/* =============================================================================
   USMLE PULSE — main.css
   Design system: tokens, reset, base typography, shared components.
   Load order: main.css -> page CSS (landing/auth/dashboard).
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. DESIGN TOKENS
   The single source of truth for color, type, spacing, radius, shadow, motion.
   Change a brand color here and it cascades across the whole site.
--------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --ink:          #0c1a24;   /* near-black text / deep surfaces */
  --ink-2:        #142a3a;   /* raised dark surface */
  --ink-soft:     #3a4f5e;   /* secondary text on light */
  --paper:        #f7f6f3;   /* warm off-white page bg */
  --paper-2:      #ffffff;   /* cards on paper */
  --line:         #e7e3dc;   /* hairline borders on light */
  --line-dark:    #21384a;   /* hairline borders on dark */

  --brand:        #0f766e;   /* teal — trust / medical / primary */
  --brand-600:    #0c655e;
  --brand-700:    #0a544e;
  --brand-bright: #14b8a6;   /* teal highlight / illustration */
  --brand-tint:   #e3f3f1;   /* teal wash background */

  --pulse:        #ff5a4c;   /* coral — the heartbeat / CTA / accent */
  --pulse-600:    #ed4636;
  --pulse-tint:   #ffe9e6;

  --gold:         #f5b942;   /* sparing accent for ratings / highlights */
  --success:      #16a34a;
  --danger:       #dc2626;
  --info:         #2563eb;

  /* Text roles */
  --text:         var(--ink);
  --text-muted:   #5b6b77;
  --text-invert:  #eaf2f1;
  --text-invert-muted: #9db4bf;

  /* Typography */
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-body:    "Hanken Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid type scale (clamp = responsive without breakpoints) */
  --t-eyebrow: 0.78rem;
  --t-body:    clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --t-lead:    clamp(1.125rem, 1.05rem + 0.4vw, 1.3rem);
  --t-h3:      clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --t-h2:      clamp(1.75rem, 1.4rem + 1.6vw, 2.6rem);
  --t-h1:      clamp(2.4rem, 1.8rem + 3vw, 4.2rem);

  /* Spacing scale */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem;

  /* Radius */
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-xl: 32px; --r-pill: 999px;

  /* Shadows — soft, layered, premium */
  --shadow-sm: 0 1px 2px rgba(12,26,36,.06), 0 1px 3px rgba(12,26,36,.05);
  --shadow-md: 0 6px 16px -6px rgba(12,26,36,.14), 0 2px 6px rgba(12,26,36,.06);
  --shadow-lg: 0 24px 48px -18px rgba(12,26,36,.28), 0 8px 18px -10px rgba(12,26,36,.14);
  --shadow-glow: 0 0 0 1px rgba(255,90,76,.25), 0 10px 40px -10px rgba(255,90,76,.45);

  /* Layout */
  --maxw: 1180px;
  --maxw-narrow: 760px;
  --header-h: 72px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-fast: .15s; --dur: .28s; --dur-slow: .6s;
}

/* ---------------------------------------------------------------------------
   2. RESET & BASE
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: var(--t-h1); font-weight: 800; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

/* Accessibility: visible focus + skip link + reduced motion */
:focus-visible { outline: 3px solid var(--pulse); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------------------------------------------------------------------------
   3. LAYOUT HELPERS
--------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.narrow { max-width: var(--maxw-narrow); }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--sp-4); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 500;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--brand); opacity: .6; }
.section-head { max-width: 640px; margin-bottom: var(--sp-7); }
.section-head.center { margin-inline: auto; }
.section-head h2 { margin-top: var(--sp-3); }
.section-head p { color: var(--text-muted); font-size: var(--t-lead); margin-top: var(--sp-3); }

/* ---------------------------------------------------------------------------
   4. BUTTONS
--------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  padding: .82rem 1.4rem; border-radius: var(--r-pill);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  white-space: nowrap; line-height: 1; border: 1px solid transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--pulse); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--pulse-600); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(12,26,36,.03); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.02rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   5. CARDS / PILLS / BADGES
--------------------------------------------------------------------------- */
.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  padding: .35rem .7rem; border-radius: var(--r-pill);
  background: var(--brand-tint); color: var(--brand-700); font-weight: 500;
}
.badge { display:inline-flex; align-items:center; gap:.4rem; font-size:.78rem; font-weight:600; padding:.25rem .65rem; border-radius: var(--r-pill); }
.badge-active { background: rgba(22,163,74,.12); color: var(--success); }
.badge-pending { background: rgba(245,185,66,.18); color: #9a6b00; }
.badge-none { background: rgba(12,26,36,.07); color: var(--text-muted); }

/* ---------------------------------------------------------------------------
   6. FORMS
--------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .45rem; margin-bottom: var(--sp-4); }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--text-muted); }
.input, .input-wrap input {
  width: 100%; padding: .8rem 1rem; font-size: 1rem;
  background: var(--paper-2); border: 1.5px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input:focus, .input-wrap input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.input.is-invalid { border-color: var(--danger); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 3rem; }
.input-wrap .toggle-pw {
  position: absolute; right: .5rem; padding: .4rem; color: var(--text-muted); border-radius: var(--r-sm);
}
.input-wrap .toggle-pw:hover { color: var(--text); }
.field-error { color: var(--danger); font-size: .82rem; min-height: 1.1em; }
.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; font-size: .9rem; color: var(--text-muted); }
.checkbox-row input { margin-top: .2rem; accent-color: var(--brand); width: 18px; height: 18px; }
.divider-or { display: flex; align-items: center; gap: 1rem; color: var(--text-muted); font-size: .82rem; margin: var(--sp-5) 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Password strength meter */
.pw-meter { height: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; margin-top: .4rem; }
.pw-meter > span { display: block; height: 100%; width: 0; transition: width var(--dur) var(--ease), background var(--dur) var(--ease); border-radius: inherit; }

/* ---------------------------------------------------------------------------
   7. HEADER / NAV (injected by components/layout.js)
--------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.nav-menu { display: flex; align-items: center; gap: var(--sp-5); }
.nav-links { display: flex; align-items: center; gap: var(--sp-2); }
.nav-links a { padding: .5rem .8rem; border-radius: var(--r-sm); font-weight: 500; font-size: .95rem; color: var(--ink-soft); transition: color var(--dur-fast), background var(--dur-fast); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: rgba(12,26,36,.05); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-3); }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: var(--r-sm); align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content:""; display:block; width:22px; height:2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform var(--dur) var(--ease), opacity var(--dur-fast); }
.nav-toggle span::before { position:absolute; top:-7px; } .nav-toggle span::after { position:absolute; top:7px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; position: relative; z-index: 210; }
  .nav-menu {
    position: fixed; inset: 0; z-index: 200; background: var(--paper);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: calc(var(--header-h) + var(--sp-4)) var(--sp-5) var(--sp-6);
    gap: var(--sp-2); overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%); transition: transform var(--dur) var(--ease); display: flex;
  }
  body.nav-open .nav-menu { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .nav-links { flex-direction: column; align-items: stretch; gap: var(--sp-1); }
  .nav-links a { padding: .95rem 1rem; font-size: 1.08rem; border-radius: var(--r-md); }
  .nav-actions { flex-direction: column; align-items: stretch; gap: var(--sp-3); margin-top: var(--sp-4); }
  .nav-actions .btn { width: 100%; }
  /* backdrop-filter on the header makes it a containing block for the fixed
     menu, clipping it to header height — disable it on mobile so the overlay
     fills the screen and all tabs show. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none;
    background: color-mix(in srgb, var(--paper) 94%, transparent); }
}

/* ---------------------------------------------------------------------------
   8. FOOTER (injected)
--------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--text-invert-muted); padding-block: var(--sp-8) var(--sp-6); margin-top: var(--sp-9); }
.site-footer a { color: var(--text-invert-muted); transition: color var(--dur-fast); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-6); padding-bottom: var(--sp-7); border-bottom: 1px solid var(--line-dark); }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin-top: var(--sp-3); max-width: 32ch; font-size: .92rem; }
.footer-col h4 { color: #fff; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; margin-bottom: var(--sp-3); }
.footer-col ul { display: flex; flex-direction: column; gap: .6rem; font-size: .92rem; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-top: var(--sp-5); font-size: .85rem; flex-wrap: wrap; }
.social-row { display: flex; gap: .5rem; }
.social-row a { width: 38px; height: 38px; border: 1px solid var(--line-dark); border-radius: var(--r-pill); display: grid; place-items: center; }
.social-row a:hover { border-color: var(--pulse); color: #fff; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------------------
   9. TOAST (ui.js)
--------------------------------------------------------------------------- */
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 300; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  display: flex; align-items: center; gap: .7rem; background: var(--ink); color: #fff;
  padding: .85rem 1.1rem; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-size: .92rem; max-width: 360px; transform: translateY(10px); opacity: 0;
  animation: toast-in .35s var(--ease-out) forwards;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
@keyframes toast-in { to { transform: translateY(0); opacity: 1; } }

/* ---------------------------------------------------------------------------
   10. SCROLL REVEAL (ui.js adds .reveal then .in)
--------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* The animated ECG / pulse line — the brand signature */
.pulse-line path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw-pulse 3s var(--ease-out) forwards; }
@keyframes draw-pulse { to { stroke-dashoffset: 0; } }

/* ===== Floating chat widget ===== */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 150; width: 56px; height: 56px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: var(--brand);
  box-shadow: 0 10px 26px rgba(15,118,110,.4); transition: transform .15s, box-shadow .15s; }
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(15,118,110,.5); }
.chat-fab.is-open { background: var(--ink); }
.chat-panel { position: fixed; right: 20px; bottom: 88px; z-index: 150; width: min(360px, calc(100vw - 40px));
  height: min(520px, calc(100vh - 140px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(12,26,36,.25); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem;
  background: var(--ink); color: #fff; }
.chat-head b { font-size: .98rem; }
.chat-x { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: .8; }
.chat-x:hover { opacity: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.chat-empty { color: var(--text-muted); font-size: .9rem; text-align: center; margin: auto; }
.cmsg { max-width: 80%; padding: .55rem .8rem; border-radius: var(--r-md); font-size: .92rem; line-height: 1.45; }
.cmsg.in { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line); }
.cmsg.out { align-self: flex-end; background: var(--brand); color: #fff; }
.chat-foot { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); align-items: center; }
.chat-foot .input { flex: 1; }
.chat-foot .btn { flex: none; padding: .6rem .8rem; }
@media (max-width: 480px) {
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 84px; }
  .chat-fab { right: 14px; bottom: 14px; }
}

/* Footer email subscribe */
.footer-newsletter { display: flex; gap: .5rem; margin-top: 1.1rem; max-width: 320px; }
.footer-newsletter .input { flex: 1; }
.footer-newsletter .btn { flex: none; }
@media (max-width: 560px) { .footer-newsletter { max-width: none; } }

/* Fix: [hidden] must win over the panel's display:flex (chat opened by default / wouldn't close) */
.chat-panel[hidden] { display: none !important; }
.chat-fab[hidden] { display: none !important; }

/* =============================== NIGHT MODE =============================== */
[data-theme="dark"] {
  --paper: #0c151c;        /* page background */
  --paper-2: #16242f;      /* cards / raised surfaces */
  --line: #28394a;         /* borders */
  --text: #e7eef1;         /* body text */
  --text-muted: #9fb3bf;
  --ink-soft: #9fb3bf;
  --brand-tint: #0d2826;
  --pulse-tint: #2c1714;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 6px 16px -6px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 48px -18px rgba(0,0,0,.7);
}
/* --ink stays dark so hero, footer, dark buttons & badges keep their look */
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .input,
[data-theme="dark"] select.input,
[data-theme="dark"] textarea.input { background: var(--paper-2); border-color: var(--line); color: var(--text); }
[data-theme="dark"] .input::placeholder { color: var(--text-muted); }
/* text that was authored as dark-on-light → make light on dark surfaces */
[data-theme="dark"] .task-summary,
[data-theme="dark"] .task-title,
[data-theme="dark"] .td-sec li,
[data-theme="dark"] .td-sec h5,
[data-theme="dark"] .td-hi,
[data-theme="dark"] .td-qid-str,
[data-theme="dark"] .cs-line b,
[data-theme="dark"] .pkg-cell,
[data-theme="dark"] .coin-chip strong,
[data-theme="dark"] .pay-card,
[data-theme="dark"] .admin-tab.is-active,
[data-theme="dark"] .admin-table td,
[data-theme="dark"] .demo-hint b,
[data-theme="dark"] .auth-note strong,
[data-theme="dark"] .np-amt { color: var(--text); }
/* hamburger lines + nav hover on the now-dark header */
[data-theme="dark"] .nav-toggle span,
[data-theme="dark"] .nav-toggle span::before,
[data-theme="dark"] .nav-toggle span::after { background: var(--text); }
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,.08); }
[data-theme="dark"] .btn-ghost:hover { color: var(--text); border-color: var(--text); background: rgba(255,255,255,.05); }
[data-theme="dark"] .admin-table th { background: var(--paper-2); }

/* Theme toggle button */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s; }
.theme-toggle:hover { background: color-mix(in srgb, var(--text) 8%, transparent); border-color: var(--text-muted); }
.nav-actions .theme-toggle { order: -1; }
@media (max-width: 880px) { .nav-actions .theme-toggle { width: 100%; border-radius: var(--r-md); gap: .5rem; } .theme-toggle .tt-label { display: inline; } }
.theme-toggle .tt-label { display: none; margin-left: .5rem; font-weight: 600; }

/* Footer bottom legal links */
.footer-legal-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-legal-links a { color: var(--text-invert-muted); }
.footer-legal-links a:hover { color: #fff; }

/* -----------------------------------------------------------------------
   The HTML `hidden` attribute must ALWAYS win over component display rules.
   Without this, any `.thing { display:flex/grid }` overrides `[hidden]`
   (same specificity, author beats UA), so "hidden" elements still render.
   This one rule prevents that across every page. -------------------------- */
[hidden] { display: none !important; }
