/* Draw Solver web UI. Desktop layout (min 1280 px). */
@import url("table.css");
/* Figtree (SIL Open Font License), latin subset, served from /fonts. Card suits and other symbols fall back to the system font. */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(../fonts/figtree-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  /* Dark theme (GTO Wizard-like, neutral greys). Panel levels: --bg (page) < --bg-1 (panels) < --bg-2 (raised / inputs) < --bg-3 (hover). */
  --font-ui: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #111111; --bg-1: #1b1b1c; --bg-2: #242426; --bg-3: #2f3032; --border: #2c2d30; --border-strong: #45474c;
  --text: #ececee; --text-muted: #9a9a9e; --accent: #a3a9ff; --accent-strong: #7f88f7; --accent-ink: #11122a;
  --danger: #ef5350; --ok: #5fd38d; --warn: #fdb70b; --info: #5aa9e6;
  /* Action colours (sampled from GTO Wizard): fold blue, check/call green, bets/raises red (darker = bigger), all-in darkest. */
  --act-fold: #3c7bb5; --act-check: #59b765; --act-call: #59b765; --act-bet-1: #ee3c3a; --act-bet-2: #db3635;
  --act-bet-3: #c93031; --act-bet-4: #9d2726; --act-bet-5: #8c2222; --act-allin: #7e1c20; --act-draw: #c98a2b; --act-pat: #59b765;
  /* Move quality tiers, seat rings, chips, the mint call-to-action. */
  --tier-best: #59b765; --tier-correct: #59b765; --tier-inaccuracy: #fdb70b; --tier-mistake: #ef4444; --tier-blunder: #ef4444;
  --pick: #fdb70b; --ring-hero: #7f88f7; --ring-villain: #f28901; --chip-blue: #29ade4; --chip-yellow: #f2c230; --chip-red: #e2433f; --cta: #a3a9ff; --cta-ink: #11122a;
  /* Four-colour deck (table cards): white rank on a coloured card. */
  --card-s: #45464a; --card-h: #b3180e; --card-d: #2536c4; --card-c: #13a031; --card-back: #34353a;
  --felt: #1b5236; --felt-2: #10331f; --rim: #0b0c0e;
  /* Aliases used by older rules. */
  --panel: var(--bg-1); --muted: var(--text-muted); --accent-2: #23254a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font: 13px/1.35 var(--font-ui);
  color: var(--text); background: var(--bg); color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 1280px; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 18px; margin: 0 0 10px; }
h2 { font-size: 15px; margin: 14px 0 8px; }
h3 { font-size: 13px; margin: 10px 0 6px; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

#topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; height: 46px; padding: 0 16px;
  background: #0b0c0e; color: var(--text); border-bottom: 1px solid #1f2024; position: sticky; top: 0; z-index: 30; }
#topbar .brand { color: var(--text); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
#topbar .brand:hover { text-decoration: none; }
#mainnav { display: flex; gap: 2px; justify-self: center; }
#mainnav a { color: var(--text-muted); padding: 6px 12px; border-radius: 6px; font-weight: 600; }
#mainnav a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
#mainnav a.active { color: var(--accent); background: transparent; }
#usermenu { display: flex; gap: 10px; align-items: center; color: var(--text-muted); justify-self: end; }
.role { font-size: 11px; padding: 1px 7px; border-radius: 8px; background: var(--bg-3); color: var(--text); }
.role-admin { background: #5b2d78; } .role-public { background: #3d4048; }
button.link { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0; font: inherit; }
button.link:hover { color: var(--text); text-decoration: underline; }
main { padding: 14px 16px; }

button, .button {
  display: inline-block; font: inherit; padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-2); color: var(--text); cursor: pointer; white-space: nowrap;
}
button:not(.card):hover:not(:disabled), .button:hover { background: var(--bg-3); border-color: var(--border-strong); text-decoration: none; }
button:disabled { opacity: .5; cursor: default; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.small, .button.small { padding: 2px 8px; font-size: 12px; }
button.selected, .button.selected { background: var(--bg-3); border-color: var(--accent); color: var(--accent); font-weight: 600; }
input, select, textarea { font: inherit; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-2); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-strong); }
label.check { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; cursor: pointer; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.error-box { background: #3a1d1f; border: 1px solid #6b2a2e; color: #ffb4b0; padding: 10px; border-radius: 6px; }
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--bg-3); color: var(--text); border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: 6px; z-index: 50; }
#toast.error { background: var(--danger); }

/* Tables */
table.grid { border-collapse: collapse; background: var(--panel); width: 100%; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: 3px 8px; }
table.grid th { background: var(--bg-2); font-weight: 600; text-align: left; position: sticky; top: 0; z-index: 1; }
table.grid tbody tr:hover { background: var(--bg-2); }
th.sortable { cursor: pointer; user-select: none; }
th.sorted::after { content: " ▲"; font-size: 10px; } th.sorted.desc::after { content: " ▼"; }
td.actions { white-space: nowrap; width: 1%; }
td.actions > * + * { margin-left: 4px; }

/* Login */
.login-page { display: flex; justify-content: center; padding-top: 80px; }
/* Public pages: the free demos (/demo/<slug>; the root shows the default one). */
.home-page { max-width: 720px; margin: 0 auto; padding: 72px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.home-page .lead { font-size: 18px; margin: 0; }
.button.big { font-size: 18px; padding: 14px 32px; border-radius: 8px; }
#mainnav .soon:not(.active) { opacity: .6; }
#mainnav .all-games { position: relative; }
#mainnav .all-games summary { list-style: none; cursor: pointer; color: var(--text-muted); padding: 6px 12px; border-radius: 6px; font-weight: 600; }
#mainnav .all-games summary::-webkit-details-marker { display: none; }
#mainnav .all-games summary::after { content: " ▾"; font-size: 11px; }
#mainnav .all-games summary:hover, #mainnav .all-games[open] summary { color: var(--text); background: var(--bg-2); }
.all-games-menu { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 50; display: flex; gap: 22px;
  background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: 8px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.all-games-group { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.all-games-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px; }
#mainnav .all-games-menu a { padding: 5px 8px; white-space: nowrap; color: var(--text); font-weight: 500; }
#mainnav .all-games-menu a small { margin-left: 6px; font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
/* "Other games" opens on hover: an invisible bridge over the 6 px gap keeps it open while the pointer moves down to the menu. */
#mainnav .other-games .all-games-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
#mainnav .soon small { margin-left: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.login-form { width: 360px; display: flex; flex-direction: column; gap: 10px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; }
.login-form .notice { font-size: 12px; color: var(--muted); margin: 0; }

/* Tree list */
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-row { gap: 4px; }
.chip-row .chip-label { width: 92px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.chip-row button.chip { padding: 3px 11px; border-radius: 14px; font-size: 13px; background: var(--bg-1); border: 1px solid var(--border);
  color: var(--text-muted); }
.chip-row button.chip:hover:not(:disabled) { color: var(--text); background: var(--bg-2); }
.chip-row button.chip.on { background: var(--accent-2); border-color: var(--accent); color: var(--text); }
#tree-search { width: 260px; }
table.trees td.title { font-weight: 500; }

/* Strategy browser */
.browse-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.browse-head h1 { margin: 0; flex: 1; }
.navbar { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 8px; }
.nav-history { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.street { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 4px; border-radius: 6px; background: var(--bg-2); }
.street.draw { background: #2c2618; }
.street-name { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-right: 2px; }
.chip-wrap { display: inline-flex; align-items: center; }
.chip { padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.chip-wrap .chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip-wrap .chip:only-child { border-radius: 12px; }
.chip-siblings { font-size: 11px; padding: 1px 2px; border-radius: 0 12px 12px 0; border-left: none; max-width: 110px; height: 23px; }
.chip.root { font-weight: 600; }
.nav-next { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-next .to-act { font-weight: 600; margin-right: 4px; }
.nav-next button.action { min-width: 64px; }
.browse-body { display: flex; gap: 12px; align-items: flex-start; }
.browse-nav { width: 250px; flex: none; align-self: flex-start; }
/* Three columns, the same for every game: left the spot table above the hand history (sticky); centre the controls
   and the charts, which never wrap or get squeezed; right the category filters, whose width depends only on the
   screen width (never on the chart), so nothing moves when navigating. */
.browse-nav { position: sticky; top: 10px; z-index: 20; display: flex; flex-direction: column; gap: 10px; }
.browse-nav .spot-panel { width: 250px; height: 150px; padding: 0; overflow: hidden; position: relative; flex: none; }
.browse-nav .browse-table-slot, .browse-nav .browse-table-slot .ptable.compact { width: 250px; height: 150px; }
/* Up to 4 seats sit at the far left and right: the rim follows their smaller oval (browse.js: rx 35, ry 25), so seats,
   labels and the dealer button fit the panel. */
.browse-nav .browse-table-slot .ptable.compact:is([data-seats="2"], [data-seats="3"], [data-seats="4"]) .pt-rim { inset: 25% 15%; }
.browse-nav .ptable.compact { --seat: 34px; }
.browse-nav > #play-link { display: block; width: 100%; box-sizing: border-box; text-align: center; margin-top: -4px; }
.browse-nav .studybar { position: static; height: calc(100vh - 118px - 190px); min-height: 280px; }
.strategy-area { display: flex; gap: 14px; align-items: flex-start; }
.sa-center { flex: 1 1 0; }
.sa-center .mega-charts { flex-wrap: nowrap; }
.sa-center .strategy-body { min-width: max-content; }
.sa-side { width: 400px; flex: none; }
.sa-side .quick-panel { height: calc(100vh - 118px); min-height: 420px; }
@media (max-width: 1599px) { .sa-side { width: 200px; } }
/* "Play from here" in the table's top-right corner. */
.spot-panel #play-link { position: absolute; top: 8px; right: 8px; z-index: 4; }
.browse-main { flex: 1; min-width: 0; }
.browse-head .stacks-slot { margin-left: auto; }
.browse-head .stacks-slot:empty { display: none; }
@media (max-width: 1280px) {
  .browse-body { flex-wrap: wrap; }
  .browse-main { order: 3; flex-basis: 100%; }
}
/* Text filter under the tabs: field, help, Clear, then (with a filter on) "12.34% hands filtered · 3.4% absolute
   range size". One line of fixed height. */
.filter-text-row { display: flex; align-items: center; gap: 8px; height: 32px; margin-bottom: 10px; }
.filter-text-row #filter-text { flex: none; width: 260px; }
.filter-stats { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; margin-left: 6px; font-variant-numeric: tabular-nums; }
#absolute-range:not(:empty)::before { content: "·"; margin-right: 10px; color: var(--accent); font-weight: 900; }
/* Small "i": its help shows on hover or focus, never in the way. */
.info-tip { position: relative; flex: none; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text-muted); font: italic 700 11px/1 Georgia, serif; cursor: help; }
.info-tip:hover, .info-tip:focus-visible { color: var(--text); border-color: var(--text-muted); outline: none; }
.info-tip:hover::after, .info-tip:focus-visible::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); right: -6px;
  width: 230px; background: #0d0d0f; color: var(--text); border: 1px solid var(--border-strong); border-radius: 5px; padding: 7px 9px;
  font: 400 12px/1.45 var(--font-ui); white-space: pre-line; z-index: 30; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
#filter-help:hover::after, #filter-help:focus-visible::after { width: 330px; }
/* Category filters at the top of the right column: two columns, tall, scrolling inside when a game has more. */
.quick-panel { height: 470px; display: flex; flex-direction: column; background: #1c1c1e; border-radius: 8px;
  padding: 10px 12px; box-sizing: border-box; }
.quick-panel .quick-filters { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.quick-filters { columns: 2 140px; column-gap: 10px; font-size: 12px; }
/* Clear filters: bottom right of the panel. */
.quick-panel #filter-clear { align-self: flex-end; margin-top: 8px; flex: none; }
.quick-filters label.check { display: flex; margin: 0 0 2px; break-inside: avoid; }
.strategy-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
/* Action totals: one line of fixed height; the numbers sit in fixed-width slots, so filters never resize them. */
.legend { display: flex; gap: 6px; flex-wrap: nowrap; height: 30px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
/* Browse: the next-action buttons with their totals, twice as tall, bigger type and colour swatches (owner). */
.strategy-head .legend { height: 60px; gap: 8px; }
.strategy-head .legend .legend-item { height: 60px; font-size: 18px; padding: 0 14px; gap: 10px; border-radius: 8px; }
.strategy-head .legend .legend-item[data-action] { width: 210px; }
.strategy-head .legend .legend-item i { width: 24px; height: 24px; border-radius: 5px; }
.strategy-head .legend .legend-item b.num { font-size: 20px; }
.strategy-head .legend .legend-item.prev { width: 92px; font-size: 16px; }
/* Single draw: a separate Prev column, then three fixed-width actions per row. Always reserve two rows. */
.strategy-head .legend.single-draw-actions { display: grid; grid-template-columns: 92px repeat(3, 210px);
  grid-template-rows: repeat(2, 60px); grid-auto-rows: 60px; height: 128px; flex: none; }
.strategy-head .legend.single-draw-actions .legend-item.prev { grid-column: 1; grid-row: 1 / 3; align-self: start; }
/* Every action pill has the same width (Fold, Pat, Raise 3.0 …): name left, number right. */
.legend-item { flex: none; white-space: nowrap; box-sizing: border-box; }
.legend-item[data-action] { width: 138px; justify-content: flex-start; overflow: hidden; padding: 5px 8px; }
.legend-item[data-action] b.num { margin-left: auto; }
.legend-item b.num { display: inline-block; min-width: 3.1em; text-align: right; font-variant-numeric: tabular-nums; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid transparent; border-radius: 6px; padding: 5px 10px; }
.legend-item b { margin-left: 4px; }
.legend-item.clickable { cursor: pointer; transition: background .1s, border-color .1s; }
.legend-item.clickable:hover, .legend-item.clickable:focus-visible { background: var(--bg-3); border-color: var(--border-strong); outline: none; }
.legend-item i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(255,255,255,.15); }
.view-options { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; height: 36px; flex-wrap: nowrap; overflow: hidden; }
/* Browse view row: tabs | filter (+ help, stats) | view options | Stacks; fixed slots so nothing moves. */
#view-options { margin-bottom: 10px; }
#view-options .tabs-slot { flex: none; min-width: 178px; }
#view-options .filter-text-row { flex: 1 1 auto; min-width: 0; height: 36px; margin-bottom: 0; }
#view-options .filter-text-row #filter-text { width: 220px; }
#view-options .filter-stats { flex: none; width: 190px; overflow: hidden; }
#view-options .view-options-extra { display: flex; align-items: center; gap: 14px; flex: none; }
#view-options .compare-modes-slot:empty { display: none; }
.tabs { display: inline-flex; }
.tabs button { border-radius: 0; } .tabs button:first-child { border-radius: 4px 0 0 4px; } .tabs button:last-child { border-radius: 0 4px 4px 0; }
.strategy-body { overflow: auto; max-height: calc(100vh - 250px); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px; }

/* Compare trees (F10) */
/* Compare: A and B panels (side by side, or one at a time); B's note says how its history was matched. */
.compare-mapping { min-height: 22px; margin-bottom: 6px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.compare-how { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 3px; background: var(--bg-3); color: var(--text-muted); }
.compare-approximations { flex-basis: 100%; }
.compare-tabs { margin-left: auto; }
.compare-legend { margin-bottom: 8px; }
.compare-panel .strategy-body { overflow-x: auto; }
.compare-approximations { margin: 0; padding-left: 18px; color: var(--warn); font-size: 12px; }
/* Title | mapping note | legend | chart rows shared by both panels (subgrid): the charts start at the same height. */
.compare-panels { display: grid; grid-template-rows: auto auto auto auto; row-gap: 0; }
.compare-panels.side { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.compare-panel { display: grid; grid-template-rows: subgrid; grid-row: 1 / span 4; align-content: start; }
/* Replace on click: both panels in the same cell; the one not shown keeps its space (no jump on a click). */
.compare-panels.replace { grid-template-columns: minmax(0, 1fr); }
.compare-panels.replace .compare-panel { grid-column: 1; cursor: pointer; }
.compare-panels.replace .compare-panel.off { visibility: hidden; pointer-events: none; }
.compare-panel { min-width: 0; }
.compare-panel-title { margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-side { display: inline-block; min-width: 18px; text-align: center; border-radius: 4px; background: var(--bg-3); color: var(--text); font-weight: 700; padding: 0 4px; }

/* Mega charts */
.mega-charts { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.mega-block { display: grid; gap: 2px 3px; align-items: center; font-size: 12px; }
.mb-title { grid-column: span 2; text-align: right; font-weight: 700; padding-right: 4px; }
.mb-col { text-align: center; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-row { font-weight: 600; text-align: right; padding-right: 4px; white-space: nowrap; }
.weight { height: 14px; display: flex; justify-content: flex-end; }
.weight span { display: block; height: 100%; background: #6d7079; }
.cell { position: relative; height: 17px; width: 36px; }
.cell.empty { background: transparent; }
.cell .mix { position: absolute; inset: 0; }
.cell b { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 17px; font-weight: 600; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.9), 0 0 1px #000; }
.mix { display: flex; overflow: hidden; background: var(--bg-3); }
.mix span { display: block; height: 100%; }
.mix.long { height: 16px; width: 320px; }
table.long-cells { border-collapse: collapse; font-size: 12px; }
table.long-cells th, table.long-cells td { padding: 2px 6px; }
table.long-cells td.weight { width: 34px; }

/* Hand list */
table.hand-list { width: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
table.hand-list th.act-col { width: 104px; min-width: 104px; max-width: 104px; }
table.hand-list td.p, table.hand-list th.p { color: var(--text-muted); }
table.hand-list td.hand { font-weight: 600; }
table.hand-list tfoot td { font-weight: 600; background: var(--bg-2); position: sticky; bottom: 0; }

/* Cards */
.card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 62px;
  border: 1px solid #9aa3b2; border-radius: 6px; background: #fff; font-weight: 700; margin-right: 4px; padding: 0; line-height: 1; }
.card .rank { font-size: 18px; } .card .suit { font-size: 18px; }
.card.small { width: 26px; height: 34px; border-radius: 4px; margin-right: 2px; }
.card.small .rank, .card.small .suit { font-size: 11px; }
.card.suit-s { color: #111; } .card.suit-h { color: #c62828; } .card.suit-d { color: #1e5bc6; } .card.suit-c { color: #2e7d32; }
.card.back { background: repeating-linear-gradient(45deg, #34569c, #34569c 4px, #2b4884 4px, #2b4884 8px); border-color: #22386a; }
button.card { cursor: pointer; }
button.card.selected { transform: translateY(-10px); }
.cards { display: inline-flex; vertical-align: middle; }

/* Play: page layout and table are in table.css. */
.small { font-size: 12px; }
.settings-body label.disabled { opacity: .5; }

/* History / review */
.review h2, .hand-view h2 { margin-top: 18px; }
td.line { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hand-nav { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
ol.steps { margin: 8px 0; padding-left: 24px; }
ol.steps li.future { color: #5f626b; } ol.steps li.current { font-weight: 700; } ol.steps li.hero { background: var(--bg-2); }
.step-decision { margin-top: 10px; }

/* Change log */
.changelog-entry { margin-bottom: 10px; max-width: 900px; }
.changelog-entry h2 { margin-top: 0; }
.resolve-badge { background: #2a2140; border: 1px solid #5b4690; color: #cdb8f5; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
table.hand-list tr.cluster-shade td { background-color: #1e2330; }
table.hand-list tbody tr { cursor: default; }
.cluster-box { margin-bottom: 8px; font-size: 12px; max-height: 120px; overflow: auto; }

/* Admin */
.admin-tabs { margin-bottom: 12px; display: flex; gap: 4px; }
.admin-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.catalog-bulk-grants select { max-width: min(340px, 100%); }
input.wide { min-width: 420px; flex: 1; }
.entry { margin-bottom: 8px; }
.entries-table td { vertical-align: middle; }
.entries-table .emails-cell { white-space: nowrap; }
.entries-table .entry-emails-inline { width: 320px; margin-right: 4px; }
.entries-table tr.entry-detail > td { background: var(--bg); padding: 8px; }
#entry-search { width: 280px; }
#new-entry-box { margin-bottom: 8px; }
#groups-table td { vertical-align: top; }
/* Tree access picker (components/treeaccess.js). */
.ta { display: flex; flex-direction: column; gap: 8px; }
.ta-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ta-count { font-size: 16px; }
.ta-diff { font-weight: 600; }
.ta-add { color: #5fcf8a; } .ta-del { color: #f07470; }
.ta-diff-list { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 14px; max-height: 88px; overflow: auto; }
.ta-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ta-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 2px 1px 8px; border-radius: 12px; font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--border); }
.ta-chip.on { border-color: var(--accent); background: var(--accent-2); }
.ta-chip.ta-pattern, .ta-chip.ta-group { border-style: dashed; border-color: var(--border-strong); }
.ta-chip.ta-missing { color: var(--text-muted); text-decoration: line-through; }
.ta-chip.ta-invalid { border-color: var(--chip-red); color: #f07470; }
.ta-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.ta-chip button { background: none; border: none; padding: 1px 2px; color: inherit; font: inherit; }
.ta-chip button:hover:not(:disabled) { background: none; color: var(--accent); }
.ta-chip-label { font-family: ui-monospace, Menlo, monospace; }
.ta-chip-count { color: var(--text-muted); }
.ta-chip .ta-x { width: 20px; height: 20px; border-radius: 10px; color: var(--text-muted); font-size: 14px; line-height: 1; }
.ta-chip .ta-x:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.ta-picker { border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.ta-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ta-search { width: 240px; }
.ta-filter .chip { font-size: 12px; padding: 2px 10px; }
.ta-list { height: 300px; overflow: auto; padding: 4px 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  align-content: start; column-gap: 16px; }
.ta-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 2px 4px; border-radius: 4px; font-size: 13px; cursor: pointer; height: 24px; }
.ta-row:hover { background: var(--bg-2); }
.ta-row.dim .ta-title { color: var(--text-muted); }
.ta-row.in .ta-title { color: var(--text); font-weight: 600; }
.ta-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.ta-tag { font-size: 10px; padding: 0 5px; border-radius: 6px; background: var(--bg-3); color: var(--text-muted); white-space: nowrap; }
.ta-via { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
.ta-pattern { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ta-pattern-input { width: 260px; }
.ta-raw summary { cursor: pointer; }
.ta-raw-text { width: 100%; box-sizing: border-box; font-size: 12px; margin-top: 4px; word-break: break-all; }
.entry-sub { font-size: 14px; margin: 12px 0 6px; }
.entry-hidden { margin-top: 10px; } .entry-hidden > summary { cursor: pointer; margin-bottom: 6px; }
.entry-buttons { margin-top: 10px; }
.entries-table .entry-name-inline { width: 170px; }
/* Groups tab: list + editor. */
.groups-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.group-list { display: flex; flex-direction: column; gap: 3px; }
.group-item { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: left; }
.group-item.on { border-color: var(--accent); background: var(--accent-2); }
.group-item.new { color: var(--text-muted); }
.group-editor { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; min-width: 0; }
.group-head { display: flex; align-items: center; gap: 8px; }
.group-head h2 { margin: 0; }
.group-members { margin: 4px 0 10px; }
#groups-table .group-name { width: 220px; }
#groups-table .group-name .small { margin-top: 4px; white-space: normal; }
textarea.group-trees { width: 100%; min-height: 34px; resize: vertical; box-sizing: border-box; font-size: 12px; line-height: 1.45;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; word-break: break-all; }
.group-match { margin-top: 3px; }
.entry.new-entry { border-style: dashed; }
.groups label.check { font-size: 12px; }
table.grid.small { font-size: 12px; }
.notice { background: #2c2618; border: 1px solid #7a5f22; padding: 8px; border-radius: 6px; }
.design-form fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 10px; background: var(--panel); }
.design-form legend { font-weight: 600; padding: 0 4px; }
label.field { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
label.field input, label.field select, label.field textarea { color: var(--text); }
.streets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.streets textarea { width: 100%; }
.ok-box { background: #17291d; border-color: #2f5c3b; }
pre.log { background: #0b0c0e; color: #c9cbd1; padding: 8px; border-radius: 6px; max-height: 360px; overflow: auto; font-size: 11px; white-space: pre-wrap; }

/* Blockers overview (F8/D, river): a fixed column to the right of the strategy; best ranks first, a bar per rank
   around a centre axis (the average), green where holding the rank helps, red where it hurts. */
.strategy-row { display: flex; gap: 10px; align-items: flex-start; }
.strategy-row > .strategy-body { flex: 1 1 auto; }
/* With the blocker column, the strategy scrolls inside its panel rather than pushing the filters off the screen. */
.sa-center:has(#blockers) { min-width: 0; }
.sa-center .strategy-row:has(#blockers) > .strategy-body { min-width: 0; }
.blockers { width: 290px; flex: none; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 250px);
  overflow-y: auto; scrollbar-width: thin; }
.blocker-table { flex: none; padding: 10px 12px; }
.blocker-table h3 { margin: 0; font-size: 14px; }
.bt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bt-sub { margin: 3px 0 8px; font-size: 12px; color: var(--text-muted); }
.bt-rows { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.bt-rows td { padding: 2px 4px; height: 20px; }
.bt-rows th { padding: 0 4px 3px; font-size: 11px; font-weight: 500; color: var(--text-muted); text-align: left; border-bottom: 1px solid var(--border); }
.bt-rows th.num { text-align: right; }
.bt-rows tr.rare { opacity: .45; }
.bt-rank { width: 22px; font: 700 13px/1 var(--font-mono, ui-monospace, monospace); text-align: center; color: var(--text); }
.bt-val { width: 48px; color: var(--text-muted); }
.bt-bar { position: relative; }
.bt-bar .bt-axis { position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1px; background: var(--border-strong); }
.bt-bar i { position: absolute; top: 5px; bottom: 5px; border-radius: 2px; }
.bt-bar i.up { background: var(--ok); } .bt-bar i.down { background: var(--danger); }
.bt-chg { width: 62px; } .bt-chg.up { color: var(--ok); } .bt-chg.down { color: var(--danger); }
.bt-hands .filter-text-row { height: auto; margin: 0 0 4px; } .bt-hands input { flex: 1; min-width: 0; }
.blockers .info-tip:hover::after, .blockers .info-tip:focus-visible::after { right: -6px; width: 250px; }
td.delta-up { background: #17291d; } td.delta-down { background: #3a1d1f; }

.hh-asterisk { color: var(--accent); margin-left: 3px; }
.hh-approximations { margin-top: 12px; }
.hh-approximation { color: var(--accent); }

/* HH analysis: uploads and compact decisions beside the full hand history. */
.hh-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hh-form select { max-width: 520px; }
#hh-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 16px; background: var(--bg-1); border-radius: 8px; }
#hh-stats b { margin-left: 4px; }
.hh-analysis-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; align-items: start; }
.hh-findings-pane, .hh-history-pane { min-width: 0; }
.hh-history-pane { position: sticky; top: 62px; max-height: calc(100vh - 78px); overflow-y: auto; padding: 0 12px 16px; border-left: 1px solid var(--border); }
.hh-checkbox-filters { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 12px; }
.hh-filter-group { display: flex; flex-wrap: wrap; gap: 8px 12px; border: 0; padding: 0; margin: 0; }
.hh-filter-group legend { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; padding: 0; }
.hh-filter-group label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; font-size: 12px; }
.hh-filter-group input { accent-color: var(--accent); margin: 0; }
.hh-filter-row { margin-bottom: 6px; gap: 12px; }
.hh-filter-row #hh-filter { flex: 1; min-width: 0; width: auto; }
.hh-filter-row #hh-count { white-space: nowrap; font-size: 12px; }
.hh-table-wrap { max-height: calc(100vh - 290px); min-height: 140px; overflow: auto; }
#hh-findings { width: 100%; table-layout: fixed; font-size: 12px; }
#hh-findings th[data-key="position"] { width: 52px; }
#hh-findings th[data-key="hand"] { width: 122px; }
#hh-findings th[data-key="played"] { width: 82px; }
#hh-findings th[data-key="advice"] { width: 84px; }
#hh-findings th[data-key="evLoss"] { width: 52px; }
.hh-strategy-action { display: block; }
#hh-findings th, #hh-findings td { padding: 7px 6px; }
#hh-findings td.line { max-width: none; }
td.hh-card-cell { white-space: nowrap; }
#hh-findings tbody tr[data-hand], #hh-skipped tbody tr { cursor: pointer; }
#hh-findings tr.selected td { background: color-mix(in srgb, var(--accent) 15%, var(--bg-1)); }
#hh-findings tr.selected td:first-child { box-shadow: inset 3px 0 var(--accent); }
#hh-findings tr:focus-visible, #hh-skipped tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#hh-findings .card.small { width: 20px; height: 29px; font-size: 12px; }
#hh-findings .cards { gap: 2px; }
.hh-frequency { display: block; font-size: 10px; margin-top: 2px; }
.hh-skipped-section { margin-top: 16px; }
.hh-skipped-section summary { cursor: pointer; color: var(--text-muted); }
#hh-skipped td { white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
.hh-hand-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; }
.hh-hand-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; width: 100%; }
.hh-hand-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hh-hand-heading h2 { margin: 0; font-size: 16px; }
.hh-hand-heading > :not(.hh-hand-tree) { white-space: nowrap; }
.hh-hand-tree { flex: 1; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-timeline { display: flex; flex-direction: column; gap: 4px; }
.hh-event { display: grid; grid-template-columns: 100px minmax(max-content, 1fr) max-content 28px; align-items: center; gap: 8px;
  min-width: max-content; min-height: 30px; padding: 3px 6px; border-radius: 4px; background: var(--bg-1); border-left: 3px solid transparent; font-size: 12px; }
.hh-event.hero { background: var(--bg-2); }
.hh-event.has-mistake { border-left-color: #f0a3b1; }
.hh-event.focused { outline: 1px solid var(--accent); outline-offset: -1px; }
.hh-event-player { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hh-event-player small { color: var(--text-muted); font-size: inherit; font-weight: 400; }
.hh-event-action { white-space: nowrap; }
.hh-event-cards { grid-column: 3; }
.hh-event-cards .card.small { width: 18px; height: 25px; font-size: 11px; }
.hh-event-cards .cards { gap: 2px; }
.hh-event-strategy { grid-column: 4; font-size: 11px; }
.hh-verdict { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hh-verdict .hh-error { color: #f5c2cb; }
.hh-verdict .hh-mistake { margin-left: 0; }
.hh-recommended { color: #bfe6c8; }
.hh-original { margin-top: 24px; }
.hh-original summary { cursor: pointer; color: var(--text-muted); }
.hh-original pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow: auto; padding: 12px; background: var(--bg-1); }
.hh-skip-note { padding: 12px; border-left: 3px solid var(--border-strong); background: var(--bg-1); }
.hh-showdown { margin-top: 18px; }
.hh-showdown > div { display: flex; gap: 16px; align-items: center; margin: 6px 0; }
.hh-showdown b { min-width: 100px; }
.hh-result { color: #bfe6c8; margin-top: 16px; }
.hh-exchange { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* Tree editor: the Swing TreeEditorPanel grid. Right-aligned labels; up to three label/field pairs per row at fixed columns. */
.te-grid { display: grid; grid-template-columns: 170px 490px 180px 200px 150px 1fr; column-gap: 6px; row-gap: 5px; align-items: center;
  max-width: 1420px; margin-bottom: 12px; }
.te-row { display: contents; }
.te-label { grid-column: auto; text-align: right; color: var(--text); font-weight: 600; font-size: 13px; line-height: 1.15; }
.te-label.top { align-self: start; padding-top: 4px; }
.te-row > .te-label:first-child { grid-column: 1; }
.te-field { min-width: 0; display: flex; align-items: center; }
.te-field.span-3 { grid-column: span 3; }
.te-field.span-all { grid-column: 2 / -1; }
.te-field input.short { width: 80px; }
.te-field input.wide { width: 100%; }
.te-field select { max-width: 100%; }
.te-field.span-all select { width: 100%; }
.te-field textarea { width: 100%; resize: vertical; }
.te-inline { display: inline-flex; gap: 6px; align-items: center; }
.te-buttons { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.te-buttons #open-title { width: 260px; }

/* Sign in with Google */
.google-signin { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0;
  border-radius: 6px; padding: 9px 14px; font-weight: 600; font-size: 14px; }
.google-signin:hover { background: #f3f4f6; text-decoration: none; color: #1f1f1f; }
.google-signin .g-mark { font-weight: 800; font-size: 16px; color: #4285f4; }
.login-or { text-align: center; color: var(--text-muted); font-size: 12px; }

/* ---------- Review (sessions, session review) ---------- */
.rv { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.rv-head h1 { margin: 0; font-size: 24px; }
.rv-head p { margin: 2px 0 0; }
.rv-back { color: var(--text-muted); font-size: 13px; }
.rv-back:hover { color: var(--text); text-decoration: none; }
.ss-list { display: flex; flex-direction: column; gap: 6px; }
.ss-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) repeat(4, 96px); gap: 14px; align-items: center; background: var(--bg-1);
  border: 1px solid transparent; border-radius: 8px; padding: 10px 14px; color: var(--text); }
.ss-row:hover { border-color: var(--border-strong); text-decoration: none; background: var(--bg-2); }
.ss-when, .ss-tree { display: flex; flex-direction: column; min-width: 0; }
.ss-when span, .ss-tree span { color: var(--text-muted); font-size: 12px; }
.ss-tree b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-stat { display: flex; flex-direction: column; }
.rv-stat span { color: var(--text-muted); font-size: 12px; }
.rv-stat b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rv-stat.bad b { color: #f0a3b1; } .rv-stat.warn b { color: #e8c66a; }
.rv-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; background: var(--bg-1); border-radius: 10px; padding: 16px 20px; }
.rv-summary .rv-stat b { font-size: 26px; }
.rv-big { display: flex; align-items: center; gap: 12px; }
.rv-big > div { display: flex; flex-direction: column; }
.rv-big span, .rv-big small { color: var(--text-muted); font-size: 12px; }
.rv-big b { font-size: 30px; font-weight: 800; line-height: 1.1; }
.rv-ring { width: 56px; height: 56px; }
.rv-leaks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-label { color: var(--text-muted); font-size: 12px; margin-right: 4px; }
.leak { background: var(--bg-1); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text-muted); }
.leak b { color: var(--text); font-weight: 600; }
.leak em { font-style: normal; color: #f0a3b1; margin-left: 8px; font-variant-numeric: tabular-nums; }
.rv-actions { display: flex; gap: 8px; align-items: center; }
.rv-primary { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px; padding: 10px 18px; font-size: 15px; font-weight: 700; }
.rv-primary:hover:not(:disabled) { background: var(--accent-strong); border: none; }
.rv-primary:disabled { background: var(--bg-2); color: var(--text-muted); }
.rv-section { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.rv-section h2 { margin: 0; font-size: 18px; }
.rv-empty { padding: 8px 2px; }
.seg-tabs { display: inline-flex; background: var(--bg-1); border-radius: 6px; padding: 2px; gap: 2px; }
.seg-tabs button { background: none; border: none; color: var(--text-muted); font-size: 12px; padding: 4px 10px; border-radius: 4px; }
.seg-tabs button.on { background: var(--bg-3); color: var(--text); }
.seg-tabs button:hover { border: none; color: var(--text); }
.mk-list { display: flex; flex-direction: column; gap: 6px; }
.mk-group { color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 8px 0 0; }
.mk-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px auto; gap: 16px; align-items: center; background: var(--bg-1);
  border-radius: 8px; padding: 10px 14px; border-left: 3px solid #f0a3b1; }
.mk-hand { display: flex; flex-direction: column; gap: 4px; }
.mk-hand small { color: var(--text-muted); font-size: 11.5px; }
.mk-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mk-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.mk-line .st { background: var(--bg-2); border-radius: 4px; padding: 1px 6px; }
.mk-line .st.draw { color: var(--text); }
.mk-line .st-rule { width: 1px; height: 14px; background: var(--border-strong); margin: 0 3px; }
.mk-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.mk-verdict i { font-style: normal; font-size: 11px; color: var(--text-muted); margin-right: 6px; }
.mk-played { background: #3a2226; color: #f5c2cb; border-radius: 5px; padding: 3px 9px; }
.mk-best { background: #1f3326; color: #bfe6c8; border-radius: 5px; padding: 3px 9px; }
.mk-type { color: var(--text-muted); font-size: 12px; }
.mk-ev { display: flex; flex-direction: column; align-items: flex-end; }
.mk-ev b { color: #f0a3b1; font-size: 18px; font-variant-numeric: tabular-nums; }
.mk-ev small { color: var(--text-muted); font-size: 11px; }
.mk-actions { display: flex; gap: 4px; }
.hd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.hd-tile { display: grid; grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  background: var(--bg-1); border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; color: var(--text); }
.hd-tile:hover { border-color: var(--border-strong); text-decoration: none; }
.hd-tile .hd-no { color: var(--text-muted); font-size: 12px; grid-row: span 2; }
.hd-tile .hd-out { color: var(--text-muted); font-size: 11.5px; grid-column: 2; }
.hd-tile .ph-mistake { grid-row: 1 / span 2; grid-column: 3; }
.hd-tile.quiet { opacity: .45; }
.hd-tile.quiet:hover { opacity: .8; }
.hd-tile.has-mistake { border-left: 3px solid #f0a3b1; }
@media (max-width: 900px) {
  .ss-row { grid-template-columns: 1fr 1fr; }
  .mk-row { grid-template-columns: 1fr; }
}
/* "‹ Prev" before the action totals (browse). */
.legend-item.prev { width: 64px; justify-content: center; color: var(--text-muted); font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: none; }
.legend-item.prev:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); background: var(--bg-2); }
.legend-item.prev:disabled { opacity: .35; cursor: default; }
/* Strategies page: Strategies | Sessions, Compare picking; both lists capped for wide screens. */
.trees-page { max-width: 1280px; margin: 0 auto; }
.trees-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.list-tabs button { font-size: 14px; padding: 6px 16px; }
.compare-bar { display: flex; align-items: center; gap: 8px; }
.trees-head-right { display: flex; align-items: center; gap: 16px; }
.view-as select { margin-left: 4px; max-width: 280px; }
.view-as-banner { margin: 0 0 12px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: 13px; }
.view-as-banner a { margin-left: 4px; }
.compare-bar[hidden], .compare-bar [hidden] { display: none; }
#compare-toggle.on { background: var(--accent-2); border-color: var(--accent); color: var(--text); }
.compare-note { font-size: 12px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.trees:not(.picking) .pick { display: none; }
table.trees .pick { width: 28px; text-align: center; }
table.trees tr.picked td { background: var(--bg-2); }
table.trees td.title .play-link { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
table.trees td.title .play-link:hover { color: var(--accent); }
.trees-page .ss-list { margin-top: 4px; }
/* Admin → Tree list: sweep status and per-tree status badges (SPEC §3.5). */
.sync-line { color: var(--text-muted); font-size: 13px; }
.sync-line b { color: var(--text); }
.error-text { color: #ff8a80; }
.st-badge { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--bg-3); color: var(--text-muted); white-space: nowrap; }
.st-badge.st-running, .st-badge.st-starting { background: #1f3b5c; color: #9cc8ff; }
.st-badge.st-requested, .st-badge.st-stopping { background: #2a2d3a; color: #aab4d6; }
.st-badge.st-downloaded { background: #17402e; color: #8fe0a8; font-weight: 700; }
.st-badge.st-downloading { background: #1f3d2c; color: #b9e6c6; }
.st-badge.st-ready { background: #1f3d2c; color: #8fe0a8; }
.st-badge.st-stale { background: #4a3413; color: #f0c070; }
td.nowrap { white-space: nowrap; }

/* Hand history stepper: the counter keeps its width ("Step 9 / 12" → "Step 10 / 12"), so the buttons stay put. */
#step-pos { display: inline-block; min-width: 8.5em; text-align: center; font-variant-numeric: tabular-nums; }

/* Mega chart cell tooltip: the cell's mix on top, then one bar per bucket (representative hand). */
.mc-tip { position: fixed; z-index: 50; width: 300px; background: #0d0d0f; border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 8px 10px; box-shadow: 0 10px 28px rgba(0,0,0,.6); pointer-events: none; font-size: 12px; color: var(--text); }
.mc-tip-head { font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-tip .mix { display: flex; overflow: hidden; border-radius: 3px; }
.mc-tip .mix > span { display: block; height: 100%; }
.mc-tip .mc-total { height: 14px; }
.mc-tip-pcts { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mc-tip-list { display: grid; gap: 2px; }
.mc-tip-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.mc-tip .mc-bar { height: 10px; }
.mc-hand { white-space: nowrap; font-size: 12px; }
.mc-card { display: inline-block; margin-right: 3px; font-weight: 700; }
.mc-card.suit-s { color: #cfd2d8; } .mc-card.suit-h { color: #ff6b6b; } .mc-card.suit-d { color: #5aa2ff; } .mc-card.suit-c { color: #4cd07d; }
.mc-tip-more { margin-top: 6px; font-size: 11px; }

/* Browse: the tree's plaque heads the navigation column; the Stacks checkbox ends the filter row. */
.filter-text-row .stacks-slot { margin-left: auto; }

/* "Licensed to <name>" (as in Swing): under the MADE block, and in the hand list's footer; grey. */
.mc-license { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; margin-top: 4px; white-space: nowrap; }
table.hand-list tfoot td.hl-license { color: var(--text-muted); font-weight: 400; white-space: nowrap; }
/* Tree editor: open a design. */
.te-open { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.te-current { flex: 1; }
.te-picker-box { margin-bottom: 10px; }
.te-picker-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
#design-search { width: 320px; }
.te-picker-list { height: 280px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-content: start; gap: 2px 12px; }
.te-pick { display: flex; align-items: center; gap: 6px; text-align: left; background: none; border: 1px solid transparent; padding: 3px 6px; min-width: 0; height: 26px; }
.te-pick:hover:not(:disabled) { background: var(--bg-2); border-color: var(--border); }
.te-pick-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-tag.draft { background: var(--accent-2); color: var(--accent); }
/* Hand list, "Show full cluster": hands listed only because they share a cluster with a filtered hand. */
table.hand-list tr.cluster-only td { opacity: .5; }
table.hand-list td.has-key { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.key-tip { position: fixed; z-index: 50; max-width: 420px; background: #0d0d0f; border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 8px; font-size: 12px; pointer-events: none; }
/* Hand list in the scrolling strategy box: no top/bottom padding and header/footer stuck to the box's edges, so no
   rows show above the header or below the footer; their lines are drawn inside the cells (collapsed borders scroll). */
.strategy-body:has(> div > table.hand-list), .strategy-body:has(> table.hand-list) { padding-top: 0; padding-bottom: 0; }
.strategy-body table.hand-list thead th { top: 0; box-shadow: inset 0 -1px 0 var(--border); }
.strategy-body table.hand-list tfoot td { bottom: 0; box-shadow: inset 0 1px 0 var(--border-strong); }
button.danger { margin-left: 10px; color: #f3a3a0; border-color: #6b2c2a; background: #2a1716; }
button.danger:hover:not(:disabled) { background: #3a1d1b; border-color: #a0403c; }
button.restart { margin-left: 10px; }
.st-badge.st-terminated { background: #3a1d1b; color: #f3a3a0; }
/* Tree editor: the answer to a button, right after it. */
.te-note { font-size: 13px; margin: 0 6px; align-self: center; }
.te-note.error { color: #ff8a80; font-weight: 600; }
.te-note.busy { color: var(--text-muted); }
.te-note.ok { color: #8fe0a8; }
/* Badugi: cards outside the best badugi (to be discarded) are greyed, after the badugi part */
.mc-card.dead { color: var(--text-muted, #7a7f89) !important; opacity: .45; font-weight: 500; }
.mc-card:not(.dead) + .mc-card.dead { margin-left: 6px; }
.mc-tag { color: var(--text-muted, #7a7f89); margin-right: 2px; }

/* "Request another structure" (tree list) */
button.request-structure { margin-left: auto; font-size: 13px; }
dialog.sr-dialog { width: 440px; padding: 18px 20px; background: var(--bg-1); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; }
dialog.sr-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.sr-dialog h3 { margin: 0 0 4px; }
.sr-dialog form { display: flex; flex-direction: column; gap: 10px; }
.sr-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sr-field > span { color: var(--text-muted); }
.sr-radios { display: flex; gap: 16px; }
.sr-radios label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.sr-sized { display: flex; flex-direction: column; gap: 10px; }
.sr-sized[hidden] { display: none; }
.sr-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Nodelocking (admin): toolbar under the action pills, edit options, painted cells, lock list, report. */
.nl-bar { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.nl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.nl-title { color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.nl-status { color: var(--text-muted); margin-left: 6px; }
.nl-status .error, .nl-report .error { color: #ff6b6b; }
.nl-view { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nl-badge { background: #8a6d1d; color: #fff; padding: 2px 8px; border-radius: 4px; }
.nl-badge.bp { background: #3a3d45; }
.nl-options { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 6px; background: #22252b; border-radius: 6px; }
.nl-options .nl-sep { width: 1px; height: 18px; background: #3a3d45; }
.nl-options .selected { outline: 2px solid var(--accent); }
.nl-adv summary { cursor: pointer; color: var(--text-muted); }
.nl-list-wrap { position: relative; }
.nl-list { position: absolute; top: 30px; left: 0; z-index: 20; width: 520px; max-height: 360px; overflow: auto; background: #1c1c1e;
  border: 1px solid #3a3d45; border-radius: 6px; padding: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.nl-list-row { padding: 6px; border-bottom: 1px solid #2c2f36; display: flex; flex-direction: column; gap: 3px; }
.nl-list-row .nl-line { font-size: 12px; word-break: break-word; }
.nl-list-row button { margin-right: 6px; }
.legend-item.nl-brush { outline: 3px solid #f5c542; outline-offset: -3px; }
.legend-item .nl-pill { margin-left: auto; font-size: 13px; color: #f5c542; display: inline-flex; align-items: center; gap: 2px; }
.legend-item .nl-pill.edit input.nl-target { width: 52px; font-size: 13px; padding: 1px 3px; }
.mega-charts.nl-editing .cell { cursor: crosshair; }
.mega-charts .cell { position: relative; }
.mega-charts .cell .nl-corner { position: absolute; top: -2px; right: -2px; font-size: 9px; font-style: normal; z-index: 2; pointer-events: none; }
.mega-charts .cell .nl-corner.shared { opacity: .6; }
.nl-report { padding: 4px 6px; background: #22252b; border-radius: 6px; }
.nl-report-table td, .nl-report-table th { padding: 2px 8px; }
.studybar .sb-lock { font-size: 11px; margin-left: 4px; }
.mega-charts.nl-editing tr[data-cells] { cursor: crosshair; }
.lock-icon { width: 10px; height: 12px; vertical-align: -1px; flex: none; }
.nl-title .lock-icon { color: #f5c542; }
.legend-item .nl-pill .lock-icon { color: #f5c542; }
.studybar .sb-lock .lock-icon, .studybar .sb-opt-lock { color: #f5c542; margin-left: 4px; }

/* Nodelock layout (2026-10-04 owner notes): start button on the "to act" line, edit bar under the pills in painting
   mode, list / Drop all / Log in the left column, Blueprint | Locked left of the filter, Blockers at the row's end. */
.head-opts .nl-start { height: 22px; padding: 0 8px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.blk-slot { margin-left: auto; display: flex; align-items: center; font-size: 13px; white-space: nowrap; }
.nl-view { margin-right: 8px; }
.nl-side { background: #1c1c1e; border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.nl-side-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nl-side .lock-icon { color: #f5c542; }
.nl-side .nl-list { left: 0; top: 26px; width: 420px; }
.nl-log { position: relative; color: var(--accent); text-decoration: underline dotted; cursor: help; margin-left: auto; }
.nl-log-pop { display: none; position: absolute; left: 0; top: 18px; z-index: 30; width: 460px; max-height: 420px; overflow: auto;
  background: #1c1c1e; border: 1px solid #3a3d45; border-radius: 6px; padding: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.5);
  color: var(--text); text-decoration: none; cursor: default; }
.nl-log:hover .nl-log-pop, .nl-log:focus .nl-log-pop, .nl-log-pop:hover { display: block; }
.nl-log-lock { margin-top: 6px; padding-top: 4px; border-top: 1px solid #2c2f36; }
.nl-log-lock.here .nl-line { color: #f5c542; }
/* Painting mode: the action pills are big radio buttons (same size; their % and colour square hidden). */
.strategy-head .legend .legend-item.nl-radio > i, .strategy-head .legend .legend-item.nl-radio > b.num { display: none; }
.legend-item .nl-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--c, #888); flex: none; box-sizing: border-box; }
.legend-item .nl-dot.on { background: radial-gradient(circle, var(--c, #888) 0 45%, transparent 50%); }
.legend-item.nl-brush { outline: 3px solid #f5c542; outline-offset: -3px; }
/* Painted cells: a yellow rectangle and a lock tinted with the pinned action; shared-bucket cells dashed. */
.mega-charts .cell.nl-painted { outline: 2px solid #f5c542; outline-offset: -2px; z-index: 1; }
.mega-charts .cell.nl-shared { box-shadow: none; outline: 2px dashed #f5c542; outline-offset: -2px; }
.mega-charts .cell .nl-corner { top: 1px; right: 1px; }
.mega-charts .cell .nl-corner .lock-icon { width: 10px; height: 12px; color: var(--nl); filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.nl-bar[hidden], .nl-side[hidden], .nl-view[hidden], .nl-start[hidden] { display: none; }
/* Painting controls on the "to act" line (right to left: Cancel, Calculate, re-solve scope, past actions). */
.head-opts .nl-head { display: flex; align-items: center; gap: 6px; }
.head-opts .nl-head select, .head-opts .nl-head button { height: 22px; font-size: 12px; padding: 0 6px; }
/* While painting, painted cells show the painted action's colour. */
.mega-charts .cell.nl-fill { background: var(--nl); }
.mega-charts .cell.nl-fill .mix, .mega-charts .cell.nl-fill > b { visibility: hidden; }
/* River rows: the border, fill and lock on the strategy bar only (not the label or the % columns). */
.long-cells td.bar-col { position: relative; }
.long-cells tr.nl-painted td.bar-col { outline: 2px solid #f5c542; outline-offset: -2px; }
.long-cells tr.nl-shared td.bar-col { outline: 2px dashed #f5c542; outline-offset: -2px; }
.long-cells tr.nl-fill td.bar-col { background: var(--nl); }
.long-cells tr.nl-fill td.bar-col .mix { visibility: hidden; }
.long-cells td.bar-col .nl-corner { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-style: normal; }
.long-cells td.bar-col .nl-corner .lock-icon { color: var(--nl); filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.long-cells tr.nl-fill td.bar-col .nl-corner .lock-icon { color: #fff; }
.mega-charts .cell.nl-fill .nl-corner .lock-icon { color: #fff; }
/* Painting: the tabs / filter row keeps its height and width, its controls are hidden. */
.view-options.nl-hidden-controls > * { visibility: hidden; }
/* Lock all: hands kept at their current strategy are framed (no fill). */
.mega-charts .cell.nl-inplace { outline: 1px solid #f5c542; outline-offset: -1px; }
.mega-charts .cell .nl-corner.inplace .lock-icon { color: #f5c542; }
.long-cells tr.nl-inplace td.bar-col { outline: 1px solid #f5c542; outline-offset: -1px; }
.long-cells td.bar-col .nl-corner.inplace .lock-icon { color: #f5c542; }
.head-opts .nl-head-progress { font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nl-spin { width: 12px; height: 12px; border: 2px solid #f5c54255; border-top-color: #f5c542; border-radius: 50%; animation: nl-spin .8s linear infinite; }
@keyframes nl-spin { to { transform: rotate(360deg); } }
/* While a calculation runs: the strategy area greyed out with a spinner over it. */
.sa-content.nl-busy { position: relative; }
.sa-content.nl-busy > * { opacity: .3; pointer-events: none; }
.sa-content.nl-busy::after { content: ''; position: absolute; left: 50%; top: 120px; width: 44px; height: 44px; margin-left: -22px;
  border: 4px solid #f5c54255; border-top-color: #f5c542; border-radius: 50%; animation: nl-spin .8s linear infinite; z-index: 5; }
/* The nodelocks list draws above the study bar; each row goes to its spot. */
.nl-side { position: relative; z-index: 60; }
.nl-side .nl-list { z-index: 100; }
.nl-list-row { cursor: pointer; }
.nl-list-row:hover { background: #26292f; }
.nl-list-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nl-head-progress[hidden], .nl-head button[hidden], .nl-head select[hidden] { display: none; }
/* Painting mode pills: Prev hidden, a label column, each pill two lines (radio + name, then its target box). */
.strategy-head .legend.nl-painting #prev-action { display: none; }
.nl-paint-labels { width: 130px; flex: none; height: 60px; display: flex; flex-direction: column; justify-content: space-around;
  font-size: 13px; color: var(--text-muted); text-align: right; padding-right: 4px; }
.strategy-head .legend .legend-item.nl-radio { flex-wrap: wrap; align-content: space-around; row-gap: 0; padding-top: 4px; padding-bottom: 4px; }
.strategy-head .legend .legend-item.nl-radio .nl-pill.edit { flex-basis: 100%; margin-left: 32px; font-size: 13px; color: #f5c542; }
.strategy-head .legend .legend-item.nl-radio .nl-dot { width: 18px; height: 18px; border-width: 3px; }
.strategy-head .legend .legend-item.nl-radio .nl-pill.edit input.nl-target { width: 60px; height: 20px; }
.head-opts .nl-status { font-size: 12px; white-space: nowrap; max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.head-opts .nl-status .error { color: #ff6b6b; }
/* Painting pills: a shorter button (radio + name) with the target box below it, not inside it. */
.strategy-head .legend .legend-item.nl-radio { height: 34px; align-self: flex-start; overflow: visible; position: relative; flex-wrap: nowrap;
  padding-top: 0; padding-bottom: 0; }
.strategy-head .legend .legend-item.nl-radio .nl-pill.edit { position: absolute; left: 0; top: 37px; margin-left: 0; flex-basis: auto; }
.nl-paint-labels { justify-content: space-between; padding: 8px 4px 4px 0; box-sizing: border-box; }
.strategy-head .legend.nl-painting { overflow: visible; }
/* Top right: head buttons, and the Log of a locked solve on the line below them. */
.head-opts .nl-head-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.head-opts .nl-head-row2 { font-size: 12px; height: 16px; line-height: 16px; }
.head-opts .nl-log { margin-left: 0; }
.head-opts .nl-log-pop { left: auto; right: 0; top: 16px; }
.head-opts { z-index: 40; }
