/* =============================================================
   CYBERSPRINT — "Clair & ludique" phishing-awareness UI
   Ported from the BrainAndros game ("Cyber Sprint"): a warm cream
   canvas, soft rounded cards, coral/orange/amber accents and bouncy
   motion (Light), plus a dramatic dark "cyberattaque" charcoal mode
   with coral/amber neon glow (Dark).
   Display: Bricolage Grotesque · Body: DM Sans.
   Two themes (light, dark) driven by `[data-theme]` on <html>.

   IMPORTANT: the email frames (.email-frame, .ms-*, .amz-*, …) and
   their highlights are INTENTIONALLY LIGHT in both themes — they are
   the quiz "specimens" and must look like real inboxes. Those blocks
   are preserved verbatim and never themed.
   ============================================================= */

/* ===== Local fonts (offline, CSP-safe — no CDN) ===== */
@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/static/fonts/HankenGrotesk.ttf') format('truetype');
}
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/static/fonts/BricolageGrotesque.ttf') format('truetype');
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    font-optical-sizing: auto;
    src: url('/static/fonts/DMSans.ttf') format('truetype');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/fonts/JetBrainsMono.ttf') format('truetype');
}
/* Inter is kept only as a typeface the email "specimens" reference (PayPal,
   Amazon …) — it is NOT part of the AEGIS app chrome. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/fonts/inter-latin.woff2') format('woff2');
}

/* ===== Tokens — LIGHT (default · "clair & ludique") ===== */
:root,
[data-theme="light"] {
    --bg:                #fff6ee;   /* warm cream */
    --surface:           #ffffff;
    --surface-elev:      #fff1e6;
    --surface-input:     #ffffff;
    --border:            rgba(43, 27, 20, 0.10);   /* warm ink hairline */
    --border-bright:     rgba(43, 27, 20, 0.20);

    --text:              #2b1b14;   /* warm near-black */
    --text-muted:        #5b463c;
    --text-dim:          #9a8074;

    --primary:           #ff5a3c;   /* coral */
    --primary-dim:       #ef451f;
    --primary-deep:      #d63a18;
    --primary-soft:      rgba(255, 90, 60, 0.12);
    --on-primary:        #ffffff;

    --secondary:         #ff8a2b;   /* orange */
    --secondary-dim:     #f57311;
    --secondary-deep:    #c85a06;
    --secondary-soft:    rgba(255, 138, 43, 0.16);
    --on-secondary:      #ffffff;

    --success:           #16b169;   /* good */
    --success-dim:       #11985a;
    --success-deep:      #0c7544;
    --success-soft:      rgba(22, 177, 105, 0.13);
    --on-success:        #ffffff;

    --danger:            #ff3b30;   /* bad */
    --danger-dim:        #e7281d;
    --danger-deep:       #c01f25;
    --danger-soft:       rgba(255, 59, 48, 0.12);
    --on-danger:         #ffffff;

    --shadow-1:          0 4px 14px rgba(70, 30, 15, 0.10), 0 1px 3px rgba(70, 30, 15, 0.08);
    --shadow-2:          0 26px 60px rgba(70, 30, 15, 0.20);
    --ring-primary:      0 0 0 3px rgba(255, 90, 60, 0.30);
    --glow-primary:      0 14px 30px rgba(255, 90, 60, 0.40);
    --hairline:          linear-gradient(90deg, transparent, var(--secondary) 18%, var(--primary) 82%, transparent);

    /* Light stays soft — only a whisper of warmth, no neon. */
    --lit-primary:       0 1px 0 rgba(255, 90, 60, 0.10);
    --lit-secondary:     0 1px 0 rgba(255, 138, 43, 0.10);
    --lit-success:       0 1px 0 rgba(22, 177, 105, 0.10);

    --font-display: 'Bricolage Grotesque', 'Space Grotesk', system-ui, sans-serif;
    --font-body:    'DM Sans', 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    /* Soft, pillowy radii — the playful signature. */
    --radius:      22px;
    --radius-sm:   14px;
    --radius-pill: 999px;

    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);

    color-scheme: light;
}

/* ===== Tokens — DARK ("cyberattaque" : charbon, corail & ambre) ===== */
[data-theme="dark"] {
    --bg:                #1f0d11;   /* dramatic charcoal-brown */
    --surface:           #2e1820;
    --surface-elev:      #3a2028;
    --surface-input:     #241016;
    --border:            rgba(255, 255, 255, 0.14);
    --border-bright:     rgba(255, 138, 43, 0.55);

    --text:              #fff7f2;
    --text-muted:        #ffd8cd;
    --text-dim:          #c9a99f;

    --primary:           #ff5a3c;   /* coral, blazing on dark */
    --primary-dim:       #ef451f;
    --primary-deep:      #ff8a2b;
    --primary-soft:      rgba(255, 90, 60, 0.18);
    --on-primary:        #ffffff;

    --secondary:         #ffc24b;   /* amber pops on dark */
    --secondary-dim:     #ff8a2b;
    --secondary-deep:    #c85a06;
    --secondary-soft:    rgba(255, 196, 75, 0.18);
    --on-secondary:      #2b1117;

    --success:           #1ed47e;
    --success-dim:       #16b169;
    --success-deep:      #0c7544;
    --success-soft:      rgba(30, 212, 126, 0.16);
    --on-success:        #04231b;

    --danger:            #ff5247;
    --danger-dim:        #e7281d;
    --danger-deep:       #b3242f;
    --danger-soft:       rgba(255, 82, 71, 0.16);
    --on-danger:         #2a0709;

    --shadow-1:          0 2px 6px rgba(0, 0, 0, 0.50), 0 14px 30px rgba(0, 0, 0, 0.45);
    --shadow-2:          0 26px 60px rgba(0, 0, 0, 0.55);
    --ring-primary:      0 0 0 3px rgba(255, 90, 60, 0.35);
    --glow-primary:      0 0 30px rgba(255, 90, 60, 0.55);
    --hairline:          linear-gradient(90deg, transparent, var(--primary) 18%, var(--secondary) 82%, transparent);

    /* Dark leans into the neon "cyberattaque" glow on titles & scores. */
    --lit-primary:       0 0 30px rgba(255, 90, 60, 0.90), 0 0 10px rgba(255, 196, 75, 0.35);
    --lit-secondary:     0 0 24px rgba(255, 196, 75, 0.60);
    --lit-success:       0 0 22px rgba(30, 212, 126, 0.50);

    color-scheme: dark;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1200px 700px at 12% -6%, rgba(255, 138, 43, 0.10), transparent 60%),
        radial-gradient(1000px 620px at 100% 0%, rgba(255, 196, 75, 0.08), transparent 56%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Warm spotlight orbs that gently breathe — the "clair & ludique" signature.
   Fixed so they read as a backdrop the content floats over. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(60% 55% at 50% 22%, rgba(255, 138, 43, 0.22), transparent 70%),
        radial-gradient(45% 45% at 78% 70%, rgba(255, 90, 60, 0.16), transparent 70%),
        radial-gradient(40% 40% at 18% 78%, rgba(255, 196, 75, 0.16), transparent 72%);
    transform-origin: center;
    animation: cs-breathe 7s ease-in-out infinite;
}
@keyframes cs-breathe {
    0%, 100% { transform: scale(1);    opacity: 0.92; }
    50%      { transform: scale(1.06); opacity: 1; }
}
/* Fine grain — a tactile, non-flat surface. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Dark "cyberattaque" — orbs shift to the danger palette and glow harder. */
[data-theme="dark"] body {
    background-image:
        radial-gradient(1200px 700px at 12% -6%, rgba(255, 90, 60, 0.14), transparent 60%),
        radial-gradient(1000px 620px at 100% 0%, rgba(120, 30, 50, 0.32), transparent 56%);
}
[data-theme="dark"] body::before {
    background-image:
        radial-gradient(60% 55% at 50% 20%, rgba(255, 90, 60, 0.28), transparent 70%),
        radial-gradient(45% 45% at 80% 72%, rgba(255, 60, 70, 0.22), transparent 70%),
        radial-gradient(42% 42% at 16% 80%, rgba(255, 140, 70, 0.18), transparent 72%);
    mix-blend-mode: screen;
}
[data-theme="dark"] body::after { mix-blend-mode: overlay; opacity: 0.07; }
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}
body > * { position: relative; z-index: 1; }

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--secondary-soft); color: var(--text); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text);
    letter-spacing: -0.015em;
    margin: 0;
}

/* ===== App chrome ===== */
.app-header {
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.app-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: var(--hairline);
    opacity: 0.7;
}
.app-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    color: var(--text);
    text-decoration: none;
}
.app-brand__logo {
    width: 60px;
    height: 60px;
    margin-block: -5px;
    object-fit: contain;
    flex-shrink: 0;
}

.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 28px 64px;
}
.app-main:has(.admin--wide) { max-width: 1600px; }

.app-footer {
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    padding: 28px 16px 40px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

/* Tighten the bottom gap (card → footer) to match the top gap
   (header → card = 32px main padding + 28px card margin = 60px) site-wide.
   In-game pages (quiz / result), flagged by [data-afk-watchdog], keep the
   original roomier footer spacing. */
.app-main:not(:has([data-afk-watchdog])) { padding-bottom: 32px; }
.app-main:not(:has([data-afk-watchdog])) + .app-footer { margin-top: 28px; }

/* ===== Quiz intro & layout ===== */
.quiz-intro h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0 0 6px;
    color: var(--text);
    line-height: 1.2;
}
.quiz-intro p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.quiz-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}
.quiz-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 100px;
}
.quiz-layout .email-frame { max-width: 820px; margin: 0 auto; }
.quiz-layout .quiz-timer,
.quiz-layout .quiz-intro { max-width: none; margin: 0; }
.quiz-layout .answer-bar {
    max-width: none;
    margin: 0;
    flex-direction: column;
    gap: 14px;
}
.quiz-layout .answer-btn {
    flex: 0 0 auto;
    width: 100%;
    padding: 22px 22px;
    font-size: 1.1rem;
}
@media (max-width: 960px) {
    .quiz-layout { grid-template-columns: 1fr; gap: 18px; }
    .quiz-side { position: static; }
    .quiz-layout .answer-bar { flex-direction: row; gap: 14px; }
    .quiz-layout .answer-btn { padding: 18px 20px; font-size: 1.05rem; }
}

/* ===== Quiz timer — instrument readout ===== */
.quiz-timer {
    max-width: 1400px;
    margin: 0 auto 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 22px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-1);
    transition: border-color .25s ease, box-shadow .25s ease;
}
.quiz-timer__label {
    grid-column: 1; grid-row: 1;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}
.quiz-timer__value {
    grid-column: 2; grid-row: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-shadow: var(--lit-primary);
}
.quiz-timer__seconds { font-size: 2.6rem; }
.quiz-timer__sep { margin: 0 1px; color: var(--text-muted); font-size: 2rem; }
.quiz-timer__centis { color: var(--text-muted); font-size: 1.5rem; }
.quiz-timer__unit {
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 600;
    margin-left: 4px;
}
.quiz-timer__bar {
    grid-column: 1 / -1; grid-row: 2;
    display: block;
    background: var(--surface-input);
    border: 1px solid var(--border);
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius-pill);
}
.quiz-timer__bar-fill {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-dim), var(--primary));
    border-radius: var(--radius-pill);
    transform-origin: left center;
    transition: background .3s ease, box-shadow .3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 90, 60, 0.40);
}
.quiz-timer__bar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 55%);
    border-radius: inherit;
    pointer-events: none;
}
[data-theme="light"] .quiz-timer__bar-fill { box-shadow: 0 0 4px rgba(255, 90, 60, 0.20); }
.quiz-timer.is-warning .quiz-timer__bar-fill { box-shadow: 0 0 10px rgba(255, 138, 43, 0.45); }
.quiz-timer.is-critical .quiz-timer__bar-fill { box-shadow: 0 0 12px rgba(255, 107, 107, 0.5); }

.quiz-timer.is-warning { border-color: var(--secondary); }
.quiz-timer.is-warning .quiz-timer__value { color: var(--secondary); text-shadow: var(--lit-secondary); }
.quiz-timer.is-warning .quiz-timer__bar-fill { background: linear-gradient(90deg, var(--secondary-dim), var(--secondary)); }

.quiz-timer.is-critical {
    border-color: var(--danger);
    animation: critical-pulse 0.7s ease-in-out infinite;
}
@keyframes critical-pulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--danger), 0 0 0 0 var(--danger-soft); }
    50%      { box-shadow: 0 0 0 1px var(--danger), 0 0 0 8px var(--danger-soft); }
}
.quiz-timer.is-critical .quiz-timer__value { color: var(--danger); }
.quiz-timer.is-critical .quiz-timer__bar-fill { background: linear-gradient(90deg, var(--danger-dim), var(--danger)); }

.quiz-timer.is-expired {
    border-color: var(--border);
    animation: none;
    box-shadow: none;
    opacity: 0.7;
}
.quiz-timer.is-expired .quiz-timer__value { color: var(--text-dim); }
.quiz-timer.is-expired .quiz-timer__bar-fill { background: var(--text-dim); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    .quiz-timer.is-critical { animation: none; }
}

/* ===========================================================
   Email frame — INTENTIONALLY LIGHT (the quiz "specimen")
   Preserved verbatim: these mimic real inboxes.
   =========================================================== */
.email-frame {
    background: #ffffff;
    border: 1px solid #d8d8e8;
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-width: 720px;
    margin: 0 auto;
    box-shadow: var(--shadow-2);
}
.email-frame--reveal {
    box-shadow: 0 0 0 1px var(--secondary), var(--shadow-2);
}

.email__meta {
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
    font-size: 0.9rem;
}
.email__meta-row { display: flex; gap: 10px; padding: 2px 0; }
.email__meta-label { flex: 0 0 54px; color: #6b7280; font-weight: 500; }
.email__meta-value { color: #1f2937; word-break: break-word; }
.email__meta-row--subject {
    padding-top: 6px;
    border-top: 1px dashed #e5e7eb;
    margin-top: 6px;
}

.email__body {
    padding: 28px 32px 24px;
    font-size: 0.98rem;
    color: #1f2937;
    background: #ffffff;
}
.email__greeting { margin: 0 0 12px; }
.email__paragraph { margin: 0 0 16px; line-height: 1.6; }
.email__paragraph--muted { color: #6b7280; font-size: 0.88rem; }
.email__body-content p { margin: 0 0 16px; line-height: 1.6; }
.email__body-content p:last-child { margin-bottom: 0; }
.email__body-content ol, .email__body-content ul { margin: 0 0 16px; padding-left: 24px; line-height: 1.6; }
.email__body-content blockquote {
    margin: 0 0 16px; padding: 4px 0 4px 14px;
    border-left: 3px solid #d1d5db; color: #4b5563;
}
.email__body-content h1, .email__body-content h2, .email__body-content h3 {
    margin: 0 0 12px; line-height: 1.3;
    font-family: inherit; color: inherit; letter-spacing: normal;
}
.email__body-content .ql-size-small { font-size: 0.75em; }
.email__body-content .ql-size-large { font-size: 1.5em; }
.email__body-content .ql-size-huge  { font-size: 2.5em; }
.email__body-content .ql-color-white  { color: #ffffff; }
.email__body-content .ql-color-red    { color: #e60000; }
.email__body-content .ql-color-orange { color: #f90000; }
.email__body-content .ql-color-yellow { color: #ffff00; }
.email__body-content .ql-color-green  { color: #008a00; }
.email__body-content .ql-color-blue   { color: #0066cc; }
.email__body-content .ql-color-purple { color: #9933ff; }
.email__body-content .ql-bg-black     { background-color: #000000; }
.email__body-content .ql-bg-red       { background-color: #e60000; }
.email__body-content .ql-bg-orange    { background-color: #f90000; }
.email__body-content .ql-bg-yellow    { background-color: #ffff00; }
.email__body-content .ql-bg-green     { background-color: #008a00; }
.email__body-content .ql-bg-blue      { background-color: #0066cc; }
.email__body-content .ql-bg-purple    { background-color: #9933ff; }
.email__cta { text-align: center; margin: 24px 0 20px; }
.email__signoff { margin: 20px 0 0; }
.email__footer {
    padding: 16px 32px 20px; font-size: 0.78rem; color: #6b7280;
    border-top: 1px solid #eef2f7; background: #fafafa;
}
.email__legal { margin-top: 6px; }

/* ===== Brand themes (preserved verbatim — quiz content) ===== */
.email__body--microsoft { font-family: 'Segoe UI', 'Inter', sans-serif; }
.ms-logo-img { display: block; height: 28px; width: auto; margin-bottom: 14px; }
.ms-divider { border: none; border-top: 1px solid #e5e7eb; margin: 0 0 20px; }
.ms-title { font-size: 1.5rem; font-weight: 600; color: #111827; margin: 0 0 18px; letter-spacing: -0.2px; font-family: inherit; }
.ms-btn {
    display: inline-block; background: #0067b8; color: #ffffff !important;
    padding: 12px 28px; border-radius: 2px; font-weight: 600;
    text-decoration: none; font-size: 0.98rem; letter-spacing: 0.2px;
}
.ms-btn:hover { background: #005a9e; }

.email__body--amazon { font-family: 'Amazon Ember', 'Helvetica', sans-serif; }
.amz-header {
    background: #ffffff; margin: -28px -32px 20px; padding: 18px 32px 14px;
    border-bottom: 1px solid #e5e7eb; display: flex; align-items: center;
}
.amz-logo-img { display: block; height: 36px; width: auto; }
.amz-title { font-size: 1.25rem; font-weight: 700; color: #111827; margin: 0 0 16px; font-family: inherit; }
.amz-btn {
    display: inline-block; background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    color: #111 !important; padding: 10px 28px; border: 1px solid #a88734;
    border-radius: 3px; font-weight: 600; text-decoration: none; font-size: 0.95rem;
}
.amz-btn:hover { background: linear-gradient(to bottom, #f5d78e, #eeb933); }
.email__footer--amazon {
    background: #f5f5f5; color: #555555; border-top: 1px solid #e5e7eb;
    padding: 18px 32px 20px;
}
.email__footer--amazon .amz-footer-nav {
    display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px;
    padding-bottom: 12px; border-bottom: 1px solid #d5dbdb;
    font-size: 0.82rem; color: #0066c0;
}
.email__footer--amazon p { color: #555555; margin: 4px 0; }
.email__footer--amazon .email__legal { color: #767676; }

.email__body--paypal { font-family: 'Inter', 'Helvetica', sans-serif; }
.pp-header {
    background: #ffffff; margin: -28px -32px 20px; padding: 18px 32px 14px;
    border-bottom: 1px solid #e5e7eb; display: flex; align-items: center;
}
.pp-logo-img { display: block; height: 28px; width: auto; }
.pp-title { font-size: 1.2rem; font-weight: 600; color: #003087; margin: 0 0 16px; font-family: inherit; }
.pp-btn {
    display: inline-block; background: #0070ba; color: #ffffff !important;
    padding: 12px 34px; border-radius: 24px; font-weight: 600;
    text-decoration: none; font-size: 0.98rem;
}
.pp-btn:hover { background: #005ea6; }

.email__body--digiposte {
    font-family: 'Helvetica Neue', 'Inter', Arial, sans-serif;
    background: #ffffff; color: #1a1a1a;
}
.dp-header {
    background: #ffffff; margin: -28px -32px 0; padding: 20px 32px 16px;
    border-bottom: 4px solid #FFCC00; display: flex; align-items: center;
}
.dp-logo-img { display: block; height: 30px; width: auto; }
.dp-hero {
    background: #F5F9FF; margin: 0 -32px 22px; padding: 20px 32px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.dp-title { font-size: 1.35rem; font-weight: 700; color: #003DA5; margin: 0; letter-spacing: -0.2px; font-family: inherit; }
.dp-card {
    display: flex; gap: 14px; align-items: center;
    border: 1px solid #e5e7eb; border-left: 4px solid #FFCC00;
    border-radius: 4px; padding: 14px 16px; margin: 0 0 22px; background: #fafbfc;
}
.dp-card__icon {
    width: 42px; height: 42px; flex: 0 0 42px;
    background: #003DA5; color: #fff; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.72rem; letter-spacing: 0.5px;
}
.dp-card__text { font-size: 0.88rem; color: #374151; line-height: 1.45; }
.dp-card__text strong { color: #003DA5; font-weight: 600; }
.dp-btn {
    display: inline-block; background: #003DA5; color: #ffffff !important;
    padding: 13px 32px; border-radius: 4px; font-weight: 600;
    text-decoration: none; font-size: 0.98rem;
}
.dp-btn:hover { background: #00297a; }
.email__footer--digiposte { background: #fafafa; border-top: 3px solid #FFCC00; color: #6b7280; }

.email__body--adp { font-family: 'Arial', 'Helvetica', sans-serif; background: #ffffff; color: #333333; }
.email__body--adp::before {
    content: ""; display: block; height: 6px; background: #D8232A; margin: -28px -32px 0;
}
.adp-header {
    background: #ffffff; margin: 0 -32px 22px; padding: 20px 32px 14px;
    border-bottom: 1px solid #e5e7eb; display: flex; align-items: baseline;
    justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.adp-logo-img { display: block; height: 36px; width: auto; }
.adp-tagline { color: #6b7280; font-size: 0.72rem; font-style: italic; letter-spacing: 0.3px; }
.adp-title {
    font-size: 1.15rem; font-weight: 700; color: #1f2937; margin: 0 0 16px;
    border-left: 3px solid #D8232A; padding-left: 10px; font-family: inherit;
}
.adp-btn {
    display: inline-block; background: #D8232A; color: #ffffff !important;
    padding: 12px 36px; border-radius: 2px; font-weight: 700;
    text-decoration: none; font-size: 0.9rem; letter-spacing: 0.5px; text-transform: uppercase;
}
.adp-btn:hover { background: #b51d23; }
.email__footer--adp { background: #f5f5f5; border-top: 1px solid #e5e7eb; color: #6b7280; }

.email__body--teams { font-family: 'Segoe UI', 'Inter', sans-serif; background: #ffffff; color: #242424; }
.teams-header {
    background: #ffffff; margin: -28px -32px 0; padding: 18px 32px 14px;
    border-bottom: 1px solid #e1dfdd; display: flex; align-items: center;
}
.teams-logo-img { display: block; height: 34px; width: auto; }
.teams-title {
    font-size: 1.15rem; font-weight: 600; color: #242424;
    margin: 22px 0 18px; line-height: 1.35; font-family: inherit;
}
.teams-quote {
    background: #f5f5f9; border-left: 4px solid #464EB8; border-radius: 4px;
    padding: 14px 16px; margin: 0 0 22px; display: flex; gap: 12px; align-items: flex-start;
}
.teams-avatar {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
    background: #464EB8; color: #fff; display: flex;
    align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem; text-transform: uppercase;
}
.teams-quote__body { flex: 1; font-size: 0.92rem; color: #333333; line-height: 1.5; }
.teams-quote__meta { font-size: 0.78rem; color: #616161; margin-bottom: 4px; }
.teams-btn {
    display: inline-block; background: #464EB8; color: #ffffff !important;
    padding: 10px 28px; border-radius: 4px; font-weight: 600;
    text-decoration: none; font-size: 0.95rem;
}
.teams-btn:hover { background: #3e45a0; }
.email__footer--teams { background: #faf9f8; border-top: 1px solid #e1dfdd; color: #616161; }
.email__legal-link { color: #464EB8; cursor: pointer; }

.email__body--onedrive { font-family: 'Segoe UI', 'Inter', sans-serif; background: #ffffff; color: #242424; }
.od-header {
    background: #ffffff; margin: -28px -32px 0; padding: 18px 32px 14px;
    border-bottom: 1px solid #e5e7eb; display: flex; align-items: center;
}
.od-logo-img { display: block; height: 28px; width: auto; }
.od-title {
    font-size: 1.15rem; font-weight: 600; color: #242424;
    margin: 22px 0 18px; line-height: 1.35; font-family: inherit;
}
.od-filecard {
    display: flex; gap: 14px; align-items: center;
    background: #f6f8fc; border: 1px solid #e1e8f0;
    border-radius: 4px; padding: 14px 18px; margin: 0 0 22px;
}
.od-filecard__icon {
    flex: 0 0 44px; width: 44px; height: 44px;
    background: #185ABD; color: #fff; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.72rem; letter-spacing: 0.5px;
}
.od-filecard__icon--xlsx { background: #107C41; }
.od-filecard__icon--pdf  { background: #B30B00; }
.od-filecard__name { font-weight: 600; color: #242424; word-break: break-word; }
.od-filecard__meta { font-size: 0.82rem; color: #616161; margin-top: 2px; }
.od-btn {
    display: inline-block; background: #0078D4; color: #ffffff !important;
    padding: 12px 32px; border-radius: 2px; font-weight: 600;
    text-decoration: none; font-size: 0.98rem;
}
.od-btn:hover { background: #106ebe; }

.email__body--linkedin { font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; background: #f3f2ef; color: #000000E6; }
.li-header {
    background: #ffffff; margin: -28px -32px 0; padding: 18px 32px 14px;
    border-bottom: 1px solid #e0e0e0; display: flex; align-items: center;
}
.li-logo-img { display: block; height: 26px; width: auto; }
.li-inner {
    background: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 24px 24px 22px; margin: 22px 0 16px;
}
.li-title { font-size: 1.05rem; font-weight: 600; color: #000000E6; margin: 0 0 14px; line-height: 1.4; font-family: inherit; }
.li-profile {
    display: flex; gap: 14px; align-items: center;
    padding: 4px 0 16px; border-bottom: 1px solid #e0e0e0; margin-bottom: 16px;
}
.li-profile__avatar {
    flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #0A66C2, #0073b1); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.3rem; text-transform: uppercase;
}
.li-profile__name { font-weight: 600; font-size: 1rem; color: #000000E6; }
.li-profile__meta { font-size: 0.85rem; color: #00000099; margin-top: 2px; }
.li-btn {
    display: inline-block; background: #0A66C2; color: #ffffff !important;
    padding: 10px 28px; border-radius: 24px; font-weight: 600;
    text-decoration: none; font-size: 0.95rem;
}
.li-btn:hover { background: #004182; }
.email__footer--linkedin { background: #f3f2ef; border-top: none; color: #00000099; text-align: center; font-size: 0.75rem; }

.email__body--custom { font-family: 'Inter', 'Segoe UI', sans-serif; }
.cust-header { display: flex; align-items: center; }
.cust-logo svg, .cust-logo img { display: block; height: 36px; width: auto; max-width: 220px; }
.cust-logo--small svg, .cust-logo--small img { height: 24px; max-width: 160px; }
.cust-logo--medium svg, .cust-logo--medium img { height: 36px; max-width: 220px; }
.cust-logo--large svg, .cust-logo--large img { height: 56px; max-width: 280px; }
.cust-logo--custom svg, .cust-logo--custom img { height: var(--cust-logo-h, 36px); max-width: 320px; }
.cust-logo__placeholder {
    display: inline-block; font-weight: 700;
    color: var(--cust-primary, #111827); letter-spacing: 0.2px; font-size: 1.1rem;
}
.cust-header--bar {
    background: var(--cust-primary, #111827); color: #ffffff;
    margin: -28px -32px 22px; padding: 18px 32px; justify-content: flex-start;
}
.cust-header--bar .cust-logo__placeholder { color: #ffffff; }
.cust-header--centered {
    background: #ffffff; justify-content: center;
    margin: -28px -32px 20px; padding: 18px 32px 14px; border-bottom: 1px solid #e5e7eb;
}
.cust-header--left {
    background: #ffffff; margin: -28px -32px 20px;
    padding: 18px 32px 14px; border-bottom: 1px solid #e5e7eb;
}
.cust-title {
    font-size: 1.35rem; font-weight: 600; color: #111827;
    margin: 0 0 18px; letter-spacing: -0.1px; font-family: inherit;
}
.cust-btn {
    display: inline-block; background: var(--cust-btn-bg, #111827);
    color: var(--cust-btn-fg, #ffffff) !important;
    padding: 12px 28px; font-weight: 600; text-decoration: none;
    font-size: 0.98rem; letter-spacing: 0.2px; border: 1px solid transparent;
}
.cust-btn--square  { border-radius: 2px; }
.cust-btn--rounded { border-radius: 6px; }
.cust-btn--pill    { border-radius: 999px; padding-left: 32px; padding-right: 32px; }
.cust-btn:hover { filter: brightness(0.92); }
.email__footer--custom { background: #fafafa; color: #6b7280; }

/* Fake links inside emails */
.fake-link { cursor: pointer; position: relative; }
.fake-link--inline { color: #0067b8; text-decoration: underline; word-break: break-all; }

/* Highlights revealed inside email — light context, preserved verbatim */
.highlight-danger {
    background: #fde2e1 !important; color: #991b1b !important;
    box-shadow: 0 0 0 1px #fca5a5 inset; border-radius: 3px; padding: 1px 4px;
}
.highlight-warning {
    background: #fff4d6 !important; color: #92400e !important;
    box-shadow: 0 0 0 1px #fcd34d inset; border-radius: 3px; padding: 1px 4px;
}
.highlight-safe {
    background: #dcfce7 !important; color: #14532d !important;
    box-shadow: 0 0 0 1px #86efac inset; border-radius: 3px; padding: 1px 4px;
}
a.ms-btn.highlight-danger, a.ms-btn.highlight-safe,
a.amz-btn.highlight-danger, a.amz-btn.highlight-safe,
a.pp-btn.highlight-danger, a.pp-btn.highlight-safe,
a.dp-btn.highlight-danger, a.dp-btn.highlight-safe,
a.adp-btn.highlight-danger, a.adp-btn.highlight-safe,
a.teams-btn.highlight-danger, a.teams-btn.highlight-safe,
a.od-btn.highlight-danger, a.od-btn.highlight-safe,
a.li-btn.highlight-danger, a.li-btn.highlight-safe,
a.cust-btn.highlight-danger, a.cust-btn.highlight-safe {
    color: #ffffff !important; box-shadow: 0 0 0 3px currentColor;
}
a.ms-btn.highlight-danger, a.amz-btn.highlight-danger,
a.pp-btn.highlight-danger, a.dp-btn.highlight-danger,
a.adp-btn.highlight-danger, a.teams-btn.highlight-danger,
a.od-btn.highlight-danger, a.li-btn.highlight-danger,
a.cust-btn.highlight-danger { outline: 3px solid #ef4444; outline-offset: 2px; }
a.ms-btn.highlight-safe, a.amz-btn.highlight-safe,
a.pp-btn.highlight-safe, a.dp-btn.highlight-safe,
a.adp-btn.highlight-safe, a.teams-btn.highlight-safe,
a.od-btn.highlight-safe, a.li-btn.highlight-safe,
a.cust-btn.highlight-safe { outline: 3px solid #22c55e; outline-offset: 2px; }

/* ===========================================================
   AEGIS components
   =========================================================== */

/* ===== Buttons — refined "signal" fill =====
   Solid accent fill with a hairline top highlight and a soft drop;
   hover lifts with an accent glow; active settles back in. No keycap. */
.btn-primary,
.landing__btn,
.next-btn,
.login__btn,
.lb-picker__go {
    padding: 12px 24px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--primary) 88%, white 12%),
        var(--primary));
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 6px 16px rgba(0, 0, 0, 0.22);
    transition: filter .15s ease, transform .18s var(--ease-bounce, ease), box-shadow .18s ease;
}
.btn-primary:hover,
.landing__btn:hover,
.next-btn:hover,
.login__btn:hover,
.lb-picker__go:hover {
    filter: brightness(1.06);
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        var(--glow-primary),
        0 10px 22px rgba(0, 0, 0, 0.26);
}
.btn-primary:active,
.landing__btn:active,
.next-btn:active,
.login__btn:active,
.lb-picker__go:active {
    filter: brightness(0.98);
    transform: translateY(0);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 3px 8px rgba(0, 0, 0, 0.20);
}
.btn-primary:focus-visible,
.landing__btn:focus-visible,
.next-btn:focus-visible,
.login__btn:focus-visible,
.lb-picker__go:focus-visible { outline: none; box-shadow: var(--ring-primary), 0 6px 16px rgba(0, 0, 0, 0.22); }

/* Width variants where buttons sit in a column flow */
.next-btn      { width: 100%; padding: 14px 18px; }
.login__btn    { width: 100%; padding: 14px 18px; margin-top: 18px; }
.landing__btn  { padding: 14px 28px; }

a.next-btn,
a.landing__btn { display: inline-block; text-align: center; text-decoration: none; }
a.next-btn { display: block; }

.next-btn--finish {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--success) 88%, white 12%),
        var(--success));
    color: var(--on-success);
}
.next-btn--finish:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 0 26px rgba(22, 177, 105, 0.30),
        0 10px 22px rgba(0, 0, 0, 0.26);
}

.admin__export-btn,
.admin-user-form__btn {
    padding: 11px 20px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--success) 88%, white 12%),
        var(--success));
    color: var(--on-success);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 5px 14px rgba(0, 0, 0, 0.18);
    transition: filter .15s ease, transform .08s ease, box-shadow .18s ease;
}
.admin__export-btn { display: inline-block; }
.admin__export-btn:hover,
.admin-user-form__btn:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 0 22px rgba(22, 177, 105, 0.26),
        0 9px 18px rgba(0, 0, 0, 0.20);
}
.admin__export-btn:active,
.admin-user-form__btn:active {
    filter: brightness(0.98);
    transform: translateY(0);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 3px 8px rgba(0, 0, 0, 0.16);
}
.admin-user-form__btn { height: 48px; }

/* Ghost / outline buttons */
.admin__delete-btn,
.admin__reset-btn,
.admin-nav__logout-btn,
.admin-preview__toggle-btn {
    background: transparent;
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    text-decoration: none;
    display: inline-block;
}
.admin__delete-btn:hover,
.admin__reset-btn:hover:not(:disabled),
.admin-nav__logout-btn:hover { background: var(--danger-soft); border-color: var(--danger); }

.admin-preview__toggle-btn {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}
.admin-preview__toggle-btn:hover { background: var(--primary-soft); border-color: var(--primary); }

.admin__reset-btn { padding: 10px 16px; font-size: 0.82rem; }
.admin__reset-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.admin__delete-btn--danger {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--danger) 88%, white 12%),
        var(--danger));
    color: var(--on-danger);
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 4px 12px rgba(0, 0, 0, 0.18);
}
.admin__delete-btn--danger:hover {
    filter: brightness(1.06);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--danger) 88%, white 12%),
        var(--danger));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 107, 107, 0.26);
}
.admin__delete-btn--danger:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 6px rgba(0, 0, 0, 0.16); }

/* ===== Inputs ===== */
.landing__input,
.landing__select,
.lb-picker__select,
.login__input,
.admin-user-form input,
.campaign-form__field input,
.template-form__field input[type="text"],
.template-form__field input[type="url"],
.template-form__field input[type="email"],
.template-form__field input[type="number"],
.template-form__field input[type="file"],
.template-form__field select,
.template-form__field textarea {
    padding: 11px 14px;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface-input);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.landing__input::placeholder { color: var(--text-dim); }
.landing__input:focus,
.landing__select:focus,
.lb-picker__select:focus,
.login__input:focus,
.admin-user-form input:focus,
.campaign-form__field input:focus,
.template-form__field input:focus,
.template-form__field select:focus,
.template-form__field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring-primary);
}

/* Select arrow */
.landing__select,
.lb-picker__select {
    appearance: none;
    padding-right: 38px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                      linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* ===== Shared surface card accent — instrument hairline at the top ===== */
.landing,
.login__card,
.end-hero {
    position: relative;
}
.landing::before,
.login__card::before,
.end-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 14%; right: 14%;
    height: 2px;
    background: var(--hairline);
    border-radius: 2px;
}

/* ===== Badges (console "chips") ===== */
.landing__badge,
.lb-hero__badge,
.login__badge,
.admin__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 4px 12px 4px 11px;
    border-radius: var(--radius-pill);
    border: 1px solid currentColor;
}
.landing__badge::before,
.lb-hero__badge::before,
.login__badge::before,
.admin__badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* ===== Landing ===== */
.landing {
    max-width: 660px;
    margin: 28px auto 0;
    padding: 40px 40px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}
.landing__hero { text-align: center; margin-bottom: 28px; }
.landing__badge {
    color: var(--primary);
    background: var(--primary-soft);
    margin-bottom: 16px;
    animation: badge-glow 2.8s ease-in-out infinite;
}
@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.0); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 90, 60, 0.12); }
}
[data-theme="light"] .landing__badge { animation-name: badge-glow-light; }
@keyframes badge-glow-light {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.0); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 90, 60, 0.12); }
}
@media (prefers-reduced-motion: reduce) {
    .landing__badge { animation: none; }
}
.landing h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin: 0 0 12px;
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--text);
}
.landing__lead {
    color: var(--text-muted);
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}
.landing__lead strong { color: var(--text); }
.landing__form { margin: 0 0 20px; }
.landing__label {
    display: block;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.landing__row { display: flex; gap: 10px; flex-wrap: wrap; }
.landing__input,
.landing__select { flex: 1 1 220px; }
.landing__select { width: 100%; margin-bottom: 4px; }
.landing__label--spaced { margin-top: 18px; }
.landing__empty {
    margin: 12px 0 20px;
    padding: 16px 18px;
    background: var(--secondary-soft);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-sm);
    color: var(--secondary);
    text-align: center;
}
.landing__empty p { margin: 0 0 6px; }
.landing__empty p:last-child { margin-bottom: 0; }
.landing__hint {
    margin: 8px 0 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}
.landing__meta {
    text-align: center;
    margin: 4px 0 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.landing__link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}
.landing__link:hover { text-decoration: underline; }
.landing__sep { margin: 0 8px; color: var(--text-dim); }
.landing__count { color: var(--secondary); font-weight: 700; }
.landing__tips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}
.landing__tips li {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text-muted);
}
.landing__tips li strong { color: var(--text); }

/* ===== HUD (progress + score) ===== */
.hud {
    max-width: 1400px;
    margin: 0 auto 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-1);
}
.hud__side {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--text-muted);
}
.hud__side--right { text-align: right; }
.hud__pseudo strong { color: var(--text); font-weight: 700; }
.hud__score strong { color: var(--primary); font-weight: 800; }
.hud__progress { min-width: 0; }
.hud__progress-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}
.hud__progress-label strong { color: var(--text); font-size: 0.9rem; }
.hud__bar {
    background: var(--surface-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    height: 10px;
    overflow: hidden;
}
.hud__bar-fill {
    background: linear-gradient(90deg, var(--primary-dim), var(--primary));
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width .4s cubic-bezier(.22,1,.36,1);
    position: relative;
    box-shadow: 0 0 10px rgba(255, 90, 60, 0.40);
}
.hud__bar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.30), transparent 55%);
    border-radius: inherit;
    pointer-events: none;
}
[data-theme="light"] .hud__bar-fill { box-shadow: 0 0 6px rgba(255, 90, 60, 0.20); }
@media (max-width: 640px) {
    .hud { grid-template-columns: 1fr; text-align: center; }
    .hud__side--right { text-align: center; }
}

/* ===== Answer bar ===== */
.answer-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 28px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.answer-btn {
    flex: 1;
    padding: 18px 22px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-1);
    transition: border-color .15s ease, background .15s ease, transform .12s ease, box-shadow .18s ease;
    cursor: pointer;
}
.answer-btn:hover { transform: translateY(-2px); }
.answer-btn:active { transform: translateY(0); }
.answer-btn--legit {
    border-color: color-mix(in srgb, var(--success) 60%, var(--border-bright));
    color: var(--success);
}
.answer-btn--legit:hover { background: var(--success-soft); border-color: var(--success); box-shadow: 0 0 22px rgba(22, 177, 105, 0.20); }
.answer-btn--phish {
    border-color: color-mix(in srgb, var(--danger) 60%, var(--border-bright));
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    line-height: 1.2;
}
.answer-btn--phish:hover { background: var(--danger-soft); border-color: var(--danger); box-shadow: 0 0 22px rgba(255, 107, 107, 0.20); }
.answer-btn__icon { width: 40px; height: 40px; flex: 0 0 auto; object-fit: contain; }
.answer-btn__label { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; }
.answer-btn__sublabel {
    font-size: 0.7em;
    font-weight: 600;
    opacity: 0.85;
    letter-spacing: 0.02em;
    font-family: var(--font-mono);
}

/* ===== Result page ===== */
.result-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    background: var(--surface);
    box-shadow: var(--shadow-1);
}
.result-banner--ok {
    border-color: var(--success);
    background: var(--success-soft);
}
.result-banner--ko {
    border-color: var(--danger);
    background: var(--danger-soft);
}
.result-banner__icon { font-size: 2.2rem; }
.result-banner h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--text);
}
.result-banner--ok h1 { color: var(--success); }
.result-banner--ko h1 { color: var(--danger); }
.result-banner p { margin: 4px 0 0; color: var(--text-muted); }
.result-banner p strong { color: var(--text); }

.result-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}
.result-columns .email-frame { max-width: 820px; margin: 0 auto; }
@media (max-width: 960px) {
    .result-columns { grid-template-columns: 1fr; }
}

.explanation-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-1);
}
.explanation-panel h2 {
    margin: 0 0 14px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}
.explanation-list { margin: 0; padding-left: 20px; color: var(--text-muted); }
.explanation-list li { margin-bottom: 10px; line-height: 1.55; }
.explanation-list li::marker { color: var(--primary); }

.legend {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.legend h3 {
    margin: 0 0 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.legend p { margin: 6px 0; }
.legend-chip {
    display: inline-block;
    min-width: 56px;
    text-align: center;
    font-size: 0.74rem;
    margin-right: 6px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.next-form { margin-top: 22px; }

/* ===== End screen ===== */
.end-hero {
    max-width: 660px;
    margin: 0 auto 32px;
    padding: 40px 32px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-1);
}
.end-hero--perfect { border-color: var(--success); }
.end-hero--perfect::before { background: linear-gradient(90deg, transparent, var(--success) 20%, var(--success) 80%, transparent); }
.end-hero__badge {
    font-size: 3.4rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 12px rgba(255, 90, 60, 0.40));
    animation: float-y 3s ease-in-out infinite;
}
.end-hero--perfect .end-hero__badge {
    filter: drop-shadow(0 0 14px rgba(22, 177, 105, 0.46));
}
[data-theme="light"] .end-hero__badge { filter: drop-shadow(0 2px 8px rgba(255, 90, 60, 0.24)); }
[data-theme="light"] .end-hero--perfect .end-hero__badge { filter: drop-shadow(0 2px 8px rgba(15, 157, 110, 0.30)); }
@keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
    .end-hero__badge { animation: none; }
}
.end-hero h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--primary);
    text-shadow: var(--lit-primary);
}
.end-hero--perfect h1 { color: var(--success); text-shadow: var(--lit-success); }
.end-hero__score {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1;
    margin: 12px 0 16px;
    letter-spacing: -0.04em;
}
.end-hero__score-num {
    font-size: 4.4rem;
    color: var(--primary);
    text-shadow: var(--lit-primary);
}
.end-hero--perfect .end-hero__score-num { color: var(--success); text-shadow: var(--lit-success); }
/* Light: the score reads as a warm coral→orange gradient (the playful hook).
   Dark keeps the solid coral with neon glow for "cyberattaque" drama. */
[data-theme="light"] .end-hero:not(.end-hero--perfect) .end-hero__score-num {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}
.end-hero__score-den {
    font-size: 1.6rem;
    color: var(--text-dim);
    margin-left: 6px;
    font-weight: 600;
}
.end-hero__meta { color: var(--text-muted); margin: 0 0 22px; font-size: 0.95rem; }
.end-hero__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.end-hero__form { margin: 0; }
.end-hero__link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
}
.end-hero__link:hover { text-decoration: underline; }

/* ===== Leaderboard ===== */
.lb-hero {
    max-width: 820px;
    margin: 0 auto 22px;
    padding: 28px 24px 8px;
    text-align: center;
}
.lb-hero__badge {
    color: var(--primary);
    background: var(--primary-soft);
    margin-bottom: 14px;
}
.lb-hero h1 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    margin: 0 0 8px;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--primary);
    text-shadow: var(--lit-primary);
}
.lb-hero__lead { color: var(--text-muted); margin: 0; font-size: 0.96rem; }

.lb-picker {
    max-width: 820px;
    margin: 0 auto 22px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow-1);
}
.lb-picker__label {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.lb-picker__select { flex: 1 1 220px; }
.lb-picker__go { padding: 9px 16px; font-size: 0.82rem; }

/* Podium */
.podium {
    max-width: 880px;
    margin: 40px auto 36px;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: nowrap;
}
.podium__slot {
    flex: 1 1 0;
    min-width: 0;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.podium__slot--1 { order: 2; }
.podium__slot--2 { order: 1; }
.podium__slot--3 { order: 3; }

.podium__card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 22px 14px 18px;
    text-align: center;
    border: 1px solid var(--border);
    border-bottom: none;
}
.podium__card--1 {
    border-color: var(--primary);
    box-shadow:
        0 0 0 1px var(--primary),
        0 0 26px rgba(255, 90, 60, 0.22);
}
[data-theme="light"] .podium__card--1 {
    box-shadow:
        0 0 0 1px var(--primary),
        0 0 18px rgba(255, 90, 60, 0.14);
}
.podium__card--2 { border-color: var(--border-bright); }
.podium__card--3 { border-color: var(--border-bright); }

.podium__crown {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.4rem;
    line-height: 1;
    z-index: 2;
    animation: crown-float 2.4s ease-in-out infinite;
}
@keyframes crown-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
    .podium__crown { animation: none; }
}
.podium__medal { font-size: 2.4rem; line-height: 1; margin: 0 0 10px; }
.podium__card--1 .podium__medal {
    font-size: 2.9rem;
    filter: drop-shadow(0 0 8px rgba(255, 90, 60, 0.5));
}
[data-theme="light"] .podium__card--1 .podium__medal {
    filter: drop-shadow(0 1px 4px rgba(255, 90, 60, 0.35));
}
.podium__pseudo {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
    margin-bottom: 10px;
    line-height: 1.2;
}
.podium__card--1 .podium__pseudo { font-size: 1.2rem; color: var(--primary); text-shadow: var(--lit-primary); }
.podium__score { margin-bottom: 4px; line-height: 1; }
.podium__score-num {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}
.podium__card--1 .podium__score-num { font-size: 2rem; color: var(--primary); text-shadow: var(--lit-primary); }
.podium__score-den { color: var(--text-dim); font-size: 0.85rem; margin-left: 2px; }
.podium__time {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

.podium__base {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 var(--radius) var(--radius);
    position: relative;
    overflow: hidden;
}
.podium__rank { font-size: 2.4rem; position: relative; z-index: 1; }
.podium__base--1 {
    background: linear-gradient(180deg, var(--primary), var(--primary-dim));
    height: 110px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30), 0 4px 16px rgba(255, 90, 60, 0.32);
}
[data-theme="light"] .podium__base--1 {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.40), 0 4px 12px rgba(255, 90, 60, 0.20);
}
.podium__base--2 {
    background: var(--surface-elev);
    color: var(--text);
    height: 78px;
    border: 1px solid var(--border-bright);
    border-top: none;
}
.podium__base--3 {
    background: var(--surface-elev);
    color: var(--text);
    height: 56px;
    border: 1px solid var(--border-bright);
    border-top: none;
}

@media (max-width: 600px) {
    .podium { flex-direction: column; align-items: stretch; gap: 18px; }
    .podium__slot { max-width: 100%; order: unset !important; }
    .podium__slot--1 { order: 1 !important; }
    .podium__slot--2 { order: 2 !important; }
    .podium__slot--3 { order: 3 !important; }
    .podium__base { height: 56px; }
    .podium__rank { font-size: 1.8rem; }
}

/* ===== Leaderboard table ===== */
.leaderboard-section {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 26px;
    box-shadow: var(--shadow-1);
}
.leaderboard-section--standalone { margin-top: 8px; }
.leaderboard-section h1, .leaderboard-section h2 {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text);
}
.leaderboard-section h1 { font-size: 1.6rem; }
.leaderboard__lead { color: var(--text-muted); margin: 0 0 18px; font-size: 0.92rem; }
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.leaderboard th {
    text-align: left;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
}
.leaderboard td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.leaderboard tbody tr:hover td { background: var(--surface-elev); }
.leaderboard__rank {
    width: 56px;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.leaderboard__score {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    font-weight: 700;
}
.leaderboard__time {
    text-align: right;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}
.leaderboard__row--me td { background: var(--primary-soft); }
.leaderboard__row--me td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.leaderboard__me-tag {
    display: inline-block;
    background: var(--primary);
    color: var(--on-primary);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.leaderboard__empty { color: var(--text-dim); font-style: italic; }
.leaderboard__cta { margin-top: 22px; text-align: center; }

.lb-full {
    max-width: 880px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px 18px;
    box-shadow: var(--shadow-1);
}
.lb-full__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}
.lb-full__header h2 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.lb-full__count { color: var(--text-muted); font-size: 0.85rem; font-family: var(--font-mono); }
.lb-full__table-wrap { overflow-x: auto; }
.leaderboard--full { min-width: 560px; }
.lb-full__date {
    color: var(--text-dim);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    white-space: nowrap;
}
.lb-row__pseudo { font-weight: 700; color: var(--text); }
.lb-row--top3-1 td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.lb-row--top3-2 td:first-child { box-shadow: inset 3px 0 0 var(--border-bright); }
.lb-row--top3-3 td:first-child { box-shadow: inset 3px 0 0 var(--border-bright); }
.lb-row--top3-1 .leaderboard__rank { color: var(--primary); }
.lb-row--top3 .leaderboard__rank { font-size: 1.2rem; font-weight: 800; }

.lb-empty {
    max-width: 480px;
    margin: 48px auto;
    background: var(--surface);
    border: 1px dashed var(--border-bright);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
}
.lb-empty__icon { font-size: 3rem; margin-bottom: 10px; }
.lb-empty h2 { margin: 0 0 6px; font-family: var(--font-display); color: var(--text); font-size: 1.3rem; }
.lb-empty p { margin: 0; color: var(--text-muted); }

/* ===== Admin login ===== */
.login {
    display: flex;
    justify-content: center;
    padding: 48px 20px;
}
.login__card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    padding: 32px 32px 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}
.login__badge {
    color: var(--danger);
    background: var(--danger-soft);
    margin-bottom: 14px;
}
.login__card h1 {
    margin: 0 0 20px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
}
.login__form { display: flex; flex-direction: column; }
.login__label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 700;
    margin: 12px 0 6px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.login__alert {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin: 0 0 14px;
    font-size: 0.9rem;
}
.login__alert--error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* ===== Admin nav ===== */
.admin-nav {
    max-width: 1100px;
    margin: 0 auto 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-1);
}
.admin-nav__tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.admin-nav__tab {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.admin-nav__tab:hover { background: var(--surface-elev); color: var(--text); }
.admin-nav__tab.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
.admin-nav__user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-nav__whoami {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.admin-nav__whoami strong { color: var(--text); font-weight: 700; }
.admin-nav__logout { margin: 0; }

/* ===== Admin alerts & panels ===== */
.admin__alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin: 0 0 16px;
    font-size: 0.92rem;
    border: 1px solid var(--border);
}
.admin__alert--ok {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}
.admin__alert--error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}
.admin__panel {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.admin__panel h2 {
    margin: 0 0 12px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.admin__muted { color: var(--text-dim); font-size: 0.85rem; font-style: italic; }
.admin__inline-form { display: inline; margin: 0; }
.admin__actions-col { width: 200px; }
.admin__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ===== Admin stats ===== */
.stats-table { min-width: 820px; width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { vertical-align: middle; padding: 10px 12px; }
.stats-table td .admin__muted { white-space: normal; }

.sortable-th { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 24px;
    padding: 0;
    background: var(--surface-elev);
    color: var(--text-muted);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sort-btn::after { content: "⇅"; }
.sort-btn:hover {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--primary);
}
.sort-btn:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.sort-btn.is-asc, .sort-btn.is-desc {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}
.sort-btn.is-asc::after { content: "↑"; }
.sort-btn.is-desc::after { content: "↓"; }
.stats-table__num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); width: 92px; color: var(--text); }
.stats-table__rate { width: 220px; }
.stats-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid currentColor;
}
.stats-badge--phish { color: var(--danger); background: var(--danger-soft); }
.stats-badge--legit { color: var(--success); background: var(--success-soft); }
.stats-bar {
    position: relative;
    background: var(--surface-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    height: 22px;
    overflow: hidden;
}
.stats-bar__fill { height: 100%; transition: width .4s ease; }
.stats-bar__fill--low  { background: var(--success); }
.stats-bar__fill--mid  { background: var(--secondary); }
.stats-bar__fill--high { background: var(--danger); }
.stats-bar__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
}

/* ===== Admin appearance ===== */
.appearance-preview {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
/* Logo preview kept on a checkered LIGHT tile in both themes — uploaded
   logos are designed for light email surfaces. */
.appearance-preview__logo {
    width: 140px;
    height: 140px;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(45deg, #f3f4f6 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, #f3f4f6 25%, transparent 25%) 0 10px / 20px 20px,
        linear-gradient(45deg, transparent 75%, #f3f4f6 75%) 10px -10px / 20px 20px,
        linear-gradient(-45deg, transparent 75%, #f3f4f6 75%) 10px 0 / 20px 20px,
        #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    flex-shrink: 0;
}
.appearance-preview__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.appearance-preview__meta {
    flex: 1 1 260px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.appearance-preview__meta p { margin: 0 0 10px; }

.appearance-form { display: flex; flex-direction: column; gap: 14px; }
.appearance-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.appearance-form__field input[type="file"] {
    padding: 12px 14px;
    border: 1px dashed var(--border-bright);
    border-radius: var(--radius-sm);
    background: var(--surface-input);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;
    cursor: pointer;
}
.appearance-form__field input[type="file"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring-primary);
}

/* ===== Admin campaigns ===== */
.admin-default-form { display: flex; flex-direction: column; gap: 8px; }
.admin-default-form__row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.admin-default-form__row .landing__select { flex: 1 1 260px; margin-bottom: 0; }

.campaign-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }

.campaign-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .15s ease;
}
.campaign-card:hover { border-color: var(--border-bright); }
.campaign-card--default {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.campaign-card--archived { opacity: 0.55; }

.campaign-card__summary {
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
}
.campaign-card__summary::-webkit-details-marker { display: none; }
.campaign-card__summary::before {
    content: "▶";
    display: inline-block;
    color: var(--primary);
    font-size: 0.75rem;
    margin-right: 8px;
    transition: transform .15s ease;
}
.campaign-card[open] .campaign-card__summary::before { transform: rotate(90deg); }
.campaign-card__headline { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.campaign-card__name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
}
.campaign-card__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid currentColor;
}
.campaign-card__badge--default { color: var(--primary); }
.campaign-card__badge--archived { color: var(--text-dim); }
.campaign-card__facts {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding-left: 22px;
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}
.campaign-card__body {
    padding: 8px 20px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-elev);
}

.campaign-form { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; }
.campaign-form__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.campaign-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.campaign-form__field--wide { grid-column: span 4; }
.campaign-form__field input { letter-spacing: normal; text-transform: none; font-weight: 400; font-family: var(--font-body); }
@media (max-width: 900px) {
    .campaign-form__grid { grid-template-columns: repeat(2, 1fr); }
    .campaign-form__field--wide { grid-column: span 2; }
}
@media (max-width: 520px) {
    .campaign-form__grid { grid-template-columns: 1fr; }
    .campaign-form__field--wide { grid-column: auto; }
}

.campaign-form__scenarios {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px 12px;
    margin: 0;
    background: var(--surface);
}
.campaign-form__scenarios legend {
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.campaign-form__scenarios > p { margin: 4px 0 12px; font-size: 0.84rem; color: var(--text-muted); }
.campaign-form__scenario-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
@media (max-width: 720px) { .campaign-form__scenario-grid { grid-template-columns: 1fr; } }
.campaign-form__checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--text);
    padding: 4px 2px;
    cursor: pointer;
}
.campaign-form__checkbox input { margin-top: 4px; accent-color: var(--primary); }
.campaign-form__scenario-item { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.campaign-form__banner-flag {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-left: 24px;
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted);
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    width: fit-content;
    cursor: pointer;
    text-transform: none;
    font-weight: 500;
}
.campaign-form__banner-flag input { margin: 0; accent-color: var(--primary); }
.campaign-form__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

/* ===== Create-user form ===== */
.admin-user-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}
@media (max-width: 640px) { .admin-user-form__row { grid-template-columns: 1fr; } }
.admin-user-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.admin-user-form__hint {
    margin: 12px 0 0;
    font-size: 0.82rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* ===== Admin panel ===== */
.admin {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 28px;
    box-shadow: var(--shadow-1);
}
.admin--wide { max-width: none; }
.admin + .admin { margin-top: 20px; }
.admin__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.admin__badge {
    color: var(--danger);
    background: var(--danger-soft);
    margin-bottom: 8px;
}
.admin h1 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
}
.admin__lead { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.admin__table-wrap { overflow-x: auto; }
.admin__table { min-width: 820px; width: 100%; border-collapse: collapse; }
.admin__table th, .admin__table td {
    white-space: nowrap;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.admin__table th {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    background: var(--surface-elev);
    border-bottom: 1px solid var(--border-bright);
}
.admin__table td { color: var(--text); }
.admin__table tbody tr:hover td { background: var(--surface-elev); }
.admin__timestamp {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.admin__id { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); }
.admin__id-col { width: 200px; }

/* ===== Fake browser status bar (mimics real browser, light) ===== */
.fake-link-statusbar {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 900;
    max-width: 70vw;
    padding: 4px 12px 4px 10px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .08s ease, transform .08s ease;
}
.fake-link-statusbar.is-visible { opacity: 1; transform: translateY(0); }
@media (hover: none) and (pointer: coarse) { .fake-link-statusbar { display: none !important; } }

/* Tooltip for blocked link clicks */
.fake-link-tooltip {
    position: absolute;
    z-index: 999;
    background: var(--surface-elev);
    color: var(--text);
    border: 1px solid var(--primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    box-shadow: var(--shadow-2);
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease;
}
.fake-link-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.fake-link-tooltip__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--primary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-weight: 700;
}

/* ===== Touch mode ===== */
body.touch-mode button, body.touch-mode a, body.touch-mode input,
body.touch-mode .answer-btn, body.touch-mode .next-btn { touch-action: manipulation; }
body.touch-mode button, body.touch-mode .answer-btn, body.touch-mode .next-btn,
body.touch-mode .landing__btn, body.touch-mode .admin-nav__tab {
    -webkit-user-select: none; user-select: none;
}
body.touch-mode input[type="text"], body.touch-mode input[type="password"] { font-size: 16px; }
body.touch-mode .landing__input { padding: 18px; font-size: 1.1rem; min-height: 56px; }
body.touch-mode .landing__btn { padding: 18px 28px; font-size: 1.1rem; min-height: 56px; }
body.touch-mode .landing__link { padding: 8px 6px; display: inline-block; }
body.touch-mode .answer-btn { padding: 22px 24px; font-size: 1.15rem; min-height: 68px; }
body.touch-mode .next-btn { padding: 16px 22px; font-size: 1.05rem; min-height: 54px; }
body.touch-mode .admin-nav__tab {
    padding: 14px 18px;
    font-size: 0.85rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}
body.touch-mode .admin-nav__logout-btn { padding: 12px 18px; font-size: 0.85rem; min-height: 48px; }
body.touch-mode .admin__delete-btn { padding: 10px 16px; font-size: 0.82rem; min-height: 44px; }
body.touch-mode .admin__reset-btn,
body.touch-mode .admin__export-btn { padding: 14px 22px; font-size: 0.9rem; min-height: 52px; }
body.touch-mode .admin-user-form input { padding: 14px; font-size: 1rem; min-height: 50px; }
body.touch-mode .admin-user-form__btn { padding: 14px 22px; font-size: 0.9rem; min-height: 50px; height: auto; }
body.touch-mode .login__input { padding: 15px; font-size: 1.05rem; min-height: 52px; }
body.touch-mode .login__btn { padding: 16px 22px; font-size: 1.05rem; min-height: 54px; }

@media (hover: none) and (pointer: coarse) {
    .answer-btn:hover, .next-btn:hover, .landing__btn:hover,
    .admin__export-btn:hover, .login__btn:hover { transform: none; }
}

/* ===== Admin scenario preview ===== */
.admin-preview-link {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    white-space: nowrap;
}
.admin-preview-link:hover { color: var(--primary-dim); border-bottom-color: var(--primary-dim); }

.admin-preview { max-width: 1200px; margin: 0 auto; padding: 8px 16px 40px; }
.admin-preview__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.admin-preview__back {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 6px;
}
.admin-preview__back:hover { color: var(--primary); }
.admin-preview__title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.admin-preview__title code {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--primary);
}
.admin-preview__sub { margin: 0; font-style: normal; }
.admin-preview__layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.admin-preview__side { display: flex; flex-direction: column; gap: 16px; }
.admin-preview__block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-1);
}
.admin-preview__block-title {
    margin: 0 0 12px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.admin-preview__options { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.admin-preview__option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.92rem;
    color: var(--text);
    cursor: pointer;
}
.admin-preview__option input { margin-top: 4px; accent-color: var(--primary); }
.admin-preview__explanation { margin: 0; padding-left: 20px; font-size: 0.9rem; color: var(--text-muted); }
.admin-preview__explanation li { margin-bottom: 8px; line-height: 1.5; }
.admin-preview__explanation li:last-child { margin-bottom: 0; }
.admin-preview__explanation li::marker { color: var(--primary); }
.admin-preview__meta { margin: 0; font-size: 0.88rem; }
.admin-preview__meta dt {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 12px;
}
.admin-preview__meta dt:first-child { margin-top: 0; }
.admin-preview__meta dd { margin: 4px 0 0; color: var(--text); word-break: break-all; }
.admin-preview__meta code {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--primary);
}
.admin-preview__keyword {
    display: inline-block;
    background: var(--secondary-soft);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin: 2px 4px 2px 0;
}
@media (max-width: 900px) { .admin-preview__layout { grid-template-columns: 1fr; } }

/* ===== Admin templates — brand cards ===== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.template-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s ease, transform .15s ease, box-shadow .18s ease;
    box-shadow: var(--shadow-1);
}
.template-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.template-card__preview { height: 110px; display: flex; align-items: center; justify-content: center; padding: 12px; }
/* Brand logos render on a LIGHT tile in both themes — they're designed for
   light email surfaces; previewing them on dark would mislead the admin. */
.template-card__logo-frame {
    background: #ffffff;
    border-radius: var(--radius-sm);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    box-sizing: border-box;
    border: 1px solid var(--border);
}
.template-card__logo {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
}
.template-card__logo svg, .template-card__logo img {
    max-width: 100%;
    max-height: 70px;
    height: auto;
    width: auto;
    display: block;
}
.template-card__body { padding: 14px 16px 12px; flex: 1; }
.template-card__name {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--text);
}
.template-card__slug { margin: 0 0 12px; font-size: 0.8rem; color: var(--text-dim); }
.template-card__slug code {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--primary);
}
.template-card__meta { margin: 0; display: grid; gap: 6px; font-size: 0.84rem; }
.template-card__meta div { display: flex; gap: 8px; align-items: center; }
.template-card__meta dt {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    flex: 0 0 130px;
    margin: 0;
}
.template-card__meta dd { margin: 0; color: var(--text); display: flex; align-items: center; gap: 6px; }
.color-chip {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--border-bright);
    flex-shrink: 0;
}
.template-edit__current { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.template-edit__current-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    min-width: 120px;
    min-height: 48px;
}
.template-edit__current-logo svg, .template-edit__current-logo img {
    max-height: 40px; max-width: 200px; height: auto; width: auto; display: block;
}
.template-card__actions {
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    background: var(--surface-elev);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Admin templates — create form layout ===== */
.template-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: flex-start;
    margin-top: 18px;
}
.template-form { min-width: 0; }
.template-form .admin__panel { margin-bottom: 16px; }
.template-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.template-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    min-width: 0;
}
.template-form__field > span:first-child,
.template-form__label {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Quill editor — kept LIGHT for WYSIWYG fidelity with rendered emails. */
.rich-editor {
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    background: #ffffff;
    overflow: hidden;
}
.rich-editor .ql-toolbar.ql-snow {
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    background: #f9fafb;
}
.rich-editor .ql-container.ql-snow { border: 0; font: inherit; font-size: 0.94rem; }
.rich-editor .ql-editor { min-height: 140px; color: #111827; }
.rich-editor .ql-editor.ql-blank::before { color: #9ca3af; font-style: normal; }

.template-form__field textarea { resize: vertical; min-height: 80px; }
.template-form__field small {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;
}
.color-input { display: flex; gap: 8px; align-items: center; }
.color-input input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    background: var(--surface-input);
    cursor: pointer;
    flex-shrink: 0;
}
.color-input input[type="text"] {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.template-form__preview {
    position: sticky;
    top: 100px;
    background: var(--surface);
    border: 1px dashed var(--border-bright);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-1);
}
.template-form__preview-title {
    margin: 0 0 4px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.template-form__preview-hint { margin: 0 0 14px; font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 1100px) {
    .template-form-layout { grid-template-columns: 1fr; }
    .template-form__preview { position: static; }
}

/* ===== Admin scenarios — verdict picker ===== */
.scn-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.scn-verdict__option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--surface);
    transition: border-color .15s ease, background .15s ease;
}
.scn-verdict__option:hover { border-color: var(--border-bright); }
.scn-verdict__option input[type="radio"] { margin-top: 4px; flex-shrink: 0; accent-color: var(--primary); }
.scn-verdict__label { display: flex; flex-direction: column; gap: 4px; }
.scn-verdict__label strong {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.01em;
}
.scn-verdict__label small { color: var(--text-muted); font-size: 0.84rem; line-height: 1.4; }
.scn-verdict__option:has(input:checked).scn-verdict__option--phish {
    border-color: var(--danger);
    background: var(--danger-soft);
}
.scn-verdict__option:has(input:checked).scn-verdict__option--legit {
    border-color: var(--success);
    background: var(--success-soft);
}
@media (max-width: 720px) { .scn-verdict { grid-template-columns: 1fr; } }

/* Source badge */
.source-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}
.source-badge--builtin { color: var(--text-dim); }
.source-badge--custom { color: var(--secondary); background: var(--secondary-soft); }

/* ===== Theme picker (admin appearance) ===== */
.theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 8px;
}
.theme-picker__option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease;
}
.theme-picker__option:hover { border-color: var(--border-bright); }
.theme-picker__option input[type="radio"] {
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.theme-picker__option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.theme-picker__swatch {
    flex: 0 0 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}
.theme-picker__swatch--dark {
    background: linear-gradient(135deg, #0a0e17 0%, #1a2334 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 90, 60, 0.35);
}
.theme-picker__swatch--light {
    background: linear-gradient(135deg, #ffffff 0%, #eef2f9 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 90, 60, 0.30);
}
.theme-picker__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.theme-picker__label strong {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.01em;
}
.theme-picker__label small {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===========================================================
   Sprint flow screens — home · rules · countdown · pseudo
   Shared, token-driven block (identical across themes; each
   theme renders it in its own palette). Mirrors the BrainAndros
   "Cyber Sprint" UX. Motion guarded by prefers-reduced-motion.
   =========================================================== */

.fade-in { animation: cs-fade-in .4s ease both; }
@keyframes cs-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Shared play button + text link ---- */
.btn-play {
    display: inline-block;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    padding: 18px 56px;
    color: var(--on-primary);
    background: linear-gradient(135deg, var(--secondary), var(--primary) 60%, var(--primary-dim));
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform .18s var(--ease-bounce, cubic-bezier(.34,1.56,.64,1)),
                box-shadow .2s ease, filter .2s ease;
}
.btn-play:hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.05); box-shadow: var(--glow-primary, var(--shadow-2)), var(--shadow-1); }
.btn-play:active { transform: translateY(0) scale(.99); }
.btn-play:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.btn-play--disabled {
    background: var(--surface-elev);
    color: var(--text-dim);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}
.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: color .15s ease, background .15s ease, transform .15s ease;
}
.link-btn:hover { color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }

/* ---- Home ---- */
.home {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 24px 16px;
}
.home-logo { width: clamp(120px, 14vw, 168px); height: auto; object-fit: contain; margin-bottom: 10px; }
.home-kicker {
    font-family: var(--font-mono);
    font-size: clamp(13px, 1.5vw, 19px);
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 14px;
}
.home-title {
    font-family: var(--font-display);
    font-size: clamp(72px, 13vw, 188px);
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: -0.035em;
    color: var(--text);
    text-shadow: var(--lit-primary);
    margin: 0;
}
.home-tag {
    margin: 22px 0 0;
    font-size: clamp(18px, 2.1vw, 27px);
    color: var(--text-muted);
    max-width: 22ch;
    line-height: 1.3;
}
.home-actions {
    margin-top: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}
.home-actions-row {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}
.home .btn-play { padding: 28px 84px; font-size: clamp(24px, 3vw, 38px); }
.home .link-btn { font-size: 1.35rem; }

/* ---- Rules ---- */
.rules {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    padding: 8px 8px 24px;
}
.rules-head { margin-bottom: 26px; }
.rules-kicker {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}
.rules-head h1 {
    font-family: var(--font-display);
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 800;
    color: var(--text);
    margin: 0;
}
.rules-lead { margin: 14px auto 0; max-width: 56ch; color: var(--text-muted); font-size: 1.02rem; }
.rules-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 8px 0 28px;
    text-align: left;
}
.rule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 22px;
    box-shadow: var(--shadow-1);
    transition: transform .25s var(--ease-bounce, cubic-bezier(.34,1.56,.64,1));
}
.rule-card:hover { transform: translateY(-5px); }
.rule-card__ic {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 12px;
}
.rule-card p { margin: 0; color: var(--text-muted); line-height: 1.55; font-size: 0.98rem; }
.rule-card p strong { color: var(--text); }
.rules-tips {
    list-style: none;
    padding: 0;
    margin: 0 auto 28px;
    max-width: 720px;
    text-align: left;
    display: grid;
    gap: 10px;
}
.rules-tips li {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.rules-tips li strong { color: var(--text); }
.rules-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
}
.rules-empty { color: var(--text-muted); }
@media (max-width: 760px) { .rules-cards { grid-template-columns: 1fr; } }

/* ---- Countdown ---- */
.countdown-screen {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.countdown {
    font-family: var(--font-display);
    font-size: clamp(140px, 30vw, 360px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--primary);
    text-shadow: var(--lit-primary);
    animation: cs-count-pop .8s var(--ease-bounce, cubic-bezier(.34,1.56,.64,1)) both;
}
.countdown.go {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: clamp(90px, 18vw, 220px);
}
@keyframes cs-count-pop {
    0% { opacity: 0; transform: scale(.4); }
    45% { opacity: 1; transform: scale(1.14); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---- Pseudo entry (on-screen AZERTY) ---- */
.pseudo {
    max-width: min(1060px, 96vw);
    margin: 0 auto;
    text-align: center;
    padding: 8px 8px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pseudo-title {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.6vw, 52px);
    font-weight: 800;
    color: var(--text);
    margin: 0 0 44px;
}
.pseudo-input {
    min-width: 360px;
    min-height: 1.5em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-1);
    padding: 12px 22px;
    margin-bottom: 34px;
    font-family: var(--font-display);
    font-size: clamp(34px, 5.6vw, 54px);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text);
    user-select: none;
}
.pseudo-input .caret { color: var(--primary); animation: cs-blink 1s steps(1) infinite; }
@keyframes cs-blink { 50% { opacity: 0; } }

.keyboard { display: flex; flex-direction: column; align-items: center; gap: 13px; margin-bottom: 26px; }
.kb-row { display: flex; gap: clamp(6px, 0.9vw, 12px); flex-wrap: wrap; justify-content: center; }
.kb-key {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(26px, 3.6vw, 40px);
    min-width: 92px;
    padding: 18px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-1);
    transition: transform .1s ease, background .12s ease, color .12s ease;
}
.kb-key:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--on-primary);
    transform: translateY(-2px);
}
.kb-key:active { transform: translateY(0) scale(.97); }
.kb-key--boxed { color: var(--primary); }
.kb-key--space { min-width: 0; padding: 18px 160px; font-size: 1.1rem; letter-spacing: 0.1em; }
.pseudo-fallback { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
    .fade-in, .countdown, .btn-play, .rule-card, .kb-key, .pseudo-input .caret { animation: none; transition: none; }
}

/* ===========================================================
   Sticky footer — pin the footer rule + tagline to the bottom
   of the viewport on short pages (header was removed).
   =========================================================== */
body { display: flex; flex-direction: column; }
.app-main { flex: 1 0 auto; }
.app-footer { flex-shrink: 0; }

/* ===========================================================
   Admin nav on a single line — keep every tab + the user
   actions on one row, tightening the spacing to fit. If a
   viewport is genuinely too narrow, scroll horizontally
   rather than wrapping onto several lines.
   =========================================================== */
.admin-nav {
    max-width: 1100px;
    flex-wrap: wrap;
    gap: 8px 12px;
}
/* Row 1: every tab + "Voir le jeu" side by side (scroll if too narrow). */
.admin-nav__tabs { flex: 1 1 100%; flex-wrap: nowrap; gap: 2px; overflow-x: auto; }
.admin-nav__tab { padding: 7px 10px; font-size: 0.78rem; white-space: nowrap; }
/* Row 2: "Connecté en tant que…" with the logout button beside it. */
.admin-nav__user { width: 100%; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 10px; white-space: nowrap; }
/* ===== Leaderboard (redesign — clean card) ===== */
.lb {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    padding: 32px 16px;
}
.lb__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(46px, 8vw, 86px);
    line-height: 1;
    color: var(--text);
    margin: 0;
}
.lb__sub {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-dim);
    margin: 0 0 14px;
}
.lb__card {
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border-radius: 26px;
    box-shadow: 0 28px 60px -28px rgba(43, 27, 20, 0.28);
    padding: 8px 30px;
}
.lb__card--empty {
    padding: 38px 30px;
    color: var(--text-muted);
}
.lb__row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 4px;
    border-bottom: 1px solid var(--border);
}
.lb__row:last-child { border-bottom: none; }
.lb__rank {
    flex: 0 0 auto;
    min-width: 34px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dim);
}
.lb__pseudo {
    flex: 1;
    text-align: left;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 1.15rem;
    color: var(--text);
}
.lb__time {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.lb__score {
    flex: 0 0 auto;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
}
.lb__close {
    margin-top: 26px;
    display: inline-block;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    padding: 18px 58px;
    border-radius: 999px;
    box-shadow: 0 18px 40px -20px rgba(43, 27, 20, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lb__close:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px -22px rgba(43, 27, 20, 0.38);
}
.lb__credit {
    margin: 18px 0 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}
