/* ============================================================
   TRUECALCULATOR.NET — DESIGN SYSTEM v2
   Indigo/violet, FLAT. NO shadows anywhere (hover-only allowed).
   Fonts: Montserrat (headings) + Valley Sans (everything else).
   ============================================================ */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --deep: #1E1B4B;
    --deep-2: #16133A;
    --accent: #7C3AED;
    --accent-tint: #F1EBFE;
    --ink: #12142B;
    --muted: #5B6478;
    --bg: #F5F6FC;
    --surface: #FFFFFF;
    --line: #E3E6F2;
    --tint: #EEF0FC;
    --ring: rgba(79, 70, 229, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --font-body: "Valley Sans", "DM Sans", system-ui, sans-serif;
    --font-display: "Montserrat", "Valley Sans", system-ui, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.22; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
main { display: block; }
.wrap, .site-header-inner, .tc-footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
::selection { background: var(--primary); color: #fff; }
/* Minimal resets (Tailwind Play CDN runs with preflight disabled) */
h5, h6, ul, ol { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Split hero: left ~70% copy + search, right ~30% calculator panel.
   The calculator spans the full hero band height and touches the right screen edge. */
.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 13fr) minmax(320px, 7fr);
    align-items: stretch;
    text-align: left;
    width: 100%;
    max-width: none;
}
.hero-text-col {
    align-self: center;
    padding: clamp(44px, 6vw, 84px) clamp(24px, 4vw, 64px) clamp(44px, 6vw, 84px) max(20px, calc((100vw - 1160px) / 2));
}
.hero-split .page-hero-copy { margin: 0; }
.hero-split .hero-search-wrap { margin: 24px 0 0; }
.hero-split .hero-pills { justify-content: flex-start; }
.hero-split .calc-card { height: 100%; }
@media (max-width: 980px) {
    .hero-split { grid-template-columns: 1fr; }
    .hero-text-col { text-align: center; padding: clamp(40px, 8vw, 64px) 20px 0; }
    .hero-split .hero-search-wrap { margin-left: auto; margin-right: auto; }
    .hero-split .hero-pills { justify-content: center; }
    .hero-split .calc-card { height: auto; margin-top: 36px; }
}

/* ============================================================
   HEADER + MEGA MENU
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--deep);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.site-brand:hover { color: #fff; }
.site-brand-logo { height: 40px; width: 40px; object-fit: contain; flex-shrink: 0; border-radius: 10px; }
.site-header .site-brand svg.site-brand-logo { width: 40px !important; height: 40px !important; min-width: 40px; }

.site-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav-list a {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #C7C9E8;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}
.site-nav-list a:hover,
.site-nav-list a:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.09); }
.site-nav-list a svg { width: 16px; height: 16px; }
.site-nav-list .material-symbols-rounded { font-size: 1.15rem; }
.site-nav-list a .material-symbols-rounded { font-size: 1.15rem; }
.btn .material-symbols-rounded { font-size: 1.05rem; }
.views-pill .material-symbols-rounded { font-size: 1rem; }
.nav-dropdown-toggle .material-symbols-rounded { font-size: 1.15rem; }
/* Drawer-only chrome stays out of the desktop header */
.site-nav-drawer-header, .site-nav-close { display: none; }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; }
.nav-dropdown-caret { transition: transform 0.2s ease; }
.nav-dropdown.is-open > .nav-dropdown-toggle .nav-dropdown-caret { transform: rotate(180deg); }
.nav-dropdown.is-open > .nav-dropdown-toggle { color: #fff; background: rgba(255, 255, 255, 0.09); }

/* MEGA PANEL: 2 columns, all categories + all calculators */
.nav-submenu { display: none; list-style: none; margin: 0; padding: 0; }
.nav-dropdown.is-open > .nav-submenu { display: block; }
@media (min-width: 861px) {
    .site-nav-list > li.nav-dropdown { position: static; }
    .nav-submenu {
        position: absolute;
        top: 100%;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(940px, calc(100vw - 40px));
        max-height: min(640px, calc(100vh - 110px));
        overflow-y: auto;
        background: var(--surface);
        border: 1px solid var(--line);
        border-top: 0;
        border-radius: 0 0 18px 18px;
        padding: 20px;
        z-index: 130;
        display: none;
        box-shadow: 0 24px 60px rgba(23, 20, 58, 0.22);
    }
    /* invisible hover bridge keeps the panel open while moving into it */
    .nav-submenu::before {
        content: "";
        position: absolute;
        top: -14px;
        left: 0;
        right: 0;
        height: 14px;
    }
    .nav-dropdown.is-open > .nav-submenu { display: block; }
    .nav-mega-group { break-inside: avoid; padding: 4px 0 12px; }
    .nav-mega-group h4 {
        display: flex;
        align-items: center;
        gap: 8px;
        font-family: var(--font-display);
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--deep);
        margin: 0 0 8px;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--tint);
    }
    .nav-mega-group h4 .material-symbols-rounded { font-size: 1.1rem; color: var(--accent); }
    .site-header .site-nav .nav-mega-group h4 a {
        color: var(--deep);
        padding: 0;
        background: none;
    }
    .site-header .site-nav .nav-mega-group h4 a:hover,
    .site-header .site-nav .nav-mega-group h4 a:focus-visible {
        color: var(--primary-dark);
        background: none;
    }
    .nav-mega-group ul { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 22px; }
    .nav-mega-group li { margin: 0 0 2px; break-inside: avoid; }
    .site-header .site-nav .nav-submenu a.nav-mega-link {
        display: block;
        color: var(--muted);
        font-size: 0.86rem;
        font-weight: 500;
        padding: 5px 8px;
        border-radius: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .site-header .site-nav .nav-submenu a.nav-mega-link:hover,
    .site-header .site-nav .nav-submenu a.nav-mega-link:focus-visible {
        color: var(--primary-dark);
        background: var(--tint);
    }
}

/* Mobile drawer */
.mobile-nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-nav-toggle-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
}
.mobile-nav-toggle-line { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; }
.site-nav-backdrop { display: none; }

@media (max-width: 860px) {
    .mobile-nav-toggle { display: flex; }
    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        background: var(--deep);
        transform: translateX(105%);
        transition: transform 0.25s ease;
        z-index: 200;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        padding: 16px;
    }
    .site-nav.is-open { transform: translateX(0); }
    .site-nav-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 2px 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        margin-bottom: 10px;
    }
    .site-nav-drawer-title {
        color: #fff;
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 1.05rem;
        letter-spacing: 0.02em;
        margin: 0;
    }
    .site-nav-close {
        background: rgba(255, 255, 255, 0.1);
        border: 0;
        border-radius: 10px;
        width: 44px;
        height: 44px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.15s ease;
    }
    .site-nav-close:hover { background: rgba(255, 255, 255, 0.2); }
    .site-nav-close-icon { font-size: 24px; color: #fff; }
    .site-nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
    .site-nav-list a { min-height: 48px; font-size: 1rem; padding: 12px 14px; }
    .site-nav-list a .material-symbols-rounded { font-size: 1.3rem; }
    .site-nav-list .nav-dropdown-caret { font-size: 1.3rem; margin-left: auto; }
    /* Category rows: tappable full-width, accordion submenus */
    .site-nav-list > li.nav-dropdown > .nav-dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
    }
    /* Submenus expand/collapse as accordions inside the drawer (full drawer width) */
    .site-header .site-nav .nav-submenu {
        background: rgba(255, 255, 255, 0.05);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        padding: 0 14px;
        margin: 0 -16px;
        transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease, margin 0.2s ease;
    }
    .site-header .site-nav .nav-dropdown.is-open > .nav-submenu {
        max-height: 70vh;
        opacity: 1;
        padding: 6px 14px 10px;
        margin: 6px -16px 4px;
        overflow-y: auto;
    }
    .nav-mega-group { padding: 2px 0 6px; }
    /* The toggle row already names the category; no header inside the panel */
    .nav-mega-group h4 { display: none; }
    .nav-mega-group ul { columns: 1; list-style: disc; padding-left: 1.2rem; margin: 0; }
    .site-header .site-nav .nav-mega-group li { margin: 0; }
    .site-header .site-nav .nav-mega-group li::marker { color: #fff; }
    .site-header .site-nav .nav-submenu a.nav-mega-link { color: #C7C9E8; font-size: 0.9rem; min-height: 40px; padding: 8px 4px; }
    .site-header .site-nav .nav-submenu a.nav-mega-link:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
    .site-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 15, 35, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 150;
        border: 0;
        cursor: default;
    }
    .site-nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
}
body.nav-drawer-open, body.tc-menu-locked { overflow: hidden; }

/* ============================================================
   HERO (centered, flat) + SEARCH WITH IN-FIELD SPINNER
   ============================================================ */
.homearea {
    background: var(--deep);
    color: #fff;
    padding: clamp(48px, 8vw, 88px) 0;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.homearea::after {
    content: "";
    position: absolute;
    right: -160px;
    top: -160px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.12);
    pointer-events: none;
}
.homearea::before {
    content: "";
    position: absolute;
    left: -140px;
    bottom: -180px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.2);
    pointer-events: none;
}
.homearea > main { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.homearea h1 { color: #fff; margin: 14px 0 12px; }
.homearea-overlap { padding-bottom: 96px; text-align: center; }
.homearea-overlap > main { max-width: 1200px; }
.page-hero-copy { color: #C7C9E8; font-size: 1.05rem; max-width: 680px; margin: 0 auto; }
.homearea-overlap .page-hero-copy { margin: 0 auto; }
/* Homepage split hero: band has no padding, the calculator panel fills it fully */
.homearea-split { padding: 0; }
.homearea-split > main { max-width: none; padding: 0; width: 100%; }

.section-eyebrow {
    display: inline-block;
    color: #A5B4FC;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.explorer-head .section-eyebrow, .quick-calc-copy .section-eyebrow { color: var(--primary-dark); }

/* Search: spinner lives INSIDE the field */
.hero-search-wrap { margin: 26px auto 0; max-width: 640px; position: relative; }
.hero-search-row { position: relative; display: flex; align-items: center; }
.hero-search-input {
    width: 100%;
    min-height: 58px;
    padding: 0 52px 0 52px;
    font-size: 17px;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    border: 2px solid var(--surface);
    border-radius: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B6478' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 17px center;
}
.hero-search-input::placeholder { color: #9AA1B5; opacity: 1; }
.hero-search-input:focus { outline: none; border-color: var(--primary); }
#loadingContainer, #loadingIcon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: var(--primary);
    pointer-events: none;
}
.hero-search-results {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    z-index: 80;
    text-align: left;
}
.sresult { padding: 13px 18px; color: var(--ink); font-weight: 600; font-size: 0.95rem; border-bottom: 1px solid var(--line); background: #fff; }
.sresult:last-child { border-bottom: 0; }
.sresult:hover, .sresult:focus-visible { background: var(--tint); color: var(--primary-dark); }
.spin { animation: tcspin 0.9s linear infinite; display: inline-flex; }
@keyframes tcspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* Popular pills under hero search */
.hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.hero-pills a {
    color: #E0E1F5;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.87rem;
    font-weight: 600;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.hero-pills a:hover { background: #fff; color: var(--deep); border-color: #fff; }

/* ============================================================
   WORKING CALCULATOR SECTION (straight, flat)
   ============================================================ */
.quick-calc-band { padding: 40px 20px 8px; }
.quick-calc-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.quick-calc-copy h2 { margin-bottom: 12px; }
.quick-calc-copy p { color: var(--muted); }
.quick-calc-copy ul { list-style: none; margin: 18px 0 0; padding: 0; }
.quick-calc-copy li { padding: 7px 0 7px 30px; position: relative; color: var(--ink); font-weight: 600; }
.quick-calc-copy li::before {
    content: "✓";
    position: absolute;
    left: 2px;
    top: 7px;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 800;
}
/* Quick calculator: white panel, dark navy header, square corners, keyboard-first */
.calc-card {
    background: #fff;
    color: var(--ink);
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}
.calc-card-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: #12102E;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #C7D2FE;
}
.calc-card-brand .material-symbols-rounded { font-size: 1.15rem; color: #A78BFA; }
.calc-card-display {
    display: block;
    width: 100%;
    border: 0;
    outline: none;
    border-bottom: 1.5px solid var(--line);
    background: #EDF1F5;
    padding: 26px 22px;
    text-align: right;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    font-weight: 700;
    color: var(--deep);
    overflow-x: auto;
    white-space: nowrap;
    cursor: default;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.calc-card-display:focus,
.calc-card-display:focus-visible {
    outline: none;
    border-radius: 0;
    background: var(--accent-tint);
    border-bottom-color: var(--accent);
}
.calc-card-display.is-error { color: #B91C1C; animation: calcShake 0.3s ease; }
@keyframes calcShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.calc-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 12px;
    padding: 30px;
    flex: 1;
}
.calc-btn-key {
    border: 1.5px solid #9CA3AF;
    border-radius: 12px;
    padding: 0;
    min-height: 68px;
    min-width: 44px;
    font-size: 1.12rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--deep);
    background: #E9EDF3;
    box-shadow: 0 3px 0 rgba(30, 27, 75, 0.22);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.05s ease, box-shadow 0.05s ease;
}
.calc-btn-key:hover { background: #DCE1E9; border-color: #6B7280; color: var(--deep); }
.calc-btn-key:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(30, 27, 75, 0.22); }
.calc-btn-key:focus-visible {
    outline: 3px solid #A5B4FC;
    outline-offset: -3px;
    border-radius: 12px;
    background: #DCE1E9;
}
.calc-key-fn {
    color: #6D28D9;
    border-color: rgba(124, 58, 237, 0.45);
    background: #E9EDF3;
    font-size: 1.3rem;
}
.calc-key-fn:hover { background: #DCE1E9; border-color: #7C3AED; color: #6D28D9; }
.calc-key-op { color: #fff; background: var(--accent); border-color: var(--accent); font-size: 1.5rem; }
.calc-key-op:hover { color: #fff; background: #6D28D9; border-color: #6D28D9; }
.calc-key-eq { grid-column: 1 / -1; color: #fff; background: var(--accent); border-color: var(--accent); font-size: 1.2rem; letter-spacing: 0.04em; }
.calc-key-eq:hover { color: #fff; background: #6D28D9; border-color: #6D28D9; }
@media (max-width: 860px) {
    .quick-calc-grid { grid-template-columns: 1fr; gap: 28px; }
    .quick-calc-copy { text-align: center; }
    .quick-calc-copy li { text-align: left; }
}

/* ============================================================
   EXPLORER: 2-column category accordions with bullet lists
   ============================================================ */
.explorer { max-width: 1200px; margin: 0 auto; padding: 48px 20px 20px; }
.explorer-head { text-align: center; margin-bottom: 26px; }
.explorer-head p { color: var(--muted); max-width: 640px; margin: 10px auto 0; }
.cat-accordions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}
.cat-acc {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.cat-acc.is-open { border-color: var(--primary); }
.cat-acc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--ink);
}
.cat-acc.is-open .cat-acc-head { color: var(--primary-dark); }
.cat-acc-icon { font-size: 1.3rem; color: var(--primary); }
.cat-acc-count {
    margin-left: auto;
    flex-shrink: 0;
    background: var(--tint);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 3px 10px;
}
.cat-acc-chevron {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--muted);
    transition: transform 0.2s ease;
}
.cat-acc.is-open .cat-acc-chevron { transform: rotate(180deg); color: var(--primary); }
.cat-acc-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
}
.cat-acc.is-open .cat-acc-body { grid-template-rows: 1fr; }
.cat-acc-body-inner { overflow: hidden; }
.cat-acc-list {
    list-style: none;
    margin: 0;
    padding: 2px 18px 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
}
.cat-acc-list li { border-top: 1px dashed var(--line); }
.cat-acc-list li:first-child,
.cat-acc-list li:nth-child(2) { border-top: 0; }
.cat-acc-list a {
    position: relative;
    display: block;
    padding: 8px 0 8px 15px;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}
.cat-acc-list a::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.55;
}
.cat-acc-list a:hover { color: var(--primary-dark); }
.cat-acc-list a:hover::before { opacity: 1; }
@media (max-width: 760px) {
    .cat-accordions { grid-template-columns: 1fr; }
    .cat-acc-list { gap: 0 14px; }
}
@media (max-width: 420px) {
    .cat-acc-list { grid-template-columns: 1fr; }
    .cat-acc-list li:nth-child(2) { border-top: 1px dashed var(--line); }
}

/* ============================================================
   HUB PAGES (popular / common): full-width accordions
   ============================================================ */
.hub-shell { max-width: 1200px; margin: 0 auto; padding: 34px 20px 56px; }
.hub-explorer { padding: 0; }

/* ============================================================
   CATEGORY PAGES: full-width bullet list of every calculator
   ============================================================ */
.cat-listing { padding: 0; margin-top: 0; }
.cat-listing > h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--deep);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--line);
}
.calc-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 28px;
}
.calc-bullets li { border-top: 1px dashed var(--line); }
.calc-bullets li:nth-child(-n+3) { border-top: 0; }
.calc-bullets a {
    position: relative;
    display: block;
    padding: 10px 0 10px 15px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}
.calc-bullets a::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.55;
}
.calc-bullets a:hover { color: var(--primary-dark); }
.calc-bullets a:hover::before { opacity: 1; }
@media (max-width: 900px) {
    .calc-bullets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calc-bullets li:nth-child(-n+3) { border-top: 1px dashed var(--line); }
    .calc-bullets li:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 560px) {
    .calc-bullets { grid-template-columns: 1fr; }
    .calc-bullets li:nth-child(-n+3) { border-top: 1px dashed var(--line); }
    .calc-bullets li:nth-child(-n+2) { border-top: 1px dashed var(--line); }
    .calc-bullets li:first-child { border-top: 0; }
}

/* ============================================================
   PAGE LAYOUT (calculator/category/sidebar pages)
   ============================================================ */
.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
}
.page-content { min-width: 0; }
.page-panel {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.page-sidebar { position: sticky; top: 86px; }
.page-shell { position: relative; }
.page-shell-single { grid-template-columns: minmax(0, 852px); justify-content: center; }
.page-sidebar h2 { font-size: 1.05rem; margin-bottom: 10px; }
.page-sidebar .cal-categories { grid-template-columns: 1fr; gap: 8px; margin: 0; }
.page-sidebar .cal-categories a { padding: 12px 14px; border-radius: 12px; }
.page-sidebar .cal-categories a:hover { transform: none; }
@media (max-width: 960px) {
    .page-shell { grid-template-columns: 1fr; }
    .page-sidebar { position: static; }
}

/* ============================================================
   CATEGORY GRID (homepage category tiles / sidebar lists)
   ============================================================ */
.cal-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.cal-categories a {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--ink);
    transition: border-color 0.15s ease, transform 0.15s ease;
    min-height: 44px;
}
.cal-categories a:hover { border-color: var(--primary); color: var(--primary-dark); transform: translateY(-2px); }
.cal-categories .material-symbols-rounded {
    font-size: 1.45rem;
    color: var(--primary);
    background: var(--tint);
    border-radius: 12px;
    padding: 8px;
    flex-shrink: 0;
}
.home-category-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .home-category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .home-category-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   LEGACY CARD GRID (category & hub pages) - flat, no badges
   ============================================================ */
.calculator-card-grid, .home-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 14px 0;
}
.calculator-box {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.calculator-box:hover { border-color: var(--primary); transform: translateY(-2px); }
.calculator-box .text-heading { font-size: 1.08rem; font-weight: 700; color: var(--ink); }
.calculator-box .text-heading:hover { color: var(--primary-dark); }
.cat-desc {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.card-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-badge, .chip-category {
    display: inline-block;
    background: var(--tint);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--primary);
    color: #fff !important;
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 12px 22px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    min-height: 46px;
    text-align: center;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .feather, .btn svg { width: 15px; height: 15px; }
.btn-ghost { background: transparent; color: var(--primary-dark) !important; border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: var(--tint); color: var(--primary-dark) !important; }
.calc-btn {
    background: var(--surface);
    color: var(--primary-dark);
    border: 1.5px dashed var(--primary);
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.15s ease;
}
.calc-btn:hover { background: var(--tint); }
.course-row, .assignment-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: end;
    padding: 12px;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}
@media (max-width: 560px) {
    .course-row, .assignment-row { grid-template-columns: 1fr; }
    .inputarea .grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   CALCULATOR FORMS (all 197)
   ============================================================ */
.calculator-area {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 32px);
}
.calculator-area > h2, .calculator-area h3 { font-family: var(--font-display); }
.inputarea { margin-bottom: 4px; }
.inputarea label, .calculator-area label {
    display: block;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 7px;
}
.inputarea input:not([type="submit"]):not([type="button"]),
.inputarea select,
.inputarea textarea,
.calculator-area input:not([type="submit"]):not([type="button"]),
.calculator-area select,
.calculator-area textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    font-size: 16px;
    font-family: var(--font-body);
    color: var(--ink);
    background: #F3F4F6;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.inputarea input:focus, .inputarea select:focus,
.calculator-area input:focus, .calculator-area select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
}
.inputarea button, .inputarea input[type="submit"],
.calculator-area button, .calculator-area input[type="submit"] {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-family: var(--font-body);
    border: 0;
    border-radius: 12px;
    padding: 13px 28px;
    cursor: pointer;
    min-height: 48px;
    transition: background 0.15s ease;
}
.inputarea button:hover, .inputarea input[type="submit"]:hover,
.calculator-area button:hover, .calculator-area input[type="submit"]:hover { background: var(--primary-dark); }
.inputarea .btn, .calculator-area .btn { background: var(--primary); }
.outputarea {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 32px);
    margin-top: 18px;
}
.outputarea .text-md { color: var(--ink); font-weight: 700; font-family: var(--font-display); }
.result-answer {
    background: transparent;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.7;
}
.result-answer ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.result-answer li::marker { color: var(--primary); }
.result-answer table { border-collapse: collapse; width: 100%; }
/* Clean structured result layout (real-math endpoints) */
.tc-result-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--tint);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}
.tc-result-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-dark);
}
.tc-result-value {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--deep);
    line-height: 1.15;
}
.tc-result-list { list-style: none; margin: 14px 0 0; padding: 0; }
.tc-result-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}
.tc-result-list li:last-child { border-bottom: 0; }
.tc-result-list li span { color: var(--muted); font-size: 0.95rem; }
.tc-result-list li b { color: var(--ink); font-size: 1rem; text-align: right; }
.tc-result-sub {
    margin: 16px 0 0;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--ink);
}
.tc-result-notes { list-style: none; margin: 6px 0 0; padding: 0; }
.tc-result-notes li { padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: 0.95rem; }
.tc-result-notes li:last-child { border-bottom: 0; }
.tc-result-notes b { color: var(--deep); }
.text-red-600 { color: #DC2626 !important; }

/* About-content block under the form */
.calc-about { margin-top: 30px; }
.calc-about h2 { font-size: 1.3rem; }
.calc-about p { color: #3B4256; line-height: 1.7; margin-top: 0.8rem; }
.calc-about ul { color: #3B4256; margin-top: 0.6rem; padding-left: 1.3rem; }
.calc-about li { margin: 0.3rem 0; }
.calc-about li::marker { color: var(--accent); }
/* About text lives in its own card, separate from the calculator card */
.calc-about-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 32px);
    margin-top: 18px;
}
.calc-about-card .calc-about { margin-top: 0; }
/* Related calculators: category accordions, separate section */
.related-explorer { padding: 0; margin-top: 30px; }
.related-explorer > h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0 0 16px;
}

/* ============================================================
   CALCULATOR PAGE TITLE BAND + SHARE
   ============================================================ */
.calc-topbar-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; justify-content: center; }
.views-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 15px;
    border-radius: 11px;
}
.views-pill svg { width: 15px; height: 15px; }
.sharearea { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sharebtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.sharebtn:hover { background: var(--accent); }
.sharebtn img { width: 19px; height: 19px; border-radius: 4px; display: block; }
.sharebtn .feather, .sharebtn svg { width: 17px; height: 17px; color: #fff; stroke: #fff; }

/* ============================================================
   SECTION HEADINGS + content
   ============================================================ */
.text-heading { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.border-t { border-top: 1.5px solid var(--line); }
.page-content > h2, .page-content .section-heading { margin-top: 28px; }
.page-content p { color: var(--muted); }
.page-panel p { color: var(--muted); }
.page-panel ul { color: var(--muted); }
.page-panel li::marker { color: var(--primary); }

/* ============================================================
   FOOTER (flat, no shadows)
   ============================================================ */
.tc-footer { background: var(--deep); color: #fff; font-family: var(--font-body); margin-top: 32px; }
.tc-footer-inner { max-width: 1200px; margin: 0 auto; padding: 48px 20px 24px; }
.tc-footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.tc-footer-brand-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.tc-footer-logo { height: 40px; width: 40px; object-fit: contain; flex-shrink: 0; }
.tc-footer-title { font-size: 1.25rem; font-weight: 800; color: #fff; font-family: var(--font-display); margin: 0; }
.tc-footer-tagline { font-size: 0.95rem; line-height: 1.65; color: #B9BCE0; max-width: 320px; margin: 0 0 18px; }
.tc-footer-share { display: flex; align-items: center; gap: 8px; }
.tc-footer-share-label { font-size: 0.9rem; color: #B9BCE0; margin-right: 2px; }
.tc-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}
.tc-share-btn:hover, .tc-share-btn:focus-visible { background: var(--accent); }
.tc-share-btn i, .tc-share-btn svg { width: 16px; height: 16px; stroke: #fff; fill: none; pointer-events: none; }
.tc-share-btn .tc-brand-icon { width: 17px; height: 17px; fill: #fff; stroke: none; }
.tc-share-btn .tc-whatsapp-icon { fill: #fff; stroke: none; }
.tc-footer-heading { font-size: 1rem; font-weight: 700; color: #fff; font-family: var(--font-display); margin: 0 0 14px; }
.tc-footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.tc-footer-links a { font-size: 0.93rem; color: #B9BCE0; text-decoration: none; }
.tc-footer-links a:hover { color: #fff; }
.tc-footer-contact { display: inline-block; margin-top: 14px; font-size: 0.93rem; color: #B9BCE0; text-decoration: none; }
.tc-footer-contact:hover { color: #fff; }
.tc-footer-divider { height: 1px; background: rgba(255, 255, 255, 0.14); margin: 32px 0 18px; }
.tc-footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.tc-footer-copy { font-size: 0.88rem; color: #B9BCE0; margin: 0; }
.tc-footer-bottom-links { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.tc-footer-bottom-links a { font-size: 0.88rem; color: #B9BCE0; }
.tc-footer-bottom-links a:hover { color: #fff; }
@media (max-width: 900px) {
    .tc-footer-top { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
    .tc-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
    .tc-footer-top { grid-template-columns: 1fr; }
    .tc-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Misc legacy hooks ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media print {
    .site-header, .tc-footer, .sharearea, .calc-topbar-meta { display: none !important; }
}
