* { margin: 0; padding: 0; box-sizing: border-box; }
        :root {
            --ink: #14152B; --ink-2: #1D1F3D;
            --paper: #F7F5F0; --paper-raised: #FFFFFF;
            --saffron: #F2A93C; --saffron-deep: #D98A22;
            --teal: #2F9E8F; --teal-deep: #24796D;
            --line: rgba(20, 21, 43, 0.10);
            --cream-text: #F4F2EC;
            --display: 'Bricolage Grotesque', system-ui, sans-serif;
            --body: 'Manrope', -apple-system, sans-serif;
            --radius-lg: 22px; --radius-md: 14px; --radius-sm: 8px;
            --text: #14152B; --text-soft: #52546E;
            --header-bg-solid: rgba(247, 245, 240, 0.96);
            --contrast-bg: #14152B; --contrast-fg: #F4F2EC;
            --link: #24796D; --chip-bg: #F1EEE6;
            --track: #E4E0D6;
            --shadow-card: 0 1px 2px rgba(20,21,43,0.04), 0 10px 28px rgba(20,21,43,0.06);
        }
        @media (prefers-color-scheme: dark) {
            :root {
                --paper: #0F1122; --paper-raised: #181A31;
                --text: #ECEAE3; --text-soft: #A4A6C0;
                --line: rgba(255, 255, 255, 0.09);
                --header-bg-solid: rgba(15, 17, 34, 0.95);
                --contrast-bg: #F2A93C; --contrast-fg: #14152B;
                --link: #5FCBBB; --chip-bg: #232643; --track: #2A2D4D;
                --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 10px 28px rgba(0,0,0,0.25);
                color-scheme: dark;
            }
        }
        html { scroll-behavior: smooth; }
        body { font-family: var(--body); line-height: 1.6; color: var(--text); background: var(--paper); font-size: 16px; }
        h1, h2, h3 { font-family: var(--display); color: var(--text); }
        a { color: inherit; }
        .container { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }
        :focus-visible { outline: 2px solid var(--saffron-deep); outline-offset: 3px; border-radius: 4px; }

        header { background: var(--header-bg-solid); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
        header nav { max-width: 1080px; margin: 0 auto; padding: 1.1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
        .brand { text-decoration: none; }
        .brand-mark { font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: var(--text); }
        .back-link { font-size: 0.9rem; font-weight: 600; color: var(--text-soft); text-decoration: none; }
        .back-link:hover { color: var(--text); }
        .crumb { font-size: 0.75rem; font-weight: 600; color: var(--text-soft); padding: 1.4rem 0 0; }
        .crumb a { text-decoration: none; color: var(--link); }

        .page-hero { padding: 1.6rem 0 1.8rem; }
        .page-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 0.6rem; }
        .page-hero p { color: var(--text-soft); font-size: 1.05rem; max-width: 42rem; }

        /* Tabs */
        .tabs { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.8rem; scrollbar-width: thin; }
        .tab { flex-shrink: 0; font: 700 0.9rem var(--body); padding: 0.6rem 1.1rem; border-radius: 30px; border: 1.5px solid var(--line);
               background: var(--paper-raised); color: var(--text-soft); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
        .tab:hover { color: var(--text); border-color: var(--text-soft); }
        .tab[aria-selected="true"] { background: var(--contrast-bg); color: var(--contrast-fg); border-color: var(--contrast-bg); }

        /* Calculator card */
        .calc { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1.4rem; margin-top: 0.6rem; }
        .card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 1.7rem; }
        .card h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.25rem; }
        .card .sub { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 1.4rem; }

        .field { margin-bottom: 1.35rem; }
        .field-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.55rem; }
        .field label { font-weight: 700; font-size: 0.92rem; }
        .num-wrap { display: flex; align-items: center; background: var(--chip-bg); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 0.3rem 0.6rem; transition: border-color .2s; }
        .num-wrap:focus-within { border-color: var(--teal); }
        .num-wrap .u { font-weight: 700; color: var(--text-soft); font-size: 0.85rem; }
        .num-wrap input { width: 7.5rem; border: 0; background: transparent; font: 700 0.98rem var(--body); color: var(--text); text-align: right; outline: none; padding: 0.1rem 0.25rem; -moz-appearance: textfield; }
        .num-wrap input::-webkit-outer-spin-button, .num-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .hint { font-size: 0.78rem; color: var(--text-soft); margin-top: 0.3rem; }
        select.sel { font: 700 0.92rem var(--body); color: var(--text); background: var(--chip-bg); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 0.45rem 0.6rem; cursor: pointer; }
        select.sel:focus { border-color: var(--teal); outline: none; }

        input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--track); outline: none; cursor: pointer;
            background-image: linear-gradient(var(--teal), var(--teal)); background-repeat: no-repeat; background-size: var(--fill, 50%) 100%; }
        input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--paper-raised); border: 3px solid var(--teal); box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
        input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--paper-raised); border: 3px solid var(--teal); }
        input[type=range]:focus-visible { outline: 2px solid var(--saffron-deep); outline-offset: 6px; }

        /* Results */
        .result-card { display: flex; flex-direction: column; }
        .headline { background: var(--contrast-bg); color: var(--contrast-fg); border-radius: var(--radius-md); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; }
        .headline .lbl { font-size: 0.82rem; font-weight: 700; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; }
        .headline .val { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.01em; }
        .headline .words { font-size: 0.85rem; font-weight: 600; opacity: 0.8; }
        .result-body { display: grid; grid-template-columns: 1fr 150px; gap: 1rem; align-items: center; }
        .breakdown { list-style: none; }
        .breakdown li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); font-size: 0.93rem; }
        .breakdown li:last-child { border-bottom: 0; }
        .breakdown .k { color: var(--text-soft); display: flex; align-items: center; gap: 0.45rem; }
        .breakdown .v { font-weight: 700; text-align: right; }
        .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
        .donut { width: 150px; height: 150px; }
        .donut text { font-family: var(--body); fill: var(--text); }
        .disclaimer { font-size: 0.76rem; color: var(--text-soft); margin-top: auto; padding-top: 1rem; }

        /* Chart + table */
        .detail { margin-top: 1.4rem; }
        .detail-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
        .legend { display: flex; gap: 1rem; font-size: 0.82rem; color: var(--text-soft); font-weight: 600; }
        .legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
        .chart-wrap { width: 100%; overflow-x: auto; }
        .chart-wrap svg { width: 100%; height: auto; display: block; }
        .chart-wrap text { font-family: var(--body); font-size: 11px; fill: var(--text-soft); }
        .bar { transition: opacity .15s; }
        .bar:hover { opacity: 0.75; }
        details.sched { margin-top: 1.2rem; }
        details.sched summary { cursor: pointer; font-weight: 700; color: var(--link); font-size: 0.95rem; list-style: none; }
        details.sched summary::-webkit-details-marker { display: none; }
        details.sched summary::before { content: '▸ '; }
        details.sched[open] summary::before { content: '▾ '; }
        .table-wrap { overflow-x: auto; margin-top: 0.9rem; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
        table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
        th, td { padding: 0.55rem 0.8rem; text-align: right; white-space: nowrap; }
        th:first-child, td:first-child { text-align: left; }
        thead th { position: sticky; top: 0; background: var(--chip-bg); font-weight: 700; z-index: 1; }
        tbody tr:nth-child(even) { background: color-mix(in srgb, var(--chip-bg) 45%, transparent); }

        /* App CTA */
        .app-cta { margin-top: 2.6rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1.3rem; align-items: center; background: var(--ink-2); color: var(--cream-text); border-radius: var(--radius-lg); padding: 1.5rem 1.7rem; }
        .app-cta img { width: 64px; height: 64px; border-radius: 16px; }
        .app-cta h3 { color: var(--cream-text); font-size: 1.15rem; font-weight: 800; }
        .app-cta p { color: #C7C8DA; font-size: 0.92rem; }
        .btn { padding: 0.85rem 1.5rem; border-radius: 30px; font-weight: 700; font-size: 0.93rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; transition: transform .2s, box-shadow .2s; }
        .btn-primary { background: var(--saffron); color: var(--ink); }
        .btn-primary:hover { background: #FFC069; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(242,169,60,0.28); }

        .section { padding: 2.4rem 0; border-top: 1px solid var(--line); margin-top: 2.6rem; }
        .section h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.2rem; }
        .faq-item { margin-bottom: 1.3rem; }
        .faq-item h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 0.35rem; }
        .faq-item p { color: var(--text-soft); font-size: 0.95rem; max-width: 46rem; }
        .faq-item code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.86rem; background: var(--chip-bg); padding: 0.1rem 0.35rem; border-radius: 4px; }

        footer { background: var(--ink-2); color: var(--cream-text); padding: 2.6rem 0 2rem; margin-top: 2rem; }
        .footer-content { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }
        .footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
        .footer-links a { color: #C7C8DA; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
        .footer-links a:hover { color: var(--saffron); }
        .footer-bottom { color: #7C7EA0; font-size: 0.8rem; }

        @media (max-width: 860px) {
            .calc { grid-template-columns: 1fr; }
        }
        @media (max-width: 560px) {
            .container, header nav, .footer-content { padding-left: 1.1rem; padding-right: 1.1rem; }
            .card { padding: 1.25rem; }
            .result-body { grid-template-columns: 1fr; justify-items: center; }
            .breakdown { width: 100%; }
            .num-wrap input { width: 6.2rem; }
            .app-cta { grid-template-columns: 1fr; text-align: left; }
        }
        @media (prefers-reduced-motion: no-preference) {
            .calc .card { animation: fade-up .5s ease both; }
            .calc .card + .card { animation-delay: .06s; }
            @keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
        }
    
        /* ---------- multi-page additions ---------- */
        a.tab { text-decoration: none; display: inline-flex; align-items: center; }
        a.tab[aria-current="page"] { background: var(--contrast-bg); color: var(--contrast-fg); border-color: var(--contrast-bg); }
        a.tab.all { border-style: dashed; }
        .content { margin-top: 2.6rem; }
        .content .block { padding: 2.2rem 0; border-top: 1px solid var(--line); }
        .content h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; }
        .content p, .content li { color: var(--text-soft); font-size: 1rem; max-width: 46rem; }
        .content p + p { margin-top: 0.8rem; }
        .content ol { padding-left: 1.3rem; display: grid; gap: 0.5rem; }
        .content strong { color: var(--text); }
        .formula { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.95rem; background: var(--paper-raised); border: 1px solid var(--line);
                   border-left: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin: 0.9rem 0; color: var(--text); overflow-x: auto; }
        .example { background: var(--chip-bg); border-radius: var(--radius-md); padding: 1rem 1.2rem; margin-top: 1rem; max-width: 46rem; }
        .example p { color: var(--text); font-size: 0.95rem; }
        .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; }
        .ccard { display: flex; gap: 0.9rem; align-items: flex-start; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
                 padding: 1.1rem 1.15rem; text-decoration: none; box-shadow: var(--shadow-card); transition: transform .2s, border-color .2s; }
        .ccard:hover { transform: translateY(-3px); border-color: var(--teal); }
        .ccard .mark { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--display);
                       font-weight: 800; font-size: 0.95rem; background: var(--contrast-bg); color: var(--contrast-fg); }
        .ccard strong { display: block; font-size: 1rem; line-height: 1.3; margin-bottom: 0.2rem; }
        .ccard span { display: block; font-size: 0.85rem; color: var(--text-soft); line-height: 1.45; }
        .cards.big .ccard { padding: 1.4rem; }
