/*
 * PhishAIris design system: vibrant dark purple network.
 *
 * A high-contrast deep purple console over a live glowing node network.
 * Shared by every template; page files only add layout for their own content.
 */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    color-scheme: dark;

    --paper:      #0d0714;   /* page ground: deep black-purple */
    --paper-deep: #130a1e;   /* recessed bands, table hover */
    --sheet:      #1a0d2a;   /* panels on the ground */
    --field:      #12081d;   /* inputs */
    --rule:       #3b1c5a;   /* hairlines */
    --rule-strong:#5c2b8a;

    --ink:        #f5f0ff;   /* bright crisp body text */
    --ink-2:      #d1beed;   /* secondary text */
    --ink-3:      #a282c8;   /* muted text */

    /* Brand accents: Electric Violet to Neon Pink/Magenta */
    --accent:     #f900e4;   /* bright violet */
    --accent-2:   #d613c6;   /* neon pink/magenta */
    --accent-2-text: #f04fdc; /* accent-2 lightened so small text on dark surfaces reaches 4.5:1 */
    --accent-green:#34d399;   /* vibrant emerald contrast */
    --on-accent:  #10031f;   /* text on accent fills */
    --accent-fill: linear-gradient(135deg, #c084fc 0%, #d8b4fe 45%, #e879f9 100%);
    --violet-rgb: 192,132,252;
    --pink-rgb:   232,121,249;

    /* Deep purple plates: navbar, footer, certificate, auth panel. */
    --intaglio:   #170b28;
    --intaglio-2: #23123d;
    --on-intaglio:#f8f5ff;
    --on-intaglio-2:#cbb5ea;

    --teal:       #c084fc;
    --plum:       #f472b6;
    --foil:       #c084fc;

    --genuine:    #34d399;   /* Safe */
    --genuine-bg: rgba(52,211,153,0.15);
    --unverified: #fbbf24;   /* Uncertain */
    --unverified-bg: rgba(251,191,36,0.15);
    --forged:     #f87171;   /* Phishing */
    --forged-bg:  rgba(248,113,113,0.15);
    --uv:         #f97995;   /* focus + scan beam */

    --font-display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
    --font-ui:      'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
    --font-mono:    'Martian Mono', 'Cascadia Mono', Consolas, monospace;

    --r-doc: 14px;
    --r-field: 4px;
    --shadow-doc: 0 1px 0 rgba(255,255,255,0.05) inset, 0 18px 40px -20px rgba(0,0,0,0.95);
    --shadow-lift: 0 1px 0 rgba(255,255,255,0.08) inset, 0 26px 50px -24px rgba(0,0,0,0.98);

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);

    /* Legacy names still referenced by inline styles/scripts. */
    --text-primary: var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);
    --blue: var(--accent);
    --danger: var(--forged);
    --warning: var(--unverified);
}

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

html {
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--rule-strong) transparent;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background:
        radial-gradient(1100px 620px at 85% -10%, rgba(var(--violet-rgb), 0.22), transparent 40%),
        radial-gradient(900px 560px at -10% 40%, rgba(147, 51, 234, 0.18), transparent 40%),
        radial-gradient(850px 500px at 110% 50%, rgba(var(--pink-rgb), 0.14), transparent 45%),
        var(--paper);
    -webkit-font-smoothing: antialiased;
}

main, .site-main { position: relative; z-index: 1; flex: 1; }

/* ── Page background: dynamic layered ambient purple ─── */
.ground {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.ground > * { position: absolute; }

.ground-aurora { inset: -20%; }
.ground-aurora span {
    position: absolute;
    width: 65vmax; height: 65vmax;
    border-radius: 50%;
    opacity: 0.85;
    filter: blur(40px);
}
.ground-aurora span:nth-child(1) { left: -10%; top: -20%; background: radial-gradient(circle, rgba(192,132,252,0.32), transparent 65%); }
.ground-aurora span:nth-child(2) { right: -15%; top: 10%; background: radial-gradient(circle, rgba(232,121,249,0.28), transparent 65%); }
.ground-aurora span:nth-child(3) { left: 20%; bottom: -35%; background: radial-gradient(circle, rgba(147,51,234,0.25), transparent 65%); }

.ground-grid {
    left: -40%; right: -40%; bottom: 0;
    height: 55vh;
    perspective: 500px;
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.95), transparent 85%);
    mask-image: linear-gradient(to top, rgba(0,0,0,0.95), transparent 85%);
}
.ground-grid-plane {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 200%;
    transform-origin: 50% 100%;
    transform: rotateX(64deg);
    background-image:
        linear-gradient(rgba(192,132,252,0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232,121,249,0.3) 1px, transparent 1px);
    background-size: 64px 64px;
}

.ground-network { inset: 0; }
.ground-network canvas { display: block; width: 100%; height: 100%; }

.ground-scan {
    left: 0; right: 0; top: 0;
    height: 3px; /* Reduced height to create a sharp, thin laser line */
    background: #d8b4fe;
    box-shadow: 
        0 0 4px #d8b4fe,
        0 0 10px #c084fc,
        0 0 20px rgba(var(--violet-rgb), 0.8),
        0 0 40px rgba(var(--violet-rgb), 0.4);
    opacity: 0;
}

@keyframes scan-beam {
    0% { 
        transform: translateY(-10px); 
        opacity: 0; 
    }
    5% { 
        opacity: 1; 
    }
    85% { 
        opacity: 1; 
    }
    90%, 100% { 
        transform: translateY(100vh); 
        opacity: 0; 
    }
}

.ground-vignette {
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(13,7,20,0.75) 100%);
}

@media (prefers-reduced-motion: no-preference) {
    .ground-aurora span:nth-child(1) { animation: aurora-a 22s ease-in-out infinite alternate; }
    .ground-aurora span:nth-child(2) { animation: aurora-b 28s ease-in-out infinite alternate; }
    .ground-aurora span:nth-child(3) { animation: aurora-c 32s ease-in-out infinite alternate; }
    .ground-grid-plane { animation: grid-roll 2.2s linear infinite, grid-pulse 4s ease-in-out infinite alternate; }
    .ground-scan { animation: scan-beam 7s var(--ease-in-out) infinite; }
}

@keyframes aurora-a { 
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(18vw, 14vh) scale(1.2); } 
}
@keyframes aurora-b { 
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-20vw, 18vh) scale(0.85); } 
}
@keyframes aurora-c { 
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(12vw, -22vh) scale(1.25); } 
}
@keyframes grid-roll { to { background-position: 0 64px, 0 0; } }
@keyframes grid-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(192,132,252,0.6)); }
}
@keyframes scan-beam {
    0% { transform: translateY(-180px); opacity: 0; }
    10% { opacity: 1; }
    60% { transform: translateY(110vh); opacity: 1; }
    61%, 100% { transform: translateY(110vh); opacity: 0; }
}

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-2); }

::selection { background: rgba(192,132,252,0.4); color: #fff; }
:focus-visible { outline: 2px solid var(--uv); outline-offset: 2px; }
input, textarea, select { caret-color: var(--uv); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 10px; border: 3px solid var(--paper); }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 2000;
    background: var(--intaglio); color: var(--on-intaglio);
    padding: 10px 16px; border-radius: var(--r-doc); text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-intaglio); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Type ───────────────────────────────────────────────── */
.display, h1.display {
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 0.98;
    color: var(--accent);
    text-wrap: balance;
    text-shadow: 0 0 20px rgba(192,132,252,0.3);
}

.title {
    font-family: var(--font-display);
    font-stretch: 112%;
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.1;
    color: var(--ink);
    text-wrap: balance;
}

.caps {
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 36em; text-wrap: pretty; }

.microprint {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 5.5px;
    line-height: 1;
    letter-spacing: 0.12em;
    color: var(--accent-2);
    opacity: 0.8;
    user-select: none;
    contain: inline-size;
    max-width: 100%;
}

/* ── Navigation band ────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13,7,20,0.85);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: var(--on-intaglio);
    border-bottom: 1px solid var(--rule);
}
.site-header::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--accent-fill);
    box-shadow: 0 0 10px rgba(232,121,249,0.8);
    opacity: 0.9;
}

.navbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 12px var(--gutter);
    min-height: 64px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--on-intaglio);
    text-decoration: none;
    font-family: var(--font-display);
    font-stretch: 118%;
    font-weight: 800;
    font-size: 19px;
    letter-spacing: 0.01em;
    margin-right: auto;
}
.nav-brand:hover { color: #fff; text-shadow: 0 0 12px rgba(192,132,252,0.6); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
}
.brand-mark .icon { width: 34px; height: 34px; }
/* Wordmark: the lettering from the project banner (static/img/wordmark.png),
   at the banner's size relative to the logo. */
.brand-wordmark { display: block; height: 22px; width: auto; }
.nav-brand:hover .brand-wordmark { filter: drop-shadow(0 0 8px rgba(255,95,175,0.45)); }

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 3px;
    color: var(--on-intaglio-2);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 160ms ease, background-color 160ms ease;
}
.nav-links a .icon { width: 16px; height: 16px; opacity: 0.8; }
.nav-links a:hover { color: #fff; background: rgba(192,132,252,0.15); }

.nav-links a.active,
.nav-links a[aria-current="page"] { color: var(--accent-2-text); background: rgba(192,132,252,0.18); box-shadow: inset 0 -2px 0 var(--accent-2); }
.nav-links a.active .icon { opacity: 1; }
.nav-links a.nav-admin { color: var(--unverified); }
.nav-links a.nav-admin.active { color: var(--unverified); background: var(--unverified-bg); box-shadow: inset 0 -2px 0 var(--unverified); }

.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: 8px; }

.nav-user {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 3px;
    color: var(--on-intaglio);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(192,132,252,0.3);
}
.nav-user:hover { color: #fff; border-color: rgba(232,121,249,0.6); }

.nav-avatar {
    width: 28px; height: 28px; border-radius: 3px; overflow: hidden;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--sheet); color: var(--accent);
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar-initial { font-family: var(--font-display); font-weight: 800; font-size: 13px; }
.nav-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-login, .nav-logout {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 3px;
    color: var(--on-intaglio-2); text-decoration: none; font-size: 15px; font-weight: 600;
}
.nav-login:hover, .nav-logout:hover { color: #fff; background: rgba(192,132,252,0.15); }
.nav-login .icon, .nav-logout .icon, .nav-signup .icon { width: 16px; height: 16px; }

.nav-signup {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 3px;
    background: var(--accent-fill); color: var(--on-accent);
    text-decoration: none; font-size: 15px; font-weight: 700;
    box-shadow: 0 0 12px rgba(192,132,252,0.4);
    transition: transform 160ms var(--ease-out), filter 160ms ease, box-shadow 160ms ease;
}
.nav-signup:hover { color: var(--on-accent); filter: brightness(1.1); box-shadow: 0 0 20px rgba(232,121,249,0.6); }
.nav-signup:active { transform: scale(0.97); }

.nav-links a, .nav-login, .nav-logout, .nav-signup { white-space: nowrap; }

@media (min-width: 961px) and (max-width: 1200px) {
    .navbar { gap: 12px; }
    .nav-links a { padding: 8px 9px; font-size: 14px; }
    .nav-links a .icon, .nav-logout .icon { display: none; }
    .nav-user { padding-right: 4px; }
    .nav-user-name { display: none; }
    .nav-auth { margin-left: 0; gap: 4px; }
}

/* ── Mobile nav drawer ──────────────────────────────────── */
.nav-toggle, .nav-drawer, .nav-backdrop { display: none; }

@media (max-width: 960px) {
    .navbar { flex-wrap: nowrap; }
    .nav-toggle, .nav-drawer-close {
        display: inline-flex; align-items: center; justify-content: center;
        width: 42px; height: 42px; padding: 0;
        color: var(--on-intaglio); background: rgba(192,132,252,0.1);
        border: 1px solid rgba(192,132,252,0.3); border-radius: 3px; cursor: pointer;
    }
    .nav-drawer-close { color: var(--accent); background: transparent; border-color: var(--rule); }
    .nav-toggle .icon, .nav-drawer-close .icon { width: 20px; height: 20px; }

    .nav-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1001;
        background: rgba(13,7,20,0.65);
        opacity: 0; visibility: hidden;
        transition: opacity 240ms ease, visibility 0s linear 240ms;
    }
    .nav-backdrop.open { opacity: 1; visibility: visible; transition: opacity 240ms ease; }

    .nav-drawer {
        display: flex; flex-direction: column;
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 1002;
        width: min(84vw, 340px);
        padding: 16px;
        overflow-y: auto;
        background: var(--sheet);
        border-left: 1px solid var(--rule);
        box-shadow: -20px 0 40px -20px rgba(0,0,0,0.8);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 280ms;
    }
    .nav-drawer.open { transform: none; visibility: visible; transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1); }
    .nav-drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .nav-drawer-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

    .nav-drawer .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-drawer .nav-links a { color: var(--ink); padding: 13px 12px; font-size: 16px; }
    .nav-drawer .nav-links a:hover { background: var(--paper); color: var(--accent); }
    .nav-drawer .nav-links a.active { background: rgba(192,132,252,0.18); color: var(--accent-2); }
    .nav-drawer .nav-auth {
        flex-direction: column; align-items: stretch; margin: 14px 0 0; padding-top: 14px;
        border-top: 1px solid var(--rule); gap: 6px;
    }
    .nav-drawer .nav-user { color: var(--ink); border-color: var(--rule); }
    .nav-drawer .nav-avatar { background: var(--accent-fill); color: var(--on-accent); }
    .nav-drawer .nav-login, .nav-drawer .nav-logout { color: var(--ink); padding: 12px; font-size: 16px; }
    .nav-drawer .nav-signup { background: var(--accent-fill); color: var(--on-accent); justify-content: center; padding: 12px; }
    .nav-drawer .nav-user-name { max-width: none; }
    body.nav-drawer-lock { overflow: hidden; }
}

/* ── Footer band ────────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 72px;
    background: var(--intaglio);
    color: var(--on-intaglio-2);
    border-top: 1px solid var(--rule);
    overflow: hidden;
}
.footer-inner {
    position: relative;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
    max-width: 1320px; margin: 0 auto; padding: 22px var(--gutter);
    font-size: 14px;
}
.footer-inner strong { color: var(--on-intaglio); font-family: var(--font-display); font-stretch: 118%; }
.footer-inner a { color: var(--on-intaglio); }
.site-footer .microprint { color: var(--on-intaglio-2); opacity: 0.6; padding: 6px var(--gutter) 8px; position: relative; }

/* ── Documents ──────────────────────────────────────────── */
.doc {
    --panel-edge: linear-gradient(155deg, rgba(192,132,252,0.7), rgba(92,43,138,0.6) 28%, rgba(59,28,90,0.6) 68%, rgba(232,121,249,0.6));
    --panel-fill: linear-gradient(180deg, #1c0e2f 0%, #150a24 45%, #10071c 100%);
    position: relative;
    background:
        radial-gradient(90% 55% at 0% 0%, rgba(192,132,252,0.12), transparent 60%) padding-box,
        radial-gradient(70% 50% at 100% 100%, rgba(232,121,249,0.08), transparent 60%) padding-box,
        var(--panel-fill) padding-box,
        var(--panel-edge) border-box;
    border: 1px solid transparent;
    border-radius: var(--r-doc);
    box-shadow:
        inset 0 1px 0 rgba(216,180,254,0.15),
        0 24px 48px -30px rgba(0,0,0,0.98),
        0 0 0 1px rgba(13,7,20,0.6);
}

.doc-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(192,132,252,0.2);
    background: linear-gradient(90deg, rgba(192,132,252,0.12), rgba(232,121,249,0.04) 45%, transparent 75%);
}
.doc > .doc-head:first-child { border-radius: calc(var(--r-doc) - 1px) calc(var(--r-doc) - 1px) 0 0; }
.doc-head .panel-title, .section-title { display: flex; align-items: center; gap: 10px; }
.doc-head .panel-title::before, .section-title::before {
    content: '';
    flex: none;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-fill);
    box-shadow: 0 0 0 3px rgba(192,132,252,0.25), 0 0 12px rgba(232,121,249,0.9);
}
.doc > .microprint { padding: 5px 20px 0; }

.doc-serial {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--forged);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 0 14px rgba(192,132,252,0.35); }
.btn-primary:hover:not(:disabled) { color: var(--on-accent); filter: brightness(1.1); box-shadow: 0 0 22px rgba(232,121,249,0.55); }

.btn-secondary { background: transparent; color: var(--accent); border-color: var(--rule-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); background: var(--sheet); color: var(--accent-2); box-shadow: 0 0 12px rgba(192,132,252,0.25); }

.btn-quiet { background: transparent; color: var(--ink-2); padding-inline: 10px; min-height: 40px; }
.btn-quiet:hover:not(:disabled) { color: var(--accent); background: var(--paper-deep); }

.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }

/* ── Fields ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--font-display); font-stretch: 118%; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }

.input, .form-input, .url-input, .feedback-comment, .chat-input, .bar-date-picker {
    --field-fill: linear-gradient(180deg, #150924, #10061c);
    --field-edge: linear-gradient(135deg, rgba(192,132,252,0.55), rgba(92,43,138,0.9) 42%, rgba(92,43,138,0.9) 62%, rgba(232,121,249,0.48));
    --field-icon: none;
    --field-glow: 0 0 0 0 transparent;
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    background: var(--field-icon) no-repeat 15px 50% / 18px 18px padding-box, var(--field-fill) padding-box, var(--field-edge) border-box;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -12px 24px -18px rgba(192,132,252,0.35), var(--field-glow);
    color: var(--ink);
    caret-color: var(--accent-2);
    color-scheme: dark;
    font-size: 16px;
    line-height: 1.4;
    transition: box-shadow 200ms var(--ease-out), background-color 200ms ease;
}
.input::placeholder, .form-input::placeholder, .url-input::placeholder,
.feedback-comment::placeholder, .chat-input::placeholder { color: #8e74ae; opacity: 1; }
.input:hover:not(:disabled):not(:focus), .form-input:hover:not(:disabled):not(:focus), .url-input:hover:not(:focus),
.feedback-comment:hover:not(:focus), .chat-input:hover:not(:focus), .bar-date-picker:hover:not(:focus) {
    --field-edge: linear-gradient(135deg, rgba(192,132,252,0.85), rgba(92,43,138,1) 45%, rgba(232,121,249,0.75));
}
.input:focus, .form-input:focus, .url-input:focus, .feedback-comment:focus, .chat-input:focus, .bar-date-picker:focus {
    outline: none;
    --field-fill: linear-gradient(180deg, #1e0c33, #150826);
    --field-edge: linear-gradient(135deg, #c084fc, #d8b4fe 55%, #e879f9);
    --field-glow: 0 0 0 4px rgba(192,132,252,0.2), 0 10px 28px -10px rgba(232,121,249,0.65);
}
.input:disabled, .form-input:disabled {
    --field-fill: linear-gradient(180deg, #100618, #100618);
    --field-edge: linear-gradient(var(--rule), var(--rule));
    color: var(--ink-3); cursor: not-allowed;
}
textarea.feedback-comment, textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }

.form-input:user-invalid, .input:user-invalid, .form-input.is-invalid, .input.is-invalid {
    --field-edge: linear-gradient(135deg, #f87171, #fb923c);
    --field-glow: 0 0 0 4px rgba(248,113,113,0.18);
}
.form-input.is-valid {
    --field-edge: linear-gradient(135deg, rgba(52,211,153,0.9), rgba(192,132,252,0.6));
}

.url-input, .form-input[type="email"], .form-input[type="password"], .form-input[autocomplete="name"] { padding-left: 44px; }
.url-input { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a282c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.url-input:focus { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.form-input[type="email"] { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a282c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
.form-input[type="email"]:focus { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
.form-input[type="password"], .password-field .form-input[type="text"] { padding-left: 44px; --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a282c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.form-input[type="password"]:focus, .password-field .form-input[type="text"]:focus { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.form-input[autocomplete="name"] { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a282c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.form-input[autocomplete="name"]:focus { --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }

.input:-webkit-autofill, .form-input:-webkit-autofill, .url-input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px #180a2b inset;
    caret-color: var(--accent-2);
    transition: background-color 9999s ease-out 0s;
}

input[type="search"]::-webkit-search-cancel-button { filter: invert(0.7) sepia(1) hue-rotate(230deg) saturate(3); cursor: pointer; }
.bar-date-picker::-webkit-calendar-picker-indicator { filter: invert(0.75) sepia(1) hue-rotate(230deg) saturate(4); cursor: pointer; }

.field-label, .form-label { transition: color 160ms ease; }
.field:focus-within .field-label, .form-group:focus-within .form-label, .inspect-form:focus-within .field-label, .upload-doc:focus-within .field-label { color: var(--accent-2); }

.field-msg { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--forged); }
.field-msg::before { content: '!'; display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--forged); color: var(--paper); font-size: 11px; font-weight: 800; }
.field-msg[hidden] { display: none; }
.field-msg.ok { color: var(--genuine); }

.pw-meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 4px; align-items: center; }
.pw-meter span { height: 4px; border-radius: 999px; background: rgba(192,132,252,0.18); transition: background-color 200ms ease, box-shadow 200ms ease; }
.pw-meter em { min-width: 5.5em; padding-left: 8px; font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-align: right; }
.pw-meter[data-level="0"] span:nth-child(-n+1) { background: var(--forged); }
.pw-meter[data-level="1"] span:nth-child(-n+1) { background: var(--forged); }
.pw-meter[data-level="2"] span:nth-child(-n+2) { background: var(--unverified); }
.pw-meter[data-level="3"] span:nth-child(-n+3) { background: #c084fc; box-shadow: 0 0 8px rgba(192,132,252,0.6); }
.pw-meter[data-level="4"] span:nth-child(-n+4) { background: var(--accent-fill); box-shadow: 0 0 8px rgba(232,121,249,0.7); }
.pw-meter[data-level="0"] em, .pw-meter[data-level="1"] em { color: var(--forged); }
.pw-meter[data-level="2"] em { color: var(--unverified); }
.pw-meter[data-level="3"] em, .pw-meter[data-level="4"] em { color: var(--genuine); }
.field-msg.ok::before { content: '\2713'; background: var(--genuine); }

/* ── Verdict tags and stamps ────────────────────────────── */
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 2px;
    font-family: var(--font-display);
    font-stretch: 118%;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.3;
}
.tag.safe, .tag.low      { color: var(--genuine);    background: var(--genuine-bg); }
.tag.uncertain, .tag.medium { color: var(--unverified); background: var(--unverified-bg); }
.tag.phishing, .tag.high { color: #fca5a5;           background: var(--forged-bg); }

.stamp {
    --stamp: var(--forged);
    display: inline-grid;
    place-items: center;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 3px solid var(--stamp);
    box-shadow: inset 0 0 0 5px var(--sheet), inset 0 0 0 7px var(--stamp);
    color: var(--stamp);
    transform: rotate(-9deg);
    text-align: center;
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 800;
    text-transform: uppercase;
}
.stamp.safe { --stamp: var(--genuine); }
.stamp.uncertain { --stamp: var(--unverified); }
.stamp.phishing { --stamp: var(--forged); }

/* ── Tables: the ledger ─────────────────────────────────── */
.ledger { width: 100%; border-collapse: collapse; font-size: 15px; }
.ledger th {
    text-align: left;
    padding: 10px 12px;
    font-family: var(--font-display); font-stretch: 118%; font-weight: 700;
    font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-2);
    border-bottom: 2px solid var(--accent);
    white-space: nowrap;
}
.ledger td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ledger tbody tr:hover td { background: rgba(192,132,252,0.08); }
.ledger .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 14px; }

/* ── Flash messages and toasts ──────────────────────────── */
.flash-messages { position: relative; z-index: 2; max-width: 720px; margin: 20px auto 0; padding: 0 var(--gutter); display: grid; gap: 8px; }
.flash {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 16px;
    border-radius: var(--r-doc);
    border: 1px solid currentColor;
    font-size: 15px; font-weight: 600;
    background: var(--sheet);
}
.flash.success { color: var(--genuine); background: var(--genuine-bg); }
.flash.error   { color: var(--forged);  background: var(--forged-bg); }
.flash.info, .flash.warning { color: var(--unverified); background: var(--unverified-bg); }

.toast-container {
    position: fixed; top: 80px; right: 16px; z-index: 1500;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 10px;
    width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--forged);
    border-radius: var(--r-doc);
    box-shadow: var(--shadow-lift);
    color: var(--ink);
    font-size: 15px;
    opacity: 0; transform: translateY(-8px);
    transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.toast.warning { border-top-color: var(--unverified); }
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(-8px); transition-duration: 160ms; }
.toast-icon { color: var(--forged); flex-shrink: 0; margin-top: 2px; }
.toast.warning .toast-icon { color: var(--unverified); }
.toast-message { flex: 1; }
.toast-close { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 2px; }
.toast-close:hover { color: var(--ink); }

/* ── Network art hosts ─────────────────────────────────── */
:where([data-art]) { position: relative; }
[data-art="shield"] > canvas, [data-art="globe"] > canvas,
[data-art="skyline"] > canvas, [data-art="vault"] > canvas, [data-art="fingerprint"] > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Page head ──────────────────────────────────────────── */
.page-head {
    position: relative;
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px;
    padding: 40px 0 28px;
}
.page-head h1 {
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 800;
    font-size: clamp(30px, 4.2vw, 48px);
    line-height: 1;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: -0.01em;
    text-shadow: 0 0 20px rgba(192,132,252,0.35);
}
.page-head p { margin-top: 10px; color: var(--ink-2); font-size: 17px; max-width: 40em; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Shared record components ──────────────────────────── */
.panel-title { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 16px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent); }
.counterfoil { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.counterfoil.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.count { padding: 22px 24px; position: relative; }
.count + .count { border-left: 1px dashed var(--rule-strong); }
.count-label { font-family: var(--font-display); font-stretch: 118%; font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.count-value { margin-top: 8px; font-family: var(--font-mono); font-weight: 700; font-size: clamp(30px, 3.4vw, 42px); line-height: 1; color: var(--accent); text-shadow: 0 0 12px rgba(192,132,252,0.4); }
.count.safe .count-value { color: var(--genuine); text-shadow: 0 0 12px rgba(52,211,153,0.4); }
.count.phishing .count-value { color: var(--forged); text-shadow: 0 0 12px rgba(248,113,113,0.4); }
.count.uncertain .count-value { color: var(--unverified); text-shadow: 0 0 12px rgba(251,191,36,0.4); }
.count-sub { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.rate-bar { margin-top: 12px; height: 8px; background: var(--genuine-bg); border-radius: 1px; overflow: hidden; }
.rate-bar span { display: block; height: 100%; background: var(--forged); transform-origin: left; transform: scaleX(calc(var(--pct) / 100)); }

.no-data { padding: 36px 24px; text-align: center; color: var(--ink-3); }

/* ── Recent scans ledger ── */
.history-card { margin-top: 28px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.search-wrap { position: relative; flex: 1 1 260px; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search-box { padding-left: 38px; min-height: 42px; font-size: 15px; }
.filter-group { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 3px; overflow: hidden; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px; background: var(--field); border: 0; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.filter-btn + .filter-btn { border-left: 1px solid var(--rule-strong); }
.filter-btn .icon { width: 16px; height: 16px; }
.filter-btn:hover { background: var(--paper); color: var(--ink); }
.filter-btn.active { background: var(--accent-fill); color: var(--on-accent); }

.table-scroll { overflow-x: auto; }
.ledger td.url-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 14px; }
.ledger tr.hidden { display: none; }
.scan-id { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }

@media (max-width: 640px) {
    .ledger thead { display: none; }
    .ledger, .ledger tbody { display: block; }
    .ledger tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "no time" "url url" "verdict risk";
        gap: 6px 12px;
        align-items: center;
        padding: 14px 16px;
        border-bottom: 1px solid var(--rule);
    }
    .ledger tr.hidden { display: none; }
    .ledger td { padding: 0; border: 0; }
    .ledger tbody tr:hover td { background: none; }
    .ledger td:nth-child(1) { grid-area: no; }
    .ledger td:nth-child(2) { grid-area: url; max-width: none; white-space: normal; overflow-wrap: anywhere; }
    .ledger td:nth-child(3), .ledger td:nth-child(4) { display: none; }
    .ledger td:nth-child(5) { grid-area: risk; justify-self: start; }
    .ledger td:nth-child(6) { grid-area: verdict; }
    .ledger td:nth-child(7) { grid-area: time; justify-self: end; font-size: 12px; color: var(--ink-3); }
}

.empty-state { padding: 48px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.empty-state h2 { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 22px; color: var(--accent); }
.empty-state p { color: var(--ink-2); }

@media (max-width: 960px) {
    .counterfoil { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .count:nth-child(3) { border-left: 0; }
    .count:nth-child(n+3) { border-top: 1px dashed var(--rule-strong); }
}
@media (max-width: 640px) {
    .count { padding: 18px; }
}

/* Model certificate rows */
.cert-rows { margin-top: 18px; border-top: 2px solid var(--accent); }
.cert-row { display: grid; grid-template-columns: 11em 6em minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.cert-row dt { font-weight: 700; }
.cert-row .val { font-family: var(--font-mono); font-weight: 700; font-size: 20px; color: var(--accent); }
.cert-row .val.good { color: var(--genuine); }
.cert-row .val.warn { color: var(--forged); }
.cert-row .why { color: var(--ink-2); font-size: 15px; }
@media (max-width: 640px) {
    .cert-row { grid-template-columns: minmax(0, 1fr) auto; }
    .cert-row .why { grid-column: 1 / -1; }
}

/* Risk-level bars and flagged-domain list */
.risk-breakdown { padding: 16px 20px 20px; display: grid; gap: 14px; }
.risk-row { display: grid; grid-template-columns: 6em minmax(0, 1fr) 3.5em; gap: 12px; align-items: center; }
.risk-label { font-weight: 700; }
.risk-row.high .risk-label { color: var(--forged); }
.risk-row.medium .risk-label { color: var(--unverified); }
.risk-row.low .risk-label { color: var(--genuine); }

.risk-bar-track {
    position: relative;
    height: 14px;
    padding: 2px;
    border-radius: 999px;
    background:
        repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(192,132,252,0.18) calc(10% - 1px) 10%) content-box,
        rgba(18,8,29,0.9);
    box-shadow: inset 0 0 0 1px var(--rule), inset 0 2px 6px rgba(0,0,0,0.6);
}
.risk-bar-fill {
    --bar: var(--accent-fill);
    --bar-glow: rgba(192,132,252,0.6);
    position: relative;
    height: 100%;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bar);
    box-shadow: 0 0 12px var(--bar-glow);
    transform-origin: left;
    transform: scaleX(calc(var(--pct) / 100));
}
.risk-bar-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: translateX(-100%);
}
@media (prefers-reduced-motion: no-preference) {
    .risk-bar-fill::after { animation: bar-sheen 3.2s var(--ease-in-out) 1.4s infinite; }
}
@keyframes bar-sheen { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }
.risk-row.high .risk-bar-fill { --bar: linear-gradient(90deg, #fb923c, #f87171 60%, #fb7185); --bar-glow: rgba(248,113,113,0.6); }
.risk-row.medium .risk-bar-fill { --bar: linear-gradient(90deg, #facc15, #fbbf24 60%, #fb923c); --bar-glow: rgba(251,191,36,0.5); }
.risk-row.low .risk-bar-fill { --bar: linear-gradient(90deg, #c084fc, #d8b4fe 55%, #e879f9); --bar-glow: rgba(232,121,249,0.6); }
.risk-count { font-family: var(--font-mono); font-weight: 700; text-align: right; }
.risk-row.high .risk-count { color: var(--forged); }
.risk-row.medium .risk-count { color: var(--unverified); }
.risk-row.low .risk-count { color: var(--genuine); }

.domain-list { list-style: none; padding: 8px 20px 12px; }
.domain-row { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; }
.domain-row + .domain-row { border-top: 1px solid var(--rule); }
.domain-rank {
    grid-row: span 2;
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #fca5a5;
    background: var(--forged-bg);
    box-shadow: inset 0 0 0 1px rgba(248,113,113,0.4);
}
.domain-row:first-child .domain-rank { background: var(--forged); color: var(--paper); box-shadow: 0 0 12px rgba(248,113,113,0.55); }
.domain-name { font-family: var(--font-mono); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-count { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--forged); }
.domain-bar { grid-column: 2 / -1; height: 4px; border-radius: 999px; background: rgba(248,113,113,0.1); overflow: hidden; }
.domain-bar span {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, rgba(248,113,113,0.35), #f87171);
    box-shadow: 0 0 8px rgba(248,113,113,0.5);
    transform-origin: left; transform: scaleX(calc(var(--pct) / 100));
}
html.motion .reveal .domain-bar span { transform: scaleX(0); transition: transform 1000ms var(--ease-out) 300ms; }
html.motion .reveal.is-in .domain-bar span { transform: scaleX(calc(var(--pct) / 100)); }

/* ── Pipeline diagram ───────────────────────────────────── */
.pipeline { margin-top: 72px; }
.pipeline h2 {
    font-family: var(--font-display); font-stretch: 125%; font-weight: 800;
    font-size: clamp(22px, 2.4vw, 28px); text-transform: uppercase; color: var(--accent);
    text-shadow: 0 0 14px rgba(192,132,252,0.3);
}
.pipeline-lede { margin-top: 8px; color: var(--ink-2); }
.pipeline-track {
    list-style: none;
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
}
.pipeline-track::before {
    content: '';
    position: absolute;
    left: 10%; right: 10%; top: 31px;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(192,132,252,0.65) 0 10px, transparent 10px 18px);
    background-size: 18px 2px;
}
.pipeline-track::after {
    content: '';
    position: absolute;
    top: 26px; left: 10%;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fdf8ff;
    box-shadow: 0 0 10px rgba(232,121,249,0.9), 0 0 0 4px rgba(192,132,252,0.35);
    opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .pipeline-track::before { animation: wire-flow 900ms linear infinite; }
    .pipeline-track::after { animation: wire-packet 4.2s var(--ease-in-out) infinite; }
    .pipeline-node { animation: node-pulse 4.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.84s); }
}
@keyframes wire-flow { to { background-position: 18px 0; } }
@keyframes wire-packet {
    0% { left: 10%; opacity: 0; }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { left: calc(90% - 10px); opacity: 0; }
}
@keyframes node-pulse {
    0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(192,132,252,0); }
    10% { box-shadow: 0 0 0 10px rgba(192,132,252,0.25), 0 0 16px rgba(232,121,249,0.4); }
}
.pipeline-step { position: relative; text-align: center; display: grid; justify-items: center; gap: 8px; }
.pipeline-node {
    position: relative;
    z-index: 1;
    display: grid; place-items: center;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--sheet);
    border: 2px solid rgba(192,132,252,0.65);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(192,132,252,0.2);
}
.pipeline-node .icon { width: 26px; height: 26px; }
.pipeline-node.is-verdict { background: var(--accent-fill); border-color: transparent; color: var(--on-accent); box-shadow: 0 0 18px rgba(232,121,249,0.5); }
.pipeline-step h3 { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 17px; color: var(--ink); }
.pipeline-step p { font-size: 15px; color: var(--ink-2); max-width: 24ch; }

@media (max-width: 860px) {
    .pipeline-track { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .pipeline-track::before {
        left: 31px; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto;
        background: repeating-linear-gradient(180deg, rgba(192,132,252,0.65) 0 10px, transparent 10px 18px);
        background-size: 2px 18px;
    }
    .pipeline-track::after { display: none; }
    .pipeline-step { grid-template-columns: 64px minmax(0, 1fr); justify-items: start; text-align: left; column-gap: 16px; }
    .pipeline-node { grid-row: span 2; }
    .pipeline-step p { max-width: none; }
    @keyframes wire-flow { to { background-position: 0 18px; } }
}

/* ── Page motion ────────────────────────────────────────── */
html.motion-pending main { opacity: 0; animation: motion-failsafe 0s linear 1.5s forwards; }
@keyframes motion-failsafe { to { opacity: 1; } }
html.motion-init .reveal, html.motion-init .reveal-item { transition: none !important; }
html.motion .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
html.motion .reveal.is-in { opacity: 1; transform: none; }
html.motion .reveal .reveal-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
    transition-delay: calc(150ms + var(--i, 0) * 70ms);
}
html.motion .reveal.is-in .reveal-item { opacity: 1; transform: none; }

html.motion .reveal .risk-bar-fill,
html.motion .reveal .rate-bar span {
    transform: scaleX(0);
    transition: transform 1100ms var(--ease-out) 250ms;
}
html.motion .reveal.is-in .risk-bar-fill,
html.motion .reveal.is-in .rate-bar span { transform: scaleX(calc(var(--pct) / 100)); }

.page-head h1::after,
.pipeline h2::after,
.bulletin h2::after,
.read > h2::after,
.procedure h2::after {
    content: '';
    display: block;
    width: 72px;
    height: 3px;
    margin-top: 14px;
    border-radius: 2px;
    background: var(--accent-fill);
    box-shadow: 0 0 8px rgba(192,132,252,0.6);
    transform-origin: left;
}
html.motion .reveal .page-head h1::after,
html.motion .page-head.reveal h1::after,
html.motion .reveal.pipeline h2::after,
html.motion .reveal.bulletin h2::after,
html.motion .reveal.read > h2::after {
    transform: scaleX(0);
    transition: transform 900ms var(--ease-out) 300ms;
}
html.motion .is-in.page-head h1::after,
html.motion .is-in.pipeline h2::after,
html.motion .is-in.bulletin h2::after,
html.motion .is-in.read > h2::after { transform: scaleX(1); }

.doc { transition: box-shadow 260ms ease; }
@media (hover: hover) and (pointer: fine) {
    .doc:hover {
        --panel-edge: linear-gradient(155deg, rgba(232,121,249,0.9), rgba(192,132,252,0.8) 30%, rgba(92,43,138,0.8) 66%, rgba(216,180,254,0.9));
        box-shadow: inset 0 1px 0 rgba(232,121,249,0.25), 0 28px 56px -30px rgba(0,0,0,0.98), 0 0 32px -10px rgba(192,132,252,0.45);
    }
    .capabilities li, .limits li, .procedure li { transition: background-color 200ms ease; }
    .capabilities li:hover, .procedure li:hover { background: rgba(192,132,252,0.06); }
}

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

@media print {
    .site-header, .site-footer, .nav-drawer, .nav-backdrop, body::after, .chat-launcher, .chat-panel { display: none !important; }
    body { background: var(--field); }
    .doc { box-shadow: none; }
}
/* ── Log out is a POST form (CSRF-protected), styled as a nav link ── */
.nav-logout-form { display: contents; }
button.nav-logout { border: 0; background: none; font-family: inherit; line-height: inherit; cursor: pointer; }

/* ── Error page ─────────────────────────────────────────── */
.error-panel { max-width: 640px; margin: clamp(32px, 8vw, 96px) auto; padding: clamp(24px, 5vw, 44px); display: grid; gap: 14px; }
.error-code { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.error-panel h1 { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: clamp(28px, 4vw, 40px); text-transform: uppercase; color: var(--accent); }
.error-panel p { color: var(--ink-2); }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ── Dashboard: live system status, privacy note ── */
.status-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -8px 0 18px; font-size: 14px; color: var(--ink-2); }
.status-strip li { display: inline-flex; align-items: center; gap: 8px; }
.status-strip i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.status-strip .ok i { background: var(--genuine); box-shadow: 0 0 8px rgba(52,211,153,0.7); }
.status-strip .warn i { background: var(--unverified); }
.status-strip .off i { background: var(--ink-3); }
.privacy-note { padding: 12px 20px 0; font-size: 14px; color: var(--ink-3); }
.cert-note { margin-top: 14px; font-size: 14px; color: var(--ink-3); max-width: 60ch; }

/* The five-tile counter row (dashboard) must collapse on small screens
   too: .counterfoil.five out-ranked the two-column .counterfoil rule,
   so phones got five squeezed columns and a sideways scroll. */
@media (max-width: 960px) {
    .counterfoil.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .counterfoil.five .count:last-child { grid-column: 1 / -1; border-left: 0; }
}
