/* ============================================================
   YakiemBattle design system v2 — semantic tokens only (RULES.md §1b.4)
   Dark-first "signal shield" identity. Bitdefender-informed structure
   (dual trust/action colour, plan comparison, money-back, logo wall)
   with a unique cyan-radar aesthetic on deep ink navy.
   Mobile-first: base = 375px, then ≥720px, ≥1024px.
   ============================================================ */

:root {
    /* Brand — signal cyan (radar/scan identity) */
    --brand:        #2BD4FF;
    --brand-hover:  #19BEEB;
    --brand-soft:   rgba(43, 212, 255, 0.10);
    --brand-glow:   rgba(43, 212, 255, 0.30);
    --brand-ink:    #04141D;   /* text on cyan fills (dark mode) */

    /* Surfaces — never pure black/white */
    --bg-base:      #070A12;   /* ink navy */
    --bg-surface:   #0C111C;
    --bg-raised:    #121927;
    --bg-hover:     #1A2334;
    --border:       #1E2A3E;
    --border-strong:#2E3D57;
    --bg-tint:      rgba(43, 212, 255, 0.06);

    /* Text (AA on surfaces) */
    --text-hi:      #EDF2F9;
    --text-mid:     #9AA8BE;
    --text-low:     #6B7A93;

    /* Status */
    --ok:           #2FD87A;
    --ok-soft:      rgba(47, 216, 122, 0.12);
    --warn:         #F2B13C;
    --warn-soft:    rgba(242, 177, 60, 0.12);
    --danger:       #FF5E5E;
    --danger-soft:  rgba(255, 94, 94, 0.12);
    --info:         #5B8DFF;
    --info-soft:    rgba(91, 141, 255, 0.12);

    /* Typography */
    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body:    "Manrope", system-ui, -apple-system, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

    /* Shape lock: buttons 10px · cards 16px · pills 5px (documented rule) */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 22px;

    /* Spacing — 4px grid */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

    /* Motion */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snap:  cubic-bezier(0.32, 0.72, 0, 1);
    --dur-fast:   150ms;
    --dur-med:    260ms;
    --dur-slow:   500ms;

    /* Layout */
    --container: 1180px;
    --nav-h: 64px;

    --shadow-card: 0 8px 30px -12px rgba(2, 6, 14, 0.55);
    --shadow-pop:  0 18px 60px -20px rgba(2, 6, 14, 0.8);
}

[data-theme="light"] {
    --brand:        #0077B6;
    --brand-hover:  #00619A;
    --brand-soft:   rgba(0, 119, 182, 0.10);
    --brand-glow:   rgba(0, 119, 182, 0.22);
    --brand-ink:    #FFFFFF;

    --bg-base:      #F2F5F9;
    --bg-surface:   #FFFFFF;
    --bg-raised:    #FFFFFF;
    --bg-hover:     #E7ECF3;
    --border:       #D9E0EA;
    --border-strong:#B4C1D4;
    --bg-tint:      rgba(0, 119, 182, 0.05);

    --text-hi:      #0C1420;
    --text-mid:     #45546C;
    --text-low:     #71809A;

    --shadow-card: 0 8px 30px -14px rgba(20, 40, 70, 0.18);
    --shadow-pop:  0 18px 60px -24px rgba(20, 40, 70, 0.28);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    overflow-x: clip;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-hi);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.scroll-lock { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
    text-wrap: balance;
}
h1 { font-size: 1.75rem; line-height: 1.15; margin: var(--sp-5) 0 var(--sp-3); }
h2 { font-size: 1.35rem; line-height: 1.2;  margin: var(--sp-5) 0 var(--sp-3); }
h3 { font-size: 1.1rem;  line-height: 1.3;  margin: var(--sp-4) 0 var(--sp-2); }
h4 { font-size: 1rem;    line-height: 1.35; margin: var(--sp-4) 0 var(--sp-2); }
h5, h6 { font-size: 0.92rem; line-height: 1.4; margin: var(--sp-3) 0 var(--sp-2); }
h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child { margin-top: 0; }
p { margin: 0 0 var(--sp-4); }
.mt-3 { margin-top: var(--sp-3); }
.mt-8 { margin-top: var(--sp-8); }
.mb-8 { margin-bottom: var(--sp-8); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.my-3 { margin-block: var(--sp-3); }
.my-4 { margin-block: var(--sp-4); }
.ml-2 { margin-left: var(--sp-2); }
.ml-auto { margin-left: auto; }
.mx-auto { margin-inline: auto; }
.flush { margin: 0; }
.flush--top { margin-top: var(--sp-3); }
.inline { display: inline; }
.fw-600 { font-weight: 600; }
.text-sm { font-size: 0.92rem; }
.text-095 { font-size: 0.95rem; }
.text-09 { font-size: 0.9rem; }
.text-085 { font-size: 0.85rem; }
.text-105 { font-size: 1.05rem; }
.text-xs { font-size: 0.72rem; }
.fine { font-size: 0.8rem; color: var(--text-low); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellipsis--340 { max-width: 340px; }
.ellipsis--220 { max-width: 220px; }
.maxw-320 { max-width: 320px; }
.maxw-520 { max-width: 520px; }
.maxw-34ch { max-width: 34ch; }
.center--22 { max-width: 22ch; margin-inline: auto; }
.grid-full { grid-column: 1 / -1; }
.chip-row { list-style: none; margin: 0; padding: 0; justify-content: center; gap: var(--sp-3) var(--sp-4); }
.otp { letter-spacing: 0.4em; text-align: center; }
.bg-tint { background: var(--bg-tint); }
.eyebrow { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.link--brand { color: var(--brand); font-weight: 700; }
ul, ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-mid); }
.low { color: var(--text-low); font-size: 0.875rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-xs); }
::selection { background: var(--brand-soft); color: var(--text-hi); }
hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

/* ---------- Typography ---------- */
.display-lg { font-size: clamp(2.4rem, 6vw, 3.9rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.display-md { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.025em; }
.display-sm { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; }
.lede { font-size: 1.1rem; color: var(--text-mid); max-width: 58ch; line-height: 1.6; }
.lede--lg { font-size: 1.2rem; }
.kicker {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--brand);
    margin-bottom: var(--sp-4);
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--bg-raised);
    --btn-fg: var(--text-hi);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 44px;                 /* touch target ≥ 44px */
    padding: 0.6rem 1.35rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--bg-hover); border-color: var(--text-low); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
    --btn-bg: var(--brand);
    --btn-fg: var(--brand-ink);
    border-color: var(--brand);
}
.btn--primary:hover { background: var(--bg-raised); color: var(--brand); border-color: var(--brand); box-shadow: 0 4px 18px -6px var(--brand-glow); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; border-color: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger); filter: brightness(0.92); }
[data-theme="light"] .btn--danger:hover {
    background: var(--bg-raised);
    border-color: var(--danger);
    color: var(--danger);
    filter: none;
}
.btn--outline-brand { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn--outline-brand:hover { background: var(--brand-soft); }
.btn--sm { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn--block { width: 100%; }
.btn--icon {
    width: 44px; height: 44px; padding: 0; flex-shrink: 0;
    border-radius: var(--radius-sm);
    display: inline-grid; place-items: center;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 5px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid var(--border-strong);
    color: var(--text-mid);
    background: var(--bg-raised);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge--ok     { color: var(--ok);     background: var(--ok-soft);     border-color: transparent; }
.badge--warn   { color: var(--warn);   background: var(--warn-soft);   border-color: transparent; }
.badge--danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge--brand  { color: var(--brand);  background: var(--brand-soft);  border-color: transparent; }
.badge--info   { color: var(--info);   background: var(--info-soft);   border-color: transparent; }
.badge--plain::before { display: none; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-5);
    box-shadow: var(--shadow-card);
}
.card--pad-sm { padding: var(--sp-4); }
.card--hover { transition: border-color var(--dur-fast), transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out); }
.card--hover:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.card--tint { background: linear-gradient(160deg, var(--bg-tint), transparent 55%), var(--bg-surface); border-color: var(--border-strong); }
.card__title { font-size: 1.1rem; margin-bottom: var(--sp-2); }

/* ---------- Site nav ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 80;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.site-nav.is-scrolled {
    background: color-mix(in srgb, var(--bg-base) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}
.site-nav.is-scrolled .site-nav__inner { height: 52px; }
.site-nav.is-scrolled .brand__mark { width: 26px; height: 26px; }
.site-nav__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sp-4);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    transition: height var(--dur-med) var(--ease-out);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}
.brand__mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--brand);
    color: var(--brand-ink);
    display: grid; place-items: center;
    font-weight: 800;
    box-shadow: 0 0 0 1px var(--brand-glow), 0 0 18px -4px var(--brand-glow);
    transition: width var(--dur-med) var(--ease-out), height var(--dur-med) var(--ease-out);
}
.brand__mark svg { width: 17px; height: 17px; }
.brand__accent { color: var(--brand); }
.brand__accent--bold { color: var(--brand); font-weight: 700; }
.site-nav__links { display: none; align-items: center; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.site-nav__links a,
.nav-drop__links a {
    display: inline-flex; align-items: center;
    min-height: 40px;
    padding: 0 var(--sp-3);
    border-radius: 5px;
    color: var(--text-mid);
    font-size: 0.92rem;
    font-weight: 600;
    position: relative;
    transition: color var(--dur-fast), background var(--dur-fast);
}
.site-nav__links a:hover,
.nav-drop__links a:hover { color: var(--text-hi); background: var(--bg-hover); }
.site-nav__links a.active,
.nav-drop__links a.active { color: var(--brand); }
.site-nav__links a::after,
.nav-drop__links a::after {
    content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 7px;
    height: 2px; border-radius: 2px;
    background: var(--brand);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--dur-med) var(--ease-out);
}
.site-nav__links a:hover::after,
.nav-drop__links a:hover::after,
.site-nav__links a.active::after,
.nav-drop__links a.active::after { transform: scaleX(1); }
.nav-drop__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-drop__links a { min-height: 48px; font-size: 1rem; }
.site-nav__actions { display: flex; align-items: center; gap: var(--sp-2); }
.site-nav__actions .btn--ghost:not([data-theme-toggle]),
.site-nav__actions .btn--primary { display: none; }

/* Menu button — two bare lines, long above short; morphs to X when open */
.nav-burger {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}
.nav-burger__icon { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 22px; }
.nav-burger__icon span {
    display: block; height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform var(--dur-med) var(--ease-snap), width var(--dur-med) var(--ease-out);
}
.nav-burger__icon span:nth-child(1) { width: 22px; }
.nav-burger__icon span:nth-child(2) { width: 12px; }
.nav-burger[aria-expanded="true"] .nav-burger__icon span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); width: 22px; }
.nav-burger[aria-expanded="true"] .nav-burger__icon span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); width: 22px; }
.nav-burger[aria-expanded="true"] .nav-burger__icon span:nth-child(3) { opacity: 0; }

/* ---------- Theme toggle (sun shown in dark, moon in light) ---------- */
.theme-toggle { width: 44px; padding: 0; flex-shrink: 0; }
.theme-ico { display: none; }
[data-theme="dark"] .theme-ico--sun { display: block; }
[data-theme="light"] .theme-ico--moon { display: block; }

/* Top-anchored mobile menu — drops down from the header */
.nav-scrim {
    position: fixed; inset: 0; z-index: 74;
    background: rgba(4, 8, 16, 0.6);
    opacity: 0; visibility: hidden;
    transition: opacity var(--dur-med) var(--ease-out), visibility var(--dur-med);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.nav-open .nav-scrim { opacity: 1; visibility: visible; }

.nav-drop {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 75;
    display: flex; flex-direction: column;
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
    background: color-mix(in srgb, var(--bg-surface) 94%, transparent);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.55);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--dur-med) var(--ease-snap), opacity var(--dur-med) var(--ease-out), visibility var(--dur-med);
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
}
.nav-drop.is-open { transform: none; opacity: 1; visibility: visible; }
.nav-drop__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--sp-2);
}
.nav-drop__label {
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--text-low);
}

/* Drop footer: CTA */
.nav-drop__foot {
    display: flex; align-items: center; gap: var(--sp-3);
    padding-top: var(--sp-4);
}
.nav-drop__foot .btn--primary { flex: 1; }

/* Staggered entrance */
.nav-drop__links li,
.nav-drop__foot { opacity: 0; transform: translateY(12px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.nav-drop.is-open .nav-drop__links li:nth-child(1) { transition-delay: 60ms; }
.nav-drop.is-open .nav-drop__links li:nth-child(2) { transition-delay: 100ms; }
.nav-drop.is-open .nav-drop__links li:nth-child(3) { transition-delay: 140ms; }
.nav-drop.is-open .nav-drop__links li:nth-child(4) { transition-delay: 180ms; }
.nav-drop.is-open .nav-drop__links li:nth-child(5) { transition-delay: 220ms; }
.nav-drop.is-open .nav-drop__links li:nth-child(6) { transition-delay: 260ms; }
.nav-drop.is-open .nav-drop__foot { transition-delay: 300ms; }
.nav-drop.is-open .nav-drop__links li,
.nav-drop.is-open .nav-drop__foot { opacity: 1; transform: none; }

/* ---------- Sidebar (admin / dashboard) ---------- */
.app-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.app-main { min-width: 0; padding: var(--sp-4) var(--sp-4) var(--sp-8); }
.side {
    display: flex; flex-direction: column;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    transition: width var(--dur-med) var(--ease-out);
}
.side__brand { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); min-height: var(--nav-h); border-bottom: 1px solid var(--border); }
.side__nav { list-style: none; margin: 0; padding: var(--sp-3); display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side__nav a {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 44px;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--text-mid);
    font-size: 0.92rem; font-weight: 600;
    white-space: nowrap;
    transition: background var(--dur-fast), color var(--dur-fast);
}
.side__nav a:hover { background: var(--bg-hover); color: var(--text-hi); }
.side__nav a.active { background: var(--brand-soft); color: var(--brand); }
.side__nav .nav-ico { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; }
.side__nav .nav-ico svg { width: 19px; height: 19px; }
.side__close {
    position: absolute; top: var(--sp-3); right: var(--sp-3);
    width: 38px; height: 38px;
    display: grid; place-items: center;
    padding: 0;
    border: none; border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-mid);
    cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast);
}
.side__close:hover { background: var(--bg-hover); color: var(--text-hi); }
.side__close svg { width: 18px; height: 18px; }
.side__signout { width: auto; margin: var(--sp-3); justify-content: flex-start; gap: var(--sp-3); padding-left: var(--sp-3); }
.side__signout .nav-ico svg { width: 17px; height: 17px; }

/* Mobile: sidebar becomes slide-in drawer */
.side-drawer-scrim {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(4, 8, 16, 0.55);
    opacity: 0; visibility: hidden;
    transition: opacity var(--dur-med) var(--ease-out), visibility var(--dur-med);
}
.side-drawer-scrim.is-open { opacity: 1; visibility: visible; }

@media (max-width: 1023px) {
    .side {
        position: fixed; inset: 0 auto 0 0; z-index: 80;
        width: min(220px, 80vw);
        transform: translateX(-105%);
        transition: transform var(--dur-med) var(--ease-snap);
        box-shadow: var(--shadow-pop);
    }
    body.side-open .side { transform: none; }
    .side-drawer-scrim { position: fixed; }
}

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-4); }
.container--narrow { max-width: 760px; }
.section { padding: var(--sp-7) 0; }
.section--tight { padding: var(--sp-5) 0; }
.section--cta { padding: var(--sp-9) 0; }
.section--alt { background: var(--bg-surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--ink { background: radial-gradient(60% 80% at 20% 0%, var(--bg-tint), transparent 60%), var(--bg-base); }
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr 1fr; }
.grid--pricing { grid-template-columns: 1fr; gap: var(--sp-4); align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack--sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.center { text-align: center; margin-inline: auto; }
.page-head { padding: var(--sp-6) 0 var(--sp-5); }
.page-head .lede { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: var(--sp-7) 0 var(--sp-8); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-7); align-items: center; }
.hero__copy .display-lg { margin-bottom: var(--sp-4); }
.hero__copy .lede { margin-bottom: var(--sp-5); }
.hero__cta { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.hero__cta .btn { width: 100%; }
.hero__trust { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-low); font-size: 0.85rem; flex-wrap: wrap; }
.hero__trust::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }

/* Ambient grid + glow (hero background) */
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(42% 55% at 78% 12%, var(--brand-glow), transparent 70%),
        radial-gradient(30% 40% at 12% 90%, rgba(91, 141, 255, 0.14), transparent 70%);
    opacity: 0.5;
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.16;
    mask-image: radial-gradient(70% 70% at 70% 20%, black, transparent 75%);
    -webkit-mask-image: radial-gradient(70% 70% at 70% 20%, black, transparent 75%);
}
.hero__grid > * { position: relative; z-index: 1; }

/* ---------- Product widget (live component preview, not fake screenshot) ---------- */
.pw {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
    max-width: 520px;
    margin-inline: auto;
    width: 100%;
}
.pw__bar {
    display: flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-low);
}
.pw__dot { width: 9px; height: 9px; border-radius: 50%; }
.pw__dot--r { background: #FF5E5E; } .pw__dot--y { background: var(--warn); } .pw__dot--g { background: var(--ok); }
.pw__body { padding: var(--sp-5); }
.pw__status {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    flex-wrap: wrap; margin-bottom: var(--sp-4);
}
.pw__shield {
    width: 54px; height: 54px; border-radius: 16px;
    display: grid; place-items: center;
    background: var(--ok-soft); color: var(--ok);
}
.pw__shield svg { width: 30px; height: 30px; }
.pw__scanline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.pw__scanline li {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    font-family: var(--font-mono); font-size: 0.78rem;
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.pw__radar {
    position: relative;
    height: 120px;
    margin-top: var(--sp-4);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 50% 50%, var(--brand-soft), transparent 62%),
        repeating-radial-gradient(circle at 50% 50%, transparent 0 42px, var(--border) 42px 43px);
    overflow: hidden;
}
.pw__radar::before {
    content: ""; position: absolute; inset: 0;
    background: conic-gradient(from 0deg, transparent 0deg, var(--brand-glow) 58deg, transparent 74deg);
    animation: radar-sweep 3.2s linear infinite;
}
.pw__blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand-glow); }
.pw__blip--1 { top: 24%; left: 30%; }
.pw__blip--2 { top: 62%; left: 58%; animation-delay: 0.6s; }
.pw__blip--3 { top: 40%; left: 76%; animation-delay: 1.4s; }
.pw__blip--4 { top: 74%; left: 34%; animation-delay: 2.2s; }
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@keyframes blip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.pw__blip { animation: blip-pulse 2.4s ease-in-out infinite; }

/* ---------- Logo wall ---------- */
.logo-wall { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-5) var(--sp-7); list-style: none; margin: 0; padding: 0; }
.logo-wall li { color: var(--text-low); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: var(--sp-2); opacity: 0.75; transition: opacity var(--dur-fast); }
.logo-wall li:hover { opacity: 1; }
.logo-wall .lw-mark { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 0.72rem; color: var(--text-mid); background: var(--bg-raised); }

/* ---------- Feature bento ---------- */
.bento { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
.bento .cell { min-height: 0; }
@media (min-width: 720px) {
    .bento { grid-template-columns: repeat(6, 1fr); }
    .bento .cell { grid-column: span 2; }
    .bento .cell--half { grid-column: span 3; }
}
.feat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: var(--sp-3); }
.feat-icon svg { width: 22px; height: 22px; }
.feat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.feat-list li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: 0.92rem; color: var(--text-mid); }
.feat-list li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--brand); margin-top: 9px; flex-shrink: 0; }

/* ---------- Stats band ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.stat { text-align: left; }
.stat__value { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 700; letter-spacing: -0.03em; color: var(--text-hi); }
.stat__value em { font-style: normal; color: var(--brand); }
.stat__label { color: var(--text-mid); font-size: 0.9rem; margin-top: var(--sp-1); }

/* ---------- Steps ---------- */
.steps { display: flex; flex-direction: column; gap: var(--sp-5); counter-reset: step; }
.step { display: flex; gap: var(--sp-4); align-items: flex-start; }
.step__num {
    counter-increment: step;
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center;
    font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem;
    color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-glow);
}
.step__num::before { content: counter(step, decimal-leading-zero); }
.step__body h3 { margin-bottom: var(--sp-1); font-size: 1.05rem; }

/* ---------- Pricing ---------- */
.pricing-card { display: flex; flex-direction: column; position: relative; }
.pricing-card--highlight { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 14px 44px -16px var(--brand-glow); }
.pricing-card__tag {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--brand); color: var(--brand-ink);
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 4px 14px; border-radius: 5px;
    box-shadow: 0 4px 14px -4px var(--brand-glow);
    white-space: nowrap;
}
.pricing-card__name { font-size: 1.2rem; margin-bottom: var(--sp-1); }
.pricing-card__devices { font-size: 0.85rem; color: var(--text-low); margin-bottom: var(--sp-4); }
.pricing-card__price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.pricing-card__per { font-size: 0.85rem; color: var(--text-low); margin-top: var(--sp-1); }
.pricing-card__old { font-size: 0.9rem; color: var(--text-low); text-decoration: line-through; margin-right: var(--sp-2); }
.pricing-card__save { color: var(--ok); font-weight: 700; font-size: 0.85rem; }
.pricing-card__features { list-style: none; padding: 0; margin: var(--sp-4) 0 var(--sp-5); flex: 1; }
.pricing-card__features li { display: flex; gap: var(--sp-2); align-items: flex-start; padding: 7px 0; font-size: 0.92rem; color: var(--text-mid); border-bottom: 1px dashed var(--border); }
.pricing-card__features li:last-child { border-bottom: none; }
.pricing-card__features li::before { content: "✓"; font-family: var(--font-mono); color: var(--brand); font-weight: 700; margin-top: -1px; }
.pricing-card__guarantee { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); font-size: 0.82rem; color: var(--text-low); margin-top: var(--sp-4); }

/* ---------- FAQ accordion ---------- */
.accordion { display: flex; flex-direction: column; gap: var(--sp-3); }
.acc-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.acc-item.is-open { border-color: var(--border-strong); }
.acc-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
    width: 100%; text-align: left;
    padding: var(--sp-4) var(--sp-5);
    background: none; border: none; cursor: pointer;
    font-family: var(--font-display); font-weight: 600; font-size: 1rem;
    color: var(--text-hi);
}
.acc-head .acc-ico { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
.acc-head .acc-ico::before, .acc-head .acc-ico::after {
    content: ""; position: absolute; background: var(--brand);
    transition: transform var(--dur-med) var(--ease-snap);
}
.acc-head .acc-ico::before { top: 8px; left: 0; width: 18px; height: 2px; }
.acc-head .acc-ico::after { top: 0; left: 8px; width: 2px; height: 18px; }
.acc-item.is-open .acc-ico::after { transform: scaleY(0); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height var(--dur-med) var(--ease-out); }
.acc-body__inner { padding: 0 var(--sp-5) var(--sp-4); color: var(--text-mid); font-size: 0.95rem; }
.acc-body__inner p:last-child { margin-bottom: 0; }

/* ---------- Testimonials ---------- */
.quote { position: relative; }
.quote blockquote { margin: 0 0 var(--sp-3); font-size: 1rem; color: var(--text-mid); line-height: 1.6; }
.quote__attr { display: flex; align-items: center; gap: var(--sp-3); }
.quote__avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
    background: var(--brand-soft); color: var(--brand);
}
.quote__name { font-weight: 700; font-size: 0.92rem; }
.quote__role { font-size: 0.82rem; color: var(--text-low); }

/* ---------- CTA band ---------- */
.cta-band {
    position: relative;
    text-align: center;
    padding: var(--sp-8) var(--sp-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, var(--bg-tint), transparent 60%), var(--bg-surface);
    border: 1px solid var(--border-strong);
    overflow: hidden;
}
.cta-band::before {
    content: ""; position: absolute; inset: -40% -20% auto; height: 120%;
    background: radial-gradient(50% 60% at 50% 0%, var(--brand-glow), transparent 70%);
    pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band .btn { min-width: min(280px, 100%); }

/* ---------- Support / help tiles ---------- */
.help-tile { display: flex; flex-direction: column; gap: var(--sp-3); height: 100%; }
.help-tile .feat-icon { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.table-wrap--scroll { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.card.table-wrap { padding: 0; overflow: hidden; }
.card.table-wrap > .table-wrap__inner { overflow-x: auto; padding: var(--sp-4); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
    text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-low); padding: var(--sp-3); border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}
.table td { padding: var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--dur-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
/* Dense tables scroll horizontally instead of distorting */
.table--dense { min-width: 880px; }
.table--dense--7col { min-width: 880px; }
.table--dense--9col { min-width: 1100px; }
.table--dense .btn--icon { width: 32px; height: 32px; }
.table--dense .btn--icon svg { width: 14px; height: 14px; }
@media (max-width: 1200px) { .table--admin-licenses th:nth-child(3), .table--admin-licenses td:nth-child(3) { display: none; } }
@media (max-width: 1024px) { .table--admin-licenses th:nth-child(5), .table--admin-licenses td:nth-child(5) { display: none; } }
/* Customer cell: name over email (desktop), two labeled rows (mobile) */
.customer-name, .customer-email { display: block; min-width: 0; overflow-wrap: anywhere; }
/* Licenses: no horizontal scroll on tablet — cards earlier than 719px */
@media (max-width: 1023px) {
    .table--cards--responsive thead { display: none; }
    .table--cards--responsive tbody { display: flex; flex-direction: column; gap: var(--sp-4); }
    .table--cards--responsive tr { display: grid; grid-template-columns: 1fr; gap: var(--sp-1); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }
    .table--cards--responsive td { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; min-width: 0; }
    .table--cards--responsive td > * { min-width: 0; overflow-wrap: anywhere; }
    .table--cards--responsive td::before { content: attr(data-label); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-low); }
    .table--cards--responsive tr:hover { background: var(--bg-surface); }
}
/* Mobile: tables with data-label collapse to stacked cards */
@media (max-width: 719px) {
    .table--cards thead { display: none; }
    .table--cards tbody { display: flex; flex-direction: column; gap: var(--sp-4); }
    .table--cards tr { display: grid; grid-template-columns: 1fr; gap: var(--sp-1); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }
    .table--cards td { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); border: none; padding: var(--sp-2) 0; flex-wrap: wrap; min-width: 0; }
    .table--cards td > * { min-width: 0; overflow-wrap: anywhere; }
    .table--cards td::before { content: attr(data-label); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-low); flex-shrink: 0; }
    .table--cards td[data-empty]::before { display: none; }
    .table--cards tr:hover { background: var(--bg-surface); }
    .table--cards .key { white-space: normal; word-break: break-all; }
    .table--cards td.customer-cell .customer-name,
    .table--cards td.customer-cell .customer-email { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; min-width: 0; }
    .table--cards td.customer-cell .customer-email { flex-basis: 100%; }
    .table--cards td.customer-cell .customer-email::before { content: attr(data-label); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-low); flex-shrink: 0; }
    .table--cards.table--dense { min-width: 0; }
}
/* Overview tables: fit the card — drop the lowest-priority column before a scrollbar appears */
@media (max-width: 899px) and (min-width: 720px) {
    .table--fit th:nth-child(5), .table--fit td:nth-child(5) { display: none; }
}

/* ---------- Code / keys ---------- */
.key {
    font-family: var(--font-mono);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    padding: 5px 9px;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    word-break: break-all;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    transition: border-color var(--dur-fast), color var(--dur-fast);
    user-select: all;
}
.key:hover { border-color: var(--brand); color: var(--brand); }
.key--nowrap { white-space: nowrap; word-break: normal; }
.qr-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4); width: fit-content; }
.qr-box img { display: block; }
.code-block {
    font-family: var(--font-mono);
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--sp-4);
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- Flash ---------- */
.flash {
    display: flex; align-items: center; gap: var(--sp-2);
    padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5); font-size: 0.92rem; font-weight: 600;
    border: 1px solid transparent;
}
.flash--success { background: var(--ok-soft); color: var(--ok); border-color: rgba(47,216,122,0.28); }
.flash--error   { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,94,94,0.28); }
.flash--warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(242,177,60,0.28); }
.flash--info    { background: var(--info-soft); color: var(--info); border-color: rgba(91,141,255,0.28); }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 0.875rem; font-weight: 700; margin-bottom: var(--sp-2); }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-raised);
    color: var(--text-hi);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-low); }
.field .hint { font-size: 0.8rem; color: var(--text-low); margin-top: var(--sp-1); }
.field .error-text { font-size: 0.82rem; color: var(--danger); margin-top: var(--sp-1); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.checkbox-row { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.9rem; min-height: 44px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5) var(--sp-4); }
.auth-theme-toggle { position: fixed; top: var(--sp-4); right: var(--sp-4); z-index: 40; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card--lg { max-width: 640px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: var(--sp-5); }
.auth-card .card { padding: var(--sp-6) var(--sp-5); }
.auth-title { text-align: center; font-size: 1.5rem; margin-bottom: var(--sp-1); }
.auth-sub { text-align: center; color: var(--text-mid); font-size: 0.92rem; margin-bottom: var(--sp-5); }
.auth-footer { text-align: center; margin-top: var(--sp-5); font-size: 0.9rem; color: var(--text-low); }
.auth-footer a { color: var(--text-mid); font-weight: 600; }
.auth-footer a:hover { color: var(--brand); }

/* ---------- Page & section titles ---------- */
.page-title { font-size: 1.6rem; line-height: 1.25; margin: 0 0 var(--sp-3); }
.section-title { font-size: 1.05rem; margin: var(--sp-6) 0 var(--sp-3); color: var(--text-hi); }
.section-title--lg { font-size: 1.15rem; }
.center--narrow { max-width: 24ch; margin-inline: auto; }
.lede--center { margin: 0 auto var(--sp-5); }
.card--link { text-decoration: none; }
.step-list { line-height: 1.8; }

/* ---------- Forms ---------- */
.form-row { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
.form-row .form-group { margin-bottom: 0; }
@media (min-width: 720px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-mid); letter-spacing: 0.02em; }
.form-required { color: var(--brand); margin-left: 2px; }
.form-required--opt { color: var(--text-low); font-weight: 400; font-size: 0.8em; margin-left: 6px; }
.input {
    width: 100%; min-height: 46px;
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-hi);
    font: inherit; font-size: 0.95rem;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
textarea.input { min-height: 150px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--text-low); }
.input:hover { border-color: var(--border-strong); }
.input:focus,
.input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }
.input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--bg-base) inset; -webkit-text-fill-color: var(--text-hi); }
.input[aria-invalid="true"],
.input[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-hint { font-size: 0.82rem; color: var(--text-low); line-height: 1.5; }
.auth-card__title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--sp-1); }
.auth-card__alt { margin-top: var(--sp-4); text-align: center; font-size: 0.9rem; color: var(--text-low); }
.auth-card__alt a { color: var(--text-mid); font-weight: 600; }
.auth-card__alt a:hover { color: var(--brand); }

/* ---------- Dashboard ---------- */
.app-topbar {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: var(--nav-h);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-base) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky; top: 0; z-index: 50;
}
.app-topbar__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0; }
.app-topbar__spacer { flex: 1; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); align-items: start; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.stat { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }
.stat__label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-low); }
.stat__value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-top: var(--sp-1); letter-spacing: -0.02em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: var(--sp-9); background: var(--bg-surface); }
.site-footer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); padding: var(--sp-7) var(--sp-4); max-width: var(--container); margin: 0 auto; }
.site-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-low); margin-bottom: var(--sp-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.site-footer a { color: var(--text-mid); font-size: 0.9rem; transition: color var(--dur-fast); }
.site-footer a:hover { color: var(--brand); }
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__bottom { border-top: 1px solid var(--border); padding: var(--sp-4); text-align: center; color: var(--text-low); font-size: 0.82rem; }

/* ---------- Error pages ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5); }
.error-shell { text-align: center; max-width: 500px; }
.error-code { font-family: var(--font-mono); font-size: clamp(4rem, 12vw, 6rem); font-weight: 700; color: var(--brand); margin-bottom: var(--sp-2); letter-spacing: -0.04em; line-height: 1; }
.error-title { font-size: 1.6rem; }
.error-message { color: var(--text-mid); }

/* ---------- Misc ---------- */
.divider { border: none; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
.avatar-initials { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand); font-family: var(--font-display); }

/* ---------- Reveal on scroll (JS adds .in-view) ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal--s1 { transition-delay: 70ms; }
.reveal--s2 { transition-delay: 140ms; }
.reveal-stagger > *:nth-child(1) { transition-delay: 70ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 140ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 210ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 280ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 350ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 420ms; }
.reveal-stagger > *:nth-child(n+7) { transition-delay: 490ms; }

/* ============================================================
   Breakpoints — mobile-first expansion
   ============================================================ */
@media (min-width: 720px) {
    .container { padding: 0 var(--sp-5); }
    .app-main { padding: var(--sp-5) var(--sp-5) var(--sp-9); }
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
    .grid--pricing { grid-template-columns: repeat(3, 1fr); }
    .hero__cta { flex-direction: row; }
    .hero__cta .btn { width: auto; }
    .steps { flex-direction: row; }
    .steps > .step { flex: 1; }
    .step { flex-direction: column; gap: var(--sp-3); }
    .site-nav__actions .btn--ghost:not([data-theme-toggle]),
    .site-nav__actions .btn--primary { display: inline-flex; }
    .site-nav__links { display: flex; }
    .nav-burger { display: none; }
    .app-shell .nav-burger { display: inline-grid; }
    .nav-drop, .nav-scrim { display: none; }
    .stats { grid-template-columns: repeat(4, 1fr); }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .site-footer__grid { grid-template-columns: repeat(4, 1fr); }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
    .hero__grid { grid-template-columns: 1.05fr 0.95fr; }
    .hero--form .hero__grid { grid-template-columns: 0.9fr 1.1fr; }
    .hero { padding: var(--sp-9) 0 var(--sp-9); }
    .section { padding: var(--sp-9) 0; }
    .dash-grid { grid-template-columns: 230px 1fr; gap: var(--sp-6); }
    .app-shell { grid-template-columns: 230px 1fr; transition: grid-template-columns var(--dur-med) var(--ease-out); }
    .side { position: sticky; top: 0; height: 100vh; width: 230px; }
    .dash-side { position: static; }
    .side__close { display: none; }

    /* Collapsible sidebar rail */
    body.side-collapsed .app-shell { grid-template-columns: 64px 1fr; }
    body.side-collapsed .side { width: 64px; }
    body.side-collapsed .side__brand { justify-content: center; padding: 0; }
    body.side-collapsed .brand__name { display: none; }
    body.side-collapsed .side__nav a { justify-content: center; gap: 0; padding: 0; }
    body.side-collapsed .side__nav a > span:last-child { display: none; }
    body.side-collapsed .side__signout { justify-content: center; gap: 0; padding: 0; }
    body.side-collapsed .side__signout > span:last-child { display: none; }
}

/* ---------- Modal (A11y: role=dialog, aria-modal, focus trap, ESC, overlay) ---------- */
.modal[hidden] { display: none !important; }
.modal {
    position: fixed; inset: 0; z-index: 120;
    display: flex; align-items: center; justify-content: center;
    padding: var(--sp-4);
}
.modal__overlay {
    position: absolute; inset: 0;
    background: rgba(4, 8, 16, 0.62);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: modal-fade-in 180ms var(--ease-out);
}
.modal__dialog {
    position: relative; z-index: 1;
    width: min(720px, 100%); max-height: min(90dvh, 860px);
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: var(--sp-5);
    animation: modal-pop-in 260ms var(--ease-snap);
    transform-origin: center;
}
.modal__dialog--sm { width: min(480px, 100%); }
.modal__header {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.modal__title { font-size: 1.2rem; margin: 0; }
.modal__close {
    width: 38px; height: 38px; display: grid; place-items: center;
    border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-mid); cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast);
}
.modal__close:hover { background: var(--bg-hover); color: var(--text-hi); }
.modal__body { display: grid; min-width: 0; overflow-x: hidden; }
.modal__dialog { overflow-x: hidden; }
#copy-modal-value { min-width: 0; overflow-x: hidden; }
.modal__footer { margin-top: var(--sp-4); }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop-in {
    from { opacity: 0; transform: scale(0.95) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal.is-closing .modal__overlay { animation: modal-fade-out 160ms var(--ease-out) forwards; }
.modal.is-closing .modal__dialog { animation: modal-pop-out 160ms var(--ease-out) forwards; }
@keyframes modal-fade-out { to { opacity: 0; } }
@keyframes modal-pop-out { to { opacity: 0; transform: scale(0.97) translateY(4px); } }

/* ---------- Toast stack (role=status live) ---------- */
.toast-stack {
    position: fixed; bottom: var(--sp-4); right: var(--sp-4); z-index: 130;
    display: flex; flex-direction: column; gap: var(--sp-2);
    max-width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: var(--sp-2);
    padding: 0.9rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.92rem; font-weight: 600;
    border: 1px solid transparent;
    box-shadow: var(--shadow-pop);
    pointer-events: auto;
    animation: toast-in 220ms var(--ease-snap);
    transform-origin: bottom right;
}
.toast--success { background: var(--ok-soft); color: var(--ok); border-color: rgba(47,216,122,0.22); }
.toast--error   { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,94,94,0.22); }
.toast--info    { background: var(--info-soft); color: var(--info); border-color: rgba(91,141,255,0.22); }
.toast.is-out { animation: toast-out 180ms var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: scale(0.97) translateY(6px); } }

/* ---------- Toggle switch (desktop-matched: 44x26 track, 18px knob, 180ms ease-out) ---------- */
.ag-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}
.ag-toggle__track {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-hover);
    transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.ag-toggle[aria-checked="true"] .ag-toggle__track {
    background: var(--brand);
    border-color: var(--brand);
}
.ag-toggle__knob {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    transition: transform 180ms var(--ease-out);
    pointer-events: none;
}
.ag-toggle[aria-checked="true"] .ag-toggle__knob {
    transform: translateX(18px);
}
.ag-toggle:hover .ag-toggle__track {
    border-color: var(--brand);
}
.ag-toggle[aria-checked="true"]:hover .ag-toggle__track {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}
.ag-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 13px;
}
.ag-toggle:active .ag-toggle__knob {
    transform: scale(0.97);
}
.ag-toggle[aria-checked="true"]:active .ag-toggle__knob {
    transform: translateX(18px) scale(0.97);
}
.ag-toggle[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Gateway section (outer Card like desktop Quick Protection) ---------- */
.gateway-section { margin-bottom: var(--sp-5); }
.gateway-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-bottom: var(--sp-1);
}
.gateway-section__title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-hi);
    line-height: 1.2;
}
.gateway-section__count {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-low);
}
.gateway-section__desc {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-mid);
    margin-bottom: var(--sp-4);
}
.gateway-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-4);
}

/* ---------- Gateway card (inner Card like protectionToggleCard) ---------- */
.gateway-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: var(--sp-5);
    transition: border-color 180ms var(--ease-out);
}
.gateway-card:hover {
    border-color: var(--border-strong);
}
.gateway-card--active {
    border-color: var(--brand);
}
.gateway-card--active:hover {
    border-color: var(--brand-hover);
}
.gateway-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.gateway-card__info {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
}
.gateway-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 700;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-mid);
}
.gateway-card--active .gateway-card__icon {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}
.gateway-card__name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-hi);
    line-height: 1.2;
}
.gateway-card__desc {
    font-size: 12px;
    color: var(--text-low);
    margin-top: 2px;
}
.gateway-card__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.gateway-card__badge--active {
    background: var(--ok-soft);
    color: var(--ok);
}
.gateway-card__badge--inactive {
    background: var(--bg-hover);
    color: var(--text-low);
}
.gateway-card__status {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border);
}
.gateway-card__status-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-mid);
}
.gateway-card__expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--sp-3);
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    color: var(--text-low);
    cursor: pointer;
}
.gateway-card__expand-btn:hover { color: var(--text-mid); }
.gateway-card__expand-btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}
.gateway-card__fields {
    display: none;
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
    margin-top: var(--sp-4);
}
.gateway-card--expanded .gateway-card__fields {
    display: block;
}
.gateway-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}