:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --fill: #2563eb;
  --fill-hover: #1d4ed8;
  --tint: #eff6ff;
  --hero-muted: #dbeafe;
  --on-accent: #f8fafc;
  --appbar-h: 56px;
  --tabbar-h: 62px;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --nav: #ffffff;
  --ink: #0f172a;
  --body: #0f172a;
  --muted: #64748b;
  --disabled: #94a3b8;
  --line: #e2e8f0;
  --hover: #eff6ff;
  --live-row: #eff6ff;
  --chip: #f1f5f9;
  --face: #e2e8f0;
  --selected: #eff6ff;
  --warn: #dc2626;
  --ok: #16a34a;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  --nav-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  --radius: 12px;
}

html { font-size: 100%; }
html[data-size="system"] { font-size: 100%; }
html[data-size="sm"] { font-size: 14px; }
html[data-size="md"] { font-size: 16px; }
html[data-size="lg"] { font-size: 18.5px; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #8aa3bd;
  --primary-dark: #9bb4cc;
  --fill: #3a5070;
  --fill-hover: #4a6386;
  --tint: #1c2738;
  --hero-muted: #9aabc0;
  --on-accent: #c4cedb;
  --bg: #121621;
  --surface: #1c2333;
  --nav: #171d2b;
  --ink: #b8c2ce;
  --body: #b8c2ce;
  --muted: #8b97a8;
  --disabled: #6b7684;
  --line: #2a3344;
  --hover: #1c2738;
  --live-row: #1c2738;
  --chip: #243044;
  --face: #243044;
  --selected: #1c2738;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  --nav-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: auto;
  text-size-adjust: auto;
  touch-action: manipulation;
}
html[data-size="sm"],
html[data-size="md"],
html[data-size="lg"] {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: Roboto, "Noto Sans TC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-underline-offset: 3px; touch-action: manipulation; }
button, summary, label { touch-action: manipulation; }
.appbar,
.appbar a,
.appbar button,
.tabbar,
.tabbar a,
.learn-tabs,
.learn-tabs a,
.style-switch {
  touch-action: manipulation;
}
a:hover { color: var(--primary-dark); }

.appbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.15rem;
  height: var(--appbar-h);
  background: var(--nav);
  color: var(--ink);
  box-shadow: var(--nav-shadow);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
.appbar .mark {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-size: 1.18rem;
}
.appbar .mark-ico {
  display: block;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: #121621;
}
.appbar .mark-word { display: inline; }
.appbar .mark-e { color: var(--primary); }
.appbar-tools {
  display: flex;
  align-items: center;
  gap: 0.05rem;
  margin-right: -0.2rem;
}

main { flex: 1; padding: 1.2rem 6vw calc(var(--tabbar-h) + 2.4rem); max-width: 920px; width: 100%; margin: 0 auto; view-transition-name: ht-main; }
body.page-race { overscroll-behavior-x: contain; }
.crumb { font-size: 0.82rem; color: var(--muted); }
.kicker {
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--hero-muted);
  margin: 0 0 0.4rem;
}

.hero {
  display: block;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--fill);
  padding: 1.7rem 1.4rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}
a.hero {
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}
a.hero:hover,
a.hero:focus-visible {
  filter: brightness(1.08);
}
a.hero:active {
  transform: scale(0.985);
}
.hero h1 { margin: 0 0 0.45rem; font-size: 1.6rem; line-height: 1.3; color: var(--on-accent); }
.hero p { margin: 0; color: var(--hero-muted); }
.hero-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.95rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.16);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--on-accent);
}
.hero-meta { margin-top: 0.65rem !important; font-size: 0.82rem; color: var(--hero-muted) !important; }
.hero.idle { background: #475569; }
.meet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.85rem;
  margin: 0 0 0.45rem;
}
.hero .meet-head h1 { margin: 0; }
.meet-count {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hero-muted);
  white-space: nowrap;
}
.hero .meet-lede {
  margin: 0.1rem 0 0.7rem;
  color: var(--hero-muted);
  line-height: 1.55;
}
.meet-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0;
}
.hero .meet-jumps a {
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.hero .meet-jumps a:hover { text-decoration: underline; }
.hero .meet-jumps a.is-done { opacity: 0.48; }

.race-jumps {
  margin-top: 0.95rem;
}
.race-jumps a {
  text-decoration: none;
  font-weight: 700;
  color: var(--muted);
  background: var(--chip);
  padding: 0.4rem 0.72rem;
  border-radius: 10px;
  font-size: 0.88rem;
}
html[data-size="sm"] .race-jumps {
  flex-wrap: nowrap;
  gap: 0.2rem;
}
html[data-size="sm"] .race-jumps a {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.28rem 0.06rem;
  font-size: 0.72rem;
  text-align: center;
  white-space: nowrap;
}
.race-jumps a.on {
  background: var(--fill);
  color: var(--on-accent);
}
.race-jumps a:hover { color: var(--primary-dark); }
.race-jumps a.on:hover { color: var(--on-accent); }
.race-jumps a.is-done { opacity: 0.48; }

.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.05rem 1.1rem 1rem;
  margin: 0 0 1rem;
}
.panel h2, .card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.panel h2::before, .card h2::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.9rem;
  background: var(--fill);
  border-radius: 2px;
  margin-right: 0.45rem;
  vertical-align: -0.1rem;
}

.race-nav {
  position: sticky;
  top: 56px;
  z-index: 20;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 6vw;
}
.chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: 0 0 auto;
  text-decoration: none;
  background: var(--bg);
  color: var(--muted);
  padding: 0.38rem 0.8rem;
  font-size: 1em;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}
.chips a.chip-hub {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg);
  box-shadow: -0.6rem 0 0 0.55rem var(--nav), 0.45rem 0 0.5rem -0.15rem var(--nav);
}
.chip-race {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 3.85rem;
  padding: 0.28rem 0.42rem !important;
  line-height: 1.15;
  font-size: 1rem;
}
.chip-race span {
  font-size: 0.8em;
  font-weight: 500;
  color: inherit;
  opacity: 0.78;
}
.chip-race.is-done {
  opacity: 0.48;
}
html[data-size="md"] .chip-race,
html[data-size="system"] .chip-race {
  min-width: 4.2rem;
  padding: 0.32rem 0.58rem !important;
}
html[data-size="lg"] .chip-race {
  min-width: 5.1rem;
  padding: 0.38rem 0.72rem !important;
}
.chips a.on { background: var(--fill); color: var(--on-accent); opacity: 1; }
.chips a:hover { color: var(--primary-dark); }
.chips a.on:hover { color: var(--on-accent); }

.index { list-style: none; padding: 0; margin: 0; }
.index li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.index span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.empty, .empty-verdict { color: var(--muted); }

.lede { color: var(--muted); margin: 0; line-height: 1.7; letter-spacing: 0.5px; }

.focus-row, .badge-list {
  --badge-gap: 0.35em;
  display: flex;
  gap: var(--badge-gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}
.focus-row::-webkit-scrollbar, .badge-list::-webkit-scrollbar { display: none; }
.badge-card {
  flex: 0 0 auto;
  width: auto;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.38em 0.45em;
  background: var(--chip);
}
.badge-value,
.badge-compact {
  --badge-num: 1.7em;
  --badge-name: 4.1em;
  display: grid;
  grid-template-columns: var(--badge-num) var(--badge-name);
  column-gap: 0.16em;
  row-gap: 0.1em;
  align-items: center;
}
.badge-value {
  padding: 0.42em 0.48em;
  border-radius: 10px;
  row-gap: 0.12em;
}
.badge-card.is-focus,
.badge-card:target {
  border-color: var(--primary);
  background: var(--tint);
  box-shadow: 0 0 0 2px var(--tint);
}
a.badge-value:hover,
a.badge-value:focus-visible {
  border-color: var(--primary);
}
.badge-head {
  display: contents;
}
.badge-value .badge-no,
.badge-compact .badge-no {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--badge-num);
  min-width: var(--badge-num);
  font-size: 1em;
  line-height: 1.15;
}
.badge-value .badge-name,
.badge-compact .badge-name {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  width: var(--badge-name);
  max-width: var(--badge-name);
  font-size: 1em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-compact {
  font-size: 0.92em;
}
.badge-value .badge-sub {
  grid-column: 2;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.3em;
  min-width: 0;
  overflow: hidden;
}
.badge-value .badge-odds,
.badge-value .badge-cd {
  font-size: 0.78em;
  color: var(--muted);
  line-height: 1.15;
  white-space: nowrap;
}
.badge-value .badge-stars,
.badge-compact .badge-stars {
  grid-column: 2;
  justify-self: start;
  font-size: 0.82em;
  line-height: 1;
}
.badge-stars {
  color: #e6a700;
  letter-spacing: 0.06em;
  font-size: 0.92em;
  line-height: 1;
}
.badge-stars .star-half {
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.1em;
  letter-spacing: 0;
}
.badge-stars .star-half::before,
.badge-stars .star-half::after {
  position: absolute;
  left: 0;
  top: 0;
  content: "★";
  line-height: 1;
}
.badge-stars .star-half::before {
  opacity: 0.28;
}
.badge-stars .star-half::after {
  width: 50%;
  overflow: hidden;
}
.focus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
}
.focus-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--primary);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.focus-chip.on,
.focus-chip:hover,
.focus-chip:focus-visible {
  border-color: var(--primary);
  background: var(--tint);
  color: var(--primary-dark);
}
.badge-no { color: var(--primary); font-weight: 700; }
.badge-name { font-weight: 700; }

.race-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.nav-row {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.nav-row:last-child { border-bottom: 0; }
.nav-race {
  border-bottom: 1px solid var(--line);
}
.nav-race:last-child { border-bottom: 0; }
.nav-race .nav-row { border-bottom: 0; }
a.nav-row {
  text-decoration: none;
  color: inherit;
  padding: 0.72rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
a.nav-row:hover,
.nav-row summary:hover {
  background: var(--hover);
}
.nav-row[open] { background: var(--hover); }
a.nav-row.live-row { background: var(--live-row); }
a.nav-row.live-row:hover { background: var(--tint); }
.nav-row summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.85rem;
}
.nav-row summary::-webkit-details-marker { display: none; }
.nav-no {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
}
.live-row .nav-no { background: var(--fill-hover); letter-spacing: 0.02em; }
.nav-copy {
  flex: 1;
  min-width: 0;
}
.nav-copy strong,
.nav-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-copy strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}
.nav-copy span {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.08rem;
}
.nav-chev,
.nav-go {
  flex: 0 0 auto;
  color: var(--muted);
}
.nav-go { font-size: 1rem; font-weight: 600; color: var(--primary); }
.nav-chev {
  width: 0.48rem;
  height: 0.48rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease, border-color 0.16s ease;
  margin: -0.18rem 0.2rem 0 0;
}
.nav-row[open] .nav-chev {
  width: auto;
  height: auto;
  border: 0;
  transform: none;
  margin: 0 0.05rem 0 0;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
}
.nav-row[open] .nav-chev::before {
  content: "→";
}
.early-preview {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0.85rem 0.8rem 3.4rem;
  background: var(--surface);
}
.early-preview p {
  margin: 0;
  color: var(--body);
  font-size: 0.88rem;
  line-height: 1.7;
  letter-spacing: 0.5px;
}
.early-preview .ai-horse,
.card.early .ai-horse { margin: 0 0 0.85rem; }
.early-preview .ai-horse:last-child,
.card.early .ai-horse:last-child { margin-bottom: 0; }
.early-preview .ai-horse > p + p,
.card.early .ai-horse > p + p { margin-top: 0.18rem; }
.ai-k {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: 0.28rem;
}
.nav-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.nav-facts li {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: start;
}
.fact-no {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.08rem;
}
.fact-copy {
  min-width: 0;
  font-size: 0.88rem;
  color: var(--body);
  line-height: 1.5;
}
.fact-copy strong {
  font-weight: 700;
  color: var(--ink);
}

.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.6rem;
}
.race-grid a {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.7rem;
  background: var(--chip);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.race-grid a:hover { border-color: var(--primary); }
.race-grid strong { color: var(--primary); }
.race-grid span { font-size: 0.75rem; color: var(--muted); }
.race-grid .live-tile { background: var(--live-row); }

.card.late { border: 2px solid var(--ok); }
.card.locked { color: var(--muted); }
.card.early .verdict { color: var(--body); }
.card.early .verdict p { margin: 0.35rem 0; line-height: 1.7; letter-spacing: 0.5px; }
.card.early .verdict p:first-child { margin-top: 0; }
.card.early .verdict p:last-child { margin-bottom: 0; }
.card.early .verdict .ai-horse > p { margin: 0; }
.card.early .verdict .ai-horse > p + p { margin-top: 0.18rem; }
.ai-horse { margin: 0 0 1.05rem; letter-spacing: 0.5px; }
.ai-horse:last-child { margin-bottom: 0; }
.ai-horse > p:first-child { margin: 0 0 0.35rem; font-weight: 700; }
a.ai-horse {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.card.early .ai-horse > p:first-child,
.card.early .ai-horse .horse-jump,
.card.early .verdict .horse-jump {
  color: var(--ink);
}
.card.early .ai-horse .horse-jump:hover,
.card.early .ai-horse .horse-jump:focus-visible,
.card.early .verdict .horse-jump:hover,
.card.early .verdict .horse-jump:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
}
a.horse-jump:not(.ai-horse) { text-decoration: none; }
a.horse-jump:not(.ai-horse):hover { text-decoration: underline; }
html:not([data-style]) h2 > .ai-classic { display: inline !important; }
html:not([data-style]) .ai-classic,
html:not([data-style]) .ai-sport,
html[data-style="classic"] .ai-sport,
html[data-style="sport"] .ai-classic { display: none !important; }
html[data-style="classic"] .early-preview .ai-classic,
html[data-style="sport"] .early-preview .ai-sport { display: inline; }

.style-switch {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.style-switch:hover,
.style-switch:focus-visible {
  background: var(--tint);
  color: var(--primary);
  outline: none;
}
.style-switch.on,
.style-switch.on:hover,
.style-switch.on:focus-visible {
  color: var(--primary);
}
.icon-gear { width: 1.45rem; height: 1.45rem; display: block; }
.install-guide {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 0.85rem;
  background: rgba(15, 23, 42, 0.78);
}
html.is-install-open .install-guide { display: flex; }
html.is-install-open,
html.is-install-open body { overflow: hidden; }
.install-guide-img {
  display: block;
  width: min(100%, 28rem);
  height: auto;
  max-height: min(86dvh, 42rem);
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  background: #0b1220;
  cursor: pointer;
}

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

.style-modal {
  display: none;
  position: fixed;
  top: var(--appbar-h);
  bottom: var(--tabbar-h);
  left: 0;
  right: 0;
  z-index: 25;
  align-items: stretch;
  justify-content: center;
  padding: 0.5rem 0.85rem 0.45rem;
  background: var(--bg);
  opacity: 1;
  overflow: hidden;
  transition: opacity 0.3s ease;
}
html:not([data-style]) .style-modal,
html.is-style-open .style-modal { display: flex; }
html:has(body.page-settings) .style-modal,
html:has(body.page-login) .style-modal,
html.is-settings-open .style-modal { display: none !important; }
html:has(body.page-settings),
html:has(body.page-login) { overflow: auto; }
.style-modal.is-leaving { opacity: 0; }
.style-options {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 0.55rem;
  width: min(22rem, 92vw);
  height: 100%;
  max-height: 100%;
  min-height: 0;
}
.style-card {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem 0.5rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.style-card-face {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border-radius: 8px;
}
.style-card-face img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.style-card-kicker {
  flex: 0 0 auto;
  margin-top: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.style-card-desc {
  flex: 0 0 auto;
  margin-top: 0.16rem;
  max-width: 100%;
  font-size: 0.72rem;
  line-height: 1.45;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.style-card:hover,
.style-card.is-on {
  background: var(--selected);
  border-color: var(--primary);
}
.style-card:focus-visible { outline: none; }
.style-card:focus-visible,
.style-card.is-on:focus-visible {
  border-color: var(--primary);
}
.style-card:active {
  transform: scale(0.985);
}
@media (min-width: 721px) {
  .style-modal {
    padding: 0.7rem 1.2rem 0.65rem;
  }
  .style-options {
    flex-direction: row;
    align-items: stretch;
    width: min(54rem, 94vw);
    gap: 1.2rem;
  }
  .style-card {
    padding: 0.7rem 0.75rem 0.8rem;
  }
  .style-card-kicker {
    margin-top: 0.55rem;
    font-size: 1.02rem;
  }
  .style-card-desc {
    margin-top: 0.24rem;
    font-size: 0.76rem;
    line-height: 1.55;
    white-space: nowrap;
    letter-spacing: 0;
  }
}
html:not([data-style]):not(:has(body.page-settings)):not(:has(body.page-login)):not(.is-settings-open),
html.is-style-open:not(.is-settings-open) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .style-modal, .style-card-face { transition: none; }
  .deck-hint-svg { animation: none; }
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: var(--tabbar-h);
  background: var(--nav);
  border-top: 1px solid var(--line);
  box-shadow: var(--nav-shadow);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tabbar a,
.tabbar .soon {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.28rem 0.2rem 0.22rem;
}
.tabbar .tabbar-ico {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}
.tabbar a.on { color: var(--primary); }
.tabbar a:hover { color: var(--primary); }
.tabbar .soon {
  color: var(--disabled);
  font-weight: 700;
  cursor: default;
}
.foot-links { margin: 0.65rem 0 0; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a.on,
.foot-links a:hover { color: var(--ink); }

.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  background: rgba(0, 0, 0, 0.55);
  overscroll-behavior: contain;
}
html[data-theme="dark"] .settings-overlay {
  background: rgba(0, 0, 0, 0.62);
}
html.is-settings-open .settings-overlay,
body.page-settings .settings-overlay {
  display: flex;
}
html.is-settings-open,
html.is-settings-open body {
  overflow: hidden;
}
html.is-settings-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}
.settings-dialog {
  position: relative;
  width: min(22.5rem, 100%);
  max-height: min(82vh, 36rem);
  overflow: auto;
  padding: 1.35rem 1.15rem 1.25rem;
  border: 2px solid #93c5fd;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.28);
}
html[data-theme="dark"] .settings-dialog {
  border-color: #4a6386;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
}
.settings-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.settings-close:hover,
.settings-close:focus-visible {
  background: var(--tint);
  color: var(--ink);
  outline: none;
}
.icon-close {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}
.settings-dialog #settings-title {
  margin: 0 2.2rem 1.05rem 0;
  font-size: 1.12rem;
}
.settings-block {
  margin: 0 0 1.05rem;
}
.settings-block:last-child { margin-bottom: 0; }
.settings-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}
.settings-block .lede { margin: 0 0 0.85rem; }
.settings-fallback { color: var(--muted); }
body.page-settings .settings-fallback { display: none; }
.seg {
  display: flex;
  gap: 0.45rem;
}
.seg-btn {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0.72rem 0.55rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.seg-btn.is-on {
  background: var(--selected);
  border-color: var(--primary);
  color: var(--primary);
}
.seg-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.race-info h1 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.race-info p { margin: 0; color: var(--muted); }

.note-scratch { color: var(--warn); font-weight: 700; margin: 0 0 0.6rem; }
.badge-out { color: var(--warn); font-weight: 700; margin-left: 0.3rem; }
mark.close-pick, mark.close-drag, mark.close-power, mark.close-edge {
  background: none;
  padding: 0;
  font-weight: 700;
  color: var(--ink);
}

.runners-block h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.runners-block h2::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.9rem;
  background: var(--fill);
  border-radius: 2px;
  margin-right: 0.45rem;
  vertical-align: -0.1rem;
}

.runners { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.runner,
.horse-card {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  column-gap: 0.75rem;
  row-gap: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  align-items: start;
}
.horse-card:target,
.horse-card.is-jump {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--tint);
  background: var(--selected);
}
.num {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 0.12rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.horse-body {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}
.horse-id,
.horse-form,
.horse-note {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}
.r1, .r2, .r3, .r4, .r5 { min-width: 0; }
.r1 {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: 1.5rem;
  line-height: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r1, .r1 * { white-space: nowrap; }
.horse { font-weight: 700; }
.jt { font-size: 0.82rem; color: var(--muted); }
.jt b { font-weight: 600; color: var(--ink); }
.r2 {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  min-height: 1.5rem;
  line-height: 1.5rem;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
}
.draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 1.35rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0 0.32rem;
  line-height: 1;
  background: var(--chip);
}
.draw-in { background: #e8f5e9; color: #2e7d32; }
.draw-out { background: #ffebee; color: #c62828; }
.wt { font-weight: 600; }
.cd { font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.r3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  min-height: 1.5rem;
}
.form { display: flex; gap: 0.18rem; flex-wrap: nowrap; flex: 0 0 auto; }
.form i {
  display: inline-flex;
  min-width: 1.4rem;
  height: 1.35rem;
  padding: 0 0.18rem;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
  border: 1px solid #8a93a0;
  color: #374151;
  background: #eef0f3;
  font-variant-numeric: tabular-nums;
}
.form i.form-1 { border-color: #c9a227; }
.form i.form-2 { border-color: #6d7f90; }
.form i.form-3 { border-color: #9a9084; }
.form-empty { color: var(--muted); font-size: 0.8rem; }
.cond { font-size: 0.84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cond-ap, .cond-a { color: #2e7d32; }
.cond-am { color: #43a047; }
.cond-bp, .cond-b, .cond-bm { color: #ef6c00; }
.cond-b { font-weight: 600; }
.cond-cp { color: #e53935; }
.cond-c, .cond-cm { color: #c62828; }
.r4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  padding-top: 0.08rem;
}
.flag {
  appearance: none;
  border: 0;
  background: var(--chip);
  border-radius: 999px;
  padding: 0.18rem 0.42rem;
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.flag-ico {
  width: 1.12rem;
  height: 1.12rem;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}
.flag-jockey { color: var(--primary); }
.flag-trainer { color: #6d4c41; }
.flag-gear { color: #1565c0; }
.flag-injury { color: #c62828; }
.flag.inj-soft { color: #b71c1c; }
.flag.inj-bone { color: #e65100; }
.flag.inj-bleed { color: #ad1457; }
.flag.inj-heart { color: #c2185b; }
.flag.inj-surgery { color: #6a1b9a; }
.flag.inj-admin { color: #546e7a; }
.flag.inj-wound { color: #ef6c00; }
.flag.inj-mild { color: #f9a825; }
.flag[aria-expanded="true"] { background: var(--tint); }
.r5 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  letter-spacing: 0.5px;
}
.ai-line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.horse-note {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.1rem;
  border-top: 1px solid var(--line);
}
.note-panel {
  background: var(--chip);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.inj { display: inline; margin-left: 0.15rem; }
.inj summary {
  display: inline;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
}
.inj summary::-webkit-details-marker { display: none; }
.inj-mild, .flag.inj-mild { color: #f9a825; }
.inj-bone, .flag.inj-bone { color: #e65100; }
.inj-soft, .flag.inj-soft { color: #b71c1c; }
.inj span { display: inline; margin-left: 0.15rem; font-size: 0.72rem; color: var(--muted); font-weight: 400; }

.runner.out {
  background: var(--chip);
  opacity: 0.5;
}
.runner.out .num { background: var(--disabled); }
.runner.out .horse { text-decoration: line-through; }

.changed-blue { color: var(--primary) !important; }

.feed-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.feed-head h1 { margin: 0; font-size: 1.25rem; }
.btn {
  display: inline-block;
  background: var(--fill);
  color: var(--on-accent);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn:hover { background: var(--fill-hover); color: var(--on-accent); }
.timeline { list-style: none; padding: 0; margin: 0.8rem 0 0; }
.timeline li { border-bottom: 1px solid var(--line); }
.timeline a {
  display: block;
  padding: 0.85rem 0.1rem;
  text-decoration: none;
  color: var(--ink);
}
.timeline time { display: block; color: var(--primary); font-size: 0.78rem; margin-bottom: 0.2rem; }

footer {
  padding: 1.1rem 6vw calc(var(--tabbar-h) + 1.4rem);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  letter-spacing: 0.5px;
}

.toast {
  position: fixed;
  top: 7.2rem;
  right: 1rem;
  max-width: 22rem;
  background: var(--nav);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 50;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-kicker { margin: 0 0 0.3rem; font-weight: 700; }
.toast-body { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.toast-go {
  display: inline-block;
  background: var(--fill);
  color: var(--on-accent);
  text-decoration: none;
  padding: 0.32rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
}

.kicker.ink { color: var(--primary); letter-spacing: 0.12em; margin-bottom: 0.35rem; }

.shikma-article { padding: 1.15rem 1.1rem 1.5rem; }
.shikma-article .article-mast {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  column-gap: 0.8rem;
  align-items: center;
  margin: 0 0 1rem;
}
.shikma-article .article-mast.has-art {
  grid-template-columns: 5.6rem minmax(0, 1fr);
  column-gap: 0.9rem;
}
.shikma-article .article-ico {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 12px;
}
.shikma-article .article-ico.has-art {
  width: 5.6rem;
  height: 5.6rem;
  border-radius: 16px;
  background: #071018;
  overflow: hidden;
}
.shikma-article .article-mast .kicker { margin: 0; }
.shikma-article .article-mast h1 {
  margin: 0.12rem 0 0;
  font-size: 1.42rem;
  line-height: 1.28;
}
.shikma-article h1 { margin: 0 0 1rem; font-size: 1.55rem; line-height: 1.3; }
.shikma-article h2 {
  margin: 1.7rem 0 0.7rem;
  font-size: 1.12rem;
  color: var(--primary-dark);
  line-height: 1.4;
}
.shikma-article h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1rem;
  color: var(--ink);
}
.shikma-article p { margin: 0.45rem 0; color: var(--body); line-height: 1.7; letter-spacing: 0.5px; }
.further-read {
  margin-top: 1.85rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
}
.further-read h2 {
  margin: 0 0 0.7rem;
}
.further-read-in,
.further-read-book {
  margin: 0.38rem 0;
  line-height: 1.65;
}
.further-read-mark {
  display: inline-block;
  width: 1.5rem;
  margin-right: 0.12rem;
}
.further-read-note {
  margin: 0.4rem 0 0 1.62rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
  letter-spacing: 0.2px;
}

.about-copy h1 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
  line-height: 1.35;
  color: var(--ink);
}
.about-copy p {
  margin: 0 0 0.95rem;
  color: var(--body);
  line-height: 1.75;
  letter-spacing: 0.5px;
}
.about-copy p:last-child { margin-bottom: 0; }
.shikma-article p.lede {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 1.1rem;
}
.shikma-article ul,
.shikma-article ol { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.shikma-article li { margin: 0.25rem 0; }
.shikma-article em { font-style: italic; }
.shikma-article .table-wrap { overflow-x: auto; margin: 0.7rem 0 1rem; }
.shikma-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.shikma-article th,
.shikma-article td {
  border-bottom: 1px solid var(--line);
  padding: 0.42rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.shikma-article th { color: var(--muted); font-weight: 600; background: var(--chip); }
.shikma-article td { font-variant-numeric: tabular-nums; }
.shikma-article tbody tr:nth-child(even) td { background: var(--tint); }
.shikma-article .facts {
  margin: 0.35rem 0 0.85rem;
  padding: 0.35rem 0.7rem 0.35rem 1.2rem;
  border-radius: 10px;
  background: var(--tint);
}
.shikma-article .facts li { margin: 0.2rem 0; }
.shikma-article .callout {
  margin: 0.45rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  background: var(--tint);
}
.shikma-article .callout p { margin: 0; }
.shikma-article .callout ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}
.shikma-article .callout li { margin: 0.2rem 0; }
.shikma-article .callout-case { border-left-color: #0f766e; }
.shikma-article .callout-watch { border-left-color: #b45309; }
.shikma-article .callout-tip { border-left-color: var(--primary); }
.shikma-article .callout-note { border-left-color: #64748b; }
.shikma-article .callout-pick { border-left-color: #16a34a; }
.shikma-article .callout-skip { border-left-color: #dc2626; }
.shikma-article .formula {
  overflow-x: auto;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.shikma-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  font-size: 0.88rem;
}
.shikma-pager a { text-decoration: none; }

.term-list { margin: 0.4rem 0 0; }
.term-list > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.55rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.term-list dt { font-weight: 700; color: var(--primary-dark); }
.term-list dd { margin: 0; color: var(--body); }

@media (max-width: 720px) {
  .term-list > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

.pick-yes,
.pick-no {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border-left: 3px solid var(--ok);
  background: #f1f8f2;
}
.pick-no {
  border-left-color: var(--warn);
  background: #fdf3f3;
}

.tabbar { padding: 0 0.4rem; }

html:has(body.page-learn),
html:has(body.page-learn) body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body.page-learn {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body.page-learn main {
  flex: 1;
  min-height: 0;
  max-width: none;
  width: 100%;
  padding: 0 0 var(--tabbar-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.page-learn main > h1 { display: none; }
body.page-learn [data-tab-panel]:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: none;
}
body.page-learn [data-tab-panel="terms"]:not([hidden]) {
  display: block;
  overflow: auto;
  padding: 0.65rem 0.9rem 1rem;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.learn-tabs {
  position: relative;
  top: auto;
  z-index: 22;
  display: flex;
  gap: 0.32rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.28rem 0.7rem 0.3rem;
  background: var(--bg);
  border-bottom: none;
}
.learn-tabs::-webkit-scrollbar { display: none; }
.learn-tabs a {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.26rem 0.32rem;
  border-radius: 999px;
  background: var(--chip);
  white-space: nowrap;
}
.learn-tabs .tab-ico {
  width: 1.2rem;
  height: 1.2rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
  font-weight: 400;
}
.learn-tabs a.on {
  color: var(--on-accent);
  background: var(--fill);
}
.learn-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 9.5rem;
  margin: 0 0 0.9rem;
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--on-accent);
  background: linear-gradient(160deg, #1d4ed8 0%, #2563eb 55%, #1e3a8a 100%);
  box-shadow: var(--shadow);
}
.learn-hero-art {
  position: absolute;
  right: -0.35rem;
  top: 0.15rem;
  opacity: 0.2;
  pointer-events: none;
}
.learn-hero .hero-ico {
  width: 7.4rem;
  height: 7.4rem;
  color: #fff;
}
.learn-hero-kicker,
.learn-hero strong,
.learn-hero-meta { position: relative; z-index: 1; }
.learn-hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--hero-muted);
}
.learn-hero strong {
  margin-top: 0.35rem;
  font-size: 1.28rem;
  line-height: 1.3;
}
.learn-hero-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--hero-muted);
}
.learn-list { display: flex; flex-direction: column; gap: 0.65rem; }
.learn-list[data-learn-promo] .learn-row:nth-child(n + 4) { display: none; }
.learn-kicker {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.learn-row,
.learn-tile {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.7rem;
}
.learn-tile {
  grid-template-columns: 1fr;
  align-items: stretch;
  padding: 0.75rem;
}
.learn-thumb {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 12px;
  color: var(--primary);
  background: var(--tint);
}
.learn-thumb .topic-ico,
.article-ico .topic-ico {
  width: 2.05rem;
  height: 2.05rem;
  display: block;
}
.learn-thumb-tile {
  width: 100%;
  height: 4.6rem;
  border-radius: 10px;
}
.learn-thumb-tile .topic-ico { width: 2.35rem; height: 2.35rem; }
.learn-thumb[data-topic="1"], .article-ico[data-topic="1"] { color: #1d4ed8; background: #dbeafe; }
.learn-thumb[data-topic="2"], .article-ico[data-topic="2"] { color: #0f766e; background: #ccfbf1; }
.learn-thumb[data-topic="3"], .article-ico[data-topic="3"] { color: #4338ca; background: #e0e7ff; }
.learn-thumb[data-topic="4"], .article-ico[data-topic="4"] { color: #b45309; background: #fef3c7; }
.learn-thumb[data-topic="5"], .article-ico[data-topic="5"] { color: #0369a1; background: #e0f2fe; }
.learn-thumb[data-topic="6"], .article-ico[data-topic="6"] { color: #6d28d9; background: #ede9fe; }
.learn-thumb[data-topic="book"], .article-ico[data-topic="book"] { color: #334155; background: #e2e8f0; }
.learn-thumb[data-topic="data"], .article-ico[data-topic="data"] { color: #0e7490; background: #cffafe; }
.article-ico.has-art,
.learn-thumb.has-art {
  background: #071018;
  overflow: hidden;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}
.topic-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.18);
  display: block;
}
.topic-art-frame {
  transform: none;
  object-fit: contain;
}
.topic-art-wide {
  transform: none;
  object-fit: cover;
}
.article-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  margin: 0 0 0.85rem;
  background: #071018;
}
.shikma-article .article-mast.has-cover {
  display: block;
  grid-template-columns: none;
}
.shikma-article .article-mast.has-cover .kicker { margin: 0.15rem 0 0; }
.shikma-article .article-mast.has-cover h1 { margin-top: 0.18rem; }
.terms-entry .learn-tile .learn-thumb.has-art {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  margin: 0 0 0.2rem;
}
.terms-entry .learn-tile .topic-art-wide {
  object-fit: cover;
  transform: none;
}
.article-ico.has-art:has(img[src*="/terms/"]) {
  background: transparent;
  box-shadow: none;
}
.learn-tile .learn-thumb { width: 100%; height: 4.6rem; }
.learn-copy,
.learn-tile strong,
.learn-tile span { min-width: 0; }
.learn-copy strong,
.learn-tile strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
}
.learn-copy span,
.learn-tile span {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.learn-section { margin: 0 0 1.2rem; }
.learn-section h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--primary);
}
.learn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.terms-entry { margin: 0 0 0.95rem; }
.terms-entry .learn-tile { text-align: left; justify-items: stretch; }
html:not([data-style]) .terms-sport,
html[data-style="classic"] .terms-sport { display: none !important; }
html[data-style="sport"] .terms-classic { display: none !important; }
@media (max-width: 720px) {
  .learn-grid.terms-entry { grid-template-columns: 1fr; }
}
.term-search { display: block; margin: 0 0 0.7rem; }
.term-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: max(16px, 1rem);
  touch-action: manipulation;
}
.term-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.85rem; }
.term-chip {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.term-chip.is-on {
  background: var(--selected);
  border-color: var(--primary);
  color: var(--primary);
}
.term-board {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: stretch;
}
.term-acc {
  flex-grow: var(--term-flex, 1);
  flex-shrink: 0;
  flex-basis: auto;
  min-width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-weight: 700;
  text-align: center;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
.term-acc.is-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--hero-muted);
  background: var(--tint);
  color: var(--primary);
}
.term-panel {
  flex: 1 1 100%;
  width: 100%;
  box-sizing: border-box;
  background: var(--tint);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  color: var(--body);
  line-height: 1.7;
  letter-spacing: 0.5px;
  white-space: pre-wrap;
}
.term-panel[hidden] { display: none; }
html[data-theme="dark"] .draw { background: #2a3648; color: #c5ced9; }
html[data-theme="dark"] .draw-in { background: #1e3a2c; color: #86b892; }
html[data-theme="dark"] .draw-out { background: #3a262c; color: #d08989; }
html[data-theme="dark"] .form i { background: #243044; border-color: #6b7684; color: #c5ced9; }
html[data-theme="dark"] .form i.form-1 { border-color: #c4ae5a; }
html[data-theme="dark"] .form i.form-2 { border-color: #8b9aab; }
html[data-theme="dark"] .form i.form-3 { border-color: #7d786e; }
html[data-theme="dark"] .cond-ap,
html[data-theme="dark"] .cond-a { color: #7cbc84; }
html[data-theme="dark"] .cond-am { color: #8bc98f; }
html[data-theme="dark"] .cond-bp,
html[data-theme="dark"] .cond-b,
html[data-theme="dark"] .cond-bm { color: #d4a05e; }
html[data-theme="dark"] .cond-cp { color: #d07a76; }
html[data-theme="dark"] .cond-c,
html[data-theme="dark"] .cond-cm { color: #c56e6e; }
html[data-theme="dark"] .flag-jockey { color: #8aabcf; }
html[data-theme="dark"] .flag-trainer { color: #b09a90; }
html[data-theme="dark"] .flag-gear { color: #7ea8d4; }
html[data-theme="dark"] .flag-injury { color: #d09090; }
html[data-theme="dark"] .flag.inj-soft { color: #d09090; }
html[data-theme="dark"] .flag.inj-bone { color: #d4a080; }
html[data-theme="dark"] .flag.inj-bleed { color: #c888a0; }
html[data-theme="dark"] .flag.inj-heart { color: #c888a0; }
html[data-theme="dark"] .flag.inj-surgery { color: #b890c4; }
html[data-theme="dark"] .flag.inj-admin { color: #97a6b0; }
html[data-theme="dark"] .flag.inj-wound { color: #d4a878; }
html[data-theme="dark"] .flag.inj-mild { color: #d4c070; }
html[data-theme="dark"] .badge-stars { color: #c8ae58; }
html[data-theme="dark"] .learn-hero {
  background: linear-gradient(160deg, #2a3a50 0%, #3a5070 55%, #243044 100%);
}
html[data-theme="dark"] .learn-thumb[data-topic="1"],
html[data-theme="dark"] .article-ico[data-topic="1"] { color: #93c5fd; background: #1e3a5f; }
html[data-theme="dark"] .learn-thumb[data-topic="2"],
html[data-theme="dark"] .article-ico[data-topic="2"] { color: #5eead4; background: #134e4a; }
html[data-theme="dark"] .learn-thumb[data-topic="3"],
html[data-theme="dark"] .article-ico[data-topic="3"] { color: #a5b4fc; background: #312e81; }
html[data-theme="dark"] .learn-thumb[data-topic="4"],
html[data-theme="dark"] .article-ico[data-topic="4"] { color: #fcd34d; background: #78350f; }
html[data-theme="dark"] .learn-thumb[data-topic="5"],
html[data-theme="dark"] .article-ico[data-topic="5"] { color: #7dd3fc; background: #164e63; }
html[data-theme="dark"] .learn-thumb[data-topic="6"],
html[data-theme="dark"] .article-ico[data-topic="6"] { color: #c4b5fd; background: #4c1d95; }
html[data-theme="dark"] .learn-thumb[data-topic="book"],
html[data-theme="dark"] .article-ico[data-topic="book"] { color: #cbd5e1; background: #334155; }
html[data-theme="dark"] .learn-thumb[data-topic="data"],
html[data-theme="dark"] .article-ico[data-topic="data"] { color: #67e8f9; background: #164e63; }
html[data-theme="dark"] .article-ico.has-art,
html[data-theme="dark"] .learn-thumb.has-art { background: #071018; }
html[data-theme="dark"] .pick-yes { background: #16341f; }
html[data-theme="dark"] .pick-no { background: #3a1c1c; }

@media (min-width: 760px) {
  .learn-hero { min-height: 11rem; }
}

@media (max-width: 720px) {
  main, .appbar, .race-nav, footer { padding-left: 1rem; padding-right: 1rem; }
  .hero h1, .race-info h1 { font-size: 1.28rem; }
  .toast { left: 1rem; right: 1rem; max-width: none; }
  .early-preview { padding-left: 0.85rem; }
}

html { view-transition-name: none; }
::view-transition-old(ht-main),
::view-transition-new(ht-main) {
  animation-duration: 0.22s;
}

.deck {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.deck-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.deck-pile {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  touch-action: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  overflow: hidden;
}
.deck-pile:active { cursor: grabbing; }
.deck-pile:focus-visible {
  box-shadow: 0 0 0 3px var(--hero-muted);
  border-radius: 18px;
}
.deck-card {
  position: absolute;
  top: 50%;
  left: 50%;
  right: auto;
  width: 80%;
  height: auto;
  max-width: 28rem;
  aspect-ratio: 5 / 4;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  color: #f8fafc;
  text-decoration: none;
  background: #0b1220;
  box-shadow: 0 16px 34px rgba(2, 8, 18, 0.42);
  outline: 1px solid rgba(148, 163, 184, 0.18);
  touch-action: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-user-drag: none;
  transform-origin: center center;
  transform: translate3d(-50%, -50%, 0);
}
.deck-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.deck-card-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.8rem 0.95rem 1.05rem;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 8, 16, 0.9) 62%);
}
.deck-card-kicker {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  opacity: 0.8;
}
.deck-card strong {
  display: block;
  margin-top: 0.16rem;
  font-size: 1.12rem;
  line-height: 1.28;
  color: #fff;
}
.deck-card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.32rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.88);
}
.deck-card-preview,
.deck-article {
  display: none;
}
.deck-hint {
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  z-index: 50;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
  color: #bfdbfe;
  line-height: 0;
}
.deck-hint-svg {
  display: block;
  width: 1.35rem;
  height: 2.05rem;
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.75));
  animation: deck-nudge 1.7s ease-in-out infinite;
}
.deck-hint-desktop { display: none; }
@keyframes deck-nudge {
  0%, 100% { transform: translateY(0); opacity: 0.72; }
  50% { transform: translateY(5px); opacity: 1; }
}
.deck-actions { display: none; }
.deck-read,
.deck-reader-close,
.deck-reader-full {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 0.48rem 1.15rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.deck-read:hover,
.deck-read:focus-visible {
  background: var(--fill-hover);
  color: var(--on-accent);
}
@media (max-width: 768px) {
  .deck-card {
    top: 50%;
    left: 50%;
    right: auto;
    width: min(92%, 28rem);
    max-width: 28rem;
    height: auto;
    max-height: calc(100% - 3.4rem);
    aspect-ratio: 5 / 4;
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(2, 8, 18, 0.55);
    transform: translate3d(-50%, -50%, 0);
  }
  .deck-card.is-center {
    outline: 2px solid rgba(59, 130, 246, 0.88);
    outline-offset: -2px;
  }
  .deck-card-copy {
    padding: 1.55rem 0.95rem 1.2rem;
  }
  .deck-card-excerpt {
    -webkit-line-clamp: 3;
  }
  .deck-card:not(.is-center) .deck-card-excerpt { display: none; }
  .deck-card:not(.is-center) .deck-card-kicker { display: none; }
  .deck-card:not(.is-center) .deck-card-copy { opacity: 0.96; padding-bottom: 0.7rem; }
  .deck-card:not(.is-center) strong { font-size: 1.02rem; }
  .deck {
    padding-top: 0.15rem;
    padding-bottom: 2.1rem;
  }
  .deck-hint {
    top: auto;
    bottom: 0.4rem;
  }
}
@media (min-width: 769px) {
  .deck {
    padding-top: 0.35rem;
    padding-bottom: 1.5rem;
  }
  .deck-stage {
    flex-direction: row;
    align-items: stretch;
    width: min(96%, 72rem);
    margin: 0 auto;
    gap: 0;
    overflow: visible;
  }
  .deck-pile {
    flex: 2 1 0;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
  }
  .deck-article {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-self: flex-start;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0.05rem 0.55rem 0.2rem 0;
    border-left: none;
    color: var(--ink);
    text-decoration: none;
  }
  .deck-article:hover { color: var(--ink); }
  .deck-article-preview {
    display: flex;
    flex-direction: column;
    gap: 1.05em;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    font-size: 0.9rem;
    color: var(--ink);
  }
  .deck-article-p {
    margin: 0;
    line-height: 1.85;
  }
  .deck-article-p.is-h {
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-top: 0.35em;
  }
  .deck-article-more {
    display: block;
    flex: 0 0 auto;
    margin-top: 0.7rem;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--primary);
  }
  .deck-article:hover .deck-article-more { color: var(--primary-dark); }
  .deck-card {
    top: 50%;
    left: 50%;
    display: block;
    width: 94%;
    height: auto;
    max-width: none;
    aspect-ratio: 5 / 4;
  }
  .deck-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .deck-card-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.7rem 1.05rem 1.1rem;
    background: linear-gradient(180deg, transparent 0%, rgba(4, 8, 16, 0.9) 62%);
  }
  .deck-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
  }
  .deck-card strong { font-size: 1.22rem; }
  .deck-card:not(.is-center) .deck-card-excerpt { display: none; }
  .deck-card:not(.is-center) .deck-card-kicker { display: none; }
  .deck-card:not(.is-center) .deck-card-copy { opacity: 0.96; padding-bottom: 0.7rem; }
  .deck-hint-mobile { display: none; }
  .deck-hint-desktop { display: block; width: 2.05rem; height: 1.35rem; }
}

body.page-review .review-article h1 {
  margin: 0.2rem 0 0.85rem;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--ink);
}
body.page-review .review-lede {
  margin: 0 0 1.15rem;
  color: var(--muted);
  line-height: 1.7;
}
body.page-review .review-body .card { margin-bottom: 1rem; }
body.page-review .review-body .card:last-child { margin-bottom: 0; }
body.page-review .review-place {
  margin-left: 0.4rem;
  font-weight: 500;
  color: var(--muted);
}
body.page-review .review-verdict {
  margin-left: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
body.page-review .review-verdict.follow { color: var(--primary); }
body.page-review .review-verdict.drop { color: var(--muted); }
body.page-review .review-body .ai-horse { margin-bottom: 1.2rem; }
body.page-review .review-body .ai-horse:last-child { margin-bottom: 0; }
body.page-review .review-body .ai-horse > p + p { margin-top: 0.25rem; line-height: 1.7; }

.login-card h1 {
  margin: 0.2rem 0 0.55rem;
  font-size: 1.45rem;
}
.login-status {
  margin: 0 0 1rem;
  color: var(--muted);
}
.login-google,
.login-form button,
.login-signed button {
  appearance: none;
  width: 100%;
  font: inherit;
  font-weight: 800;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.login-google {
  border-color: var(--primary);
  background: var(--tint);
  color: var(--primary);
}
.login-google:hover,
.login-form button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.login-or {
  margin: 1.1rem 0 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.login-form {
  display: grid;
  gap: 0.75rem;
}
.login-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.login-form input {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.login-form button[type="submit"] {
  background: var(--fill);
  border-color: var(--fill);
  color: var(--on-accent);
}
.login-ghost {
  background: transparent;
}
.login-err {
  margin: 0;
  color: var(--warn);
  font-size: 0.88rem;
}
.login-who {
  margin: 0 0 1rem;
  font-weight: 700;
}
.login-google:disabled,
.login-form button:disabled,
.login-signed button:disabled {
  opacity: 0.6;
  cursor: default;
}
