/* ==========================================================================
   Rivalry-Week CFB Fantasy — Design System
   ==========================================================================

   Design rationale:
   - Notre Dame navy (#0C2340) as the signature dark base — deep and
     authoritative, the color of the Golden Dome at dusk.
   - Notre Dame gold (#C99700) as the single accent — used sparingly for
     scores, highlights, and CTAs. Richer and more muted than generic amber.
   - Warm white (#F0EEE9) for primary text — slightly cream, not clinical.
   - JetBrains Mono for all stat numbers — monospaced so columns align
     perfectly without a table layout hack.
   - Bebas Neue for display headings only — punchy but used with restraint.

   Token system
   ──────────────────────────────────────────────────────────────────────── */

:root {
  /* Color tokens */
  --c-field:        #0C2340;   /* Notre Dame navy — primary bg in dark contexts */
  --c-field-mid:    #163058;   /* lighter navy for cards/panels */
  --c-field-light:  #1E4080;   /* hover states, borders */
  --c-chalk:        #F0EEE9;   /* primary text on dark */
  --c-chalk-dim:    #A8A8A8;   /* secondary / muted text */
  --c-amber:        #C99700;   /* Notre Dame gold — accent, scores, CTAs */
  --c-amber-dim:    #7A5C00;   /* gold on darker background */
  --c-page:         #060E1A;   /* deepest bg — night game layer */
  --c-surface:      #0A1A2E;   /* card surfaces */
  --c-surface-hi:   #102240;   /* elevated cards */
  --c-border:       #1E408040; /* subtle borders */
  --c-danger:       #EF4444;
  --c-success:      #22C55E;
  --c-warning:      #C99700;
  --c-nav-special:  #60A5FA;   /* nav-only accent for My Leagues / Commissioner — never gold */

  /* Strength-multiplier scale — one band per difficulty step, so a 0.75 and a
     0.90 no longer read as the same "bad". Thresholds live in the `mult()`
     macro (server) and `multClass()` in main.js (client); the colours live
     only here. */
  --mult-vlow:      #F87171;   /* < 0.85  — much weaker opponent */
  --mult-low:       #FB923C;   /* < 0.95  — somewhat weaker. Orange, deliberately
                                  not the ND gold: gold is the app's identity
                                  colour, not a scoring signal. */
  --mult-even:      #A8A8A8;   /* ~ 1.00  — even matchup */
  --mult-high:      #86EFAC;   /* < 1.35  — somewhat stronger */
  --mult-vhigh:     #22C55E;   /* >=1.35  — much stronger opponent */

  /* Typography */
  --f-display:  'Bebas Neue', 'Arial Narrow', sans-serif;
  --f-body:     'Inter', system-ui, sans-serif;
  --f-mono:     'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-display: 3.5rem;

  /* Spacing (8px grid) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Layout */
  --container-max: 1280px;
  --nav-height:    44px;
  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  /* Transitions */
  --t-fast:   120ms ease;
  --t-base:   200ms ease;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--f-body);
  font-size: var(--text-base);
  line-height: 1.6;
  background: var(--c-page);
  color: var(--c-chalk);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; }

/* ==========================================================================
   Top Nav
   ========================================================================== */

.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--c-field);
  border-bottom: 1px solid var(--c-field-light);
  box-shadow: var(--shadow);
}

.topnav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-4);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

/* Brand / wordmark */
.topnav__brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.topnav__brand-primary {
  font-family: var(--f-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--c-chalk);
  line-height: 1;
}

.topnav__brand-secondary {
  font-family: var(--f-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--c-amber);
  line-height: 1;
}

.topnav__brand-tag {
  display: none;
}

/* Nav links */
.topnav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
}

.topnav__link {
  padding: var(--sp-1) var(--sp-2);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-chalk-dim);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
  letter-spacing: 0.02em;
}

.topnav__link:hover { color: var(--c-chalk); background: var(--c-field-mid); }
/* Commissioner, My Leagues, and Superadmin always keep their own fixed
   accent color — never boxed/gold-highlighted for being the active page,
   so `--active` is intentionally not added to those links in the template. */
.topnav__link--special { color: var(--c-nav-special); }  /* Commissioner: always blue */
.topnav__link--leagues { color: var(--c-amber); }          /* My Leagues: always gold */
.topnav__link--super { color: var(--c-danger); }           /* Superadmin: always red */

/* Active page — a filled gold box, matching .btn--primary (e.g. "Start Draft"). */
.topnav__link--active {
  background: var(--c-amber);
  color: var(--c-page);
  font-weight: 700;
}
.topnav__link--active:hover { background: #FBBF24; color: var(--c-page); }

/* Right side */
.topnav__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* User menu */
.user-menu { position: relative; }

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
  transition: background var(--t-fast);
}

.user-menu__trigger:hover { background: var(--c-field-mid); }

.user-menu__avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-amber);
  color: var(--c-page);
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-menu__name {
  font-size: 0.8rem;
  font-weight: 500;
}

.user-menu__caret { transition: transform var(--t-fast); }
.user-menu__trigger[aria-expanded="true"] .user-menu__caret { transform: rotate(180deg); }

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  min-width: 200px;
  background: var(--c-surface-hi);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.user-menu__dropdown[hidden] { display: none; }

.user-menu__header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}

.user-menu__team {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-chalk);
}

.user-menu__email {
  font-size: var(--text-xs);
  color: var(--c-chalk-dim);
  margin-top: var(--sp-1);
}

.user-menu__item {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--c-chalk-dim);
  transition: background var(--t-fast), color var(--t-fast);
}

.user-menu__item:hover { background: var(--c-surface); color: var(--c-chalk); }
.user-menu__item--danger:hover { color: var(--c-danger); }

/* Mobile nav toggle (hamburger) — hidden on desktop */
.topnav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.topnav__toggle:hover { background: var(--c-field-mid); }
.topnav__toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--c-chalk);
  border-radius: 2px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.topnav__toggle[aria-expanded="true"] .topnav__toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topnav__toggle[aria-expanded="true"] .topnav__toggle-bar:nth-child(2) { opacity: 0; }
.topnav__toggle[aria-expanded="true"] .topnav__toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Mobile nav: collapse links into a dropdown panel ─────────────────────── */
@media (max-width: 860px) {
  .topnav__toggle { display: flex; }

  .topnav__links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2);
    background: var(--c-field);
    border-bottom: 1px solid var(--c-field-light);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }
  /* When toggled open, show the panel */
  .topnav__links.is-open { display: flex; }

  .topnav__link {
    padding: var(--sp-3) var(--sp-3);
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }
  .topnav__link--active { background: var(--c-amber); color: var(--c-page); }

  /* Keep the brand + user menu on the bar; nav overlays below */
  .topnav__inner { position: static; }
  .topnav { position: sticky; }
}

/* ==========================================================================
   Flash messages
   ========================================================================== */

.flash-stack {
  position: fixed;
  top: calc(var(--nav-height) + var(--sp-4));
  right: var(--sp-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 380px;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn var(--t-base) ease;
}

.flash--success { background: #14532D; border: 1px solid var(--c-success); color: var(--c-success); }
.flash--error   { background: #450A0A; border: 1px solid var(--c-danger);  color: var(--c-danger); }
.flash--warning { background: #451A03; border: 1px solid var(--c-warning); color: var(--c-warning); }
.flash--info    { background: var(--c-surface-hi); border: 1px solid var(--c-field-light); color: var(--c-chalk); }

.flash__close {
  font-size: var(--text-lg);
  line-height: 1;
  opacity: 0.6;
  flex-shrink: 0;
}

.flash__close:hover { opacity: 1; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.page-content {
  flex: 1;
  width: 100%;
  padding: var(--sp-4) var(--sp-4);
}

.page-header {
  margin-bottom: var(--sp-4);
}

.page-title {
  font-family: var(--f-display);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--c-chalk);
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--c-chalk-dim);
  margin-top: var(--sp-1);
}

/* ── Shared sub-page header (league sub-pages: Scoreboard, Lineup, League
   Rosters, Schedule, Stats, Commissioner tools) — see macros/ui.html
   page_header(). Kept visually smaller than .page-title, which is reserved
   for top-level pages (League Dashboard, My Leagues, Player Rankings, etc). */
.ph-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.ph-eyebrow { margin-bottom: 2px; }
.ph-title {
  font-family: var(--f-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--c-chalk);
  margin: 0;
}
.ph-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── Shared week selector (macros/ui.html week_selector()) — button row on
   desktop, dropdown on mobile. One toggle rule for every page that uses it. */
.wk-sel-select { display: none; }

/* ── Team name / abbreviation swap (macros/ui.html team_name()) — mobile
   shows the 2-4 char abbreviation instead of the full team name wherever
   this macro is used, so condensed layouts don't have to truncate. ── */
.tn-abbr { display: none; }

@media (max-width: 600px) {
  .ph-actions--stretch { width: 100%; }
  .ph-actions--stretch > a.btn, .ph-actions--stretch > button.btn { flex: 1 1 auto; text-align: center; }

  .wk-sel-btns { display: none !important; }
  .wk-sel-select { display: block !important; width: 100%; }

  .tn-full { display: none !important; }
  .tn-abbr { display: inline !important; }
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card--elevated { background: var(--c-surface-hi); box-shadow: var(--shadow); }

.card__header {
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__title {
  font-family: var(--f-display);
  font-size: var(--text-xl);
  letter-spacing: 0.04em;
  color: var(--c-chalk);
}

.card__body { padding: var(--sp-6); }
.card__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary {
  background: var(--c-amber);
  color: var(--c-page);
}
.btn--primary:hover:not(:disabled) { background: #FBBF24; }

.btn--ghost {
  background: transparent;
  color: var(--c-chalk-dim);
  border: 1px solid var(--c-border);
}
.btn--ghost:hover:not(:disabled) { background: var(--c-surface); color: var(--c-chalk); border-color: var(--c-field-light); }

.btn--danger {
  background: transparent;
  color: var(--c-danger);
  border: 1px solid var(--c-danger);
}
.btn--danger:hover:not(:disabled) { background: #450A0A; }

.btn--sm { padding: var(--sp-2) var(--sp-3); font-size: var(--text-xs); }
.btn--lg { padding: var(--sp-4) var(--sp-8); font-size: var(--text-base); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-chalk-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-control {
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-page);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-chalk);
  font-size: var(--text-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--c-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-control::placeholder { color: var(--c-chalk-dim); }

.form-error {
  font-size: var(--text-xs);
  color: var(--c-danger);
  margin-top: var(--sp-1);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--c-chalk-dim);
}

/* ==========================================================================
   Tables  (stats, scoreboards, rosters)
   ========================================================================== */

.data-table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-chalk-dim);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-family: var(--f-mono);
}

.data-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--c-chalk);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover { background: var(--c-surface-hi); }

/* Stat number emphasis */
.stat-number {
  font-family: var(--f-mono);
  font-weight: 600;
  color: var(--c-chalk);
}

.stat-number--amber { color: var(--c-amber); }
.stat-number--dim   { color: var(--c-chalk-dim); }
.stat-number--neg   { color: var(--c-danger); }
.stat-number--pos   { color: var(--c-success); }

/* ==========================================================================
   Badges / Tags
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* No position variants here — a PASS/RUSH/DEF label is always .pos-chip. */
.badge--flex    { background: #3A2A0A; color: #FDE68A; }
.badge--locked  { background: #2D1F00; color: var(--c-amber); }
.badge--bench   { background: var(--c-surface); color: var(--c-chalk-dim); }

/* Scheduler job chips (Superadmin). The registered set is small and fixed, so
   each gets its own colour — a column of identical text is much harder to scan
   than a column of colours. `--unknown` is the fallback: a jobs.csv row naming
   something that isn't registered renders grey rather than silently looking
   like every other job. */
.job-chip {
  display: inline-block;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.job-chip--scrape          { background: #1E3A5F; color: #60A5FA; }
.job-chip--scrape_season   { background: #2E1F4A; color: #C4B5FD; }
.job-chip--process_waivers { background: #1A3A1A; color: #86EFAC; }
.job-chip--schedule_digest { background: #3A2A0A; color: #FDE68A; }
.job-chip--unknown         { background: #2A2A2A; color: #9CA3AF; }

/* ── Position chip (PASS / RUSH / DEF) ──────────────────────────────────────
   The single position chip for the whole app. Exactly two states:

     .pos-chip                 ACTIVE   — solid position fill, white text
     .pos-chip.is-inactive     INACTIVE — transparent, position-coloured text

   The per-position colour is carried in `--chip`, so both states derive from
   one value and no site needs to name a hex again. A chip with no position
   modifier falls back to the neutral dim colour, which is what an ownership
   chip (a team abbreviation rather than a position) uses.

   Do not add a third variant or restyle this locally — every chip in the app
   is meant to be visually identical. Width is the one thing that flexes: the
   min-width holds a position label and longer labels grow into the max-width.
*/
.pos-chip {
  --chip: var(--c-chalk-dim);
  display: inline-block;
  box-sizing: border-box;
  min-width: 40px;
  max-width: 64px;
  padding: 2px 6px;
  border: 2px solid var(--chip);
  border-radius: 4px;
  background: var(--chip);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-chip.is-inactive { background: transparent; color: var(--chip); }

/* Strength multipliers. Apply one band class alongside .stat-number. */
.mult--vlow  { color: var(--mult-vlow); }
.mult--low   { color: var(--mult-low); }
.mult--even  { color: var(--mult-even); }
.mult--high  { color: var(--mult-high); }
.mult--vhigh { color: var(--mult-vhigh); }

.pos-chip--PASS { --chip: #4A7BC8; }
.pos-chip--RUSH { --chip: #5AAA5A; }
.pos-chip--DEF  { --chip: #C85A5A; }
/* FLEX is a roster slot rather than a position, but it is gold everywhere in
   the app (lineup FLEX section, flex role selector), so the chip matches. */
.pos-chip--FLEX { --chip: var(--c-amber); }

/* ==========================================================================
   Score display
   ========================================================================== */

.score-big {
  font-family: var(--f-mono);
  font-size: var(--text-4xl);
  font-weight: 600;
  color: var(--c-amber);
  letter-spacing: -0.02em;
  line-height: 1;
}

.score-label {
  font-size: var(--text-xs);
  color: var(--c-chalk-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: var(--sp-1);
}

/* Rank chip */
.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--c-surface-hi);
  color: var(--c-chalk-dim);
}

.rank-chip--1 { background: var(--c-amber); color: var(--c-page); }
.rank-chip--2 { background: var(--c-chalk-dim); color: var(--c-page); }
.rank-chip--3 { background: #92610A; color: var(--c-chalk); }

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  color: var(--c-chalk-dim);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.empty-state__title {
  font-family: var(--f-display);
  font-size: var(--text-2xl);
  letter-spacing: 0.04em;
  color: var(--c-chalk);
  margin-bottom: var(--sp-2);
}

.empty-state__body {
  font-size: var(--text-sm);
  max-width: 360px;
  margin: 0 auto var(--sp-6);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--c-field);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-4) var(--sp-6);
  margin-top: auto;
  align-self: stretch;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--c-chalk-dim);
}

.site-footer__link {
  color: var(--c-chalk-dim);
  text-decoration: none;
}

.site-footer__link:hover {
  color: var(--c-amber);
  text-decoration: underline;
}

/* ==========================================================================
   Auth layout  (centered card, used on login / register)
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  background: var(--c-page);
}

.auth-page .page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card__brand {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.auth-card__title {
  font-family: var(--f-display);
  font-size: var(--text-3xl);
  letter-spacing: 0.04em;
  color: var(--c-chalk);
  margin-bottom: var(--sp-1);
}

.auth-card__subtitle {
  font-size: var(--text-sm);
  color: var(--c-chalk-dim);
}

.auth-card__form { display: flex; flex-direction: column; gap: var(--sp-5); }

.auth-card__footer {
  text-align: center;
  margin-top: var(--sp-6);
  font-size: var(--text-sm);
  color: var(--c-chalk-dim);
}

.auth-card__footer a {
  color: var(--c-amber);
  font-weight: 600;
}

.auth-card__footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Utility classes
   ========================================================================== */

.text-amber    { color: var(--c-amber); }
.text-dim      { color: var(--c-chalk-dim); }
.text-danger   { color: var(--c-danger); }
.text-success  { color: var(--c-success); }
.text-mono     { font-family: var(--f-mono); }
.text-display  { font-family: var(--f-display); letter-spacing: 0.04em; }
.text-upper    { text-transform: uppercase; letter-spacing: 0.08em; }
.text-sm       { font-size: var(--text-sm); }
.text-xs       { font-size: var(--text-xs); }

.mt-2  { margin-top: var(--sp-2); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: var(--sp-2); }
.gap-4         { gap: var(--sp-4); }
.gap-6         { gap: var(--sp-6); }

.w-full        { width: 100%; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-6) 0;
}

/* Screen reader only */
.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;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
