/* No web fonts: the system font stack is fast and private. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5d636e;
  --line: #e2e0da;
  --accent: #1f5f8b;
  --ball: #eef2f6;
  --ball-text: #1d1f23;
  --hit: #1f5f8b;
  --hit-text: #ffffff;
  --bonus: #fbe9c8;
  --bonus-text: #6b4300;
  --bonus-hit: #b86e00;
  --note-bg: #fff6e0;
  --note-line: #e8c76a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1d2025;
    --text: #e8e6e1;
    --muted: #a2a7b0;
    --line: #33373e;
    --accent: #7db7e0;
    --ball: #2a2e35;
    --ball-text: #e8e6e1;
    --hit: #7db7e0;
    --hit-text: #10161c;
    --bonus: #3d3220;
    --bonus-text: #f2d49b;
    --bonus-hit: #e9a73c;
    --note-bg: #2e2818;
    --note-line: #7a6326;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 60rem; margin: 0 auto; padding: 0 16px; }
header { padding-top: 2rem; }
h1 { margin: 0; font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
.sub, .hint, footer { color: var(--muted); }
.hint { font-size: 0.9rem; margin: 0.5rem 0; }

.disclaimer {
  margin-top: 1.25rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;   /* 0.6rem plus 30% */
  line-height: 1.4;
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-radius: 8px;
}

.latest {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.latest .when { color: var(--muted); }

.balls { display: inline-flex; gap: 0.3rem; white-space: nowrap; }
.ball {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--ball); color: var(--ball-text);
  font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 600;
}
.ball.bonus { background: var(--bonus); color: var(--bonus-text); margin-left: 0.35rem; }
/* Shared numbers: filled AND outlined, so it isn't color alone */
.ball.hit { background: var(--hit); color: var(--hit-text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--hit); }
.ball.bonus.hit { background: var(--bonus-hit); color: var(--hit-text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bonus-hit); }
.latest .ball { width: 2.5rem; height: 2.5rem; font-size: 1.05rem; }

.controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: end; }
.controls label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); gap: 0.2rem; }
input, select, button {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.35rem 0.5rem;
}
.presets { display: flex; flex-wrap: wrap; gap: 0.4rem; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
a.button-link { display: inline-block; padding: 0.35rem 0.6rem; border: 1px solid var(--accent); border-radius: 6px;
  color: var(--accent); text-decoration: none; font-weight: 600; }
a.button-link:hover { background: var(--accent); color: var(--surface); }
.range-controls { margin: 0.5rem 0 0.25rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.summary { font-weight: 600; min-height: 1.5em; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
td.date { white-space: nowrap; }
td.date small { display: block; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-weight: 700; font-size: 1.1rem; }

footer { margin-top: 3rem; padding-bottom: 2rem; font-size: 0.85rem; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .ball { width: 1.7rem; height: 1.7rem; font-size: 0.8rem; }
  th, td { padding: 0.4rem; }
}

/* Site menu (same on every page) */
.site-nav { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-nav ul { list-style: none; margin: 0 auto; padding: 0 16px; max-width: 60rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { display: inline-block; padding: 0.7rem 0; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Home page: one card per game */
.games { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin-top: 1rem; }
.game-card { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.game-card:hover { border-color: var(--accent); }
.game-card h2, .game-card h3 { margin: 0; font-size: 1.15rem; }
.game-card .when, .game-card .meta { color: var(--muted); font-size: 0.9rem; }
.game-card .go { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: auto; }
.site-nav + header { padding-top: 1.5rem; }

/* Extra line under a draw (Daily Derby horse names) and notes in the Matches column */
td small.detail { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
td.num small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); }

/* Privacy page */
.prose > * { max-width: 42rem; }
.prose h2 { margin-top: 1.75rem; }
.prose li { margin: 0.3rem 0; }
.opt-out { margin: 1rem 0; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.opt-out p { margin: 0 0 0.6rem; }
footer a, .prose a { color: var(--accent); }

/* History / Method test switch (SuperLotto) */
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tabs a { white-space: nowrap; }
.tabs a { padding: 0.35rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 0.9rem; background: var(--surface); }
.tabs a:hover { color: var(--text); border-color: var(--accent); }
.tabs a[aria-current="page"] { color: var(--hit-text); background: var(--accent); border-color: var(--accent); }

/* Method test page */
:root { --series: #2a78d6; --reference: #8b929c; }
@media (prefers-color-scheme: dark) { :root { --series: #3987e5; --reference: #6b717a; } }
.verdict { font-size: 1.1rem; font-weight: 600; margin: 0.25rem 0 1rem; max-width: 46rem; }
.tiles { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.75rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; }
.tile-label { font-size: 0.8rem; color: var(--muted); }
.tile-value { font-size: 1.3rem; font-weight: 650; line-height: 1.2; }
.tile-note { font-size: 0.75rem; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0; }
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--series); }
.key.chance { border-top: 2px dashed var(--reference); }
.key.band { height: 10px; border: 0; background: var(--reference); opacity: 0.25; border-radius: 2px; }
#legend-dist .key { width: 10px; height: 10px; border: 0; border-radius: 2px; background: var(--series); }
#legend-dist .key.chance-col { background: var(--reference); }

.chart { margin: 0; padding: 0.75rem 0.5rem 0.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .band { fill: var(--reference); opacity: 0.18; }
.chart .line-actual { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-chance { fill: none; stroke: var(--reference); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.chart .dot-actual { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .dot-chance { fill: var(--reference); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .end-label { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .end-label.strong { fill: var(--text); font-weight: 600; }
.chart .col-actual { fill: var(--series); }
.chart .col-chance { fill: var(--reference); }
.chart .col-group { outline: none; }
.chart .col-group:focus-visible rect { stroke: var(--accent); stroke-width: 2; }

.tip { position: absolute; z-index: 10; display: flex; flex-direction: column; gap: 0.1rem; max-width: 18rem;
  padding: 0.5rem 0.7rem; font-size: 0.85rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.12); pointer-events: none; }
.tip[hidden] { display: none; }
.tip span { color: var(--muted); }

.bt-table td { vertical-align: top; }
.bt-table td.list { min-width: 12rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.chip { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.45rem; padding: 0 0.25rem; border-radius: 4px;
  background: var(--ball); color: var(--ball-text); font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.bonus { background: var(--bonus); color: var(--bonus-text); }
.chip.hit { background: var(--hit); color: var(--hit-text); }
.chip.bonus.hit { background: var(--bonus-hit); }
.bonus-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.35rem; }
.bonus-row small.detail { margin: 0; }
.bt-table .balls { margin-top: 0.1rem; }
td.num small { white-space: nowrap; }
@media (max-width: 640px) {
  /* Draw-by-draw table as stacked cards on phones */
  /* (direct children only, so the prize tables inside keep their normal table layout) */
  .bt-table > thead { display: none; }
  .bt-table > tbody > tr { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 0.75rem; padding: 0.75rem 0.6rem;
    border-bottom: 1px solid var(--line); }
  .bt-table > tbody > tr > td { border: 0; padding: 0; }
  .bt-table > tbody > tr > td.list { grid-column: 1 / -1; min-width: 0; }
  .bt-table > tbody > tr > td.date + td.date { text-align: right; }
  .bt-table > tbody > tr.has-winners { border-bottom: none; padding-bottom: 0.3rem; }
  .bt-table > tbody > tr.winners-row { display: block; padding-top: 0; }
  .bt-table > tbody > tr.winners-row > td { padding: 0; }
}

/* Candidate plays page */
.note { padding: 0.6rem 0.9rem; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 8px; }
.cand { display: grid; gap: 0.9rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.cand-label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.hint a { color: var(--accent); }
.plays { list-style: none; counter-reset: play; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.plays li { counter-increment: play; display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.plays li::before { content: counter(play); min-width: 1.5rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.plays .ball { width: 2.2rem; height: 2.2rem; font-size: 0.95rem; }
@media (max-width: 640px) { .plays { grid-template-columns: 1fr; } .plays .ball { width: 2rem; height: 2rem; } }
.chip.added { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.chip.bonus.added { box-shadow: inset 0 0 0 1.5px var(--bonus-text); color: var(--bonus-text); }
.added-note { display: block; margin-top: 0.35rem; }
.cand-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 0.35rem; }
.cand-head .cand-label { margin: 0; }
.keep { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.keep select { padding: 0.2rem 0.4rem; font-size: 0.9rem; }

/* Play sheet: hidden on screen, the only thing printed from the Candidate plays page */
.sheet { display: none; }
@media print {
  @page { margin: 0.6in; }
  body.plays-page > *:not(.page-grid), .page-grid > *:not(.page-col), .page-col > *:not(main),
  body.plays-page main > *:not(#sheet) { display: none !important; }
  .page-grid, .page-col { display: block !important; max-width: none !important; padding: 0 !important; }
  body.plays-page { background: #fff; color: #000; }
  body.plays-page main.wrap { padding: 0; max-width: none; }
  .sheet { display: block; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #000; }
  .sheet-brand { margin: 0; font-size: 10pt; letter-spacing: 0.08em; text-transform: uppercase; }
  .sheet-head h2 { margin: 0.1in 0 0.05in; font-size: 20pt; }
  .sheet-head p { margin: 0; font-size: 11pt; }
  .sheet-settings { margin-top: 0.08in; padding: 0.05in 0.08in; border: 1px solid #999; }
  .sheet-settings p { margin: 0; font-size: 9.5pt; }
  .sheet-slip { break-inside: avoid; margin-top: 0.25in; }
  .sheet-slip h3 { margin: 0 0 0.06in; font-size: 13pt; }
  .sheet table { border-collapse: collapse; }
  .sheet th, .sheet td { border: 1pt solid #000; padding: 0.05in 0.12in; text-align: center; }
  .sheet thead th { font-size: 9pt; font-weight: 600; }
  .sheet tbody th { font-size: 14pt; }
  .sheet tbody td { font-size: 20pt; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 0.45in; }
  .sheet .sheet-bonus { border-left: 3pt double #000; }
  .sheet-foot { margin-top: 0.3in; font-size: 9.5pt; break-inside: avoid; }
  .sheet-foot p { margin: 0.04in 0; }
}

/* Results History: settings in a sidebar beside the results; stacked on narrow screens */
.bt-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.bt-side { position: sticky; top: 1rem; padding: 0 1rem 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; margin-top: 1.25rem; }
.bt-side h2 { margin-top: 1rem; }
.bt-side .controls { flex-direction: column; align-items: stretch; gap: 0.75rem; }
.bt-side .controls select, .bt-side .controls button, .bt-side a.button-link { width: 100%; text-align: center; }
.bt-main > section:first-child h2 { margin-top: 1.25rem; }
/* The sidebar scrolls on its own when it's taller than the window, so its lower settings are always reachable */
@media (min-width: 52.01rem) {
  .bt-side { max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
.method-line { margin: 0 0 0.35rem; font-size: 0.95rem; }
.settings-about { margin: 0 0 0.75rem; font-size: 0.85rem; }
.settings-about summary { cursor: pointer; color: var(--muted); }
.settings-about p { margin: 0.35rem 0 0; }
@media (max-width: 52rem) {
  .bt-layout { display: block; }
  .bt-side { position: static; }
  .bt-side .controls { flex-direction: row; flex-wrap: wrap; align-items: end; }
  .bt-side .controls select, .bt-side .controls button, .bt-side a.button-link { width: auto; }
}
.bt-side .hint { font-size: 0.82rem; }
.pos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0.15rem 0; }
.pos-row > small.detail { margin: 0; min-width: 2rem; }
.keep[hidden] { display: none; }
.chips > .pos-row { flex-basis: 100%; }

/* The newest draw as one line of text under a game page's heading */
.latest-line { margin: 0.5rem 0 0; color: var(--muted); }
.latest-line strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* On/off switch (a checkbox styled as a switch), e.g. "Use every number before repeating" */
.controls label.switch { flex-direction: row; align-items: center; gap: 0.55rem; font-size: 0.9rem;
  color: var(--text); cursor: pointer; min-height: 2.2rem; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative;
  width: 2.6rem; height: 1.5rem; border-radius: 999px; background: var(--line); cursor: pointer;
  transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 1.2rem; height: 1.2rem;
  border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(1.1rem); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media print { .switch { display: none; } }

/* Past draws and winners */
.past { margin-top: 2.5rem; }
.past-draws { list-style: none; margin: 0.75rem 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.past-draws > li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.pd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.pd-head .when { min-width: 15rem; color: var(--muted); font-size: 0.95rem; }
.past-draws details { margin-top: 0.35rem; }
.past-draws summary { cursor: pointer; color: var(--accent); font-size: 0.92rem; }
.pd-none { margin: 0.35rem 0 0; }
.prize-table { border-collapse: collapse; margin: 0.5rem 0 0.25rem; font-size: 0.92rem; width: auto; min-width: min(100%, 24rem); }
.prize-table th, .prize-table td { padding: 0.3rem 1.5rem 0.3rem 0; border-bottom: 1px solid var(--line); text-align: left;
  font-size: inherit; font-weight: 400; }
.prize-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.prize-table th { color: var(--muted); font-weight: 600; }
@media print { .past-draws details:not([open]) { display: none; } }
/* Winners under each draw in the draw-by-draw table */
.winners { margin-top: 0.35rem; }
.winners summary { cursor: pointer; color: var(--accent); font-size: 0.85rem; line-height: 1.35; }
.winners .prize-table { font-size: 0.85rem; }
.past-link { margin-top: 0.75rem; }
.bt-table tr.has-winners > td { border-bottom: none; padding-bottom: 0.2rem; }
.bt-table tr.winners-row > td { padding-top: 0; padding-bottom: 0.7rem; }
.winners { margin-top: 0; }
.winners summary strong { font-weight: 600; }
.prize-table td:first-child { white-space: nowrap; }
.bt-table td.built small.used { margin-top: 0.45rem; color: var(--text); }

/* Recent results near the top of a game page */
.recent { margin: 0.75rem 0 1rem; }
.recent h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.recent-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.recent-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; padding: 0.45rem 0;
  border-bottom: 1px solid var(--line); }
.recent-list .when { min-width: 11.5rem; color: var(--muted); font-size: 0.9rem; }
.recent-list .ball { width: 1.9rem; height: 1.9rem; font-size: 0.85rem; }
.recent-win { color: var(--muted); font-size: 0.85rem; }
.recent-more { margin: 0.45rem 0 0; font-size: 0.9rem; }

/* The two charts side by side when there's room (one above the other on narrow screens) */
.chart-pair { display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.chart-pair > section { display: flex; flex-direction: column; min-width: 0; }
.chart-pair > section .chart { margin-top: auto; }
.chart-pair h2 { font-size: 1.05rem; }

/* "Back to results" link above a page heading */
.back-link { margin: 0 0 0.25rem; font-size: 0.95rem; }
.back-link a { text-decoration: none; color: var(--accent); }
.back-link a:hover { text-decoration: underline; }

/* Method chooser in the "Tune the method" sidebar */
.method-hint { margin: -0.35rem 0 0.1rem; font-size: 0.82rem; }
.method-controls { display: contents; }
.method-controls[hidden] { display: none; }
label.switch[hidden] { display: none; }

/* How the methods compare */
.compare-table { width: 100%; font-size: 0.92rem; }
.compare-table td.num { font-weight: 600; font-size: 0.95rem; }
.compare-table tr.current td { background: var(--note-bg); }
.compare-table td.flag { color: var(--bonus-text); font-weight: 600; }
button.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }
.compare-table td:last-child { white-space: nowrap; }

/* "Methods tested" explainer */
.article h2 { margin-top: 2rem; }
.article h3 { margin: 1.25rem 0 0.25rem; font-size: 1rem; }
.methods-list dt { font-weight: 650; margin-top: 0.75rem; }
.methods-list dd { margin: 0.15rem 0 0; }
.methods-table { width: 100%; min-width: 30rem; font-size: 0.85rem; }
.methods-table th, .methods-table td { padding: 0.45rem 0.35rem; }
.methods-table thead th { font-size: 0.7rem; }
.methods-table th[scope="row"] { font-weight: 600; font-size: 0.75rem; }
.methods-table td .diff { display: block; font-weight: 650; font-variant-numeric: tabular-nums; }
.methods-table td .mark { display: block; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.methods-table td.v-above .mark, .methods-table td.v-below .mark { color: var(--bonus-text); font-weight: 600; }
.mark-within { font-size: 0.85em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.3em; }
.try-links li { margin: 0.25rem 0; }
.home-methods { margin: 1.5rem 0 0; font-size: 1rem; }

/* State switch (California / Texas): in the site menu, and sections on the home page */
.site-nav .state-switch { margin-left: auto; display: flex; gap: 0.25rem; align-items: center; }
.site-nav .state-switch a { padding: 0.25rem 0.6rem; margin: 0.45rem 0; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; }
.site-nav .state-switch a[aria-current="true"] { color: var(--text); border-color: var(--accent); }
.state-pick { margin: 0.5rem 0 0; font-weight: 600; }
.state-games { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.state-games > h2 { margin: 0; font-size: 1.3rem; }
@media (max-width: 40rem) { .site-nav .state-switch { margin-left: 0; } }
.methods-table caption { caption-side: top; text-align: left; font-weight: 700; font-size: 1.05rem; padding: 0 0 0.4rem; color: var(--text); }
.table-scroll + .table-scroll { margin-top: 1.5rem; }
/* My numbers: the visitor's own numbers */
.controls input[type="text"] { font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.4rem 0.55rem; min-width: 0; }
.bt-side .controls input[type="text"] { width: 100%; box-sizing: border-box; }
.mine-problem { color: #9a3b00; margin: 0; }
.mine-problem:empty { display: none; }
a.button-link[hidden], label[hidden] { display: none; }

/* Patterns in the draws */
.patterns, .fold-sec { margin-top: 2rem; }
.patterns h3 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
.pattern-notes { padding-left: 1.2rem; margin: 0; }
.pattern-notes li { margin: 0.4rem 0; line-height: 1.5; }
.patterns-table small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; white-space: nowrap; }
.patterns-table td:first-child { min-width: 9rem; }

/* Heat map (Patterns in the draws) */
.hm-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.25rem 0 0.75rem; }
.hm-controls button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.hm-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.9rem, 1fr)); gap: 4px; max-width: 40rem; }
.hm-digits { display: grid; gap: 4px; max-width: 40rem; }
.hm-row { display: grid; grid-template-columns: 5.5rem repeat(10, 1fr); gap: 4px; align-items: stretch; }
.hm-rowlabel { font-size: 0.8rem; color: var(--muted); align-self: center; }
.hm-cell { border-radius: 6px; padding: 0.3rem 0.1rem; text-align: center; border: 1px solid var(--line); min-width: 0; }
.hm-cell.hm-out { border-color: var(--text); }
.hm-num { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.hm-count { display: block; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-out .hm-count { color: var(--text); font-weight: 600; }
.hm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.hm-swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; vertical-align: middle; }
@media (max-width: 40rem) { .hm-row { grid-template-columns: 4rem repeat(10, 1fr); } .hm-rowlabel { font-size: 0.72rem; } }
.hm-cell { font: inherit; color: var(--text); cursor: pointer; }
.hm-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-key { white-space: nowrap; }
.hm-detail { font-size: 0.9rem; margin: 0.6rem 0 0; min-height: 1.4em; }
@media (max-width: 40rem) { .hm-num { font-size: 0.85rem; } .hm-count { font-size: 0.66rem; } .hm-cell { padding: 0.25rem 0; } }

/* Crowd meter (Winners dropdowns) and Popular numbers box */
.crowd { font-size: 0.88rem; margin: 0.5rem 0 0.2rem; max-width: 42rem; }
.takeaway { font-weight: 600; margin-top: 0.6rem; }

/* Explore a setting */
.ex-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.ex-pick button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ex-svg { display: block; max-width: 100%; height: auto; }
.ex-band { fill: var(--reference); fill-opacity: 0.18; }
.ex-zero { stroke: var(--reference); stroke-dasharray: 4 3; }
.ex-line { fill: none; stroke: var(--series); stroke-opacity: 0.5; stroke-width: 1.5; }
.ex-dot { fill: var(--series); cursor: pointer; }
.ex-dot.out { fill: #d66030; }
.ex-dot.here { stroke: var(--text); stroke-width: 2.5; }
.ex-dot:focus-visible { outline: none; stroke: var(--accent); stroke-width: 3; }
.ex-axis { font-size: 11px; fill: var(--muted); }
.ex-axis.here { fill: var(--text); font-weight: 700; }
/* Sliders under the tuning menus */
.menu-slider { width: 100%; margin: 0.35rem 0 0; padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
.menu-slider[hidden] { display: none; }

/* Collapsible sections: Patterns in the draws, and the result sections on a game's page */
:is(.patterns-box, .fold) > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
:is(.patterns-box, .fold) > summary::-webkit-details-marker { display: none; }
:is(.patterns-box, .fold) > summary h2 { margin: 0; display: inline-flex; align-items: center; gap: 0.5rem; }
:is(.patterns-box, .fold) > summary h2::before { content: "▸"; font-size: 0.9em; color: var(--accent); transition: transform 0.15s; }
:is(.patterns-box, .fold)[open] > summary h2::before { transform: rotate(90deg); }
:is(.patterns-teaser, .fold-teaser) { font-size: 0.9rem; color: var(--muted); }
:is(.patterns-box, .fold)[open] :is(.patterns-teaser, .fold-teaser) { display: none; }
:is(.patterns-box, .fold)[open] > summary { margin-bottom: 0.6rem; }
:is(.patterns-box, .fold) > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
#chart-running .axis, #chart-running .end-label { font-size: 13px; }

/* Best look-back */
.best-summary { font-weight: 600; margin: 0 0 0.5rem; }
.best-table small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.best-table tr.current td { background: var(--current, rgba(214, 160, 48, 0.12)); }

/* Next draw card (ticket sales / draw time): a right-hand card; full width on phones */
.draw-alert { margin: 0.75rem 0 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 8px; background: var(--surface); font-size: 0.92rem; }
.draw-alert h2 { font-size: 0.95rem; margin: 0 0 0.35rem; }
.draw-alert p { margin: 0.2rem 0; }
.draw-alert .draw-when { font-size: 1.3rem; font-weight: 700; }
.draw-alert .draw-close { font-weight: 600; }
.draw-alert .draw-when:empty, .draw-alert .draw-close:empty { display: none; }
.draw-alert .draw-rule { color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; }
.draw-alert .draw-source { color: var(--muted); font-size: 0.75rem; }
.draw-alert.soon { border-top-color: #d66030; }
.draw-alert.soon .draw-close { color: #b4501f; }
@media (prefers-color-scheme: dark) { .draw-alert.soon .draw-close { color: #f08a5d; } }

/* Results and Candidate plays: the Next draw card in its own right-hand column (laptops and up); first on phones */
.page-grid { display: flex; flex-direction: column; }
.page-grid > .draw-alert { order: -1; margin: 0.75rem 16px 0; }
.page-col > .wrap { max-width: none; }
@media (min-width: 56rem) {
  .page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 0 1.5rem; max-width: calc(60rem + 17.5rem);
                margin: 0 auto; padding: 0 16px; align-items: start; }
  .page-col > .wrap { padding: 0; }
  .page-grid > .draw-alert { order: 0; position: sticky; top: 1rem; margin: 1.5rem 0 0; }
}
.page-col > header.wrap { padding-top: 1.5rem; }
.page-grid > .draw-alert { margin-bottom: 0; }
@media (max-width: 55.99rem) { .page-col > header.wrap { padding-top: 1rem; } }

/* Results page: the right column holds the Next draw card and the Generate Numbers button, together */
.page-grid > .side-col { order: -1; margin: 0.75rem 16px 0; }
.side-col > .draw-alert { margin: 0; }
.side-col .side-plays { display: block; text-align: center; margin-top: 0.75rem; padding: 0.6rem 0.75rem; }
.side-col .side-plays[hidden] { display: none; }
@media (min-width: 56rem) {
  .page-grid > .side-col { order: 0; position: sticky; top: 1rem; margin: 1.5rem 0 0; }
}
.side-plays-note { font-size: 0.82rem; color: var(--muted); margin: 0.35rem 0.1rem 0; text-align: center; }
.side-plays-note[hidden] { display: none; }
/* "Create tickets" button: filled by default, outlined on hover (the reverse of other link buttons) */
.side-col a.side-plays { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.side-col a.side-plays:hover, .side-col a.side-plays:focus-visible { background: var(--surface); color: var(--accent); }
/* "Print play sheet" button: filled by default, outlined on hover, like "Create tickets" */
button#print { background: var(--accent); color: var(--surface); border-color: var(--accent); font-weight: 600; }
button#print:hover, button#print:focus-visible { background: var(--surface); color: var(--accent); }

/* "Tune the method": the same card look as the Next draw card (accent top edge, icon, bolder heading) */
.bt-side { border-top: 4px solid var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.bt-side h2 { display: flex; align-items: center; gap: 0.4rem; color: var(--accent); }
.bt-side .side-icon { font-size: 1.05em; }
.page-grid > .side-col .draw-alert { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }

/* Source and "not affiliated" note on game pages (Texas) */
.source-note { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0.75rem; padding-left: 0.6rem; border-left: 3px solid var(--line); max-width: 46rem; }

/* Home page state sections: the same card look as the sidebars (accent top edge, icon, accent heading, soft shadow) */
.state-games { padding: 1rem 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.state-games > h2 { display: flex; align-items: center; gap: 0.4rem; color: var(--accent); }
.state-games > h2 .state-count { margin-left: auto; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.state-games .game-card { background: var(--bg); }
.state-games .game-card:hover { background: var(--surface); }
.state-pick a { display: inline-block; margin-left: 0.3rem; padding: 0.15rem 0.7rem; border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.state-pick a:hover, .state-pick a:focus-visible { background: var(--accent); color: var(--surface); }
@media (max-width: 600px) { .state-games { padding: 0.8rem 0.75rem 1rem; } }
/* A state's name on the home page links to its page; a game's page links back to its state */
.state-games > h2 > a { color: inherit; text-decoration: none; }
.state-games > h2 > a:hover, .state-games > h2 > a:focus-visible { color: var(--accent); text-decoration: underline; }
.state-more { margin: 0.25rem 0 0.75rem; font-size: 0.9rem; font-weight: 600; }
.state-more a { color: var(--accent); }

/* Logo: magnifying glass with a lottery ball (orange 7) (header brand link and home page title) */
.lg-lens { fill: #eaf2f8; }
.lg-ring { stroke: var(--accent); fill: none; }
.lg-glint { stroke: #ffffff; opacity: 0.95; }
.lg-seven { fill: #f57c00; }
.lg-ball { fill: #ffffff; stroke: #f57c00; }
@media (prefers-color-scheme: dark) {
  .lg-lens { fill: #1d2a35; }
  .lg-glint { opacity: 0.35; }
  .lg-seven { fill: #ff8c1a; }
  .lg-ball { stroke: #ff8c1a; }
}
.site-nav a.brand { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text); }
.site-nav a.brand .logo-mark { width: 1.6rem; height: 1.6rem; flex-shrink: 0; }
.home-title { display: flex; align-items: center; gap: 0.6rem; }
.home-title .logo-big { width: 3.4rem; height: 3.4rem; flex-shrink: 0; }
@media (max-width: 30rem) { .site-nav a.brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* My picks page (and Save these plays on the Plays pages) */
.private-note { max-width: 46rem; padding: 0.6rem 0.9rem; border-left: 4px solid var(--accent); background: var(--surface);
  border-radius: 0 8px 8px 0; font-size: 0.95rem; }
.picks-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.picks-head h2 { margin: 0; }
button.button-link { padding: 0.45rem 0.8rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent);
  color: var(--surface); font: inherit; font-weight: 600; cursor: pointer; }
button.button-link:hover, button.button-link:focus-visible { background: var(--surface); color: var(--accent); }
.add-form, .save-panel { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 8px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.add-form .controls, .save-panel .controls { margin-bottom: 0.75rem; }
.add-form .grow, .save-panel .grow { flex: 1 1 14rem; }
.add-form input[type=text], .save-panel input[type=text] { width: 100%; }
.add-form textarea { width: 100%; font: 1rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0.5rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.lines-label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.add-form .bad:empty { display: none; }
.save-title { margin: 0 0 0.75rem; }
.pick-card { margin: 1rem 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pick-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.pick-top h3 { margin: 0; font-size: 1.1rem; }
.pick-label { font-weight: 400; color: var(--muted); }
.pick-meta { margin: 0.2rem 0 0.6rem; }
.slot { border-top: 1px solid var(--line); padding: 0.5rem 0; }
.slot summary { cursor: pointer; padding: 0.2rem 0; }
.slot.waiting summary { color: var(--muted); }
.slot-drawn { margin: 0.5rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pick-lines { margin: 0.5rem 0 0; padding-left: 1.6rem; display: grid; gap: 0.5rem; }
.pick-lines li { padding: 0.25rem 0.4rem; border-radius: 6px; }
.pick-lines li .balls { margin-right: 0.75rem; vertical-align: middle; }
.pick-lines li.won { background: var(--bonus); color: var(--bonus-text); }
.line-result { font-size: 0.92rem; }
.pick-lines li.won .line-result { font-weight: 700; }
.keep-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.button-like { display: inline-block; padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  cursor: pointer; font-size: 0.95rem; }
.button-like:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
button.danger { color: var(--bad, #b42318); }
button.danger-link { color: var(--bad, #b42318); }
.link-box { width: 100%; max-width: 40rem; margin-top: 0.4rem; font: 0.85rem ui-monospace, Menlo, monospace; }
.callout-box { margin: 1rem 0; padding: 0.8rem 1rem; border: 2px solid var(--accent); border-radius: 8px; background: var(--surface); }
.callout-box p { margin: 0.3rem 0; }
.sync-vote { margin-top: 2rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 8px; }
.sync-vote h2 { margin-top: 0; font-size: 1.1rem; }
#save-msg:empty, #keep-msg:empty { display: none; }
@media print { .save-panel, #save-msg, #save-plays { display: none !important; } }
:root { --bad: #b42318; }
@media (prefers-color-scheme: dark) { :root { --bad: #ff8a80; } }

/* "My picks" under "Create tickets" in the right sidebar: outlined, so Create tickets stays the main button */
.side-col a.side-picks { display: block; text-align: center; margin-top: 1rem; padding: 0.55rem 0.75rem; font-weight: 600;
  background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.side-col a.side-picks:hover, .side-col a.side-picks:focus-visible { background: var(--accent); color: var(--surface); }

/* My methods: the recipe builder on Results History */
.builder { margin: 0 0 1.5rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 8px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.builder h2 { margin-top: 0; color: var(--accent); }
/* The builder opens as a dialog over the page */
dialog.builder { width: min(46rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); overflow: auto; margin: auto;
  color: var(--text); padding: 1rem 1.25rem 1.25rem; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
dialog.builder::backdrop { background: rgba(20, 22, 26, 0.55); }
.builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  position: sticky; top: -1rem; background: var(--surface); padding-top: 1rem; margin-top: -1rem; z-index: 1; }
.builder-head h2 { margin: 0 0 0.5rem; }
.builder-x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; padding: 0.1rem 0.4rem; color: var(--muted); cursor: pointer; }
.builder-x:hover { color: var(--text); }
.builder fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0.75rem 0; padding: 0.6rem 0.8rem 0.8rem; }
.builder legend { font-weight: 700; padding: 0 0.3rem; }
.builder legend .hint { font-weight: 400; font-size: 0.85rem; }
.builder .b-name { display: block; font-weight: 600; }
.builder .b-name input { width: 100%; max-width: 24rem; margin-top: 0.25rem; }
.builder .controls { gap: 0.6rem 1rem; }
.builder #b-b { margin-top: 0.6rem; }
.builder #b-b[hidden] { display: none; }
.builder label.check { display: inline-flex; align-items: center; gap: 0.35rem; }
.builder .grow { flex: 1 1 12rem; }
.builder .grow input { width: 100%; }
.builder .bad:empty { display: none; }
.b-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 0; }
#custom-controls { display: flex; flex-direction: column; gap: 0.4rem; }
#custom-controls[hidden] { display: none; }
#custom-msg:empty { display: none; }
.custom-note { font-size: 0.92rem; max-width: 46rem; }
tr.mine-row td:first-child { font-style: italic; }
.builder .controls label.check { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; }
.builder .controls label.check input { margin: 0; width: auto; }
.b-actions button[type=submit] { background: var(--accent); color: var(--surface); border: 1px solid var(--accent); font-weight: 600; }
.b-actions button[type=submit]:hover, .b-actions button[type=submit]:focus-visible { background: var(--surface); color: var(--accent); }
.builder .b-kind { margin: 0.75rem 0 0; }
.builder #b-mix[hidden], .builder #b-swarm[hidden] { display: none; }
.agent-row { padding: 0.5rem 0 0.75rem; border-bottom: 1px dashed var(--line); }
.agent-row:last-child { border-bottom: 0; }
.agent-row .agent-h { margin: 0 0 0.3rem; }
.agent-row .controls + .controls { margin-top: 0.4rem; align-items: end; }
#b-add-agent[hidden] { display: none; }
.pd-head .pd-horses { flex-basis: 100%; margin-top: 0.15rem; }
.pd-head .pd-horses { color: var(--muted); font-size: 0.85rem; }

/* Imported lists box */
#b-lines { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.builder select { max-width: 100%; }
@media (max-width: 480px) { dialog.builder { padding: 0.75rem 0.85rem 1rem; } }
.builder .controls > label { min-width: 0; max-width: 100%; }

/* Formula box */
.formula-input { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, monospace; font-size: 1rem; padding: 0.45rem 0.6rem; }
.formula-status { margin: 0.35rem 0 0.6rem; font-size: 0.9rem; color: var(--muted); }
.formula-status.good { color: var(--good, #1e7a3c); }
.formula-status.bad { color: var(--bad, #b3261e); }
.formula-status mark { background: var(--bad, #b3261e); color: #fff; border-radius: 2px; padding: 0 2px; }
.formula-status code { font-size: 0.85rem; }
.formula-examples button { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.formula-ref summary { cursor: pointer; font-weight: 600; margin: 0.4rem 0; }
.formula-table td { padding: 0.2rem 0.6rem 0.2rem 0; vertical-align: top; font-size: 0.9rem; }
.formula-table code { white-space: nowrap; }
.builder #b-formula[hidden], .builder #b-import[hidden] { display: none; }

/* Make your own method page */
.copy-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem 0.9rem;
  padding-top: 2.2rem; overflow-x: auto; white-space: pre-wrap; font-size: 0.85rem; }
.copy-box code { font-family: ui-monospace, Menlo, monospace; }
.copy-btn { position: absolute; top: 0.4rem; right: 0.4rem; font-size: 0.8rem; padding: 0.2rem 0.6rem; }
dl.kinds dt { font-weight: 700; margin-top: 0.75rem; }
dl.kinds dd { margin: 0.15rem 0 0 1rem; }
.formula-table.examples code { white-space: normal; }

/* Top menu on one line: a little tighter on laptops; on narrow screens it scrolls sideways instead of wrapping */
.site-nav ul { gap: 0.25rem 1rem; }
.site-nav a { font-size: 0.95rem; }
.site-nav .state-switch a { font-size: 0.8rem; padding: 0.2rem 0.55rem; }
.site-nav ul { max-width: 66rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav li { flex-shrink: 0; white-space: nowrap; }
.site-nav .state-switch { margin-left: auto; padding-left: 0.5rem; }

/* My picks: each draw laid out like Draw by draw: your plays · the candidate list · the draw */
.slot-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.85fr); gap: 0.75rem 1.25rem; margin: 0.5rem 0; }
.slot-col h4 { margin: 0 0 0.4rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.slot-grid .pick-lines { margin-top: 0; }
.slot-grid .line-result { display: block; margin-top: 0.2rem; }
.cand-bonus { margin-top: 0.35rem; }
.cand-pos { align-items: center; margin-bottom: 0.25rem; }
.cand-pos .pos-name { font-size: 0.78rem; color: var(--muted); min-width: 2rem; }
.cand-caught { margin: 0.4rem 0 0; font-size: 0.88rem; font-weight: 600; }
.cand-method { margin: 0.35rem 0 0; font-size: 0.8rem; }
@media (max-width: 760px) { .slot-grid { grid-template-columns: 1fr; } .slot-grid > .slot-col:last-child { order: -1; } }

/* Method buttons (Results History and Plays sidebars) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.method-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.method-btn { width: 100%; padding: 0.45rem 0.4rem; font-size: 0.85rem; line-height: 1.2; text-align: center; border-radius: 6px; }
.method-btn[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.method-mine-h { margin: 0.25rem 0 0; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.method-mine { display: grid; grid-template-columns: 1fr; gap: 0.35rem; }
.method-btn.mine { text-align: left; padding-left: 0.65rem; }
.method-customize { display: block; width: 100%; padding: 0.45rem; font-size: 0.85rem; text-align: center; border: 1px dashed var(--accent);
  border-radius: 6px; background: transparent; color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; }
.method-customize:hover { background: var(--accent); color: var(--surface); border-style: solid; }
.bt-side .controls .method-buttons button { width: 100%; }
.method-pick { display: flex; flex-direction: column; gap: 0.3rem; }
.method-caption { font-size: 0.9rem; }
.range-controls .method-pick { flex-basis: 100%; }
.range-controls .method-buttons { max-width: 46rem; }
.range-controls .method-customize { max-width: 22rem; }
.range-controls .method-grid { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.range-controls .method-mine { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.mine-row { display: flex; gap: 0.3rem; }
.mine-row .method-btn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-side .controls .mine-row .method-gear, .method-gear { width: 2.2rem; flex: 0 0 2.2rem; padding: 0; font-size: 1rem; border-radius: 6px; }
/* Your own method's dialog: what it does, and sharing */
.b-manage { margin: 0.25rem 0 0.75rem; padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.b-desc { margin: 0 0 0.5rem; font-size: 0.92rem; }
.b-manage-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.b-manage #custom-msg:empty { display: none; }

/* Short menus as buttons (the method builder) */
.choice-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.choice-field[hidden] { display: none; }
.choice-caption { font-size: 0.85rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.choice-btn { padding: 0.3rem 0.65rem; font-size: 0.85rem; border-radius: 999px; line-height: 1.25; color: var(--text); }
.choice-btn[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.choice-note { margin: 0.1rem 0 0; font-size: 0.82rem; color: var(--muted); }
.choice-note[hidden] { display: none; }
.builder .controls > .choice-field { flex: 1 1 100%; }

/* TEST FEATURE: printing on playslips (Plays page, hidden; see slip.js) */
.slip-sheet { display: none; }
@page slip { size: 82.5mm 216mm; margin: 0; }
@media print {
  body.print-slip main > #slip-sheet { display: block !important; }
  body.print-slip #sheet { display: none !important; }
  /* Each slip a hair shorter than the page (clipped), breaking before the next one rather than after itself:
     a page filled to the exact millimetre can spill a sliver onto a blank extra page (Safari). */
  .slip-page { page: slip; width: max-content; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
  .slip-page + .slip-page { break-before: page; page-break-before: always; }
  .slip-page .slip-svg { display: block; }
  .slip-mark { fill: #000; }
  .slip-guide { stroke: #000; stroke-width: 0.15; }
  .slip-ruler { stroke-width: 0.3; }
  .slip-ruler-text { font: 2.6px sans-serif; fill: #000; }
}
.lab-btn { border-style: dashed; }
.slip-dialog { width: min(52rem, calc(100vw - 1.5rem)); }
.slip-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.slip-preview .slip-svg { width: 9.5rem; height: auto; }
.slip-paper { fill: #fff; stroke: var(--line); stroke-width: 0.3; }
.slip-bubble { fill: none; stroke: #e2a0a0; stroke-width: 0.25; }
.slip-label { font-size: 5px; fill: #c44; font-weight: 700; }
.slip-preview .slip-mark { fill: var(--accent); }
.slip-nudge { display: grid; grid-template-columns: auto 2rem 5.5rem 2rem; gap: 0.3rem 0.4rem; align-items: center; margin: 0.5rem 0; font-size: 0.85rem; }
.slip-nudge output, .slip-nudge input { text-align: center; font-variant-numeric: tabular-nums; }
.slip-nudge input { width: 100%; box-sizing: border-box; padding: 0.15rem 0.2rem; }
.slip-nudge button { padding: 0.15rem 0; }
@media (max-width: 560px) { .slip-wrap { grid-template-columns: 1fr; } }
.copyright { font-size: 0.8rem; color: var(--muted); }
.slip-cost { font-weight: 600; margin: 0.5rem 0 0.25rem; }
.beta-tag { display: inline-block; font-size: 0.65em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.1em 0.45em; border-radius: 999px; background: var(--accent); color: var(--surface); vertical-align: middle; }

/* Time Capsule (time-capsule.html, and the "Seal it" button on Results pages) */
.side-col .side-capsule { display: block; width: 100%; text-align: center; margin-top: 1rem; padding: 0.55rem 0.75rem; font: inherit;
  font-weight: 600; cursor: pointer; color: var(--accent); background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; }
.side-col .side-capsule:hover, .side-col .side-capsule:focus-visible { background: var(--accent); color: var(--surface); }
.capsule { margin: 1rem 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.capsule h3 { margin: 0 0 0.25rem; }
.capsule.opened { border-color: var(--accent); }
.capsule-meta { margin: 0.2rem 0; color: var(--muted); font-size: 0.9rem; }
.capsule-bar { height: 0.5rem; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0.5rem 0 0.75rem; }
.capsule-bar span { display: block; height: 100%; background: var(--accent); }
.capsule .verdict.flag { font-weight: 600; }
.capsule-next { margin: 0.75rem 0; padding: 0.6rem 0.75rem; border-left: 3px solid var(--accent); }
.capsule-next p { margin: 0.2rem 0 0.4rem; }
.capsule-draws summary { cursor: pointer; margin: 0.5rem 0; }
.capsule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.75rem 0 0; }
.capsule-empty ol { padding-left: 1.25rem; }
.capsule-dialog .controls.stack { flex-direction: column; align-items: stretch; }
.capsule-dialog .controls.stack > * { flex: none; }
.capsule-dialog .controls.stack p { margin: 0.25rem 0; }
.capsule-dialog button.primary, .capsule-page button.primary { background: var(--accent); color: var(--surface); border-color: var(--accent); font-weight: 600; }
.capsule-dialog button.primary:hover, .capsule-page button.primary:hover { background: var(--surface); color: var(--accent); }
.capsule-dialog [hidden] { display: none !important; }
/* My picks: "Peek into your Time Capsules" */
.peek-btn { font: inherit; font-weight: 600; cursor: pointer; padding: 0.45rem 0.9rem; color: var(--accent); background: var(--surface);
  border: 1px solid var(--accent); border-radius: 8px; }
.peek-btn:hover, .peek-btn:focus-visible { background: var(--accent); color: var(--surface); }
.peek-dialog { width: min(52rem, calc(100vw - 2rem)); }
.peek-dialog .capsule { margin: 0.75rem 0; }
/* Results page: Agent by agent (team methods) */
.agents-table .team-row th, .agents-table .team-row td { font-weight: 600; border-top: 2px solid var(--line); }
.agents-table td small { color: var(--muted); }
.agents-table tbody th { text-transform: none; letter-spacing: normal; font-weight: 500; }

/* Pools (beta): pools.html, site/pools.js */
.pool-form h3 { margin: 0 0 0.75rem; }
.pool-form textarea { width: 100%; font: 1rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0.5rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.pool-form .bad:empty { display: none; }
.pool-rules { margin: 1rem 0 0.5rem; padding: 0.5rem 0.9rem 0.25rem; border: 1px solid var(--line); border-radius: 8px; }
.pool-rules legend { font-weight: 600; padding: 0 0.3rem; }
.pool-rules input[type=number] { width: 5rem; }
.pool-card .pick-top { flex-wrap: wrap; }
.pool-role { font-size: 0.85rem; color: var(--muted); }
.member-copy { border-left: 4px solid var(--muted); }
.pool-code { margin: 0 0 0.6rem; font-size: 0.95rem; }
.pool-code strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.05em; }
.pool-warn p { margin: 0.25rem 0; }
.pool-members { border-collapse: collapse; margin: 0.5rem 0 0.75rem; font-size: 0.92rem; }
.pool-members-note { margin: 0.5rem 0 0; }
.pool-members tbody th, .pool-members tfoot th { text-transform: none; letter-spacing: normal; font-size: inherit; font-weight: 600; color: var(--text); }
.pool-members tfoot th { color: var(--muted); }
.pool-members th, .pool-members td { padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.pool-members thead th { color: var(--muted); font-weight: 600; vertical-align: bottom; }
.pool-members .num { text-align: right; font-variant-numeric: tabular-nums; }
.pool-members .paid-col { text-align: center; }
.pool-members td.is-paid { color: var(--hit); font-weight: 700; }
.pool-members td.not-paid { color: var(--muted); }
.pool-members tfoot th, .pool-members tfoot td { color: var(--muted); border-bottom: none; }
.pool-members input[type=checkbox] { width: 1.1rem; height: 1.1rem; }
button.linklike.tiny { font-size: 0.78rem; padding: 0; }
.pool-tickets { margin: 0.25rem 0 0.5rem; }
.pool-tickets summary { cursor: pointer; color: var(--accent); }
.pool-split { margin-top: 0.5rem; }
.pools-page button.primary { background: var(--accent); color: var(--surface); border-color: var(--accent); font-weight: 600; }
.pools-page button.primary:hover { background: var(--surface); color: var(--accent); }
.agreement { display: none; }
@media print {
  body.pools-page > *:not(main), body.pools-page main > *:not(#agreement) { display: none !important; }
  body.pools-page { background: #fff; color: #000; }
  body.pools-page main.wrap { padding: 0; max-width: none; }
  .agreement { display: block; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #000; font-size: 10.5pt; }
  .agreement h2 { margin: 0.08in 0 0.05in; font-size: 18pt; }
  .agreement h3 { margin: 0.18in 0 0.06in; font-size: 12pt; }
  .agreement p { margin: 0.02in 0; }
  .agreement .sheet-brand { font-size: 9pt; letter-spacing: 0.08em; text-transform: uppercase; }
  .agree-list { margin: 0; padding-left: 0.25in; }
  .agree-list li { margin: 0.04in 0; }
  .agreement table { border-collapse: collapse; }
  .agree-sign { width: 100%; }
  .agree-sign th, .agree-sign td { border: 1pt solid #000; padding: 0.05in 0.08in; text-align: left; }
  .agree-sign td { height: 0.3in; }
  .agree-sign th:nth-child(2), .agree-sign td:nth-child(2) { width: 0.6in; text-align: center; }
  .agree-sign th:nth-child(3) { width: 45%; }
  .agree-tickets th, .agree-tickets td { border: 1pt solid #000; padding: 0.02in 0.08in; text-align: center; font-variant-numeric: tabular-nums; }
  .agree-tickets .sheet-bonus { border-left: 3pt double #000; }
  .agree-sign tr, .agree-tickets tr { break-inside: avoid; }
  .agreement .sheet-foot { margin-top: 0.2in; font-size: 9pt; }
}
.fill-box { margin: 0.3rem 0 0.6rem; padding: 0.6rem 0.8rem; border: 1px dashed var(--line); border-radius: 8px; }
.fill-box .fill-title { margin: 0 0 0.4rem; font-size: 0.95rem; }
.fill-box .controls { margin-bottom: 0.2rem; align-items: end; }
.fill-box .hint:empty { display: none; }
.pool-made { margin: -0.4rem 0 0.6rem; }
.pools-page .tune-cand { margin: 0.75rem 0 0.25rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.pools-page .tune-cand .cand-label { margin: 0.4rem 0 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.pools-page .tune-cand .chips { gap: 0.2rem; }
.pools-page .tune-cand .pos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; flex-basis: 100%; }
.pools-page #range-note { font-size: 0.82rem; }
@media (max-width: 52rem) { .fill-where { display: none; } }
.pools-page .tune-cand [hidden] { display: none !important; }
@media (min-width: 52.01rem) { .pools-page .bt-side { max-height: calc(100vh - 2rem); overflow-y: auto; } }
/* "Start a pool" under My picks in the Results History right sidebar: filled, like Create tickets */
.side-col a.side-pools { display: block; text-align: center; margin-top: 1rem; padding: 0.6rem 0.75rem; font-weight: 600;
  background: var(--accent); color: var(--surface); border: 1px solid var(--accent); }
.side-col a.side-pools:hover, .side-col a.side-pools:focus-visible { background: var(--surface); color: var(--accent); }
.side-col a.side-pools[hidden], .side-col .side-plays-note[hidden] { display: none; }
/* Pools: the kind of pool (how prizes are split), and take-turns rows */
.pool-kinds { margin: 0 0 1rem; padding: 0.5rem 0.9rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 0.45rem; }
.pool-kinds legend { font-weight: 600; padding: 0 0.3rem; }
.pool-kinds .kind-opt { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.93rem; cursor: pointer; }
.pool-kinds .kind-opt input { margin-top: 0.25rem; }
.pool-kinds .kind-opt strong { display: block; }
.pool-kind { font-weight: 600; color: var(--accent); }
.pool-members .turn-row th, .pool-members .turn-row td { background: var(--surface); }
.pool-members .turn-row select { font-size: 0.85rem; max-width: 7.5rem; }
.pool-members td.not-turn { color: var(--muted); }
/* Pools: the members table in Start a pool */
.members-box { margin: 0.75rem 0 0.5rem; }
.members-box #f-members-help { margin: 0.1rem 0 0.4rem; }
.m-table { border-collapse: collapse; font-size: 0.93rem; }
.m-table th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 0.2rem 0.4rem; text-transform: none; letter-spacing: normal; }
.m-table th.num, .m-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.m-table td { padding: 0.25rem 0.4rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.m-table td.num { padding-top: 0.55rem; white-space: nowrap; }
.m-table .m-name { width: 12rem; max-width: 40vw; }
.m-table .m-err { display: block; font-size: 0.8rem; margin: 0.15rem 0 0; }
.m-table .m-err:empty { display: none; }
.m-table tr.m-bad .m-name { border-color: var(--bad, #b42318); box-shadow: 0 0 0 1px var(--bad, #b42318); }
.m-weight { white-space: nowrap; }
.m-weight .m-num-input { width: 4.2rem; text-align: center; margin: 0 0.15rem; }
.m-step, .m-move, .m-remove { min-width: 1.9rem; padding: 0.2rem 0.4rem; line-height: 1.2; }
.m-remove { color: var(--bad, #b42318); }
.m-order { white-space: nowrap; }
.m-order .m-num { display: inline-block; min-width: 1.3rem; color: var(--muted); }
.m-claim-col { text-align: center; }
.m-table th.m-claim-col { white-space: normal; max-width: 5rem; }
.m-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin: 0.5rem 0; }
.m-later { font-size: 0.88rem; color: var(--muted); }
.m-paste textarea { width: 100%; font: 0.95rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0.4rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.m-summary { font-weight: 600; margin: 0.4rem 0 0.2rem; }
.m-summary.m-ok { color: var(--ok, #1a7f37); }
.m-summary.m-off { color: var(--bad, #b42318); }
.pool-cost { margin: -0.3rem 0 0.6rem; }
@media (max-width: 40rem) {
  .m-table thead { display: none; }
  .m-table, .m-table tbody, .m-table tr { display: block; }
  .m-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
  .m-table td { display: block; border: 0; padding: 0; }
  .m-table td:nth-child(1), .m-table td:has(.m-name) { flex: 1 1 100%; }
  .m-table .m-name { width: 100%; max-width: none; }
  .m-table td.num { padding: 0; }
  .m-table td[data-part]::before { content: "Part "; color: var(--muted); font-weight: 400; }
  .m-table td[data-cost]::before { content: "Pays "; color: var(--muted); font-weight: 400; }
  .m-table td.m-claim-col::before { content: "Claims "; color: var(--muted); font-size: 0.85rem; }
}
.m-table td.num { font-size: 0.93rem; font-weight: 400; }
@media (max-width: 40rem) {
  .m-table td[data-part]:empty, .m-table td[data-cost]:empty { display: none; }
}
/* Pools: the results box at the top of a pool's card, every ticket best-first, the copy buttons */
.pool-results { margin: 0.5rem 0 0.9rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; background: var(--bg); }
.pool-results p { margin: 0.25rem 0; }
.pr-latest { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.pr-won.pr-win { font-weight: 600; color: var(--bonus-text); background: var(--bonus); display: inline-block; padding: 0.15rem 0.5rem; border-radius: 6px; }
.pr-me select { font-size: 0.9rem; }
.pr-actions { margin: 0.5rem 0 0.2rem; }
.pr-copy-box { width: 100%; font: 0.9rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 0.3rem; }
.pool-all { margin: 0.4rem 0; }
.pool-all summary { cursor: pointer; color: var(--accent); }
.all-lines li .line-result { color: var(--muted); }
.all-lines li.won .line-result { color: inherit; }
.pr-copy-wrap { margin: 0.4rem 0 0.2rem; }
.pool-members tr.is-me th, .pool-members tr.is-me td, .pool-split tr.is-me td { background: var(--note-bg); }
