/* ==========================================================================
   Ayduke — design system
   1. Tokens          5. Cards & grids
   2. Reset           6. Tool page (forms, results, tables, charts)
   3. Layout          7. Content (prose, FAQ, guides)
   4. Header/Footer   8. Utilities, print, motion
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */
:root {
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --brand-700: #0b5744;
    --brand-600: #0f6b52;
    --brand-500: #14805f;
    --brand-100: #e3f2ec;
    --accent-600: #0d5f8f;
    --accent-500: #1178ad;
    --accent-100: #e2eff7;

    --ink-900: #0d1420;
    --ink-800: #16202f;
    --ink-700: #26334a;
    --ink-600: #3d4b63;
    --ink-500: #5b6980;
    --ink-400: #7d8a9e;
    --ink-300: #aab4c3;
    --ink-200: #d6dce5;
    --ink-100: #e9edf3;
    --ink-050: #f4f6fa;

    --ok-600: #17784f;
    --ok-100: #e3f4ea;
    --warn-600: #a8620a;
    --warn-100: #fdf1de;
    --bad-600: #b52a25;
    --bad-100: #fdeceb;

    --bg: #ffffff;
    --bg-soft: var(--ink-050);
    --bg-tint: #f7f9fc;
    --surface: #ffffff;
    --surface-2: #fbfcfe;
    --border: var(--ink-200);
    --border-soft: var(--ink-100);
    --text: var(--ink-900);
    --text-soft: var(--ink-500);
    --text-mute: var(--ink-400);
    --primary: var(--brand-600);
    --primary-ink: #ffffff;
    --link: var(--accent-600);
    --accent: var(--brand-600);

    --radius-xs: 6px;
    --radius-sm: 9px;
    --radius: 13px;
    --radius-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow: 0 4px 16px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 18px 44px -14px rgba(13, 32, 56, .22);

    --container: 1220px;
    --gap: clamp(1rem, 2.4vw, 1.75rem);
    --header-h: 68px;

    --step--1: clamp(.82rem, .8rem + .1vw, .875rem);
    --step-0: clamp(.95rem, .93rem + .12vw, 1rem);
    --step-1: clamp(1.06rem, 1rem + .3vw, 1.19rem);
    --step-2: clamp(1.24rem, 1.14rem + .5vw, 1.5rem);
    --step-3: clamp(1.5rem, 1.3rem + .9vw, 2rem);
    --step-4: clamp(1.85rem, 1.5rem + 1.6vw, 2.7rem);
}



/* 2. Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.22; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.15rem; }
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
strong { font-weight: 650; }
small { font-size: var(--step--1); }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }
figure { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-100); color: var(--text); }

.icon { flex: none; }

/* 3. Layout ------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1rem, 3.2vw, 2rem);
}
.container--narrow { max-width: 860px; }

.main { min-height: 60vh; padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }

.section { padding: clamp(2.25rem, 4.5vw, 3.75rem) 0; }
.section--tint { background: var(--bg-tint); border-block: 1px solid var(--border-soft); }
.section--why { background: var(--bg-soft); border-top: 1px solid var(--border-soft); }
.section-head { max-width: 720px; margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }
.section-title { font-size: var(--step-3); margin-bottom: .35em; }
.section-sub { color: var(--text-soft); margin: 0; }
.section-actions { margin-top: clamp(1.25rem, 2.5vw, 2rem); display: flex; gap: .75rem; flex-wrap: wrap; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -60px; left: 1rem; z-index: 100;
    background: var(--primary); color: var(--primary-ink);
    padding: .65rem 1rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-weight: 600;
    transition: top .18s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* 4. Header ------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border-soft); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }

/* Brand / Logo */
.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; opacity: .85; }
.brand-logo { font-size: 1.3rem; letter-spacing: -.02em; line-height: 1; }
.brand-logo strong { font-weight: 800; }
.brand-dot { font-weight: 400; color: var(--text-mute); }

/* Desktop navigation */
.desktop-nav { display: flex; align-items: center; margin-left: 2rem; }
.nav-list { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-link {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .5rem .75rem; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 550; font-size: .9rem;
    background: none; border: 0; cursor: pointer; white-space: nowrap;
    transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav-link .chevron { transition: transform .2s ease; }
.nav-link[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
    position: absolute; top: calc(100% + .5rem); left: 0; z-index: 110;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.has-dropdown.is-open > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-dropdown { min-width: 540px; padding: 1rem; }
.dropdown--lang { min-width: 200px; right: 0; left: auto; padding: .5rem; }
.dropdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; }
.dropdown-item { display: flex; gap: .6rem; align-items: center; padding: .55rem .65rem; border-radius: var(--radius-sm); color: var(--text); transition: background .12s; }
.dropdown-item:hover { background: var(--bg-soft); text-decoration: none; }
.dropdown-label strong { display: block; font-size: .88rem; font-weight: 600; }
.dropdown-label small { color: var(--text-mute); font-size: .75rem; }
.dropdown-icon {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none;
    border-radius: 8px; color: var(--accent, var(--brand-600));
    background: color-mix(in srgb, var(--accent, var(--brand-600)) 10%, transparent);
}
.dropdown-footer {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    margin-top: .6rem; padding: .65rem .7rem; border-top: 1px solid var(--border-soft);
    font-weight: 600; font-size: .88rem; color: var(--brand-600); border-radius: var(--radius-sm);
}
.dropdown-footer:hover { background: var(--brand-100); text-decoration: none; }

/* Header actions (search + lang + hamburger) */
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.search-mini { position: relative; display: flex; align-items: center; }
.search-mini .search-icon { position: absolute; left: .65rem; color: var(--text-mute); pointer-events: none; }
.search-mini input {
    width: 180px; padding: .5rem .7rem .5rem 2.2rem;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-soft); color: var(--text); font-size: .88rem;
    transition: width .25s ease, border-color .15s, background .15s;
}
.search-mini input:focus { width: 240px; background: var(--surface); border-color: var(--brand-600); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 15%, transparent); }

.btn-icon {
    display: inline-flex; align-items: center; gap: .3rem; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 .5rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-soft); cursor: pointer;
    transition: color .12s, border-color .12s;
}
.btn-icon:hover { color: var(--text); border-color: var(--brand-600); }
.lang-code { font-size: .76rem; font-weight: 700; letter-spacing: .04em; }

.lang-list { list-style: none; margin: 0; padding: 0; }
.lang-list a { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--text); font-size: .88rem; transition: background .12s; }
.lang-list a:hover { background: var(--bg-soft); text-decoration: none; }
.lang-list a.is-active { background: var(--brand-100); font-weight: 650; color: var(--brand-700); }
.flag { font-size: 1.05rem; line-height: 1; }

/* Hamburger toggle */
.nav-toggle { display: none; }
.nav-toggle .close-icon { display: none; }
.nav-toggle[aria-expanded="true"] .hamburger-icon { display: none; }
.nav-toggle[aria-expanded="true"] .close-icon { display: block; }

/* Mobile overlay + drawer
   NOTE: both are rendered outside <header> (see partials/mobile-drawer.php).
   .site-header sets backdrop-filter, which would make it the containing block
   for these fixed elements and clip the drawer to the header's height. */
.mobile-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0, 0, 0, .45);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
}
.mobile-overlay.is-active { opacity: 1; pointer-events: auto; }
.mobile-drawer {
    position: fixed; top: 0; right: 0; z-index: 95;
    width: min(330px, 88vw);
    height: 100vh;      /* fallback */
    height: 100dvh;     /* tracks mobile browser chrome */
    background: var(--surface);
    box-shadow: -4px 0 28px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    display: flex; flex-direction: column;
    /* visibility keeps the panel out of the tab order when closed. Transitioning
       it defers the flip to hidden until the slide-out has finished. */
    visibility: hidden;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility .3s;
}
.mobile-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s;
}

.drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1rem 1.25rem; flex: none;
    border-bottom: 1px solid var(--border-soft);
}
.drawer-close { border: none; background: none; color: var(--text-mute); cursor: pointer; padding: .4rem; }
.drawer-close:hover { color: var(--text); }
.drawer-body {
    padding: 1rem 1.25rem 2rem;
    display: flex; flex-direction: column; gap: 1.5rem;
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.drawer-search { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: var(--bg-soft); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.drawer-search svg { color: var(--text-mute); flex: none; }
.drawer-search input { flex: 1; border: none; background: none; font-size: .9rem; color: var(--text); outline: none; }
.drawer-nav { display: flex; flex-direction: column; gap: .2rem; }
.drawer-link {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .75rem .6rem; font-size: 1rem; font-weight: 550;
    color: var(--text); border-radius: var(--radius-sm);
    transition: background .12s;
}
.drawer-link:hover { background: var(--bg-soft); text-decoration: none; }
.drawer-link-count {
    flex: none; min-width: 1.6rem; padding: .1rem .45rem;
    border-radius: 999px; background: var(--bg-soft);
    color: var(--text-mute); font-size: .74rem; font-weight: 700;
    text-align: center; font-variant-numeric: tabular-nums;
}
.drawer-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); font-weight: 700; margin-bottom: .6rem; }
.drawer-langs { display: flex; flex-wrap: wrap; gap: .4rem; }
.drawer-lang { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .6rem; font-size: .84rem; border-radius: var(--radius-sm); color: var(--text-soft); border: 1px solid var(--border-soft); transition: all .12s; }
.drawer-lang:hover { border-color: var(--brand-600); color: var(--text); text-decoration: none; }
.drawer-lang.is-active { background: var(--brand-100); border-color: var(--brand-600); color: var(--brand-700); font-weight: 600; }

@media (max-width: 1023px) {
    .desktop-nav { display: none; }
    .nav-toggle { display: inline-flex; }
    .search-mini { display: none; }
}
@media (min-width: 1024px) {
    /* Keep the drawer out of the way on desktop without using display:none,
       which would break the transform transition if the width ever changes. */
    .mobile-overlay { display: none; }
    .mobile-drawer { display: none; }
}

/* Search suggestions ---------------------------------------------------- */
.search-suggestions {
    position: absolute; top: calc(100% + .4rem); left: 0; right: 0; z-index: 120;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,.12); overflow: hidden; max-height: 380px; overflow-y: auto;
}
.search-suggestions a { display: block; padding: .6rem .8rem; color: var(--text); border-bottom: 1px solid var(--border-soft); }
.search-suggestions a:last-child { border-bottom: 0; }
.search-suggestions a:hover, .search-suggestions a.is-active { background: var(--bg-soft); text-decoration: none; }
.search-suggestions strong { display: block; font-size: .92rem; font-weight: 600; }
.search-suggestions span { font-size: .8rem; color: var(--text-mute); }
.search-suggestions .sg-cat { color: var(--brand-600); font-weight: 600; }

/* 5. Buttons, tags, cards ---------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .7rem 1.15rem; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .95rem; line-height: 1.2;
    border: 1px solid transparent; cursor: pointer; text-align: center;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(11, 87, 68, .3); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--ink-300); background: var(--bg-soft); }
.btn--sm { padding: .5rem .8rem; font-size: .87rem; }

.mini-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .55rem; border-radius: var(--radius-xs);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-soft); font-size: .78rem; font-weight: 600; cursor: pointer;
}
.mini-btn:hover { color: var(--text); border-color: var(--ink-300); }
.mini-btn.is-done { color: var(--ok-600); border-color: color-mix(in srgb, var(--ok-600) 45%, transparent); }

.tag {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .12rem .5rem; border-radius: 999px;
    background: var(--bg-soft); border: 1px solid var(--border-soft);
    font-size: .72rem; font-weight: 600; color: var(--text-soft); letter-spacing: .01em;
}
.tag--region { background: var(--accent-100); border-color: transparent; color: var(--accent-600); }

.chip-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
.chip-nav--center { justify-content: center; margin-top: 2rem; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .42rem .75rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: .85rem; font-weight: 600;
}
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.chip svg { color: var(--accent); }
.chip-count { color: var(--text-mute); font-weight: 600; font-size: .76rem; }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: clamp(1.1rem, 2.2vw, 1.6rem);
    box-shadow: var(--shadow-xs); margin-bottom: var(--gap);
}
.card-title { font-size: 1.03rem; font-weight: 700; margin: 0 0 1rem; letter-spacing: -.01em; }
.card--tool { border-top: 3px solid var(--accent, var(--brand-600)); }
.card--result { background: var(--surface-2); }
.card--note { background: var(--bg-soft); }
.card--sources { background: var(--bg-soft); font-size: var(--step--1); }
.card-more { display: inline-flex; align-items: center; gap: .3rem; margin-top: .85rem; font-size: .86rem; font-weight: 650; }

.card-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.card-grid--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr)); }

.tool-card {
    display: flex; gap: .8rem; align-items: flex-start;
    padding: 1rem 1.05rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs);
    transition: border-color .16s ease, box-shadow .18s ease, transform .16s ease;
}
.tool-card:hover {
    text-decoration: none; transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
    box-shadow: var(--shadow);
}
.tool-card-icon {
    display: grid; place-items: center; width: 38px; height: 38px; flex: none;
    border-radius: 10px; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tool-card-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.tool-card-title { font-weight: 650; font-size: .97rem; letter-spacing: -.01em; }
.tool-card-desc { font-size: .83rem; color: var(--text-soft); line-height: 1.5; }
.tool-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tool-card-arrow { margin-left: auto; color: var(--text-mute); opacity: 0; transform: translateX(-4px); transition: .16s ease; }
.tool-card:hover .tool-card-arrow { opacity: 1; transform: none; color: var(--accent); }

.category-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); }
.category-card {
    display: flex; flex-direction: column; gap: .3rem;
    padding: 1.15rem; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.category-card::after {
    content: ""; position: absolute; inset: auto -30% -60% auto; width: 150px; height: 150px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
    opacity: .5; transition: opacity .2s ease;
}
.category-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); }
.category-card:hover::after { opacity: 1; }
.category-icon {
    display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: .4rem;
    border-radius: 11px; color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0d5f8f));
}
.category-card strong { font-size: 1rem; }
.category-desc { font-size: .84rem; color: var(--text-soft); line-height: 1.5; }
.category-count { font-size: .76rem; color: var(--text-mute); font-weight: 650; margin-top: .35rem; }

/* Hero ------------------------------------------------------------------ */
.hero {
    position: relative;
    padding: clamp(2.5rem, 6vw, 4.75rem) 0 clamp(2rem, 4.5vw, 3.5rem);
    background:
        radial-gradient(1000px 420px at 78% -8%, color-mix(in srgb, var(--accent-500) 14%, transparent), transparent 70%),
        radial-gradient(720px 340px at 8% 0%, color-mix(in srgb, var(--brand-500) 13%, transparent), transparent 70%),
        var(--bg);
    border-bottom: 1px solid var(--border-soft);
    overflow: hidden;
}
.hero-inner { display: grid; gap: clamp(1.75rem, 4vw, 3rem); grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; }
.hero-copy { max-width: 660px; }
.hero-kicker {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .32rem .7rem; border-radius: 999px; margin: 0 0 1rem;
    background: var(--brand-100); color: var(--brand-700);
    font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}

.hero h1 { font-size: var(--step-4); margin-bottom: .5rem; }
.hero-lede { font-size: var(--step-1); color: var(--text-soft); margin-bottom: 1.6rem; max-width: 56ch; }

.hero-search {
    position: relative; display: flex; align-items: center; gap: .5rem;
    padding: .45rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
    max-width: 620px;
}
.hero-search .search-icon { position: absolute; left: 1.05rem; color: var(--text-mute); pointer-events: none; }
.hero-search input {
    flex: 1; min-width: 0; padding: .7rem .8rem .7rem 2.5rem;
    border: 0; background: none; color: var(--text); font-size: 1rem;
}
.hero-search input:focus { outline: none; }
.hero-search .btn { border-radius: 999px; flex: none; }
.hero-search--page { margin-bottom: 1.5rem; }
.hero-search .search-suggestions { left: .5rem; right: .5rem; }

.hero-pills { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 1.1rem 0 0; padding: 0; }
.hero-pills a {
    display: inline-block; padding: .32rem .7rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-soft); font-size: .82rem; font-weight: 550;
}
.hero-pills a:hover { text-decoration: none; color: var(--text); border-color: var(--ink-300); }

.hero-badges { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 1.5rem 0 0; padding: 0; font-size: .85rem; color: var(--text-soft); }
.hero-badges li { display: inline-flex; align-items: center; gap: .35rem; }
.hero-badges svg { color: var(--ok-600); }

.hero-panel { position: relative; }
.hero-panel-card {
    position: relative; z-index: 2;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-lg);
}
.hero-panel-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--border-soft); font-size: .9rem; }
.hero-panel-row span { color: var(--text-soft); }
.hero-panel-row strong { font-variant-numeric: tabular-nums; }
.hero-panel-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); margin: 1rem 0; overflow: hidden; }
.hero-panel-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); }
.hero-panel-result { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: .35rem; }
.hero-panel-result span { color: var(--text-soft); font-size: .85rem; }
.hero-panel-result strong { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; color: var(--brand-600); font-variant-numeric: tabular-nums; }

.hero-panel-glow {
    position: absolute; inset: 12% -8% -14% 8%; z-index: 1; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-500) 30%, transparent), color-mix(in srgb, var(--accent-500) 25%, transparent));
    filter: blur(38px); opacity: .5;
}
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-panel { display: none; }
}

/* Strips / why / guides ------------------------------------------------- */
.strip-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.strip-title { display: flex; align-items: center; gap: .55rem; font-size: 1rem; margin-bottom: .7rem; }
.strip-title a { color: var(--text); }
.strip-icon {
    display: grid; place-items: center; width: 30px; height: 30px; flex: none;
    border-radius: 8px; color: var(--accent, var(--brand-600));
    background: color-mix(in srgb, var(--accent, var(--brand-600)) 13%, transparent);
}
.strip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.strip-list a { display: block; padding: .3rem 0; font-size: .88rem; color: var(--text-soft); border-bottom: 1px solid var(--border-soft); }
.strip-list li:last-child a { border-bottom: 0; }
.strip-list a:hover { color: var(--link); text-decoration: none; }

.why-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.why-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.why-icon {
    display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: .75rem;
    border-radius: 11px; color: var(--brand-600); background: var(--brand-100);
}

.why-card h3 { font-size: 1rem; margin-bottom: .35rem; }
.why-card p { color: var(--text-soft); font-size: .89rem; margin: 0; }

.guide-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.guide-grid--index { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.guide-card {
    display: flex; flex-direction: column; gap: .4rem;
    padding: 1.25rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    box-shadow: var(--shadow-xs);
}
.guide-card:hover { text-decoration: none; border-color: var(--ink-300); box-shadow: var(--shadow); }
.guide-card-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-600); }

.guide-card strong, .guide-card h2 { font-size: 1.05rem; line-height: 1.35; margin: 0; }
.guide-card h2 a { color: var(--text); }
.guide-card-desc, .guide-card p { font-size: .87rem; color: var(--text-soft); margin: 0; }
.guide-card-more { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 650; color: var(--link); margin-top: auto; }

/* Page heads ------------------------------------------------------------ */
.breadcrumbs { padding: 1rem 0 .25rem; font-size: .82rem; color: var(--text-mute); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: .35rem; }
.breadcrumbs a { color: var(--text-soft); }
.crumb-sep { color: var(--ink-300); }

.page-head { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0 1.75rem; }
.page-head-icon {
    display: grid; place-items: center; width: 54px; height: 54px; flex: none;
    border-radius: 14px; color: #fff;
    background: linear-gradient(135deg, var(--accent, var(--brand-600)), color-mix(in srgb, var(--accent, var(--brand-600)) 55%, #0d5f8f));
    box-shadow: var(--shadow);
}
.page-head h1 { margin-bottom: .35rem; }
.page-head-meta { font-size: .84rem; color: var(--text-mute); margin: .5rem 0 0; }
.lede { font-size: var(--step-1); color: var(--text-soft); margin: 0; max-width: 70ch; }

.eyebrow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .82rem; font-weight: 600; margin: 0 0 .6rem; }
.eyebrow a { display: inline-flex; align-items: center; gap: .3rem; color: var(--accent, var(--brand-600)); }

.result-count { color: var(--text-soft); font-size: .9rem; margin-bottom: 1rem; }

.empty-state { text-align: center; padding: clamp(2rem, 5vw, 3.5rem) 1rem; color: var(--text-soft); }
.empty-state svg { color: var(--text-mute); margin-bottom: .75rem; }
.empty-state h1, .empty-state h2 { color: var(--text); }
.empty-state--page .hero-search { margin: 1.5rem auto; }
.error-code { display: block; font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; letter-spacing: -.05em; color: var(--brand-100); line-height: 1; }

.error-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* Catalogue ------------------------------------------------------------- */
.catalogue-search { position: relative; display: flex; align-items: center; gap: .6rem; max-width: 520px; margin-bottom: .5rem; }
.catalogue-search .search-icon { position: absolute; left: .8rem; color: var(--text-mute); }
.catalogue-search input {
    flex: 1; padding: .65rem .8rem .65rem 2.3rem; font-size: .95rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
}
.catalogue-count { font-size: .82rem; color: var(--text-mute); white-space: nowrap; }
.catalogue-group { padding: 1.75rem 0; border-top: 1px solid var(--border-soft); }
.catalogue-group:first-child { border-top: 0; }
.catalogue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-bottom: 1rem; }
.catalogue-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: var(--step-2); }
.catalogue-head h2 a { color: var(--text); }
.catalogue-head p { margin: 0; color: var(--text-soft); font-size: .88rem; }
.catalogue-empty { text-align: center; color: var(--text-soft); padding: 2rem 0; }

/* 6. Tool page --------------------------------------------------------- */
.tool-page { padding-top: .5rem; }
.tool-head {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start;
    padding: .5rem 0 1.5rem;
}
.tool-head-main { max-width: 800px; }
.tool-head h1 { margin-bottom: .4rem; }
.tool-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tool-facts { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; list-style: none; margin: .9rem 0 0; padding: 0; font-size: .82rem; color: var(--text-soft); }
.tool-facts li { display: inline-flex; align-items: center; gap: .3rem; }
.tool-facts svg { color: var(--ok-600); }

.tool-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 306px; align-items: start; }
.tool-layout--wide { grid-template-columns: minmax(0, 1fr); }
.tool-layout--wide .tool-aside { display: none; }
.tool-aside { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; gap: var(--gap); }
@media (max-width: 1023px) {
    .tool-layout { grid-template-columns: 1fr; }
    .tool-aside { position: static; }
}

/* Forms ---------------------------------------------------------------- */
.field-grid { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; grid-column: span 6; }
.field--full { grid-column: span 12; }
.field--half { grid-column: span 6; }
.field--third { grid-column: span 4; }
.field--quarter { grid-column: span 3; }
.field--hidden { position: absolute; left: -9999px; }
.field[hidden] { display: none; }
@media (max-width: 640px) {
    .field, .field--half, .field--third, .field--quarter { grid-column: span 12; }
}

.field-label { font-size: .85rem; font-weight: 600; color: var(--text); display: flex; gap: .25rem; align-items: baseline; }
.req { color: var(--bad-600); }
.field-help { font-size: .78rem; color: var(--text-mute); margin: 0; }

.control { position: relative; display: flex; align-items: stretch; }
.control input, .control select, .control textarea {
    width: 100%; min-width: 0; padding: .62rem .7rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--text); font-size: .95rem; font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-variant-numeric: tabular-nums;
}
.control input:hover, .control select:hover, .control textarea:hover { border-color: var(--ink-300); }
.control input:focus, .control select:focus, .control textarea:focus {
    outline: none; border-color: var(--accent-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 18%, transparent);
}
.control select {
    appearance: none; cursor: pointer; padding-right: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d8a9e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .65rem center;
}
.control textarea { resize: vertical; min-height: 7rem; line-height: 1.55; }
.control textarea.mono, .control input.mono { font-family: var(--font-mono); font-size: .88rem; }
.control--area { flex-direction: column; }
.area-tools { display: flex; gap: .4rem; margin-top: .4rem; }

.control--prefixed input { padding-left: 2.1rem; }
.control--suffixed input { padding-right: 2.6rem; }
.affix {
    position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
    color: var(--text-mute); font-size: .88rem; font-weight: 600; pointer-events: none;
}
.affix--prefix { left: .7rem; }
.affix--suffix { right: .75rem; }

.control--range { flex-direction: row; align-items: center; gap: .75rem; }
.control--range input[type="range"] { padding: 0; accent-color: var(--primary); }
.range-out { font-variant-numeric: tabular-nums; font-weight: 650; font-size: .9rem; min-width: 3.5rem; text-align: right; }

.field--check { justify-content: center; }
.check-label { display: inline-flex; align-items: flex-start; gap: .5rem; font-size: .9rem; cursor: pointer; }
.check-label input { width: 1.05rem; height: 1.05rem; margin-top: .18rem; accent-color: var(--primary); }

.radio-set { border: 0; padding: 0; margin: 0; }
.radio-set legend { padding: 0; margin-bottom: .4rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-pill span {
    display: inline-block; padding: .45rem .8rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: .87rem; font-weight: 550; cursor: pointer; color: var(--text-soft);
}
.radio-pill input:checked + span { background: var(--brand-100); border-color: color-mix(in srgb, var(--brand-600) 45%, transparent); color: var(--brand-700); font-weight: 650; }

.radio-pill input:focus-visible + span { outline: 2px solid var(--accent-500); outline-offset: 2px; }

.field-group { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 1rem; margin: 0 0 1rem; }
.field-group legend { padding: 0 .4rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.25rem; }
.form-status { font-size: .82rem; color: var(--text-mute); }
.form-status.is-busy { color: var(--accent-600); }

/* Results -------------------------------------------------------------- */
.result { display: grid; gap: 1.25rem; }
.result-headline {
    display: flex; flex-direction: column; gap: .15rem;
    padding: 1.15rem 1.25rem; border-radius: var(--radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-600) 12%, var(--surface)), color-mix(in srgb, var(--accent-600) 9%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--brand-600) 22%, var(--border));
}
.result-headline-label { font-size: .82rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-soft); }
.result-headline-value { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 780; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result-headline-value .unit { font-size: .45em; font-weight: 650; margin-left: .3rem; color: var(--text-soft); letter-spacing: 0; }
.result-headline-note { font-size: .86rem; color: var(--text-soft); }

.stat-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 175px), 1fr)); margin: 0; }
.stat {
    padding: .8rem .9rem; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border);
}
.stat dt { font-size: .78rem; color: var(--text-soft); font-weight: 600; margin-bottom: .2rem; }
.stat dd { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat-note { font-size: .74rem; color: var(--text-mute); margin: .2rem 0 0; }
.stat--good { border-color: color-mix(in srgb, var(--ok-600) 40%, transparent); background: var(--ok-100); }
.stat--good dd { color: var(--ok-600); }
.stat--warn { border-color: color-mix(in srgb, var(--warn-600) 40%, transparent); background: var(--warn-100); }
.stat--warn dd { color: var(--warn-600); }
.stat--bad { border-color: color-mix(in srgb, var(--bad-600) 40%, transparent); background: var(--bad-100); }
.stat--bad dd { color: var(--bad-600); }

.result-block { display: block; }
.result-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.result-block-title { font-size: .95rem; font-weight: 700; margin: 0; }
.result-block-actions { display: flex; gap: .35rem; }

.output {
    margin: 0; padding: .85rem 1rem; border-radius: var(--radius-sm);
    background: var(--ink-900); color: #e6edf6; border: 1px solid var(--ink-800);
    font-family: var(--font-mono); font-size: .84rem; line-height: 1.55;
    overflow-x: auto; max-height: 460px; overflow-y: auto; tab-size: 2;
}
.output--wrap { white-space: pre-wrap; word-break: break-word; }


.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.table-wrap--scroll { max-height: 480px; overflow: auto; }
.data-table { font-size: .87rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.data-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-soft); font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft);
}
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
.data-table tbody tr:hover { background: var(--brand-100); }
.data-table tfoot td { background: var(--bg-soft); font-weight: 700; border-top: 2px solid var(--border); }
.align-l { text-align: left; }
.align-r { text-align: right; }
.align-c { text-align: center; }
.table-note { font-size: .78rem; color: var(--text-mute); margin: .4rem 0 0; }

.chart-figure { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem 1rem; background: var(--surface); }
.chart-figure figcaption { font-size: .95rem; font-weight: 700; margin-bottom: .6rem; }
.chart-scroll { overflow-x: auto; }
.chart { width: 100%; height: auto; min-width: 420px; }
.chart-grid { stroke: var(--border-soft); stroke-width: 1; }
.chart-axis { stroke: var(--border); stroke-width: 1.2; }
.chart-tick { font-size: 11px; fill: var(--text-mute); font-family: var(--font-sans); }
.chart-centre { font-size: 17px; font-weight: 700; fill: var(--text); font-family: var(--font-sans); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; list-style: none; margin: 0 0 .6rem; padding: 0; font-size: .82rem; color: var(--text-soft); }
.chart-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend--stack { flex-direction: column; gap: .5rem; margin: 0; }
.chart-legend--stack li { display: grid; grid-template-columns: 12px 1fr auto; gap: .5rem; width: 100%; }
.legend-value { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text); }
.dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.chart-donut-wrap { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.chart-donut { min-width: 0; }
@media (max-width: 560px) { .chart-donut-wrap { grid-template-columns: 1fr; } }

.gauge { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; background: var(--surface); }
.gauge figcaption { font-size: .9rem; font-weight: 700; margin-bottom: .7rem; }
.gauge-track { position: relative; display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--bg-soft); }
.gauge-seg { display: block; height: 100%; }
.gauge-needle {
    position: absolute; top: -5px; bottom: -5px; width: 3px; transform: translateX(-50%);
    background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface);
}
.gauge-legend { display: flex; flex-wrap: wrap; gap: .3rem .85rem; list-style: none; margin: .7rem 0 0; padding: 0; font-size: .78rem; color: var(--text-soft); }
.gauge-legend li { display: inline-flex; align-items: center; gap: .35rem; }

.result-notes { display: grid; gap: .5rem; }
.note {
    display: flex; gap: .5rem; align-items: flex-start; margin: 0;
    padding: .65rem .8rem; border-radius: var(--radius-sm); font-size: .85rem;
    background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--text-soft);
}
.note svg { margin-top: .15rem; flex: none; }
.note--warn { background: var(--warn-100); border-color: color-mix(in srgb, var(--warn-600) 30%, transparent); color: var(--warn-600); }
.note--info svg { color: var(--accent-600); }
.note a { font-weight: 600; }

.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.alert p, .alert ul { margin: .2rem 0 0; font-size: .88rem; }
.alert ul { padding-left: 1.1rem; }
.alert--error { background: var(--bad-100); border: 1px solid color-mix(in srgb, var(--bad-600) 35%, transparent); color: var(--bad-600); }
.alert--success { background: var(--ok-100); border: 1px solid color-mix(in srgb, var(--ok-600) 35%, transparent); color: var(--ok-600); }
.alert strong { color: inherit; }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.link-list a {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .5rem .2rem; font-size: .89rem; color: var(--text-soft);
    border-bottom: 1px solid var(--border-soft);
}
.link-list li:last-child a { border-bottom: 0; }
.link-list a:hover { color: var(--link); text-decoration: none; }
.link-list a.is-active { color: var(--brand-600); font-weight: 650; }
.link-list .count { font-size: .76rem; color: var(--text-mute); }

.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: .85rem; color: var(--text-soft); }
.trust-list li { display: flex; gap: .5rem; align-items: flex-start; }
.trust-list svg { color: var(--brand-600); margin-top: .15rem; }


/* 7. Content ------------------------------------------------------------ */
.card--prose { padding: clamp(1.2rem, 2.5vw, 1.9rem); }
.card--prose h2 { font-size: var(--step-2); margin-bottom: .7rem; }
.prose { color: var(--text-soft); max-width: 74ch; }
.prose p { margin: 0 0 1em; }
.prose h3 { color: var(--text); font-size: var(--step-1); margin: 1.6em 0 .5em; }
.prose h4 { color: var(--text); font-size: 1rem; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--brand-600); }
.prose a { font-weight: 600; }
.prose strong { color: var(--text); }
.prose code {
    font-family: var(--font-mono); font-size: .86em; padding: .12em .38em;
    border-radius: 5px; background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--text);
}
.prose blockquote {
    margin: 1.4em 0; padding: .1rem 0 .1rem 1.1rem;
    border-left: 3px solid var(--brand-600); color: var(--text-soft); font-style: italic;
}
.prose table { margin: 1.2em 0; font-size: .9rem; }
.prose th, .prose td { padding: .5rem .65rem; border: 1px solid var(--border-soft); text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 700; color: var(--text); }
.prose--article { max-width: 76ch; font-size: 1.02rem; }
.prose--article h2 { color: var(--text); font-size: var(--step-2); margin: 1.9em 0 .6em; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.prose--article h2:first-child { margin-top: 0; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: .75rem; }
.steps li {
    position: relative; padding-left: 2.4rem; color: var(--text-soft);
    counter-increment: step; line-height: 1.6;
}
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: -.1rem;
    display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
    border-radius: 50%; background: var(--brand-100); color: var(--brand-700);
    font-size: .82rem; font-weight: 750;
}


.card--faq h2 { font-size: var(--step-2); margin-bottom: .9rem; }
.faq-list { display: grid; gap: .5rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.faq-item summary {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .8rem 1rem; cursor: pointer; font-weight: 620; font-size: .95rem; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--bg-soft); }
.faq-chevron { transition: transform .18s ease; color: var(--text-mute); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 1rem 1rem; font-size: .92rem; }

.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.sources a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.disclaimer-note { font-size: .78rem; color: var(--text-mute); margin: .8rem 0 0; }

.toc {
    background: var(--bg-soft); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.75rem;
}
.toc h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); margin-bottom: .5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.toc a { font-size: .9rem; color: var(--text-soft); }

.article-head { padding: .5rem 0 1.5rem; }
.article-meta { font-size: .82rem; color: var(--text-mute); margin: .8rem 0 0; }

.contact-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr); align-items: start; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }

.related { margin-bottom: var(--gap); }
.related .section-title { font-size: var(--step-2); }

/* Ads ------------------------------------------------------------------- */
/* Reserve vertical space to prevent CLS (Cumulative Layout Shift) which
   hurts Core Web Vitals and causes AdSense to penalise ad placements. */
.ad-slot {
    display: block; margin: var(--gap) 0; text-align: center;
    min-height: 90px; /* reserve at least the smallest standard banner height */
    contain: layout style;
    overflow: hidden;
}
.ad-slot .ad-label {
    display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em;
    color: var(--text-mute); margin-bottom: .3rem;
}
.ad-slot--sidebar { margin-top: 0; min-height: 250px; /* MPU height */ }
.ad-slot--in_feed { min-height: 100px; }
.ad-slot--in_result { min-height: 90px; }
.ad-slot--footer { min-height: 90px; margin-bottom: 1.5rem; }
.ad-slot ins { display: block; }

/* 8. Footer ------------------------------------------------------------- */
.site-footer {
    background: var(--bg-soft); border-top: 1px solid var(--border);
    padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; margin-top: auto;
    font-size: .9rem;
}
.footer-top { margin-bottom: 2rem; }
.footer-brand .brand-logo { font-size: 1.4rem; }
.footer-desc { color: var(--text-soft); max-width: 44ch; margin: .8rem 0 .5rem; font-size: .88rem; line-height: 1.6; }
.footer-stats { font-size: .8rem; color: var(--text-mute); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-heading { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); margin-bottom: .7rem; font-weight: 700; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer-links a { color: var(--text-soft); font-size: .86rem; transition: color .12s; }
.footer-links a:hover { color: var(--brand-600); text-decoration: none; }

.footer-langs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.footer-langs-label { font-size: .8rem; color: var(--text-mute); font-weight: 600; }
.footer-langs-list { display: flex; flex-wrap: wrap; gap: .3rem .8rem; list-style: none; margin: 0; padding: 0; }
.footer-langs-list a { font-size: .84rem; color: var(--text-soft); transition: color .12s; }
.footer-langs-list a:hover { color: var(--brand-600); text-decoration: none; }
.footer-langs-list a.is-active { color: var(--brand-600); font-weight: 700; }

.footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem;
    margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
    font-size: .8rem; color: var(--text-mute);
}
.footer-bottom p { margin: 0; }
.footer-note { max-width: 60ch; }

/* 9. Utilities, motion, print ------------------------------------------ */

/* Tool markup: SERP preview ------------------------------------------- */
.serp-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--surface);
    font-family: Arial, sans-serif;
    max-width: 600px;
}
.serp-preview--mobile { max-width: 400px; }
.serp-site { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.serp-favicon { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--border-soft); display: grid; place-items: center; }
.serp-favicon img { width: 16px; height: 16px; }
.serp-name { font-size: .82rem; color: var(--text-soft); }
.serp-url { font-size: .78rem; color: #4d5156; display: flex; align-items: center; gap: .3rem; word-break: break-all; }
.serp-title { font-size: 1.2rem; line-height: 1.3; color: #1a0dab; margin: .15rem 0 .25rem; cursor: pointer; font-weight: 400; }
.serp-title:hover { text-decoration: underline; }
.serp-desc { font-size: .87rem; line-height: 1.55; color: #4d5156; }
.serp-desc strong, .serp-desc b { font-weight: 700; color: #3c4043; }
.serp-preview--mobile .serp-title { font-size: 1rem; }
.serp-preview--mobile .serp-desc { font-size: .82rem; }

/* Tool markup: colour swatches ---------------------------------------- */
.colour-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.swatch-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.swatch {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    position: relative; cursor: pointer;
}
.swatch::after {
    content: attr(data-label);
    position: absolute; bottom: -1.4rem; left: 50%; transform: translateX(-50%);
    font-size: .65rem; color: var(--text-mute); white-space: nowrap;
}

/* Tool markup: gradient preview --------------------------------------- */
.gradient-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.gradient-presets { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.gradient-chip {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer; transition: transform .12s ease;
}
.gradient-chip:hover { transform: scale(1.15); }

/* Tool markup: contrast preview --------------------------------------- */
.contrast-preview {
    display: flex; align-items: center; justify-content: center;
    min-height: 100px; padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 1.25rem; font-weight: 600;
    text-align: center;
}
.contrast-preview-sm { font-size: .9rem; min-height: 60px; font-weight: 400; }

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

.is-hidden { display: none !important; }

@media print {
    .site-header, .site-footer, .tool-aside, .ad-slot, .tool-head-actions, .form-actions,
    .breadcrumbs, .related, .hero-search, .chip-nav, .skip-link, .toc { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; margin-bottom: 1rem; }
    .tool-layout { grid-template-columns: 1fr; }
    .output { background: #f5f5f5; color: #000; border-color: #ccc; max-height: none; }
    .data-table th { background: #eee; }
    .table-wrap--scroll { max-height: none; }
    a[href]::after { content: ""; }
}
