:root {
  color-scheme: dark;
  interpolate-size: allow-keywords;

  --bg: #080A10;
  --bg-2: #0C0F17;
  --surface: #10131C;
  --surface-2: #151924;
  --surface-3: #1C2130;
  --line: rgba(226, 232, 255, 0.08);
  --line-strong: rgba(226, 232, 255, 0.16);
  --text: #E8ECF6;
  --muted: #98A1B6;
  --muted-strong: #BCC4D6;  /* small print that still has to be comfortably readable */
  --faint: #7D869C;

  --accent: #7C8CFF;
  --accent-hover: #95A2FF;
  --accent-ink: #0A0D1F;
  --accent-soft: rgba(124, 140, 255, 0.16);
  --turf: #34D399;
  --sky: #38BDF8;
  --pink: #F472B6;
  --rose: #FB7185;
  --miss: #F87171;
  --violet: #A78BFA;

  --r-sm: 10px;
  --r: 16px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px -28px rgba(0, 0, 0, 0.75);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "Segoe UI Variable Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Night-game glow + faint yard lines. Fixed, painted once, no JS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 32rem at 88% -12%, rgba(124, 140, 255, 0.14), transparent 60%),
    radial-gradient(48rem 30rem at -12% 8%, rgba(52, 211, 153, 0.07), transparent 60%),
    repeating-linear-gradient(90deg, rgba(226, 232, 255, 0.028) 0 1px, transparent 1px 120px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

main { flex: 1; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Motion primitives ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes step-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.55; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.35; } }

.view:not([hidden]) .reveal { animation: rise 0.6s var(--ease-out) both; }
/* Headline text stays visible while it settles, so it counts for Largest Contentful Paint immediately. */
.view:not([hidden]) :is(.page-head, .pitch) > .reveal:is(h1, .lede), .view:not([hidden]) .page-head > .reveal { animation-name: settle; }
.d1 { animation-delay: 0ms !important; }
.d2 { animation-delay: 70ms !important; }
.d3 { animation-delay: 140ms !important; }
.d4 { animation-delay: 210ms !important; }
.d5 { animation-delay: 280ms !important; }
.d6 { animation-delay: 350ms !important; }

.skeleton {
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--surface-3);
  border-radius: 8px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-num { width: 56%; height: 0.8em; margin-block: 0.1em; }
.sk-bar { height: 22px; }
.sk-row { height: 52px; margin: 6px 8px; border-radius: 12px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 10, 16, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  justify-self: start;
}
.brand-mark { width: 30px; height: 30px; flex: none; transition: transform 0.4s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.06); }

.status-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.status-dot, .live-dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
[data-state="ok"] .status-dot, .live-dot { background: var(--turf); }
[data-state="ok"] .status-dot::after, .live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: ping 2.2s var(--ease-out) infinite;
}
[data-state="busy"] .status-dot { background: var(--accent); animation: blink 1s ease-in-out infinite; }
[data-state="warn"] .status-dot { background: var(--violet); }
[data-state="bad"] .status-dot { background: var(--rose); }

/* ---------- Segmented control (nav, filters, weeks) ---------- */

.segmented {
  --thumb: var(--accent);
  --thumb-ink: var(--accent-ink);
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.segmented-quiet { --thumb: var(--surface-3); --thumb-ink: var(--text); }

.segmented button {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  color: var(--muted);
  font: 550 0.875rem/1 var(--font);
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s;
}
/* Only the unselected segments brighten on hover. The selected one sits on the accent
   thumb and already uses --thumb-ink against it; letting the hover rule override that to
   --text put #E8ECF6 on #7C8CFF, which is 2.5:1 and fails AA. */
.segmented button:not([aria-pressed="true"]):not([aria-current="page"]):hover { color: var(--text); }
.segmented [aria-pressed="true"], .segmented [aria-current="page"] { color: var(--thumb-ink); }
.segmented:not(.ready) [aria-pressed="true"], .segmented:not(.ready) [aria-current="page"] { background: var(--thumb); }

.segmented-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--w, 0);
  transform: translateX(var(--x, 0));
  border-radius: 999px;
  background: var(--thumb);
  opacity: 0;
}
.segmented-quiet .segmented-thumb { box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented.ready .segmented-thumb {
  opacity: 1;
  transition: transform 0.4s var(--ease-out), width 0.4s var(--ease-out);
}

/* ---------- Buttons & fields ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 0.9375rem/1.2 var(--font);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.btn:active { transform: scale(0.97); }
.btn svg { transition: transform 0.25s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn-sm { padding: 8px 14px; font-size: 0.8125rem; border-radius: 10px; }

.btn-primary {
  --spinner: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 20px -12px rgba(0, 0, 0, 0.9);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { --spinner: var(--text); background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Directory badge: sized to fit inside a .btn (128px wide, the "How it works" button's width). */
.taaft-badge { display: inline-flex; align-items: center; height: 44px; border-radius: 8px; }
.taaft-badge img { display: block; width: 128px; height: auto; }
.btn-danger { color: var(--bad, #ff7a7a); }
.btn-danger:hover { border-color: var(--bad, #ff7a7a); }
.account-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.league-rows { list-style: none; margin: 16px 0 0; padding: 0; }
.league-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.league-row:last-child { border-bottom: 1px solid var(--line); }
.league-row-name { display: grid; gap: 2px; min-width: 0; }
.league-row-name strong { overflow-wrap: anywhere; }
.league-row-name small { color: var(--muted); font-size: 0.8125rem; }
.league-row-name small.unpaid { color: var(--rose); }
.league-row .account-actions { margin-top: 0; gap: 8px; }
.league-row .btn { padding-block: 6px; font-size: 0.8125rem; }
.league-row .checkbox-label { margin: 0 4px 0 0; font-size: 0.8125rem; }

.device-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.device-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.device-row.revoked { opacity: 0.6; }
.device-info { display: grid; gap: 4px; min-width: 0; }
.device-info strong { color: var(--text); }
.device-info .muted { font-size: 0.8125rem; }
.device-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-block { width: 100%; }
.btn:disabled { cursor: default; }
.btn[aria-busy="true"] { color: transparent; }
.btn[aria-busy="true"] svg { opacity: 0; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--spinner);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 14px;
  color: var(--muted);
  font: 500 0.8125rem var(--font);
  cursor: pointer;
  transition: color 0.2s;
}
.btn-link:hover { color: var(--text); }

label { display: block; margin: 20px 0 8px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.optional { font-weight: 400; color: var(--faint); margin-left: 4px; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-strong);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
}

input, textarea, select {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 14px;
  transition: border-color 0.2s, box-shadow 0.25s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 104px; line-height: 1.5; }

.field-row { display: flex; gap: 10px; }
.field-row input { flex: 1; min-width: 0; }

/* ---------- Shared layout ---------- */

.view {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 24px 88px;
  /* body is a flex column, so a .view is a flex item sized to its content across the
     cross axis. One 460px-wide .doc-table was therefore stretching the whole page to
     534px on a 375px phone: past the viewport, headline cut off, and the .table-scroll
     wrapper powerless, because the item that refused to shrink was this one, not the
     table. Pinning the width to the container -- max-width still caps it on desktop --
     gives the wrapper a definite width, so the table scrolls inside it as intended. */
  width: 100%;
}

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }

.lede { color: var(--muted); font-size: 1.0625rem; line-height: 1.6; max-width: 50ch; }

/* The product's one-line promise, between the headline and the lede. Full --text rather
   than --muted: it is a claim, not supporting copy, and it has to carry at a glance. */
.tagline {
  color: var(--text);
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 560;
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 46ch;
  margin: 0 0 4px;
  /* One short line that must not strand "to." on its own; balance evens the break. */
  text-wrap: balance;
}
.tagline em { color: var(--accent); font-style: normal; font-weight: 680; }

.chip {
  --tone: var(--muted);
  display: inline-block;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
}
.chip-lineup { --tone: var(--accent); }
.chip-waiver { --tone: var(--sky); }
.chip-trade { --tone: var(--pink); }

.pill {
  --tone: var(--muted);
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 550;
  text-transform: capitalize;
  white-space: nowrap;
  color: var(--tone);
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
  background: color-mix(in srgb, var(--tone) 9%, transparent);
}
.pill-hit { --tone: var(--turf); }
.pill-miss { --tone: var(--miss); }
.pill-mixed { --tone: var(--violet); }
.pill-flag { --tone: var(--rose); }
.pill-pending { --tone: var(--faint); }

/* ---------- Dashboard ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  margin-bottom: 32px;
}
.page-head h1, .page-head .page-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 14px 0 10px;
}
.page-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.refreshed { color: var(--faint); font-size: 0.8125rem; }

.demo-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 40px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.demo-run-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.9375rem; }
.demo-run-head .muted { font-size: 0.8125rem; }

.run-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; font-size: 0.875rem; }
.run-steps li { display: flex; align-items: center; gap: 10px; color: var(--faint); transition: color 0.3s; }
.run-steps li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 0.625rem;
  font-weight: 800;
}
.run-steps li.active { color: var(--text); }
.run-steps li.active::before { border-color: var(--accent); border-right-color: transparent; animation: spin 0.7s linear infinite; }
.run-steps li.done { color: var(--muted); }
.run-steps li.done::before { content: "\2713"; color: #03140C; background: var(--turf); border-color: var(--turf); }

.demo-weeks { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.demo-weeks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.875rem; }
.demo-note { color: var(--faint); font-size: 0.75rem; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.stat {
  --tone: var(--accent);
  position: relative;
  overflow: hidden;
  padding: 22px 22px 20px;
  transition: border-color 0.25s, transform 0.35s var(--ease-out);
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 32px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--tone);
}
.tone-accent { --tone: var(--accent); }
.tone-turf { --tone: var(--turf); }
.tone-rose { --tone: var(--rose); }
.tone-sky { --tone: var(--sky); }

.stat-label { color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.stat-value {
  font-family: var(--display);
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 6px;
  white-space: nowrap;
}
.dash-body:not(.is-loading) .stat-value { animation: fade 0.4s ease-out both; }
.stat-sub { color: var(--faint); font-size: 0.8125rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 24px; }
.panel h2, .log h2 { font-size: 1.0625rem; letter-spacing: -0.01em; }
.panel > .muted { font-size: 0.875rem; margin-top: 6px; max-width: 48ch; }

.bars { display: grid; gap: 14px; margin-top: 24px; }
.bar { display: grid; grid-template-columns: 72px minmax(0, 1fr) 44px; align-items: center; gap: 14px; font-size: 0.875rem; }
.bar-label { color: var(--muted); text-transform: capitalize; }
.bar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill {
  --tone: var(--accent);
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
  transform-origin: left;
  transform: scaleX(var(--v, 0));
  transition: transform 0.8s var(--ease-out);
  animation: grow 1s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tone-high { --tone: var(--turf); }
.tone-medium { --tone: var(--accent); }
.tone-low { --tone: var(--faint); }
.tone-lineup { --tone: var(--accent); }
.tone-waiver { --tone: var(--sky); }
.tone-trade { --tone: var(--pink); }

.log { margin-top: 16px; padding-bottom: 8px; }
.log-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  padding: 18px 24px 12px;
}
.filter-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }

.log-list { display: flex; flex-direction: column; padding: 0 8px; }

.entry {
  border-radius: 12px;
  animation: rise 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
}
.entry + .entry { box-shadow: 0 -1px 0 var(--line); }

.entry summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 12px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.entry summary::-webkit-details-marker { display: none; }
.entry summary:hover, .entry[open] summary { background: var(--surface-3); }
.entry summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.entry[open] summary::after { transform: translateY(3px) rotate(-135deg); }

.entry-summary { font-size: 0.9375rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry[open] .entry-summary { white-space: normal; }
.entry-meta { display: flex; align-items: center; gap: 8px; }
.entry-time { min-width: 52px; text-align: right; color: var(--faint); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

.entry::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s var(--ease-out), content-visibility 0.35s allow-discrete;
}
.entry[open]::details-content { block-size: auto; }

.entry-body { padding: 12px 16px 18px 94px; }
.entry-reasoning { color: var(--muted); font-size: 0.9rem; max-width: 72ch; }
.entry-outcome {
  margin-top: 12px;
  padding: 10px 12px;
  max-width: 72ch;
  border-radius: 10px;
  font-size: 0.875rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.entry-outcome strong { font-weight: 600; margin-right: 6px; }
.entry-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 0.8125rem; color: var(--faint); }
.entry-facts strong { color: var(--text); font-weight: 550; text-transform: capitalize; }

.empty { margin: 8px 16px 12px; padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; }

/* ---------- Get started ---------- */

.signup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}

.pitch { padding-top: clamp(0px, 2vw, 24px); }
.pitch h1 {
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 16px 0 20px;
  text-wrap: balance;
}
.pitch h1 em { font-style: normal; color: var(--accent); }

.season-pill {
  display: inline-block;
  margin-top: 20px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--turf);
  background: color-mix(in srgb, var(--turf) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--turf) 30%, transparent);
}

.features { list-style: none; padding: 0; margin: 36px 0; display: grid; gap: 20px; }
.features li { display: grid; grid-template-columns: 42px 1fr; gap: 16px; align-items: start; }
.features strong { display: block; font-weight: 600; margin-bottom: 2px; }
.features .muted { font-size: 0.9375rem; }
.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.wizard { position: sticky; top: 88px; padding: clamp(22px, 4vw, 30px); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 0.8125rem; color: var(--faint); }
.steps li { display: flex; align-items: center; gap: 8px; transition: color 0.3s; }
.step-num {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.steps [aria-current] { color: var(--text); }
.steps [aria-current] .step-num { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.steps .done { color: var(--muted); }
.steps .done .step-num { font-size: 0; color: #03140C; background: var(--turf); border-color: var(--turf); }
.steps .done .step-num::before { content: "\2713"; font-size: 0.8125rem; }

.progress { height: 3px; margin: 18px 0 28px; border-radius: 3px; overflow: hidden; background: var(--surface-3); }
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--turf), var(--accent));
  transform-origin: left;
  transform: scaleX(var(--progress, 0.1667));
  transition: transform 0.6s var(--ease-out);
}

.step:not([hidden]) { animation: step-in 0.45s var(--ease-out) both; }
.step h2 { font-size: 1.375rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.step > .muted { font-size: 0.9375rem; }

.results-status { margin-top: 18px; font-size: 0.875rem; color: var(--muted); }
.results-status.error { color: var(--miss); }

.league-list { display: grid; gap: 8px; margin-top: 12px; }
.league {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  animation: rise 0.45s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
  transition: border-color 0.2s, transform 0.25s var(--ease-out);
}
.league:hover { border-color: var(--accent); transform: translateY(-1px); }
.league strong { display: block; font-weight: 600; }
.league small { display: block; color: var(--muted); font-size: 0.8125rem; }
.league-arrow { color: var(--faint); transition: transform 0.25s var(--ease-out), color 0.2s; }
.league:hover .league-arrow { color: var(--accent); transform: translateX(3px); }

.selected { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.selected strong { color: var(--text); font-weight: 600; }

.price { margin: 22px 0 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.price-num { font-family: var(--display); font-size: 2.3rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.price-terms { margin-top: 8px; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }

.challenge {
  margin-top: 4px;
  padding: 16px;
  border-radius: 14px;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  animation: rise 0.4s var(--ease-out) both;
}
.code-row { display: flex; gap: 10px; align-items: stretch; margin: 12px 0 14px; }
.code-row code {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font: 600 1.0625rem/1.2 var(--mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--bg-2);
  overflow-wrap: anywhere;
}

.note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  color: var(--text);
  background: color-mix(in srgb, var(--turf) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--turf) 30%, transparent);
  animation: rise 0.35s var(--ease-out) both;
}
.note.error {
  background: color-mix(in srgb, var(--miss) 9%, var(--surface-2));
  border-color: color-mix(in srgb, var(--miss) 35%, transparent);
}

.fine-print { margin-top: 14px; font-size: 0.75rem; color: var(--faint); }

.settings-hint { margin-top: 10px; font-size: 0.8125rem; color: var(--muted-strong); }

/* ---------- How it works ---------- */

.doc-page { max-width: 860px; }
.doc-head { margin-bottom: 28px; }
.doc-head h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 14px 0 14px;
  text-wrap: balance;
}
.doc-head .lede { max-width: 62ch; }

.doc-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.doc-nav a {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 550;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.doc-nav a:hover { color: var(--text); border-color: var(--accent); }

.doc-section { margin-bottom: 16px; scroll-margin-top: 84px; }
.doc-section h2 { font-size: 1.375rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.doc-section h3 { font-size: 0.9375rem; margin-bottom: 10px; }
.doc-subhead { font-size: 1.0625rem !important; margin: 26px 0 10px; letter-spacing: -0.01em; }
.doc-section > p { color: var(--muted); max-width: 70ch; margin-bottom: 14px; }
.doc-section strong { color: var(--text); font-weight: 600; }

.doc-list, .doc-steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 12px; color: var(--muted); max-width: 72ch; }
.doc-list { list-style: none; padding-left: 0; }
.doc-list > li { position: relative; padding-left: 20px; }
.doc-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}
.doc-list.tight { gap: 8px; font-size: 0.9375rem; }
.doc-steps > li { padding-left: 6px; }
.doc-steps > li::marker { color: var(--accent); font-weight: 700; }

.doc-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--line);
  max-width: 72ch;
}

.split-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.doc-box { padding: 18px 20px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }

.table-scroll { overflow-x: auto; margin: 6px 0 4px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 460px; }
.doc-table th, .doc-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.doc-table td { color: var(--muted); }
.doc-table td:first-child { color: var(--text); font-weight: 550; }
.doc-table tbody tr:last-child td { border-bottom: 0; }

.faq-heading { font-family: var(--display); font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -0.03em; margin-bottom: 10px; }
#faq > .lede { margin-bottom: 18px; }
.faq-item {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  margin-bottom: 8px;
  animation: none;
}
.faq-item summary { grid-template-columns: minmax(0, 1fr) 12px; padding: 16px 18px; }
.faq-item .entry-summary { font-size: 1rem; font-weight: 600; white-space: normal; }
.faq-item .entry-body { padding: 0 18px 18px; }
.faq-item .entry-body p { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; max-width: 72ch; }

.doc-cta { margin-top: 24px; padding: clamp(28px, 5vw, 40px); text-align: center; }
.doc-cta h2 { font-family: var(--display); font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -0.03em; }
.doc-cta .lede { margin: 10px auto 0; }

@media (max-width: 720px) {
  .split-two { grid-template-columns: 1fr; }
}

/* ---------- 404 ---------- */

.notfound {
  max-width: 620px;
  margin: clamp(24px, 8vh, 72px) auto 0;
  padding: clamp(32px, 6vw, 52px);
  text-align: center;
}
.notfound h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 16px 0 12px;
}
.notfound .lede { margin: 0 auto; }
.notfound-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.notfound-links { margin-top: 24px; font-size: 0.8125rem; color: var(--muted-strong); }
.notfound-links a { color: inherit; }
#settings-schedule { margin-top: 22px; }

/* ---------- Footer & consent ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 20px;
  padding: 28px 24px 36px;
  font-size: 0.8125rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
}
.footer .btn-link { margin: 0; text-decoration: underline; text-underline-offset: 3px; }

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 520px;
  padding: 18px;
  display: grid;
  gap: 14px;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  animation: rise 0.5s var(--ease-out) both;
}
.consent strong { color: var(--text); }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .signup, .demo-bar { grid-template-columns: 1fr; }
  .wizard { position: static; }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 10px 16px; gap: 8px; }
  .brand-name, .status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .status-pill { padding: 9px; }
  .segmented button { padding: 9px 12px; }
  .view { padding-inline: 16px; }
  .page-head-side { align-items: flex-start; }
  .demo-bar { padding: 18px 16px; }
  .stats { gap: 10px; }
  .stat { padding: 18px 16px 16px; }
  .stat::before { left: 16px; }
  .panel { padding: 20px; }
  .log-head { padding: 16px 16px 10px; }
  .log-list { padding: 0 4px; }
  .entry summary {
    grid-template-columns: auto minmax(0, 1fr) 12px;
    grid-template-areas: "chip meta chev" "text text text";
    gap: 10px;
    padding: 14px 12px;
  }
  .entry summary .chip { grid-area: chip; justify-self: start; }
  .entry-meta { grid-area: meta; justify-content: flex-end; }
  .entry-summary { grid-area: text; white-space: normal; }
  .entry summary::after { grid-area: chev; }
  .entry-body { padding: 4px 12px 16px; }
  .field-row { flex-direction: column; }
  .steps li > span:last-child { font-size: 0.75rem; }
  .consent-actions .btn { flex: 1; }
}

@media (max-width: 340px) {
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Select, hints ---------- */

select {
  appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field-hint { margin: 10px 0 0; color: var(--faint); font-size: 0.8125rem; line-height: 1.5; }
.field-hint code { font-family: var(--mono); color: var(--muted); }

/* ---------- Welcome: GM philosophy notecards ---------- */

#view-welcome { padding-top: clamp(14px, 3vh, 36px); padding-bottom: 24px; }
.welcome { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.welcome-head h2 { font-family: var(--display); font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.05; letter-spacing: -0.035em; margin: 8px 0 10px; }
.welcome-head h2 em { font-style: normal; color: var(--accent); }
.welcome-head .lede { margin: 0; max-width: 64ch; font-size: 1rem; }
.deck-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.deck-meta #deck-count { color: var(--faint); font-variant-numeric: tabular-nums; }
.deck-progress { margin: 0; }
.deck-progress span { transform: scaleX(var(--progress, 0)); }

.deck {
  position: relative;
  /* Sized so the header, card, and buttons fit one screen: no scrolling between questions. */
  height: clamp(300px, calc(100svh - 400px), 470px);
  margin-top: 6px;
}
/* Two cards peeking out underneath make it read as a deck. */
.deck::before, .deck::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.deck::before { transform: translate(10px, 12px) rotate(1.6deg); opacity: 0.45; }
.deck::after { transform: translate(5px, 6px) rotate(0.8deg); opacity: 0.75; }

.notecard {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(20px, 3.6vw, 32px);
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
  /* Safety net for very small screens; cards are sized so this rarely scrolls. */
  overflow-y: auto;
}
.notecard.leaving { pointer-events: none; }
.notecard-topic { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.notecard-topic span { color: var(--faint); letter-spacing: 0.02em; }
.notecard-intro { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.notecard-question { margin: 0; font-size: clamp(1rem, 1.9vw, 1.1875rem); font-weight: 600; line-height: 1.45; letter-spacing: -0.01em; }
.notecard textarea { flex: 1; min-height: 88px; resize: none; }
.notecard-count { align-self: flex-end; margin: -4px 0 0; color: var(--faint); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.schedule-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.schedule-days legend { margin-bottom: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.day-option { position: relative; margin: 0; }
.day-option input { position: absolute; opacity: 0; pointer-events: none; }
.day-option span { display: block; height: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-2); color: var(--text); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.day-option small { display: block; margin-top: 2px; color: var(--faint); font-size: 0.75rem; font-weight: 400; }
.day-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.day-option input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }
.schedule-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.schedule-row label { margin-top: 4px; }

.notecard-done { align-items: flex-start; justify-content: center; }
.notecard-done h3 { margin: 0; font-family: var(--display); font-size: 1.6rem; letter-spacing: -0.03em; }
.notecard-done p { margin: 0; max-width: 46ch; color: var(--muted); }
.done-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(52, 211, 153, 0.16); color: var(--turf); font-size: 1.3rem; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.deck-hint { margin: 0; color: var(--faint); font-size: 0.75rem; }
.deck-nav .btn { min-width: 108px; }

@media (max-width: 640px) {
  .welcome-head .lede, .deck-hint { display: none; }
  .deck { height: max(340px, calc(100svh - 360px)); }
  .notecard { gap: 10px; }
  .notecard-question { font-size: 0.975rem; }
  .notecard-intro { font-size: 0.8125rem; }
  .notecard textarea { min-height: 72px; }
  .deck-nav { margin-top: 10px; }
  .schedule-days { grid-template-columns: 1fr 1fr; }
  .schedule-row { grid-template-columns: 1fr; gap: 0; }
}

