:root {
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --sim: #3fb950;
  --live: #d29922;
  --journal: #58a6ff;
  --you: #e08532;
  --model-fade: #d29922;
  --both: #3fb950;
  --predictions: #a371f7;
  --logo-plate: #d8dde3;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  min-width: 0;
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.switcher a, .chip {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}
.switcher a.active-simulation, .switcher a.active-research, .switcher a.active-board { background: #16351f; color: var(--sim); border-color: var(--sim); }
.switcher a.active-live, .switcher a.active-journal { background: #0d2137; color: var(--journal); border-color: var(--journal); }
.switcher a.active-predictions, .switcher a.active-adjustments { background: #2a1f3d; color: var(--predictions); border-color: var(--predictions); }
.switcher a.active-ratings { background: #1c2a3a; color: var(--accent); border-color: var(--accent); }
.switcher a.active-rankings, .switcher a.active-records { background: #2a2416; color: var(--warn); border-color: var(--warn); }
.switcher a.active-game { background: #1c2a3a; color: var(--accent); border-color: var(--accent); }
main { padding: 1.25rem 1.5rem 3rem; max-width: 1200px; margin: 0 auto; min-width: 0; }
.banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #21262d;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; }
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}
.stat span { display: block; color: var(--muted); font-size: 0.75rem; }
.stat strong { font-size: 1.25rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 1.25rem; min-width: 0; }
.color-legend {
  list-style: none;
  margin: 0 0 0.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.color-legend .swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -0.05rem;
  border: 1px solid var(--border);
}
.color-legend .swatch.fill-you { background: var(--you); border-color: var(--you); }
.color-legend .swatch.fill-model { background: var(--model-fade); border-color: var(--model-fade); }
.color-legend .swatch.fill-both { background: var(--both); border-color: var(--both); }
.color-legend .swatch.warning-chip { background: var(--bad); border-color: var(--bad); }
.error-caption, .error-stats { color: var(--muted); font-size: 0.8rem; }
.error-league p { margin: 0.35rem 0; }
.error-league .error-stats { margin-top: 0.45rem; }
.game-miss { margin-top: 0.75rem; color: var(--muted); font-size: 0.85rem; }
.game-miss p { margin: 0.3rem 0; }
@media (min-width: 960px) {
  .error-panel { grid-column: 1 / -1; }
}
a.scan-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.scan-card[hidden],
.game-card[hidden] {
  display: none;
}
a.scan-card:hover { border-color: var(--accent); }
.scan-card .team.home .team-identity { margin-left: auto; flex-direction: row-reverse; }
.scan-card .team strong { display: flex; }
.scan-slot .empty { margin: 0.35rem 0 0; }
.record-col { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.record-col small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 500; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-width: 0;
  max-width: 100%;
}
h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.slate-label { color: var(--muted); font-weight: 500; }
.line-clock {
  margin: -0.15rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  max-width: 100%;
}
.line-clock time { font-variant-numeric: tabular-nums; }
.line-full { display: inline; }
.line-abbrev { display: none; }
.line-bit { white-space: nowrap; }
.line-track {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
  min-width: 0;
}
.line-track .line-full,
.line-track .line-abbrev {
  flex-wrap: wrap;
  column-gap: 0.35rem;
  row-gap: 0.1rem;
  min-width: 0;
  max-width: 100%;
}
.line-track .line-full { display: flex; }
.line-track .line-abbrev { display: none; }
.empty { color: var(--muted); }
canvas { width: 100%; max-height: 240px; }
.chores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin: 0 0 1rem;
}
.chores button {
  font: inherit;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: #1c2a3a;
  color: var(--accent);
  cursor: pointer;
}
.chores button:disabled { opacity: 0.6; cursor: wait; }
.chore-status {
  color: var(--muted);
  font-size: 0.85rem;
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0;
}
.chore-state-running { color: var(--warn); }
.chore-state-succeeded { color: var(--good); }
.chore-state-failed { color: var(--bad); }
.filters { margin-bottom: 1rem; color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.league-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.65rem; }
.filters form.week-form { display: inline-flex; align-items: center; margin: 0; }
.filters label { display: inline-flex; align-items: center; gap: 0.4rem; }
.filters select {
  font: inherit;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.filters a { margin-right: 0; }
.filters a.is-current { color: var(--text); font-weight: 600; }
.team-search { margin-left: auto; }
.team-search input {
  width: min(22rem, 100%);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.board-panel { min-width: 0; }
.game-list { display: flex; flex-direction: column; gap: 0.85rem; }
.game-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1117;
  padding: 0.85rem 1rem 0.7rem;
  min-width: 0;
  max-width: 100%;
}
.game-card.fill-you { background: #2a1a0c; border-color: var(--you); }
.game-card.fill-model { background: #2a2108; border-color: var(--model-fade); }
.game-card.fill-both { background: #10261a; border-color: var(--both); }
.game-card.has-warning { box-shadow: inset 0 0 0 2px var(--bad); }
.market.fill-you { background: #3a241055; border-color: #e0853266; }
.market.fill-model { background: #3d2e1055; border-color: #d2992266; }
.market.fill-both { background: #16351f55; border-color: #3fb95066; }
.market.has-warning { box-shadow: inset 0 0 0 1px var(--bad); }
.info-chip, .warning-chip, .you-chip, .model-chip, .both-chip {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
}
.warning-chip { color: var(--bad); border-color: var(--bad); }
.you-chip { color: var(--you); border-color: var(--you); }
.model-chip { color: var(--model-fade); border-color: var(--model-fade); }
.both-chip { color: var(--both); border-color: var(--both); }
.warning-text { color: var(--bad); }
.model-ticket-list { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.85rem; }
.ticket-modal {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 1rem 1.1rem 1.2rem;
  max-width: 42rem;
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}
.ticket-modal::backdrop { background: #00000088; }
.ticket-modal code { white-space: nowrap; }
.modal-actions { display: flex; gap: 0.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
#open-add-ticket {
  position: relative;
  font: inherit;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #21262d;
  color: var(--text);
  cursor: pointer;
}
#open-add-ticket .btn-icon { display: none; }
.reconsider-badge { position: relative; }
.reconsider-badge .badge-icon { display: none; }
.panel-head h2 { margin: 0; }
.journal-filters label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; }
.journal-filters input, .journal-filters select {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
}
.pred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 0.85rem; margin-top: 1rem; min-width: 0; }
.team-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--team-color, var(--border));
  border-radius: 10px;
  background: var(--panel);
  padding: 0.85rem 1rem;
  min-width: 0;
  max-width: 100%;
}
.team-card.reconsider { box-shadow: inset 0 0 0 2px var(--bad); }
.reconsider-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.reconsider-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}
.ack-reconsider {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #21262d;
  color: var(--text);
  cursor: pointer;
}
.team-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
}
.team-card header h2 { margin: 0; min-width: 0; max-width: 100%; flex: 1 0 auto; font-size: 1rem; font-weight: 700; }
.header-chips { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; margin-left: auto; }
.club-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.12;
  min-width: 0;
}
.club-full { display: flex; flex-direction: column; min-width: 0; }
.club-place, .club-nick { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-abbrev { display: none; white-space: nowrap; }
.name-abbrev { display: none; }
img.team-logo, img.chip-logo, .team-mark {
  background: var(--logo-plate);
  box-sizing: content-box;
}
img.team-logo, img.chip-logo { object-fit: contain; }
img.team-logo, .team-mark.team-logo {
  width: 32px;
  height: 32px;
  padding: 3px;
  border-radius: 6px;
}
img.chip-logo, .team-mark {
  width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
}
.team-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 12px;
}
.team-mark.team-logo { font-size: 18px; }
.team.home .club-name { align-items: flex-end; }
.named-team .club-name,
.team-identity .club-name { font-size: 0.95rem; font-weight: 700; }
.note-row { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: var(--muted); }
.note-row input {
  font: inherit;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
}
.schedule { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.pick-strip { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.55rem; }
.pick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  color: #0d1117;
}
.pick-chip.hit { background: var(--good); }
.pick-chip.miss { background: var(--bad); color: #fff; }
.pick-chip.ungraded {
  background: #21262d;
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--border);
}
.sched-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; align-items: center; min-width: 0; }
.sched-row.bye { color: var(--muted); font-style: italic; }
.pick-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  width: min(100%, 18rem);
  flex: 1 1 18rem;
  min-width: 0;
  max-width: 100%;
}
.pick-winner, #open-add-ticket {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--muted);
  cursor: pointer;
}
.pick-winner { width: 100%; justify-content: center; min-width: 0; }
.pick-winner.selected {
  border-color: var(--good);
  background: var(--good);
  color: #0d1117;
}
.pick-winner:disabled { opacity: 0.35; cursor: default; }
.model-context, .rank-context { margin: 0.35rem 0 0.6rem; color: var(--muted); font-size: 0.8rem; }
.rank-context { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.audit-panel { margin-bottom: 1rem; }
.audit-list { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.7rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.rank-grip {
  display: grid;
  gap: 3px;
  width: 1.25rem;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.rank-grip span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.rank-grip:active { cursor: grabbing; }
.rank-list li.dragging { opacity: 0.45; }
.rank-list li.drop-before { border-top: 2px solid var(--accent); }
.rank-num { width: 1.5rem; color: var(--muted); }
.rank-name { flex: 1; min-width: 0; }
.ratings-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.85rem;
}
.rank-moves { display: flex; gap: 0.15rem; }
.rank-move {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.rank-move span {
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.rank-move[data-dir="up"] span { transform: translateY(2px) rotate(-135deg); }
.rank-move[data-dir="down"] span { transform: translateY(-2px) rotate(45deg); }
.rank-move:hover { color: var(--text); }
.leftover-list { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.ticket-form textarea {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
}
.book-panel { margin: 1rem 0 0; }
.book-panel .gut-book { display: grid; gap: 0.35rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.gut-book li { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.85rem; align-items: center; }
.book-meta { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.drop-ticket {
  font: inherit;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.muted { color: var(--muted); }
.research-notes { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.research-notes li { font-size: 0.85rem; }
.research-notes .info-chip { margin-left: 0.35rem; }
.game-card.noisy { border-color: var(--warn); }
.noise-chip { color: var(--warn); border-color: var(--warn); }
.market.noisy { border-color: var(--warn); background: #3d2e1055; }
.honesty-flag, .pick-flag.noisy-text { color: var(--warn); font-size: 0.8rem; grid-column: 1 / -1; }
.gut-flag { color: var(--accent); }
.mark-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.mark-row button {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--muted);
  cursor: pointer;
}
.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.65rem;
}
.league-chip, .final-chip, .noise-chip, .intl-chip {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.intl-chip {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--warn);
  border-color: var(--warn);
  vertical-align: middle;
}
.final-chip { color: var(--warn); border-color: var(--warn); }
.matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}
.team { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; max-width: 100%; }
.team.home { text-align: right; }
.team .loc { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.team strong { font-size: 1.35rem; letter-spacing: 0.02em; min-width: 0; max-width: 100%; }
.team .score { color: var(--accent); font-weight: 700; }
.at { color: var(--muted); font-weight: 700; padding-inline: 0.35rem; white-space: nowrap; }
.markets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.market {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #161b22;
  border: 1px solid transparent;
  font-size: 0.85rem;
}
.market.picked { border-color: #3fb95066; background: #16351f55; }
.market-name { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 0.15rem; }
.market-lines { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
.market-lines > span { min-width: 0; max-width: 100%; }
.market-lines em { color: var(--muted); font-style: normal; margin-right: 0.3rem; font-size: 0.75rem; }
.pred-quotes {
  flex: 1 0 100%;
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.pred-quotes li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  align-items: baseline;
  min-width: 0;
}
.quote-market {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 4.5rem;
}
.cap-flag {
  color: var(--warn);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  margin-left: 0.25rem;
}
.cap-clamp { color: var(--warn); font-size: 0.85rem; margin: 0.35rem 0 0; }
.cap-list { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.adjust-entry { flex: 1 0 100%; margin-top: 0.35rem; }
.adjust-entry summary { cursor: pointer; color: var(--accent); font-size: 0.8rem; }
.adjust-form { margin-top: 0.45rem; }
.adjust-help { margin: 0.5rem 0 0; font-size: 0.8rem; }
.evidence-fields {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}
.evidence-fields legend { padding: 0 0.35rem; font-size: 0.8rem; color: var(--muted); }
.adjust-status { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.35rem 0; }
.adjust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.adjust-row { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.adjust-row:first-child { border-top: 0; padding-top: 0; }
.adjust-lines { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }
.pick-flag {
  grid-column: 1 / -1;
  color: var(--good);
  font-size: 0.8rem;
  font-weight: 600;
}
.ticket-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
}
.ticket-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); }
.ticket-form input, .ticket-form select, .inline-form input {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
}
.ticket-form button, .inline-form button, .drop-journal {
  font: inherit;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #21262d;
  color: var(--text);
  cursor: pointer;
}
.span-2 { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.form-error { color: var(--bad); font-size: 0.8rem; margin: 0.35rem 0 0; }
.form-error:empty { display: none; }
.inline-form .form-error { flex-basis: 100%; margin: 0; }
.ticket-confirm {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: 22rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--good);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 24px #00000066;
}
.ticket-confirm:empty { display: none; }
.journal-book-label { margin: 1rem 0 0.35rem; font-size: 1.05rem; }
.paper-panel { margin-top: 1.25rem; }
.journal-table { font-size: 0.85rem; width: 100%; }
.journal-table td { vertical-align: top; }
.journal-table .ticket-cell { width: 100%; }
.journal-filters select { min-width: 14rem; }
.leg-line { margin-top: 0.2rem; }
.leg-line a, .leg-line .leg-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  border-bottom: 2px solid var(--team-color, transparent);
  padding-bottom: 0.05rem;
}
.leg-copy { flex: 0 1 auto; min-width: 0; }
.slate-on-leg { display: block; margin-bottom: 0.1rem; }
.matchup a { color: inherit; }
a.pick-chip { color: inherit; }
a.pick-chip.miss { color: #fff; }
a.game-link { color: inherit; }
.chip-line { min-width: 0; }
.pick-chip time,
.game-link time { white-space: nowrap; }
.pull-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin: 1rem 0; }
.pull-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; color: var(--muted); }
.pull-form input, .pull-form select {
  font: inherit;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.pull-form button {
  font: inherit;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: #1c2a3a;
  color: var(--accent);
  cursor: pointer;
}
.matchup-block { margin-top: 1rem; }
.matchup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.8rem; }
.named-team, .team-identity, .stat-head, .rank-bit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.named-team, .team-identity {
  border-bottom: 3px solid var(--team-color, var(--border));
  padding-bottom: 0.12rem;
}
.vs { color: var(--muted); font-weight: 600; }
.stat-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0 1rem; font-size: 0.85rem; }
.stat-table th, .stat-table td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
.stat-table th:first-child { color: var(--muted); font-weight: 600; }
.stat-table th.colored { border-bottom: 3px solid var(--team-color, var(--border)); }
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }
.site-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: #0d1117;
}
.site-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--team-color, var(--border));
}
.site-card.is-neutral::before {
  background: linear-gradient(90deg, var(--team-color, var(--border)), var(--team-color-b, var(--border)));
}
.site-card h3 { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.4rem; font-size: 1rem; }
.real-game .team.home .team-identity { margin-left: auto; flex-direction: row-reverse; }
.real-game .team strong { display: flex; }
.rank-bit { margin-right: 0.75rem; border-bottom: 2px solid var(--team-color, transparent); }
.site-card p { margin: 0.2rem 0; }
.meeting-list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
.real-game { scroll-margin-top: 1rem; }
.real-game.is-opened { outline: 2px solid var(--accent); outline-offset: 2px; }
.conditions { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem 1rem; margin: 0.6rem 0; }
.conditions div { margin: 0; }
.conditions dt { color: var(--muted); font-size: 0.72rem; }
.conditions dd { margin: 0; }
.factor-list { list-style: none; margin: 0.3rem 0 0.6rem; padding: 0; max-width: 22rem; }
.factor-list li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding: 0.2rem 0; font-variant-numeric: tabular-nums; }
.real-game h3 { margin: 0.4rem 0; font-size: 0.95rem; }

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 1024px) {
  a.scan-card {
    display: block;
  }
  .switcher a,
  .filters a,
  .leftover-list a,
  .reconsider-list a,
  a.game-link,
  a.pick-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
  }
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }
  .switcher a,
  .filters a,
  .rank-grip,
  .rank-move,
  .reconsider-list a {
    min-width: 44px;
  }
  .rank-move {
    width: 44px;
    height: 44px;
  }
  .leg-line a {
    min-height: 44px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .line-clock {
    margin-top: 0;
  }
  .line-full { display: inline; }
  .line-abbrev { display: none; }
  .line-track .line-full { display: flex; }
  .line-track .line-abbrev { display: none; }
  .journal-filters label {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 0;
  }
  .journal-filters input,
  .journal-filters select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .market { grid-template-columns: 1fr; }
  .line-clock {
    margin: 0.2rem 0 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
  }
  .line-full { display: none; }
  .line-abbrev { display: inline; }
  .line-track { font-size: 0.7rem; }
  .line-track .line-full { display: none; }
  .line-track .line-abbrev {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.35rem;
    row-gap: 0.1rem;
  }
  .board-panel h2 {
    line-height: 1.35;
  }
  .journal-filters label {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .journal-filters input,
  .journal-filters select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .club-full,
  .name-full { display: none; }
  .club-abbrev,
  .name-abbrev { display: inline; }
  .leg-copy {
    white-space: nowrap;
    min-width: max-content;
  }
  .leg-line a { min-height: 44px; }

  .book-panel .table-scroll {
    overflow: visible;
  }
  .journal-table thead {
    display: none;
  }
  .journal-table,
  .journal-table tbody {
    display: block;
    width: 100%;
  }
  .journal-table tr.journal-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "status book book"
      "ticket ticket ticket"
      "stake odds pnl"
      "actions actions actions";
    gap: 0.35rem 0.75rem;
    margin: 0 0 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0d1117;
  }
  .journal-table tr.journal-row td {
    display: block;
    width: auto;
    min-width: 0;
    border: 0;
    padding: 0;
  }
  .journal-table td[data-label="Status"] { grid-area: status; }
  .journal-table td[data-label="Book"] { grid-area: book; }
  .journal-table td.ticket-cell { grid-area: ticket; }
  .journal-table td[data-label="Stake"] { grid-area: stake; }
  .journal-table td[data-label="Odds"] { grid-area: odds; }
  .journal-table td[data-label="P&L"] { grid-area: pnl; }
  .journal-table td[data-label="Actions"] { grid-area: actions; }
  .journal-table td[data-label="Stake"]::before,
  .journal-table td[data-label="Odds"]::before,
  .journal-table td[data-label="P&L"]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .reconsider-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }
  .reconsider-badge .badge-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .reconsider-badge .badge-icon { display: inline; font-weight: 700; }

  #open-add-ticket {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
  }
  #open-add-ticket .btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  #open-add-ticket .btn-icon { display: inline; }

  .rank-grip {
    width: 44px;
    height: 44px;
    padding: 0;
    align-content: center;
    justify-items: center;
  }
  .rank-grip span {
    width: 14px;
    height: 2px;
  }
  .game-card .rank-context {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
  .matchup { align-items: end; }
  .matchup .at {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    margin: 0;
    padding: 0 0.35rem;
    line-height: 1;
  }
}

