:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #edf2f7;
  --line: #d8e0e8;
  --line-strong: #a5b1bf;
  --text: #111827;
  --muted: #64748b;
  --head: #101820;
  --accent: #0f766e;
  --accent-2: #1f4f8f;
  --accent-soft: #e7f5f2;
  --warn: #9a5b00;
  --bad: #b42318;
  --hit: #167348;
  --shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
  letter-spacing: 0;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.2), transparent 42%),
    var(--head);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 18px;
}

.site-header-inner {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.eyebrow, h1, h2, h3, p {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.site-header .eyebrow {
  color: #99f6e4;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: #dce3eb;
  font-size: 12px;
}

.status-row span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

main {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 18px 42px;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 13px;
  font-weight: 800;
}

.tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.summary-label-short {
  display: none !important;
}

.summary-card strong {
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.summary-card small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.control-bar {
  display: grid;
  grid-template-columns: 170px minmax(240px, 1fr) 150px;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 921px) {
  main {
    padding-top: 14px;
  }

  .view-tabs {
    margin-bottom: 12px;
  }

  .summary-grid {
    gap: 10px;
    margin-bottom: 10px;
  }

  .summary-card {
    padding: 10px 12px;
  }

  .summary-card span {
    margin-bottom: 3px;
  }

  .summary-card strong {
    font-size: 22px;
  }

  .summary-card small {
    margin-top: 3px;
  }

  .control-bar {
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    align-items: center;
  }

  .field {
    display: block;
    position: relative;
    font-size: 11px;
  }

  .field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .field input,
  .field select {
    height: 34px;
    border-radius: 6px;
    padding: 0 9px;
    font-size: 13px;
  }

  .section-head {
    margin: 2px 0 8px;
  }

  .section-head h2 {
    font-size: 16px;
  }

  .section-head p {
    margin-top: 1px;
    font-size: 11px;
  }
}

.field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 4px 0 10px;
}

.section-head h2 {
  font-size: 18px;
}

.section-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.section-head.compact {
  margin: 0 0 9px;
}

.highlight-panel:empty {
  display: none;
}

.highlight-section {
  margin-bottom: 14px;
}

.highlight-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.highlight-toggle > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.highlight-toggle > summary::-webkit-details-marker {
  display: none;
}

.highlight-toggle > summary:focus:not(:focus-visible) {
  outline: none;
}

.highlight-toggle > summary:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  outline-offset: -2px;
}

.highlight-toggle > summary::after {
  content: "+";
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 900;
}

.highlight-toggle[open] > summary::after {
  content: "-";
}

.highlight-toggle > summary strong,
.highlight-toggle > summary span,
.highlight-toggle > summary small {
  display: block;
}

.highlight-toggle > summary strong {
  font-size: 14px;
}

.highlight-toggle > summary span,
.highlight-toggle > summary small {
  color: var(--muted);
  font-size: 12px;
}

.highlight-toggle > summary small {
  margin-left: auto;
  white-space: nowrap;
}

.highlight-toggle .highlight-grid {
  padding: 10px;
  border-top: 1px solid var(--line);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.highlight-group {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.highlight-group h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14px;
}

.highlight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.highlight-more {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

.highlight-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  cursor: pointer;
  list-style: none;
  padding: 7px 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.highlight-more > summary::-webkit-details-marker {
  display: none;
}

.highlight-more > summary:focus:not(:focus-visible) {
  outline: none;
}

.highlight-more > summary:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  outline-offset: -2px;
}

.highlight-more > summary::after {
  content: "-";
  margin-left: 8px;
  color: var(--muted);
}

.highlight-more:not([open]) > summary::after {
  content: "+";
}

.highlight-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.highlight-card {
  width: 100%;
  min-width: 0;
  text-align: left;
  color: var(--text);
  background: #f5fbf8;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px 12px;
}

.highlight-card:nth-child(2n) {
  border-right: 0;
}

.highlight-card:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.highlight-card.bet {
  background: #fff9ea;
}

.highlight-card > span,
.highlight-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.highlight-card strong {
  display: block;
  margin-top: 4px;
}

.highlight-card .pick-line {
  margin-top: 5px;
}

.empty-mini {
  padding: 16px 12px;
  color: var(--muted);
  font-size: 13px;
}

.race-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 9px;
}

.race-card {
  position: relative;
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.race-card:hover {
  border-color: #b7c4d2;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.race-card.grade-s,
.race-card.grade-a {
  border-left-color: var(--accent);
}

.race-card.grade-b {
  border-left-color: var(--accent-2);
}

.race-card.grade-c {
  border-left-color: #b7791f;
}

.race-card.grade-d {
  border-left-color: #94a3b8;
}

.race-card:focus-visible,
.back-button:focus-visible,
.share-button:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.25);
  outline-offset: 2px;
}

.race-card-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.race-title {
  min-width: 0;
}

.race-title h3 {
  font-size: 14.5px;
  line-height: 1.25;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.race-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.time-pill {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}

.grade-pill {
  color: #fff;
  background: var(--accent-2);
  border-color: var(--accent-2);
  font-weight: 800;
}

.stage-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.stage-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.stage-track small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.stage-chip.done {
  border-color: rgba(5, 150, 105, 0.28);
  background: #ecfdf5;
  color: #047857;
}

.stage-chip.pending {
  background: #f8fafc;
  color: #94a3b8;
}

.stage-chip.current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.race-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.pick-mini {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: linear-gradient(180deg, #fff, var(--surface-2));
}

.pick-mini label,
.pick-card label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 3px;
}

.pick-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.horse-badge {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border: 1px solid rgba(0, 0, 0, 0.28);
  color: #111827;
  background: #eef2f6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  font-variant-numeric: tabular-nums;
}

.horse-badge.dark {
  color: #fff;
}

.horse-badge.frame-1 {
  background: #fff;
  border-color: #111827;
  color: #111827;
}

.horse-badge.frame-2 {
  background: #111827;
  border-color: #111827;
}

.horse-badge.frame-3 {
  background: #dc2626;
  border-color: #991b1b;
}

.horse-badge.frame-4 {
  background: #2563eb;
  border-color: #1d4ed8;
}

.horse-badge.frame-5 {
  background: #facc15;
  border-color: #b7791f;
  color: #111827;
}

.horse-badge.frame-6 {
  background: #16a34a;
  border-color: #15803d;
}

.horse-badge.frame-7 {
  background: #f97316;
  border-color: #c2410c;
}

.horse-badge.frame-8 {
  background: #ec4899;
  border-color: #be185d;
}

.horse-badge.frame-na {
  background: #eef2f6;
  border-color: #cbd5e1;
  color: #334155;
}

.horse-name {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prob-line {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.metric-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.metric-pair span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 5px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.metric-pair strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.metric-pair.prominent {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signal-strip {
  margin-top: 10px;
  border: 1px solid #c9d8e7;
  border-radius: 8px;
  background: #f7fbff;
  overflow: hidden;
}

.signal-strip-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid #dbe6f0;
}

.signal-strip-head strong {
  color: #16324f;
  font-size: 13px;
}

.signal-strip-head span {
  color: var(--muted);
  font-size: 12px;
}

.signal-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  font-weight: 800;
}

.tone-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 2px;
}

.tone-dot:first-child {
  margin-left: 0;
}

.tone-plus { background: #2563eb; }
.tone-minus { background: #dc2626; }
.tone-mixed { background: #d97706; }

.signal-strip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 9px;
}

.signal-card {
  border: 1px solid #d8e2ec;
  border-left: 4px solid #64748b;
  border-radius: 7px;
  padding: 8px;
  background: #fff;
  min-width: 0;
}

.signal-card.strength-a {
  border-left-color: #b45309;
  background: #fffbeb;
}

.signal-card.strength-b {
  border-left-color: #0f766e;
  background: #f0fdfa;
}

.signal-card.strength-c {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.signal-card.tone-plus {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.signal-card.tone-minus {
  border-left-color: #dc2626;
  background: #fff1f2;
}

.signal-card.tone-mixed {
  border-left-color: #d97706;
  background: #fffbeb;
}

.signal-card.tone-plus strong { color: #1e3a8a; }
.signal-card.tone-minus strong { color: #991b1b; }
.signal-card.tone-mixed strong { color: #92400e; }

.signal-card strong,
.signal-card span,
.signal-card small {
  display: block;
}

.signal-card strong {
  color: #0f172a;
  font-size: 13px;
}

.signal-card span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  font-weight: 900;
  font-size: 12px;
}

.signal-card small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.signal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  padding: 2px 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.signal-chip.strength-a {
  border-color: #f3c05c;
  background: #fffbeb;
  color: #92400e;
}

.signal-chip.strength-b {
  border-color: #8fd3c7;
  background: #ecfdf5;
  color: #0f766e;
}

.signal-chip.strength-c {
  border-color: #b7c9ff;
  background: #eff6ff;
  color: #1d4ed8;
}

.signal-chip.tone-plus {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.signal-chip.tone-minus {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.signal-chip.tone-mixed {
  border-color: #f6c766;
  background: #fffbeb;
  color: #92400e;
}

.value-mini {
  border: 1px solid #b9d8ce;
  border-radius: 7px;
  padding: 6px 7px;
  margin-top: 7px;
  background: #edf8f4;
}

.value-mini > span {
  display: inline-flex;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 5px;
}

.bet-mini {
  border: 1px solid #d8c59a;
  border-radius: 7px;
  padding: 6px 7px;
  margin-top: 7px;
  background: #fff9ea;
}

.bet-mini > span {
  display: inline-flex;
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 5px;
}

.bet-mini strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.back-button {
  height: 38px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 800;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.detail-main,
.detail-side,
.panel {
  min-width: 0;
}

.race-hero {
  background:
    linear-gradient(180deg, #fff, #f8fbfb);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.race-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.race-hero h2 {
  font-size: 22px;
  line-height: 1.32;
  margin-top: 3px;
  letter-spacing: 0;
}

.frame-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.frame-dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.28);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.frame-dot.frame-1 {
  background: #fff;
  border-color: #111827;
  color: #111827;
}

.frame-dot.frame-2 {
  background: #111827;
  color: #fff;
}

.frame-dot.frame-3 {
  background: #dc2626;
  color: #fff;
}

.frame-dot.frame-4 {
  background: #2563eb;
  color: #fff;
}

.frame-dot.frame-5 {
  background: #facc15;
  color: #111827;
}

.frame-dot.frame-6 {
  background: #16a34a;
  color: #fff;
}

.frame-dot.frame-7 {
  background: #f97316;
  color: #fff;
}

.frame-dot.frame-8 {
  background: #ec4899;
  color: #fff;
}

.race-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid #d8c59a;
  border-radius: 7px;
  background: #fff9ea;
  color: #665018;
  font-size: 12px;
  line-height: 1.45;
}

.race-notice strong {
  flex: 0 0 auto;
  color: #8a5a00;
}

.share-button {
  min-width: 76px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: var(--head);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

@media (min-width: 921px) {
  .race-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
    gap: 10px 12px;
  }

  .race-hero-top,
  .race-notice {
    grid-column: 1 / -1;
  }

  .race-hero .pick-grid,
  .race-hero .signal-strip {
    margin-top: 0;
    align-self: start;
  }

  .race-hero .pick-grid {
    grid-column: 1;
  }

  .race-hero .signal-strip {
    grid-column: 2;
  }

  .race-hero .signal-strip-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
  }

  .race-hero .signal-card {
    padding: 6px;
  }

  .race-hero .signal-card small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

.pick-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.pick-card .horse-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
}

.pick-card .horse-name {
  font-size: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}

.panel h3 {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--surface-2));
  font-size: 15px;
}

.rank-list {
  display: grid;
  gap: 0;
}

.rank-more,
.horse-more {
  border-bottom: 1px solid var(--line);
}

.horse-more {
  border-top: 1px solid var(--line);
}

.rank-more > summary,
.horse-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  cursor: pointer;
  list-style: none;
  padding: 9px 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.rank-more > summary::-webkit-details-marker,
.horse-more > summary::-webkit-details-marker {
  display: none;
}

.rank-more > summary:focus:not(:focus-visible),
.horse-more > summary:focus:not(:focus-visible) {
  outline: none;
}

.rank-more > summary:focus-visible,
.horse-more > summary:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  outline-offset: -2px;
}

.rank-more > summary::after,
.horse-more > summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--muted);
}

.rank-more[open] > summary::after,
.horse-more[open] > summary::after {
  content: "-";
}

.rank-extra,
.horse-all-list {
  border-top: 1px solid var(--line);
}

.horse-feature-list {
  display: grid;
  gap: 0;
}

.rank-row,
.horse-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 84px 84px 84px;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.rank-row:nth-child(even),
.horse-row:nth-child(even) {
  background: #fbfdff;
}

.rank-row:last-child,
.horse-row:last-child {
  border-bottom: 0;
}

.rank-no {
  color: var(--muted);
  font-weight: 800;
}

.meter {
  height: 5px;
  border-radius: 999px;
  background: #dfe5ec;
  overflow: hidden;
  margin-top: 4px;
}

.meter span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--accent);
}

.num-stat {
  min-width: 0;
  text-align: right;
}

.num-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.num-stat strong {
  font-size: 14px;
}

.market-note {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.market-note strong {
  color: var(--accent);
}

.market-note span {
  color: var(--muted);
  font-size: 12px;
}

.market-list {
  display: grid;
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 68px 58px 78px 72px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.market-row:last-child {
  border-bottom: 0;
}

.market-row.hot {
  background: #f0faf6;
}

.market-row.good {
  background: #f7fbff;
}

.market-row.cold {
  color: var(--muted);
  background: #fafafa;
}

.bet-signal-shell {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.bet-signal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 10px;
}

.bet-signal-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 58px 42px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.bet-signal-summary-card.hot {
  background: #fff7e8;
  border-color: #edd2a4;
}

.bet-signal-summary-card.good {
  background: #f5fbf8;
  border-color: #badbd2;
}

.bet-signal-summary-card > div:first-child {
  min-width: 0;
}

.bet-signal-summary-card > div:first-child span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bet-signal-summary-card > div:first-child strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.bet-detail-toggle {
  border-top: 1px solid var(--line);
}

.bet-detail-toggle > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  cursor: pointer;
  list-style: none;
  padding: 9px 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.bet-detail-toggle > summary::-webkit-details-marker {
  display: none;
}

.bet-detail-toggle > summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--muted);
}

.bet-detail-toggle[open] > summary::after {
  content: "-";
}

.bet-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

.bet-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.bet-group-head strong {
  font-size: 14px;
}

.bet-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.bet-signal-list {
  display: grid;
}

.bet-signal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 76px 70px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.bet-signal:last-child {
  border-bottom: 0;
}

.bet-signal.hot {
  background: #fff7e8;
}

.bet-signal.good {
  background: #f5fbf8;
}

.bet-signal-main {
  min-width: 0;
}

.bet-signal-main strong {
  display: block;
  font-size: 15px;
}

.bet-signal-main span,
.bet-signal p {
  color: var(--muted);
  font-size: 12px;
}

.bet-signal-main span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-signal p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.5;
}

.mark-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.component-mini {
  max-width: 420px;
  margin-top: 6px;
  border: 1px solid #d7e2ee;
  border-radius: 7px;
  background: #f8fbff;
  padding: 6px;
}

.component-mini-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.component-mini-head strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.component-mini-head em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  white-space: nowrap;
}

.component-bars {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.component-bar {
  display: grid;
  grid-template-columns: 58px minmax(44px, 1fr) 42px;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.2;
}

.component-bar > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-bar > div {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.component-bar i {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
}

.component-bar.plus i {
  background: #2563eb;
}

.component-bar.minus i {
  margin-left: auto;
  background: #dc2626;
}

.component-bar strong {
  text-align: right;
  color: var(--text);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.component-empty {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.mark-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
}

.mark-pill.hot {
  background: #fff7d6;
  border-color: #f0c94b;
  color: #7a4b00;
}

.mark-pill.good {
  background: #e7f4ee;
  border-color: #99d1ba;
  color: #0b604d;
}

.mark-pill.mid {
  background: #eef4ff;
  border-color: #bfd2ff;
  color: #1d4ed8;
}

.heatmap-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.summary-grid,
.highlight-grid,
.highlight-list,
.signal-strip-list,
.heatmap-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.24) transparent;
}

.summary-grid::-webkit-scrollbar,
.highlight-grid::-webkit-scrollbar,
.highlight-list::-webkit-scrollbar,
.signal-strip-list::-webkit-scrollbar,
.heatmap-scroll::-webkit-scrollbar {
  height: 6px;
}

.summary-grid::-webkit-scrollbar-thumb,
.highlight-grid::-webkit-scrollbar-thumb,
.highlight-list::-webkit-scrollbar-thumb,
.signal-strip-list::-webkit-scrollbar-thumb,
.heatmap-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 999px;
}

.heatmap-table {
  border-collapse: collapse;
  width: 100%;
  min-width: var(--table-min, 760px);
  table-layout: fixed;
}

.heatmap-table th,
.heatmap-table td {
  border-bottom: 1px solid var(--line);
  padding: 0;
  text-align: center;
  height: 38px;
  font-size: 12px;
}

.heatmap-table th {
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 800;
}

.heatmap-table th:first-child,
.heatmap-table td:first-child {
  width: 160px;
  text-align: left;
  padding: 6px 8px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}

.heatmap-cell {
  background: rgba(11, 107, 88, var(--alpha, 0));
  color: var(--cell-text, #25313d);
  font-weight: 800;
}

.side-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.rec-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: var(--surface-2);
}

.rec-card strong {
  display: block;
}

.rec-card span {
  color: var(--muted);
  font-size: 12px;
}

.model-rec.is-grouped {
  border-color: #b9c9dc;
  background: #f7fbff;
}

.model-rec small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.empty-state,
.error-state {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.error-state {
  color: var(--bad);
}

.report-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.report-hero h2 {
  font-size: 22px;
  line-height: 1.3;
}

.report-hero p:not(.eyebrow) {
  color: var(--muted);
  margin-top: 7px;
  max-width: 900px;
}

.report-summary {
  margin-top: 13px;
  margin-bottom: 0;
}

.report-panel h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.value-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 8px;
  padding: 8px;
}

.value-card-list.compact {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.value-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-2);
}

.value-card.hit {
  border-left-color: var(--hit);
}

.value-card.near {
  border-left-color: var(--warn);
}

.value-card.miss {
  border-left-color: var(--line-strong);
}

.value-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.value-card h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  border-radius: 999px;
  background: var(--head);
  color: #fff;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.value-horses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.value-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.value-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.value-reason {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

@media (max-width: 920px) {
  .site-header {
    display: block;
    padding: 0 10px;
  }

  .site-header-inner {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 10px;
  }

  .status-row {
    justify-content: flex-end;
    margin-top: 0;
    gap: 5px;
  }

  main {
    padding: 9px 8px 24px;
  }

  .view-tabs {
    margin-bottom: 10px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-bar {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 8px;
  }

  .search-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .race-list {
    grid-template-columns: 1fr;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .detail-shell {
    display: block;
  }

  .race-hero-top {
    display: block;
  }

  .share-button {
    width: 100%;
    margin-top: 10px;
  }

  .pick-grid {
    grid-template-columns: 1fr;
  }

  .rank-row,
  .horse-row,
  .market-row,
  .bet-signal {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    row-gap: 6px;
  }

  .rank-row .num-stat,
  .horse-row .num-stat,
  .market-row .num-stat,
  .bet-signal .num-stat {
    grid-column: 2;
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 8px;
    text-align: left;
  }

  .rank-row .num-stat span,
  .horse-row .num-stat span,
  .market-row .num-stat span,
  .bet-signal .num-stat span {
    font-size: 11px;
  }

  .rank-row .num-stat .meter,
  .horse-row .num-stat .meter,
  .market-row .num-stat .meter {
    margin-top: 0;
  }

  .market-row .pick-line {
    grid-column: 1 / -1;
  }

  .bet-signal-main {
    grid-column: 1 / -1;
  }

  .bet-signal p {
    grid-column: 1 / -1;
  }

  .market-note {
    display: block;
  }

  .market-note span {
    display: block;
    margin-top: 3px;
  }

  .signal-strip-head {
    display: block;
  }

  .signal-strip-head span {
    display: block;
    margin-top: 2px;
  }

  .signal-legend {
    display: flex !important;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    white-space: normal;
    font-size: 10.5px;
  }

  .signal-strip-list {
    grid-template-columns: 1fr;
  }

  .heatmap-table th:first-child,
  .heatmap-table td:first-child {
    width: 124px;
  }

  .value-card-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 18px;
    white-space: nowrap;
  }

  .eyebrow {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .status-row span {
    padding: 3px 6px;
    font-size: 10.5px;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    overscroll-behavior-x: contain;
    margin: 0 0 5px;
    padding: 0;
  }

  .summary-grid,
  .highlight-grid,
  .highlight-list,
  .signal-strip-list,
  .heatmap-scroll {
    scrollbar-width: none;
  }

  .summary-grid::-webkit-scrollbar,
  .highlight-grid::-webkit-scrollbar,
  .highlight-list::-webkit-scrollbar,
  .signal-strip-list::-webkit-scrollbar,
  .heatmap-scroll::-webkit-scrollbar {
    display: none;
  }

  .summary-card {
    min-width: 0;
    padding: 4px 3px;
    text-align: center;
  }

  .summary-card strong {
    display: block;
    font-size: 14px;
    line-height: 1.1;
  }

  .summary-card span,
  .summary-card small {
    font-size: 8.5px;
    line-height: 1.1;
  }

  .summary-label-full {
    display: none !important;
  }

  .summary-label-short {
    display: block !important;
  }

  .summary-card small {
    display: none;
  }

  .highlight-section {
    margin: 0 0 6px;
    padding: 0;
  }

  .highlight-section .section-head {
    margin-bottom: 3px;
  }

  .highlight-section .section-head h2 {
    font-size: 15px;
  }

  .highlight-section .section-head p {
    display: none;
  }

  .highlight-toggle > summary {
    min-height: 44px;
    padding: 7px 8px;
    gap: 7px;
  }

  .highlight-toggle > summary strong {
    font-size: 12px;
  }

  .highlight-toggle > summary span {
    display: none;
  }

  .highlight-toggle > summary small {
    font-size: 10px;
  }

  .highlight-toggle .highlight-grid {
    padding: 5px;
  }

  .highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }

  .highlight-group {
    min-width: 0;
  }

  .highlight-group h3 {
    padding: 4px 5px;
    font-size: 11px;
  }

  .highlight-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .highlight-more {
    border-top: 0;
  }

  .highlight-more > summary {
    padding: 4px 5px;
    font-size: 10px;
  }

  .highlight-extra {
    grid-template-columns: 1fr;
  }

  .highlight-card {
    min-height: 43px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 4px 5px;
  }

  .highlight-card:last-child {
    border-bottom: 0;
  }

  .highlight-card:nth-child(2n),
  .highlight-card:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .highlight-card:last-child {
    border-bottom: 0;
  }

  .highlight-card > span,
  .highlight-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8.5px;
    line-height: 1.12;
  }

  .highlight-card strong {
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
  }

  .highlight-card .pick-line {
    gap: 3px;
    margin-top: 2px;
  }

  .highlight-card .horse-badge {
    width: 21px;
    min-width: 21px;
    height: 21px;
    border-radius: 4px;
    font-size: 10px;
  }

  .highlight-card .horse-name {
    font-size: 10.5px;
  }

  .control-bar {
    grid-template-columns: 104px minmax(0, 1fr) 66px;
    gap: 6px;
    margin-bottom: 7px;
    padding: 6px;
    align-items: end;
  }

  .field {
    gap: 2px;
    font-size: 10px;
  }

  .field > span {
    display: none;
  }

  .field input,
  .field select {
    height: 32px;
    border-radius: 6px;
    padding: 0 6px;
    font-size: 12px;
  }

  .search-field {
    grid-column: auto;
    grid-row: auto;
  }

  .section-head {
    align-items: center;
    margin: 2px 0 4px;
  }

  .section-head h2 {
    font-size: 15px;
  }

  .section-head p {
    margin-top: 0;
    font-size: 10px;
  }

  .race-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
  }

  .pick-card {
    padding: 7px;
  }

  .pick-card .horse-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .pick-card .horse-name {
    font-size: 13px;
  }

  .race-hero {
    padding: 9px;
    margin-bottom: 10px;
  }

  .race-hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px;
  }

  .race-hero h2 {
    font-size: 17px;
    line-height: 1.22;
  }

  .race-hero .eyebrow {
    font-size: 10px;
  }

  .frame-legend {
    margin-top: 4px;
    gap: 3px;
  }

  .frame-legend > span,
  .frame-legend small {
    display: none;
  }

  .frame-dot {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .share-button {
    width: auto;
    min-width: 54px;
    height: 34px;
    margin-top: 0;
    padding: 0 9px;
  }

  .race-notice {
    margin-top: 7px;
    padding: 5px 7px;
    font-size: 11px;
    line-height: 1.3;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .race-notice span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .race-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 5px;
    row-gap: 4px;
    padding: 6px 7px;
    border-left-width: 4px;
  }

  .race-card-head,
  .race-picks,
  .race-card > .prob-line {
    grid-column: 1 / -1;
  }

  .race-list {
    gap: 7px;
  }

  .race-card-head {
    gap: 6px;
    align-items: center;
  }

  .race-meta {
    gap: 3px;
    margin-top: 3px;
  }

  .race-title h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    font-size: 13px;
    line-height: 1.18;
  }

  .pill {
    min-height: 19px;
    padding: 1px 5px;
    font-size: 10px;
  }

  .race-card .grade-pill {
    min-width: 23px;
    height: 23px;
    padding: 0;
    font-size: 10px;
  }

  .race-picks {
    gap: 5px;
    margin-top: 5px;
  }

  .pick-mini {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    column-gap: 4px;
    row-gap: 3px;
    align-items: center;
    padding: 5px;
  }

  .pick-mini label,
  .pick-card label {
    font-size: 11px;
  }

  .pick-mini label {
    grid-row: 1 / span 2;
    align-self: center;
    margin-bottom: 0;
    font-size: 10px;
  }

  .pick-mini .pick-line,
  .pick-mini .metric-pair {
    grid-column: 2;
  }

  .pick-mini .pick-line {
    gap: 4px;
  }

  .pick-mini .horse-badge {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 11px;
  }

  .pick-mini .horse-name {
    font-size: 12px;
    line-height: 1.15;
  }

  .metric-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .pick-mini .metric-pair {
    gap: 3px;
  }

  .metric-pair span {
    display: block;
    padding: 3px 4px;
    font-size: 10.5px;
  }

  .pick-mini .metric-pair span {
    padding: 2px 3px;
    font-size: 9.5px;
  }

  .metric-pair strong {
    display: block;
    margin-top: 1px;
    font-size: 11.5px;
  }

  .pick-mini .metric-pair strong {
    font-size: 10.5px;
  }

  .metric-pair.prominent {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .metric-pair.prominent span {
    display: block;
  }

  .metric-pair.prominent strong {
    display: block;
    margin-top: 2px;
  }

  .signal-strip-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 6px;
  }

  .signal-strip {
    margin-top: 7px;
  }

  .signal-strip-head {
    display: flex;
    align-items: center;
    padding: 6px 7px;
  }

  .signal-strip-head span {
    margin-top: 0;
    font-size: 10px;
  }

  .signal-card {
    min-width: 0;
    padding: 5px;
  }

  .signal-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .signal-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    gap: 4px;
    margin-top: 2px;
    font-size: 11px;
  }

  .signal-card .horse-badge {
    width: 22px;
    min-width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 10px;
  }

  .signal-card small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    font-size: 10.5px;
    line-height: 1.2;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .panel {
    margin-bottom: 9px;
  }

  .panel h3 {
    padding: 8px 9px;
    font-size: 13px;
  }

  .rank-more > summary,
  .horse-more > summary {
    padding: 7px 8px;
    font-size: 12px;
  }

  .rank-row {
    grid-template-columns: 24px minmax(0, 1fr) 48px 54px 52px;
    gap: 5px;
    align-items: center;
    padding: 7px 8px;
  }

  .rank-row > div:nth-child(2) {
    min-width: 0;
  }

  .rank-row .pick-line,
  .market-row .pick-line,
  .horse-row .pick-line,
  .bet-signal-main {
    min-width: 0;
  }

  .rank-row .horse-name,
  .market-row .horse-name,
  .horse-row .horse-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
  }

  .rank-row .signal-chip-row {
    margin-top: 2px;
    gap: 2px;
  }

  .rank-row .signal-chip {
    min-height: 16px;
    padding: 1px 4px;
    font-size: 9.5px;
  }

  .rank-row .component-mini,
  .horse-row .component-mini {
    max-width: none;
    margin-top: 4px;
    padding: 5px;
  }

  .rank-row .component-mini {
    display: none;
  }

  .rank-row .component-mini-head,
  .horse-row .component-mini-head {
    gap: 4px;
    font-size: 9.5px;
  }

  .rank-row .component-mini-head strong,
  .horse-row .component-mini-head strong {
    font-size: 10.5px;
  }

  .rank-row .component-mini-head em,
  .horse-row .component-mini-head em {
    font-size: 9px;
  }

  .rank-row .component-bar,
  .horse-row .component-bar {
    grid-template-columns: 46px minmax(34px, 1fr) 36px;
    gap: 4px;
    font-size: 9.5px;
  }

  .rank-row .num-stat,
  .market-row .num-stat,
  .bet-signal .num-stat,
  .horse-row .num-stat {
    grid-column: auto;
    display: block;
    text-align: right;
  }

  .rank-row .num-stat span,
  .market-row .num-stat span,
  .bet-signal .num-stat span,
  .horse-row .num-stat span {
    font-size: 9.5px;
    line-height: 1.1;
  }

  .rank-row .num-stat strong,
  .market-row .num-stat strong,
  .bet-signal .num-stat strong,
  .horse-row .num-stat strong {
    font-size: 11.5px;
    line-height: 1.15;
  }

  .rank-row .meter {
    height: 3px;
    margin-top: 3px;
  }

  .market-note {
    padding: 7px 8px;
  }

  .market-note span {
    margin-top: 2px;
    font-size: 10.5px;
  }

  .market-row {
    grid-template-columns: minmax(0, 1fr) 34px 39px 30px 44px 45px;
    gap: 4px;
    align-items: center;
    padding: 7px 8px;
  }

  .market-row .pick-line {
    grid-column: auto;
  }

  .bet-signal-shell {
    gap: 7px;
    padding: 7px;
  }

  .bet-signal-summary {
    gap: 5px;
    padding: 7px;
  }

  .bet-signal-summary-card {
    grid-template-columns: minmax(0, 1fr) 38px 60px 30px;
    gap: 4px;
    padding: 6px;
    border-radius: 7px;
  }

  .bet-signal-summary-card > div:first-child span {
    font-size: 9.5px;
  }

  .bet-signal-summary-card > div:first-child strong {
    font-size: 12px;
  }

  .bet-detail-toggle > summary {
    padding: 7px 8px;
    font-size: 12px;
  }

  .bet-group-head {
    padding: 7px 8px;
  }

  .bet-group-head strong {
    font-size: 13px;
  }

  .bet-signal {
    grid-template-columns: minmax(0, 1fr) 50px 48px 38px;
    gap: 5px;
    align-items: center;
    padding: 7px 8px;
  }

  .bet-signal-main {
    grid-column: auto;
  }

  .bet-signal-main strong {
    font-size: 13px;
  }

  .bet-signal-main span {
    font-size: 10.5px;
  }

  .bet-signal p {
    grid-column: 1 / -1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 1.25;
  }

  .horse-row {
    grid-template-columns: minmax(0, 1fr) 48px 52px 36px;
    gap: 5px;
    align-items: center;
    padding: 7px 8px;
  }

  .horse-row > div:first-child {
    display: none;
  }

  .horse-row > div:nth-child(2) {
    min-width: 0;
  }

  .horse-row .mark-cloud,
  .horse-row .signal-chip-row {
    margin-top: 3px;
    gap: 3px;
  }

  .horse-row .mark-pill,
  .horse-row .signal-chip {
    min-height: 17px;
    padding: 1px 4px;
    font-size: 9.5px;
  }

  .heatmap-scroll {
    overflow-x: hidden;
  }

  .heatmap-table {
    width: 100%;
    min-width: 100% !important;
    table-layout: fixed;
  }

  .heatmap-table th,
  .heatmap-table td {
    height: 29px;
  }

  .heatmap-table th:first-child,
  .heatmap-table td:first-child {
    width: 112px;
    padding: 3px 5px;
  }

  .heatmap-table th:not(:first-child) {
    font-size: 8px;
    font-weight: 800;
  }

  .heatmap-table td:not(:first-child) {
    font-size: 0;
  }

  .heatmap-table td:first-child .horse-badge {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 11px;
  }

  .heatmap-table td:first-child .horse-name {
    display: inline-block;
    max-width: 68px;
    vertical-align: middle;
    font-size: 10.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .value-mini,
  .bet-mini {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 4px;
    margin-top: 0;
    padding: 4px 5px;
  }

  .value-mini > span,
  .bet-mini > span {
    margin-bottom: 0;
    font-size: 9.5px;
  }

  .value-mini .pick-line {
    min-width: 0;
    gap: 3px;
  }

  .value-mini .horse-badge {
    width: 20px;
    min-width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 9.5px;
  }

  .value-mini .horse-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
  }

  .value-mini .prob-line,
  .bet-mini .prob-line {
    display: none;
  }

  .bet-mini strong {
    min-width: 0;
    font-size: 10.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .race-card > .prob-line {
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .race-hero h2 {
    font-size: 17px;
  }

  .horse-name {
    white-space: normal;
    line-height: 1.25;
  }

  .tab-button {
    flex: 1 1 0;
    padding: 0 8px;
  }

  .report-hero h2 {
    font-size: 18px;
  }

  .report-hero {
    padding: 10px;
    margin-bottom: 9px;
  }

  .report-hero p:not(.eyebrow) {
    margin-top: 5px;
    line-height: 1.45;
  }

  .value-card-list {
    gap: 6px;
    padding: 6px;
  }

  .value-card {
    padding: 7px;
  }

  .value-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
  }

  .value-card h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
  }

  .result-badge {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10.5px;
  }

  .value-horses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 6px;
  }

  .value-horses > div {
    min-width: 0;
  }

  .value-label {
    margin-bottom: 2px;
    font-size: 9.5px;
  }

  .value-card .pick-line {
    gap: 4px;
  }

  .value-card .horse-badge {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 11px;
  }

  .value-card .horse-name {
    font-size: 12px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .value-meta {
    gap: 4px;
    margin-top: 6px;
  }

  .value-meta .pill {
    min-height: 17px;
    padding: 1px 4px;
    font-size: 9px;
  }

  .value-reason {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 16px;
  }

  .site-header {
    padding: 0 8px;
  }

  .site-header-inner {
    gap: 6px;
    padding: 7px 0;
  }

  .status-row {
    gap: 3px;
  }

  .status-row span {
    padding: 3px 4px;
    font-size: 9.5px;
  }

  .summary-card strong {
    font-size: 13px;
  }

  .summary-card span {
    font-size: 8px;
  }

  .highlight-card {
    min-height: 39px;
  }
}

@media (min-width: 921px) {
  .race-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 8px;
  }

  .race-card {
    padding: 8px;
  }

  .race-title h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
  }

  .race-meta {
    gap: 3px;
    margin-top: 4px;
  }

  .race-card .pill {
    min-height: 18px;
    padding: 1px 5px;
    font-size: 10px;
  }

  .race-card .grade-pill {
    min-width: 23px;
    height: 23px;
    padding: 0;
    font-size: 10px;
  }

  .race-picks {
    gap: 5px;
    margin-top: 6px;
  }

  .race-card .pick-mini {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    column-gap: 4px;
    row-gap: 3px;
    align-items: center;
    padding: 5px;
  }

  .race-card .pick-mini label {
    grid-row: 1 / span 2;
    align-self: center;
    margin-bottom: 0;
    font-size: 10px;
  }

  .race-card .pick-mini .pick-line,
  .race-card .pick-mini .metric-pair {
    grid-column: 2;
  }

  .race-card .pick-mini .pick-line {
    gap: 4px;
  }

  .race-card .pick-mini .horse-badge {
    width: 23px;
    min-width: 23px;
    height: 23px;
    border-radius: 4px;
    font-size: 10.5px;
  }

  .race-card .pick-mini .horse-name {
    font-size: 11.5px;
    line-height: 1.15;
  }

  .race-card .pick-mini .metric-pair {
    gap: 3px;
    margin-top: 0;
  }

  .race-card .pick-mini .metric-pair span {
    padding: 2px 3px;
    font-size: 9.5px;
  }

  .race-card .pick-mini .metric-pair strong {
    margin-top: 1px;
    font-size: 10.5px;
  }

  .race-card .value-mini,
  .race-card .bet-mini {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 5px;
    row-gap: 2px;
    margin-top: 5px;
    padding: 5px;
  }

  .race-card .value-mini > span,
  .race-card .bet-mini > span {
    grid-row: 1 / span 2;
    margin-bottom: 0;
    font-size: 9.5px;
    writing-mode: horizontal-tb;
  }

  .race-card .value-mini .pick-line {
    min-width: 0;
    gap: 3px;
  }

  .race-card .value-mini .horse-badge {
    width: 20px;
    min-width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 9.5px;
  }

  .race-card .value-mini .horse-name,
  .race-card .bet-mini strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.2;
  }

  .race-card .value-mini .prob-line,
  .race-card .bet-mini .prob-line {
    grid-column: 2;
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9.5px;
    line-height: 1.2;
  }

  .race-card > .prob-line {
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }
}

@media (min-width: 921px) {
  .report-hero {
    display: grid;
    grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .report-hero h2 {
    font-size: 20px;
  }

  .report-hero p:not(.eyebrow) {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
  }

  .report-hero > .eyebrow,
  .report-hero > h2,
  .report-hero > p:not(.eyebrow) {
    grid-column: 1;
  }

  .report-hero > .eyebrow {
    align-self: end;
  }

  .report-hero > h2 {
    align-self: center;
  }

  .report-summary {
    grid-column: 2;
    grid-row: 1 / span 3;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
  }

  .report-summary .summary-card {
    padding: 8px 10px;
  }

  .report-summary .summary-card strong {
    font-size: 20px;
  }

  .value-card-list,
  .value-card-list.compact {
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .value-card {
    padding: 7px;
    border-radius: 7px;
  }

  .value-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .value-card h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
  }

  .result-badge {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10.5px;
  }

  .value-horses {
    gap: 5px;
    margin-top: 6px;
  }

  .value-label {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .value-card .pick-line {
    gap: 4px;
  }

  .value-card .horse-badge {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 11px;
  }

  .value-card .horse-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .value-meta {
    gap: 3px;
    margin-top: 6px;
  }

  .value-meta .pill {
    min-height: 17px;
    padding: 1px 4px;
    font-size: 9.5px;
  }

  .value-reason {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }
}

@media (min-width: 921px) {
  .site-header-inner,
  main {
    max-width: 1560px;
  }

  .site-header-inner {
    padding: 13px 0 11px;
  }

  main {
    padding: 12px 14px 36px;
  }

  h1 {
    font-size: 22px;
  }

  .view-tabs {
    gap: 7px;
    margin-bottom: 9px;
  }

  .tab-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
  }

  .summary-grid {
    gap: 8px;
    margin-bottom: 8px;
  }

  .summary-card {
    border-radius: 7px;
    padding: 8px 10px;
  }

  .summary-card span {
    font-size: 11px;
  }

  .summary-card strong {
    font-size: 20px;
  }

  .control-bar {
    grid-template-columns: 145px minmax(220px, 1fr) 130px;
    gap: 8px;
    margin-bottom: 8px;
    padding: 7px 8px;
  }

  .highlight-section {
    margin-bottom: 8px;
  }

  .highlight-toggle > summary {
    min-height: 38px;
    padding: 7px 10px;
  }

  .highlight-toggle > summary strong {
    font-size: 13px;
  }

  .highlight-toggle > summary span,
  .highlight-toggle > summary small {
    font-size: 11px;
  }

  .section-head {
    margin: 0 0 7px;
  }

  .section-head h2 {
    font-size: 15px;
  }

  .race-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px;
  }

  .race-card {
    padding: 6px;
    border-left-width: 3px;
    border-radius: 7px;
    box-shadow: var(--shadow-soft);
  }

  .race-card:hover {
    transform: none;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
  }

  .race-card-head {
    gap: 5px;
  }

  .race-title h3 {
    font-size: 12.5px;
    line-height: 1.15;
  }

  .race-meta {
    gap: 2px;
    margin-top: 3px;
  }

  .race-card .pill {
    min-height: 16px;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .race-card .grade-pill {
    min-width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .race-picks {
    gap: 4px;
    margin-top: 4px;
  }

  .race-card .pick-mini {
    grid-template-columns: 12px minmax(0, 1fr);
    column-gap: 3px;
    row-gap: 2px;
    padding: 4px;
    border-radius: 6px;
  }

  .race-card .pick-mini label {
    font-size: 9px;
  }

  .race-card .pick-mini .pick-line {
    gap: 3px;
  }

  .race-card .pick-mini .horse-badge {
    width: 20px;
    min-width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 9.5px;
  }

  .race-card .pick-mini .horse-name {
    font-size: 10.5px;
  }

  .race-card .pick-mini .metric-pair {
    gap: 2px;
  }

  .race-card .pick-mini .metric-pair span {
    padding: 1px 2px;
    font-size: 8.5px;
  }

  .race-card .pick-mini .metric-pair strong {
    font-size: 9.5px;
  }

  .race-card .value-mini,
  .race-card .bet-mini {
    margin-top: 4px;
    padding: 4px;
    border-radius: 6px;
  }

  .race-card .value-mini > span,
  .race-card .bet-mini > span {
    font-size: 9px;
  }

  .race-card .value-mini .horse-badge {
    width: 18px;
    min-width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .race-card .value-mini .horse-name,
  .race-card .bet-mini strong {
    font-size: 10px;
  }

  .race-card .value-mini .prob-line,
  .race-card .bet-mini .prob-line {
    display: none;
  }

  .race-card > .prob-line {
    margin-top: 2px;
    font-size: 9px;
  }
}
