:root {
  --stock: #f7f6f2;
  --paper: #ffffff;
  --ink: #141414;
  --ink-2: #3f3d39;
  --ink-3: #66625b;
  --hair: #d6d2c9;
  --hair-soft: #e7e4dd;
  --red: #d22630;
  --red-deep: #a51b24;
  --red-ink: #b3202a;
  --navy: #0b2f5e;
  --win: #1d6b3a;

  --display: "Archivo", "Arial Narrow", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 62ch;
  --page: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: var(--paper); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

button, input, select { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.caps {
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; }

/* ── Issue strip ─────────────────────────────────────────────── */

.strip {
  background: var(--ink);
  color: var(--stock);
  font-size: 0.8125rem;
}
.strip .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 40px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-bottom: 6px;
}
.strip__date { font-stretch: 75%; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.strip__right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.strip a { text-decoration: none; font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.strip a:hover { text-decoration: underline; }
.strip a[aria-current="page"] { color: #ff9ea3; }
.strip__links { display: flex; align-items: center; gap: 16px; order: 2; }
.strip__logout { display: contents; }
.strip__log, .strip__logout button {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--stock);
  font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8125rem;
}
.strip__log:hover, .strip__logout button:hover { text-decoration: underline; }
.strip__log[aria-expanded="true"] { color: #ff9ea3; }


/* ── Masthead ────────────────────────────────────────────────── */

.masthead { background: var(--red); color: var(--paper); }
.masthead .wrap { padding-top: clamp(18px, 3vw, 28px); }
.masthead__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 32px;
  flex-wrap: wrap;
}
.masthead__title {
  font-size: clamp(3.25rem, 13vw, 6rem);
  font-weight: 900;
  font-stretch: 62%;
  line-height: 0.82;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: none;
  display: block;
}
.masthead__issue {
  text-align: right;
  padding-bottom: 4px;
  font-stretch: 75%;
  text-transform: uppercase;
  line-height: 1.05;
}
.masthead__issue b { display: block; font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; letter-spacing: 0.01em; }
.masthead__issue span { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; }

.tabs { display: flex; gap: 4px; margin-top: clamp(18px, 3vw, 26px); }
.tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 clamp(14px, 3vw, 24px);
  background: var(--red-deep);
  color: var(--paper);
  text-decoration: none;
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9375rem;
  transition: background-color 160ms var(--ease-out);
}
.tab:hover { background: #8e151d; }
.tab[aria-current="page"] { background: var(--stock); color: var(--ink); }

/* ── Main ────────────────────────────────────────────────────── */

main { padding-bottom: 96px; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}
.btn:hover { background: var(--ink); color: var(--stock); }
.btn--red { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn--red:hover { background: var(--red-deep); border-color: var(--red-deep); color: var(--paper); }
.btn--quiet { border-color: transparent; padding: 0 8px; }
.btn--quiet:hover { background: transparent; color: var(--ink); text-decoration: underline; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.spinner { position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; }
.htmx-request .spinner { animation: spin 0.7s linear infinite; }
.htmx-request .hide-on-load { opacity: 0; }
.htmx-request.btn, .htmx-request .btn { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Contents: round navigation ──────────────────────────────── */

.contents {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  padding: 36px 0 20px;
  border-bottom: 3px solid var(--ink);
}
.contents__prev, .contents__next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.contents__prev:hover, .contents__next:hover { color: var(--red-ink); }
.contents__next { justify-self: end; }
.contents__round { text-align: center; }
.contents__round h1 {
  font-size: clamp(2.75rem, 9vw, 5rem);
  font-weight: 900;
  font-stretch: 62%;
  line-height: 0.9;
  text-transform: uppercase;
}
.contents__state { margin-top: 6px; color: var(--ink-3); }
.contents__state--current { color: var(--red-ink); }
.contents__state--upcoming { color: var(--navy); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
}
.toolbar__synced { color: var(--ink-3); font-size: 0.8125rem; }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.notice {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 10px 0;
  margin-bottom: 8px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-2);
}

/* ── Round index ─────────────────────────────────────────────── */

.index { padding: 6px 0 4px; border-bottom: 1px solid var(--ink); }
.index ol { list-style: none; margin: 0; padding: 0; }
.index li + li { border-top: 1px solid var(--hair-soft); }
.index a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  text-decoration: none;
  min-height: 36px;
}
.index a:hover .index__match { color: var(--red-ink); }
.index__match { font-stretch: 75%; font-weight: 700; font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.02em; min-width: 0; }
.index__match i { font-family: var(--serif); font-weight: 400; text-transform: none; color: var(--ink-3); padding: 0 2px; }
.index__leader { flex: 1; min-width: 16px; border-bottom: 1px dotted var(--ink-3); transform: translateY(-4px); }
.index__tip {
  display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap;
  font-stretch: 62%; font-weight: 900; font-size: 1.125rem; text-transform: uppercase;
}
.index__tip b { font-stretch: 75%; font-weight: 700; font-size: 0.875rem; color: var(--ink-3); }
.index__tip--wrong { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.index__tip--none { font-stretch: 75%; font-weight: 600; font-size: 0.8125rem; color: var(--ink-3); }
.index__mark { align-self: center; display: inline-grid; }
.index__mark--right { color: var(--win); }
.index__mark--wrong { color: var(--red-ink); }

/* ── Round scoreline ─────────────────────────────────────────── */

.scoreline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
  padding: 14px 0 18px;
}
.scoreline__big { font-size: clamp(2.5rem, 7vw, 3.5rem); font-weight: 900; font-stretch: 62%; line-height: 0.9; }
.scoreline__big small { font-size: 0.5em; font-weight: 700; color: var(--ink-3); }
.scoreline__meta { color: var(--ink-2); font-size: 0.9375rem; }
.scoreline__meta b { font-weight: 800; }

/* ── Game pages ──────────────────────────────────────────────── */

.games { display: block; }

.game {
  border-top: 3px solid var(--ink);
  padding: 22px 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px clamp(24px, 5vw, 64px);
}
.games > .game:first-child { border-top-width: 0; }

.game__line { color: var(--ink-3); font-size: 0.875rem; margin-top: 12px; }
.sheet { min-width: 0; }
.sheet .team-news { margin-top: 22px; }
.sheet .team-news ul { list-style: none; margin: 0; padding: 0; }
.sheet .team-news h3 {
  font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.8125rem; padding-bottom: 6px; border-bottom: 1px solid var(--hair); margin-bottom: 6px;
}
.sheet .team-news li {
  font-family: var(--serif); font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2);
  padding: 6px 0 6px 18px; position: relative; border-bottom: 1px solid var(--hair-soft);
}
.sheet .team-news li::before { content: ""; position: absolute; left: 0; top: 0.9em; width: 7px; height: 7px; background: var(--navy); }

.side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
.side + .v { margin: 2px 0; }
.side__name {
  font-size: clamp(1.75rem, 4.6vw, 2.75rem);
  font-weight: 900;
  font-stretch: 62%;
  line-height: 0.95;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 10px;
  overflow-wrap: anywhere;
}
.side__name .icon { width: 0.55em; height: 0.55em; color: var(--win); }
.side__score { font-size: clamp(1.75rem, 4.6vw, 2.75rem); font-weight: 900; font-stretch: 62%; line-height: 0.95; }
.side--lost .side__name, .side--lost .side__score { color: var(--ink-3); }
.v { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 1rem; }

.result-line { margin-top: 12px; display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.live-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy); color: var(--paper);
  padding: 3px 8px;
}
.live-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* Prices */
.prices { margin-top: 18px; border-top: 1px solid var(--hair); }
.prices summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0 6px;
}
.prices summary::-webkit-details-marker { display: none; }
.prices__price { font-weight: 800; font-stretch: 75%; font-size: 1.25rem; }
.prices__pct { color: var(--ink-3); font-size: 0.8125rem; margin-left: 4px; }
.prices__away { text-align: right; }
.prices__fav { color: var(--ink); }
.prices__out .prices__price { color: var(--ink-3); font-weight: 600; }
.prices__mid { color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.prices__mid .icon { transition: transform 200ms var(--ease-out); }
.prices[open] .prices__mid .icon { transform: rotate(90deg); }
.prices table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin-top: 4px; }
.prices th { text-align: right; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.prices th:first-child, .prices td:first-child { text-align: left; }
.prices td { text-align: right; padding: 4px 0; border-top: 1px solid var(--hair-soft); color: var(--ink-3); }
.prices td.fav { color: var(--ink); font-weight: 700; }
.prices--loading { margin-top: 18px; color: var(--ink-3); font-size: 0.8125rem; }

/* Preview column */
.preview { min-width: 0; }

.call {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border: 2px solid var(--ink);
}
.call__label { color: #b9b5ac; }
.call__team {
  font-size: clamp(1.375rem, 3.4vw, 2rem);
  font-weight: 900;
  font-stretch: 62%;
  text-transform: uppercase;
  line-height: 1;
  overflow-wrap: anywhere;
}
.call__conf { text-align: right; font-size: clamp(1.375rem, 3.4vw, 2rem); font-weight: 900; font-stretch: 62%; line-height: 1; }
.call__conf small { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; color: #b9b5ac; margin-top: 3px; }
.call--wrong { background: transparent; color: var(--ink); }
.call--wrong .call__team { text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--red); }
.call--wrong .call__label, .call--wrong .call__conf small { color: var(--ink-3); }

.verdict { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 800; }
.verdict--right { color: var(--win); }
.verdict--wrong { color: var(--red-ink); }

.byline { margin-top: 10px; color: var(--ink-3); font-size: 0.8125rem; }

.lede {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: var(--measure);
  margin-top: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.empty-preview { font-family: var(--serif); font-style: italic; color: var(--ink-3); margin-bottom: 16px; }

/* Expanded preview */
.feature { margin-top: 22px; max-width: var(--measure); animation: unfold 520ms var(--ease-out) both; }
@keyframes unfold {
  from { clip-path: inset(0 0 100% 0); opacity: 0; transform: translateY(-6px); }
  to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; }
}
.feature section + section { margin-top: 26px; }
.feature h3 {
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8125rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 10px;
}
.feature ul { list-style: none; margin: 0; padding: 0; }
.feature li {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
  padding: 6px 0 6px 18px;
  position: relative;
  border-bottom: 1px solid var(--hair-soft);
}
.feature li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 7px;
  height: 7px;
  background: var(--red);
}
.feature .data li::before { background: var(--ink-3); }
.team-news { border: 2px solid var(--ink); padding: 12px 16px; background: var(--paper); }
.team-news li:last-child { border-bottom: 0; }
.reasoning p {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
}
.reasoning p + p { margin-top: 0.9em; }
.reasoning h3 + p::first-letter,
.reasoning h3 + .retip + p::first-letter,
.reasoning h3 + .panel-summary + p::first-letter,
.reasoning h3 + .retip + .panel-summary + p::first-letter {
  float: left;
  font-family: var(--display);
  font-stretch: 62%;
  font-weight: 900;
  font-size: 3.6em;
  line-height: 0.82;
  padding: 4px 8px 0 0;
  color: var(--red);
}

.game--error .preview { color: var(--red-ink); }
.error-text { font-family: var(--serif); color: var(--red-ink); margin-bottom: 14px; }

/* Empty / loading round */
.blank { text-align: center; padding: 80px 0; }
.blank h2 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 900; font-stretch: 62%; text-transform: uppercase; }
.blank p { font-family: var(--serif); font-style: italic; color: var(--ink-3); margin-top: 8px; }
.rule-loader { width: 120px; height: 3px; background: var(--hair); margin: 0 auto 20px; overflow: hidden; position: relative; }
.rule-loader::after {
  content: ""; position: absolute; inset: 0; width: 40%; background: var(--red);
  animation: slide 1.1s var(--ease-out) infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ── Page turn on round change ───────────────────────────────── */

#round-view.htmx-swapping > * { opacity: 0; transition: opacity 140ms ease-in; }
#round-view[data-dir] > .round { animation: turn-next 460ms var(--ease-out) both; }
#round-view[data-dir="prev"] > .round { animation-name: turn-prev; }
@keyframes turn-next {
  from { clip-path: inset(0 0 0 100%); transform: translateX(24px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes turn-prev {
  from { clip-path: inset(0 100% 0 0); transform: translateX(-24px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

/* ── Cover (off-season, Horses) ──────────────────────────────── */

.cover {
  min-height: calc(100vh - 260px);
  display: grid;
  place-items: center;
  padding: 56px 0;
  text-align: center;
}
.cover__frame { border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); padding: 28px clamp(8px, 4vw, 48px) 32px; max-width: 900px; }
.cover h1 { text-transform: uppercase; font-stretch: 62%; font-weight: 900; line-height: 0.86; }
.cover__lead { display: block; font-size: clamp(1.5rem, 5vw, 2.5rem); font-weight: 800; letter-spacing: 0.02em; }
.cover__big { display: block; font-size: clamp(4rem, 16vw, 9.5rem); margin-top: 6px; }
.cover__big em { font-style: normal; color: var(--red); }
.cover p { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 1.125rem; margin-top: 20px; }

/* ── Sources ─────────────────────────────────────────────────── */

.page-head { padding: 36px 0 18px; border-bottom: 3px solid var(--ink); display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); font-weight: 900; font-stretch: 62%; line-height: 0.9; text-transform: uppercase; }
.page-head p { color: var(--ink-3); }

.table-scroll { overflow-x: auto; margin-bottom: 48px; }
.ledger { width: 100%; border-collapse: collapse; min-width: 720px; }
.ledger th {
  text-align: left;
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--ink-2);
  padding: 12px 12px 8px 0;
  border-bottom: 1px solid var(--ink);
}
.ledger td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hair); vertical-align: top; font-size: 0.875rem; }
.ledger tr:hover td { background: var(--paper); }
.ledger__name { font-weight: 800; font-stretch: 75%; font-size: 1rem; }
.ledger__desc { font-family: var(--serif); color: var(--ink-3); margin-top: 2px; font-size: 0.875rem; }
.ledger__url { color: var(--navy); display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__type { color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.75rem; }
.status--ok { color: var(--win); }
.status--error { color: var(--red-ink); cursor: help; }
.status--unknown { color: var(--ink-3); }
.ledger__error td { color: var(--red-ink); font-family: var(--serif); }

.tick-box {
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--paper);
  cursor: pointer;
  padding: 0;
}
.tick-box[aria-pressed="true"] { background: var(--ink); }
.tick-box .icon { width: 16px; height: 16px; }
.link-remove { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--red-ink); font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; }
.link-remove:hover { text-decoration: underline; }

.form-block { border-top: 3px solid var(--ink); padding-top: 18px; }
.form-block h2 { font-size: 1.75rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; max-width: 760px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  padding: 8px 10px;
  font-size: 1rem;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus, .field select:focus { outline: none; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }

/* ── Startup overlay ─────────────────────────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(247, 246, 242, 0.94);
  display: grid; place-items: center; text-align: center;
}
.overlay h2 { font-size: 2rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; }
.overlay p { font-family: var(--serif); font-style: italic; color: var(--ink-3); margin-top: 6px; }

/* ── Log sheet ───────────────────────────────────────────────── */

.log-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 380ms var(--ease-out), visibility 0s linear 380ms;
  box-shadow: 0 -8px 24px rgba(20, 20, 20, 0.18);
}
.log-sheet.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.log-sheet__head {
  background: var(--ink);
  color: var(--stock);
  border-top: 4px solid var(--red);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px var(--gutter);
  cursor: pointer;
  user-select: none;
}
.log-sheet__title { display: flex; align-items: center; gap: 10px; }
.log-sheet__live { width: 7px; height: 7px; border-radius: 50%; background: #7fd39a; animation: blink 1.4s ease-in-out infinite; }
.log-sheet__live[hidden] { display: none; }
.log-sheet__head button { background: none; border: 0; color: #b9b5ac; cursor: pointer; padding: 4px 8px; }
.log-sheet__head button:hover { color: var(--stock); }
.log-sheet__body {
  background: #1b1a18;
  color: #e9e6df;
  height: min(18rem, 50vh);
  overflow-y: auto;
  padding: 14px var(--gutter);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  scrollbar-color: #4a4843 #1b1a18;
}
.log-sheet__body ::selection { background: var(--stock); color: var(--ink); }
.log--muted { color: #8e8a82; }
.log--info { color: #b9b5ac; }
.log--fetch { color: #9fc3e6; }
.log--ai { color: #f7f6f2; }
.log--error { color: #ff9ea3; }
.log--done { color: #f2c94c; }

/* ── Race book (Horses) ──────────────────────────────────────── */

.racebook__sync { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.racebook__error { margin: 16px 0 0; }
.notice--warn { color: var(--red-ink); border-color: var(--red-ink); font-style: normal; }
.notice--warn a { color: inherit; }

.racebook .page-head h1 span { font-weight: 700; font-stretch: 75%; font-size: 0.4em; letter-spacing: 0.04em; color: var(--ink-3); margin-left: 8px; }

.weekend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "meets features" "rest rest"; gap: 0 clamp(24px, 5vw, 64px); padding: 14px 0 22px; border-bottom: 3px solid var(--ink); }
.weekend ul { list-style: none; margin: 0; padding: 0; }
.weekend__meets { grid-area: meets; }
.weekend__features { grid-area: features; }
.weekend__rest, .weekend__none { grid-area: rest; }
.weekend li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hair-soft); font-size: 0.875rem; color: var(--ink-3); }
.weekend li a { text-decoration: none; color: var(--ink); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; min-width: 0; }
.weekend li a:hover b { color: var(--red-ink); }
.weekend li b { font-weight: 800; font-size: 1rem; }
.weekend li > span { text-align: right; flex-shrink: 0; }
.weekend__features li a { text-transform: none; font-stretch: 100%; }
.weekend__features li b { font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.weekend__features li a span { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 0.75rem; color: var(--red-ink); letter-spacing: 0.04em; margin-left: 4px; }
.weekend__none, .weekend__rest { font-family: var(--serif); font-style: italic; color: var(--ink-3); margin-top: 10px; font-size: 0.9375rem; }

/* Multis: the experts' ticket on paper, the AI's reversed in ink like the call plate */
.multis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; padding: 22px 0 8px; }
.multi { border: 2px solid var(--ink); padding: 14px 18px 18px; background: var(--paper); min-width: 0; }
.multi--ai { background: var(--ink); color: var(--paper); }
.multi--value { border-color: var(--red); }
.multi--value .multi__head h3 { color: var(--red-ink); }
.multi__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid currentColor; }
.multi__head h3 { font-size: 1.375rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; }
.multi__price { white-space: nowrap; }
.multi__price .caps { color: var(--ink-3); }
.multi--ai .multi__price .caps { color: #b9b5ac; }
.multi__price b { font-size: 1.75rem; font-weight: 900; font-stretch: 62%; margin-left: 4px; }
.multi__legs { list-style: none; margin: 0; padding: 0; }
.multi__legs li { display: grid; grid-template-columns: minmax(0, 1fr) auto 1.25em; grid-template-areas: "race race race" "horse odds mark"; column-gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair-soft); align-items: baseline; }
.multi--ai .multi__legs li { border-color: #3f3d39; }
.multi__race { grid-area: race; font-size: 0.75rem; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); text-decoration: none; }
.multi--ai .multi__race { color: #b9b5ac; }
.multi__race:hover { text-decoration: underline; }
.multi__horse { grid-area: horse; font-size: 1.25rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: 1.05; overflow-wrap: anywhere; }
.multi__horse i, .pick__horse i { font-style: normal; font-stretch: 75%; font-weight: 700; font-size: 0.75em; margin-right: 2px; opacity: 0.7; }
.multi__odds { grid-area: odds; font-weight: 800; font-stretch: 75%; }
.multi__mark { grid-area: mark; display: inline-grid; align-self: center; }
.multi__legs li.is-lost .multi__horse { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.multi__note { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 0.9375rem; margin-top: 12px; }
.multi--ai .multi__note { color: #b9b5ac; }
.multi .btn { margin-top: 14px; }
.autotip { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 10px; border-top: 1px solid #3f3d39; }
.autotip p { font-family: var(--serif); font-size: 0.875rem; color: #b9b5ac; flex: 1 1 200px; }
.multi .autotip .btn { margin-top: 0; color: var(--paper); }
.panel-summary { font-family: var(--serif); font-style: italic; color: var(--ink-2); margin-bottom: 10px; }
.discussion { margin-top: 14px; border-top: 1px solid var(--hair); padding-top: 8px; }
.discussion summary { cursor: pointer; font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8125rem; min-height: 32px; display: flex; align-items: center; }
.discussion summary:hover { color: var(--red-ink); }
.discussion ol { list-style: none; margin: 4px 0 0; padding: 0; }
.discussion li { padding: 6px 0; border-bottom: 1px solid var(--hair-soft); }
.discussion li > b { font-size: 0.6875rem; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.discussion li p { margin: 4px 0 0; font-family: var(--display); font-size: 0.875rem; line-height: 1.4; }
.discussion__who { font-weight: 800; font-stretch: 75%; text-transform: uppercase; }
.discussion__pick { font-weight: 600; }
.discussion__said { display: block; font-family: var(--serif); font-size: 0.9375rem; color: var(--ink-2); margin-top: 2px; }
.retip { margin-bottom: 8px; font-family: var(--display); font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8125rem; color: var(--red-ink); }
.multi--ai .verdict--right { color: #7fd19b; }
.multi--ai .verdict--wrong { color: #ff9ea3; }
.multi--ai .pick__mark--won { color: #7fd19b; }
.multi--ai .pick__mark--lost { color: #ff9ea3; }

/* One meeting at a time; the strip sticks so switching venue never needs a scroll back up. */
.venues { position: sticky; top: 0; z-index: 5; margin-top: 26px; background: var(--stock); border-bottom: 3px solid var(--ink); }
.venues__list { display: flex; overflow-x: auto; scrollbar-width: none; }
.venues__list::-webkit-scrollbar { display: none; }
.venue-tab { flex: 1 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 16px 7px; background: none; border: 0; border-right: 1px solid var(--hair); color: var(--ink); cursor: pointer; text-align: left; transition: background-color 160ms var(--ease-out); }
.venue-tab:last-child { border-right: 0; }
.venue-tab b { font-size: 1.1875rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.venue-tab span { font-size: 0.6875rem; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); white-space: nowrap; }
.venue-tab:hover { background: var(--paper); }
.venue-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.venue-tab[aria-selected="true"] span { color: #b9b5ac; }
.venue-tab:focus-visible { outline: 2px solid var(--red); outline-offset: -4px; }

.meeting { padding-top: 18px; }
.meeting__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.meeting__head h3 { font-size: clamp(1.75rem, 4.6vw, 2.75rem); font-weight: 900; font-stretch: 62%; line-height: 0.95; text-transform: uppercase; }
.meeting__head p { color: var(--ink-3); font-size: 0.875rem; margin-top: 4px; }
.meeting .notice { margin-top: 14px; }

.races { list-style: none; margin: 0; padding: 0; }
.race { border-bottom: 1px solid var(--hair); }
.race__row { display: grid; grid-template-columns: 64px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; }
.race__no b { display: block; font-size: 1.75rem; font-weight: 900; font-stretch: 62%; line-height: 0.9; }
.race__no span { font-size: 0.8125rem; color: var(--ink-3); }
.race__name h4 { margin: 0; font-size: 1rem; font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.2; }
.race__name p { font-size: 0.8125rem; color: var(--ink-3); margin-top: 2px; }
.race__name .race__result { color: var(--ink-2); }
.race__result b { font-weight: 800; }
.race--abandoned .race__no, .race--abandoned .race__name { color: var(--ink-3); }
.race--abandoned .race__name h4 { text-decoration: line-through; text-decoration-color: var(--ink-3); }

.pick { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label mark" "horse mark" "meta mark"; column-gap: 8px; padding: 8px 12px; border: 2px solid var(--ink); min-height: 72px; align-content: center; min-width: 0; }
.pick--experts { background: var(--paper); }
.pick--ai { background: var(--ink); color: var(--paper); }
.pick__label { grid-area: label; font-size: 0.6875rem; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.pick--ai .pick__label { color: #b9b5ac; }
.pick__horse { grid-area: horse; font-size: 1.1875rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: 1.05; overflow-wrap: anywhere; }
.pick__meta { grid-area: meta; font-size: 0.75rem; color: var(--ink-3); margin-top: 2px; }
.pick--ai .pick__meta { color: #b9b5ac; }
.pick__mark { grid-area: mark; align-self: center; display: inline-grid; font-size: 1.25rem; }
.pick__mark--won { color: var(--win); }
.pick__mark--lost { color: var(--red-ink); }
.pick--lost .pick__horse { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.pick--ai.pick--lost { background: transparent; color: var(--ink); }
.pick--ai.pick--lost .pick__label, .pick--ai.pick--lost .pick__meta { color: var(--ink-3); }
.pick--empty, .pick--waiting { background: transparent; color: var(--ink); border-style: dashed; border-color: var(--hair); }
.pick--empty .pick__label, .pick--waiting .pick__label { color: var(--ink-3); }
.pick__none { grid-area: horse; font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 0.9375rem; }
.pick--waiting .pick__none { color: var(--navy); }
.pick__error { grid-area: meta; font-family: var(--serif); color: var(--red-ink); font-size: 0.8125rem; }
.pick .btn { grid-area: horse; justify-self: start; min-height: 34px; margin-top: 2px; }

button.pick { font: inherit; text-align: left; width: 100%; cursor: pointer; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.pick--experts.pick--toggle:hover { background: var(--stock); border-color: var(--red-ink); }
.pick--toggle .pick__label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pick__more { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); white-space: nowrap; }
.pick__more .icon { transition: transform 200ms var(--ease-out); }
.pick--toggle[aria-expanded="true"] .pick__more .icon { transform: rotate(90deg); }
.pick--toggle:hover .pick__more { color: var(--red-ink); }

.race__tips { padding: 4px 0 22px 78px; animation: unfold 420ms var(--ease-out) both; }
.race__tips[hidden] { display: none; }
.tipsters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: clamp(20px, 3vw, 36px); }
.tipsters > li { padding: 10px 0 12px; border-top: 1px solid var(--hair); }
.tipsters__who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.tipsters__who b { font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; }
.tipsters__who > span:not(.tag) { font-size: 0.75rem; color: var(--ink-3); }
.tipsters__picks { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: pick; }
.tipsters__picks li { counter-increment: pick; display: flex; align-items: baseline; gap: 6px; padding: 2px 0; font-size: 0.875rem; color: var(--ink-2); }
.tipsters__picks li::before { content: counter(pick); width: 1.1em; flex-shrink: 0; font-size: 0.6875rem; font-weight: 700; font-stretch: 75%; color: var(--ink-3); }
.tipsters__picks i { font-style: normal; font-weight: 900; font-stretch: 62%; font-size: 1.0625rem; min-width: 1.3em; color: var(--ink); }
.tipsters__picks li.is-consensus { color: var(--ink); font-weight: 700; }
.tipsters__picks li.is-winner { box-shadow: inset 3px 0 0 var(--win); padding-left: 6px; margin-left: -6px; }
.tipsters__note { font-family: var(--serif); font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); margin-top: 6px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; cursor: pointer; }
.tipsters__note.is-open { -webkit-line-clamp: unset; }
.tag--note { border: 1px solid var(--red-ink); color: var(--red-ink); margin-left: 0; text-transform: uppercase; }

.race__toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer; font-stretch: 75%; font-weight: 800; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
.race__toggle:hover { color: var(--red-ink); }
.race__toggle .icon { transition: transform 200ms var(--ease-out); }
.race__toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }

.race__form { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(24px, 4vw, 48px); padding: 6px 0 26px 78px; animation: unfold 420ms var(--ease-out) both; }
.race__form[hidden] { display: none; }
.race__form h3 { font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8125rem; padding-bottom: 6px; border-bottom: 1px solid var(--ink); margin-bottom: 10px; }
.race__form section + section { margin-top: 24px; }
.race__read { max-width: var(--measure); }
.race__read .reasoning p { font-size: 1rem; }
.race__read .byline { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.race__read .byline .btn { min-height: 32px; font-size: 0.75rem; }
.race__comment p { font-family: var(--serif); color: var(--ink-2); line-height: 1.6; }
.factors { list-style: none; margin: 14px 0 0; padding: 0; }
.factors li { font-family: var(--serif); font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); padding: 5px 0 5px 18px; position: relative; border-bottom: 1px solid var(--hair-soft); }
.factors li::before { content: ""; position: absolute; left: 0; top: 0.9em; width: 7px; height: 7px; background: var(--red); }

.race__tables .table-scroll { margin-bottom: 0; }
.field-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.field-table th { text-align: left; font-size: 0.6875rem; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 0 10px 6px 0; }
.field-table td { padding: 7px 10px 7px 0; border-top: 1px solid var(--hair-soft); vertical-align: top; }
.field-table__no { font-weight: 900; font-stretch: 62%; font-size: 1.0625rem; }
.field-table td small { display: block; font-weight: 400; font-stretch: 100%; color: var(--ink-3); font-size: 0.75rem; }
.field-table__horse { font-weight: 800; font-stretch: 75%; text-transform: uppercase; }
.field-table__form { font-stretch: 75%; letter-spacing: 0.04em; }
.field-table tr.is-scratched td { color: var(--ink-3); }
.field-table tr.is-scratched .field-table__horse { text-decoration: line-through; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 5px; font-size: 0.625rem; font-weight: 800; font-stretch: 75%; letter-spacing: 0.06em; vertical-align: 1px; }
.tag--ai { background: var(--ink); color: var(--paper); }

/* Track record */
.tally-intro { font-family: var(--serif); color: var(--ink-2); max-width: var(--measure); margin-top: 16px; }
.tally-intro a { color: var(--red-ink); }
.tally-block { margin-top: 32px; }
.tally-block .table-scroll { margin-bottom: 0; }
.tally-block h3 { font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.875rem; padding-bottom: 6px; border-bottom: 3px solid var(--ink); }
.tally-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 clamp(24px, 4vw, 48px); }
.tally { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.tally th { text-align: right; font-size: 0.6875rem; font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 10px 0 6px 14px; white-space: nowrap; }
.tally td { text-align: right; padding: 9px 0 9px 14px; border-bottom: 1px solid var(--hair-soft); white-space: nowrap; }
.tally th:first-child, .tally td:first-child { text-align: left; padding-left: 0; }
.tally__name { font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; white-space: normal !important; }
.tally__name small { display: block; font-weight: 400; font-stretch: 100%; text-transform: none; letter-spacing: 0; color: var(--ink-3); font-size: 0.75rem; }
.tally__baseline td { color: var(--ink-3); }
.tally .is-up { color: var(--win); font-weight: 700; }
.tally .is-down { color: var(--red-ink); }
.tally-note, .tally-empty { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 0.9375rem; margin-top: 10px; }

/* Login */
.login .masthead { padding-bottom: clamp(18px, 3vw, 28px); }
.login__form { max-width: 420px; margin: clamp(36px, 8vw, 72px) 0; padding-top: 18px; border-top: 3px solid var(--ink); }
.login__form h1 { font-size: clamp(2.5rem, 8vw, 3.5rem); font-weight: 900; font-stretch: 62%; line-height: 0.9; text-transform: uppercase; }
.login__form > p { font-family: var(--serif); color: var(--ink-2); margin: 10px 0 22px; }
.login__form .field input { width: 100%; }
.login__form .error-text { margin-top: 12px; color: var(--red-ink); }
.login__form .btn { margin-top: 18px; min-height: 44px; }

/* ── Responsive ──────────────────────────────────────────────── */

@media (min-width: 761px) {
  .sheet { position: sticky; top: 16px; align-self: start; }
}

@media (max-width: 760px) {
  .round { display: flex; flex-direction: column; }
  .sheet { display: contents; }
  .preview { order: 1; }
  .sheet .team-news { order: 2; margin-top: 0; }
  .round > .toolbar { order: 10; border-top: 3px solid var(--ink); }
  .strip__links { order: 0; width: 100%; justify-content: flex-end; }
  .index__match { font-size: 0.8125rem; }
  .index a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
  .index__leader { display: none; }
  .index__tip { font-size: 1rem; }
  .game { grid-template-columns: minmax(0, 1fr); }
  .masthead__issue { text-align: left; }
  .contents { padding-top: 24px; }
  .contents__prev span, .contents__next span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .tab { flex: 1; justify-content: center; padding: 0 8px; }
  .strip__date { display: none; }
  .strip .wrap { justify-content: flex-end; }
  .strip__right { justify-content: flex-end; }
  .weekend { grid-template-columns: minmax(0, 1fr); grid-template-areas: "meets" "features" "rest"; }
  .weekend__features { margin-top: 14px; }
  /* Column two is sized so the two pick plates split the row evenly beneath the race number and name. */
  .race__row { grid-template-columns: 52px calc(50% - 67px) minmax(0, 1fr); grid-template-areas: "no name name" "experts experts ai" "toggle toggle toggle"; gap: 10px; }
  .race__no { grid-area: no; align-self: start; }
  .race__name { grid-area: name; }
  .race__row > .pick--experts { grid-area: experts; }
  .race__row > .pick--ai { grid-area: ai; }
  .race__toggle { grid-area: toggle; justify-self: start; min-height: 40px; }
  .race__form { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .race__tips { padding-left: 0; }
  .tally__opt { display: none; }
  .tally th, .tally td { padding-left: 10px; }
}

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