

        /* ── Reset & base ── */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
            background: #f6f9fc;
            color: #1a2634;
            line-height: 1.6;
            padding: 20px 16px 60px;
        }
        .container {
            max-width: 820px;
            margin: 0 auto;
        }

        /* ── Focus styles ── */
        :focus-visible {
            outline: 2px solid #1a6b8f;
            outline-offset: 2px;
        }
        .input-field:focus-visible {
            outline: 2px solid #1a6b8f;
            outline-offset: 0px;
        }
        .tab-btn:focus-visible,
        .btn-secondary:focus-visible {
            outline: 2px solid #1a6b8f;
            outline-offset: 2px;
        }

        /* ── Header ── */
        .page-header {
            margin-bottom: 24px;
        }
        .page-header h1 {
            font-size: 2rem;
            font-weight: 700;
            letter-spacing: -0.5px;
            color: #0b2b40;
        }
        .page-header .sub {
            color: #3d5a73;
            font-size: 1.05rem;
            margin-top: 4px;
        }

        /* ── Card ── */
        .card {
            background: #ffffff;
            border-radius: 20px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
            padding: 24px 20px 28px;
            margin-bottom: 28px;
            transition: box-shadow 0.2s;
        }
        .card:hover {
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
        }

        /* ── Sub-tabs ── */
        .sub-tabs {
            display: flex;
            gap: 6px;
            background: #eef3f7;
            border-radius: 14px;
            padding: 4px;
            margin-bottom: 22px;
        }
        .tab-btn {
            flex: 1;
            padding: 10px 12px;
            border: none;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.9rem;
            background: transparent;
            color: #3d5a73;
            cursor: pointer;
            transition: 0.2s;
            text-align: center;
        }
        .tab-btn.active {
            background: #ffffff;
            color: #0b2b40;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }
        @media (hover: hover) {
            .tab-btn:hover:not(.active) {
                background: rgba(255, 255, 255, 0.5);
            }
        }

        /* ── Inputs ── */
        .input-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 14px;
        }
        .input-group label {
            font-weight: 600;
            font-size: 0.9rem;
            color: #1a3a4a;
        }
        .input-group .hint {
            font-size: 0.75rem;
            color: #6a7f8f;
            font-weight: 400;
            margin-left: 4px;
        }
        .input-row {
            display: flex;
            flex-wrap: wrap;
            gap: 16px 24px;
        }
        .input-row .input-group {
            flex: 1 1 200px;
            min-width: 150px;
        }
        .input-field {
            width: 100%;
            padding: 6px 7px;
            border: 1px solid #999;
            border-radius: 0;
            font-size: 1rem;
            font-weight: 500;
            background: #fafcfe;
            transition: 0.2s;
            color: #0b2b40;
            outline: none;
            font-family: inherit;
        }
        .input-field:focus {
            border-color: #2a7faa;
            background: #ffffff;
        }
        .input-field.error {
            border-color: #c0392b;
            background: #fef6f5;
        }
        .input-field.error:focus {
            border-color: #c0392b;
        }
        .input-field::placeholder {
            color: #a0b8c9;
            font-weight: 400;
        }
        .field-error {
            font-size: 0.8rem;
            color: #c0392b;
            min-height: 1.2em;
            margin-top: 2px;
        }
        .field-warning {
            font-size: 0.8rem;
            color: #b9770e;
            min-height: 1.2em;
            margin-top: 2px;
        }

        /* ── Date input wrapper ── */
        .date-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .date-input-wrapper .input-field {
            flex: 1;
            padding-right: 44px;
        }
        .date-input-wrapper .date-picker-native {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            opacity: 0;
            cursor: pointer;
            z-index: 2;
            padding: 0;
            border: none;
            background: transparent;
        }
        .date-input-wrapper .date-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 1.2rem;
            color: #8aa3b5;
            pointer-events: none;
            z-index: 1;
        }

        /* ── Result ── */
        .result-area {
            margin-top: 20px;
            padding-top: 18px;
            border-top: 2px dashed #e4edf4;
            text-align: center;
        }
        .result-area .result-primary {
            font-size: 2.4rem;
            font-weight: 700;
            color: #0b2b40;
            line-height: 1.2;
            margin-bottom: 6px;
        }
        .result-area .result-primary .highlight {
            color: #1a6b8f;
        }
        .result-area .result-secondary {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 16px 32px;
            margin-top: 8px;
        }
        .result-area .result-secondary .stat {
            font-size: 1rem;
            color: #3d5a73;
        }
        .result-area .result-secondary .stat strong {
            color: #0b2b40;
            font-weight: 700;
        }
        .result-area .result-birthday {
            margin-top: 12px;
            font-size: 1.05rem;
            font-weight: 500;
            color: #1a6b8f;
            background: #eef6fc;
            padding: 8px 18px;
            border-radius: 30px;
            display: inline-block;
        }
        .result-area .result-older {
            font-size: 1.1rem;
            font-weight: 600;
            color: #0b2b40;
            margin-top: 4px;
        }
        .result-area .result-placeholder {
            color: #8aa3b5;
            font-size: 1rem;
            padding: 8px 0;
        }
        .result-actions {
            margin-top: 14px;
            display: flex;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .btn-secondary {
            padding: 8px 20px;
            border: 1.5px solid #d0dfe9;
            border-radius: 30px;
            background: #ffffff;
            font-size: 0.85rem;
            font-weight: 500;
            color: #1a3a4a;
            cursor: pointer;
            transition: 0.2s;
        }
        @media (hover: hover) {
            .btn-secondary:hover {
                border-color: #2a7faa;
                background: #f2f8fd;
            }
        }

        /* ── Mode visibility ── */
        .mode-panel {
            display: none;
        }
        .mode-panel.active {
            display: block;
        }

        /* ── Content blocks ── */
        .content-block {
            margin-top: 32px;
        }
        .content-block h2 {
            font-size: 1.5rem;
            font-weight: 700;
            color: #0b2b40;
            margin: 28px 0 10px;
        }
        .content-block h2:first-of-type {
            margin-top: 0;
        }
        .content-block h3 {
            font-size: 1.12rem;
            font-weight: 600;
            color: #1a3a4a;
            margin: 18px 0 6px;
        }
        .content-block p {
            color: #1f3a4a;
            margin-bottom: 12px;
        }
        .content-block ul {
            padding-left: 22px;
            margin-bottom: 12px;
        }
        .content-block li {
            margin-bottom: 4px;
            color: #1f3a4a;
        }

        /* ── FAQ ── */
        .faq-item {
            border-bottom: 1px solid #e4edf4;
            padding: 14px 0;
        }
        .faq-item:last-child {
            border-bottom: none;
        }
        .faq-item h3 {
            font-size: 1.02rem;
            font-weight: 600;
            color: #0b2b40;
            margin-bottom: 4px;
            cursor: default;
        }
        .faq-item p {
            color: #2d4a5a;
            font-size: 0.95rem;
            margin-bottom: 0;
        }
        .faq-item code {
            background: #eef3f7;
            padding: 1px 6px;
            border-radius: 4px;
            font-size: 0.85rem;
        }

        /* ── Internal links ── */
        .internal-links {
            display: flex;
            flex-wrap: wrap;
            gap: 12px 24px;
            padding: 14px 0 6px;
            border-top: 1px solid #e4edf4;
            margin-top: 18px;
        }
        .internal-links a {
            color: #1a6b8f;
            text-decoration: none;
            font-weight: 500;
            font-size: 0.92rem;
        }
        .internal-links a:hover {
            text-decoration: underline;
        }

        /* ── Toast ── */
        .toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(80px);
            background: #0b2b40;
            color: #fff;
            padding: 10px 24px;
            border-radius: 30px;
            font-weight: 500;
            font-size: 0.95rem;
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
            opacity: 0;
            transition: opacity 0.3s ease, transform 0.3s ease;
            pointer-events: none;
            z-index: 9999;
        }
        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* ── Ad slots ── */
        .ad-slot {
            min-height: 250px;
            background: #f0f5fa;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #6a7f8f;
            font-size: 0.85rem;
            margin: 24px 0;
            border: 1px dashed #c8dae6;
            overflow: hidden;
        }
        .ad-slot--small {
            min-height: 90px;
        }

        /* ── Misc ── */
        .text-muted {
            color: #6a7f8f;
            font-size: 0.85rem;
        }
        .mt-8 {
            margin-top: 8px;
        }
        .mt-12 {
            margin-top: 12px;
        }
        .text-center {
            text-align: center;
        }
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }

        /* ── Responsive ── */
        @media (max-width: 600px) {
            .page-header h1 {
                font-size: 1.6rem;
            }
            .card {
                padding: 18px 14px 22px;
            }
            .result-area .result-primary {
                font-size: 1.8rem;
            }
            .result-area .result-secondary {
                gap: 8px 16px;
                font-size: 0.9rem;
            }
            .input-row .input-group {
                flex: 1 1 100%;
                min-width: unset;
            }
            .sub-tabs .tab-btn {
                font-size: 0.78rem;
                padding: 8px 8px;
            }
            .ad-slot {
                min-height: 200px;
            }
        }

        @media (max-width: 479px) {
            .result-area .result-primary {
                font-size: 1.5rem;
            }
            .result-area .result-secondary {
                flex-direction: column;
                gap: 4px;
                align-items: center;
            }
            .result-area .result-birthday {
                font-size: 0.9rem;
                padding: 6px 14px;
            }
            .tab-btn {
                font-size: 0.7rem;
                padding: 6px 6px;
            }
            .ad-slot {
                min-height: 160px;
            }
            .ad-slot--small {
                min-height: 70px;
            }
        }

        @media (max-width: 360px) {
            .card {
                padding: 14px 10px 18px;
            }
            .page-header h1 {
                font-size: 1.4rem;
            }
            .result-area .result-primary {
                font-size: 1.3rem;
            }
            .input-field {
                font-size: 0.9rem;
                padding: 10px 12px;
            }
        }

        @media (min-width: 1200px) {
            .container {
                position: relative;
            }
            .ad-slot--side {
                position: absolute;
                top: 120px;
                width: 160px;
                min-height: 600px;
                background: #f0f5fa;
                border-radius: 16px;
                border: 1px dashed #c8dae6;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #6a7f8f;
                font-size: 0.75rem;
            }
            .ad-slot--side-left {
                left: -190px;
            }
            .ad-slot--side-right {
                right: -190px;
            }
        }
    

        /* ── Site chrome ── */
        .site-header {
            background:#0b2b40; margin:-20px -16px 24px; padding:0 16px;
            position:sticky; top:0; z-index:50; box-shadow:0 2px 12px rgba(0,0,0,.12);
        }
        .site-header .bar {
            max-width:1040px; margin:0 auto; display:flex; align-items:center;
            justify-content:space-between; gap:12px; min-height:58px;
        }
        .brand { display:flex; align-items:center; gap:8px; color:#fff;
            font-weight:800; font-size:1.15rem; letter-spacing:-.3px; text-decoration:none; }
        .brand .dot { width:10px; height:10px; border-radius:3px; background:#4bb3e6; }
        .nav-toggle { display:none; background:transparent; border:1px solid #2f5570;
            color:#cfe4f1; border-radius:10px; padding:8px 11px; font-size:1rem; cursor:pointer;
            min-width:42px; min-height:42px; }
        .site-nav ul { list-style:none; display:flex; gap:4px; flex-wrap:wrap; }
        .site-nav a { color:#cfe4f1; text-decoration:none; font-size:.86rem; font-weight:600;
            padding:8px 11px; border-radius:9px; display:block; white-space:nowrap; }
        .site-nav a:hover { background:#173e58; color:#fff; }
        .site-nav a[aria-current="page"] { background:#1d4d6b; color:#fff; }

        @media (max-width:860px) {
            .nav-toggle { display:block; }
            .site-nav { display:none; width:100%; padding-bottom:10px; }
            .site-nav.open { display:block; }
            .site-header .bar { flex-wrap:wrap; }
            .site-nav ul { flex-direction:column; gap:2px; }
            .site-nav a { padding:11px 12px; }
        }

        .breadcrumbs { font-size:.8rem; color:#6a7f8f; margin-bottom:14px; }
        .breadcrumbs a { color:#2a7faa; text-decoration:none; }
        .breadcrumbs a:hover { text-decoration:underline; }

        .site-footer {
            background:#0b2b40; color:#a8c6da; margin:40px -16px -60px; padding:34px 16px 30px;
            font-size:.87rem; line-height:1.7;
        }
        .site-footer .fwrap { max-width:1040px; margin:0 auto;
            display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:26px; }
        .site-footer h3 { color:#fff; font-size:.92rem; margin-bottom:10px; }
        .site-footer ul { list-style:none; }
        .site-footer li { margin-bottom:5px; }
        .site-footer a { color:#a8c6da; text-decoration:none; }
        .site-footer a:hover { color:#fff; text-decoration:underline; }
        .site-footer .legal { max-width:1040px; margin:24px auto 0; padding-top:16px;
            border-top:1px solid #1d4157; font-size:.8rem; color:#84a4bb; }

        /* homepage */
        .tool-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(255px,1fr)); gap:16px; margin:22px 0 8px; }
        .tool-card { background:#fff; border-radius:16px; padding:20px 18px; text-decoration:none;
            display:block; color:inherit; box-shadow:0 6px 22px rgba(0,0,0,.06); transition:.2s;
            border:2px solid transparent; }
        .tool-card:hover { transform:translateY(-2px); border-color:#bcdcee; box-shadow:0 12px 30px rgba(0,0,0,.09); }
        .tool-card h3 { color:#0b2b40; font-size:1.03rem; margin-bottom:6px; }
        .tool-card p { color:#3d5a73; font-size:.87rem; line-height:1.55; }
        .tool-card .go { color:#2a7faa; font-weight:700; font-size:.82rem; margin-top:10px; display:block; }
        .hero-note { background:#eef6fb; border-left:3px solid #2a7faa; padding:12px 14px;
            border-radius:10px; font-size:.88rem; color:#3d5a73; margin-top:6px; }


        
        /* ══════════════════════════════════════════════════════════
           DESIGN SPEC — calculator.net style (navy / grey / green)
           Light theme only. Arial 13px. Dense, sharp corners.
           Presentation only: no markup, text, schema or link changes.
           ══════════════════════════════════════════════════════════ */

        :root{
            --navy:#1c4587;
            --navy-dk:#123163;
            --green:#3d7a1f;
            --green-lt:#e8f2e0;
            --grey:#f0f0f0;
            --line:#c0c0c0;
            --link:#1155cc;
            --red:#a01919;
        }

        body{
            background:#fff; color:#000;
            font-size:13px; line-height:1.45; font-family:Arial,Helvetica,sans-serif;
            padding:0 14px 46px;
        }
        .container{ max-width:1000px; }
        a{ color:#1155cc; }

        /* ── 1. Navy header bar ── */
        .site-header{ background:#1c4587; border-bottom:none; box-shadow:none; }
        .site-header .bar{ min-height:46px; }
        .brand{ font-size:1.15rem; font-weight:bold; color:#fff; }
        .brand .dot{ background:#8fc34d; }
        .site-nav a{ font-size:12px; font-weight:bold; color:#dbe6f5; padding:6px 9px; border-radius:0; }
        .site-nav a:hover{ background:#16386e; color:#fff; }
        .site-nav a[aria-current="page"]{ background:#123163; color:#fff; }

        /* ── 2. Breadcrumb ── */
        .breadcrumbs{ font-size:11px; color:#555; margin:10px 0 6px; }
        .breadcrumbs a{ color:#1155cc; }

        /* ── 3. H1 ── */
        .page-header{ margin-bottom:8px; }
        .page-header h1{ font-size:23px; font-weight:bold; color:#1c4587; margin-bottom:4px; letter-spacing:0; }
        .page-header .sub{ font-size:12.5px; color:#444; }
        .byline{ margin:0 0 10px; font-size:11.5px; }
        .byline .avatar{ width:24px; height:24px; flex:0 0 24px; font-size:10px; border-radius:50%; background:#1c4587; }

        /* ── 4. Navy instruction strip ── */
        .mode-panel.active::before{
            content:"Enter your values below — results update instantly";
            display:block; background:#1c4587; color:#fff;
            font-size:12px; font-weight:bold; padding:7px 12px; margin:0 0 12px;
        }

        /* ── 5. Tabs ── */
        .sub-tabs, .tabs{
            background:transparent; border-bottom:2px solid #1c4587;
            padding:0; gap:0; border-radius:0; display:flex;
        }
        .tab-btn{
            padding:9px 16px; background:#f0f0f0;
            border:1px solid #c0c0c0; border-bottom:none;
            font-weight:bold; font-size:13px; font-family:Arial,Helvetica,sans-serif; color:#333;
            border-radius:0; box-shadow:none; cursor:pointer;
        }
        .tab-btn.active{ background:#1c4587; color:#fff; border-color:#1c4587; }
        .tab-btn:hover:not(.active){ background:#e2e2e2; }

        /* ── 6. Two-pane layout ── */
        .card{ border:none; background:transparent; box-shadow:none; padding:0; margin-bottom:20px; }
        .mode-panel.active{
            display:flex; flex-wrap:wrap; gap:14px;
            align-items:flex-start; padding:0;
        }
        .mode-panel.active > *{ flex:1 1 100%; min-width:0; margin:0; }
        /* left input pane: grey box */
        .mode-panel.active > .input-row,
        .mode-panel.active > .input-group,
        .mode-panel.active > #subj-rows,
        .mode-panel.active > #sem-rows,
        .mode-panel.active > #cbse-rows{
            flex:1 1 340px; background:#f0f0f0; border:1px solid #c0c0c0; padding:12px;
        }
        /* right output pane */
        .mode-panel.active > .result-area{ flex:1 1 300px; align-self:stretch; }

        /* ── 7. Green result panel ── */
        .result-area{
            background:#fff; border:1px solid #c0c0c0;
            border-radius:0; padding:0 0 10px; margin:0; text-align:center;
        }
        .result-area::before{
            content:"Result"; display:block;
            background:#3d7a1f; color:#fff;
            font-weight:bold; font-size:12.5px; font-family:Arial,Helvetica,sans-serif;
            padding:6px 12px; text-align:left; letter-spacing:0;
            text-transform:none; margin-bottom:0;
        }
        .result-primary{
            background:#3d7a1f; color:#fff; font-size:2.6rem; font-weight:bold;
            padding:14px 12px 6px; margin:0; text-align:center; line-height:1.1;
        }
        .result-secondary{
            background:#fff; color:#555; font-size:12px;
            padding:7px 10px 0; text-align:center;
        }
        .result-placeholder{ font-size:12.5px; color:#666; padding:14px 12px; }

        /* ── 8. Buttons ── */
        .btn-secondary{
            font-weight:bold; font-size:12px; font-family:Arial,Helvetica,sans-serif; padding:6px 14px; min-height:30px;
            border:1px solid #999; background:#dcdcdc; color:#222;
            border-radius:0; cursor:pointer; box-shadow:none;
        }
        .btn-secondary:hover{ background:#ccc; border-color:#888; }
        .btn-secondary.primary,
        #add-subj, #add-sem, .add-row-btn, [id^="add-"]{
            background:#fff; color:#1c4587; border:1px solid #1c4587;
            font-weight:bold; font-size:12.5px; font-family:Arial,Helvetica,sans-serif; border-radius:0; padding:6px 14px;
        }
        .btn-secondary.primary:hover,
        #add-subj:hover, #add-sem:hover, .add-row-btn:hover, [id^="add-"]:hover{
            background:#1c4587; color:#fff;
        }

        /* ── 9. Inputs ── */
        .input-field{
            width:100%; border:1px solid #999; padding:6px 7px;
            font-size:13px; font-family:Arial,Helvetica,sans-serif; background:#fff;
            min-height:30px; border-radius:0;
        }
        .input-field:focus{ outline:2px solid #7aa7e0; outline-offset:-1px; border-color:#1c4587; box-shadow:none; }
        .input-field.error{ border-color:#a01919; background:#fff0f0; }
        .input-group label, label{ font-size:11.5px; font-weight:bold; color:#333; }
        .input-group{ margin-bottom:10px; }
        .input-group:last-child{ margin-bottom:0; }
        .field-error{ color:#a01919; font-size:11.5px; }

        /* ── 10. Dense tables ── */
        .conv-table, table.bd{ width:100%; border-collapse:collapse; font-size:12.5px; }
        .conv-table th, table.bd th{
            background:#1c4587; color:#fff; padding:5px 6px;
            border:1px solid #123163; font-size:11.5px; text-align:left;
            text-transform:none; letter-spacing:0;
        }
        .conv-table td, table.bd td{ border:1px solid #c0c0c0; padding:4px 6px; }
        .conv-table tbody tr:nth-child(even) td,
        table.bd tbody tr:nth-child(even){ background:#f6f6f6; }

        /* ── 11. Content ── */
        .content-block{ border:1px solid #c0c0c0; border-radius:0; box-shadow:none; padding:16px 14px; }
        .content-block h2{
            font-size:16px; font-weight:bold; color:#1c4587;
            border-bottom:2px solid #1c4587; padding-bottom:4px; margin-top:20px;
        }
        .content-block h3{ font-size:13.5px; margin-top:14px; }
        .content-block p, .content-block li{ font-size:13px; line-height:1.45; }
        .faq-item{ border:1px solid #c0c0c0; border-radius:0; }
        .faq-item h3{ font-size:13px; }
        .faq-item p{ font-size:12.5px; }
        .uni-note, .sources, .disclaimer, .running, .sem-total, .author-box, .hero-note{
            border-radius:0; font-size:12px;
        }
        .uni-note{ background:#e8f2e0; border-left:3px solid #3d7a1f; color:#2c4a17; }
        .uni-note.warn{ background:#fdf6e3; border-left-color:#b8860b; color:#6b5310; }
        .disclaimer{ background:#fdf6e3; border:1px solid #e0cf9a; color:#6b5310; }
        .conf-badge{ border-radius:0; font-size:10px; }
        .tool-card{ border:1px solid #c0c0c0; border-radius:0; box-shadow:none; padding:14px 13px; }
        .tool-card:hover{ border-color:#1c4587; background:#f7f9fc; transform:none; box-shadow:none; }
        .site-footer{ background:#1c4587; font-size:12px; }
        .history-list li{ font-size:12px; }

        /* ── 12. Mobile ── */
        @media (max-width:640px){
            body{ padding:0 10px 40px; font-size:13px; }
            .page-header h1{ font-size:19px; }
            .result-primary{ font-size:2rem; }
            .tab-btn{ font-size:11.5px; padding:8px 10px; }
            .conv-table, table.bd{ font-size:11px; }
            .conv-table th, .conv-table td, table.bd th, table.bd td{ padding:4px 3px; }
            .content-block{ padding:13px 11px; }
            .content-block h2{ font-size:14.5px; }
            .mode-panel.active::before{ font-size:11.5px; padding:6px 10px; }
            /* tab strip scrolls rather than squeezing labels */
            .sub-tabs, .tabs{ overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
            .sub-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar{ display:none; }
            .tab-btn{ flex:0 0 auto; white-space:nowrap; }
            /* preset chip rows scroll too */
            .preset-row, .presets, .quick-presets{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
        }
        /* 16px on controls stops iOS Safari zooming on focus */
        @media (max-width:640px){
            .input-field, select.input-field, input.input-field{ font-size:16px; }
        }
        @media (prefers-reduced-motion:reduce){ *{ transition:none!important; } }

        /* ── Spacing polish: consistent gaps, no dead space ── */
        .card{ margin-bottom:18px; }
        .panes, .mode-panel.active{ gap:12px; }
        .pane-in, .pane-out{ min-width:0; }
        .input-row{ display:flex; flex-wrap:wrap; gap:10px 12px; }
        .input-row > .input-group{ flex:1 1 150px; margin-bottom:0; }
        .input-group + .input-group{ margin-top:10px; }
        .result-actions{ display:flex; flex-wrap:wrap; gap:8px; padding:10px 10px 0; justify-content:center; }
        .presets{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
        .preset-btn{ border-radius:0; font-size:11.5px; padding:5px 9px; }
        .hint, .hint-text{ font-size:11px; color:#666; }
        .field-error:empty{ display:none; margin:0; }
        .content-block > h2:first-child{ margin-top:0; }
        .content-block p{ margin-bottom:10px; }
        .content-block ul, .content-block ol{ margin:0 0 12px 18px; }
        .content-block li{ margin-bottom:5px; }
        .faq-item{ padding:10px 12px; margin-bottom:8px; }
        .faq-item h3{ margin-bottom:4px; }
        .faq-item p{ margin-bottom:0; }
        .sources li{ padding:4px 0 4px 15px; }
        .byline .meta{ line-height:1.35; }
        @media (max-width:640px){
            .card{ margin-bottom:14px; }
            .panes, .mode-panel.active{ gap:10px; }
            .pane-in{ padding:10px; }
            .input-row{ gap:8px 10px; }
            .input-row > .input-group{ flex:1 1 100%; }
            .result-actions{ padding:9px 8px 0; gap:6px; }
            .result-actions .btn-secondary{ flex:1 1 auto; }
            .content-block{ padding:12px 10px; }
            .content-block h2{ margin-top:16px; }
            .faq-item{ padding:9px 10px; }
            .breadcrumbs{ margin:8px 0 5px; }
            .page-header{ margin-bottom:6px; }
            .byline{ margin-bottom:8px; }
            .table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
        }
        @media (max-width:400px){
            body{ padding:0 8px 36px; }
            .pane-in{ padding:9px; }
            .preset-btn{ font-size:11px; padding:5px 7px; }
        }

        /* sharp corners guaranteed regardless of rule order */
        input.input-field, select.input-field, textarea.input-field,
        .pane-in .input-field, .input-group .input-field{ border-radius:0; }
