/* 2026 interim UI — see the design brief for the rules these styles follow.
   Chrome stays achromatic; color comes only from team identity, the odds
   ramp, and the state colors (clinched / eliminated / coin flip). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
/* Nippo Bold (Indian Type Foundry, ITF Free Font License), served from this
   site: a Latin subset of backend/assets/fonts/Nippo-Bold.otf, the file the
   share cards draw with, so there's no third-party stylesheet to wait on. */
@font-face {
  font-family: "Nippo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/nippo-bold.woff2") format("woff2");
}

/* ------------------------------------------------------------------ tokens */

:root {
  --brand-50: #F2FBF8;
  --brand-100: #E1F7EF;
  --brand-200: #C2EFDF;
  --brand-300: #9BE6CD;
  --brand-400: #66DDB5;
  --brand-500: #26C58F;
  --brand-600: #198C65;
  --brand-700: #137252;
  --brand-800: #0F5B41;
  --brand-900: #0D4632;
  --brand-950: #07291D;

  --neutral-50: #F7F7F7;
  --neutral-100: #EFEFEF;
  --neutral-200: #DFDEDF;
  --neutral-300: #C7C7C7;
  --neutral-400: #A4A3A4;
  --neutral-500: #7B7A7B;
  --neutral-600: #5C5B5C;
  --neutral-700: #4C4C4C;
  --neutral-800: #393939;
  --neutral-900: #272727;
  --neutral-950: #161616;

  --surface-page: #FFFFFF;
  --surface-card: #FFFFFF;
  --surface-raised: var(--neutral-50);
  --surface-inverse: var(--neutral-900);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-on-inverse: var(--neutral-50);
  --border: var(--neutral-200);
  --connector: var(--neutral-400);
  --interactive: var(--brand-700);
  --interactive-hover: var(--brand-800);
  --accent-identity: var(--brand-600);
  --state-clinched: var(--brand-700);
  --state-eliminated: #B91C1C;
  --state-coinflip: #FBBF24;
  --state-live: var(--brand-700);

  --odds-1: var(--neutral-50);
  --odds-2: var(--brand-100);
  --odds-3: var(--brand-200);
  --odds-4: var(--brand-300);
  --odds-5: var(--brand-400);
  --odds-text: var(--neutral-900);

  --scrubber-selected-bg: var(--brand-700);
  --scrubber-selected-text: #FFFFFF;
  --link: var(--interactive);
  --link-hover: var(--interactive-hover);
  --header-h: 68px;

  --font-display: "Nippo", "Inter", system-ui, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

.dark {
  --surface-page: var(--neutral-950);
  --surface-card: var(--neutral-900);
  --surface-raised: var(--neutral-800);
  --surface-inverse: var(--neutral-50);
  --text-primary: var(--neutral-50);
  --text-secondary: var(--neutral-400);
  --text-on-inverse: var(--neutral-900);
  --border: var(--neutral-800);
  --connector: var(--neutral-500);
  --accent-identity: var(--brand-500);
  --state-live: var(--brand-500);

  --odds-1: var(--neutral-800);
  --odds-2: var(--brand-950);
  --odds-3: var(--brand-900);
  --odds-4: var(--brand-800);
  --odds-5: var(--brand-700);
  --odds-text: var(--brand-50);

  --scrubber-selected-bg: var(--brand-400);
  --scrubber-selected-text: var(--neutral-900);
  --link: var(--brand-400);
  --link-hover: var(--brand-300);

  color-scheme: dark;
}

/* ------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font: 400 16px/24px var(--font-text);
}
/* Tabular figures on every numeric style (brief §4) — scoped, because Inter's
   tnum feature also widens hyphens and would space out prose and titles. */
.standings, .odds, .provenance, .game-card {
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
/* Link color comes from a theme token rather than a ".dark a" rule, so
   components that set color: inherit (team names, titles) win in both themes. */
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--interactive);
  outline-offset: 2px;
  border-radius: 4px;
}
.dark :focus-visible { outline-color: var(--brand-400); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--surface-inverse); color: var(--text-on-inverse);
  padding: 10px 14px; border-radius: 6px; z-index: 20;
}
.skip-link:focus { top: 8px; color: var(--text-on-inverse); }

/* ----------------------------------------------------------------- layout
   Two measures, not one: a reading column for prose and a wider one for
   the table and scenario cards. */

.site-header, .page, .site-footer, .scrubber-bar__inner {
  margin-inline: auto;
  padding-inline: 16px;
  max-width: 68rem;
}
@media (min-width: 48em) {
  .site-header, .page, .site-footer, .scrubber-bar__inner { padding-inline: 32px; }
}

/* The header (name, team search, theme) stays pinned at every width; the
   class scrubber scrolls away under it, and the context bar takes over
   once the page title is out of view. */
.site-header-bar { position: sticky; top: 0; z-index: 11; background: var(--surface-page); }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--header-h);
}
.site-header__home {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 44px; min-height: 44px;
  color: var(--text-primary); text-decoration: none;
  font-size: 16px; line-height: 20px;
}
.site-header__home:hover { color: var(--text-primary); }
.site-header__home img { width: 34px; height: auto; }
.team-search { position: relative; flex: 1 1 auto; display: flex; justify-content: flex-end; max-width: 20rem; margin-left: auto; }
/* 16px, not smaller: iOS Safari zooms the page into any field under 16px
   when it's focused, and doesn't zoom back out. */
.team-search input {
  width: 100%; min-height: 44px; padding: 0 12px;
  font: inherit; font-size: 16px;
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: 8px;
}
.team-search input::placeholder { color: var(--text-secondary); }

/* Search suggestions: a popup list under the field. */
.team-results {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  width: max(100%, min(22rem, calc(100vw - 32px)));
  max-height: min(24rem, 60vh); overflow-y: auto;
  padding: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
}
.dark .team-results { box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); }
.team-results [role="option"] {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 44px; padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.team-results [aria-selected="true"] { background: var(--surface-raised); }
.team-results__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-results__meta { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.team-results__empty { padding: 10px; font-size: 14px; color: var(--text-secondary); }
/* Phones: the field is narrow and mid-header, so the list spans the header. */
@media (max-width: 40em) {
  .site-header { position: relative; }
  .team-search { position: static; }
  .team-results { left: 16px; right: 16px; width: auto; top: calc(100% - 2px); }
}
@media (max-width: 40em) {
  .site-header { gap: 10px; }
  .site-header__home span { display: none; }
}
/* Very narrow (a phone zoomed to 200%): the search gets a row of its own, and
   the header scrolls away rather than holding a third of the screen. */
@media (max-width: 20em) {
  .site-header-bar { position: static; }
  .site-header { flex-wrap: wrap; height: auto; padding-block: 8px; row-gap: 8px; }
  .team-search { order: 3; flex-basis: 100%; max-width: none; }
  .context-bar { top: 0; }
}

/* Light / System / Dark: a segmented control matching the class scrubber.
   Each choice is a 44px touch target; the selected one is filled. */
.theme-toggle {
  flex: none;
  display: inline-flex; gap: 2px;
  padding: 3px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.theme-toggle__item {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.theme-toggle__item svg { width: 20px; height: 20px; }
.theme-toggle__item:hover { color: var(--text-primary); }
.theme-toggle__item[aria-checked="true"] {
  background: var(--scrubber-selected-bg);
  color: var(--scrubber-selected-text);
}
.theme-toggle__item:focus-visible { outline-offset: -2px; }
@media (max-width: 30em) {
  .theme-toggle__item svg { width: 18px; height: 18px; }
}

.site-footer {
  padding-block: 48px 40px;
  color: var(--text-secondary);
  font-size: 12px; line-height: 16px;
}
.site-footer p { max-width: 40rem; }
.site-footer p + p { margin-top: 8px; }

/* ---------------------------------------------------------- class scrubber */

.scrubber-bar {
  background: var(--surface-page);
  border-bottom: 1px solid var(--border);
}

/* What's on screen, pinned under the header once the title scrolls away.
   Fixed rather than sticky so showing it never shifts the page. */
.context-bar {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 10;
  background: var(--surface-page);
  border-block: 1px solid var(--border);
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity 120ms ease-out, transform 120ms ease-out, visibility 0s linear 120ms;
}
.context-bar.is-shown {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .context-bar, .context-bar.is-shown { transition: none; transform: none; }
}
.context-bar__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
  margin-inline: auto; max-width: 68rem;
  padding: 8px 16px;
  font-size: 13px; line-height: 18px;
}
@media (min-width: 48em) {
  .context-bar__inner { padding-inline: 32px; }
}
.context-bar__title {
  font-family: var(--font-display); font-weight: 700;
  font-variant-numeric: normal; /* tnum would space out the hyphen in "2-7A" */
  font-size: 15px; letter-spacing: 0;
  color: var(--text-primary);
}
.context-bar .sep { color: var(--text-secondary); }
.scrubber-bar__inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px;
  padding-block: 8px;
}
.scrubber-bar__inner .scrubber { min-width: 0; }

/* The front page has no class of its own, so no class picker (it has its own way in). */
.scrubber-bar[hidden] { display: none; }
.scrubber {
  display: inline-flex; gap: 2px;
  max-width: 100%;
  padding: 3px;
  background: var(--surface-raised);
  border-radius: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.scrubber::-webkit-scrollbar { display: none; }
.scrubber__item {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 44px;
  padding: 0 12px;
  text-decoration: none;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600; font-size: 15px;
  cursor: pointer;
}
.scrubber__item:hover { color: var(--text-primary); }
.scrubber__item:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.scrubber__item[aria-current="page"], .scrubber__item[aria-current="page"]:hover {
  background: var(--scrubber-selected-bg);
  color: var(--scrubber-selected-text);
}
.scrubber__item:focus-visible { outline-offset: -2px; }

/* -------------------------------------------------------------- typography */

/* Nippo carries the page's titles and headers (the site name, page titles
   including their class/region designation, and section headers); Inter
   carries everything people read or compare. Nippo's only weight is Bold. */
.title, .section-title, .sub-title, .region-block__title, .article h2, .site-header__home span {
  font-family: var(--font-display);
  font-weight: 700;
}
.title {
  font-size: 32px; line-height: 36px;
  letter-spacing: -0.01em;
}
@media (max-width: 30em) {
  .title { font-size: 28px; line-height: 32px; }
}

.headline {
  font-size: 22px; line-height: 32px; font-weight: 600;
  max-width: 36rem;
  text-wrap: pretty;
}

.section-title { font-size: 24px; line-height: 30px; }
.sub-title { font-size: 20px; line-height: 26px; }
.prose { max-width: 38rem; }
.prose p + p { margin-top: 16px; }
.muted { color: var(--text-secondary); }
.caption { font-size: 12px; line-height: 16px; color: var(--text-secondary); }

/* ------------------------------------------------------------ provenance */

.mode { display: inline-flex; align-items: center; gap: 4px; }

.info-button {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin-inline: -10px -6px;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text-secondary);
}
.info-button svg { width: 15px; height: 15px; }
.info-button:hover, .info-button[aria-expanded="true"] { color: var(--text-primary); }
.mode-help {
  max-width: 36rem; margin-top: 4px; padding: 10px 14px;
  border-left: 2px solid var(--connector);
  font-size: 14px; line-height: 20px; color: var(--text-secondary);
}
.mode-help p + p { margin-top: 6px; }
.mode-help strong { color: var(--text-primary); font-weight: 600; }

/* The provenance line as controls: each select reads as part of the
   sentence, with a dotted underline and caret marking it as changeable. */
.provenance--controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px;
  font-size: 13px;
}
.provenance--controls .sep { color: var(--text-secondary); }
.provenance--controls .seg { display: inline-flex; align-items: center; gap: 6px; }
.ctl { display: inline-flex; align-items: center; gap: 4px; }
.inline-select select {
  appearance: none;
  field-sizing: content; /* hug the chosen option instead of the longest one */
  min-height: 44px;
  padding: 0 14px 0 2px;
  border: 0; border-radius: 4px;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237B7A7B' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 2px center / 9px 6px;
  color: var(--text-primary);
  font: inherit; font-weight: 600;
  text-decoration: underline dotted var(--connector);
  text-underline-offset: 4px;
  cursor: pointer;
}
.ctl--mode.mode--tossup select { font-style: italic; }
.inline-select option { font-style: normal; color: initial; }
.mode--tossup { font-style: italic; }
.mode__glyph { width: 13px; height: 13px; flex: none; }

.provenance {
  font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.provenance__live { color: var(--state-live); display: inline-flex; align-items: center; gap: 6px; }
.provenance__pulse {
  position: relative; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--state-live);
}
.provenance__pulse::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--state-live);
  transform: translate(-50%, -50%);
  animation: live-ring 1200ms ease-out infinite;
}
@keyframes live-ring {
  from { width: 8px; height: 8px; opacity: 0.6; }
  to { width: 20px; height: 20px; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .provenance__pulse::after { display: none; }
}

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px 1px 5px;
  border-radius: 6px;
  font-size: 12px; line-height: 18px; font-weight: 500;
  white-space: nowrap;
  vertical-align: 1px;
}
.badge svg { width: 12px; height: 12px; flex: none; }
.badge--clinched, .badge--champion { background: var(--state-clinched); color: #FFFFFF; }
.badge--eliminated { background: var(--state-eliminated); color: #FFFFFF; }
.badge--coinflip { background: var(--state-coinflip); color: var(--neutral-900); }

/* ------------------------------------------------------------ team marks */

.mark {
  display: inline-block; flex: none;
  width: 24px; height: 24px;
  object-fit: contain;
  vertical-align: middle;
}
.mark--generic .helmet__shell { stroke: #FFFFFF; }
.mark--generic.mark--pale .helmet__shell { stroke: var(--neutral-400); }
.dark .mark--generic.mark--pale .helmet__shell { stroke: #FFFFFF; }
/* No team colors on record: initials in a neutral squircle. */
.mark--initials {
  display: inline-grid; place-items: center;
  border-radius: 30%;
  background: var(--neutral-200);
  color: var(--neutral-800);
  font-size: 10px; line-height: 1; font-weight: 700;
  letter-spacing: -0.02em;
}
.dark .mark--initials { background: var(--neutral-700); color: var(--neutral-50); }
/* Logos at 48px and up get a footprint-normalizing container. */
.mark--lg { width: 48px; height: 48px; }
.mark--lg.mark--logo {
  padding: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.mark--lg.mark--initials { font-size: 18px; }

.team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* ------------------------------------------------------------- odds cell */

.odds {
  display: inline-block;
  min-width: 3.6em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--odds-1);
  color: var(--odds-text);
  font-size: 14px; line-height: 20px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.odds--1 { background: var(--odds-1); }
.odds--2 { background: var(--odds-2); }
.odds--3 { background: var(--odds-3); }
.odds--4 { background: var(--odds-4); }
.odds--5 { background: var(--odds-5); }

.entry-head { padding-block: 40px 24px; }

/* ------------------------------------------- class view: region tables */

.region-blocks {
  display: grid; gap: 36px 56px;
  grid-template-columns: repeat(auto-fill, minmax(min(26rem, 100%), 1fr));
  align-items: start;
}
.region-block__title { font-size: 20px; line-height: 26px; }
.region-block__title a { color: inherit; text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.region-block__title a:hover { text-decoration: underline; }
.standings--compact { margin-top: 0; }
.standings--compact th, .standings--compact td { padding: 4px 4px; }
.standings--compact .col-odds { width: 4.2em; }
.team-link {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px;
  color: inherit; text-decoration: none;
}
.team-link:hover .team-name { text-decoration: underline; }
.standings .team-link .team-name { font-weight: 500; }

/* ---------------------------------------------------------- region view */

.region-head { padding-block: 28px 0; }

/* Breadcrumbs: Home › Class 7A › Region 2-7A. Each link is a full-height target. */
.crumbs ol {
  display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none;
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.02em;
}
.crumbs li { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-secondary); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--text-secondary); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.entry-head .crumbs + .title, .article .crumbs + .title { margin-top: 4px; }
.entry-head:has(> .crumbs) { padding-top: 28px; } /* the crumbs take the space the padding gave */
.region-head .title { margin-top: 4px; }
.region-head .headline { margin-top: 20px; }
.region-head .provenance { margin-top: 16px; }
.region-head .provenance--controls, .entry-head .provenance--controls,
.static-page .region-head .provenance--static { margin-top: 8px; }

.standings { margin-top: 14px; width: 100%; border-collapse: collapse; }
.standings caption { text-align: left; }
.standings th, .standings td {
  padding: 8px 6px;
  font-size: 14px; line-height: 20px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
.standings thead th {
  font-weight: 500; color: var(--text-secondary);
  font-size: 12px; line-height: 16px;
  padding-block: 6px;
}
.standings .col-pos { width: 2.4em; padding-left: 12px; text-align: left; color: var(--text-secondary); }
.standings .col-team { text-align: left; width: 100%; }
.standings tbody th { font-weight: 400; }
.standings .col-odds { width: 4.4em; padding-inline: 2px; } /* 3px pushed the table 1px past a 375px phone */
.standings .col-rec { white-space: nowrap; }
/* Records and odds sit centered under centered headers. */
.standings .col-rec, .standings .col-odds { text-align: center; }
.standings tr.is-eliminated .team-name { color: var(--text-secondary); }
/* The picked team: a rule in the identity green, not a fill (a fill would
   match the lowest odds-ramp slot and hide those cells). */
.standings tr.is-focus > :first-child { box-shadow: inset 3px 0 0 var(--accent-identity); }
/* The picked row and its expanded panels read as one block: no rule between
   them, so the green edge runs unbroken from the row through the panels. */
.standings tr.is-focus:not(.detail) > * { border-bottom-color: transparent; }
.standings tr.is-focus .team-name { font-weight: 600; }
.focus-note { margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); }

.row-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 44px;
  padding: 0; border: 0; background: none;
  text-align: left; cursor: pointer;
}
.row-toggle .team-name { font-weight: 500; }
.row-toggle__label { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.row-toggle__chev {
  width: 14px; height: 14px; flex: none;
  color: var(--text-secondary);
  transition: transform 120ms ease-out;
}
.row-toggle[aria-expanded="true"] .row-toggle__chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .row-toggle__chev { transition: none; }
}
/* Expanded row: Record, Seeding odds, and Playoff path panels side by side,
   wrapping to a stack on narrow screens. */
.standings tr.detail td { text-align: left; padding: 12px 6px 24px 2.6em; }
.detail__panels {
  display: grid; gap: 24px 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), auto));
  justify-content: space-between;
  align-items: start;
}
.detail__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 22px; }
.detail__sub { margin-top: 16px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-secondary); }
.detail__records { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 14px; color: var(--text-secondary); }
.detail__records strong { color: var(--text-primary); font-weight: 600; font-size: 16px; margin-right: 2px; }
.detail__note { margin-top: 10px; font-size: 14px; line-height: 20px; color: var(--text-secondary); max-width: 34rem; }
.detail__odds { display: grid; gap: 6px; margin: 8px 0 0; font-size: 14px; }
.detail__odds div { display: grid; grid-template-columns: 7.4em auto; align-items: center; }
.detail__odds dt { color: var(--text-secondary); }
.detail__odds dd { margin: 0; }
.sched { margin-top: 6px; display: grid; gap: 6px; font-size: 14px; }
.sched li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sched .mark { width: 20px; height: 20px; }
.sched__joiner { min-width: 1.4em; color: var(--text-secondary); font-size: 13px; }
.sched__result { margin-left: 4px; font-weight: 600; white-space: nowrap; }
.sched__wl { font-weight: 600; }
.sched__wl--L, .sched__wl--T { color: var(--text-secondary); }
.sched__date { margin-left: 4px; color: var(--text-secondary); font-size: 13px; }

/* Playoff path inside an expanded row. */
.path { margin-top: 8px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.path th, .path td { padding: 4px 14px 4px 0; text-align: right; border: 0; }
.path th[scope="row"], .path thead th:first-child { text-align: left; font-weight: 400; }
.path thead th { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.standings tr.detail .path td, .standings tr.detail .path th { padding: 4px 14px 4px 0; }
.standings tr.detail .path thead th { text-align: left; }

/* Narrow (or zoomed) viewports keep two odds columns: 1st and Playoffs. */
@media (max-width: 40em) {
  .standings .col-mid, .standings .col-overall { display: none; }
}
@media (max-width: 22em) {
  .standings .col-pos { display: none; }
}
/* Keep the expanded panels clear of the picked row's green rule. */
@media (max-width: 40em) {
  .standings tr.detail td { padding-left: 16px; padding-right: 10px; }
}

.section { margin-top: 56px; }
.section > .section-title + * { margin-top: 16px; }

/* Region games: a card per game, grouped under each game day. */
.game-day + .game-day { margin-top: 24px; }
.game-day__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 15px; line-height: 20px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.game-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  margin-top: 10px;
}
.game-card {
  display: grid; gap: 10px;
  padding: 14px 16px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.game-card.is-focus { border-color: var(--accent-identity); box-shadow: inset 3px 0 0 var(--accent-identity); }
.game-card__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.game-card__team { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.game-card__score { font-weight: 500; }
.game-card__team.is-winner .team-name, .game-card__team.is-winner .game-card__score { font-weight: 700; }
.game-card__joiner { color: var(--text-secondary); font-size: 14px; }

/* ------------------------------------------------------------ scenarios */

.scenario-group + .scenario-group { margin-top: 40px; }
.scenario-group--spaced { margin-top: 20px; }
.scenario-group > .sub-title { margin-bottom: 14px; }
details.scenario-group > summary {
  display: flex; align-items: baseline; gap: 12px;
  min-height: 44px; padding-block: 8px;
  cursor: pointer;
  list-style: none;
}
details.scenario-group > summary::-webkit-details-marker { display: none; }
details.scenario-group > summary .sub-title::before,
details.scenario-group > summary .section-title::before {
  content: ""; display: inline-block;
  width: 0; height: 0; margin-right: 10px; vertical-align: 3px;
  border-left: 6px solid currentColor; border-block: 5px solid transparent;
  transition: transform 120ms ease-out;
}
details.scenario-group[open] > summary .sub-title::before,
details.scenario-group[open] > summary .section-title::before { transform: rotate(90deg); }
details.scenario-group > summary { flex-wrap: wrap; }
details.scenario-group[open] > summary { margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) {
  details.scenario-group > summary .sub-title::before,
  details.scenario-group > summary .section-title::before { transition: none; }
}
.scenario-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
  align-items: start;
}
.scenario {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--team-ui-light, var(--border));
  border-radius: 8px;
  padding: 16px 16px 18px;
}
.dark .scenario { border-left-color: var(--team-ui-dark, var(--border)); }
.scenario__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scenario__title { font-size: 18px; line-height: 24px; font-weight: 600; }
.scenario__head .odds { font-size: 16px; font-weight: 600; }
/* The card title reads as a condition: "Stringer clinches the region IF",
   then the chips. Styled like the AND/OR connectors it leads into. */
.scenario__if {
  margin-left: 2px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.scenario .provenance { margin-top: 4px; }

/* A complete scenario: the seeds it produces, then the results behind it. */
.outcome__seeds { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.outcome__seeds li { display: flex; align-items: center; gap: 10px; }
.outcome__seeds li.is-focus .team-name { font-weight: 700; }
.outcome__seed {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-raised);
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.outcome__out { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.outcome__out-label { font-weight: 600; margin-right: 2px; }
.outcome__out strong { color: var(--text-primary); }
.outcome__if {
  margin-top: 14px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.outcome .scenario__body { margin-top: 8px; }
.scenario__body { margin-top: 16px; }

/* Condition chips and the explicit AND / OR grammar. */
.conditions { display: flex; flex-direction: column; align-items: stretch; }
.cond-group { display: flex; flex-direction: column; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  background: var(--surface-raised);
  border-radius: 6px;
  font-size: 14px; line-height: 20px;
  text-align: left;
}
.chip--text { padding-left: 10px; }
.chip__subject { font-weight: 500; }
.chip svg { width: 18px; height: 18px; flex: none; }
.and {
  position: relative;
  display: flex; justify-content: center;
  height: 26px;
}
.and::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 1px; background: var(--connector);
}
.and span {
  position: relative; align-self: center;
  padding: 0 4px;
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 10px; line-height: 12px; font-weight: 600;
}
.or {
  position: relative;
  display: flex; justify-content: center;
  margin-block: 14px;
}
.or::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--connector);
}
.or span {
  position: relative;
  padding: 1px 10px;
  border-radius: 6px;
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  font-size: 11px; line-height: 16px; font-weight: 600;
}

.notice { padding-block: 40px; color: var(--text-secondary); }

/* ---------------------------------------------------------- methodology */

.article { padding-block: 40px 0; }
.article .prose { margin-top: 20px; }
.article h2 { margin-top: 36px; font-size: 20px; line-height: 26px; }
.article h2 + p { margin-top: 8px; }
.article ol.steps { list-style: decimal; padding-left: 1.4em; margin-top: 8px; }
.article ol.steps li + li { margin-top: 6px; }
.article ol.steps + p { margin-top: 16px; }
.article ul.bullets { list-style: disc; padding-left: 1.4em; margin-top: 8px; }
.article ul.bullets li + li { margin-top: 6px; }
.article ul.bullets + p { margin-top: 16px; }
.article h2[id] { scroll-margin-top: 80px; }

.detail__link { margin-top: 14px; font-size: 14px; }

/* ------------------------------------------------------------- bracket */

.bracket-head { padding-bottom: 16px; }
.bracket-head .focus-note { margin-top: 12px; }

/* North / South / Both: a segmented control like the class scrubber. */
.half-control {
  display: inline-flex; gap: 2px;
  margin-bottom: 20px;
  padding: 3px;
  background: var(--surface-raised);
  border-radius: 10px;
}
.half-control__item {
  min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
}
.half-control__item:hover { color: var(--text-primary); }
.half-control__item[aria-pressed="true"] {
  background: var(--scrubber-selected-bg);
  color: var(--scrubber-selected-text);
}
.half-control__item:focus-visible { outline-offset: -2px; }

/* The bracket page is wider than the rest, with the header to match. */
body.is-wide .site-header, body.is-wide .scrubber-bar__inner, body.is-wide .context-bar__inner,
body.is-wide .page, body.is-wide .site-footer,
body:has(.bracket-head) :is(.site-header, .scrubber-bar__inner, .context-bar__inner, .page, .site-footer) { max-width: 92rem; }

/* Round tabs: phones only (wide screens show every round at once). */
.round-tabs { display: none; }

/* The bracket tree: columns of fixed-height cards, positioned by app.js so
   each game sits between the two that feed it, joined by lines. */
.tree {
  --line: color-mix(in srgb, var(--text-secondary) 50%, transparent);
  position: relative;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 12px;
}
.tree__cols { position: relative; display: flex; gap: 32px; width: max-content; min-width: 100%; }
.tcol { flex: 1 0 14rem; max-width: 18rem; }
.tcol__title {
  margin-bottom: 10px;
  font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tcol__body { position: relative; margin: 0; padding: 0; list-style: none; }
.tslot { position: absolute; top: 0; left: 0; right: 0; height: var(--card-h); }
.tree__lines { position: absolute; left: 0; pointer-events: none; overflow: visible; }
.tree__lines path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.tree__lines path.is-path { stroke: var(--accent-identity); stroke-width: 2.5; }

/* A compact game card: one row per side, the home team on the bottom. */
.tgame {
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; height: 100%;
  padding: 2px 10px 2px 2px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary); font: inherit; text-align: left;
  cursor: pointer;
}
.tgame:hover { border-color: var(--line); }
.tgame:focus-visible { outline: 2px solid var(--link); outline-offset: -3px; } /* inside the card: the tree clips anything outside */
.tgame.is-path { border-color: var(--accent-identity); box-shadow: inset 3px 0 0 var(--accent-identity); }
.tgame.is-off { background: var(--surface-raised); }
.tgame.is-off .trow__name, .tgame.is-off .trow__value { color: var(--text-secondary); }
.tgame.is-off .odds { opacity: 0.75; }
.trow {
  display: grid; grid-template-columns: 22px 22px minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
  height: 45px; min-width: 0;
}
.trow + .trow { border-top: 1px solid var(--border); }
.trow__gutter { font-size: 11px; line-height: 14px; color: var(--text-secondary); text-align: center; }
.trow .mark { width: 22px; height: 22px; }
.trow__text { display: flex; flex-direction: column; min-width: 0; }
.trow__name { font-size: 14px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__sub {
  display: block;
  font-size: 12px; line-height: 15px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trow__sub .lock { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
.trow__value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trow .odds { min-width: 3.2em; padding: 1px 5px; font-size: 13px; line-height: 18px; }
.trow--result:not(.is-winner) .trow__name, .trow--result:not(.is-winner) .trow__value { color: var(--text-secondary); font-weight: 500; }
.trow--result.is-winner .trow__name, .trow--result.is-winner .trow__value { font-weight: 700; }
.trow.is-focus .trow__name { font-weight: 700; }
.trow--empty .trow__name { color: var(--text-secondary); font-weight: 400; }

/* Phones: one round per screen with the next peeking in, round tabs to jump. */
@media (max-width: 48em) {
  .half-control__item--both { display: none; }
  .round-tabs {
    display: flex; gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto; scrollbar-width: none;
  }
  .round-tabs::-webkit-scrollbar { display: none; }
  .round-tabs__item {
    flex: none;
    min-width: 44px; min-height: 44px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600; font-size: 14px;
    cursor: pointer;
  }
  .round-tabs__item[aria-current="true"] { border-color: var(--text-primary); color: var(--text-primary); }
  .tree {
    margin-inline: -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .tree::-webkit-scrollbar { display: none; }
  .tree__cols { gap: 24px; }
  .tcol { flex: none; width: calc(88vw - 40px); max-width: none; scroll-snap-align: start; }
}
/* Very narrow (a phone zoomed to 200%): a full-width round, and each row
   gives the name the width, odds underneath; the helmet (decoration) goes. */
@media (max-width: 20em) {
  .tcol { width: calc(100vw - 40px); }
  .trow { grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; }
  .trow .mark { display: none; }
  .trow__sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* still read out */
  .trow__value { grid-column: 2; justify-self: start; line-height: 1; }
}

/* The game sheet: a bottom sheet on phones, a centered dialog on wide screens. */
.game-sheet {
  width: min(32rem, calc(100vw - 32px)); max-height: min(85vh, 48rem);
  padding: 0;
  background: var(--surface-page); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.game-sheet[open] { display: flex; flex-direction: column; }
.game-sheet::backdrop { background: rgb(0 0 0 / 0.45); }
.game-sheet__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--border);
}
.game-sheet__kicker { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.game-sheet__title { margin-top: 2px; font-size: 18px; line-height: 24px; font-weight: 700; }
.game-sheet__title:focus { outline: none; } /* focused on open so the close button doesn't start ringed */
.game-sheet__prov { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.game-sheet__prov .context-bar__title { font-weight: 600; color: var(--text-primary); }
.game-sheet__prov .sep { color: var(--text-secondary); }
.game-sheet__close {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; margin: -8px -6px 0 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text-secondary); cursor: pointer;
}
.game-sheet__close svg { width: 18px; height: 18px; }
.game-sheet__close:hover { color: var(--text-primary); background: var(--surface-raised); }
.game-sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 12px 20px 20px; display: grid; gap: 14px; }
.game-sheet__hint { font-size: 13px; }
.bgame.bgame--sheet { padding: 0; border: 0; background: none; }
@media (max-width: 48em) {
  .game-sheet {
    width: 100%; max-width: 100%; max-height: 88vh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  .game-sheet__body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
/* Small or zoomed-in screens: the whole sheet scrolls, so its heading doesn't
   leave the body a sliver. */
@media (max-width: 20em), (max-height: 32em) {
  .game-sheet { overflow-y: auto; overscroll-behavior: contain; }
  .game-sheet[open] { display: block; }
  .game-sheet__body { overflow: visible; }
}
/* Very narrow: matchups and opponents put their odds under the names. */
@media (max-width: 20em) {
  ol.opp-list li { grid-template-columns: minmax(0, 1fr); }
  ol.opp-list li > .odds { justify-self: end; }
}
/* Names wrap in the sheet rather than cut off: it's where the full name is.
   When even one word won't fit beside the odds (zoomed in), the odds drop
   below the name. */
dialog.game-sheet .team-name { white-space: normal; overflow-wrap: break-word; }
dialog.game-sheet .bteam { flex-wrap: wrap; }
dialog.game-sheet .bteam__name { flex: 1 1 0; min-width: min-content; }
dialog.game-sheet .bteam .odds { margin-left: auto; }
@media (prefers-reduced-motion: no-preference) {
  .game-sheet[open] { animation: sheet-in 160ms ease-out; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } }
}

/* A game card. */
.bgame {
  display: grid; gap: 6px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bgame > *, .bside > *, .bgame__detail > * { min-width: 0; }
.bgame__state {
  font-size: 11px; line-height: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.bgame__site { font-size: 13px; }

.bteam {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; min-width: 0;
}
.bteam__name {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0; min-height: 44px;
  padding: 0; border: 0; background: none;
  color: var(--text-primary);
  font: inherit; text-align: left;
  cursor: pointer;
}
.bteam__name .mark { flex: none; }
.bteam__name .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bteam__name:hover .team-name { text-decoration: underline; }
.bteam__name.is-focus .team-name { font-weight: 700; }
.bteam .odds { flex: none; }
.bteam__fact {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 13px; color: var(--text-secondary);
}
.lock { width: 13px; height: 13px; flex: none; }
.bteam__home {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 11px; line-height: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.bside__label .bteam__home { margin-left: 8px; }
/* A locked team: name and Home tag, then its seed on a line of its own. */
.bteam--locked { flex-wrap: wrap; row-gap: 0; }
.bteam--locked .bteam__name { flex: 1 1 0; }
.bteam--locked .bteam__home { order: 1; }
.bteam--locked .bteam__fact { order: 2; flex-basis: 100%; padding-left: 30px; margin-top: -6px; }
.bteam__score { flex: none; font-variant-numeric: tabular-nums; font-weight: 500; }
.bteam--result.is-winner .team-name, .bteam--result.is-winner .bteam__score { font-weight: 700; }
.bteam--result:not(.is-winner) .team-name { color: var(--text-secondary); }

.bside__label { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.bside__list { list-style: none; margin: 0; padding: 0; }
.bside__empty { font-size: 14px; }
.bside__more {
  min-height: 44px; padding: 0;
  border: 0; background: none;
  color: var(--link); font: inherit; font-size: 14px;
  cursor: pointer;
}
.bside__more:hover { color: var(--link-hover); text-decoration: underline; }

.bgame__vs {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.bgame__vs::before, .bgame__vs::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.bgame__detail { display: grid; gap: 8px; padding-bottom: 4px; }
.bgame__detail[hidden] { display: none; }
.bgame__heading { font-size: 14px; line-height: 20px; font-weight: 600; }
.bgame__count, .bgame__note { font-size: 13px; line-height: 18px; }
.bgame__sides { display: grid; gap: 4px; }
.bgame__sides-vs { font-size: 12px; }

.opp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.opp-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 2px 10px;
}
.opp-list .team { min-width: 0; }
.opp-list--matchups { gap: 0; }
.opp-list--matchups li { padding-block: 8px; }
.opp-list--matchups li + li { border-top: 1px solid var(--border); }
.opp-list .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-list__host { grid-column: 1 / -1; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.opp-list .team + .odds { justify-self: end; }
.mu__teams { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mu__line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mu__line .team { min-width: 0; }
.mu__line .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu__line .vs { flex: none; width: 1.5em; }
.mu__teams .vs { font-size: 12px; color: var(--text-secondary); }
.bgame .mark { width: 22px; height: 22px; }

/* ------------------------------------------------------------ main nav */
/* Standings, Bracket, How it works: header links on wide screens, a tab
   bar along the bottom on phones and small tablets. Only one is shown. */

.site-nav { display: none; gap: 4px; }
/* Pages without the team search (How it works): keep the nav beside the name. */
.site-nav:has(+ .theme-toggle) { margin-right: auto; }
.site-nav__item {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 10px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__item:hover { color: var(--text-primary); }
.site-nav__item[aria-current="page"] { color: var(--text-primary); border-bottom-color: var(--accent-identity); }

.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-page);
  border-top: 1px solid var(--border);
}
.tab-bar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px;
  color: var(--text-secondary);
  font-size: 12px; line-height: 14px; font-weight: 600;
  text-decoration: none;
}
.tab-bar__item svg { width: 24px; height: 24px; }
.tab-bar__item:hover { color: var(--text-primary); }
.tab-bar__item[aria-current="page"] { color: var(--accent-identity); }
.tab-bar__item:focus-visible { outline-offset: -4px; }
body { padding-bottom: calc(57px + env(safe-area-inset-bottom)); }

/* Between tablet and wide desktop the name gives way to the nav (the helmet stays). */
@media (min-width: 60em) and (max-width: 79.99em) {
  .site-header__home span { display: none; }
}
@media (min-width: 60em) {
  .site-nav { display: flex; }
  .site-header__home { flex: none; }
  .tab-bar { display: none; }
  body { padding-bottom: 0; }
}
@media print {
  .tab-bar { display: none; }
}

/* ------------------------------------------------------------ feedback */
/* Report links sit quietly under what they're about; the form opens in a
   sheet (the bracket's game sheet styles) or on /feedback. */

.link-button {
  padding: 0; border: 0; background: none;
  color: var(--link); font: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--link-hover); }
.report-line { margin-top: 16px; font-size: 14px; line-height: 20px; }
.report-line .link-button { min-height: 44px; text-align: left; } /* a line of its own, so a full-size target */

.game-card__report {
  justify-self: end;
  min-height: 32px; padding: 0 2px;
  border: 0; background: none;
  color: var(--text-secondary); font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.game-card__report:hover { color: var(--link); }

.fb-page { max-width: 36rem; }
.fb-form { display: grid; gap: 18px; }
.fb-about { font-size: 14px; line-height: 20px; font-weight: 600; }
.fb-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.fb-form legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; }
.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-cat { position: relative; display: inline-flex; }
.fb-cat input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fb-cat span {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
}
.fb-cat input:checked + span { border-color: var(--text-primary); color: var(--text-primary); background: var(--surface-raised); }
.fb-cat input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.fb-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.fb-field .muted { font-weight: 400; }
.fb-form textarea, .fb-form input[type="email"], .fb-score input {
  width: 100%; padding: 10px 12px;
  font: inherit; font-size: 16px; font-weight: 400; /* 16px: no iOS zoom on focus */
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: 8px;
}
.fb-form textarea { resize: vertical; min-height: 6rem; }
.fb-scores { display: grid; gap: 10px; }
.fb-score { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; align-items: center; gap: 12px; }
.fb-score__team { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-score input { text-align: right; font-variant-numeric: tabular-nums; }
/* The honeypot: kept out of sight and out of the tab order; people never fill it in. */
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb-status { min-height: 20px; font-size: 14px; line-height: 20px; }
.fb-status.is-error { color: var(--state-eliminated); font-weight: 600; }
.fb-actions { display: flex; }
.fb-submit {
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 8px;
  background: var(--scrubber-selected-bg); color: var(--scrubber-selected-text);
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.fb-submit:disabled { opacity: 0.6; cursor: progress; }
.fb-fine { font-size: 13px; line-height: 18px; }
.fb-sent { display: grid; gap: 10px; justify-items: start; padding-block: 8px; }
.fb-sent__title { font-size: 18px; font-weight: 700; }
.dark .fb-status.is-error { color: #F87171; } /* the badge red is too dark to read as text here */
/* Cloudflare Turnstile: invisible unless Cloudflare asks for a click */
.fb-turnstile:empty { display: none; }

/* ------------------------------------------------------------ moderation (/moderate) */
.mod-page { max-width: 46rem; }
.mod-account { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mod-button[hidden] { display: none; }
.mod-button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text-primary); text-decoration: none;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.mod-button:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.mod-filters {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: start;
  padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
}
.mod-filter { grid-column: 1; margin: 0; padding: 0; border: 0; min-width: 0; }
.mod-filter legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.mod-refresh {
  grid-column: 2; grid-row: 1; align-self: end;
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  color: var(--text-primary); background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.mod-refresh:hover { border-color: var(--text-secondary); }
.mod-refresh svg { width: 20px; height: 20px; }
.mod-refresh.is-loading svg { animation: mod-spin 0.8s linear infinite; }
@keyframes mod-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mod-refresh.is-loading svg { animation: none; opacity: 0.5; } }
/* More specific than ".fb-cat span", which styles the chip itself. */
.fb-cat span.mod-count {
  display: inline-grid; place-items: center; min-width: 20px; min-height: 0; height: 20px;
  margin: 0 -6px 0 8px; padding: 0 6px; border: 0;
  border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--odds-3); color: var(--odds-text);
}
.fb-cat span.mod-count .visually-hidden { padding: 0; border: 0; min-height: 0; }
.mod-list { display: grid; }
.mod-list[aria-busy="true"] { opacity: 0.55; }
.mod-empty { padding-block: 32px; }
.mod-more { padding-block: 16px 8px; }
.mod-card { display: grid; gap: 10px; padding-block: 20px; border-bottom: 1px solid var(--border); }
.mod-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.mod-card__title { font-size: 16px; line-height: 22px; font-weight: 700; }
.mod-card__title:focus { outline: none; }
.mod-card__when { font-size: 13px; }
.mod-card__about { font-weight: 600; }
.mod-card__meta { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.mod-message {
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 12px 14px; border-radius: 8px; background: var(--surface-raised);
}
.mod-score { justify-self: start; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.mod-score th, .mod-score td { padding: 6px 12px 6px 0; text-align: left; }
.mod-score thead th { font-size: 13px; font-weight: 600; color: var(--text-secondary); max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-score tbody th { font-weight: 500; color: var(--text-secondary); padding-right: 20px; }
.mod-score tbody td { font-weight: 600; min-width: 3ch; }
.mod-score td.is-changed span { padding: 2px 6px; margin-left: -6px; border-radius: 6px; background: var(--odds-3); color: var(--odds-text); }
.mod-score__result { color: var(--text-secondary); font-weight: 500 !important; }
.mod-payload { display: grid; gap: 4px; font-size: 14px; }
.mod-payload div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .mod-payload div { grid-template-columns: minmax(0, 1fr); gap: 0; } .mod-payload div + div { margin-top: 6px; } }
.mod-payload dt { color: var(--text-secondary); }
.mod-payload dd { margin: 0; overflow-wrap: anywhere; }
.mod-card__review { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.mod-card__notes { flex-basis: 100%; color: var(--text-secondary); white-space: pre-wrap; }
.mod-status {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-raised); border: 1px solid var(--border);
}
.mod-status--approved { color: var(--state-clinched); border-color: currentColor; }
.mod-status--rejected { color: var(--state-eliminated); border-color: currentColor; }
.dark .mod-status--rejected { color: #F87171; }
.mod-decide { display: grid; gap: 10px; }
.mod-decide textarea {
  width: 100%; padding: 8px 12px; min-height: 2.75rem; resize: vertical;
  font: inherit; font-size: 16px; color: var(--text-primary);
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px;
}
.mod-decide__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mod-reject {
  min-height: 44px; padding: 0 18px;
  font: inherit; font-weight: 600; color: var(--text-primary);
  background: transparent; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.mod-reject:hover { border-color: var(--text-secondary); }
.mod-decide button:disabled { opacity: 0.6; cursor: progress; }
.mod-message-card { display: grid; gap: 12px; justify-items: start; padding-block: 24px; }

/* ------------------------------------------------------------ static page content
   What nginx includes before the app loads (backend/helpers/static_pages.py). */
/* The pre-rendered snapshot line takes the room the app's dropdowns will
   (one 44px row, two on phones), so nothing below it moves when they arrive.
   The landing preview's copy is a picture, so it keeps its own height. */
.provenance--static { margin-top: 8px; }
.static-page .provenance--static { display: flex; align-items: center; min-height: 44px; }
@media (max-width: 30em) { .static-page .provenance--static { min-height: 88px; align-items: flex-start; padding-top: 14px; } }
.static-list { display: grid; gap: 6px; margin-top: 12px; padding-left: 20px; }
.static-list--inline { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-left: 0; list-style: none; }

/* ------------------------------------------------------------ front page ("/")
   Drawn by the pipeline (static_pages.landing_body); the app shows the same file.
   Who we are on the left, a tour of the site on the right, one column on phones. */
.landing { display: grid; gap: 40px; padding-block: 40px 48px; }
@media (min-width: 960px) {
  .landing { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; align-items: start; }
  .landing-intro { padding-right: 40px; }
  .landing-tour { padding-left: 40px; border-left: 1px solid var(--border); }
}
.landing-intro, .landing-tour { display: grid; gap: 32px; align-content: start; min-width: 0; }
.landing-kicker, .landing-title, .landing-heading, .landing-subheading {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
}
.landing-kicker { font-size: 15px; line-height: 18px; letter-spacing: 0.04em; }
.landing-title { margin-top: 4px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: 0.01em; }
.landing-intro > .landing-kicker + .landing-title { margin-top: -28px; } /* kicker and title read as one block */
.landing-helmet { display: block; width: 100%; max-width: 520px; height: auto; }
/* Under the helmet: every class's standings and bracket, a button each. */
.landing-classes { display: grid; gap: 12px; max-width: 520px; }
.landing-classes__label {
  font-family: var(--font-display); font-size: 15px; line-height: 18px; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.landing-classes__list {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
  margin: 8px 0 0; padding: 0; list-style: none;
}
.landing-classes__item {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-primary); text-decoration: none;
  font-weight: 600; font-size: 15px;
}
.landing-classes__item:hover { background: var(--scrubber-selected-bg); color: var(--scrubber-selected-text); }
.landing-classes__item:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
/* One column (phones, small tablets): the welcome and the helmet sit centered;
   two columns keep them flush left with the text below. */
@media (max-width: 959px) {
  .landing-helmet { max-width: 280px; margin-inline: auto; }
  .landing-intro > .landing-kicker, .landing-intro > .landing-title { text-align: center; }
}
.landing-heading { font-size: 22px; line-height: 26px; letter-spacing: 0.02em; }
.landing-subheading { font-size: 17px; line-height: 22px; letter-spacing: 0.02em; }
.landing-section { display: grid; gap: 10px; min-width: 0; }
.landing-section > .landing-section { margin-top: 14px; }
.landing-section p, .landing-list { font-size: 16px; line-height: 24px; }
.landing-list { padding-left: 20px; list-style: disc; display: grid; gap: 2px; }
/* "Here's Class 5A as it stands right now:" before each example card. */
.landing-section .landing-lead { margin-top: 6px; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.landing-lead + .landing-preview { margin-top: 0; }
.landing-preview--class .region-blocks { margin-top: 18px; gap: 24px 48px; }
.landing-preview {
  display: block; margin-top: 8px; max-width: 40rem;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface-card); color: inherit; text-decoration: none;
}
.landing-preview:hover { border-color: var(--text-secondary); }
.landing-preview__frame { display: block; height: 250px; overflow: hidden; padding: 14px 16px 0; pointer-events: none; }
/* The region page at a little over half size. A transform (not zoom, which Safari and Chromium
   size differently) scales it; the width undoes the scale so it lands exactly at the frame's width,
   and the frame's fixed height crops it. */
.landing-preview__page { display: block; width: calc(100% / 0.55); transform: scale(0.55); transform-origin: top left; }
.landing-preview__page .title { font-size: 32px; line-height: 38px; }
/* The scenario previews' own text sizes, over the landing section's 16px paragraphs. */
.landing-preview--scenarios .section-title { font-size: 24px; line-height: 30px; }
/* The section starts just under the provenance line here (no standings table in between), and the
   sub-heading sits where the page's open fold puts it. */
.landing-preview--scenarios .section { margin-top: 28px; }
.landing-preview--scenarios .scenario-group > .sub-title { margin-bottom: 14px; }
.landing-preview--scenarios :is(.outcome__out, .outcome__if) { font-size: 13px; line-height: 18px; }
.landing-preview__label {
  display: block; padding: 10px 16px; border-top: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--link);
}
/* The bracket page in miniature: drawn at a fixed 1200px and scaled to fit, smaller on phones. */
.landing-preview--bracket { --bp-s: 0.45; }
@media (max-width: 640px) { .landing-preview--bracket { --bp-s: 0.25; } }
.landing-preview--bracket .landing-preview__frame { height: calc(735px * var(--bp-s) + 14px); }
.landing-preview--bracket .landing-preview__page { width: 1200px; transform: scale(var(--bp-s)); }
.bracket-preview {
  --line: color-mix(in srgb, var(--text-secondary) 50%, transparent);
  display: flex; align-items: flex-start; gap: 28px; margin-top: 18px;
}
.bracket-preview__tree { position: relative; flex: none; }
.bracket-preview__titles { position: relative; height: 28px; }
.bracket-preview__titles .tcol__title { position: absolute; top: 0; margin: 0; }
.bracket-preview__cols { position: relative; }
.bracket-preview__cols .tree__lines { top: 0; }
.bracket-preview__slot { position: absolute; display: block; }
.bracket-preview__sheet {
  display: flex; flex-direction: column; flex: none; width: 380px; max-height: none;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}
.landing-links a { margin-right: 10px; }

/* The team's Elo rating under its seeding odds (the expanded row). */
.detail__elo { margin-top: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.detail__elo-label { color: var(--text-secondary); }
.detail__elo + .detail__note { margin-top: 4px; font-size: 13px; line-height: 18px; }
