:root {
  color-scheme: dark;
  /* Neutrals lean slightly green, toward the pine accent, so the dark reads
     as chosen rather than a stock grey. */
  --paper: #0e1211;
  --card: #151a19;
  --ink: #e6ebe8;
  --ink-2: #a2aca7;
  --ink-3: #7b8581;
  --line: #232a28;
  --line-2: #343d3a;
  --pine: #6cc3a0;
  --pine-hover: #88d2b4;
  --pine-soft: #1a2823;
  --on-pine: #07130f;
  --up: #5fc495;
  --down: #e5775f;
  --up-soft: #15261e;
  --down-soft: #2c1a15;
  --amber: #dcaa4e;
  --amber-soft: #2a2213;
  --shadow: rgba(0, 0, 0, 0.45);
  --scrim: rgba(4, 6, 6, 0.66);
  --radius: 10px;
  --measure: 660px;
}

* { box-sizing: border-box; }

/* Any rule that sets display outranks the hidden attribute. Without this the
   sheet's scrim, which is display: flex, stays over the page and swallows
   every click. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h3 { font-weight: 500; letter-spacing: -0.012em; margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h3 { font-size: 1rem; }
p { margin: 0; }

/* Masthead ---------------------------------------------------------------*/
.masthead {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
/* "W" and "ver" recede so the "ai" in the middle carries the name. */
.wordmark {
  font-weight: 600;
  font-size: 1.875rem;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}
.wordmark .ai { color: var(--pine); }
a.wordmark:hover { color: var(--ink-2); }
.meta { font-size: 0.75rem; color: var(--ink-3); text-align: right; }
.warn-stamp { color: var(--amber); background: var(--amber-soft); padding: 0.1875rem 0.5rem; border-radius: 6px; }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

/* One column and no card: the answer and the ranked list are the page. */
.panel { display: flex; flex-direction: column; gap: 1.125rem; }
.intro { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 0 0.25rem; }
.lede { color: var(--ink-2); font-size: 0.9375rem; max-width: 46ch; }

/* Search -----------------------------------------------------------------*/
.search { position: relative; }
.search-icon {
  position: absolute; left: 0.8125rem; top: 0.875rem;
  width: 1.0625rem; height: 1.0625rem;
  fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round;
  pointer-events: none;
}
#search {
  width: 100%;
  height: 2.875rem;
  padding: 0 0.875rem 0 2.375rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
#search::placeholder { color: var(--ink-3); }
#search:focus { outline: 2px solid var(--pine); outline-offset: 1px; border-color: var(--pine); }

.suggestions {
  list-style: none; margin: 0.375rem 0 0; padding: 0.25rem;
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
  max-height: 19rem; overflow-y: auto;
}
.suggestions li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.875rem;
}
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--pine-soft); }
.suggestions .tag { color: var(--ink-3); font-size: 0.75rem; white-space: nowrap; }
.suggestions .who { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }

.avatar {
  position: relative; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  overflow: hidden; display: inline-grid; place-items: center;
  background: var(--line); color: var(--ink-2);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.03em;
}
.avatar.lg { width: 2.375rem; height: 2.375rem; font-size: 0.75rem; }

/* Settings chips ---------------------------------------------------------*/
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.25rem; padding: 0 0.875rem;
  background: none; border: 1px solid var(--line); border-radius: 1.125rem;
  font: inherit; font-size: 0.8125rem; color: var(--ink-2); cursor: pointer;
}
.chip::after {
  content: ""; width: 0.3125rem; height: 0.3125rem; margin-top: -0.1875rem;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }

.error { color: var(--down); font-size: 0.8125rem; }

/* Why Waiver -------------------------------------------------------------*/
.why {
  display: flex; flex-direction: column; gap: 1.125rem;
  margin-top: 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.why-title { margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); }
.why-proof { display: flex; align-items: center; gap: 1rem; }
.why-proof b {
  flex: none; font-size: 2.5rem; font-weight: 500; line-height: 1;
  letter-spacing: -0.03em; color: var(--pine);
}
.why-proof > span { font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
.why-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem 1.5rem;
}
.why-list li { display: flex; flex-direction: column; gap: 0.25rem; }
.why-list strong { font-size: 0.9375rem; font-weight: 500; }
.why-list li > span { font-size: 0.8125rem; line-height: 1.55; color: var(--ink-2); }
.why-note { font-size: 0.75rem; line-height: 1.6; color: var(--ink-3); }

/* Search pages and footer ------------------------------------------------*/
a.wordmark { text-decoration: none; }
.board { display: flex; flex-direction: column; gap: 1.125rem; padding-top: 0.75rem; }
.board h1 { text-wrap: balance; }
.board h2 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; margin: 1.25rem 0 0; scroll-margin-top: 1rem; }
.board h3 { font-size: 0.9375rem; color: var(--ink-2); margin: 0.25rem 0 0; }
.board a { color: var(--pine); }
.board-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.board-nav a {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.875rem;
  border: 1px solid var(--line); border-radius: 1.125rem;
  font-size: 0.8125rem; color: var(--ink-2); text-decoration: none;
}
.board-nav a[aria-current="page"] { border-color: var(--pine); color: var(--ink); }
.board-table-wrap { overflow-x: auto; }
.board-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.board-table th {
  text-align: left; font-weight: 500; font-size: 0.75rem; color: var(--ink-3);
  padding: 0.5rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.board-table td { padding: 0.625rem 0.5rem; border-bottom: 1px solid var(--line); }
.board-table .num { text-align: right; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board-list li { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.875rem 0; border-bottom: 1px solid var(--line); }
.board-list span { font-size: 0.8125rem; color: var(--ink-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.prose h2 { margin: 0.5rem 0 0; font-size: 1rem; font-weight: 500; letter-spacing: -0.012em; }
.prose p { color: var(--ink-2); max-width: 64ch; }
.prose a { color: var(--pine); }

.player-head { display: flex; align-items: center; gap: 1rem; }
.player-head .avatar { flex: none; width: 4rem; height: 4rem; font-size: 1.125rem; }
.figures { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.625rem; }
.figures div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 0.875rem; }
.figures dt { font-size: 0.75rem; color: var(--ink-3); }
.figures dd { margin: 0.125rem 0 0; font-size: 1.25rem; font-weight: 500; }
@media (max-width: 34rem) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.site-footer {
  max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 3rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.8125rem;
}
.site-footer a { color: var(--ink-3); text-decoration: none; }
.site-footer a:hover { color: var(--pine); }

/* Answer -----------------------------------------------------------------*/
.answer { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; padding-top: 0.625rem; }
.answer-title { font-size: 2rem; font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.answer-sub { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); max-width: 52ch; }
.share {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.375rem;
  min-height: 2.25rem; padding: 0 0.875rem;
  background: none; border: 1px solid var(--line-2); border-radius: 1.125rem;
  font: inherit; font-size: 0.8125rem; color: var(--ink); cursor: pointer;
}
.share:hover { border-color: var(--pine); color: var(--pine); }
.share svg {
  width: 0.875rem; height: 0.875rem;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.flip {
  margin-top: 0.25rem; font-size: 0.8125rem; color: var(--amber);
  background: var(--amber-soft); padding: 0.625rem 0.75rem; border-radius: 8px;
}

.pill { font-size: 0.6875rem; padding: 0.125rem 0.4375rem; border-radius: 6px; white-space: nowrap; }
.answer .pill { font-size: 0.75rem; font-weight: 500; padding: 0.1875rem 0.5rem; }
.pill.good { background: var(--up-soft); color: var(--up); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--down-soft); color: var(--down); }
.pill.neutral { background: var(--pine-soft); color: var(--ink-2); }

/* Ranking ----------------------------------------------------------------*/
.ranking { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ranking:empty { display: none; }
.row { border-bottom: 1px solid var(--line); }

.row-head { list-style: none; }
.row-head::-webkit-details-marker { display: none; }
.row-head::marker { content: ""; }
.row-head {
  display: grid;
  grid-template-columns: 1rem 2.375rem minmax(0, 1fr) auto 2rem;
  align-items: center; gap: 0.75rem;
  padding: 0.875rem 0;
  cursor: pointer;
}
.rank { font-size: 0.9375rem; color: var(--ink-3); }
.row-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.row-main strong { font-weight: 500; font-size: 0.9375rem; }
.row-meta { font-size: 0.75rem; color: var(--ink-3); }
.row-meta .up { color: var(--up); }
.row-meta .down { color: var(--down); }
.row-pts { text-align: right; }
.row-pts b { display: block; font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
.row-pts span { display: block; font-size: 0.6875rem; color: var(--ink-3); }
.remove {
  width: 2rem; height: 2rem; display: inline-grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer;
}
.remove:hover { color: var(--down); background: var(--down-soft); }
.remove svg { width: 0.875rem; height: 0.875rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Indented to the name column, past the rank, photo and their gaps. */
.row-body { display: flex; flex-direction: column; gap: 0.875rem; padding: 0 0 1.25rem 4.875rem; }

.drivers { display: flex; flex-direction: column; gap: 0.5rem; }
.driver { display: grid; grid-template-columns: 8.5rem 1fr 2.5rem; align-items: center; gap: 0.75rem; }
.driver span:first-child { font-size: 0.8125rem; color: var(--ink-2); }
.track { position: relative; height: 0.375rem; background: var(--line); border-radius: 3px; }
.track i { position: absolute; height: 0.375rem; border-radius: 3px; display: block; }
.track::after { content: ""; position: absolute; left: 50%; top: -0.1875rem; width: 1px; height: 0.75rem; background: var(--line-2); }
.driver b { font-size: 0.75rem; font-weight: 400; text-align: right; }

.statline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.875rem; font-size: 0.75rem; color: var(--ink-3); }
.reason { font-size: 0.875rem; line-height: 1.7; color: var(--ink-2); }
/* Ad ---------------------------------------------------------------------*/
.ad-slot {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.ad-label, .ad-note { margin: 0; font-size: 0.6875rem; color: var(--ink-3); }
.ad-label { letter-spacing: 0.06em; text-transform: uppercase; }
/* Room held for the unit, so the page does not jump when the ad arrives. */
.ad-unit { min-height: 250px; }
/* AdSense marks a unit it has no ad for; the whole slot goes with it. */
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }

.tag { margin-left: 0.25rem; font-size: 0.6875rem; font-weight: 600; color: var(--down); }
.outlook { align-self: flex-start; font-size: 0.8125rem; font-weight: 500; color: var(--pine); text-underline-offset: 3px; }
.outlook::after { content: " \2192"; }
.outlook:hover { text-decoration-thickness: 2px; }
.hint { font-size: 0.8125rem; color: var(--ink-3); }
.footnote { font-size: 0.75rem; color: var(--ink-3); line-height: 1.6; }

/* Buttons ----------------------------------------------------------------*/
.primary {
  margin-top: 1.5rem; width: 100%; height: 2.875rem;
  background: var(--pine); color: var(--on-pine); border: 0; border-radius: var(--radius);
  font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--pine-hover); }

.icon { background: none; border: 0; cursor: pointer; padding: 0.25rem; color: var(--ink-3); display: inline-flex; }
.icon svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

:where(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }

/* Sheet ------------------------------------------------------------------*/
.scrim {
  position: fixed; inset: 0; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem; z-index: 50;
}
.sheet {
  background: var(--card); border-radius: 14px; width: 100%; max-width: 23rem;
  padding: 1.25rem; max-height: 85vh; overflow-y: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.875rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.label { font-size: 0.6875rem; color: var(--ink-3); margin-bottom: 0.625rem; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.6875rem 0.75rem; margin-bottom: 0.5rem; color: var(--ink);
}
.opt strong { font-weight: 500; font-size: 0.875rem; display: block; }
.opt small { color: var(--ink-3); font-size: 0.75rem; }
.opt[aria-checked="true"] { border-color: var(--pine); border-width: 2px; padding: 0.625rem 0.6875rem; }
.opt[aria-checked="true"] .check { color: var(--pine); }
.check { width: 1rem; height: 1rem; flex: none; }
.check svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.custom { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 0.5rem; }
.range { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.range select { flex: 1; font: inherit; font-size: 0.8125rem; padding: 0.5rem; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); }
.range span { font-size: 0.8125rem; color: var(--ink-3); }

@media (max-width: 34rem) {
  main, .masthead { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: 1.5rem; }
  .answer-title { font-size: 1.625rem; }
  .why-list { grid-template-columns: 1fr; }
  .why-proof b { font-size: 2rem; }
  .row-head { grid-template-columns: 0.75rem 2.125rem minmax(0, 1fr) auto 1.75rem; gap: 0.625rem; }
  .avatar.lg { width: 2.125rem; height: 2.125rem; }
  .row-body { padding-left: 0; }
  .driver { grid-template-columns: 7.5rem 1fr 2.25rem; gap: 0.5rem; }
  .driver span:first-child { font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
