/* Omahalytics calculator (PLO4, PLO5, PLO6): dark analysis surface.
   Colors, type and shape come from the shared tokens.css (the landing
   page uses the same file, see docs/DESIGN_landing.md). Teal is for the
   interface only; player series, suits and gains or losses are data colors.
   Player colour follows the seat, never the current ranking. The app keeps
   a denser scale than the landing page: 14px text, compact panels. */

:root {
  /* chart chrome on the slate surfaces */
  --grid: #1F2E33;
  --axis: #2A3D44;

  /* glass: a light top to bottom sheen, a bright top edge and a dark bottom
     edge. Used on the two floating bars and the secondary controls; the Run
     button stays solid teal, the deck and the chips stay flat. Only the two
     bars blur what is behind them (backdrop-filter is costly per element). */
  --glass:        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  --glass-hover:  linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035));
  --glass-line:   rgba(232, 239, 241, 0.12);
  --glass-edge:   inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  --glass-shadow: var(--glass-edge), 0 1px 3px rgba(0, 0, 0, 0.28);

  /* the fill of a selected option (segments, tabs, picked cards): a
     stronger tint than --accent-soft, edged in --accent */
  --accent-fill:  rgba(44, 200, 192, 0.22);
  /* the selected segment or tab: no frame, a fill that deepens toward
     the bottom and a delicate bright line on the bottom edge */
  --accent-fill-grad: linear-gradient(180deg, rgba(44, 200, 192, 0.12), rgba(44, 200, 192, 0.30));
  --accent-fill-edge: inset 0 -1px 0 rgba(90, 219, 212, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* in page jumps (the run bar's equity split links to the results) land
   below the sticky top bar */
html { scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* hidden until the script knows whether the visitor stays or is sent to
   sign in, so a signed out visitor never sees the page flash */
body.auth-pending { visibility: hidden; }

:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

h1, h2, h3 { margin: 0; font-weight: 600; }
h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 17px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--text);
}
h3.subhead { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 24px 0 10px; }

/* the three steps of the landing page, as small teal outline numbers */
.step {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--accent-lo);
  border-radius: 50%;
  color: var(--accent);
  font: 600 12px/1 var(--font-display);
  letter-spacing: 0;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font: 500 11px/1.3 var(--font-body);
  opacity: 0.7;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ------------------------------------------------------------ top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(26, 39, 44, 0.74), rgba(14, 21, 24, 0.70));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.brand { display: flex; align-items: center; gap: 20px; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 17px/1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo-mark { width: 28px; height: 28px; flex: none; }
.logo-link { display: inline-flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; }
.logo-link:hover span { color: var(--accent-hi); }
.game-switch .seg { font-weight: 600; padding: 7px 14px; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 3px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  cursor: help;
  white-space: nowrap;
}
.meta:empty { display: none; }
.icon {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------- panels */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.panel-head .sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.head-actions { display: flex; align-items: center; gap: 6px; }
.head-actions .count { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ranges first and wide, the board beside them: the order of the
   landing page's "pick ranges, set the board, read the results" */
.setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .setup { grid-template-columns: 1fr; } }

.hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 500 13px/1.3 var(--font-body);
  color: var(--text-2);
  background: var(--glass), var(--surface-2);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-sm);
  box-shadow: var(--glass-shadow);
  padding: 6px 12px;
  cursor: pointer;
  transition: color 150ms ease-out, border-color 150ms ease-out, transform 150ms ease-out;
}
.btn:hover:not(:disabled) { background: var(--glass-hover), var(--surface-2); border-color: rgba(232, 239, 241, 0.2); color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: var(--glass); box-shadow: var(--glass-edge); }
.btn.ghost:hover:not(:disabled) { background: var(--glass-hover); }
.btn.square { width: 30px; height: 30px; padding: 0; font-size: 16px; }
/* the one filled teal button of the app */
.btn.primary {
  height: 40px;
  padding: 0 18px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(44, 200, 192, 0.18);
  font-weight: 600;
  font-size: 14px;
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--accent-ink); }
.btn.primary:active:not(:disabled) { background: var(--accent-lo); border-color: var(--accent-lo); }
.btn.primary kbd { border-color: rgba(4, 32, 30, 0.45); opacity: 0.8; }
.btn.stop { height: 40px; padding: 0 16px; border-radius: var(--r-md); }
.btn.stop:not(:disabled) {
  color: #FFD2D4;
  background: linear-gradient(180deg, rgba(229, 100, 106, 0.26), rgba(229, 100, 106, 0.07)), var(--surface-2);
  border-color: rgba(229, 100, 106, 0.45);
}

/* -------------------------------------------------------------- board */

/* the street is the one badge of the board panel (design section 6) */
.street-tag {
  font: 500 11px/1.4 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-hi);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  padding: 3px 10px;
}

.board-slots { display: flex; gap: 6px; margin-bottom: 12px; }
.slot {
  width: 46px;
  height: 64px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}
/* an empty slot shows a dim suit; the next slot to fill shows it bright */
.slot-ph { font-size: 22px; line-height: 1; color: var(--muted); opacity: 0.4; }
.slot.next .slot-ph { color: var(--text); opacity: 1; }
.slot.filled {
  border: 1px solid var(--border);
  border-style: solid;
  background: var(--surface-2);
  cursor: pointer;
}
.slot.next { border-color: var(--accent); background: var(--accent-fill); }
.slot .rank { font-family: var(--font-mono); letter-spacing: -0.02em; }
.slot .suit { font-size: 15px; margin-left: 1px; }

.board-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.board-input {
  flex: 1;
  font: 14px var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  min-width: 0;
  transition: border-color 150ms ease-out;
}
.board-input::placeholder, .range-input::placeholder { color: var(--muted); opacity: 0.8; }
.board-input:focus, .range-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.deck { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.card-btn {
  font: 12px/1 var(--font-body);
  font-weight: 600;
  padding: 6px 0 5px;
  border-radius: 2px;
  border: 1px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 90ms ease, background 90ms ease;
}
.card-btn:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-1px); }
.card-btn:disabled { opacity: 0.22; cursor: default; }
.card-btn.picked { border-color: var(--accent); background: var(--accent-fill); }
.card-btn.held:disabled { opacity: 0.12; text-decoration: line-through; }
.card-btn.dead {
  background: transparent;
  border: 1px dashed var(--axis);
  text-decoration: line-through;
  opacity: 0.55;
}

h3.minor { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

.random-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.random-row .muted-label { margin-right: 2px; }
.random-row .check { margin-left: 4px; }
.select {
  font: 12px var(--font-body);
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 6px;
  max-width: 100%;
}
.select:focus { outline: none; border-color: var(--accent); }

.dead-block { padding-top: 12px; border-top: 1px solid var(--border-soft); }
.dead-head { display: flex; align-items: center; gap: 10px; min-height: 30px; margin-bottom: 8px; }
.dead-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.dead-card {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font: 600 13px/1 var(--font-body);
  padding: 5px 7px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--axis);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.dead-card:hover { border-color: var(--text-2); }
.dead-card .suit { font-size: 12px; }

.pick-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.suit-s { color: var(--suit-s); }
.suit-h { color: var(--suit-h); }
.suit-d { color: var(--suit-d); }
.suit-c { color: var(--suit-c); }

/* ------------------------------------------------------------ players */

.players { display: flex; flex-direction: column; gap: 10px; }

.player {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.seat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}
.seat-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-2);
}
/* the player's equity in the current run, next to their range */
.seat-eq {
  font: 600 16px/1.2 var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: opacity 150ms ease-out;
}
.seat-eq.stale { opacity: 0.4; cursor: help; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

.range-input {
  width: 100%;
  font: 14px var(--font-mono);
  color: var(--text);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  transition: border-color 150ms ease-out;
}
.range-input.bad { border-color: var(--bad); }
.range-input.bad:focus { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(229, 100, 106, 0.15); }

.presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip {
  font: 11px var(--font-body);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 3px 9px;
  cursor: pointer;
  transition: color 100ms ease, border-color 100ms ease;
}
.chip:hover { color: var(--text); border-color: var(--accent-lo); background: var(--accent-soft); }

.range-info {
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 18px;
}
.range-info.bad { color: #F2A9AC; }
.range-info .link, .error .link { text-decoration: underline; }


/* ------------------------------------------------------------- runbar */

.runbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(33, 50, 56, 0.70), rgba(20, 30, 34, 0.78));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.4);
  position: sticky;
  bottom: 12px;
  z-index: 10;
}
.run-actions { display: flex; align-items: center; gap: 8px; }
.run-options { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.runstats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-left: auto; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.run-flag { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); flex: none; align-self: center; }
.run-flag.live { background: var(--good); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .run-flag.live { animation: none; } }

/* the equity split of the current run, small, in the run bar */
.run-split {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
  min-width: 150px;
  max-width: 280px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r-sm);
}
.run-split:hover .run-split-labels { color: var(--text); }
.run-split-bar { display: flex; gap: 2px; height: 8px; border-radius: 2px; overflow: hidden; }
.run-split-bar span { flex: 1 1 0; min-width: 2px; transition: flex-grow 250ms ease-out; }
.run-split-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.run-split-item { display: inline-flex; align-items: center; gap: 5px; }
.run-split-item .dot { width: 7px; height: 7px; }

/* notices: a surface with a colored bar on the left (design section 6) */
.error {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--bad);
  background: var(--surface-1);
  color: #F2C3C5;
  font-size: 13px;
}

/* before the first run: what will show up here and how to get it */
.empty-state {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 28px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  color: var(--text-2);
}
.empty-state .step { margin-top: 1px; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { margin: 0 0 6px; max-width: 70ch; }
.empty-state b { color: var(--text); font-weight: 600; }
.results:not([hidden]) ~ .empty-state,
.report:not([hidden]) ~ .empty-state { display: none; }

/* ------------------------------------------------------------ results */

.results { display: flex; flex-direction: column; gap: 16px; }

/* the rows read like the landing page's hero table: seat and range, wins
   and ties, equity with its error bar. The split bar above carries the
   proportions, so the rows need no bars of their own. */
.equity-list { display: flex; flex-direction: column; }
.eq-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(150px, auto);
  grid-template-areas: "name sub value";
  gap: 4px 24px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.eq-row > .eq-name { grid-area: name; }
.eq-row > .eq-sub { grid-area: sub; }
.eq-row > div:nth-child(2) { grid-area: value; text-align: right; }
.eq-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.eq-spec {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eq-seat { font-weight: 600; font-size: 12px; color: var(--text-2); min-width: 20px; }
.eq-value { font: 600 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.eq-ci { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 6px; }

/* the equity bar, the product's signature: one segment per seat */
.eq-split {
  display: flex;
  gap: 3px;
  height: 14px;
  margin-bottom: 20px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.eq-split span { flex: 1 1 0; min-width: 2px; transition: flex-grow 250ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .eq-split span, .run-split-bar span { transition: none; }
}
.eq-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* distribution tables */

.filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.segmented {
  display: inline-flex;
  background: var(--glass), var(--surface-2);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  box-shadow: var(--glass-edge);
  overflow: hidden;
}
.seg {
  font: 12px var(--font-body);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: color 100ms ease, background 100ms ease, box-shadow 100ms ease;
}
.seg:hover:not(:disabled):not(.active) { color: var(--text-2); }
/* the selected option fills its whole segment: a teal gradient that
   deepens toward the bottom, with a thin bright line along the bottom edge */
.seg.active {
  background: var(--accent-fill-grad);
  box-shadow: var(--accent-fill-edge);
  color: var(--text);
}
.seg:disabled { opacity: 0.4; cursor: default; }
.check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }

.tabs { display: inline-flex; gap: 4px; }
.tab {
  font: 12px var(--font-body);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 4px 12px;
  cursor: pointer;
}
.tab { background: var(--glass); box-shadow: var(--glass-edge); }
.tab.active {
  color: var(--text);
  background: var(--accent-fill-grad);
  border-color: transparent;
  box-shadow: var(--accent-fill-edge);
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.legend-item .eq-spec { max-width: 200px; }

.table-wrap { overflow-x: auto; }
table.dist { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.dist th, table.dist td { text-align: right; padding: 0; }
table.dist thead th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--grid);
}
table.dist thead th:first-child { text-align: left; }
table.dist tbody td { border-bottom: 1px solid var(--grid); }
table.dist tbody tr:last-child td { border-bottom: 0; }
table.dist .cat-name { text-align: left; color: var(--text-2); font-size: 13px; padding: 7px 16px 7px 0 !important; white-space: nowrap; width: 170px; }
.cell { min-width: 96px; padding: 5px 0 5px 12px !important; }
.cell-inner { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-track { flex: 1; height: 8px; background: var(--grid); border-radius: 2px; min-width: 24px; }
.bar-fill { height: 100%; border-radius: 0 3px 3px 0; transition: width 200ms linear; }
.cell-value { font-size: 13px; color: var(--text); min-width: 46px; text-align: right; }
.cell-value.zero { color: var(--axis); }
.cell:hover .bar-track { background: var(--axis); }
/* hand strength groups open into their sub-rows */
.expander {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.expander:hover { color: var(--text); }
.expander .caret {
  width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 150ms ease;
}
.expander[aria-expanded="true"] .caret { transform: rotate(90deg); }
table.dist tr.group-row .cat-name { color: var(--text); }
table.dist tr.sub-row .cat-name { padding-left: 17px !important; font-size: 12px; }
table.dist tr.sub-row .cell-value { font-size: 12px; }
table.dist tr.sub-row .bar-track { height: 6px; }

.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-width: 260px;
}
.tooltip b { color: var(--text); font-weight: 600; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tooltip .tt-key { display: flex; align-items: center; gap: 6px; }
.tooltip .tt-delta { color: var(--muted); margin-left: 4px; }

/* help tips: what a feature is and how to read its output. A "?" icon next
   to a heading, or a dotted label, carries data-help="key" (see HELP in app.js) */
.tooltip.help-tip { max-width: min(330px, calc(100vw - 16px)); padding: 10px 12px; line-height: 1.5; }
.tooltip.help-tip p { margin: 6px 0 0; }
.tooltip .tt-read span {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.help {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  padding: 0;
  font: 600 10px/1 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: help;
  vertical-align: 1px;
  transition: color 100ms ease, border-color 100ms ease;
}
.help::after { content: ''; position: absolute; inset: -8px; }
.help:hover, .help:focus-visible { color: var(--text); border-color: var(--text-2); }
.has-help { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
.meta:hover, .meta:focus-visible { color: var(--text-2); border-color: var(--border); }

/* equity by next card: ranks across, suits down */

.check.off { opacity: 0.4; cursor: default; }
/* a feature the user's plan leaves out */
.pro-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-hi);
  font: 600 10px/1.5 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.seg .dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }

.nc-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
}
.nc {
  grid-column: var(--r);
  grid-row: var(--s);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 5px;
  font: 12px/1.1 var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 200ms linear, border-color 100ms ease;
}
.nc:hover:not(:disabled) { border-color: var(--text-2); }
.nc-card { font-weight: 700; }
.nc-val { font-size: 12px; }
.nc.noisy .nc-val { color: var(--muted); }
.nc.never, .nc.board { cursor: default; }
.nc.never .nc-val, .nc.board .nc-val { color: var(--axis); font-size: 10px; }
.nc.board { background: transparent; border-style: dashed; }

/* ------------------------------------------------------- hand previews */

.btn.small { padding: 3px 10px; font-size: 12px; }
.btn.danger { color: #F2A9AC; }
.btn.danger:hover:not(:disabled), .btn.danger.armed { color: #FFD2D4; border-color: rgba(229, 100, 106, 0.45); }
.btn .dot { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.link {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.link:hover { text-decoration: underline; }
.syntax-line { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); }
.syntax-line code, .dict-entry code { font-family: var(--font-mono); color: var(--text-2); }

.range-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.range-tools .push { margin-left: auto; }
.chip.named-chip { font-family: var(--font-mono); color: var(--text-2); border-style: dashed; }

/* named ranges: inline save form and the list in the dictionary */
.name-form { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.name-dollar { font: 14px var(--font-mono); color: var(--muted); }
.name-input {
  font: 13px var(--font-mono);
  color: var(--text);
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  width: 150px;
}
.name-input:focus { outline: none; border-color: var(--accent); }
.name-input.bad { border-color: var(--bad); }
.name-msg { font-size: 12px; color: var(--muted); }
.name-msg.bad { color: #F2A9AC; }
.link.danger { color: #F2A9AC; }

.named {
  padding: 12px;
  margin-bottom: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
}
.named .named-hint { margin: 4px 0 10px; }
.named-hint code { font-family: var(--font-mono); color: var(--text-2); }
.named-row {
  display: grid;
  grid-template-columns: minmax(90px, max-content) 1fr auto;
  align-items: baseline;
  gap: 4px 14px;
  padding: 6px 0;
  border-top: 1px solid var(--grid);
}
.named-name { font: 13px var(--font-mono); color: var(--text); white-space: nowrap; }
.named-text { font: 12px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.named-actions { display: flex; gap: 6px; font-size: 12px; }
.preview { margin-top: 8px; }

.hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 6px;
}
.hand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
}
.hand-cards { display: flex; gap: 2px; }
.hand-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.hand-top { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hand-weight { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hand-grid .empty { color: var(--muted); font-size: 12px; }

/* one hole card: rank over suit glyph, coloured by suit (four colour deck) */
.mc {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 29px;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.mc i { font-style: normal; font-size: 10px; margin-top: 1px; }
.mc.gap { margin-left: 5px; }

.range-info .removal { color: var(--text-2); text-decoration: underline dotted var(--axis); cursor: help; }
.range-info .weighted { text-decoration: underline dotted var(--axis); cursor: help; }

/* ------------------------------------------------- range composition */

.comp-panel { margin-top: 10px; }

/* a player's card picker: the hand's slots over a deck of its own */
.hand-picker { margin-top: 10px; }
.hand-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.hand-head .push { margin-left: auto; }
.hand-slots { display: flex; gap: 5px; }
.hand-slots .slot { width: 36px; height: 50px; font-size: 16px; }
.hand-slots .slot .suit { font-size: 13px; }
.hand-slots .slot-ph { font-size: 18px; }
.comp-panel .empty { color: var(--muted); font-size: 12px; }
.comp-note { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.comp-pick {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  width: 100%;
  text-align: inherit;
  cursor: pointer;
}
.comp-pick:hover { color: var(--text); text-decoration: underline; }
.comp-pick:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; border-radius: 3px; }

.comp-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.comp-table th, .comp-table td { padding: 4px 6px; text-align: right; white-space: nowrap; }
.comp-table thead th { font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--grid); }
.comp-table .comp-group { text-align: center; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.comp-group .comp-sub { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.comp-table .comp-col { font-family: var(--font-mono); font-weight: 400; }
.comp-table .comp-row { text-align: left; font-weight: 400; color: var(--text-2); padding-left: 0; }
.comp-table .comp-all { vertical-align: bottom; }
.comp-table tbody td, .comp-table tbody th { border-bottom: 1px solid var(--grid); }
.comp-cell { color: var(--text); }
.comp-cell .zero { color: var(--axis); }
.comp-total { color: var(--text-2); }
.comp-foot th, .comp-foot td { border-bottom: 0 !important; font-weight: 600; }
.comp-table .edge { border-left: 1px solid var(--axis); }

.comp-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.comp-list h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.comp-item {
  display: grid;
  grid-template-columns: 1fr 44px 42px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.comp-item .comp-label { color: var(--text-2); }
.comp-item .comp-val { text-align: right; color: var(--text); }
.comp-item.zero .comp-val { color: var(--axis); }
.comp-bar { height: 6px; background: var(--grid); border-radius: 2px; overflow: hidden; }
.comp-bar span { display: block; height: 100%; background: var(--accent-lo); }

/* ----------------------------------------------------- filter dictionary */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45); }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(620px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border-soft);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.5);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-body { overflow-y: auto; padding: 14px 16px 40px; }

.playground {
  padding: 12px;
  margin-bottom: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
}
.pg-row { display: flex; gap: 8px; }
.pg-row .range-input { flex: 1; }
.pg-board { flex: 0 0 120px; }
.pg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.pg-actions .spacer { flex: 1; }
.muted-label { font-size: 12px; color: var(--muted); }

.dict-search {
  width: 100%;
  font: 13px var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  margin-bottom: 12px;
}
.dict-group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 16px 0 6px; }
.dict-entry {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 2px 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 7px 8px;
  cursor: pointer;
}
.dict-entry:hover { background: var(--surface-1); border-color: var(--border-soft); }
.dict-entry.active { background: var(--accent-fill); border-color: var(--accent); }
.dict-syntax { font-family: var(--font-mono); font-size: 13px; color: var(--text); white-space: nowrap; }
.dict-name { font-size: 13px; color: var(--text-2); font-weight: 600; }
.dict-desc { grid-column: 2; font-size: 12px; color: var(--muted); }
/* an example must not break at its "-" (not) operator */
.dict-desc code { white-space: nowrap; }

/* ------------------------------------------------------- flop report */

/* the flop report sits in the board panel: "every flop" instead of one */
.report-start { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 14px; }
.report-start .muted-label { margin-right: 2px; }

.report { display: flex; flex-direction: column; gap: 16px; }
.rep-note { margin: -4px 0 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rep-tip { text-decoration: underline dotted var(--axis); cursor: help; }

h3.rep-avg-head { margin-top: 8px; }
.rep-overall { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 26px; margin-bottom: 10px; }
.rep-eq { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.rep-eq .dot { align-self: center; }
.rep-eq .eq-spec { max-width: 220px; }
.rep-eq-val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rep-eq .eq-ci { margin-left: 0; }
.rep-eq-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }

.rep-sel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  min-height: 34px;
  padding: 6px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  font-variant-numeric: tabular-nums;
}
.rep-sel-name { font-weight: 600; color: var(--text); }
.rep-sel-val { display: inline-flex; align-items: center; gap: 6px; }
.rep-sel .eq-ci { margin-left: 0; }

.rep-chart { position: relative; }
.rep-chart .empty, .rep-table + .empty { color: var(--muted); font-size: 12px; padding: 12px 0; }
.ch { display: block; width: 100%; height: auto; cursor: crosshair; }
.ch-grid { stroke: var(--grid); stroke-width: 1; }
.ch-mean { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 5 4; }
.ch-label { fill: var(--muted); font: 11px var(--font-body); }
.ch-dot { stroke: var(--bg); stroke-width: 2; pointer-events: none; }
.ch-axis { font-size: 12px; color: var(--muted); margin-top: 2px; }

table.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.rep-table th, .rep-table td { padding: 5px 10px; text-align: right; white-space: nowrap; }
.rep-table th:first-child, .rep-table td:first-child { text-align: left; padding-left: 0; }
.rep-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--axis);
}
.rep-table thead .dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }
.rep-table th.sortable { cursor: pointer; user-select: none; }
.rep-table th.sortable:hover { color: var(--text); }
.rep-table tbody td { border-bottom: 1px solid var(--grid); }
.rep-table .rep-dim th {
  padding-top: 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  text-align: left;
  border-bottom: 1px solid var(--grid);
}
.rep-row { cursor: pointer; }
.rep-row:hover td { color: var(--text); }
.rep-row:hover .rep-name { text-decoration: underline; }
.rep-row:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -2px; }
.rep-row.on .rep-name { color: var(--text); font-weight: 600; }
.rep-row.on .rep-name::before { content: '\2713'; margin-right: 6px; color: var(--accent); }
.rep-name { color: var(--text-2); }
.rep-val { color: var(--text); }
.rep-val.zero { color: var(--axis); }
.rep-val .eq-ci { margin-left: 5px; font-size: 11px; }
.rep-partial { color: var(--muted); margin-left: 2px; }
.flop-btn {
  display: inline-flex;
  gap: 2px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.flop-btn:hover .mc { border-color: var(--text-2); }
.flop-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* the flop list: every flop in one scrolling box of --rows rows, of which
   only the rows in view are in the page (app.js reads --row-h) */
.rep-find { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.rep-find .board-input { flex: 0 1 280px; min-width: 0; }
.rep-scroll {
  --row-h: 38px;
  --rows: 20;
  --head-h: 30px;
  max-height: min(calc(var(--row-h) * var(--rows) + var(--head-h)), 75vh);
  overflow: auto;
  border-bottom: 1px solid var(--grid);
  overscroll-behavior: contain;
}
table.rep-flops { table-layout: fixed; }
.rep-flops thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--head-h);
  padding-top: 0;
  padding-bottom: 0;
  background: var(--surface-1);
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--axis);
}
.rep-flops th:first-child { width: 96px; }
.rep-flops th.rep-prob { width: 112px; }
.rep-flops th.rep-n { width: 96px; }
.rep-flops tbody tr { height: var(--row-h); }
.rep-flops tbody td { padding-top: 0; padding-bottom: 0; overflow: hidden; text-overflow: ellipsis; }
.rep-flops .rep-pad td { padding: 0; border: 0; }
.rep-flops .rep-empty td { color: var(--muted); text-align: left; }

/* who beats whom: the player's showdown hand down, the winner's across */
table.beat { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.beat-summary { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.beat-summary b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.beat th, .beat td { padding: 6px 8px; text-align: right; white-space: nowrap; }
.beat thead th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--grid);
  vertical-align: bottom;
}
.beat thead th.beat-win { text-transform: none; letter-spacing: 0; white-space: normal; min-width: 52px; max-width: 64px; line-height: 1.2; }
.beat thead .beat-group { text-align: center; border-bottom: 0; padding-bottom: 2px; }
.beat th:first-child, .beat td:first-child { text-align: left; padding-left: 0; }
.beat tbody td { border-bottom: 1px solid var(--grid); }
.beat tbody tr:last-child td { border-bottom: 0; }
.beat .cat-name { color: var(--text-2); padding-right: 16px; }
/* the hand names stay in view while the winner columns scroll sideways */
.beat th:first-child, .beat td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-1); }
.beat .beat-held, .beat .beat-lost { color: var(--text); }
.beat .beat-lost { padding-right: 16px; border-right: 1px solid var(--grid); }
.beat .beat-ci { color: var(--muted); font-size: 11px; margin-left: 3px; }
.beat td.bw { color: var(--text); min-width: 52px; border-left: 1px solid var(--bg); }
.beat td.bw.zero { color: var(--axis); }
.beat td.bw.noisy { color: var(--muted); }
.beat td.bw:hover { outline: 1px solid var(--text-2); outline-offset: -1px; }

/* ---------------------------------------------------------- narrow screens
   Last in the file on purpose: these override rules of equal specificity. */

@media (max-width: 620px) {
  main { padding: 14px 12px 60px; }
  .topbar { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .runbar { position: static; }
  .runstats { margin-left: 0; width: 100%; }
  .card-btn { font-size: 11px; }
  table.dist .cat-name { width: auto; white-space: normal; padding-right: 10px !important; }
  .topbar-right .meta { display: none; }
  .topbar { height: auto; padding: 10px 12px; }
  .brand { gap: 10px; flex-wrap: wrap; }
  .logo span, .topbar .btn-label { display: none; }
  .topbar { flex-wrap: nowrap; }
  .panel { padding: 16px; }
  .player { grid-template-columns: 1fr; gap: 8px; }
  .seat { flex-direction: row; align-items: baseline; justify-content: space-between; padding-top: 0; }
  .run-split { width: 100%; }
  .empty-state { padding: 20px 16px; }
  .pg-row { flex-direction: column; }
  .pg-board { flex: auto; }
  .dict-entry { grid-template-columns: 1fr; }
  .named-row { grid-template-columns: 1fr auto; }
  .named-text { grid-column: 1 / -1; grid-row: 2; }
  .dict-desc { grid-column: 1; }
  /* thirteen columns do not fit a phone: suits across, ranks down */
  .nc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nc { grid-column: var(--s); grid-row: var(--r); flex-direction: row; justify-content: space-between; padding: 6px 10px; }
  .report-start { flex-wrap: wrap; }
  .rep-table th, .rep-table td { padding: 5px 6px; }
  .beat th, .beat td { padding: 5px 6px; }
  .beat .cat-name { white-space: normal; min-width: 76px; }
  .rep-scroll { --rows: 12; }
  #repMetric { flex-wrap: wrap; }
  .rep-flops th:first-child { width: 84px; }
  .rep-flops th.rep-prob { width: 86px; }
  .rep-flops th.rep-n { width: 72px; }
}

/* ------------------------------------------------------------- sharing */

/* a shared link, a new version of the server, the plan ending: notices
   like .error, with the accent bar (a warm one for the plan) */
/* ------------------------------------------------------------- account */

main.account { max-width: 880px; }
.account-title { font-size: 22px; }
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.account-wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .account-grid { grid-template-columns: 1fr; } }
.account-grid .panel-head { margin-bottom: 12px; }
.account-big { margin: 0; font: 600 20px/1.3 var(--font-display); color: var(--text); }
.account-grid .hint { margin-top: 10px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.account-text { margin: 0; color: var(--text-2); max-width: 70ch; }
.account-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.account-list dt { color: var(--muted); }
.account-list dd { margin: 0; color: var(--text); text-align: right; overflow-wrap: anywhere; }

/* ------------------------------------------------------------- notices */

.shared-banner,
.notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  background: var(--surface-1);
}
.shared-banner .icon,
.notice .icon { color: var(--accent); flex: none; }
.notice.warn { border-left-color: var(--warm); }
.notice.warn .icon { color: var(--warm); }
/* the upgrade hint in the top bar: a Pro tag that is a link */
.upgrade-link { margin: 0; text-decoration: none; }
.upgrade-link:hover { background: var(--accent-glow); }
.shared-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.shared-text .sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.shared-actions { display: flex; align-items: center; gap: 8px; }
a.btn { text-decoration: none; }

.share-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 41;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.share-dialog[hidden] { display: none; }
.share-body { overflow-y: auto; padding: 4px 16px 18px; }
.share-link-row { display: flex; gap: 8px; margin: 12px 0 6px; }
.share-link { flex: 1; min-width: 0; }
.share-status { min-height: 18px; margin: 0 0 12px; font-size: 12px; color: var(--text-2); }
.share-status.bad { color: var(--bad); }
.share-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.share-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
}
.share-item-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.share-item-title {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-item-title:hover { text-decoration: underline; }

/* read only: the setup says what was run, and nothing on the page edits
   it or starts a run */
body.readonly .players-panel .head-actions,
body.readonly .presets,
body.readonly .range-tools,
body.readonly .syntax-line,
body.readonly .board-actions,
body.readonly .random-row,
body.readonly .report-start,
body.readonly .pick-row,
body.readonly .deck,
body.readonly .hand-picker,
body.readonly .board-panel > .hint,
body.readonly .run-actions,
body.readonly .run-options,
body.readonly #dictOpen,
body.readonly #usage,
body.readonly #repStop,
body.readonly #repResume,
body.readonly .empty-state,
body.readonly #gameSwitch .seg:not(.active),
body.readonly.shared-missing .setup,
body.readonly.shared-missing .runbar { display: none; }
body.readonly .slot,
body.readonly .dead-card { pointer-events: none; }
body.readonly .flop-btn { cursor: default; }
