/* =============================================================
   FinanceCalc Pro — Stylesheet v3.0
   Mobile-first · Dark mode · No horizontal overflow
   ============================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- Light theme ---------- */
:root {
    color-scheme: light;

    --brand-900: #0b1220;
    --brand-800: #0f172a;
    --brand-700: #1e293b;
    --brand-600: #334155;

    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;

    --accent-500: #10b981;
    --accent-600: #059669;
    --gold-500: #f59e0b;
    --purple-500: #8b5cf6;

    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --accent-50: #ecfdf5;
    --accent-100: #d1fae5;
    --gold-50: #fffbeb;
    --purple-50: #f5f3ff;

    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --muted-soft: #94a3b8;
    --line: #e2e8f0;
    --line-soft: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #fbfcfe;
    --canvas: #f7f9fc;
    --header-bg: rgba(255,255,255,.9);

    --sh-xs: 0 1px 2px rgba(15,23,42,.05);
    --sh-sm: 0 2px 8px rgba(15,23,42,.06);
    --sh-md: 0 6px 20px rgba(15,23,42,.08);
    --sh-lg: 0 14px 40px rgba(15,23,42,.11);
    --sh-xl: 0 22px 60px rgba(15,23,42,.14);

    --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-head: var(--font-body);
    --ease: cubic-bezier(.4,0,.2,1);
    --dur: .22s;
    --header-h: 60px;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
    color-scheme: dark;

    --primary-500: #60a5fa;
    --primary-600: #3b82f6;
    --primary-700: #7dd3fc;
    --primary-800: #93c5fd;
    --accent-500: #34d399;
    --accent-600: #6ee7b7;
    --gold-500: #fbbf24;
    --purple-500: #a78bfa;

    --primary-50: #16233c;
    --primary-100: #1c2f4d;
    --primary-200: #2a4570;
    --accent-50: #0f2a22;
    --accent-100: #17402f;
    --gold-50: #2c2210;
    --purple-50: #221c3a;

    --ink: #f1f5f9;
    --ink-soft: #cbd5e1;
    --muted: #94a3b8;
    --muted-soft: #64748b;
    --line: #253449;
    --line-soft: #1c2839;
    --surface: #131c2b;
    --surface-2: #17212f;
    --canvas: #0b1220;
    --header-bg: rgba(19,28,43,.92);

    --sh-xs: 0 1px 2px rgba(0,0,0,.3);
    --sh-sm: 0 2px 8px rgba(0,0,0,.35);
    --sh-md: 0 6px 20px rgba(0,0,0,.4);
    --sh-lg: 0 14px 40px rgba(0,0,0,.45);
    --sh-xl: 0 22px 60px rgba(0,0,0,.55);
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    scroll-padding-top: calc(var(--header-h) + 10px);
}

body {
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--ink-soft);
    font-size: 15.5px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100vw;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}

img, svg, video, canvas, iframe { max-width: 100%; height: auto; display: block; }

p, li, td, th, h1, h2, h3, h4, h5, dd, dt, figcaption, blockquote, label, span, a, div {
    overflow-wrap: break-word;
    word-break: break-word;
}

pre { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

a { color: var(--primary-600); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--primary-700); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-head); color: var(--ink);
    line-height: 1.25; font-weight: 700; letter-spacing: -.018em;
}

button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; max-width: 100%; font-size: 16px; }

:focus-visible { outline: 3px solid var(--primary-500); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 15px; }

/* Every grid or flex child must be shrinkable */
.container > *, .tool-layout > *, .tool-main > *, .tools-grid > *,
.blog-grid > *, .footer-grid > *, .field-grid > *, .result-grid > *,
.compare-grid > *, .feature-strip > *, .form-pair > * { min-width: 0; }

.skip-link {
    position: absolute; top: -60px; left: 12px; z-index: 10000;
    background: var(--primary-600); color: #fff; padding: 11px 18px;
    border-radius: 0 0 var(--r-sm) var(--r-sm); font-weight: 600; font-size: 14px;
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

.section, .section-tight, .section-sm { content-visibility: auto; contain-intrinsic-size: auto 500px; }

/* =============================================================
   TOP BAR
   ============================================================= */
.topbar {
    background: linear-gradient(100deg, var(--brand-900), var(--brand-700));
    color: #cbd5e1; font-size: 11.5px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; min-height: 32px; flex-wrap: wrap;
}
.topbar-text { display: inline-flex; align-items: center; gap: 6px; }
.topbar-text i { color: var(--accent-500); font-size: 10px; flex-shrink: 0; }
.topbar-links a { color: #e2e8f0; font-weight: 500; white-space: nowrap; }
.topbar-links a:hover { color: #fff; }

/* =============================================================
   HEADER
   ============================================================= */
/* A solid background on mobile.
   backdrop-filter is applied only from 901px up, because any element with a
   backdrop-filter becomes the containing block for its fixed-position
   descendants, which would trap the mobile nav drawer inside the header. */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 1000;
    transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-stuck { box-shadow: var(--sh-md); }

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 1; min-width: 0; }
.brand-logo { max-height: 34px; width: auto; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    color: #fff; display: grid; place-items: center; font-size: 16px;
}
.brand-name {
    font-size: 16.5px; font-weight: 800; color: var(--ink);
    letter-spacing: -.026em; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.brand:hover .brand-name { color: var(--primary-600); }

.main-nav { display: flex; align-items: center; gap: 1px; }
.main-nav .nav-link {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 11px; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
    background: none; border: none; white-space: nowrap;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.main-nav .nav-link:hover { background: var(--primary-50); color: var(--primary-700); }
.dropdown-toggle i { font-size: 8.5px; transition: transform var(--dur) var(--ease); }

.nav-badge {
    background: var(--accent-500); color: #06281d;
    font-size: 8.5px; font-weight: 800; padding: 2px 5px;
    border-radius: var(--r-full); text-transform: uppercase; letter-spacing: .3px;
}

.nav-dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 5px); left: 0;
    width: 280px; max-width: calc(100vw - 30px); padding: 6px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--sh-xl);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
    z-index: 100;
}
.nav-dropdown:hover > .dropdown-menu, .nav-dropdown:focus-within > .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown:hover .dropdown-toggle i { transform: rotate(180deg); }

.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink); }
.dropdown-menu a:hover { background: var(--primary-50); }
.dd-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: var(--primary-50); color: var(--primary-600);
    display: grid; place-items: center; font-size: 13px;
}
.dropdown-menu a:hover .dd-icon { background: var(--primary-600); color: #fff; }
.dd-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dd-text strong { font-size: 13px; font-weight: 600; }
.dd-text small { font-size: 10.5px; color: var(--muted); line-height: 1.4; }

.header-tools { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.theme-btn {
    width: 36px; height: 36px; flex-shrink: 0;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); color: var(--ink-soft);
    display: grid; place-items: center; font-size: 13.5px;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.theme-btn:hover { border-color: var(--primary-500); color: var(--primary-600); }
.theme-btn .i-sun { display: none; }
.theme-btn .i-moon { display: block; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }

.mobile-toggle {
    display: none; width: 36px; height: 36px; flex-shrink: 0;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface);
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.mobile-toggle span {
    display: block; width: 16px; height: 2px; border-radius: 2px;
    background: var(--ink);
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.mobile-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-toggle.is-active span:nth-child(2) { opacity: 0; }
.mobile-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =============================================================
   MOBILE DRAWER
   A standalone element outside the header, so no ancestor filter or
   transform can trap it. Not rendered at all on desktop.
   ============================================================= */
.drawer, .drawer-backdrop { display: none; }

@media (max-width: 900px) {
    .drawer-backdrop {
        display: block;
        position: fixed; inset: 0;
        background: rgba(8, 13, 24, .55);
        opacity: 0; visibility: hidden; z-index: 1001;
        transition: opacity .25s var(--ease), visibility .25s;
    }
    .drawer-backdrop.is-shown { opacity: 1; visibility: visible; }

    .drawer {
        display: flex; flex-direction: column;
        position: fixed; top: 0; right: 0;
        width: min(310px, 84vw);
        height: 100vh; height: 100dvh;
        background: var(--surface);
        border-left: 1px solid var(--line);
        box-shadow: -10px 0 36px rgba(8, 13, 24, .26);
        z-index: 1002;
        transform: translateX(103%);
        transition: transform .28s var(--ease);
        overflow-y: auto; overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .drawer.is-open { transform: translateX(0); }

    .drawer-top {
        display: flex; align-items: center; justify-content: space-between;
        gap: 12px; flex-shrink: 0;
        padding: 14px 16px;
        padding-top: max(14px, env(safe-area-inset-top));
        border-bottom: 1px solid var(--line);
    }
    .drawer-heading {
        font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
        text-transform: uppercase; color: var(--muted);
    }
    .drawer-x {
        width: 36px; height: 36px; flex-shrink: 0;
        border: 1px solid var(--line); border-radius: var(--r-sm);
        background: var(--surface); color: var(--ink-soft);
        display: grid; place-items: center; font-size: 15px;
    }
    .drawer-x:active { background: var(--line-soft); }

    .drawer-links {
        display: flex; flex-direction: column; gap: 8px;
        padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
    }

    /* Each entry is a full-width button */
    .drawer-btn {
        display: flex; align-items: center; gap: 12px;
        padding: 12px 13px; min-height: 52px;
        background: var(--surface-2);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        color: var(--ink); font-size: 14.5px; font-weight: 600;
        transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
    }
    .drawer-btn:active {
        background: var(--primary-50);
        border-color: var(--primary-200);
        color: var(--primary-700);
    }
    .drawer-btn .db-icon {
        width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
        background: var(--primary-50); color: var(--primary-600);
        display: grid; place-items: center; font-size: 14px;
    }
    .drawer-btn .db-text { flex: 1; min-width: 0; line-height: 1.35; }
    .drawer-btn .db-arrow { font-size: 11px; color: var(--muted-soft); flex-shrink: 0; }

    /* Home stands out from the calculators */
    .drawer-btn.is-home {
        background: var(--primary-600);
        border-color: var(--primary-600);
        color: #fff;
    }
    .drawer-btn.is-home .db-icon { background: rgba(255, 255, 255, .18); color: #fff; }
    .drawer-btn.is-home .db-arrow { color: rgba(255, 255, 255, .7); }
    .drawer-btn.is-home:active { background: var(--primary-700); color: #fff; }

    /* Stop the page behind from scrolling */
    body.nav-open { overflow: hidden; }
}

/* =============================================================
   HERO
   ============================================================= */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(140deg, var(--brand-900) 0%, #16233c 45%, var(--brand-800) 100%);
    color: #fff; padding: 46px 0 52px; text-align: center;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 18% 22%, rgba(37,99,235,.26), transparent 46%),
                radial-gradient(circle at 84% 78%, rgba(16,185,129,.16), transparent 46%);
    pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15);
    padding: 6px 13px; border-radius: var(--r-full);
    font-size: 11.5px; font-weight: 500; color: #dbeafe; margin-bottom: 16px;
}
.hero-badge i { color: var(--accent-500); flex-shrink: 0; }

.hero h1 {
    font-size: clamp(24px, 7vw, 48px); color: #fff;
    margin-bottom: 13px; line-height: 1.16; letter-spacing: -.03em;
}
.hero h1 .grad {
    background: linear-gradient(120deg, #60a5fa, #34d399);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: clamp(13.5px, 3vw, 17.5px); color: #b4c2d6;
    max-width: 620px; margin-inline: auto; line-height: 1.68;
}

.hero-cta { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn-hero {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 20px; border-radius: var(--r-full);
    font-size: 13.8px; font-weight: 600;
    transition: transform var(--dur) var(--ease);
}
.btn-hero-primary { background: #fff; color: var(--brand-800); box-shadow: 0 6px 20px rgba(0,0,0,.22); }
.btn-hero-primary:hover { color: var(--primary-700); transform: translateY(-2px); }
.btn-hero-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.btn-hero-ghost:hover { background: rgba(255,255,255,.17); color: #fff; transform: translateY(-2px); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 30px; }
.hero-stat { text-align: center; min-width: 0; }
.hero-stat strong {
    display: block; font-size: clamp(15px, 4.6vw, 28px);
    font-weight: 800; color: #fff; line-height: 1.15;
}
.hero-stat span {
    font-size: clamp(8.5px, 2.4vw, 11.5px); color: #94a3b8;
    text-transform: uppercase; letter-spacing: .4px; display: block; margin-top: 2px;
}

/* =============================================================
   SECTIONS
   ============================================================= */
.section { padding: 42px 0; }
.section-sm { padding: 30px 0; }
.section-tight { padding: 0 0 42px; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 26px; }
.eyebrow {
    display: inline-block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--primary-600); margin-bottom: 9px;
}
.section-head h2 { font-size: clamp(20px, 5vw, 32px); margin-bottom: 10px; }
.section-head p { font-size: clamp(13.5px, 2.6vw, 15.5px); color: var(--muted); line-height: 1.7; }

/* =============================================================
   TOOL CARDS
   ============================================================= */
.tools-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }

.tool-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 19px 17px;
    display: flex; flex-direction: column;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tool-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary-600), var(--accent-500));
    transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: var(--primary-200); }
.tool-card:hover::after { transform: scaleX(1); }

.tool-card .tool-icon {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    background: var(--primary-50); color: var(--primary-600);
    display: grid; place-items: center; font-size: 19px; margin-bottom: 13px;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tool-card:hover .tool-icon { background: var(--primary-600); color: #fff; }
.tool-card h3 { font-size: 16.5px; margin-bottom: 7px; }
.tool-card p { font-size: 13.2px; color: var(--muted); line-height: 1.62; flex: 1; margin-bottom: 13px; }

.tool-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.tool-tag {
    font-size: 10px; font-weight: 600; padding: 3px 7px;
    border-radius: var(--r-full); background: var(--line-soft); color: var(--muted);
}

.tool-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13.2px; font-weight: 600; color: var(--primary-600); align-self: flex-start;
}
.tool-link i { transition: transform var(--dur) var(--ease); font-size: 10.5px; }
.tool-card:hover .tool-link i { transform: translateX(3px); }

.tool-card.is-ai .tool-icon { background: var(--purple-50); color: var(--purple-500); }
.tool-card.is-ai:hover .tool-icon { background: var(--purple-500); color: #fff; }
.tool-card.is-ai::after { background: linear-gradient(90deg, var(--purple-500), var(--primary-600)); }
.tool-card.is-ai .tool-link { color: var(--purple-500); }

.card-flag {
    position: absolute; top: 13px; right: 13px;
    font-size: 9px; font-weight: 800; letter-spacing: .4px;
    text-transform: uppercase; padding: 3px 7px; border-radius: var(--r-full);
    background: var(--accent-500); color: #06281d;
}

/* =============================================================
   FEATURE STRIP
   ============================================================= */
.feature-strip { display: grid; gap: 12px; grid-template-columns: 1fr; }
.feature-item {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 15px;
    display: flex; gap: 11px; align-items: flex-start;
}
.feature-item .fi-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 14px;
}
.fi-blue { background: var(--primary-50); color: var(--primary-600); }
.fi-green { background: var(--accent-50); color: var(--accent-600); }
.fi-gold { background: var(--gold-50); color: var(--gold-500); }
.fi-purple { background: var(--purple-50); color: var(--purple-500); }
.feature-item h4 { font-size: 14px; margin-bottom: 3px; }
.feature-item p { font-size: 12.5px; color: var(--muted); line-height: 1.58; }

/* =============================================================
   TOOL PAGE
   ============================================================= */
.tool-page { padding: 18px 0 42px; }
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.tool-main { min-width: 0; }

.breadcrumb { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 12px; }
.breadcrumb-list { display: flex; align-items: center; gap: 6px; list-style: none; flex-wrap: wrap; }
.breadcrumb-list li { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
.breadcrumb-list li::after { content: '/'; color: var(--muted-soft); font-size: 10.5px; }
.breadcrumb-list li:last-child::after { display: none; }
.breadcrumb-list a { color: var(--muted); }
.breadcrumb-list a:hover { color: var(--primary-600); }
.breadcrumb-list li.is-current { color: var(--ink); font-weight: 500; }

.calc-panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--sh-sm);
    overflow: hidden; margin-bottom: 18px;
}
.calc-head { padding: 18px 15px 15px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.calc-head h1 { font-size: clamp(18px, 5vw, 26px); margin-bottom: 7px; }
.calc-head .lede { font-size: 13.5px; color: var(--muted); line-height: 1.62; }
.calc-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 11px; font-size: 11px; color: var(--muted); }
.calc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.calc-meta i { color: var(--accent-500); flex-shrink: 0; }

.calc-body { padding: 17px 15px 19px; }

/* Form */
.field-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field label .hint { font-weight: 400; color: var(--muted); font-size: 11px; }

.field-input { position: relative; }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 12px; font-size: 16px; color: var(--ink);
    background: var(--surface); border: 1.6px solid var(--line);
    border-radius: var(--r-sm); outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-50);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-soft); }
.field-input.has-prefix input { padding-left: 31px; }
.field-input.has-suffix input { padding-right: 34px; }
.field-affix {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 13.5px; pointer-events: none; font-weight: 500;
}
.field-affix.is-prefix { left: 11px; }
.field-affix.is-suffix { right: 11px; }

.field select {
    appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.5 1.2 3.7h9.6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
}

.field-slider { margin-top: 2px; }
.field-slider input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
    padding: 0; border: none; border-radius: var(--r-full);
    background: var(--line); cursor: pointer;
}
.field-slider input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 22px; height: 22px;
    border-radius: 50%; background: var(--primary-600);
    border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
}
.field-slider input[type=range]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; background: var(--primary-600);
    border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
}
.slider-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-soft); margin-top: 4px; }

/* Buttons */
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.btn-calc {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 22px; border: none; border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: #fff; font-size: 14.2px; font-weight: 600; min-height: 44px;
    box-shadow: 0 3px 12px rgba(37,99,235,.22);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-calc:hover { transform: translateY(-2px); }
.btn-calc:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-reset {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 18px; border-radius: var(--r-sm); min-height: 44px;
    background: var(--surface); color: var(--ink-soft);
    border: 1.6px solid var(--line); font-size: 13.8px; font-weight: 500;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.btn-reset:hover { border-color: var(--muted-soft); background: var(--line-soft); }

/* Results */
.result-panel {
    margin-top: 19px; padding: 16px 14px;
    background: linear-gradient(150deg, var(--primary-50), var(--accent-50));
    border: 1.6px solid var(--primary-200); border-radius: var(--r-md); display: none;
}
.result-panel.is-active { display: block; animation: riseIn .28s var(--ease); }
@keyframes riseIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.result-headline { text-align: center; margin-bottom: 15px; }
.result-headline .rh-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .85px; color: var(--primary-700); margin-bottom: 4px;
}
.result-headline .rh-value {
    font-size: clamp(23px, 8.5vw, 38px); font-weight: 800;
    color: var(--primary-700); line-height: 1.1; letter-spacing: -.025em;
}
.result-headline .rh-sub { font-size: 11.8px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.result-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-cell {
    background: var(--surface); border-radius: var(--r-sm);
    padding: 12px 9px; text-align: center; box-shadow: var(--sh-xs); min-width: 0;
}
.result-cell .rc-label {
    font-size: 9.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; line-height: 1.35;
}
.result-cell .rc-value { font-size: clamp(14px, 4.4vw, 18px); font-weight: 700; color: var(--ink); }
.result-cell.is-primary .rc-value { color: var(--primary-600); }
.result-cell.is-accent .rc-value { color: var(--accent-600); }
.result-cell.is-warn .rc-value { color: var(--gold-500); }

.split-bar-wrap { margin-top: 15px; }
.split-legend { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.split-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-blue { background: var(--primary-600); }
.dot-gold { background: var(--gold-500); }
.dot-green { background: var(--accent-500); }
.split-bar { height: 10px; border-radius: var(--r-full); overflow: hidden; background: var(--gold-500); display: flex; }
.split-bar .split-fill { height: 100%; background: var(--primary-600); transition: width .5s var(--ease); }
.split-bar.is-green { background: var(--accent-500); }
.split-pcts { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }

/* Regime comparison */
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compare-card {
    background: var(--surface); border: 1.8px solid var(--line);
    border-radius: var(--r-md); padding: 14px 10px; text-align: center;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); min-width: 0;
}
.compare-card.is-winner { border-color: var(--accent-500); box-shadow: 0 0 0 3px var(--accent-50); }
.compare-card .cc-label {
    font-size: 9.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .7px; color: var(--muted); margin-bottom: 6px;
}
.compare-card .cc-value { font-size: clamp(17px, 6vw, 24px); font-weight: 800; color: var(--ink); line-height: 1.15; }
.compare-card.is-winner .cc-value { color: var(--accent-600); }
.compare-card .cc-detail { font-size: 10.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.cc-crown {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent-50); color: var(--accent-600);
    font-size: 9px; font-weight: 800; padding: 3px 7px;
    border-radius: var(--r-full); margin-top: 7px; text-transform: uppercase;
}

.verdict-box {
    margin-top: 12px; padding: 13px;
    background: var(--surface); border: 1.8px solid var(--accent-100);
    border-radius: var(--r-md); text-align: center;
}
.verdict-box .vb-label { font-size: 11.2px; color: var(--muted); }
.verdict-box .vb-text {
    font-size: clamp(13.5px, 4vw, 16.5px); font-weight: 700;
    color: var(--accent-600); margin-top: 3px; line-height: 1.4;
}

/* Schedule table */
.schedule-wrap { margin-top: 15px; }
.schedule-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.8px; font-weight: 600; color: var(--primary-600);
    background: none; border: none; padding: 6px 0; text-align: left; min-height: 36px;
}
.schedule-table-wrap {
    display: none; margin-top: 11px; max-height: 300px; max-width: 100%;
    overflow: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
}
.schedule-table-wrap.is-open { display: block; }
.schedule-table-wrap table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 11.8px; }
.schedule-table-wrap th {
    position: sticky; top: 0; z-index: 1; background: var(--brand-800); color: #fff;
    padding: 8px 9px; text-align: right; font-weight: 600; white-space: nowrap;
}
.schedule-table-wrap th:first-child, .schedule-table-wrap td:first-child { text-align: left; }
.schedule-table-wrap td {
    padding: 7px 9px; text-align: right; border-bottom: 1px solid var(--line-soft);
    white-space: nowrap; color: var(--ink-soft);
}
.schedule-table-wrap tbody tr:nth-child(even) { background: var(--surface-2); }

/* =============================================================
   CONTENT
   ============================================================= */
.content-block {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 18px 15px; margin-bottom: 16px;
}
.content-block > h2 {
    font-size: clamp(17px, 4.4vw, 21px); margin-bottom: 13px;
    padding-bottom: 10px; border-bottom: 2px solid var(--primary-50);
}
.content-block h3 { font-size: clamp(15px, 3.4vw, 17px); margin: 20px 0 8px; color: var(--ink); }
.content-block h4 { font-size: 14.5px; margin: 16px 0 7px; }
.content-block p { margin-bottom: 12px; line-height: 1.78; }
.content-block ul, .content-block ol { margin: 0 0 14px; padding-left: 19px; }
.content-block li { margin-bottom: 7px; line-height: 1.7; }
.content-block li::marker { color: var(--primary-600); }
.content-block strong { color: var(--ink); font-weight: 600; }
.content-block a { border-bottom: 1px solid var(--primary-200); }
.content-block img { border-radius: var(--r-md); margin: 13px 0; }
.content-block figure { margin: 16px 0; }
.content-block figcaption { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 6px; font-style: italic; }

.content-block blockquote {
    margin: 16px 0; padding: 13px 15px; background: var(--primary-50);
    border-left: 4px solid var(--primary-600); border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-size: 14px; color: var(--ink-soft);
}
.content-block blockquote p:last-child { margin-bottom: 0; }
.content-block pre { background: var(--brand-800); color: #e2e8f0; padding: 13px; border-radius: var(--r-sm); font-size: 12px; margin-bottom: 14px; }
.content-block code {
    background: var(--line-soft); padding: 2px 5px; border-radius: 4px;
    font-size: 12.5px; font-family: ui-monospace, Menlo, monospace;
}
.content-block pre code { background: none; padding: 0; color: inherit; }

/* Tables always scroll inside a wrapper */
.table-scroll {
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 15px 0; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: var(--surface);
}
.table-scroll table { margin: 0; border: none; }
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-track { background: var(--line-soft); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--muted-soft); border-radius: 3px; }

.scroll-hint {
    display: none; font-size: 10.5px; color: var(--muted);
    text-align: center; margin: -10px 0 14px;
}

table { border-collapse: collapse; }
.content-block table, .data-table, .page-card table, .article-body table {
    width: 100%; min-width: 400px; border-collapse: collapse;
    font-size: 13px; background: var(--surface);
}
.content-block th, .data-table th, .page-card th, .article-body th {
    background: var(--brand-800); color: #fff; padding: 9px 11px;
    text-align: left; font-weight: 600; font-size: 12px;
}
.content-block td, .data-table td, .page-card td, .article-body td {
    padding: 9px 11px; border-bottom: 1px solid var(--line);
    color: var(--ink-soft); vertical-align: top;
}
.content-block tbody tr:nth-child(even), .data-table tbody tr:nth-child(even),
.page-card tbody tr:nth-child(even), .article-body tbody tr:nth-child(even) { background: var(--surface-2); }
.content-block tbody tr:last-child td { border-bottom: none; }

/* Callouts */
.callout { display: flex; gap: 10px; padding: 13px 14px; border-radius: var(--r-md); margin: 15px 0; font-size: 13.2px; line-height: 1.68; }
.callout i { font-size: 15px; flex-shrink: 0; margin-top: 2px; }
.callout p:last-child { margin-bottom: 0; }
.callout-info { background: var(--primary-50); border: 1px solid var(--primary-200); color: var(--ink-soft); }
.callout-info i { color: var(--primary-600); }
.callout-tip { background: var(--accent-50); border: 1px solid var(--accent-100); color: var(--ink-soft); }
.callout-tip i { color: var(--accent-600); }
.callout-warn { background: var(--gold-50); border: 1px solid var(--gold-500); color: var(--ink-soft); }
.callout-warn i { color: var(--gold-500); }

/* Takeaways */
.takeaways { background: var(--accent-50); border: 1px solid var(--accent-100); border-radius: var(--r-md); padding: 16px 14px; margin: 18px 0; }
.takeaways h3 { font-size: 15px; margin: 0 0 11px; display: flex; align-items: center; gap: 8px; color: var(--accent-600); }
.takeaways ul { list-style: none; padding: 0; margin: 0; }
.takeaways li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.2px; color: var(--ink-soft); padding: 5px 0; line-height: 1.65; }
.takeaways li::before {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    color: var(--accent-600); font-size: 10px; flex-shrink: 0; margin-top: 4px;
}

/* Formula box */
.formula-box {
    background: var(--brand-800); color: #e2e8f0; border-radius: var(--r-md);
    padding: 14px 12px; margin: 15px 0; text-align: center;
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.formula-box .fb-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 8px; }
.formula-box .fb-formula { font-family: ui-monospace, Menlo, monospace; font-size: clamp(11.5px, 3.6vw, 16px); color: #7dd3fc; line-height: 1.65; }
.formula-box .fb-legend { margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.1); font-size: 11.5px; color: #cbd5e1; text-align: left; }
.formula-box .fb-legend div { margin-bottom: 4px; line-height: 1.55; }

/* =============================================================
   FAQ
   ============================================================= */
.faq-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 15px; margin-bottom: 16px; }
.faq-block > h2 { font-size: clamp(17px, 4.4vw, 21px); margin-bottom: 14px; }

.faq-item { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; overflow: hidden; transition: border-color var(--dur) var(--ease); }
.faq-item.is-open { border-color: var(--primary-200); }
.faq-question {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 11px; padding: 12px 14px; background: var(--surface-2); border: none;
    text-align: left; font-family: var(--font-body); font-size: 13.6px;
    font-weight: 600; color: var(--ink); min-height: 46px;
    transition: background var(--dur) var(--ease);
}
.faq-question:hover { background: var(--primary-50); }
.faq-item.is-open .faq-question { background: var(--primary-50); color: var(--primary-700); }
.faq-question i { font-size: 10.5px; color: var(--muted); flex-shrink: 0; transition: transform var(--dur) var(--ease); }
.faq-item.is-open .faq-question i { transform: rotate(180deg); color: var(--primary-600); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease), padding .3s var(--ease); padding: 0 14px; }
.faq-item.is-open .faq-answer { max-height: 1200px; padding: 12px 14px 14px; }
.faq-answer p { font-size: 13.2px; color: var(--ink-soft); line-height: 1.75; margin-bottom: 8px; }
.faq-answer p:last-child { margin-bottom: 0; }

/* =============================================================
   SIDEBAR
   ============================================================= */
.tool-sidebar { position: static; min-width: 0; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 17px 15px; margin-bottom: 15px; }
.widget > h3 {
    font-size: 14.5px; margin-bottom: 13px; padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-50); display: flex; align-items: center; gap: 8px;
}
.widget > h3 i { color: var(--primary-600); font-size: 13px; flex-shrink: 0; }

.widget-list { list-style: none; }
.widget-list li { margin-bottom: 4px; }
.widget-list a {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-radius: var(--r-sm); font-size: 13.2px; color: var(--ink-soft);
    min-height: 42px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.widget-list a:hover { background: var(--primary-50); color: var(--primary-700); }
.widget-list a i { width: 16px; text-align: center; color: var(--primary-600); font-size: 12.5px; flex-shrink: 0; }
.widget-list a.is-current { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }

.widget-tips { list-style: none; }
.widget-tips li {
    display: flex; gap: 9px; align-items: flex-start; font-size: 12.8px;
    color: var(--ink-soft); padding: 8px 0; line-height: 1.6;
    border-bottom: 1px solid var(--line-soft);
}
.widget-tips li:last-child { border-bottom: none; }
.widget-tips i { color: var(--gold-500); font-size: 11.5px; margin-top: 3px; flex-shrink: 0; }

.widget-cta { background: linear-gradient(150deg, var(--brand-800), var(--brand-700)); border: none; text-align: center; }
.widget-cta h3 { color: #fff; border-bottom-color: rgba(255,255,255,.12); justify-content: center; }
.widget-cta h3 i { color: var(--accent-500); }
.widget-cta p { font-size: 12.8px; color: #b4c2d6; margin-bottom: 13px; line-height: 1.65; }
.widget-cta .wc-btn {
    display: inline-flex; align-items: center; gap: 7px; background: #fff;
    color: var(--brand-800); padding: 10px 18px; border-radius: var(--r-full);
    font-size: 13.2px; font-weight: 600; min-height: 40px;
}
.widget-cta .wc-btn:hover { color: var(--primary-700); }

/* =============================================================
   ADS
   ============================================================= */
.ad-slot { padding: 14px 0; text-align: center; overflow: hidden; }
.ad-slot-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.ad-slot-footer { background: var(--surface); border-top: 1px solid var(--line); }
.ad-label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted-soft); margin-bottom: 7px; }
.ad-inline {
    margin: 20px 0; padding: 16px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-md);
    text-align: center; min-height: 90px; overflow: hidden;
}
.ad-sidebar { padding: 15px; text-align: center; min-height: 220px; overflow: hidden; }
.ad-slot ins, .ad-inline ins, .ad-sidebar ins { max-width: 100% !important; }

/* =============================================================
   BLOG
   ============================================================= */
.blog-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.blog-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.blog-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--line-soft); display: grid; place-items: center; }
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.blog-card:hover .blog-thumb img { transform: scale(1.04); }
.blog-thumb .thumb-fallback { font-size: 30px; color: var(--muted-soft); }
.blog-card-body { padding: 17px 15px; display: flex; flex-direction: column; flex: 1; }
.blog-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--primary-600); margin-bottom: 8px; }
.blog-card h3 { font-size: 16.5px; margin-bottom: 8px; line-height: 1.4; }
.blog-card h3 a { color: var(--ink); }
.blog-card h3 a:hover { color: var(--primary-600); }
.blog-card p { font-size: 13.2px; color: var(--muted); line-height: 1.62; flex: 1; margin-bottom: 13px; }
.blog-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted-soft); padding-top: 11px; border-top: 1px solid var(--line-soft); }
.blog-meta span { display: inline-flex; align-items: center; gap: 5px; }

.article-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; }
.article-hero-img { aspect-ratio: 16/8; overflow: hidden; }
.article-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.article-hero-body { padding: 19px 15px; }
.article-hero h1 { font-size: clamp(20px, 5.4vw, 31px); margin-bottom: 11px; line-height: 1.26; }
.article-meta { display: flex; gap: 13px; flex-wrap: wrap; font-size: 12.2px; color: var(--muted); padding-top: 13px; border-top: 1px solid var(--line-soft); }
.article-meta span { display: inline-flex; align-items: center; gap: 5px; }
.article-meta i { color: var(--primary-600); flex-shrink: 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.tag-pill { font-size: 11.5px; padding: 5px 11px; border-radius: var(--r-full); background: var(--primary-50); color: var(--primary-700); font-weight: 500; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 42px; min-height: 42px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 500;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pagination a:hover { border-color: var(--primary-500); color: var(--primary-600); }
.pagination .is-active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }

.empty-state { text-align: center; padding: 48px 16px; }
.empty-state i { font-size: 40px; color: var(--muted-soft); opacity: .4; margin-bottom: 14px; }
.empty-state h2 { font-size: 18px; color: var(--ink-soft); margin-bottom: 7px; }
.empty-state p { font-size: 13.8px; color: var(--muted); }

/* =============================================================
   STATIC PAGES
   ============================================================= */
.page-wrap { padding: 22px 0 42px; }
.page-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 20px 16px;
    max-width: 860px; margin-inline: auto;
}
.page-card h1 { font-size: clamp(21px, 5.4vw, 31px); margin-bottom: 9px; }
.page-card .page-updated { font-size: 12.2px; color: var(--muted); margin-bottom: 22px; }
.page-card h2 { font-size: clamp(17px, 4vw, 19.5px); margin: 26px 0 11px; }
.page-card h3 { font-size: 15.5px; margin: 20px 0 8px; }
.page-card p { margin-bottom: 14px; line-height: 1.8; }
.page-card ul, .page-card ol { margin: 0 0 15px; padding-left: 20px; }
.page-card li { margin-bottom: 8px; line-height: 1.74; }
.page-card li::marker { color: var(--primary-600); }
.page-card strong { color: var(--ink); font-weight: 600; }

.form-stack { display: grid; gap: 16px; margin: 20px 0; }
.form-pair { display: grid; grid-template-columns: 1fr; gap: 15px; }
.form-stack label { display: block; font-size: 13.2px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-stack input, .form-stack textarea, .form-stack select {
    width: 100%; padding: 11px 13px; font-size: 16px; color: var(--ink);
    border: 1.6px solid var(--line); border-radius: var(--r-sm);
    outline: none; background: var(--surface);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus {
    border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-50);
}
.form-stack textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.form-stack select {
    appearance: none; -webkit-appearance: none; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.5 1.2 3.7h9.6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
}

.notice { display: flex; gap: 11px; padding: 14px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: 13.5px; }
.notice i { font-size: 15px; flex-shrink: 0; margin-top: 2px; }
.notice-ok { background: var(--accent-50); border: 1px solid var(--accent-100); color: var(--accent-600); }
.notice-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
[data-theme="dark"] .notice-err { background: #2c1315; border-color: #5c2427; color: #fca5a5; }

.contact-cards { display: grid; gap: 12px; margin: 22px 0; grid-template-columns: 1fr; }
.contact-card { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; text-align: center; }
.contact-card i { font-size: 20px; color: var(--primary-600); margin-bottom: 9px; display: block; }
.contact-card h4 { font-size: 14px; margin-bottom: 4px; }
.contact-card p { font-size: 12.8px; color: var(--muted); margin: 0; word-break: break-word; }

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
    background: linear-gradient(170deg, var(--brand-800), var(--brand-900));
    color: #a3b1c6; padding: 40px 0 0; margin-top: 44px;
}
.footer-grid { display: grid; gap: 26px; padding-bottom: 28px; grid-template-columns: 1fr; }
.footer-brand { color: #fff; font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.footer-brand i { color: var(--primary-500); }
.footer-logo { max-height: 38px; margin-bottom: 12px; }
.footer-about p { font-size: 13.2px; line-height: 1.75; color: #94a3b8; margin-bottom: 15px; }

.footer-trust { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.footer-trust span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.8px; color: #cbd5e1; }
.footer-trust i { color: var(--accent-500); font-size: 11px; flex-shrink: 0; }

.footer-col h4 { color: #fff; font-size: 13.5px; margin-bottom: 13px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 3px; }
.footer-col ul a {
    color: #94a3b8; font-size: 13.2px; display: block; padding: 7px 0;
    transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}
.footer-col ul a:hover { color: #fff; padding-left: 4px; }

.footer-social { display: flex; gap: 9px; }
.footer-social a {
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08);
    color: #cbd5e1; display: grid; place-items: center; font-size: 14.5px;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer-social a:hover { background: var(--primary-600); color: #fff; transform: translateY(-2px); }

/* Footer utility row: theme toggle and back to top */
.footer-utility {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,.08);
}
.footer-theme {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
    color: #cbd5e1; padding: 9px 16px; border-radius: var(--r-full);
    font-size: 12.8px; font-weight: 500; min-height: 40px;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.footer-theme:hover { background: rgba(255,255,255,.14); color: #fff; }
.footer-theme .i-sun { display: none; }
[data-theme="dark"] .footer-theme .i-sun { display: inline; }
[data-theme="dark"] .footer-theme .i-moon { display: none; }
.footer-theme-label-dark { display: inline; }
.footer-theme-label-light { display: none; }
[data-theme="dark"] .footer-theme-label-dark { display: none; }
[data-theme="dark"] .footer-theme-label-light { display: inline; }

.footer-top-link {
    display: inline-flex; align-items: center; gap: 7px;
    color: #94a3b8; font-size: 12.8px; padding: 9px 0; min-height: 40px;
}
.footer-top-link:hover { color: #fff; }

.footer-disclaimer { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.08); }
.footer-disclaimer p { font-size: 11.5px; line-height: 1.72; color: #78889e; }
.footer-disclaimer strong { color: #a3b1c6; }

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; flex-wrap: wrap; padding: 15px 0 20px;
    border-top: 1px solid rgba(255,255,255,.08); font-size: 12.2px; color: #78889e;
}
.footer-updated { font-size: 11.5px; }

.back-to-top {
    position: fixed; bottom: 84px; right: 15px;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); color: var(--primary-600);
    border: 1px solid var(--line); box-shadow: var(--sh-md);
    font-size: 14px; z-index: 900;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity var(--dur) var(--ease), visibility var(--dur), transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--primary-600); color: #fff; border-color: var(--primary-600); }

/* =============================================================
   UTILITIES
   ============================================================= */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 30px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* =============================================================
   BREAKPOINT: 480px and up
   ============================================================= */
@media (min-width: 480px) {
    .container { padding-inline: 18px; }
    .result-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .contact-cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .form-pair { grid-template-columns: 1fr 1fr; }
}

/* =============================================================
   BREAKPOINT: 640px and up
   ============================================================= */
@media (min-width: 640px) {
    body { font-size: 16px; }
    .container { padding-inline: 20px; }
    .hero { padding: 58px 0 64px; }
    .hero-stats { gap: 20px; }
    .section { padding: 52px 0; }
    .section-tight { padding: 0 0 52px; }
    .feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tools-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
    .blog-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
    .field-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
    .calc-head { padding: 22px 20px 18px; }
    .calc-body { padding: 20px; }
    .content-block, .faq-block { padding: 22px 20px; }
    .page-card { padding: 28px 24px; }
    .article-hero-body { padding: 24px 20px; }
    .blog-card-body { padding: 20px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-about { grid-column: 1 / -1; }
    .back-to-top { right: 20px; }
}

/* =============================================================
   BREAKPOINT: 901px and up — desktop nav
   ============================================================= */
@media (min-width: 901px) {
    .header-inner { gap: 20px; }
    .brand-name { font-size: 18px; }
    .brand-logo { max-height: 40px; }
    .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 34px; }
    .footer-about { grid-column: auto; }
}

/* =============================================================
   BREAKPOINT: below 901px — mobile nav drawer
   ============================================================= */
/* Below 901px the desktop nav is replaced by the drawer defined above */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .mobile-toggle { display: flex; }
}

/* Desktop: glass header, no drawer */
@media (min-width: 901px) {
    .site-header {
        background: var(--header-bg);
        -webkit-backdrop-filter: saturate(170%) blur(12px);
        backdrop-filter: saturate(170%) blur(12px);
    }
}

/* =============================================================
   BREAKPOINT: 1024px and up — sidebar layout
   ============================================================= */
@media (min-width: 1024px) {
    .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
    .tool-sidebar { position: sticky; top: calc(var(--header-h) + 14px); }
    .feature-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .compare-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================================
   Touch devices: disable hover transforms
   ============================================================= */
@media (hover: none) {
    .tool-card:hover, .blog-card:hover, .btn-calc:hover,
    .btn-hero:hover, .footer-social a:hover { transform: none; }
    .tool-card:hover .tool-icon { transform: none; }
    .blog-card:hover .blog-thumb img { transform: none; }
}

/* =============================================================
   PRINT
   ============================================================= */
@media print {
    .topbar, .site-header, .site-footer, .back-to-top, .ad-slot,
    .ad-inline, .ad-sidebar, .tool-sidebar, #chatbotWrapper,
    .btn-row, .breadcrumb, .nav-backdrop, .scroll-hint { display: none !important; }
    .tool-layout { grid-template-columns: 1fr; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .calc-panel, .content-block, .faq-block, .page-card {
        border: 1px solid #ccc; box-shadow: none; break-inside: avoid;
    }
    .faq-answer { max-height: none !important; padding: 10px 14px !important; }
    .schedule-table-wrap { max-height: none !important; display: block !important; }
    a { text-decoration: underline; color: #000; }
}

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================================
   SHARED COMPONENTS USED ACROSS TOOL PAGES
   Kept here instead of inline styles so dark mode applies.
   ============================================================= */

/* Full-width item inside a grid */
.grid-full { grid-column: 1 / -1; }

/* Pill button rows: loan presets, modes, GST rates, quick questions */
.pill-row { display: flex; gap: 7px; flex-wrap: wrap; }

.pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; min-height: 40px;
    border: 1.5px solid var(--line); border-radius: var(--r-full);
    background: var(--surface); color: var(--ink-soft);
    font-size: 13px; font-weight: 500; font-family: var(--font-body);
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pill:hover { border-color: var(--primary-500); color: var(--primary-600); }
.pill.is-active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.pill i { font-size: 12px; }

/* Compact variant for GST rate chips */
.pill-sm { padding: 7px 14px; min-height: 36px; font-size: 12.5px; font-weight: 600; }
.pill-sm.is-active { background: var(--primary-50); border-color: var(--primary-500); color: var(--primary-700); }

/* Suggested-question chips on AI pages */
.pill-q {
    border-color: var(--primary-200); color: var(--primary-700);
    text-align: left; justify-content: flex-start;
}
.pill-q:hover { background: var(--primary-600); color: #fff; border-color: var(--primary-600); }

.pill-label { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }

/* Textarea inside a .field, matching input styling */
.field textarea {
    min-height: 100px; resize: vertical; line-height: 1.7;
    padding: 12px 13px;
}

/* =============================================================
   AI RESPONSE PANELS
   ============================================================= */
.ai-loading { display: none; text-align: center; padding: 32px 16px; }
.ai-loading.is-shown { display: block; }
.ai-loading p { color: var(--muted); font-size: 13.5px; margin-top: 12px; }

.ai-spinner {
    width: 38px; height: 38px; margin: 0 auto;
    border: 3.5px solid var(--line);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: aiSpin .8s linear infinite;
}
.ai-spinner.is-green { border-top-color: var(--accent-500); }
.ai-spinner.is-purple { border-top-color: var(--purple-500); }
@keyframes aiSpin { to { transform: rotate(360deg); } }

.ai-answer { display: none; margin-top: 20px; }
.ai-answer.is-shown { display: block; }

.ai-card {
    background: linear-gradient(150deg, var(--primary-50), var(--accent-50));
    border: 1.6px solid var(--primary-200);
    border-radius: var(--r-md); padding: 18px 15px;
}
.ai-card.is-green { background: var(--accent-50); border-color: var(--accent-100); }
.ai-card.is-purple { background: var(--purple-50); border-color: var(--purple-50); }

.ai-card-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--primary-200);
    flex-wrap: wrap;
}
.ai-card.is-green .ai-card-head { border-bottom-color: var(--accent-100); }
.ai-card.is-purple .ai-card-head { border-bottom-color: var(--purple-50); }

.ai-card-ava {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    color: #fff; display: grid; place-items: center; font-size: 15px;
}
.ai-card-ava.is-green { background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); color: #05261c; }
.ai-card-ava.is-purple { background: linear-gradient(135deg, var(--purple-500), #6d28d9); color: #fff; }

.ai-card-title { display: flex; flex-direction: column; min-width: 0; }
.ai-card-title strong { font-size: 14px; color: var(--ink); }
.ai-card-title small { font-size: 11px; color: var(--muted); }

.ai-copy-btn {
    margin-left: auto; background: none; border: 1px solid var(--primary-200);
    border-radius: var(--r-sm); padding: 7px 12px; min-height: 34px;
    font-size: 11.5px; color: var(--primary-700); font-family: var(--font-body);
    transition: background var(--dur) var(--ease);
}
.ai-copy-btn:hover { background: var(--primary-100); }

.ai-body { font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.ai-body p { margin-bottom: 12px; }
.ai-body p:last-child { margin-bottom: 0; }
.ai-body strong { color: var(--ink); font-weight: 600; }
.ai-body ul, .ai-body ol { margin: 10px 0; padding-left: 20px; }
.ai-body li { margin-bottom: 6px; }
.ai-body li::marker { color: var(--primary-600); }
.ai-body h3, .ai-body h4 { font-size: 15px; margin: 16px 0 8px; color: var(--ink); }
.ai-body code {
    background: var(--surface); padding: 2px 5px; border-radius: 4px;
    font-size: 12.8px; font-family: ui-monospace, Menlo, monospace;
}
.ai-body table { display: block; overflow-x: auto; max-width: 100%; font-size: 12.5px; }

.ai-error { color: #b91c1c; }
[data-theme="dark"] .ai-error { color: #fca5a5; }

.ai-disclaimer {
    font-size: 11px; color: var(--muted); margin-top: 9px;
    text-align: center; line-height: 1.5;
}

/* =============================================================
   SHARE BUTTONS
   ============================================================= */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; min-height: 40px;
    border-radius: var(--r-full); border: none;
    color: #fff; font-size: 12.5px; font-weight: 500;
    font-family: var(--font-body);
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.share-btn:hover { color: #fff; transform: translateY(-2px); opacity: .92; }
.share-whatsapp { background: #25d366; }
.share-x        { background: #0f172a; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-copy     { background: var(--brand-600); }
[data-theme="dark"] .share-x { background: #334155; }

.share-label {
    font-size: 11.5px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px;
}

/* =============================================================
   BLOG CATEGORY FILTER
   ============================================================= */
.cat-filter { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.cat-chip {
    padding: 8px 15px; min-height: 38px;
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: var(--r-full); font-size: 12.8px; font-weight: 500;
    border: 1.4px solid var(--line); background: var(--surface); color: var(--ink-soft);
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.cat-chip:hover { border-color: var(--primary-500); color: var(--primary-600); }
.cat-chip.is-active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.cat-chip .cat-count { opacity: .65; font-size: 11.5px; }

/* Tool pill links used on the blog and 404 pages */
.tool-pill-row { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.tool-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 15px; min-height: 40px;
    background: var(--primary-50); border: 1px solid var(--primary-200);
    border-radius: var(--r-full); font-size: 13px; font-weight: 500;
    color: var(--primary-700);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tool-pill:hover { background: var(--primary-600); color: #fff; }

/* =============================================================
   404 PAGE
   ============================================================= */
.error-wrap { max-width: 640px; margin-inline: auto; text-align: center; padding: 30px 0; }
.error-code {
    font-size: clamp(56px, 18vw, 100px); font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; margin-bottom: 10px;
}
.error-wrap h1 { font-size: clamp(19px, 4.6vw, 26px); margin-bottom: 11px; }
.error-wrap > p { font-size: 14.5px; color: var(--muted); line-height: 1.7; margin-bottom: 26px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }

.error-tools {
    text-align: left; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 20px 16px;
}
.error-tools h2 { font-size: 15.5px; margin-bottom: 14px; text-align: center; }
.error-tool-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.error-tool-link {
    display: flex; align-items: center; gap: 10px; padding: 11px 12px;
    border-radius: var(--r-sm); background: var(--canvas);
    color: var(--ink-soft); font-size: 13.2px; min-height: 46px;
    transition: background var(--dur) var(--ease);
}
.error-tool-link:hover { background: var(--primary-50); color: var(--primary-700); }
.error-tool-link .etl-icon {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    background: var(--primary-50); color: var(--primary-600);
    display: grid; place-items: center; font-size: 12.5px;
}

@media (min-width: 480px) {
    .error-tool-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* =============================================================
   ARTICLE BODY (admin-authored HTML)
   ============================================================= */
.article-body { max-width: 100%; }
.article-body h2 { font-size: clamp(17px, 4.2vw, 21px); margin: 26px 0 12px; color: var(--ink); }
.article-body h3 { font-size: clamp(15px, 3.4vw, 17.5px); margin: 22px 0 9px; color: var(--ink); }
.article-body h4 { font-size: 15px; margin: 18px 0 8px; color: var(--ink); }
.article-body p { margin-bottom: 14px; line-height: 1.8; }
.article-body ul, .article-body ol { margin: 0 0 15px; padding-left: 21px; }
.article-body li { margin-bottom: 8px; line-height: 1.75; }
.article-body li::marker { color: var(--primary-600); }
.article-body img {
    border-radius: var(--r-md); margin: 16px 0;
    box-shadow: var(--sh-sm); max-width: 100%; height: auto;
}
.article-body figure { margin: 18px 0; max-width: 100%; }
.article-body figcaption {
    font-size: 12px; color: var(--muted); text-align: center;
    margin-top: 8px; font-style: italic;
}
.article-body blockquote {
    margin: 18px 0; padding: 14px 16px;
    background: var(--primary-50); border-left: 4px solid var(--primary-600);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body pre {
    background: var(--brand-800); color: #e2e8f0;
    padding: 14px; border-radius: var(--r-sm);
    font-size: 12.5px; margin-bottom: 15px;
}
.article-body code {
    background: var(--line-soft); padding: 2px 5px; border-radius: 4px;
    font-size: 13px; font-family: ui-monospace, Menlo, monospace;
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body a { border-bottom: 1px solid var(--primary-200); }
.article-body a:hover { border-bottom-color: var(--primary-600); }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.article-body iframe { max-width: 100%; border-radius: var(--r-md); }

/* Responsive video embeds pasted into articles */
.article-body iframe[src*="youtube"], .article-body iframe[src*="vimeo"] {
    width: 100%; aspect-ratio: 16 / 9; height: auto;
}

/* Multi-line widget links, used for article titles in the sidebar */
.widget-link-multi { align-items: flex-start !important; }
.widget-link-multi i { margin-top: 4px; }
.widget-link-multi span { line-height: 1.5; }
