/* Board Watch - dashboard for the e-ink chess boards.
 *
 * Layout idea: one centred column of cards; the board and the move list sit
 * side by side on a desk and stack on a phone. Palette is the boards' own
 * world - cool paper greys, one ink blue for the player we care about, grey
 * for the machine, and red kept for the moves the review flagged.
 */
:root {
  color-scheme: light;

  --plane: #f2f3f1;         /* page */
  --surface: #fdfdfc;       /* cards */
  --surface-2: #ebeeec;     /* inset fills */
  --ink: #131617;
  --ink-2: #4e5456;
  --ink-3: #777f80;
  --line: #e0e2dd;          /* hairlines */
  --rule: #c4c7c1;          /* axes, dividers that carry weight */

  --accent: #2a78d6;        /* the human player */
  --accent-wash: rgba(42, 120, 214, 0.11);
  --engine: #868d96;        /* the machine - de-emphasis, not a series hue */
  --crit: #d03b3b;          /* blunders */
  --crit-wash: rgba(208, 59, 59, 0.10);
  --good: #0ca30c;
  --warn: #fab219;

  --sq-light: #e9eae5;
  --sq-dark: #a9b3b4;
  --sq-mark: rgba(42, 120, 214, 0.30);
  --piece-light: #fcfcfa;
  --piece-dark: #181c1d;
  --piece-edge: #24282a;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-glyph: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2",
                "Apple Symbols", sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(19, 22, 23, 0.05), 0 6px 18px rgba(19, 22, 23, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0e1011;
    --surface: #17191a;
    --surface-2: #1f2324;
    --ink: #eef0ed;
    --ink-2: #bcc1bf;
    --ink-3: #8b9291;
    --line: #2a2d2e;
    --rule: #3c4041;
    --accent: #3987e5;
    --accent-wash: rgba(57, 135, 229, 0.18);
    --engine: #767d84;
    --crit: #e06a6a;
    --crit-wash: rgba(224, 106, 106, 0.16);
    --good: #0ca30c;
    --warn: #fab219;
    --sq-light: #8d9496;
    --sq-dark: #646c6e;
    --sq-mark: rgba(57, 135, 229, 0.55);
    --piece-light: #f7f8f5;
    --piece-dark: #0e1112;
    --piece-edge: #0a0c0d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 6px 18px rgba(0, 0, 0, 0.22);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0e1011;
  --surface: #17191a;
  --surface-2: #1f2324;
  --ink: #eef0ed;
  --ink-2: #bcc1bf;
  --ink-3: #8b9291;
  --line: #2a2d2e;
  --rule: #3c4041;
  --accent: #3987e5;
  --accent-wash: rgba(57, 135, 229, 0.18);
  --engine: #767d84;
  --crit: #e06a6a;
  --crit-wash: rgba(224, 106, 106, 0.16);
  --good: #0ca30c;
  --warn: #fab219;
  --sq-light: #8d9496;
  --sq-dark: #646c6e;
  --sq-mark: rgba(57, 135, 229, 0.55);
  --piece-light: #f7f8f5;
  --piece-dark: #0e1112;
  --piece-edge: #0a0c0d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 6px 18px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; margin: 0; }
h1 { font-size: 1.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }

a { color: var(--accent); }

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

.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- scaffolding */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brandname { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand .sub { color: var(--ink-3); font-size: 0.8rem; }

nav.tabs { display: flex; gap: 4px; margin-left: auto; }

nav.tabs a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid transparent;
}
nav.tabs a:hover { background: var(--surface-2); color: var(--ink); }
nav.tabs a[aria-current="page"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* The board picker sits beside the brand: it scopes the whole site, the tabs
   choose a screen within that scope. It is a native select wearing the button
   style, so it is a real control on every platform and grows with the number
   of boards. */
.boardpick select {
  max-width: 11rem;
  padding-right: 6px;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  /* Brand and picker share the first row, the tabs take the second. The
     strapline gives way only when there is a picker to make room for. */
  .topbar-in.picking .brand .sub { display: none; }
  .topbar-in.picking .boardpick { margin-left: auto; }
  .topbar-in.picking nav.tabs { margin-left: 0; flex: 1 1 100%; }
}

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

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.spacer { flex: 1 1 auto; }

.muted { color: var(--ink-3); }
.sec { color: var(--ink-2); }
.small { font-size: 0.82rem; }
.lead { font-size: 1.02rem; color: var(--ink); max-width: 62ch; }
p { margin: 0 0 0.7em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

/* ------------------------------------------------------------------- pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.pill.live {
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
  color: color-mix(in srgb, var(--good) 72%, var(--ink));
  background: color-mix(in srgb, var(--good) 10%, var(--surface));
}
.pill.warnish {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  color: var(--ink-2);
}
.pill.critish {
  border-color: color-mix(in srgb, var(--crit) 45%, var(--line));
  background: var(--crit-wash);
  color: color-mix(in srgb, var(--crit) 72%, var(--ink));
}
.pill.accentish {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-wash);
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}
.pill.goodish {
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
  color: color-mix(in srgb, var(--good) 72%, var(--ink));
  background: color-mix(in srgb, var(--good) 10%, var(--surface));
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.live .dot { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .pill.live .dot { animation: none; }
}

.key { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.key.human { background: var(--accent); }
.key.engine { background: var(--engine); }
.key.blunder { background: var(--crit); border-radius: 50%; }

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

.board-wrap { width: 100%; max-width: 380px; }

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  /* Rows must be stated too. With only columns declared the eight rows are
     implicit and sized by their content, so a rank holding a piece took the
     glyph's line box while an empty rank collapsed -- the squares came out as
     rectangles, tall where there were pieces and flat where there were none.
     aspect-ratio fixes the board's outline, not how the height divides inside
     it. */
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--sq-light);
}

.sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-glyph);
  font-size: min(7.6vw, 30px);
  line-height: 1;
  user-select: none;
}
.sq.d { background: var(--sq-dark); }
.sq.mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sq-mark);
  pointer-events: none;
}
.sq.flag { box-shadow: inset 0 0 0 3px var(--crit); }
.sq .pc { position: relative; z-index: 1; }
.sq .pc.w {
  color: var(--piece-light);
  -webkit-text-stroke: 0.9px var(--piece-edge);
  paint-order: stroke fill;
}
.sq .pc.b { color: var(--piece-dark); }

.sq .coord {
  position: absolute;
  font-family: var(--font-body);
  font-size: 8px;
  line-height: 1;
  color: var(--ink);
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}
.sq .coord.f { bottom: 2px; right: 3px; }
.sq .coord.r { top: 2px; left: 3px; }

.board-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }

.turn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}
.turn .side {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 1px solid var(--ink-3);
}
.turn .side.w { background: var(--piece-light); }
.turn .side.b { background: var(--piece-dark); }

/* -------------------------------------------------------------- move list */

.moves {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  max-height: 340px;
  background: var(--surface);
}

.moves table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.moves th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.moves td { padding: 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.moves tr:last-child td { border-bottom: 0; }
.moves td.n {
  padding: 4px 8px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  width: 2.6em;
  text-align: right;
}

.mv {
  display: flex;
  align-items: baseline;
  gap: 7px;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.mv:hover { background: var(--surface-2); }
.mv[aria-current="true"] { background: var(--accent-wash); border-left-color: var(--accent); font-weight: 600; }
.mv .u { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.mv .t { color: var(--ink-3); font-size: 0.78rem; font-variant-numeric: tabular-nums; margin-left: auto; }
.mv.bad .u { color: var(--crit); }
.mv.bad .u::after { content: " \25C6"; font-size: 0.7em; vertical-align: 0.1em; }
.mv.human { }
.mv .g { font-family: var(--font-glyph); }

/* --------------------------------------------------------- evaluation bar */

/* The move list and the bar sit side by side and the bar matches whatever
   height the list ends up with, so `align-items: stretch` (the default) is
   doing real work here -- do not set it to anything else. The list carries
   `min-width: 0` because a flex item defaults to `min-width: auto`, which is
   its content width: without it a long move list refuses to narrow and pushes
   the bar off the card instead of making room for it. */
.moves-row { display: flex; gap: 10px; align-items: stretch; }
.moves-row .moves { flex: 1 1 auto; min-width: 0; }

.evalbar {
  flex: 0 0 34px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  /* The bar's own ground is white's half; black's is painted over the top of
     it, so only one element has to be sized from the percentage. */
  background: var(--piece-light);
}
.eb-black { background: var(--piece-dark); }
/* The halfway mark, so "level" reads as a position and not only as a ratio.
   Which ink it needs depends on which side of the split it lands in, and the
   renderer already knows, so it picks the class -- rather than leaning on
   `mix-blend-mode`, whose result here would depend on the blend sitting in the
   stacking context we expect it to. */
.eb-mid {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
}
.eb-mid.on-black { background: var(--piece-light); opacity: 0.55; }
.eb-mid.on-white { background: var(--piece-dark);  opacity: 0.35; }
.eb-num {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* The number goes in the leader's end of the bar: always the taller half, so
   there is always room for it and always contrast behind it. */
.eb-num.low  { bottom: 5px; color: var(--piece-dark); }
.eb-num.high { top: 5px;    color: var(--piece-light); }

@media (max-width: 760px) {
  .evalbar { flex-basis: 30px; }
}

/* ---------------------------------------------------------------- game grid */

.game-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 760px) {
  .game-grid { grid-template-columns: 1fr; }
  .board-wrap { max-width: 100%; }
}

.controls { display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  min-height: 32px;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { color: var(--ink-3); cursor: default; background: var(--surface); opacity: 0.6; }
a.btn { display: inline-block; text-decoration: none; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn .g { font-family: var(--font-glyph); }

/* ------------------------------------------------------------------- tiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--surface);
}
.tile .label { font-size: 0.75rem; color: var(--ink-3); }
.tile .value { font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.tile .note { font-size: 0.75rem; color: var(--ink-3); }
.tile.flagged { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); background: var(--crit-wash); }

/* ------------------------------------------------------------------- chart */

.chart-card { padding-bottom: 12px; }
.chart-head { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin-bottom: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 0.78rem; color: var(--ink-2); }
.chart-legend span.item { display: inline-flex; align-items: center; gap: 6px; }

.chart-scroll { overflow-x: auto; overflow-y: hidden; position: relative; }
.chart-scroll svg { display: block; touch-action: pan-y; }

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  font-size: 0.86rem;
  color: var(--ink-2);
  min-height: 1.5em;
  margin-top: 6px;
}
.readout strong { color: var(--ink); font-weight: 600; }

.tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 7px;
  box-shadow: var(--shadow);
  padding: 6px 9px;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s linear;
}
.tip.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

/* ------------------------------------------------------------------ review */

.review { display: flex; flex-direction: column; gap: 14px; }
.review .finding {
  border-left: 3px solid var(--line);
  padding-left: 12px;
}
.review .finding h3 { margin-bottom: 2px; }
.review .finding p { color: var(--ink-2); max-width: 66ch; }
.review .finding.time { border-left-color: var(--accent); }

ol.practise { margin: 4px 0 0; padding-left: 1.3em; color: var(--ink-2); max-width: 66ch; }
ol.practise li { margin-bottom: 4px; }

.blunders { display: flex; flex-direction: column; gap: 8px; }
button.blunder {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--crit);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink-2);
}
button.blunder:hover { background: var(--surface-2); }
button.blunder[aria-current="true"] { background: var(--crit-wash); }
button.blunder .hd {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2px;
}
button.blunder .hd .t { font-weight: 500; color: var(--crit); font-variant-numeric: tabular-nums; }
button.blunder .note { font-size: 0.88rem; max-width: 62ch; }

/* ------------------------------------------------------------------- lists */

.games { display: flex; flex-direction: column; gap: 8px; }

a.game-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 4px 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}
a.game-row:hover { border-color: var(--rule); background: var(--surface-2); }
a.game-row .when { font-size: 0.78rem; color: var(--ink-3); }
a.game-row .what { font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
a.game-row .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: flex-end; }
@media (max-width: 560px) {
  a.game-row { grid-template-columns: 1fr; }
  a.game-row .meta { justify-content: flex-start; }
}

.result-stripe {
  display: inline-block;
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
}

/* --------------------------------------------------------------- challenge */

/* One board's cards belong together; the next board's start after a rule. */
.player + .player {
  margin-top: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.ladder, .lessons, .runs { list-style: none; margin: 0; padding: 0; }

/* The three lists share one row anatomy with the games list: what it is in
   bold, the particulars small and grey beneath, the figure on the right. */
.rung .what, .run .what {
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}
.rung .when, .lesson .when, .run .when, .score .when { font-size: 0.78rem; color: var(--ink-3); }
.score { font-weight: 600; font-size: 1.05rem; white-space: nowrap; text-align: right; }
.score .when { font-weight: 400; }

.ladder, .lessons {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.rung, .lesson {
  display: grid;
  gap: 4px 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.rung:last-child, .lesson:last-child { border-bottom: 0; }

.rung {
  grid-template-columns: 1.4em minmax(0, 1fr) auto;
  border-left: 3px solid transparent;
}
.rung .n { color: var(--ink-3); text-align: right; }
.rung.here { background: var(--accent-wash); border-left-color: var(--accent); }
.rung.shut .what { color: var(--ink-3); font-weight: 500; }

.lesson { grid-template-columns: minmax(0, 1fr) auto; }
.lesson .what { max-width: 62ch; }
.rate {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  justify-content: flex-end;
}
.rate .pct { font-size: 0.82rem; color: var(--ink-2); min-width: 7.2em; text-align: right; }
.rate .pct strong { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.meter {
  display: inline-block;
  width: 84px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--engine); }
.lesson.shaky .meter > span { background: var(--warn); }
.lesson.weak .meter > span { background: var(--crit); }
@media (max-width: 560px) {
  .lesson { grid-template-columns: 1fr; }
  .rate { justify-content: flex-start; }
  .rate .pct { min-width: 0; }
}

.runs { display: flex; flex-direction: column; gap: 8px; }
.run {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}
.run-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
}

/* One square per puzzle. Colour is the third thing that tells them apart,
   after the mark and the fill: solid with a light tick, hatched with a dark
   tick, a cross on a plain ground, a dash in a dashed outline. */
.strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.it {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
button.it { cursor: pointer; }
.it svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.it.r0 {
  background: color-mix(in srgb, var(--good) 86%, #000);
  border-color: color-mix(in srgb, var(--good) 86%, #000);
  color: #ffffff;
}
.it.r1 {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--ink-2));
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--warn) 40%, var(--surface)) 0 3px,
      var(--surface) 3px 6px);
}
.it.r2 {
  border-color: var(--crit);
  background: var(--crit-wash);
  color: var(--crit);
}
.it.r3 {
  border-style: dashed;
  border-color: var(--ink-3);
  background: none;
  color: var(--ink-3);
}
button.it:hover { filter: brightness(0.94); }
button.it[aria-expanded="true"] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
}
.chart-legend .it { width: 20px; height: 20px; border-radius: 5px; }
.chart-legend .it svg { width: 11px; height: 11px; }
@media (max-width: 560px) {
  /* Two rows of six, and a wider target for a thumb. */
  .strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .strip .it { width: auto; height: 34px; }
}

.item-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item-detail[hidden] { display: none; }
.item-detail .readout { margin-top: 4px; min-height: 0; }
.item-detail .asked { margin-bottom: 0; }
.item-grid {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.item-grid .sq { font-size: min(6.4vw, 22px); }
.item-grid .stack { gap: 10px; }
.ans { white-space: nowrap; }
.ans .g { font-family: var(--font-glyph); }
.ans .u { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 620px) {
  .item-grid { grid-template-columns: 1fr; }
  .item-grid .board-wrap { max-width: 300px; }
}

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

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--rule);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--surface);
  color: var(--ink-2);
}
.notice h3 { color: var(--ink); margin-bottom: 2px; }
.notice.bad { border-left-color: var(--crit); }
.notice.wait { border-left-color: var(--warn); }
.notice.info { border-left-color: var(--accent); }
.notice p { max-width: 62ch; }

.banner {
  background: color-mix(in srgb, var(--warn) 16%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line));
  color: var(--ink-2);
  font-size: 0.8rem;
  text-align: center;
  padding: 5px 16px;
}

.stale { opacity: 0.55; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 50;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--rule);
}

footer.foot {
  color: var(--ink-3);
  font-size: 0.78rem;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
