:root {
  color-scheme: light;
  --bg: #eef2eb;
  --bg-soft: #f6f8f4;
  --panel: #ffffff;
  --surface: #f8faf7;
  --ink: #152019;
  --muted: #5f6d64;
  --line: #d5ddd6;
  --line-strong: #c3cec5;
  --accent: #0f6b52;
  --accent-soft: #e3f2eb;
  --green: #0f6b52;
  --green-soft: #e3f2eb;
  --red: #c53b2c;
  --red-soft: #fff1ee;
  --amber: #9a6408;
  --shadow-sm: 0 1px 2px rgba(21, 32, 25, 0.05);
  --shadow: 0 8px 24px rgba(21, 32, 25, 0.07);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --touch: 44px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, p { margin: 0; }

a { color: inherit; }

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 20px;
  padding: 16px max(16px, calc((100vw - 1440px) / 2 + 16px));
  padding-top: max(16px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--shadow-sm);
}

.topbar > .brand-home,
.topbar > div:first-child {
  min-width: 0;
  flex: 1 1 180px;
}

.brand-home {
  display: block;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-home:hover .eyebrow,
.brand-home:focus-visible .eyebrow {
  color: var(--accent-strong, #0f766e);
}

.brand-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin-top: 4px;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.site-nav {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  flex-shrink: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.site-nav a.active {
  background: #fff;
  color: var(--green);
  box-shadow: var(--shadow-sm);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  width: 100%;
  flex: 1 1 100%;
}

.toolbar label {
  min-width: 0;
}

.toolbar label select,
.toolbar label input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: var(--touch);
  min-height: var(--touch);
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.toolbar-date {
  grid-column: 1 / -1;
}

input[type="date"] {
  text-align: left;
}

input[type="date"]::-webkit-date-and-time-value {
  min-height: 1em;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

select,
input[type="date"],
input:not([type="hidden"]) {
  width: 100%;
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select:focus,
input:focus {
  outline: none;
  border-color: #8ec4ae;
  box-shadow: 0 0 0 3px rgba(15, 107, 82, 0.12);
}

.odds-panel {
  position: relative;
  min-width: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.odds-panel[open] { min-width: 230px; }
.odds-panel label { margin-top: 10px; }

/* ── Layout ── */
.app-shell {
  width: min(1440px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 calc(48px + env(safe-area-inset-bottom));
}

.status {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.status.is-loading {
  border-color: #b9dcc8;
  background: #f8fcfa;
  color: var(--ink);
}

.status.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #d5e8de;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.status.warning {
  color: var(--amber);
  border-color: #ead4a8;
  background: #fffaf0;
}

.app-shell.is-page-loading #status {
  margin-bottom: 12px;
}

.app-shell.is-page-loading .pick-history {
  display: none;
}

.page-boot-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: clamp(180px, 32vh, 280px);
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.page-boot-state-compact {
  min-height: clamp(140px, 24vh, 220px);
}

.page-boot-state.is-error {
  border-color: #ebc8c0;
  background: #fff7f5;
}

.page-boot-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #d5e8de;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.page-boot-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.page-boot-state .note {
  margin: 0;
  max-width: 28em;
}

.is-loading-placeholder {
  display: none;
}

.game-feed { display: grid; gap: 14px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

/* ── Pick history ── */
.pick-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 14px;
}

.pick-history:empty {
  display: none;
  margin: 0;
}

.pick-history-dates {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0;
  padding: 2px 0 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.pick-history-dates::-webkit-scrollbar { display: none; }

.pick-history-dates button {
  flex: 0 0 auto;
  min-height: var(--touch);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pick-history-dates button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.daily-top-picks {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.top-pick-block h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.top-pick-block .note { margin: 0; }

.top-pick-table-wrap {
  border: 0;
  border-radius: var(--radius-sm);
  background: #fff;
}

.top-pick-table {
  min-width: 0;
  width: 100%;
}

.top-pick-table th,
.top-pick-table td {
  padding: 10px 8px;
  font-size: 0.78rem;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

.top-pick-table th.rank,
.top-pick-table td.rank,
.top-pick-table th.num,
.top-pick-table td.num {
  width: 52px;
  text-align: center;
  white-space: nowrap;
}

.top-pick-table td.num { font-weight: 800; color: var(--accent); }

.top-pick-table tbody tr:last-child td { border-bottom: 0; }

.confidence-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.confidence-table-block h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stats-confidence { margin-bottom: 14px; }

.stats-confidence-block + .stats-confidence-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.confidence-panel .confidence-tables { margin-top: 12px; }

.guest-comments {
  margin-bottom: 14px;
  position: relative;
}

.guest-comment-form {
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.guest-comment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.guest-comment-form input,
.guest-comment-form textarea {
  width: 100%;
  min-height: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  resize: vertical;
}

.guest-comment-form textarea { min-height: 96px; }

.guest-comment-form button {
  justify-self: start;
  min-height: var(--touch);
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.guest-comment-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.guest-comment-list {
  display: grid;
  gap: 10px;
}

.guest-comment {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.guest-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.guest-comment-headline {
  align-items: center;
}

.guest-comment-head-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.comment-admin-trigger {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.12);
  color: transparent;
  font-size: 0;
  line-height: 0;
  opacity: 0.18;
  cursor: pointer;
}

.comment-admin-trigger:hover,
.comment-admin-trigger:focus-visible {
  opacity: 0.55;
  background: rgba(15, 118, 110, 0.18);
}

.comment-admin-login {
  display: none;
  position: absolute;
  right: 10px;
  bottom: 24px;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.comment-admin-login.is-open {
  display: inline-flex;
}

.comment-admin-login input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.comment-admin-login-submit,
.comment-admin-login-cancel {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.comment-admin-login-submit {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.25);
}

.comment-admin-logout {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.guest-comment-delete {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #b42318;
  font-size: 0.72rem;
  cursor: pointer;
}

.guest-comment-delete:hover,
.guest-comment-delete:focus-visible {
  background: #fff5f5;
}

.guest-comment-head strong {
  font-size: 0.84rem;
}

.guest-comment-head time {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.guest-comment-ip {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.guest-comment p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.guest-comment-empty { margin-top: 4px; }

.guest-comment-count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

/* ── Reel card (1080x1920 export) ── */
.reel-page {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #111814;
}

.reel-card {
  width: 1080px;
  height: 1920px;
  padding: 74px 72px 68px;
  background: #111d17;
  color: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.reel-brand {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #86d6b2;
}

.reel-card h1 {
  margin: 24px 0 0;
  font-size: 76px;
  line-height: 1.12;
  letter-spacing: 0;
}

.reel-card h1 em {
  color: #86d6b2;
  font-style: normal;
}

.reel-kicker {
  margin: 18px 0 0;
  color: #aab8b0;
  font-size: 25px;
  font-weight: 800;
}

.reel-hook {
  margin: 20px 0 28px;
  color: #d9e3dd;
  font-size: 31px;
  font-weight: 800;
}

.reel-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 34px;
  border: 1px solid #3b4e43;
  border-left: 8px solid #d7a93b;
  border-radius: 8px;
  background: #1a2921;
  overflow: hidden;
}

.reel-proof div {
  padding: 26px 30px 18px;
}

.reel-proof div + div {
  border-left: 1px solid #3b4e43;
}

.reel-proof span,
.reel-proof strong {
  display: block;
}

.reel-proof span {
  color: #aab8b0;
  font-size: 22px;
  font-weight: 800;
}

.reel-proof strong {
  margin-top: 5px;
  color: #fff;
  font-size: 58px;
  font-variant-numeric: tabular-nums;
}

.reel-proof p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 30px;
  border-top: 1px solid #3b4e43;
  color: #d7a93b;
  font-size: 22px;
  font-weight: 800;
}

.reel-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.reel-section-head span {
  color: #86d6b2;
  font-size: 24px;
  font-weight: 900;
}

.reel-section-head strong {
  color: #aab8b0;
  font-size: 22px;
}

.reel-picks {
  display: grid;
  gap: 14px;
}

.reel-pick {
  padding: 24px 28px;
  border: 1px solid #3b4e43;
  border-radius: 8px;
  background: #1b2c23;
}

.reel-pick-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reel-rank,
.reel-league-badge,
.reel-result {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 18px;
  font-weight: 900;
}

.reel-rank { background: #d7a93b; color: #172018; }
.reel-league-badge { background: #334b65; color: #dcecff; }
.reel-result { margin-left: auto; background: #3a4240; color: #dce2de; }
.reel-result.win { background: #165f48; color: #d7fff0; }

.reel-matchup {
  margin: 17px 0 5px;
  color: #aab8b0;
  font-size: 23px;
  font-weight: 700;
}

.reel-selection {
  display: block;
  font-size: 42px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.reel-pick-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid #3b4e43;
}

.reel-pick-metrics span {
  padding-top: 14px;
  color: #aab8b0;
  font-size: 21px;
}

.reel-pick-metrics b {
  margin-left: 7px;
  color: #fff;
  font-size: 25px;
}

.reel-tease {
  margin-top: 26px;
  padding: 22px 26px;
  border: 1px solid #5b4772;
  border-radius: 8px;
  background: #241f2c;
}

.reel-tease span {
  display: block;
  color: #c8a9ea;
  font-size: 18px;
  font-weight: 900;
}

.reel-tease strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
}

.reel-tease p {
  margin: 7px 0 0;
  color: #c5bacf;
  font-size: 20px;
  line-height: 1.4;
}

.reel-empty {
  padding: 32px;
  border: 1px solid #3b4e43;
  color: #aab8b0;
  font-size: 24px;
}

.reel-foot {
  margin: auto 0 0;
  padding-top: 22px;
  border-top: 1px solid #3b4e43;
  font-size: 25px;
  font-weight: 800;
  color: #86d6b2;
  text-align: center;
}

.reel-error {
  margin: auto;
  font-size: 40px;
  text-align: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.subheading {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.cumulative-panel {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cumulative-panel.sub-panel {
  padding-top: 16px;
}

.cumulative-note { margin-bottom: 8px; }
.cumulative-note strong { color: var(--ink); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

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

.metric-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 0;
}

.metric-card span,
.metric-card em {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.metric-card em { margin-top: 4px; line-height: 1.35; }

.profit-pos { color: var(--accent); }
.profit-neg { color: var(--red); }

.profit-plain {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.profit-plain strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.45;
}

.profit-plain p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.profit-plain-win { background: #edf7f1; border-color: #b9dcc8; }
.profit-plain-win strong { color: #0b674d; }
.profit-plain-loss { background: #fff3f0; border-color: #ebc8c0; }
.profit-plain-loss strong { color: #a33b2c; }

.yield-explainer {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid #d7e4dc;
  border-radius: var(--radius);
  background: #f7fbf8;
}

.yield-explainer h4 {
  margin: 0 0 10px;
  color: #0b674d;
  font-size: 0.86rem;
}

.yield-explainer ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.yield-explainer li + li { margin-top: 6px; }
.yield-explainer strong { color: var(--ink); }

.daily-record {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.daily-record .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-record-table-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.daily-record-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7f5;
  box-shadow: inset 0 -1px 0 var(--line);
}

.daily-record-table td.num,
.daily-record-table th.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.daily-record-table .result-tag {
  font-size: 0.72rem;
  min-height: 24px;
  padding: 0 8px;
}

.untracked-row td {
  color: var(--muted);
  background: #fafafa;
}

.stats-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.stats-version-analysis {
  margin-bottom: 16px;
}

.stats-subhead {
  margin: 18px 0 8px;
  font-size: 0.92rem;
}

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

.stats-compare-table td.num,
.stats-compare-table th.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.detail-list { margin-top: 10px; }

.record-archive {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.record-day {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.record-day summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
  list-style: none;
  min-height: var(--touch);
}

.record-day summary::-webkit-details-marker { display: none; }

.record-day summary::before {
  content: "▸";
  margin-right: 8px;
  color: var(--muted);
}

.record-day[open] summary::before { content: "▾"; }

.record-day-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.record-table-wrap {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
}

.record-table { min-width: 820px; }

.record-table th,
.record-table td {
  font-size: 0.76rem;
  padding: 10px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.highlight-row { background: #f7fbf8; }

.result-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.result-tag.win { background: var(--accent-soft); color: var(--accent); }
.result-tag.loss { background: var(--red-soft); color: var(--red); }
.result-tag.pending { background: var(--surface); color: var(--muted); }
.result-tag.void { background: #eef1ed; color: #78827c; }

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.stat-line:first-of-type { border-top: 0; }
.stat-line span:last-child { text-align: right; font-weight: 800; }
.stat-line-stack { flex-wrap: wrap; }

.stat-line-detail {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  margin: 0 -4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.stat-line-detail + .stat-line-detail { margin-top: 8px; }

.stat-line-detail .stat-primary {
  font-weight: 800;
  line-height: 1.4;
  font-size: 0.88rem;
}

.stat-line-detail .stat-primary em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 700;
}

.stat-line-detail .stat-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  text-align: left;
}

/* ── Stats dashboard ── */
.stats-overview { margin-bottom: 14px; }

.stats-league-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-league-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stats-league-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 12px;
}

.stats-league-head h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.stats-league-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stats-league-metrics { display: grid; gap: 8px; }

.stats-metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.stats-metric span,
.stats-metric em {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.stats-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.stats-metric em { margin-top: 4px; }

.stats-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.stats-best-days { margin-bottom: 14px; }

.stats-league-days {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.stats-league-days h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.stats-day-list { display: grid; gap: 8px; }

.stats-day-row {
  display: grid;
  grid-template-columns: 110px 70px repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color 0.15s, background 0.15s;
}

.stats-day-row:active {
  background: var(--green-soft);
  border-color: #abd2c3;
}

.stats-day-date { font-weight: 900; }

.stats-day-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stats-day-row strong { color: var(--ink); }

/* ── Game cards ── */
.game-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.game-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfdfb 0%, #f6f8f4 100%);
}

.game-time {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
}

.game-card h2 {
  margin-top: 6px;
  font-size: clamp(1.05rem, 4.2vw, 1.3rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.venue {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-live { background: var(--red-soft); color: var(--red); }
.badge-final { background: #eef1ed; color: #4d5a52; }
.badge-void { background: #fff8e8; color: var(--amber); }

.pitcher-profile { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.pitcher-profile img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: top center;
  background: #f3f5f1;
}

.bullpen-panel { grid-column: 1 / -1; min-width: 0; }
.bullpen-roster { min-width: 0; margin-top: 12px; }
.bullpen-roster h4 { margin-bottom: 7px; font-size: 0.84rem; }
.bullpen-roster .table-wrap { max-width: 100%; }
.bullpen-roster table { min-width: 760px; }

.analysis-body {
  padding: 0;
  min-height: 188px;
}

.analysis-body:has(.analysis-layout),
.analysis-body:has(.loading-block.is-error) {
  padding: 14px;
  min-height: 0;
}

.loading-block {
  position: relative;
  width: 100%;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fafcf9;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.55;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #d5e8de;
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.loading-text {
  max-width: 22em;
  color: var(--ink);
}

.loading-block.is-loading {
  background: #f8fcfa;
}

.loading-block.is-loading .loading-spinner {
  animation: spin 0.75s linear infinite;
}

.loading-block.is-idle .loading-spinner {
  width: 28px;
  height: 28px;
  border-width: 2px;
  border-color: #c9ddd3;
  border-top-color: var(--accent);
  opacity: 0.85;
}

.loading-block.is-muted,
.loading-block.is-empty {
  min-height: 140px;
  padding-bottom: 24px;
  background: var(--surface);
}

.loading-block.is-empty .loading-spinner {
  width: 28px;
  height: 28px;
  border: 0;
  background: #eef1ed;
  position: relative;
}

.loading-block.is-empty .loading-spinner::after {
  content: "—";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.loading-block.is-idle .loading-spinner,
.loading-block.is-muted .loading-spinner,
.loading-block.is-empty .loading-spinner {
  animation: none;
}

.loading-block.is-error {
  min-height: auto;
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  border-style: solid;
  border-color: #ebc8c0;
  background: #fff7f5;
  color: var(--ink);
  text-align: left;
}

.loading-block.is-error strong {
  display: block;
  color: var(--red);
  font-size: 0.9rem;
}

.loading-block.is-error pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.retry-analysis {
  align-self: flex-start;
  min-height: var(--touch);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

@keyframes spin { to { transform: rotate(360deg); } }

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.75fr) minmax(600px, 1.45fr);
  gap: 14px;
  align-items: start;
}

.left-stack,
.right-stack {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pick-box {
  min-width: 0;
  padding: 14px;
  border-left: 4px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
}

.pick-box.sub {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pick-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.pick-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pick-box p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.score-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.score-team { min-width: 0; }

.score-team span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.score-team strong {
  display: block;
  margin-top: 4px;
  font-size: 1.85rem;
}

.score-dash { color: var(--muted); font-weight: 900; }

.note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-head h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.95rem;
}

.insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 12px;
}

.insight-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.insight-tag.good { border-color: #abd2c3; background: #e7f4ee; color: #0b674d; }
.insight-tag.warn { border-color: #e4b8ae; background: #fff0ed; color: #a33b2c; }
.insight-tag.neutral { background: var(--surface); color: var(--muted); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th, td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: 0.78rem;
}

th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

th:first-child,
td:first-child { text-align: left; }

td:first-child { font-weight: 800; }

.no-sample {
  color: var(--muted);
  font-size: 0.74rem;
  text-align: left;
}

td:first-child span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.data-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.data-chip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.data-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.data-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
}

.odds-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(197, 59, 44, 0.12);
}

.odds-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(115px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.odds-row strong { font-size: 0.92rem; }

.odds-trend { text-align: right; font-weight: 900; }
.odds-trend.strong { color: var(--accent); }
.odds-trend.weak { color: var(--red); }
.odds-trend.flat { color: var(--muted); }

.odds-updated {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 9px;
}

.form-head h3 { margin: 0; }

.form-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.form-head + .form-row { border-top: 0; }

.form-team { min-width: 0; }
.form-team strong,
.form-team span { display: block; overflow-wrap: anywhere; }
.form-team strong { font-size: 0.82rem; }
.form-team span { margin-top: 3px; color: var(--muted); font-size: 0.7rem; }

.form-sequence {
  display: grid;
  grid-template-columns: repeat(10, minmax(20px, 1fr));
  gap: 3px;
  width: 100%;
}

.form-result {
  width: 100%;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 900;
}

.form-result.win { background: var(--accent); }
.form-result.loss { background: var(--red); }
.form-result.draw { background: #78827c; }
.form-sequence.soccer-form { grid-template-columns: repeat(5, minmax(28px, 1fr)); }

.sweep-panel { border-color: #d7bd83; background: #fffaf0; }
.sweep-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sweep-head h3 { margin: 3px 0 0; color: var(--ink); font-size: 1rem; }
.sweep-kicker { color: var(--amber); font-size: 0.68rem; font-weight: 900; }
.sweep-summary { margin-top: 9px; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.sweep-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.sweep-metrics div { padding: 10px; border: 1px solid #e7d6ad; border-radius: var(--radius-sm); background: #fff; }
.sweep-metrics span, .sweep-metrics strong { display: block; }
.sweep-metrics span { color: var(--muted); font-size: 0.68rem; }
.sweep-metrics strong { margin-top: 4px; font-size: 0.9rem; }

/* ── Tablet ── */
@media (max-width: 1050px) {
  .analysis-layout { grid-template-columns: 1fr; }
  .right-stack { order: 2; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-league-grid { grid-template-columns: 1fr; }
}

/* ── Mobile ── */
@media (max-width: 720px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand nav"
      "tools tools";
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .topbar > .brand-home,
  .topbar > div:first-child {
    grid-area: brand;
    min-width: 0;
  }

  .site-nav {
    grid-area: nav;
    justify-self: end;
    align-self: center;
  }

  .toolbar {
    grid-area: tools;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .toolbar-date {
    grid-column: 1 / -1;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .toolbar label {
    gap: 5px;
    font-size: 0.68rem;
    margin: 0;
  }

  .toolbar label select,
  .toolbar label input[type="date"] {
    height: var(--touch);
    min-height: var(--touch);
    font-size: 16px;
    border-radius: 10px;
  }

  .odds-panel { grid-column: 1 / -1; }

  .app-shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .status {
    margin-bottom: 12px;
    padding: 12px 14px;
    font-size: 0.84rem;
  }

  .page-boot-state {
    min-height: clamp(160px, 28vh, 240px);
    padding: 24px 16px;
  }

  .pick-history { gap: 14px; }

  .daily-top-picks { padding: 12px; gap: 12px; }

  .confidence-tables { grid-template-columns: 1fr; gap: 12px; }

  .top-pick-table th,
  .top-pick-table td {
    padding: 9px 6px;
    font-size: 0.74rem;
  }

  .panel { padding: 14px; border-radius: var(--radius); }

  .game-card-head {
    flex-direction: row;
    align-items: flex-start;
    padding: 14px;
  }

  .game-card-head > div { min-width: 0; flex: 1; }

  .pick-grid,
  .metric-grid,
  .metric-grid-3,
  .data-strip {
    grid-template-columns: 1fr;
  }

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

  .odds-row { grid-template-columns: 1fr auto; }
  .odds-trend { grid-column: 1 / -1; text-align: left; }

  .form-sequence { grid-template-columns: repeat(10, minmax(18px, 1fr)); }

  .sweep-metrics { grid-template-columns: 1fr; }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .record-day summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px;
  }

  .record-day-meta { text-align: left; }

  .stat-line:not(.stat-line-detail) {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .stat-line:not(.stat-line-detail) span:last-child { text-align: left; }

  .pick-history-dates button {
    min-height: 40px;
    padding: 0 14px;
  }

  .stats-day-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 14px;
  }

  .stats-day-row > :first-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .stats-day-meta { font-size: 0.7rem; }

  .analysis-body,
  .loading-block {
    min-height: 160px;
  }

  .loading-block {
    padding: 18px 14px;
    font-size: 0.84rem;
  }

  .loading-spinner,
  .loading-block.is-loading .loading-spinner {
    width: 30px;
    height: 30px;
  }
}

/* Stats page: no toolbar */
.topbar:not(:has(.toolbar)) {
  grid-template-areas:
    "brand nav";
}

@media (max-width: 720px) {
  .topbar:not(:has(.toolbar)) {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
}

.version-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.version-badge.standard {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.version-badge.detail {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
}

body.detail-mode .pick-box.detail-pick {
  border-color: rgba(168, 85, 247, 0.35);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.02));
}

.detail-metrics-panel {
  border-color: rgba(168, 85, 247, 0.25);
}

.detail-pick-history {
  border-left: 3px solid rgba(168, 85, 247, 0.45);
}

/* Scan-first UI polish */
:root {
  --bg: #f1f4f0;
  --bg-soft: #f7f9f6;
  --surface: #f7f9f7;
  --line: #d2dad4;
  --line-strong: #b8c5bc;
  --shadow-sm: 0 1px 2px rgba(15, 31, 22, 0.05);
  --shadow: 0 6px 18px rgba(15, 31, 22, 0.07);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 8px;
}

body,
h1,
h2,
h3,
h4,
.eyebrow {
  letter-spacing: 0;
}

.topbar {
  align-items: center;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: 14px;
  border-bottom-color: #304138;
  background: #17231d;
  color: #fff;
  box-shadow: 0 4px 16px rgba(10, 22, 15, 0.14);
}

.topbar .eyebrow { color: #7fd1ad; }
.topbar h1 { color: #fff; }

.site-nav {
  border-color: #3b4b42;
  background: #223129;
}

.site-nav a { color: #b9c5be; }

.site-nav a.active {
  background: #fff;
  color: var(--accent);
  box-shadow: none;
}

.toolbar {
  grid-template-columns: minmax(160px, 0.75fr) minmax(160px, 0.75fr) minmax(250px, 1.5fr);
  gap: 12px;
}

.toolbar label { color: #c7d2cb; }
.toolbar-date { grid-column: auto; }

.toolbar label select,
.toolbar label input[type="date"],
.odds-panel {
  border-color: #516158;
  background: #fff;
}

.app-shell {
  width: min(1360px, calc(100% - 24px));
  padding-top: 14px;
}

.panel,
.game-card,
.stats-league-card,
.record-day,
.status {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.panel { padding: 16px; }

.section-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-head h2,
.section-head h3 {
  font-size: 1rem;
}

.section-badge,
.version-badge,
.result-tag,
.badge,
.insight-tag {
  border-radius: 6px;
}

.stats-version-analysis,
.stats-confidence,
.stats-best-days,
.guest-comments {
  margin-bottom: 12px;
}

.visitor-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: -2px 0 12px;
}

.visitor-stats > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.visitor-stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.visitor-stats strong {
  color: var(--accent);
  font-size: 1.05rem;
  text-align: right;
}

@media (max-width: 480px) {
  .visitor-stats > div {
    flex: 1 1 130px;
    min-width: 0;
  }
}

.stats-version-analysis .table-wrap,
.stats-confidence .table-wrap {
  margin-top: 8px;
}

.stats-version-analysis table,
.stats-confidence table {
  min-width: 620px;
  table-layout: fixed;
}

.stats-version-analysis th,
.stats-version-analysis td,
.stats-confidence th,
.stats-confidence td {
  padding: 9px 10px;
}

.stats-league-grid { gap: 10px; }

.stats-league-card {
  padding: 14px;
  border-top: 3px solid var(--accent);
}

.stats-league-head { margin-bottom: 9px; }

.stats-league-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stats-metric {
  min-width: 0;
  padding: 10px;
  background: #f5f8f5;
}

.stats-metric strong {
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.stats-link {
  min-height: 36px;
  margin-top: 7px;
}

.stats-day-list { gap: 5px; }

.stats-day-row {
  grid-template-columns: 84px 58px repeat(3, minmax(0, 1fr));
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 6px;
}

.stats-day-row:hover {
  border-color: #9fbaab;
  background: #f6faf7;
}

.stats-league-days {
  margin-top: 12px;
  padding-top: 12px;
}

.game-card-head {
  padding: 14px 16px;
  border-top: 3px solid var(--accent);
  background: #f8faf8;
}

body.detail-mode .game-card-head {
  border-top-color: #7b5fb1;
  background: #faf8fc;
}

body.detail-mode .pick-box.detail-pick {
  border-color: #9d87c2;
  background: #f7f3fb;
}

.analysis-body:has(.analysis-layout),
.analysis-body:has(.loading-block.is-error) {
  padding: 12px;
}

.analysis-layout { gap: 12px; }
.left-stack,
.right-stack { gap: 10px; }

.pick-grid { gap: 8px; }

.pick-box {
  padding: 12px;
  border-left-width: 3px;
}

.pick-box strong { font-size: 1rem; }
.pick-box p { font-size: 0.72rem; }

.mini-grid { gap: 0 10px; }

.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #a7b5ab #eef2ef;
}

th {
  background: #f1f5f2;
  color: #526158;
}

tbody tr:nth-child(even) td { background: #fafbfa; }
tbody tr:hover td { background: #f2f8f4; }

@media (max-width: 1050px) {
  .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-league-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "tools";
    gap: 10px;
    padding: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .topbar:not(:has(.toolbar)) {
    grid-template-columns: 1fr;
    grid-template-areas: "brand";
    min-height: 66px;
  }

  .topbar h1 {
    margin-top: 2px;
    font-size: 1.28rem;
  }

  .site-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid #34463c;
    border-radius: 0;
    background: #17231d;
    box-shadow: 0 -5px 18px rgba(10, 22, 15, 0.16);
  }

  .site-nav a {
    min-height: 44px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.76rem;
  }

  .site-nav a.active {
    background: #e8f3ed;
    color: #0c6049;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-color: #42544a;
    border-radius: 8px;
  }

  .toolbar-date {
    grid-column: 1 / -1;
    padding-top: 8px;
  }

  .app-shell {
    width: calc(100% - 16px);
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .panel { padding: 12px; }

  .status {
    min-height: 42px;
    margin-bottom: 8px;
    padding: 9px 11px;
    border-radius: 6px;
  }

  .section-head {
    gap: 5px;
    padding-bottom: 8px;
  }

  .stats-version-analysis,
  .stats-confidence,
  .stats-best-days,
  .guest-comments {
    margin-bottom: 8px;
  }

  .confidence-table-block,
  .confidence-tables > * {
    min-width: 0;
  }

  .confidence-table-block .table-wrap {
    width: 100%;
    max-width: 100%;
  }

  .stats-league-grid { gap: 8px; }

  .stats-league-card {
    padding: 11px;
  }

  .stats-league-head {
    margin-bottom: 7px;
  }

  .stats-league-head h2 { font-size: 1rem; }

  .stats-league-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .stats-metric {
    padding: 8px 6px;
    text-align: center;
  }

  .stats-metric span,
  .stats-metric em {
    font-size: 0.62rem;
  }

  .stats-metric strong {
    font-size: 0.82rem;
    overflow-wrap: anywhere;
  }

  .stats-link {
    width: 100%;
    min-height: 36px;
    justify-content: center;
    margin-top: 6px;
    border-top: 1px solid var(--line);
  }

  .stats-day-row {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
  }

  .stats-day-row > :first-child {
    grid-column: 1 / -1;
  }

  .stats-day-row > span:not(:first-child):not(.stats-day-meta) {
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }

  .game-card {
    min-height: 180px;
    border-radius: 8px;
  }

  .game-card-head {
    padding: 11px 12px;
  }

  .game-card h2 {
    margin-top: 3px;
    font-size: 1rem;
  }

  .venue {
    margin-top: 3px;
    font-size: 0.7rem;
  }

  .analysis-body:has(.analysis-layout),
  .analysis-body:has(.loading-block.is-error) {
    padding: 8px;
  }

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

  .pick-box {
    min-height: 112px;
    padding: 10px;
  }

  .pick-box strong {
    font-size: 0.88rem;
  }

  .pick-box p {
    font-size: 0.67rem;
    line-height: 1.4;
  }

  .data-chip { padding: 10px; }

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

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

  .daily-record-table th:first-child,
  .daily-record-table td:first-child,
  .record-table th:first-child,
  .record-table td:first-child,
  .stats-compare-table th:first-child,
  .stats-compare-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
  }

  .daily-record-table thead th:first-child,
  .record-table thead th:first-child,
  .stats-compare-table thead th:first-child {
    z-index: 3;
    background: #edf3ef;
  }

  .odds-row {
    padding: 8px 0;
  }
}
