/* ── GLOBAL OVERFLOW GUARD ───────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

.main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ── FORM PANEL ──────────────────────────────────────────────── */
.calc-form-panel {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 20px 16px 24px;
    border: 1px solid var(--border);
    box-sizing: border-box; width: 100%; overflow: hidden;
}
.form-section-label {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; margin-top: 4px;
}
.form-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0 18px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: .88rem; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
.label-note { font-weight: 400; color: var(--text-muted); font-size: .78rem; margin-left: 4px; }

input[type="text"], input[type="email"], select {
    width: 100%; height: 42px; padding: 0 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .95rem; font-family: 'Source Sans 3', sans-serif;
    color: var(--text); background: #fff;
    transition: border-color .2s, box-shadow .2s; outline: none;
}
input[type="text"]:focus, input[type="email"]:focus, select:focus {
    border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(44,95,138,.12);
}
input.readonly-field { background: #f0f4f8; color: var(--slate); cursor: default; }

.input-prefix-wrap, .input-suffix-wrap {
    display: flex; align-items: center;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.input-prefix-wrap:focus-within, .input-suffix-wrap:focus-within {
    border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(44,95,138,.12);
}
.prefix, .suffix {
    padding: 0 10px; background: #f0f4f8; color: var(--slate);
    font-size: .9rem; font-weight: 600; white-space: nowrap;
    height: 42px; display: flex; align-items: center;
}
.prefix { border-right: 1px solid var(--border); }
.suffix { border-left:  1px solid var(--border); }
.input-prefix-wrap input, .input-suffix-wrap input {
    border: none !important; box-shadow: none !important; border-radius: 0; flex: 1;
}
.input-dual { display: flex; gap: 8px; }
.input-dual .input-prefix-wrap { flex: 1; }
.pct-box { width: 80px; }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 32px; cursor: pointer; }
.select-wrap::after {
    content: '▾'; position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%); color: var(--slate); pointer-events: none; font-size: .8rem;
}

.calculator-wrapper {
    display: grid; grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px; margin-bottom: 48px; align-items: start;
    width: 100%; box-sizing: border-box;
}
.calc-form-panel,
.calc-results-panel { min-width: 0; }

/* Loan type tabs */
.loan-type-tabs {
    display: flex; margin-bottom: 20px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.loan-tab {
    flex: 1; text-align: center; padding: 9px 4px;
    font-size: .82rem; font-weight: 600; color: var(--slate);
    cursor: pointer; background: #fff;
    transition: background .15s, color .15s;
    border-right: 1px solid var(--border);
}
.loan-tab:last-child { border-right: none; }
.loan-tab input { display: none; }
.loan-tab:hover { background: #f0f4f8; }
.loan-tab.active { background: var(--navy); color: #fff; }

/* Gold button — shared style (#2) */
.calc-btn, .extra-calc-btn {
    width: 100%; height: 48px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #fff; border: none; border-radius: var(--radius-sm);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem; font-weight: 700; letter-spacing: .03em;
    cursor: pointer; margin-top: 24px;
    transition: transform .15s, box-shadow .15s, filter .15s;
    box-shadow: 0 3px 12px rgba(200,146,58,.35);
}
.calc-btn:hover, .extra-calc-btn:hover {
    filter: brightness(1.06); transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200,146,58,.45);
}
.calc-btn:active, .extra-calc-btn:active { transform: translateY(0); }

/* Extra button override — no full width, auto margin */
.extra-calc-btn { width: auto; margin-top: 0; padding: 0 22px; flex-shrink: 0; }

/* ── RESULTS PANEL ───────────────────────────────────────────── */
.calc-results-panel { display: flex; flex-direction: column; gap: 20px; box-sizing: border-box; width: 100%; overflow: hidden; }

/* Monthly payment card */
.monthly-payment-card {
    background: var(--navy); border-radius: var(--radius);
    padding: 24px 24px 20px; color: #fff; box-shadow: var(--shadow-lg);
    box-sizing: border-box; width: 100%; overflow: hidden;
}
.mp-label {
    font-size: .8rem; color: rgba(255,255,255,.6);
    text-transform: uppercase; letter-spacing: .07em; font-weight: 500; margin-bottom: 4px;
}
.mp-amount {
    font-family: 'Playfair Display', serif;
    font-size: 2.7rem; font-weight: 700; color: var(--gold-light); line-height: 1; margin-bottom: 2px;
}
.mp-sub { font-size: .82rem; color: rgba(255,255,255,.45); margin-bottom: 16px; }

/* Payment card header: label+amount left, export icons right */
.mp-header-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.mp-export-icons {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    padding-top: 4px;
}
.mp-export-icons img {
    width: 32px; height: 32px; cursor: pointer; opacity: .85;
    transition: opacity .15s, transform .15s;
}
.mp-export-icons img:hover { opacity: 1; transform: scale(1.1); }

/* Breakdown header row */
.mp-breakdown-header {
    display: grid; grid-template-columns: 1fr minmax(0, 90px) minmax(0, 90px);
    gap: 8px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 8px;
}
.mp-item-head { font-size: .72rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .06em; padding-left: 20px; }
.mp-col-head  { font-size: .72rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .06em; text-align: right; }

.mp-breakdown { display: flex; flex-direction: column; gap: 7px; }
.mp-row {
    display: grid; grid-template-columns: 14px minmax(0, 1fr) minmax(0, 90px) minmax(0, 90px);
    align-items: center; gap: 8px; font-size: .88rem;
}
.mp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mp-item { color: rgba(255,255,255,.8); }
.mp-mo   { font-weight: 600; color: #fff; text-align: right; }
.mp-tot  { color: rgba(255,255,255,.55); font-size: .82rem; text-align: right; }

.mp-row-total { margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); }
.mp-row-total .mp-item { color: #fff; }
.mp-row-total .mp-tot  { color: var(--gold-light); font-weight: 600; font-size: .88rem; }

/* Donut chart — interactive (#1) */
.chart-section {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 16px 20px; display: flex; align-items: center; gap: 20px;
    position: relative;
}
.chart-canvas-wrap { position: relative; flex-shrink: 0; }
#donutChart { display: block; cursor: crosshair; }
.donut-tooltip {
    position: absolute; pointer-events: none;
    background: rgba(26,46,70,.92); color: #fff;
    padding: 6px 11px; border-radius: 6px;
    font-size: .8rem; font-weight: 600; white-space: nowrap;
    transform: translate(-50%, -130%);
    opacity: 0; transition: opacity .15s;
    z-index: 10;
}
.donut-tooltip.visible { opacity: 1; }

.chart-legend { display: flex; flex-direction: column; gap: 6px; font-size: .83rem; }
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--slate); }
.legend-item span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* Summary stats */
.summary-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius-sm);
    border: 1px solid var(--border); padding: 13px 15px; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.stat-val { font-size: 1.1rem; font-weight: 700; color: var(--navy); font-family: 'Playfair Display', serif; }

/* ── EXTRA PAYMENT (#2 #3) ───────────────────────────────────── */
.extra-payment-section {
    background: #f0f5fb; border-radius: var(--radius);
    border: 1px solid var(--border); padding: 20px 22px;
}
.extra-payment-header h3 {
    font-family: 'Playfair Display', serif; font-size: 1.1rem;
    font-weight: 700; color: var(--navy); margin-bottom: 4px;
}
.extra-payment-header p { font-size: .87rem; color: var(--text-muted); margin-bottom: 14px; }

.extra-pay-form { margin-bottom: 16px; }
.extra-pay-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.extra-pay-row label { font-size: .88rem; font-weight: 600; color: var(--slate); white-space: nowrap; }
.extra-note { font-size: .78rem; color: var(--text-muted); margin-top: 8px; }

/* #3 — horizontal results table, max 2 rows */
.extra-results-table-wrap { overflow-x: auto; }
.extra-results-table {
    width: 100%; border-collapse: collapse;
    font-size: .85rem; border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border);
}
.extra-results-table th {
    background: var(--navy); color: rgba(255,255,255,.8);
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; padding: 8px 12px; text-align: center; white-space: nowrap;
}
.extra-results-table td {
    padding: 10px 12px; text-align: center; border-right: 1px solid var(--border);
    vertical-align: middle;
}
.extra-results-table td:last-child { border-right: none; }
.extra-results-table .label-row td { font-size: .75rem; color: var(--text-muted); background: #f8f9fc; font-weight: 500; }
.extra-results-table .value-row td { font-size: 1rem; font-weight: 700; background: #fff; }
.val-green  { color: #2d7a52; }
.val-blue   { color: var(--navy-mid); }
.val-gold   { color: var(--gold); }
.val-normal { color: var(--navy); }

/* ── EXPORT SECTION (#4 #5) ──────────────────────────────────── */
.export-section {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 20px 22px;
}
.export-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.export-subtitle { font-size: .86rem; color: var(--text-muted); margin-bottom: 16px; }

/* #4 — image-style clickable export tiles */
.export-tiles { display: flex; gap: 14px; flex-wrap: wrap; }
.export-tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; border-radius: var(--radius-sm);
    padding: 14px 18px; border: 1.5px solid var(--border);
    background: #fff; transition: border-color .2s, box-shadow .2s, transform .15s;
    min-width: 90px; text-decoration: none;
    user-select: none;
}
.export-tile:hover { border-color: var(--navy-mid); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.export-tile:active { transform: translateY(0); }
.export-tile svg { display: block; }
.export-tile-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tile-pdf   .export-tile-label { color: #c0392b; }
.tile-xlsx  .export-tile-label { color: #1e6e3f; }
.tile-print .export-tile-label { color: var(--navy); }

.export-note { font-size: .75rem; color: var(--text-muted); margin-top: 12px; }

/* #5 — Email popup modal */
.export-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(10,20,35,.55); z-index: 500;
    align-items: center; justify-content: center;
}
.export-modal-overlay.open { display: flex; }
.export-modal {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 32px 28px;
    width: 100%; max-width: 400px; position: relative;
    animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(-18px); opacity: 0; } to { transform: none; opacity: 1; } }
.export-modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; font-size: 1.3rem; cursor: pointer;
    color: var(--text-muted); line-height: 1;
}
.export-modal-close:hover { color: var(--navy); }
.export-modal h3 {
    font-family: 'Playfair Display', serif; font-size: 1.2rem;
    color: var(--navy); margin-bottom: 6px;
}
.export-modal-icon { font-size: 2rem; margin-bottom: 8px; }
.export-modal p { font-size: .88rem; color: var(--text-muted); margin-bottom: 16px; }
.export-modal .modal-email-wrap { display: flex; flex-direction: column; gap: 10px; }
.export-modal input[type="email"] {
    height: 44px; font-size: .95rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px;
}
.export-modal input[type="email"]:focus { border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(44,95,138,.12); }
.modal-submit-btn {
    height: 44px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #fff; border: none; border-radius: var(--radius-sm);
    font-family: 'Source Sans 3', sans-serif; font-size: .95rem; font-weight: 700;
    cursor: pointer; transition: filter .15s, transform .15s;
    box-shadow: 0 3px 10px rgba(200,146,58,.3);
}
.modal-submit-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.modal-note { font-size: .75rem; color: var(--text-muted); margin-top: 8px !important; }

/* ── AMORTIZATION ────────────────────────────────────────────── */
.amort-section {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
    padding: 32px 32px 24px; margin-bottom: 36px;
    box-sizing: border-box; width: 100%; overflow: hidden;
}
/* #1 bar chart tooltip */
.amort-chart-wrap { position: relative; margin-bottom: 24px; }
.bar-tooltip {
    position: absolute; pointer-events: none;
    background: rgba(26,46,70,.92); color: #fff;
    padding: 7px 12px; border-radius: 6px;
    font-size: .8rem; line-height: 1.5; white-space: nowrap;
    transform: translate(-50%, -110%);
    opacity: 0; transition: opacity .15s;
    z-index: 10;
}
.bar-tooltip.visible { opacity: 1; }
#amortBarChart { display: block; width: 100%; }

.amort-tabs {
    display: flex; margin-bottom: 20px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; width: fit-content;
}
.amort-tab {
    padding: 8px 28px; font-size: .88rem; font-weight: 600;
    border: none; background: #fff; color: var(--slate);
    cursor: pointer; transition: background .15s, color .15s;
    border-right: 1px solid var(--border);
    font-family: 'Source Sans 3', sans-serif;
}
.amort-tab:last-child { border-right: none; }
.amort-tab.active { background: var(--navy); color: #fff; }

.amort-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.amort-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.amort-table th {
    background: linear-gradient(to bottom, #2d4f72, var(--navy-mid));
    color: #fff; font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    padding: 10px 14px; text-align: left; white-space: nowrap;
    border-bottom: 2px solid var(--gold);
}
.amort-table td { padding: 9px 14px; border-bottom: 1px solid #eef0f4; white-space: nowrap; }
.amort-table tr:last-child td { border-bottom: none; }
.amort-table tr:hover td { background: #eef5ff; }
.yr-cell        { font-weight: 600; color: var(--navy); }
.principal-cell { color: var(--green); font-weight: 600; }
.interest-cell  { color: var(--orange); }

.balance-bar-wrap {
    background: #e8edf4; border-radius: 3px; height: 5px;
    width: 80px; display: inline-block; margin-right: 8px;
    vertical-align: middle; overflow: hidden;
}
.balance-bar { height: 100%; background: linear-gradient(90deg, var(--navy-mid), var(--gold)); border-radius: 3px; min-width: 2px; }

/* ── EDUCATIONAL ─────────────────────────────────────────────── */
.edu-section {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
    padding: 40px 36px; margin-bottom: 36px;
    box-sizing: border-box; width: 100%; overflow: hidden;
}
.edu-grid { display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start; }
.edu-main { min-width: 0; }
.edu-main h2 {
    font-family: 'Playfair Display', serif; font-size: 1.55rem; font-weight: 700;
    color: var(--navy); margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}
.edu-main h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; color: var(--navy); margin: 20px 0 7px; }
.edu-main p  { color: var(--slate); font-size: .94rem; line-height: 1.7; margin-bottom: 10px; }
.edu-main strong { color: var(--navy); }

.edu-sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card { background: #f0f5fb; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 16px 18px; }
.sidebar-card h4 {
    font-family: 'Playfair Display', serif; font-size: .97rem; font-weight: 700;
    color: var(--navy); margin-bottom: 10px; padding-bottom: 7px; border-bottom: 2px solid var(--gold);
}
.sidebar-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sidebar-card li { font-size: .83rem; color: var(--slate); line-height: 1.4; }
.sidebar-card strong { color: var(--navy); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
    display: inline-block; padding: 3px 9px;
    background: #e8f0fb; color: var(--navy-mid);
    border-radius: 20px; font-size: .73rem; font-weight: 600;
}

/* ── FAQ — #6 plain titles ───────────────────────────────────── */
.faq-section { margin-top: 32px; }
.faq-section > h2 {
    font-family: 'Playfair Display', serif; font-size: 1.55rem; font-weight: 700;
    color: var(--navy); margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}
.faq-item { margin-bottom: 20px; }
/* #6: plain h4 title instead of button */
.faq-q-title {
    font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700;
    color: var(--navy); margin-bottom: 6px;
    padding-left: 14px; border-left: 3px solid var(--gold);
}
.faq-a { padding-left: 17px; }
.faq-a p { color: var(--slate); font-size: .92rem; line-height: 1.65; }

/* ── CAR LOAN CALCULATOR — page-specific additions ───────────────────────── */

/* Deal quality indicator card */
.deal-indicator-card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 16px 20px;
}
.deal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.deal-label-text {
    font-size: .78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted);
}
.deal-badge {
    display: inline-block; padding: 3px 11px; border-radius: 20px;
    font-size: .76rem; font-weight: 700; letter-spacing: .04em;
}
.deal-excellent { background: #e8f7ee; color: #2d7a52; }
.deal-good      { background: #e8f0fb; color: #2c5f8a; }
.deal-high      { background: #fef3e2; color: #b86a0a; }

.deal-bar-track {
    height: 7px; background: #e8edf4; border-radius: 4px;
    overflow: hidden; margin-bottom: 10px;
}
.deal-bar-fill {
    height: 100%; border-radius: 4px;
    transition: width .4s ease;
}
.deal-bar-fill.deal-excellent { background: linear-gradient(90deg, #4aa06e, #2d7a52); }
.deal-bar-fill.deal-good      { background: linear-gradient(90deg, #3d7ab5, #2c5f8a); }
.deal-bar-fill.deal-high      { background: linear-gradient(90deg, #e8b469, #c8923a); }
.deal-note { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

/* Educational inline table (loan term comparison) */
.edu-table-wrap {
    overflow-x: auto; margin: 18px 0;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.edu-table {
    width: 100%; border-collapse: collapse; font-size: .87rem;
}
.edu-table th {
    background: var(--navy); color: rgba(255,255,255,.85);
    padding: 10px 14px; text-align: left; font-size: .76rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    white-space: nowrap; border-bottom: 2px solid var(--gold);
}
.edu-table td {
    padding: 9px 14px; border-bottom: 1px solid #eef0f4; color: var(--text);
    white-space: nowrap;
}
.edu-table tr:nth-child(even) td { background: #f8f9fc; }
.edu-table tr:hover td { background: #eef5ff; }
.edu-table tr:last-child td { border-bottom: none; }
.edu-table strong { color: var(--navy-mid); }
.edu-table-note {
    font-size: .75rem; color: var(--text-muted);
    padding: 8px 14px; background: #f8f9fc;
    border-top: 1px solid var(--border); margin: 0;
}

/* Sidebar link styling */
.sidebar-card a {
    color: var(--navy-mid); text-decoration: none; font-size: .83rem;
    transition: color .2s;
}
.sidebar-card a:hover { color: var(--gold); text-decoration: underline; }

/* ── PERSONAL LOAN CALCULATOR — page-specific additions ──────────────────── */

/* Active row in term comparison table */
.pl-active-row td {
    background: #eef5ff !important;
    font-weight: 600;
    border-left: 3px solid var(--gold);
}
.pl-active-row .yr-cell { color: var(--navy-mid); }

/* Consolidation savings card green left border variant */
.deal-indicator-card[style*="border-left"] .deal-label-text {
    color: var(--slate);
}

/* Effective APR stat value — highlight if differs from stated rate */
.stat-card .stat-val-warning {
    color: var(--orange);
    font-size: 1.05rem;
}

/* Purpose select spacing */
#loan_purpose { cursor: pointer; }

/* ── AMORTIZATION CALCULATOR — page-specific additions ───────────────────── */

/* Second canvas (balance curve) — reduced height via wrapper */
#balanceChart { display: block; width: 100%; }

/* Totals row in amortization table footer */
.amort-table tfoot tr td {
    padding: 10px 14px;
    border-top: 2px solid var(--gold);
    font-size: .88rem;
}

/* Loan term dual-field row */
.input-dual .input-suffix-wrap input[type="number"] {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    flex: 1;
    text-align: right;
    padding-right: 4px;
}

/* Extra column in amortization table when extra payment active */
.amort-table td[style*="color:var(--green)"] { font-weight: 600; }

/* ── INTEREST ONLY CALCULATOR — page-specific additions ─────────────────── */

/* IO vs Fully Amortizing comparison grid */
.io-compare-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}
.io-compare-col {
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 12px 14px;
}
.io-compare-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.io-compare-val {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}
.io-compare-val span {
    font-size: .75rem;
    font-weight: 400;
    color: var(--text-muted);
    font-family: 'Source Sans 3', sans-serif;
}
.io-compare-sub {
    font-size: .76rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 6px;
}
.io-compare-total {
    font-size: .78rem;
    font-weight: 600;
    color: var(--orange);
}
.io-compare-divider {
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px;
}

/* Phase badges in schedule table */
.io-phase-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.badge-io    { background: #eef5ff; color: var(--navy-mid); }
.badge-amort { background: #fef3e2; color: #b86a0a; }

/* IO phase rows — subtle left border */
.io-phase-row td:first-child {
    border-left: 3px solid var(--navy-mid);
}

@media (max-width: 600px) {
    .io-compare-grid {
        grid-template-columns: 1fr;
    }
    .io-compare-divider { padding: 0; }
}

/* ── TWO-COLUMN RESPONSIVE ───────────────────────────────────── */

/* Tablet landscape: edu sidebar narrows */
@media (max-width: 1100px) {
    .amort-section,
    .edu-section { padding: 24px 20px; }
    .edu-grid { gap: 28px; }
    .edu-main h2 { font-size: 1.3rem; }
    .edu-main h3 { font-size: 1rem; }
    .faq-section > h2 { font-size: 1.3rem; }
}

/* Tablet portrait: single column */
@media (max-width: 860px) {
    .calculator-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }
    .calc-form-panel,
    .calc-results-panel { grid-column: 1; }
    .edu-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .edu-sidebar {
        position: static;
        display: grid; grid-template-columns: repeat(2, 1fr);
    }
    .amort-section,
    .edu-section { padding: 20px 14px; }
    .summary-stats { grid-template-columns: 1fr; }
    .chart-section { flex-direction: column; align-items: flex-start; }
    .mp-amount { font-size: 2rem; }
    .mp-breakdown-header,
    .mp-row { grid-template-columns: 14px minmax(0,1fr) minmax(0,70px); }
    .mp-breakdown-header { grid-template-columns: 1fr minmax(0,70px); }
    .mp-col-head:last-child,
    .mp-tot { display: none; }
    .edu-main h2 { font-size: 1.2rem; }
    .edu-main h3 { font-size: .97rem; }
    .faq-section > h2 { font-size: 1.2rem; }
    .faq-q-title { font-size: .92rem; }
    .faq-a { padding-left: 10px; }
}

/* Mobile */
@media (max-width: 480px) {
    .amort-section,
    .edu-section { padding: 16px 10px; }
    .calc-form-panel { padding: 14px 10px 18px; }
    .loan-type-tabs { flex-wrap: wrap; }
    .loan-tab { flex: 1 0 40%; }
    .export-modal { padding: 24px 16px; }
    .amort-tabs { width: 100%; }
    .amort-tab { flex: 1; padding: 8px 10px; font-size: .8rem; }
    .edu-sidebar { grid-template-columns: 1fr; }
    .edu-main h2 { font-size: 1.1rem; }
    .edu-main h3 { font-size: .92rem; }
    .faq-section > h2 { font-size: 1.1rem; }
    .faq-a p { font-size: .87rem; }
}

