/* Smart Finance Calculators — Stripe/Linear Design System */

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --accent: #2563eb;
    --accent-light: #93c5fd;
    --cta-bg: #2563eb;
    --cta-hover: #1d4ed8;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --white: #ffffff;
    --danger: #ef4444;
    --success: #10b981;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 100px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
    --max-width: 980px;
    --transition: 200ms ease;
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--slate-800);
    background: var(--white);
    line-height: 1.75;
    font-size: 17px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul, ol { padding-left: 1.25em; }

/* ── HEADER ── */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--slate-100);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.site-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--slate-900);
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: -.02em;
}
.site-logo:hover { color: var(--primary); }
.site-logo svg { width: 22px; height: 22px; color: var(--primary); }

/* Nav */
.site-nav { display: flex; align-items: center; gap: .125rem; }
.site-nav a {
    padding: .5rem .875rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--slate-500);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
}
.site-nav a:hover { color: var(--slate-900); }
.site-nav a.active { color: var(--primary); background: var(--primary-50); }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: .5rem;
    cursor: pointer;
    color: var(--slate-600);
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ── HERO (homepage) ── */
.hero {
    background: var(--white);
    color: var(--slate-900);
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--slate-100);
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--slate-900);
}
.hero p {
    font-size: 1.1rem;
    color: var(--slate-500);
    max-width: 480px;
    margin: 0 auto;
    font-weight: 400;
}

/* ── PAGE HEADER (non-homepage) ── */
.page-header {
    background: var(--white);
    border-bottom: 1px solid var(--slate-100);
    padding: 2.5rem 1.5rem 2rem;
}
.page-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-bottom: .375rem;
}
.page-header .subtitle {
    color: var(--slate-400);
    font-size: 1.05rem;
    font-weight: 400;
}

/* ── BREADCRUMB ── */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: .75rem 1.5rem;
    font-size: .8rem;
    color: var(--slate-400);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
}
.breadcrumb a { color: var(--slate-400); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--slate-300); }

/* ── MAIN CONTENT ── */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* Card/section */
.card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 1rem;
    letter-spacing: -.01em;
}
.card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--slate-800);
    margin: 1.25rem 0 .5rem;
}
.card p { margin-bottom: .75rem; color: var(--slate-600); }
.card ul, .card ol { margin-bottom: .75rem; color: var(--slate-600); }
.card li { margin-bottom: .35rem; }
.card strong { color: var(--slate-800); }

/* ── CALCULATOR ── */
.calc-container {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.calc-container h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: 1.5rem;
}
.calc-form { display: flex; flex-direction: column; gap: 1.5rem; }
.calc-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--slate-500);
    margin-bottom: .375rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.calc-field input[type="text"],
.calc-field input[type="number"] {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--slate-800);
    background: var(--white);
    transition: border-color var(--transition);
}
.calc-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.calc-field input[type="range"] {
    width: 100%;
    margin-top: .5rem;
    -webkit-appearance: none;
    height: 4px;
    background: var(--slate-200);
    border-radius: 2px;
    outline: none;
}
.calc-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.calc-field input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.calc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--primary);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    padding: .875rem 1.75rem;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    width: 100%;
}
.calc-btn:hover { background: var(--primary-dark); }
.calc-btn:active { transform: scale(.98); }
.calc-btn svg { width: 18px; height: 18px; }

/* Results */
.calc-results {
    display: none;
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.calc-results.visible { display: block; }
.calc-results .result-hero {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--primary-100);
    margin-bottom: 1.25rem;
}
.calc-results .result-hero .label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .375rem;
}
.calc-results .result-hero .value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -.03em;
    line-height: 1;
}
.calc-results .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.calc-results .result-item { padding: .5rem 0; }
.calc-results .result-item .label {
    font-size: .75rem;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.calc-results .result-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--slate-800);
}

/* ── CHART ── */
.chart-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--primary-100);
}
.chart-container canvas {
    width: 100%;
    height: 320px;
    display: block;
}
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--slate-600);
}
.chart-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── BREAKDOWN TABLE ── */
.breakdown-output {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.breakdown-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--slate-100);
    border-radius: var(--radius);
}
.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}
.breakdown-table th {
    background: var(--slate-900);
    color: var(--white);
    padding: .625rem .75rem;
    text-align: right;
    font-weight: 600;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    position: sticky;
    top: 0;
}
.breakdown-table th:first-child { text-align: center; }
.breakdown-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--slate-100);
    text-align: right;
}
.breakdown-table td:first-child { text-align: center; color: var(--slate-400); }
.breakdown-table tr:nth-child(even) { background: var(--slate-50); }
.breakdown-table .highlight-cell {
    font-weight: 700;
    color: var(--primary);
}

/* CSV export button */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    background: var(--white);
    color: var(--slate-600);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-pill);
    font-size: .85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-export:hover { border-color: var(--primary); color: var(--primary); }
.btn-export svg { width: 16px; height: 16px; }

/* ── CALCULATOR LISTING (homepage) ── */
.calc-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.calc-listing-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--slate-600);
}
.calc-listing-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--slate-600);
}
.calc-listing-silo {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
    margin-bottom: .5rem;
}
.calc-listing-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: .5rem;
    line-height: 1.3;
}
.calc-listing-card p {
    font-size: .85rem;
    color: var(--slate-400);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.calc-listing-link {
    display: inline-block;
    margin-top: .75rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
}

/* ── FAQ (native details/summary) ── */
.faq-section { margin-bottom: 1.5rem; }
.faq-item {
    border-bottom: 1px solid var(--slate-100);
    padding: 1.125rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
    font-size: .95rem;
    font-weight: 600;
    color: var(--slate-800);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--slate-300);
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform var(--transition);
}
.faq-item[open] > .faq-question::after { content: '\2212'; color: var(--primary); }
.faq-item .faq-answer {
    padding-top: .5rem;
    font-size: .9rem;
    color: var(--slate-500);
    line-height: 1.7;
}

/* ── ADSENSE SLOT ── */
.adsense-slot {
    margin: 2rem 0;
    text-align: center;
    min-height: 100px;
}

/* ── AFFILIATE CTA ── */
.affiliate-cta {
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.affiliate-cta .cta-text {
    font-weight: 600;
    color: var(--slate-800);
    font-size: .95rem;
}
.affiliate-cta .cta-text small {
    display: block;
    font-weight: 400;
    font-size: .8rem;
    color: var(--slate-500);
    margin-top: .25rem;
}
.affiliate-cta .cta-button {
    background: var(--primary);
    color: var(--white);
    padding: .625rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    transition: background var(--transition);
}
.affiliate-cta .cta-button:hover { background: var(--primary-dark); color: var(--white); }

.affiliate-cta-full {
    background: var(--slate-900);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--white);
}
.affiliate-cta-full h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--white);
}
.affiliate-cta-full p {
    font-size: .95rem;
    opacity: .7;
    margin-bottom: 1.25rem;
    color: var(--white);
}
.affiliate-cta-full .cta-button {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: .875rem 2.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    transition: background var(--transition);
}
.affiliate-cta-full .cta-button:hover { background: var(--primary-light); color: var(--white); }

/* ── FOOTER ── */
.site-footer {
    background: var(--slate-900);
    color: var(--slate-400);
    padding: 2.5rem 1.5rem;
    margin-top: 2rem;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2rem;
}
@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr repeat(6, 1fr);
    }
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}
.footer-brand {
    font-weight: 700;
    font-size: .95rem;
    color: var(--white);
    margin-bottom: .25rem;
}
.footer-copy { font-size: .8rem; color: var(--slate-500); }
.footer-heading {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--slate-500);
    margin-bottom: .25rem;
}
.footer-col a {
    color: var(--slate-400);
    font-size: .85rem;
    transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    body { font-size: 16px; }
    .header-inner { height: 56px; padding: 0 1rem; }
    .site-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--slate-100);
        flex-direction: column;
        padding: .5rem;
        box-shadow: var(--shadow-lg);
    }
    .site-nav.open { display: flex; }
    .nav-toggle { display: flex; }

    .hero { padding: 2.5rem 1rem 1.5rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: .95rem; }
    .page-header { padding: 2rem 1rem 1.5rem; }
    .page-header h1 { font-size: 1.5rem; }
    .main { padding: 1.5rem 1rem 2.5rem; }

    .calc-results .result-hero .value { font-size: 2.25rem; }
    .calc-results .result-grid { grid-template-columns: 1fr; }

    .calc-listing { grid-template-columns: 1fr; }

    .affiliate-cta { flex-direction: column; text-align: center; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .footer-col:first-child { grid-column: 1 / -1; text-align: center; }

    .chart-container canvas { height: 240px; }
}

/* ── SIDE ADS (desktop only) ── */
.side-ad {
    display: none;
}
@media (min-width: 1200px) {
    .side-ad {
        display: block;
        position: fixed;
        top: 80px;
        z-index: 10;
        width: 160px;
    }
    .side-ad-left {
        left: calc((100vw - var(--max-width)) / 2 - 160px - 24px);
    }
    .side-ad-right {
        right: calc((100vw - var(--max-width)) / 2 - 160px - 24px);
    }
    .side-ad-sticky {
        position: sticky;
        top: 80px;
    }
}
@media (min-width: 1200px) and (max-width: 1339px) {
    .side-ad-left { left: 8px; }
    .side-ad-right { right: 8px; }
}

/* ── COOKIE BANNER ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--slate-900);
    color: var(--slate-300);
    z-index: 9999;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--slate-700);
}
.cookie-banner-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-banner-inner p {
    flex: 1;
    min-width: 280px;
    font-size: .85rem;
    line-height: 1.5;
    margin: 0;
}
.cookie-banner-inner a { color: var(--primary-light); }
.cookie-banner-actions {
    display: flex;
    gap: .75rem;
    flex-shrink: 0;
}
.cookie-banner .btn {
    padding: .5rem 1.25rem;
    font-size: .85rem;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
}
.cookie-banner .btn-primary {
    background: var(--primary);
    color: var(--white);
}
.cookie-banner .btn-primary:hover { background: var(--primary-dark); }
.cookie-banner .btn-secondary {
    background: transparent;
    color: var(--slate-400);
    border: 1px solid var(--slate-600);
}
.cookie-banner .btn-secondary:hover {
    color: var(--white);
    border-color: var(--slate-400);
}

/* ── CALCULATOR TABS ── */
.calc-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: var(--slate-50);
    border-radius: var(--radius-pill);
    padding: 4px;
    border: 1px solid var(--slate-200);
}
.calc-tab {
    flex: 1;
    padding: .625rem 1rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--slate-500);
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-family: inherit;
}
.calc-tab:hover { color: var(--slate-700); }
.calc-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ── COMPARE MODE ── */
.calc-compare {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: .5rem;
}
.calc-compare .scenario {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.calc-compare .scenario h4 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
}
.compare-results {
    display: none;
    margin-top: 1.5rem;
}
.compare-results.visible { display: block; }
.compare-table .diff-positive {
    color: var(--success);
    font-weight: 700;
    font-size: .85rem;
}
.compare-table .diff-negative {
    color: var(--danger);
    font-weight: 600;
    font-size: .85rem;
}

/* ── PIE CHART ── */
.pie-chart-wrap {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--primary-100);
    justify-content: center;
}
.pie-legend {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.pie-legend-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--slate-600);
}

/* ── MILESTONES GRID ── */
.milestones-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--primary-100);
}
.milestone-item {
    text-align: center;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
}
.milestone-pct {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: .25rem;
}
.milestone-time {
    font-size: .8rem;
    color: var(--slate-500);
    font-weight: 600;
}

/* ── PROGRESS BAR ── */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--slate-200);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 1.25rem;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* ── PAYMENT BREAKDOWN ── */
.payment-breakdown {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--primary-100);
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: .625rem 0;
    font-size: .9rem;
    color: var(--slate-600);
    border-bottom: 1px solid var(--slate-100);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row.total {
    font-weight: 700;
    color: var(--slate-800);
    border-top: 2px solid var(--slate-200);
    margin-top: .25rem;
    padding-top: .75rem;
}

/* ── SAVE TIP ── */
.save-extra-tip {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    font-size: .9rem;
    color: #065f46;
    font-weight: 600;
}
.save-extra-tip:empty { display: none; }

/* ── AMORTIZATION OUTPUT ── */
.amort-output {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

/* ── DROPDOWN NAV ── */
.nav-dropdown {
    position: relative;
}
.nav-dropdown > .nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .5rem .875rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--slate-500);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.nav-dropdown > .nav-dropdown-trigger:hover { color: var(--slate-900); }
.nav-dropdown > .nav-dropdown-trigger::after {
    content: '';
    border: 4px solid transparent;
    border-top-color: currentColor;
    margin-top: 2px;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .5rem;
    z-index: 200;
}
.nav-dropdown:hover > .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: .5rem .75rem;
    font-size: .85rem;
    color: var(--slate-600);
    border-radius: 8px;
    transition: all var(--transition);
}
.nav-dropdown-menu a:hover {
    background: var(--primary-50);
    color: var(--primary);
}

/* ── SILO SECTION (homepage) ── */
.silo-section {
    margin-bottom: 2rem;
}
.silo-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* ── RESPONSIVE additions ── */
@media (max-width: 768px) {
    .calc-tabs { flex-direction: column; border-radius: var(--radius); }
    .calc-tab { border-radius: 8px; }
    .calc-compare { grid-template-columns: 1fr; }
    .milestones-grid { grid-template-columns: repeat(2, 1fr); }
    .pie-chart-wrap { flex-direction: column; }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 1rem;
    }
    .nav-dropdown:hover > .nav-dropdown-menu { display: block; }
}

/* ── BLOG ── */
.blog-categories {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.blog-cat-tag {
    display: inline-block;
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--slate-500);
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
}
.blog-cat-tag:hover { border-color: var(--primary); color: var(--primary); }
.blog-cat-tag.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
    color: var(--slate-600);
}
.blog-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.blog-card-cat {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
    margin-bottom: .5rem;
}
.blog-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: .5rem;
    line-height: 1.3;
}
.blog-card p {
    font-size: .85rem;
    color: var(--slate-400);
    flex: 1;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-meta {
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--slate-400);
}
.blog-article-cat {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
    margin-bottom: .5rem;
}
.blog-article-meta {
    font-size: .9rem;
    color: var(--slate-400);
    margin-top: .25rem;
}
.blog-article .card { margin-bottom: 1.5rem; }
.blog-article .card h2 { font-size: 1.3rem; }
.blog-article .card p { margin-bottom: .75rem; }

@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
}

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-small { font-size: .85rem; color: var(--slate-400); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ── Email Results Button & Group ── */
.btn-export-group {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.btn-email {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
.btn-email:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}
.btn-email svg { stroke: #fff; }
.email-results-inline {
    margin-top: 1rem;
    text-align: right;
}

/* ── Email Modal ── */
.email-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.email-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
}
.email-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
    animation: emailModalIn .25s ease-out;
}
@keyframes emailModalIn {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.email-modal-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--slate-400);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background .15s;
}
.email-modal-close:hover { background: var(--slate-50); color: var(--slate-700); }
.email-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.email-modal-header h3 {
    margin: .75rem 0 .25rem;
    font-size: 1.25rem;
    color: var(--slate-900);
}
.email-modal-header p {
    margin: 0;
    font-size: .875rem;
    color: var(--slate-500);
}
.email-modal-field {
    margin-bottom: 1rem;
}
.email-modal-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: .35rem;
}
.email-modal-field input[type="email"] {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    box-sizing: border-box;
}
.email-modal-field input[type="email"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.email-modal-error {
    display: block;
    color: #dc2626;
    font-size: .8rem;
    margin-top: .35rem;
    min-height: 1.1em;
}
.email-modal-consent {
    margin-bottom: 1.25rem;
}
.email-modal-consent label {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .8rem;
    color: var(--slate-500);
    cursor: pointer;
    line-height: 1.4;
}
.email-modal-consent input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.email-modal-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .8rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}
.email-modal-submit:hover { background: #1d4ed8; }
.email-modal-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.email-modal-success {
    text-align: center;
    padding: 1rem 0;
}
.email-modal-success h4 {
    margin: 1rem 0 .25rem;
    font-size: 1.2rem;
    color: var(--slate-900);
}
.email-modal-success p {
    margin: 0 0 1.25rem;
    font-size: .9rem;
    color: var(--slate-500);
}
.email-modal-close-btn {
    padding: .6rem 1.5rem;
    background: var(--slate-100);
    color: var(--slate-700);
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.email-modal-close-btn:hover { background: var(--slate-200); }

@media (max-width: 768px) {
    .email-modal-dialog { padding: 1.5rem; }
    .btn-export-group { flex-direction: column; }
}
