.rsam-calc-wrap {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 30px;
    font-family: "Segoe UI", system-ui, sans-serif;
    box-sizing: border-box;
}

.rsam-calc-head {
    text-align: center;
    margin-bottom: 22px;
}

.rsam-calc-head h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
}

.rsam-calc-head p {
    margin: 0;
    font-size: 15px;
    color: #555;
}

.rsam-calc-box {
    background: #ffffff;
    border-radius: 18px;
    border-top: 5px solid #ff3232;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .09);
    padding: 26px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    align-items: stretch;
}

.rsam-calc-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsam-calc-top-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.rsam-fieldset {
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px 10px;
    background: #fff;
    transition: border-color .2s ease;
}

.rsam-fieldset:focus-within {
    border-color: #ff3232;
}

.rsam-fieldset-label {
    position: absolute;
    top: -9px;
    left: 12px;
    background: #fff;
    padding: 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
}

.rsam-fieldset input,
.rsam-fieldset select {
    width: 100%;
    border: 0;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    padding: 2px 0;
}

.rsam-fieldset select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 16px 16px;
}

.rsam-fieldset:focus-within select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ff3232' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.rsam-semester-card {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
}

.rsam-semester-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.rsam-semester-info span {
    font-size: 13px;
    color: #475569;
    line-height: 1.25;
}

.rsam-semester-info strong {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}

.rsam-segments {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.rsam-seg {
    height: 7px;
    border-radius: 99px;
    background: #e2e8f0;
    transition: background .25s ease;
}

.rsam-seg.is-filled {
    background: #10b981;
}

.rsam-pill-group-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}

.rsam-pill-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.rsam-pill-btn {
    border: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
}

.rsam-pill-btn.is-active {
    background: #10b981;
    color: #fff;
}

.rsam-calc-right {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.rsam-res-title {
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 10px;
}

.rsam-res-amount {
    font-size: 42px;
    font-weight: 800;
    color: #10b981;
    line-height: 1.1;
    margin-bottom: 16px;
    word-break: break-word;
}

.rsam-res-breakdown {
    width: 100%;
    border-top: 1px dashed #cbd5e1;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.rsam-res-line {
    display: flex;
    justify-content: space-between;
}

.rsam-res-copy {
    margin-top: 14px;
    background: #1a1a1a;
    color: #fff;
    border: 0;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.rsam-more-tools {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.rsam-more-tools h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.rsam-more-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rsam-more-links a {
    display: inline-block;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s ease;
}

.rsam-more-links a:hover {
    border-color: #ff3232;
    color: #ff3232;
}

@media (max-width: 768px) {
    .rsam-calc-box {
        grid-template-columns: 1fr;
        padding: 18px;
    }
    .rsam-calc-top-inputs {
        grid-template-columns: 1fr;
    }
    .rsam-res-amount {
        font-size: 36px;
    }
}

/* Vitrina / Acceso directo [rsam_calculadoras] */
.rsam-calc-hub {
    background: #1a1a1a;
    color: #fff;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 25px 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .45);
    font-family: "Segoe UI", system-ui, sans-serif;
    box-sizing: border-box;
}

.rsam-calc-hub-head {
    margin-bottom: 18px;
}

.rsam-calc-hub-head h3 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.rsam-calc-hub-head p {
    margin: 0;
    font-size: 13.5px;
    color: #bbb;
}

.rsam-calc-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.rsam-calc-hub-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    padding: 18px 16px;
    text-decoration: none;
    color: #fff;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.rsam-calc-hub-item:hover {
    transform: translateY(-3px);
    border-color: #ff3232;
    background: rgba(255, 50, 50, .1);
    color: #fff;
}

.rsam-calc-hub-tag {
    display: inline-block;
    align-self: flex-start;
    background: rgba(255, 50, 50, .2);
    color: #ff6b6b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 3px 9px;
    border-radius: 99px;
    margin-bottom: 10px;
}

.rsam-calc-hub-item strong {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    display: block;
}

.rsam-calc-hub-item small {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.4;
    margin-bottom: 14px;
    display: block;
}

.rsam-calc-hub-cta {
    font-size: 13px;
    font-weight: 700;
    color: #ff3232;
}

@media (max-width: 720px) {
    .rsam-calc-hub {
        padding: 18px 15px;
    }
    .rsam-calc-hub-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Vitrina 2x2 para 4 calculadoras */
.rsam-calc-hub-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Estilos específicos Calculadora IGV y Detracciones SUNAT */
.rsam-tc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rsam-tc-row .rsam-fieldset {
    flex: 1;
    min-width: 150px;
}

.rsam-tc-date {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
}

.rsam-tc-link {
    display: inline-block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #ff3232;
    text-decoration: underline;
}

.rsam-radio-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rsam-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s ease, background .2s ease;
}

.rsam-radio-card.is-selected {
    border-color: #ff3232;
    background: #fff5f5;
}

.rsam-radio-card input[type="radio"] {
    margin-top: 3px;
    accent-color: #ff3232;
    width: 16px;
    height: 16px;
}

.rsam-radio-card strong {
    display: block;
    font-size: 13.5px;
    color: #1e293b;
}

.rsam-radio-card small {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.rsam-detrac-panel {
    width: 100%;
    text-align: left;
}

.rsam-detrac-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.rsam-detrac-status span:first-child {
    font-size: 14px;
    font-weight: 800;
    color: #10b981;
}

.rsam-detrac-status.is-exempt span:first-child {
    color: #d97706;
}

.rsam-detrac-badge-pct {
    background: #fee2e2;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 99px;
}

.rsam-detrac-table {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.rsam-detrac-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    padding-bottom: 7px;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

.rsam-detrac-row:last-child {
    border-bottom: 0;
}

.rsam-detrac-row-label {
    font-weight: 700;
    color: #334155;
}

.rsam-detrac-row-vals {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rsam-val-main {
    font-weight: 800;
    color: #0f172a;
}

.rsam-val-main.is-igv { color: #2563eb; }
.rsam-val-main.is-total { color: #10b981; }
.rsam-val-main.is-detrac { color: #ea580c; }
.rsam-val-main.is-neto { color: #16a34a; font-size: 15px; }

.rsam-val-pen {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.rsam-steps-box {
    margin-top: 18px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 14px;
    padding: 18px;
}

.rsam-steps-box h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #0369a1;
    text-align: center;
}

.rsam-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e0f2fe;
    border-radius: 10px;
    padding: 11px 14px;
    margin-bottom: 8px;
}

.rsam-step-item:last-child {
    margin-bottom: 0;
}

.rsam-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff3232;
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.rsam-step-item strong {
    display: block;
    font-size: 13.5px;
    color: #0f172a;
    margin-bottom: 2px;
}

.rsam-step-item span {
    font-size: 12.5px;
    color: #475569;
}

.rsam-detrac-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.rsam-btn-clear {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.rsam-btn-copy-primary {
    background: #ff3232;
    border: 0;
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 720px) {
    .rsam-calc-hub-grid {
        grid-template-columns: 1fr;
    }
}