/* Book Drill: Najdorf. Dark, calm, phone first. Palette and type from design/ux.md. */

:root {
  --bg: #14171A;
  --card: #1B1F23;
  --hair: #272C31;
  --text: #E8E6E3;
  --muted: #9AA3AB;
  --ok: #6F9E5A;
  --bad: #B9603F;
  --brass: #C9A227;
  --seen: #4A5866;   /* positions seen, under mastered (feedback btWuDCetuHuKw1A-mSiHjg) */
  --weak: #D97B66;   /* light red: positions missed last time, not a problem (Tal build #85) */
  --problem: #A8322A;   /* dark red: positions right 34% of the time or less (Tal build #85) */
  --r: 10px;
  --board: min(100vw, 61dvh);   /* 61: the chip rail's 40px went to the board */
  --safe: env(safe-area-inset-bottom, 0px);
  --bd-gutter: 14px;   /* the board's coordinate gutters, board.js */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; background: none; border: 0; touch-action: manipulation; }
a { color: var(--brass); }

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100vw;
}

/* ---------- 1. Tracker ---------- */
/* The top inset is applied everywhere: a Safari tab reports 0, the home-screen PWA and the
   native shell report the notch, so the tracker never sits under the clock. */
#tracker {
  flex: 0 0 auto;
  height: auto;
  min-height: 56px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
}
.t-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-name .eco {
  font-size: 12px;
  font-weight: 600;
  color: var(--brass);
  letter-spacing: 0.04em;
  margin-left: 6px;
}
.t-crumb {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
}
#tracker.flash { animation: lift 200ms ease-out; }
@keyframes lift {
  0% { background: rgba(201, 162, 39, 0.22); }
  100% { background: transparent; }
}


/* ---------- 1b. Add to Home Screen strip ---------- */
.a2hs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  font-size: 12px;
  color: var(--brass);
  background: rgba(201, 162, 39, 0.08);
  border-bottom: 1px solid var(--hair);
}
.a2hs-x {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 32px;
  color: var(--muted);
  font-size: 14px;
}
.a2hs-x:active { color: var(--brass); }

/* ---------- 3. Board ---------- */
#boardwrap {
  flex: 0 0 auto;
  width: var(--board);
  height: var(--board);
  margin: 0 auto;
  position: relative;
}
#board {
  width: 100%;
  height: 100%;
  position: relative;
}

/* The board (board.js over cm-chessboard, v15). Every page's board wears the "bd" theme: the
   old brown squares, brass for the drawn arrows and rings. The coordinates live in two gutters
   outside the squares, a grid track per square, so each label is centred on its own rank or
   file at any size and never sits under a piece. */
.bd-host {
  display: grid;
  grid-template-columns: var(--bd-gutter) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--bd-gutter);
}
.bd-host.bd-nocoords { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.bd-squares { grid-column: 2; grid-row: 1; position: relative; min-width: 0; min-height: 0; }
.bd-nocoords .bd-squares { grid-column: 1; }
.bd-ranks { grid-column: 1; grid-row: 1; display: grid; grid-template-rows: repeat(8, minmax(0, 1fr)); }
.bd-files { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.bd-ranks span, .bd-files span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  pointer-events: none;
}
.cm-chessboard.bd { display: block; overflow: visible; -webkit-user-select: none; user-select: none; }
.cm-chessboard.bd .board .square.white { fill: #F0D9B5; }
.cm-chessboard.bd .board .square.black { fill: #C0AE91; }
.cm-chessboard.bd .board .border { fill: #C0AE91; stroke-width: 0; }
.cm-chessboard.bd .board.input-enabled .square { cursor: pointer; }
.cm-chessboard.bd .markers .marker.bd-last { fill: rgb(155, 199, 0); opacity: 0.41; }
.cm-chessboard.bd .markers .marker.bd-sel { fill: rgb(20, 85, 30); opacity: 0.5; }
.cm-chessboard.bd .markers .marker.bd-hover { fill: rgb(20, 85, 30); opacity: 0.3; }
.cm-chessboard.bd .markers .marker.bd-check { fill: url(#bd-check-grad); opacity: 1; }
.cm-chessboard.bd .markers .marker.bd-dest { fill: rgb(20, 85, 30); opacity: 0.5; }
.cm-chessboard.bd .markers .marker.bd-take { fill: rgb(20, 85, 30); opacity: 0.45; }
.cm-chessboard.bd .markers .marker.bd-ring { fill: none; stroke-width: 3px; opacity: 0.8; }
.cm-chessboard.bd .markers .marker.bd-ring.bd-yellow { stroke: var(--brass); }
.cm-chessboard.bd .markers .marker.bd-ring.bd-red { stroke: #A8382C; }
.cm-chessboard.bd .arrows { pointer-events: none; }
.cm-chessboard.bd .bd-arrow { opacity: 0.85; }
.cm-chessboard.bd .bd-arrow .arrow-line { stroke-linecap: round; }
.cm-chessboard.bd .bd-arrow.bd-yellow .arrow-line { stroke: var(--brass); }
.cm-chessboard.bd .bd-arrow.bd-yellow .arrow-head { fill: var(--brass); }
.cm-chessboard.bd .bd-arrow.bd-red .arrow-line { stroke: #A8382C; }
.cm-chessboard.bd .bd-arrow.bd-red .arrow-head { fill: #A8382C; }
/* The piece in hand while dragging is drawn into the page body: keep it above the board. */
.cm-chessboard-draggable-piece { z-index: 40; }

/* ---------- 4. Feedback card ---------- */
.card {
  flex: 1 1 auto;
  min-height: 96px;
  padding: 12px 14px;
  background: var(--card);
  border-top: 1px solid var(--hair);
  border-left: 3px solid transparent;
  position: relative;
  overflow-y: auto;
}
.card.ok { border-left-color: var(--ok); }
.card.bad { border-left-color: var(--bad); }
.card.note { border-left-color: var(--brass); }

/* Card type sized to read at arm's length (Tal build #261: 13px notes were too small). A long note
   is cut into bits (copy.js bitsOf): each bit its own short paragraph, the first one brighter as
   the lead, the rest following under it. */
.c-title { font-size: 19px; font-weight: 600; line-height: 24px; }
.card.waiting .c-title { color: var(--muted); }
.c-lines { margin-top: 6px; font-size: 16px; line-height: 23px; color: var(--muted); }
.c-lines > div + div { margin-top: 6px; }
.c-lines .bit { display: block; }
.c-lines .bit + .bit { margin-top: 8px; }
.c-lines .bit:first-child { color: var(--text); }
.c-lines .strong { color: var(--text); }
.c-lines .eco { color: var(--brass); font-size: 13px; letter-spacing: 0.06em; }
/* A sequence the board plays out (app.js, 5b): tap it to see it again; the move on the board is lit. */
.c-lines .seq { text-decoration: underline dotted; text-decoration-color: var(--brass); text-underline-offset: 3px; cursor: pointer; }
.c-lines .seq .mv { transition: color 120ms; }
.c-lines .seq .mv.on { color: var(--brass); }
.c-lines .pgn {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--text);
  max-height: 64px;
  overflow-y: auto;
  margin-top: 4px;
}
.c-actions { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.c-actions .aside { font-size: 13px; color: var(--muted); }

.btn-outline {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
}
.btn-fill {
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--r);
  background: var(--ok);
  color: #10140f;
  font-size: 14px;
  font-weight: 700;
}
.btn-danger {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r);
  background: var(--bad);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.c-progress {
  height: 2px;
  margin-top: 8px;
  background: transparent;
}
.c-progress i {
  display: block;
  height: 2px;
  width: 0;
  background: var(--brass);
}
.c-progress.run i { width: 100%; transition: width linear; }

/* The finished line's clock (feedback 8E8ivO2x2OfQQ97Fnj5vFw): the time left draining on the left,
   Pause on the right (sA7ke1nH5bSwN0F57oKx5g dropped the Next line button). It is the card's last row
   and sticks to the card's foot when the card scrolls, so the clock is always in view. Any tap on the
   bar toggles it, like Pause; a tap on the locked board makes it pulse and the clock runs on (app.js 6b). */
.card.has-nb { padding-bottom: 0; }
.nextbar {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px -14px 0;
  padding: 8px 14px 10px;
  background: var(--card);
  border-top: 1px solid var(--hair);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: nb-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nextbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brass);
  opacity: 0;
  pointer-events: none;
}
.nb-btn {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  margin: -4px 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.nb-btn svg { width: 26px; height: 26px; }
.nb-btn:active { opacity: 0.7; }
.nb-pause { border: 1.5px solid var(--hair); color: var(--text); }
.nb-pause .nb-ico-play, .nb-pause[aria-pressed="true"] .nb-ico-pause { display: none; }
.nb-pause[aria-pressed="true"] .nb-ico-play { display: block; }
.nb-pause[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); background: rgba(201, 162, 39, 0.12); }
.nb-mid { position: relative; flex: 1 1 auto; min-width: 0; }
.nb-text { font-size: 14px; font-weight: 600; line-height: 18px; }
.nb-track { height: 3px; margin-top: 6px; border-radius: 2px; background: var(--hair); overflow: hidden; }
.nb-track i { display: block; height: 100%; background: var(--brass); transform-origin: left center; }
.nextbar.paused .nb-text { color: var(--muted); }
.nextbar.paused .nb-track { display: none; }
.nextbar.nudge::before { animation: nb-flash 450ms ease-out; }
.nextbar.nudge .nb-pause { animation: nb-pop 450ms ease-out; }
@keyframes nb-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nb-flash { 0% { opacity: 0; } 25% { opacity: 0.16; } 100% { opacity: 0; } }
@keyframes nb-pop { 0% { transform: none; } 30% { transform: scale(1.12); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .nextbar, .nextbar.nudge::before, .nextbar.nudge .nb-pause { animation: none; }
}

/* Explore panel lives in the card slot */
.explore { position: absolute; inset: 0; padding: 10px 14px; overflow-y: auto; }
.x-head { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.x-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 4px;
  border-bottom: 1px solid var(--hair);
}
.x-san { font-family: ui-monospace, Menlo, monospace; font-size: 15px; font-weight: 600; min-width: 62px; }
.x-name { font-size: 13px; color: var(--muted); }
.x-main { color: var(--brass); }

/* ---------- 5. Move list and scrubber ---------- */
.moverow {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--hair);
}
.scrub {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.scrub:active { color: var(--brass); }
.movelist {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.movelist::-webkit-scrollbar { display: none; }
.scrub:disabled { opacity: 0.25; }
.movelist .mv { padding: 6px 2px; border-radius: 4px; }
.movelist .mv:active { background: var(--hair); }
.movelist .num { color: var(--muted); opacity: 0.7; }
.movelist .w { color: var(--muted); }
.movelist .b { color: var(--text); }
.movelist .last { font-weight: 700; }
.movelist .viewing { background: var(--brass); color: #14171A; font-weight: 700; }
.movelist .miss::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bad);
  margin-left: 3px;
  vertical-align: 2px;
}

/* ---------- 6. Controls ---------- */
.controls {
  flex: 0 0 auto;
  height: calc(60px + var(--safe));
  padding-bottom: var(--safe);
  display: flex;
  border-top: 1px solid var(--hair);
  background: var(--bg);
}
.ctl {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
}
.ctl .ico { font-size: 20px; line-height: 20px; }
.ctl .lbl { font-size: 10px; letter-spacing: 0.03em; }
.ctl:active, .ctl.on { color: var(--brass); }
.ctl[disabled] { opacity: 0.35; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 14, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 40;
}
.promo-row { display: flex; gap: 10px; }
.promo-btn {
  width: 66px;
  height: 66px;
  border-radius: var(--r);
  border: 1px solid var(--hair);
  background: var(--card);
  background-size: 76% 76%;
  background-repeat: no-repeat;
  background-position: center;
}
.promo-hint { font-size: 13px; color: var(--muted); }

.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(10, 12, 14, 0.6); }
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85dvh;
  overflow-y: auto;
  background: var(--card);
  border-top: 1px solid var(--hair);
  border-radius: var(--r) var(--r) 0 0;
  padding: 8px 16px calc(20px + var(--safe));
  overscroll-behavior: contain;
  transition: transform 180ms ease-out;
}
.sheet-grab {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--hair);
  margin: 4px auto 12px;
}
.sheet-panel h2 { font-size: 20px; margin: 4px 0 2px; }
.sheet-panel h3 { font-size: 14px; margin: 18px 0 6px; color: var(--muted); }
.s-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.s-bars { display: flex; flex-direction: column; gap: 10px; }
.s-row { display: grid; grid-template-columns: 68px 1fr 54px; gap: 8px; align-items: center; }
.s-row .lab { font-size: 13px; font-weight: 600; }
.s-row .val { font-size: 12px; color: var(--muted); text-align: right; }
.s-bar { height: 8px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.s-bar i { display: block; height: 8px; background: var(--ok); }
.s-counts { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 20px; }
.s-foot { margin-top: 20px; }
.s-confirm { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.row-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  font-size: 15px;
}
.row-toggle input { width: 22px; height: 22px; accent-color: var(--brass); }
.row-seg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  font-size: 15px;
}
.seg {
  display: flex;
  border: 1px solid var(--hair);
  border-radius: 999px;
  overflow: hidden;
}
.seg-b {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.seg-b + .seg-b { border-left: 1px solid var(--hair); }
.seg-b:active { color: var(--text); }
.seg-b[aria-selected="true"] { background: var(--brass); color: #14171A; }
.m-note { font-size: 13px; color: var(--muted); line-height: 19px; }

/* ---------- Book sheet ---------- */
/* Grab bar and head stay put; only the list scrolls, so the close button is always in reach. */
.sheet-full {
  top: 0;
  max-height: 100dvh;
  border-radius: 0;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.b-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + var(--safe));
}
.b-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.b-head h2 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.b-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.b-close svg { width: 22px; height: 22px; }
.b-close:active { color: var(--text); }
.b-list { display: flex; flex-direction: column; }
.b-fam {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}
.b-tap {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 2px;
}
.b-tap:active { background: rgba(201, 162, 39, 0.08); }
.b-top { display: flex; align-items: baseline; gap: 8px; }
.b-lab { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-fam .b-lab { font-size: 15px; color: var(--brass); }
.b-lab .eco { font-size: 11px; color: var(--brass); letter-spacing: 0.05em; margin-left: 6px; font-weight: 600; }
.b-word { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.b-word.on { color: var(--ok); }
.b-meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.b-bar { flex: 1 1 auto; height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.b-bar i { display: block; height: 6px; background: var(--ok); }
.b-count { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.b-acts { display: flex; gap: 10px; padding: 4px 2px 10px; }
.b-row.open { background: rgba(201, 162, 39, 0.05); }
.b-in1 { padding-left: 14px; }
.b-in2 { padding-left: 28px; }
.b-in3 { padding-left: 42px; }

.t-name.targeting { color: var(--brass); }


/* ---------- 16. Landing page: pick an opening ---------- */
/* The drill page owns a fixed viewport. The landing is the one page that scrolls. */
body.op-body { overflow: auto; }

.op-page {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(24px + var(--safe));
}
.op-head { padding: 6px 2px 16px; }
.op-title { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.op-sub { font-size: 14px; line-height: 20px; color: var(--muted); margin: 8px 0 0; }

.op-list { display: flex; flex-direction: column; gap: 12px; }

.op-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
}
.op-card:active { border-color: var(--brass); }
.op-card.op-off { opacity: 0.55; }
.op-card.op-off:active { border-color: var(--hair); }

.op-top { display: flex; align-items: baseline; gap: 10px; }
.op-name { flex: 1 1 auto; font-size: 17px; font-weight: 600; line-height: 22px; }
.op-eco { font-size: 11px; font-weight: 600; color: var(--brass); letter-spacing: 0.04em; }
.op-tag {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 2px 8px;
}
.op-moves {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  line-height: 17px;
}
.op-blurb { font-size: 13px; line-height: 19px; color: var(--text); }

.op-meterrow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.op-bar { flex: 1 1 auto; height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.op-bar { position: relative; }
.op-bar b, .op-bar u, .op-bar s, .op-bar i { position: absolute; left: 0; top: 0; display: block; height: 100%; text-decoration: none; }
.op-bar b { background: var(--seen); }
.op-bar u { background: var(--weak); }      /* missed last time (Tal build #85) */
.op-bar s { background: var(--problem); }   /* problem (Tal build #85) */
.op-bar i { background: var(--ok); }
.op-word { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.op-word.on { color: var(--ok); }
.op-count { font-size: 11px; color: var(--muted); }
.op-last { font-size: 11px; color: var(--muted); }
.op-soon { color: var(--brass); }

/* The Menu's Switch opening row sits full width above the toggles. */
.m-wide { width: 100%; margin: 4px 0 12px; }

/* ---------- 17. Coach page: paste a game, walk through it ---------- */
/* Appended block, nothing above is touched. The coach page is a fixed column like the drill:
   board on top, move strip under it, the chat scrolls, the input row rides the home indicator. */
.ch-body { overflow: hidden; }

.ch-app {
  height: 100dvh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  --ch-board: min(100vw, 42dvh);
}
/* A follow session gives the chat room to read along. No transition on purpose. */
.ch-app.ch-session { --ch-board: min(100vw, 36dvh); }

.ch-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  border-bottom: 1px solid var(--hair);
}
.ch-home {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
}
.ch-home:active { color: var(--brass); }
.ch-headtext { min-width: 0; }
.ch-title { font-size: 17px; font-weight: 600; line-height: 21px; }
.ch-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* State 1: empty */
.ch-setup {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 16px calc(24px + var(--safe));
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.ch-lead { font-size: 14px; line-height: 20px; color: var(--muted); margin: 0 0 12px; }
.ch-ta {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  resize: none;
  -webkit-user-select: text;
  user-select: text;
}
.ch-ta:focus { outline: none; border-color: var(--brass); }
.ch-ask { min-height: 64px; margin-top: 10px; }
.ch-keyrow { margin-top: 12px; }
.ch-keylabel { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ch-keyinput {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  -webkit-user-select: text;
  user-select: text;
}
.ch-keyinput:focus { outline: none; border-color: var(--brass); }
.ch-go {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid var(--brass);
  border-radius: var(--r);
  color: var(--brass);
  font-size: 16px;
  font-weight: 600;
}
.ch-go:active { background: var(--brass); color: #14171A; }
.ch-go:disabled { opacity: 0.5; }
.ch-err { margin-top: 12px; font-size: 13px; line-height: 19px; color: var(--bad); }

.ch-side { margin-top: 18px; }
.ch-sidelead { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ch-sidebtns { display: flex; gap: 10px; }
.ch-sidebtn {
  flex: 1 1 0;
  min-height: 48px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  color: var(--text);
  font-size: 15px;
}
.ch-sidebtn:active { border-color: var(--brass); color: var(--brass); }

.ch-lastrow {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
}
.ch-lastrow:active { border-color: var(--brass); }

/* States 2 to 4: the game */
.ch-game { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ch-boardwrap {
  flex: 0 0 auto;
  width: var(--ch-board);
  height: var(--ch-board);
  margin: 0 auto;
  position: relative;
}
#ch-board { width: 100%; height: 100%; position: relative; }

.ch-prog { flex: 0 0 auto; padding: 10px 14px 2px; }
.ch-progbar { height: 3px; border-radius: 2px; background: var(--hair); overflow: hidden; }
.ch-progbar i { display: block; height: 3px; width: 4%; background: var(--brass); transition: width 160ms linear; }
.ch-progtext { margin-top: 6px; font-size: 12px; color: var(--muted); }

.ch-evalrow {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 21px;
  box-sizing: border-box;
  padding: 8px 14px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.ch-evalnum { color: var(--text); font-weight: 600; }
.ch-mark { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; }
.ch-best { font-size: 12px; color: var(--muted); }
.ch-inaccuracy { color: #C79A3B; }
.ch-mistake { color: #D2833F; }
.ch-blunder { color: var(--bad); }

.ch-moverow { flex: 0 0 auto; display: flex; align-items: center; border-bottom: 1px solid var(--hair); }
.movelist .ch-dot::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-left: 3px;
  vertical-align: 2px;
  background: var(--muted);
}
.movelist .ch-dot.ch-inaccuracy::after { background: #C79A3B; }
.movelist .ch-dot.ch-mistake::after { background: #D2833F; }
.movelist .ch-dot.ch-blunder::after { background: var(--bad); }

/* The chat */
.ch-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 4px;
  -webkit-user-select: text;
  user-select: text;
}
.ch-turn { margin-bottom: 14px; }
.ch-row { margin-bottom: 10px; font-size: 15px; line-height: 21px; }
.ch-coach {
  border-left: 2px solid var(--brass);
  padding-left: 10px;
}
.ch-coach p { margin: 0 0 10px; }
.ch-coach p:last-child { margin-bottom: 0; }
.ch-coach ul { margin: 0 0 10px; padding-left: 18px; }
.ch-coach li { margin: 0 0 4px; }
.ch-coach strong { color: #fff; }
.ch-me {
  margin-left: auto;
  max-width: 85%;
  width: fit-content;
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
}
.ch-note { font-size: 12px; color: var(--muted); }

.ch-mv {
  display: inline;
  position: relative;
  padding: 2px 3px;
  margin: 0 -1px;
  border-radius: 4px;
  color: var(--brass);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.4);
}
.ch-mv:active { background: var(--brass); color: #14171A; }
/* A bigger target than the glyphs, with no change to the line box. */
.ch-mv::after { content: ''; position: absolute; inset: -8px -2px; }

.ch-fold { margin-bottom: 8px; }
.ch-foldhead {
  display: block;
  width: 100%;
  min-height: 28px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 4px 0;
}
.ch-foldhead::after { content: " \25BE"; }
.ch-fold.open .ch-foldhead::after { content: " \25B4"; }
.ch-foldbody {
  font-size: 13px;
  line-height: 19px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ch-fold.open .ch-foldbody { display: block; -webkit-line-clamp: none; }

.ch-inputrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px calc(8px + var(--safe));
  border-top: 1px solid var(--hair);
  background: var(--bg);
}
.ch-q {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 22px;
  -webkit-user-select: text;
  user-select: text;
}
.ch-q:focus { outline: none; border-color: var(--brass); }
.ch-send {
  flex: 0 0 auto;
  min-width: 68px;
  min-height: 44px;
  border: 1px solid var(--brass);
  border-radius: 22px;
  color: var(--brass);
  font-weight: 600;
}
.ch-send:active { background: var(--brass); color: #14171A; }
.ch-send.ch-stop { border-color: var(--bad); color: var(--bad); }

/* The key prompt */
/* Top aligned on purpose: the panel opens the keyboard, and centred it puts Save under it. */
.ch-keysheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}
.ch-keyscrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.ch-keypanel {
  position: relative;
  width: min(92vw, 420px);
  padding: 18px 16px calc(18px + var(--safe));
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
}
.ch-keyhead { margin: 0 0 6px; font-size: 17px; }
.ch-keynote { margin: 0 0 12px; font-size: 13px; line-height: 19px; color: var(--muted); }
.ch-keybtns { display: flex; gap: 10px; margin-top: 12px; }
.ch-keysave, .ch-keycancel {
  flex: 1 1 0;
  min-height: 44px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  color: var(--text);
}
.ch-keysave { border-color: var(--brass); color: var(--brass); font-weight: 600; }

/* ---------- Narration rows in the Menu ---------- */
.nr-voice .seg-b { padding: 0 8px; }
.nr-voice.nr-off { opacity: 0.45; }
.row-toggle.nr-na { opacity: 0.45; }
.nr-voice.nr-off .seg-b { pointer-events: none; }
.nr-voice .seg-b.nr-nokey { opacity: 0.5; }
.nr-key { gap: 10px; }
.nr-key[hidden] { display: none; }
.nr-keyfield { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.nr-key .ch-keyinput { flex: 1 1 auto; min-width: 0; }
.nr-keysave {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--brass);
  border-radius: var(--r);
  color: var(--brass);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 18. Theory page ---------- */
/* Appended block, nothing above is touched. A page that scrolls, like the landing. */
body.th-body { overflow: auto; }
.th-app { max-width: 520px; margin: 0 auto; padding-bottom: calc(24px + var(--safe)); }
.th-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  border-bottom: 1px solid var(--hair);
}
.th-home {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
}
.th-home:active { color: var(--brass); }
.th-headtext { min-width: 0; }
.th-title { font-size: 17px; font-weight: 600; line-height: 21px; }
.th-sub { font-size: 12px; color: var(--muted); line-height: 16px; }
.th-say, .th-card-say {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 17px;
  background: none;
  border: 0;
}
.th-say { margin-left: auto; }
.th-say.on { color: #14171A; background: var(--brass); border-radius: 999px; }
.th-say:active, .th-card-say:active { opacity: 0.6; }
.th-card-say { display: none; }
body.th-narr .th-card-say { display: flex; }
.th-main { padding: 12px; }
.th-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 12px;
  margin-bottom: 12px;
  scroll-margin-top: 12px;
}
.th-meter { margin-top: 10px; }
.th-meter .b-top { display: flex; justify-content: space-between; align-items: baseline; }
.th-meter .b-count { flex: 1 0 100%; font-size: 12px; color: var(--muted); }
.th-meter .b-meter { flex-wrap: wrap; row-gap: 4px; }
.th-meter .b-bar { flex: 1 0 100%; }
.th-leadrow { display: flex; align-items: flex-start; gap: 8px; margin: 4px 2px 16px; }
.th-lead { flex: 1 1 auto; font-size: 15px; line-height: 22px; color: var(--muted); margin: 0; }
.th-section { font-size: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); margin: 28px 2px 12px; padding-top: 12px; border-top: 1px solid var(--hair); }
.th-titlerow { display: flex; align-items: center; gap: 8px; }
.th-h { flex: 1 1 auto; font-size: 17px; font-weight: 600; line-height: 22px; margin: 4px 0 8px; }
.th-moves { font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 19px; color: var(--muted); margin-bottom: 8px; word-break: break-word; }
.th-board { aspect-ratio: 1; width: 100%; margin: 4px 0 10px; }
.th-p { font-size: 15px; line-height: 22px; margin: 0 0 10px; }
.th-ul { margin: 0 0 10px; padding-left: 20px; font-size: 15px; line-height: 22px; }
.th-ul li { margin-bottom: 4px; }
.th-ex { border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 8px; }
.th-answer { font-size: 15px; font-weight: 700; color: var(--brass); margin: 4px 0 10px; }
.th-lh { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.th-lines { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 22px; }
.th-lines .eco { color: var(--muted); font-size: 12px; }
.th-held { color: var(--muted); }
.th-acts { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.th-acts button { min-height: 44px; }
.th-wide { width: 100%; min-height: 44px; margin-top: 8px; }
.th-foot { margin-top: 8px; }

/* ---------- 19. Follow the coach ---------- */
/* Appended block (design/v8-follow.md): the line strip in the move row, the follow bar above
   the chat, the step the coach is on, and the Play button on a finished answer. */

/* The line strip: off the game, so brass and mono, with the way back first. It sits in the move
   row between the scrubs and takes the game strip's place while a line shows. */
.ch-line {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 44px;
  border-bottom: 1px solid var(--hair);
  background: rgba(201, 162, 39, 0.05);
}
.ch-moverow .ch-line { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
.ch-game.ch-offgame #ch-moves { display: none; }
.ch-line-back {
  flex: 0 0 auto;
  height: 44px;
  min-width: 44px;
  padding: 0 6px 0 10px;
  display: flex;
  align-items: center;
}
.ch-line-back span {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--bg);
}
.ch-line-back span::before { content: '\2039\00a0'; color: var(--muted); }
.ch-line-back:active span { border-color: var(--brass); color: var(--brass); }
.ch-line-moves {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  /* Soft edges, so a line scrolled past its start still shows there is more. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.ch-line-moves::-webkit-scrollbar { display: none; }
.ch-lmv {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 1px;
  display: flex;
  align-items: center;
  color: rgba(201, 162, 39, 0.42);
}
.ch-lmv.on { color: var(--brass); }
.ch-lchip { padding: 5px 3px; border-radius: 4px; }
.ch-lnum { opacity: 0.7; }
.ch-lmv.viewing .ch-lchip { background: var(--brass); color: #14171A; font-weight: 700; }
.ch-lmv.viewing .ch-lnum { opacity: 0.8; }
.ch-lmv:active .ch-lchip { background: var(--hair); }

/* While a line shows, the game strip keeps its anchor, outlined: the fill is the line's. */
.movelist.ch-inline .viewing {
  background: transparent;
  color: var(--brass);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.6);
}
/* Off the game, the board wears a brass ring, around the squares, not the coordinate gutters. */
.ch-boardwrap.ch-off::after {
  content: '';
  position: absolute;
  inset: 0 0 var(--bd-gutter) var(--bd-gutter);
  box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.7);
  pointer-events: none;
  z-index: 3;
}

/* The follow bar */
.ch-follow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 2px;
  border-bottom: 1px solid var(--hair);
  background: var(--card);
}
.ch-fbtn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.ch-fbtn svg { width: 17px; height: 17px; fill: currentColor; }
.ch-fbtn:active { color: var(--brass); }
.ch-fbtn:disabled { opacity: 0.25; }
.ch-f-toggle { color: var(--brass); }
.ch-f-toggle svg { width: 21px; height: 21px; }
.ch-f-close { color: var(--muted); }
.ch-f-close svg { width: 15px; height: 15px; }
.ch-f-label {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  line-height: 44px;
  padding: 0 8px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.ch-f-n { color: var(--muted); }

/* The step being read: a soft wash, no colour change, so the coach's brass edge stays the loudest. */
.ch-step {
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 220ms ease, box-shadow 220ms ease;
}
.ch-step.ch-now {
  background: rgba(201, 162, 39, 0.12);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.12);
}

/* Play on a finished answer */
.ch-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 2px 0 -6px -10px;
  color: var(--brass);
}
.ch-playdot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.55);
}
.ch-playdot svg { width: 12px; height: 12px; fill: currentColor; margin-left: 2px; }
.ch-play:active .ch-playdot,
.ch-coach.ch-following .ch-playdot { background: var(--brass); color: #14171A; }

/* ---------- 20. Settings ---------- */
/* Appended block (design/v9-saved-and-usage.md): the gear on the landing, the saved list on the
   coach's setup screen, and the settings page, which borrows the theory page's shell and cards. */
.op-headrow { display: flex; align-items: flex-start; gap: 8px; }
.op-headrow .op-title { flex: 1 1 auto; min-width: 0; }
.op-headrow .op-titlebox { flex: 1 1 auto; min-width: 0; }
/* Which build and web bundle is running, so a fix can be confirmed on the phone. */
.op-ver { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.op-gear {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: -8px -10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 50%;
}
.op-gear svg { width: 24px; height: 24px; }
.op-gear:active { color: var(--brass); }

/* Saved analyses on the coach's setup screen */
.ch-saved { margin-top: 20px; }
.ch-savedhead { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 2px 8px; }
.ch-savedrow {
  position: relative;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 64px;
}
.ch-savedrow + .ch-savedrow { margin-top: 8px; }
.ch-savedmain { color: var(--text); font-size: 14px; line-height: 19px; }
.ch-savedsub { font-size: 12px; line-height: 16px; color: var(--muted); }
.ch-savedcur { border-color: var(--brass); }
.ch-savedtag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 2px 8px;
}

/* The settings page */
.st-body .th-main > div:first-child > .th-section { margin-top: 4px; padding-top: 0; border-top: 0; }
.st-muted { color: var(--muted); }
.st-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.st-tile { margin-bottom: 0; padding: 12px; min-height: 44px; }
.st-tilelab { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.st-cost { font-size: 22px; font-weight: 700; line-height: 30px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.st-cap { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.st-line { font-size: 14px; line-height: 20px; margin: 0 2px 6px; }
.st-line.st-muted { font-size: 13px; margin-bottom: 12px; }
.st-recent .th-lh { margin-top: 0; }
.st-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.st-row + .st-row { border-top: 1px solid var(--hair); }
.st-userow { font-size: 13px; font-variant-numeric: tabular-nums; }
.st-when { flex: 0 0 76px; color: var(--muted); font-size: 12px; }
.st-kind { flex: 0 0 48px; }
.st-size { flex: 1 1 auto; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-rowcost { flex: 0 0 auto; }
.st-list { padding: 0 12px; }
.st-saved { gap: 6px; }
.st-open {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-open:active { color: var(--brass); }
.st-main { font-size: 15px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; }
.st-sub { font-size: 12px; line-height: 16px; color: var(--muted); }
.st-acts { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.st-del {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.st-del:active { color: var(--bad); }
.st-yes { color: var(--bad); }
.st-no { color: var(--text); }
.st-ask { font-size: 13px; color: var(--muted); }
.st-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-size: 14px;
  color: var(--brass);
  text-decoration: none;
}
.st-link:active { opacity: 0.6; }
.st-keystatus { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.st-keystatus.on { color: var(--ok); }
.st-keyfield { display: flex; gap: 8px; align-items: center; }
.st-keyfield .ch-keyinput { flex: 1 1 auto; min-width: 0; }
.st-keysave {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--brass);
  border-radius: var(--r);
  color: var(--brass);
  font-size: 14px;
  font-weight: 600;
}
.st-keysave:active { opacity: 0.6; }
.st-keyacts { margin-top: 10px; }
.st-keyclear { min-height: 44px; }
.st-key .m-note { margin-top: 10px; }
/* Condensed settings (feedback tgpKBsXqOdWf5Z9Ta0IGNw): tighter section rhythm, grouped cards
   with hairline rows, one intro line per concept. */
.st-body .th-section { font-size: 13px; margin: 18px 2px 6px; padding-top: 10px; }
.st-body .th-card { margin-bottom: 8px; }
.st-intro { font-size: 13px; line-height: 18px; color: var(--muted); margin: 0 2px 8px; }
.st-group { padding: 0 12px; }
.st-trow { gap: 12px; padding: 4px 0; }
.st-trow + .st-trow, .st-group .st-row + .st-row, .st-group > div + div > .st-row:first-child { border-top: 1px solid var(--hair); }
.st-tlab { display: flex; flex-direction: column; min-width: 0; }
.st-tlab > span:first-child { font-size: 15px; line-height: 20px; }
.st-none { font-size: 13px; padding: 8px 0; }
.st-body .st-shelf > summary { margin-top: 14px; padding: 8px 0; }
.st-body .st-acct { padding: 0 12px; }
.st-body .st-acct .st-owner { margin-top: 0; border-top: 1px solid var(--hair); }

/* ---------- 21. Unguided (v10) ---------- */
/* A small tag in the tracker's corner while the mode is on, so a terse card has a reason. */
#tracker { position: relative; }
.t-mode {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.03em;
  color: var(--muted);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 5px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
/* A chip this small still takes a thumb: the hit area reaches past its border. */
.t-mode::after { content: ''; position: absolute; inset: -14px -8px; }
.t-mode:active { opacity: 0.5; }
/* The tag is the Blitz switch (feedback 9WNNJGZ68U1JUv1P-G7LeA, renamed 2026-10-15): it names the
   mode, Classical in grey, Blitz lit. */
#tracker.unguided .t-mode { color: var(--text); }
/* v11: the same tag, in brass, while the last line plays again. */
#tracker.replay .t-mode { color: var(--brass); }

/* ---------- 22. Revisit loader (v11) ---------- */
/* The modal that covers the board for 3000 ms while the last line is set up underneath. */
.revisit { z-index: 45; }
.revisit-card {
  min-width: 230px;
  max-width: 86vw;
  padding: 16px 20px 14px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--brass);
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  animation: revisit-in 160ms ease-out;
}
.revisit-text { font-size: 16px; font-weight: 600; line-height: 22px; text-align: center; }
.revisit-bar { height: 2px; margin-top: 12px; background: var(--hair); overflow: hidden; }
.revisit-bar i { display: block; height: 2px; width: 0; background: var(--brass); }
@keyframes revisit-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
/* ---------- 22b. Mastered announcement ---------- */
/* A named line just reached 100 per cent: one short card, lifts on its own or on a tap. */
.mastered { z-index: 46; }
.mastered-card {
  width: min(340px, 90vw);
  padding: 20px 22px 18px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--hair);
  border-top: 3px solid var(--brass);
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  animation: revisit-in 160ms ease-out;
}
.mastered-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); }
.mastered-name { margin-top: 6px; font-size: 21px; font-weight: 600; line-height: 27px; }
.mastered-sub { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.mastered-keep { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hair); }
.mastered-keep[hidden] { display: none; }
.mastered-keep-q { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.mastered-rate { display: flex; border: 1px solid var(--hair); border-radius: 999px; overflow: hidden; }
.mastered-rate button { flex: 1 1 0; min-height: 40px; padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mastered-rate button + button { border-left: 1px solid var(--hair); }
.mastered-rate button[aria-checked="true"] { background: var(--brass); color: #14171A; }
.mastered-rate-note { margin-top: 10px; min-height: 40px; font-size: 13px; line-height: 20px; color: var(--muted); }
/* Focus list mastered (7e): what to work on next, then the two ways out. */
.fd-picks { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.fd-pick { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--hair); border-radius: 10px; text-align: left; }
.fd-pick:active { border-color: var(--brass); }
.fd-name { font-size: 15px; font-weight: 600; line-height: 20px; }
.fd-name .eco { font-size: 12px; font-weight: 500; color: var(--muted); }
.fd-why { font-size: 13px; line-height: 18px; color: var(--muted); }
.fd-acts { display: flex; gap: 8px; margin-top: 16px; }
.fd-acts .btn-outline { flex: 1 1 0; min-height: 44px; }
.fd-stay { margin-top: 10px; min-height: 40px; font-size: 13px; font-weight: 600; color: var(--muted); }
/* The pace row stands down while unguided drives the clock. */
.row-seg.ug-off .seg { opacity: 0.45; }
.row-seg.ug-off .seg .seg-b { pointer-events: none; }

/* ---------- 21. Account ---------- */
/* Appended block (design/v12-accounts.md section 8): the account page, the person glyph on the
   landing, the account row on settings and the sign-in line on the coach. */
.au-body .th-main > #au-view > .au-pane > .th-section:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.au-banner { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: var(--r); font-size: 14px; line-height: 20px; background: var(--card); }
.au-banner.au-ok { border-color: var(--ok); }
.au-banner.au-bad { border-color: var(--bad); }
.au-tabs { display: flex; margin: 4px 0 14px; }
.au-tabs .seg-b { flex: 1 1 0; min-height: 40px; }
.au-providers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.au-pbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.au-pbtn:active { opacity: 0.75; }
.au-pmark { width: 18px; height: 18px; flex: 0 0 auto; }
/* Apple: the black button, white mark and text. A hairline so it reads on the dark page. */
.au-apple { background: #000; color: #fff; border: 1px solid #3A3F44; font-family: -apple-system, system-ui, sans-serif; }
.au-apple .au-pmark { width: 17px; height: 20px; margin-top: -3px; }
/* Google: the dark neutral button from Google's sign-in guidelines. */
.au-google { background: #131314; color: #E3E3E3; border: 1px solid #8E918F; font-family: Roboto, system-ui, sans-serif; font-size: 14px; }
.au-or { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; margin: 2px 0 0; }
.au-form .au-field { display: block; margin-bottom: 12px; }
.au-form .ch-go { margin-top: 4px; }
.au-hint { margin: -4px 0 12px; }
.au-form .au-hint:last-child { margin: 12px 0 0; }
.au-err { margin: 0 0 8px; }
.au-turnstile { margin: 4px 0 12px; min-height: 65px; }
.au-links { display: flex; justify-content: flex-end; }
.au-linkbtn { color: var(--muted); }
.au-row { justify-content: space-between; font-size: 14px; }
.au-rowlab { color: var(--muted); flex: 0 0 auto; }
.au-rowval { text-align: right; min-width: 0; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.au-glyph { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.au-ok { color: var(--ok); }
.au-warn { color: var(--brass); }
.au-verify { border-top: 1px solid var(--hair); padding-top: 10px; margin-top: 4px; }
.au-verify .m-note { margin: 0 0 8px; }
.au-sent { margin-top: 8px; }
.au-tiles { margin-bottom: 10px; }
.au-meter { height: 4px; background: var(--hair); border-radius: 2px; overflow: hidden; margin: 0 0 10px; }
.au-meter i { display: block; height: 4px; background: var(--brass); }
.au-acts { margin: 4px 0 0; }
.au-acts .btn-outline, .au-resend { min-height: 44px; }
.au-delete .au-form .ch-keyinput { margin-bottom: 0; }
.au-delbtn { width: 100%; min-height: 44px; }
.au-delbtn:disabled { opacity: 0.4; }
.au-signlink { color: var(--brass); font-weight: 600; }

/* The person glyph next to the gear on the landing */
.op-gear.op-person { margin: -8px 0 0 0; }

/* Settings: the account row and the owner key disclosure */
.st-account { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; text-decoration: none; color: var(--text); }
.st-account:active { color: var(--brass); }
.st-account .st-acctmain { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.st-account .st-acctgo { flex: 0 0 auto; color: var(--brass); font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.st-account svg { width: 16px; height: 16px; }
.st-shelf > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; -webkit-tap-highlight-color: transparent; }
.st-shelf > summary { margin: 28px 2px 0; padding: 12px 0; min-height: 44px; border-top: 1px solid var(--hair); }
.st-shelf > summary .th-section { margin: 0; padding: 0; border-top: 0; }
.st-shelf[open] > summary { margin-bottom: 0; }
.st-shelf > summary::-webkit-details-marker { display: none; }
.st-shelf > summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform 0.15s; }
.st-shelf[open] > summary svg { transform: rotate(90deg); }
.st-owner { margin-top: 4px; }
.st-owner > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--muted); }
.st-owner > summary::-webkit-details-marker { display: none; }
.st-owner > summary svg { width: 14px; height: 14px; margin-right: 6px; transition: transform 0.15s; }
.st-owner[open] > summary svg { transform: rotate(90deg); }

/* Coach: the sign-in line on the setup screen */
.ch-signin { margin-top: 14px; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r); background: var(--card); font-size: 14px; line-height: 20px; }
.ch-signin a { color: var(--brass); font-weight: 600; }

/* The speaker glyph, inline SVG in place of the old emoji */
.ch-say svg, .th-say svg, .th-card-say svg { width: 20px; height: 20px; }
/* Sign-in handoff (account.js): the code Safari asks to confirm. */
.au-handoff .au-pin { font-size: 44px; font-weight: 700; letter-spacing: 0.18em; text-align: center; margin: 14px 0 16px; font-variant-numeric: tabular-nums; color: var(--brass); }
.au-handoff .au-pbtn { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------- v14 voice packs (design/v14-voice-packs.md section 7) ---------- */
/* The landing row under an opening card: quiet, one line, the control on the right. */
.vp-row { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: -4px; padding: 0 2px 0 4px; font-size: 13px; color: var(--muted); }
.vp-glyph { flex: 0 0 auto; width: 18px; height: 18px; display: flex; color: var(--muted); }
.vp-glyph svg { width: 18px; height: 18px; }
.vp-row.vp-ready .vp-glyph { color: var(--ok); }
.vp-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vp-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-line { display: flex; align-items: center; gap: 8px; }
.vp-bar { flex: 1 1 auto; height: 3px; border-radius: 2px; background: var(--hair); overflow: hidden; }
.vp-bar i { display: block; width: 0; height: 100%; background: var(--brass); transition: width 120ms linear; }
.vp-pct { flex: 0 0 auto; min-width: 34px; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.vp-act { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--brass); -webkit-tap-highlight-color: transparent; }
.vp-act:active { color: var(--text); }
/* The sheet. */
.vp-what { font-size: 14px; line-height: 20px; margin: 0 0 8px; }
.vp-size { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.vp-prog { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.vp-prog .vp-bar { height: 6px; border-radius: 3px; }
.vp-prog .vp-pct { font-size: 13px; min-width: 40px; }
.vp-msg:empty { display: none; }
.vp-acts { display: flex; gap: 10px; margin-top: 16px; }
/* The drill's one-time hint when narration is on and the opening's pack is not on the phone. */
.vp-hint {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe)); z-index: 45;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 6px 10px 12px; border: 1px solid var(--hair); border-radius: var(--r);
  background: var(--card); font-size: 13px; line-height: 18px; color: var(--text);
}
.vp-hint .vp-glyph { color: var(--brass); }
.vp-hint span { flex: 1 1 auto; }
.vp-hint button { flex: 0 0 auto; min-width: 44px; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--brass); }
/* Settings: installed packs. */
.vp-list { padding: 0 12px; }
.vp-row[hidden] { display: none; }

/* ---------- 23. A question from a paused walkthrough (v18) ---------- */
/* The chip over the question box: the move on the board and the sentence being read, while the
   box is open on a stopped answer. On a sent question it shrinks to the move, and a tap shows it. */
.ch-inputrow { flex-wrap: wrap; }
.ch-anchor {
  flex: 1 0 100%;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 12px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.06);
  font-size: 13px;
  line-height: 18px;
}
.ch-anc-glyph { flex: 0 0 auto; width: 10px; height: 10px; fill: var(--brass); }
.ch-anc-mv {
  flex: 0 0 auto;
  color: var(--brass);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ch-anc-say {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-anc-x {
  flex: 0 0 auto;
  position: relative;
  width: 40px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.ch-anc-x svg { width: 12px; height: 12px; fill: currentColor; }
.ch-anc-x::after { content: ''; position: absolute; inset: -6px 0; }
.ch-anc-x:active { color: var(--brass); }
.ch-me-at {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: -2px 0 3px;
  padding: 2px 0;
  color: var(--brass);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 16px;
}
.ch-me-at svg { width: 9px; height: 9px; fill: currentColor; }
.ch-me-at:active { opacity: 0.6; }

/* ---------- 19. Focus page (Tal build #31) ---------- */
/* One line to drill: the Book sheet's rows on a page of their own, reached from the landing. */
.fc-books { margin-bottom: 12px; width: max-content; }
.fc-books .seg-b { min-height: 36px; padding: 0 16px; font-size: 13px; }
.fc-now { border-color: rgba(201, 162, 39, 0.35); }
.fc-sec { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); margin-bottom: 6px; }
.fc-sec-add { margin: 18px 2px 8px; color: var(--muted); }
.fc-empty { font-size: 14px; line-height: 20px; color: var(--muted); margin: 4px 0 0; }
.fc-fam { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.fc-tog { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--hair); color: var(--muted); }
.fc-tog svg { width: 16px; height: 16px; }
.fc-tog.on { border-color: var(--brass); color: var(--brass); }
.fc-mine .fc-tog { border-color: var(--hair); color: var(--muted); }
.fc-mine .fc-row + .fc-row { border-top: 1px solid var(--hair); }
.fc-mine .fc-on { background: none; }
.fc-less { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px 10px; font-size: 12px; color: var(--brass); }
.fc-less button { flex: 0 0 auto; min-height: 30px; padding: 0 12px; border: 1px solid var(--hair); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fc-acts { padding: 12px 0 0; }
.fc-acts button { min-height: 44px; }
.fc-find {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  margin: 2px 0 4px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  font: inherit;
  font-size: 16px;
}
.fc-find:focus { outline: none; border-color: var(--brass); }
.fc-list .b-tap { min-height: 44px; }
.fc-on { background: rgba(201, 162, 39, 0.08); border-radius: var(--r); }


/* ---------- 20. Focus list in the trainer (2026-10-11) ---------- */
/* The tracker's target glyph: hollow while the variation is off the list, brass filled on it. */
/* The chip and the glyph sit side by side, centred on the name and crumb lines. */
.t-tools {
  position: absolute;
  right: 4px;
  top: calc(10px + env(safe-area-inset-top, 0px));
  height: 36px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.t-focus {
  width: 44px;
  height: 44px;
  margin: -4px 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.t-focus svg { width: 22px; height: 22px; }
.t-focus { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }   /* a long press opens the bubble, not a callout */
.t-focus:active { opacity: 0.6; }
.t-focus.on { color: var(--brass); }
.t-focus.on .fg-dot { fill: currentColor; }
.t-focus.on:active { opacity: 1; }   /* the yellow shows the moment the tap lands */
#tracker .t-name, #tracker .t-crumb { padding-right: 116px; }

/* The focus builder bubble (Ara, 2026-10-15): hangs under the tracker, its point on the target.
   app.js sets --fb-top (the tracker's bottom) and --fb-x (the point's left edge). */
.fb { position: fixed; inset: 0; z-index: 48; }
.fb-scrim { position: absolute; inset: 0; background: rgba(10, 12, 14, 0.45); }
.fb-bubble {
  position: absolute;
  left: 8px;
  right: 8px;
  top: var(--fb-top, 72px);
  max-height: calc(100dvh - var(--fb-top, 72px) - 12px - var(--safe));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  transform-origin: calc(var(--fb-x, 340px) - 8px) 0;
  animation: fb-pop 160ms ease-out;
}
.fb-bubble::before {
  content: '';
  position: absolute;
  top: -7px;
  left: calc(var(--fb-x, 340px) - 8px);
  width: 12px;
  height: 12px;
  background: var(--card);
  border-left: 1px solid rgba(201, 162, 39, 0.35);
  border-top: 1px solid rgba(201, 162, 39, 0.35);
  transform: rotate(45deg);
}
@keyframes fb-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: none; }
}
/* The focus target's bubble (Ara, 2026-10-26): under the target, fades on its own, blocks nothing. */
.fq { position: fixed; inset: 0; z-index: 48; pointer-events: none; }
.fq-bubble {
  pointer-events: auto;
  position: absolute;
  right: 8px;
  top: var(--fb-top, 72px);
  max-width: calc(100% - 16px);
  padding: 12px 16px;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--brass);
  text-align: left;
  background: var(--card);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  transform-origin: calc(100% - 20px) 0;
  animation: fb-pop 160ms ease-out;
}
.fq-bubble::before {
  content: '';
  position: absolute;
  top: -7px;
  right: var(--fq-r, 20px);
  width: 12px;
  height: 12px;
  background: var(--card);
  border-left: 1px solid rgba(201, 162, 39, 0.35);
  border-top: 1px solid rgba(201, 162, 39, 0.35);
  transform: rotate(45deg);
}
.fq-bubble:active { opacity: 0.7; }
.fq-tip { pointer-events: none; min-height: 0; padding: 9px 14px; font-size: 14px; font-weight: 500; color: var(--text); }
.fq.fading .fq-bubble { opacity: 0; transition: opacity 400ms ease; }
.fb-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 6px 8px 16px; }
.fb-headtext { flex: 1 1 auto; min-width: 0; }
.fb-title { font-size: 16px; font-weight: 600; line-height: 22px; }
.fb-sub { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.fb-done { flex: 0 0 auto; min-height: 44px; margin-top: -8px; padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--brass); }
.fb-done:active { opacity: 0.6; }
.fb-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 12px 14px; }
.fb-here { margin-bottom: 14px; }
.fb-here .b-fam { margin-top: 0; padding-top: 0; border-top: 0; }

.fc-row .b-top { align-items: center; }

/* Home: the way back to the landing page, top-left of the tracker (feedback 2026-10-11). */
.t-home {
  position: absolute;
  left: 4px;
  top: calc(6px + env(safe-area-inset-top, 0px));
  width: 52px;
  height: 52px;
  margin: -4px 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.t-home svg { width: 22px; height: 22px; }
.t-home:active { opacity: 0.6; }
#tracker { padding-left: 48px; }

/* Ask about this position (feedback _f5iXZ3DG2Uvall2lbpMcQ): a small pill at the card's top right,
   floated so the card's text wraps round it, and the sheet it opens (public/ask.js). */
.c-ask {
  float: right;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  margin: -4px -6px 4px 10px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
/* A 44px tap target round the 32px pill. */
.c-ask::after { content: ''; position: absolute; inset: -6px -4px; }
.c-ask svg { width: 18px; height: 18px; color: var(--brass); }
.c-ask:active { color: var(--text); border-color: var(--muted); }
.ask-panel {
  display: flex;
  flex-direction: column;
  height: min(80dvh, 680px);
  overflow: hidden;
  padding-bottom: calc(12px + var(--safe));
}
.ask-panel .b-head h2 { font-size: 18px; white-space: nowrap; }
.ask-where { font-size: 13px; color: var(--brass); line-height: 18px; margin: 0 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--hair);
  padding: 4px 0 8px;
}
.ask-log:empty::before {
  content: 'Ask anything about the position on the board: why the book plays its move, what your move runs into, how this line differs from another.';
  display: block;
  margin-top: 10px;
  font-size: 13px;
  line-height: 19px;
  color: var(--muted);
}
.ask-q {
  margin: 12px 0 0 auto;
  max-width: 85%;
  width: fit-content;
  padding: 8px 12px;
  border-radius: var(--r);
  background: var(--hair);
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
  -webkit-user-select: text;
  user-select: text;
}
.ask-a { margin-top: 10px; font-size: 15px; line-height: 22px; -webkit-user-select: text; user-select: text; }
.ask-a p { margin: 0 0 10px; }
.ask-a .ask-wait { color: var(--muted); font-size: 13px; }
.ask-note { font-size: 13px; line-height: 19px; color: var(--muted); padding: 6px 0 2px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--hair); }
.ask-input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px or iOS zooms the page on focus */
  line-height: 22px;
}
.ask-input:focus { outline: none; border-color: var(--muted); }
.ask-input:disabled { opacity: 0.5; }
.ask-send { flex: 0 0 auto; min-height: 44px; min-width: 72px; }
.ask-send:disabled { opacity: 0.4; }

/* ---------- Stats: the player's own sticking point (feedback 9URACP45XWR3F5YwT_2-kQ) ---------- */
.s-stick { margin-top: 16px; padding: 10px 12px; border: 1px solid rgba(201, 162, 39, 0.35); border-radius: var(--r); font-size: 13px; line-height: 19px; color: var(--muted); }
.s-stick-h { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); margin-bottom: 4px; }
.s-stick-m .strong { color: var(--text); font-weight: 600; }
.s-stick-why { margin-top: 4px; }
/* v21: the profile under the sticking point. Strong suits, problem areas, habits, suggestions. */
.s-prof { margin-top: 16px; font-size: 13px; line-height: 19px; color: var(--muted); }
.s-prof-h { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); margin: 12px 0 4px; }
.s-prof-h:first-child { margin-top: 0; }
.s-prof-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.s-prof-name { color: var(--text); font-weight: 600; min-width: 0; }
.s-prof-name .eco { font-weight: 400; color: var(--muted); font-size: 12px; }
.s-prof-val { white-space: nowrap; font-size: 12px; }
.s-prof-note { margin-top: 2px; }
.s-prof-sug { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--r); }
.s-prof-act { margin-top: 8px; }

/* ---------- Player insights (insights.html, owner only) ---------- */
.in-back svg { width: 22px; height: 22px; }
.in-tools { margin: 0 0 12px; }
.in-seg { width: max-content; max-width: 100%; }
.in-seg .seg-b { min-height: 36px; padding: 0 14px; font-size: 13px; }
.in-note { margin: 8px 2px 12px; }
.in-note a { color: var(--brass); }
.in-user .in-who { margin-top: 16px; overflow-wrap: anywhere; text-transform: none; letter-spacing: 0.02em; }
.in-user:first-child .in-who { margin-top: 4px; border-top: 0; padding-top: 0; }
.in-var { font-size: 14px; line-height: 20px; }
.in-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); margin-bottom: 6px; }
.in-move { font-size: 15px; line-height: 21px; }
.in-san { font-weight: 700; color: var(--text); }
.in-stat { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.in-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--hair); color: var(--muted); }
.in-tag.hot { border-color: var(--brass); color: var(--brass); }
.in-tag.ok { border-color: var(--ok); color: var(--ok); }
.in-inst { margin-top: 6px; }
.in-path { color: var(--muted); overflow-wrap: anywhere; }
.in-why { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 19px; }
.in-lab { color: var(--text); font-weight: 600; }
.in-when { margin-top: 6px; color: var(--muted); font-size: 12px; }
.in-more { margin-top: 10px; border-top: 1px solid var(--hair); padding-top: 8px; }
.in-more summary { min-height: 36px; display: flex; align-items: center; color: var(--brass); font-size: 13px; font-weight: 600; cursor: pointer; }
.in-sub { padding: 10px 0; border-top: 1px solid var(--hair); }
.in-sub:first-of-type { border-top: 0; }

/* Focus page shelves (feedback 2026-10-11): each family folds shut, its lines indent under the chevron. */
.fc-list .b-fam { margin-top: 0; padding-top: 0; border-top: 0; }
.fc-shelf { padding: 2px 0; }
.fc-shelf + .fc-shelf { border-top: 1px solid var(--hair); }
.fc-shelf.open { background: rgba(201, 162, 39, 0.04); border-radius: var(--r); }
.fc-chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); transition: transform 0.15s; }
.fc-chev svg { width: 18px; height: 18px; display: block; }
.fc-chev.open { transform: rotate(90deg); color: var(--brass); }
.fc-tog { position: relative; }
.fc-tog::after { content: ''; position: absolute; inset: -8px; }
.fc-list .b-in1 { padding-left: 26px; }
.fc-list .b-in2 { padding-left: 40px; }
.fc-list .b-in3 { padding-left: 54px; }

/* ---------- 24. Home v24: rows, the launch sheet (design/v24-home.md) ---------- */
.op-list { gap: 10px; }
/* A row: the body opens the sheet, the play glyph launches. */
.hm-row { display: flex; align-items: stretch; min-height: 72px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); }
.hm-row:active { border-color: var(--brass); }
.hm-row.op-off { opacity: 0.55; }
.hm-row.op-off:active { border-color: var(--hair); }
.hm-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 12px 14px; text-align: left; -webkit-tap-highlight-color: transparent; }
.hm-l1 { display: flex; align-items: baseline; gap: 10px; }
.hm-l1 .op-name { min-width: 0; font-size: 16px; line-height: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hm-tags { font-size: 13px; line-height: 18px; color: var(--muted); }
.hm-body .op-bar { flex: 0 0 auto; width: 100%; margin-top: 2px; }
.hm-vnote { font-size: 12px; line-height: 16px; color: var(--brass); }
.hm-play { flex: 0 0 52px; display: grid; place-items: center; min-height: 44px; color: var(--brass); -webkit-tap-highlight-color: transparent; }
.hm-play svg { width: 32px; height: 32px; }
.hm-play:active { color: var(--text); }
.hm-row.hm-soon { min-height: 60px; }
.hm-row.hm-soon .op-name { color: var(--muted); }
/* The Coming section. */
.hm-coming { margin-top: 22px; }
.hm-div { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 2px 4px; }
.hm-dnote { margin: 0 2px 10px; }
/* The first-open strip. */
.hm-start { display: flex; flex-direction: column; gap: 6px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--brass); border-radius: var(--r); }
.hm-stitle { font-size: 16px; font-weight: 600; color: var(--brass); }
.hm-spitch { font-size: 14px; line-height: 20px; }
.hm-snote { font-size: 12px; line-height: 17px; color: var(--muted); }
.hm-sgo { min-height: 44px; width: 100%; margin-top: 4px; }
/* The sign-in wall (Ara, 2026-10-16): the mastered card's look, above every sheet. */
.signwall { z-index: 70; }
.sw-go { display: block; margin-top: 16px; min-height: 44px; line-height: 44px; text-align: center; text-decoration: none; }
/* The new-user preview (thread 1054): a strip under the title while a stash is held; the Settings card. */
.hm-preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 8px 8px 8px 14px; font-size: 12px; color: var(--brass); border: 1px solid var(--brass); border-radius: var(--r); }
.hm-pback { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--brass); background: none; color: var(--brass); font: inherit; font-weight: 600; }
.st-previewcard .th-p { padding: 12px 0 0; }
.st-previewacts { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.st-previewgo { min-height: 44px; width: 100%; }
.st-previewcard > .st-previewgo { margin: 12px 0; }
/* The launch sheet, above the update bar; the voice sheet above it. */
#hm-sheet { z-index: 52; }
#vp-sheet { z-index: 53; }
.hm-panel { max-height: 88dvh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.hm-grab { position: relative; flex: 0 0 auto; }
.hm-grab::after { content: ''; position: absolute; inset: -20px -40px; }
.hm-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.hm-moves { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.hm-taglist { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 10px; }
.hm-tag { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--hair); border-radius: 999px; padding: 3px 10px; }
.hm-pitch { font-size: 15px; line-height: 22px; margin: 0 0 6px; }
.hm-blurb { font-size: 13px; line-height: 19px; color: var(--muted); margin: 0 0 12px; }
.hm-mast { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin: 0 0 4px; padding: 6px 0 4px; text-align: left; -webkit-tap-highlight-color: transparent; }
.hm-mast .op-bar { flex: 0 0 auto; width: 100%; }
.hm-mrow { display: flex; align-items: center; gap: 8px; }
.hm-mline { flex: 1 1 auto; font-size: 13px; line-height: 18px; color: var(--muted); }
.hm-mrow svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
.hm-mast:active .hm-mline, .hm-mast:active svg { color: var(--brass); }
.hm-sug { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--hair); border-radius: var(--r); }
.hm-sug .m-note { flex: 1 1 auto; }
.hm-sug .btn-outline { min-height: 44px; flex: 0 0 auto; color: var(--brass); }
.hm-seg { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r); }
.hm-seg .seg-b { min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 14px; }
.hm-seg .seg-b small { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.hm-seg .seg-b[aria-checked="true"] { background: var(--brass); color: #14171A; }
.hm-onote { margin: 6px 0 0; }
.hm-basic { margin-top: 10px; }
.hm-blab { display: flex; flex-direction: column; gap: 2px; }
.hm-blab small { font-size: 12px; color: var(--muted); }
.hm-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 2px; border-top: 1px solid var(--hair); text-align: left; font-size: 15px; -webkit-tap-highlight-color: transparent; }
.hm-link svg { flex: 0 0 auto; width: 18px; height: 18px; }
.hm-link .hm-lval { flex: 1 1 auto; text-align: right; font-size: 13px; color: var(--muted); }
.hm-link:active { color: var(--brass); }
#hm-voice .vp-row { margin-top: 0; border-top: 1px solid var(--hair); }
.hm-go { flex: 0 0 auto; padding: 10px 0 calc(12px + var(--safe)); border-top: 1px solid var(--hair); background: var(--card); }
.hm-go .btn-fill, .hm-go .btn-outline { width: 100%; min-height: 48px; font-size: 16px; }
.hm-keep { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
body.op-body.hm-lock { overflow: hidden; }
@media (max-width: 359px) { .hm-play { flex-basis: 46px; } .hm-body { padding-left: 12px; } }

/* ---------- 25. Home: Drill or Analyze (Tal build #67, feedback 3rAaGRTORWQkEOBHw840vA) ---------- */
/* The old Classical/Blitz pill a size up: full width under the title, the picked half in brass. */
.hm-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 16px; border: 1px solid var(--hair); border-radius: 999px; overflow: hidden; }
.hm-tab { min-height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.hm-tab:active { background: rgba(201, 162, 39, 0.08); }
.hm-tab[aria-selected="true"] { background: var(--brass); color: #14171A; }

/* ---------- 26. Coach: the book overlay (v25, design/v25-book-overlay.md) ---------- */
/* The strip under the move row: the variation at play, where the game left the book, the drill
   record, Ask and Drill. The eval row's right end says where the viewed ply stands; the move strip
   underlines the stretch the game stayed in the book. */
.ch-book {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--hair);
  background: rgba(201, 162, 39, 0.06);
}
.ch-bookglyph { flex: 0 0 auto; width: 20px; height: 20px; color: var(--brass); }
/* Tal build #220: the game left the player's prep; the strip names the opening it went into. */
.ch-book.ch-prep { background: rgba(154, 163, 171, 0.06); }
.ch-book.ch-prep .ch-bookglyph { color: var(--muted); }
.ch-booktext { flex: 1 1 auto; min-width: 0; }
.ch-bookname { font-size: 14px; font-weight: 600; line-height: 18px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bookname .eco { font-size: 11px; font-weight: 600; color: var(--brass); letter-spacing: 0.04em; margin-left: 6px; }
.ch-booksub {
  font-size: 12px;
  line-height: 15px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.ch-bookbtn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.ch-bookbtn:active { color: var(--text); border-color: var(--text); }
.ch-bookdrill { border-color: var(--brass); color: var(--brass); }
.ch-bookdrill:active { background: var(--brass); color: #14171A; }
.ch-bookat {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  color: var(--brass);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-bookat.ch-left { color: var(--muted); }
.movelist .ch-inbook { box-shadow: inset 0 -2px 0 rgba(201, 162, 39, 0.5); border-radius: 4px 4px 0 0; }
.movelist .ch-leftbook { box-shadow: inset 0 -2px 0 var(--muted); border-radius: 4px 4px 0 0; }
.movelist .viewing.ch-inbook, .movelist .viewing.ch-leftbook { box-shadow: none; border-radius: 4px; }


/* Per-variation bars under a focus card (feedback vkrZhTrglF0fCoWZHiWtog). */
.fc-sub { margin: 0 0 8px 14px; padding: 6px 0 0 10px; border-left: 2px solid var(--hair); }
.fc-sub .b-top { display: flex; align-items: center; gap: 8px; }
.fc-sub .b-lab { flex: 1 1 auto; font-size: 13px; color: var(--text); }
.fc-sub .b-meter { margin-top: 4px; }
.fc-how { font-size: 12px; line-height: 17px; color: var(--muted); margin: 10px 2px 0; }

/* ---------- Progress (Tal build #85, design/v31-progress.md) ---------- */
/* The launch sheet's bar opens it: the whole opening big, with a key; the problem areas; every line. */
.pg-sec { margin: 18px 2px 8px; }
.pg-sum .op-bar { display: block; height: 10px; border-radius: 5px; margin: 10px 0 12px; }
.pg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pg-word { font-size: 17px; font-weight: 600; }
.pg-word.on { color: var(--ok); }
.pg-pct { font-size: 13px; color: var(--muted); text-align: right; }
.pg-key { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.pg-k { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.pg-k i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; background: var(--hair); }
.pg-k-mastered i { background: var(--ok); }
.pg-k-problem i { background: var(--problem); }
.pg-k-slip i { background: var(--weak); }
.pg-k-learning i { background: var(--seen); }
.pg-k-unseen i { box-shadow: inset 0 0 0 1px #3A4148; }
.pg-kw { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-k b { margin-left: auto; color: var(--text); font-weight: 600; }
.pg-how { font-size: 12px; line-height: 17px; color: var(--muted); margin: 12px 0 0; }
.pg-meter { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.pg-meter .op-bar { flex: 0 0 auto; width: 100%; }
.pg-count { font-size: 12px; line-height: 16px; color: var(--muted); }
.pg-studied { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.pg-time { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); }
.pg-mark { white-space: nowrap; }
.pg-mark i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.pg-mark-problem i { background: var(--problem); }
.pg-mark-slip i { background: var(--weak); }
.pg-none { font-size: 14px; line-height: 20px; color: var(--muted); margin: 0; }
.pg-fix { margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--hair); }
.pg-fixgo { display: block; width: 100%; min-height: 44px; font-size: 15px; }
.pg-fixnote { font-size: 12px; line-height: 17px; color: var(--muted); margin: 8px 0 0; }
.pg-fix + .pg-none { margin-top: 2px; }
.pg-prob + .pg-prob { border-top: 1px solid var(--hair); padding-top: 12px; margin-top: 12px; }
.pg-prob .b-top { align-items: center; }
.pg-fam { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pg-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.pg-why { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 18px; }
.pg-drill { flex: 0 0 auto; min-height: 44px; color: var(--brass); }
.pg-prob .b-lab, .pg-row .b-lab { white-space: normal; }
.pg-list { padding: 2px 10px; }
.pg-shelf { padding: 2px 0; }
.pg-shelf + .pg-shelf { border-top: 1px solid var(--hair); }
.pg-tap { min-height: 44px; }
.pg-row .b-top { align-items: center; }
.pg-famrow .b-lab { font-size: 15px; color: var(--brass); }
.pg-row.open { background: rgba(201, 162, 39, 0.05); border-radius: var(--r); }
.pg-acts { padding: 0 2px 10px; }
.pg-list .b-in1 { padding-left: 22px; }
.pg-list .b-in2 { padding-left: 36px; }
.pg-list .b-in3 { padding-left: 50px; }

/* Tal build #102: delete an analysis. A bin beside each saved row and in the Coach's header;
   the first tap turns it into Delete, the second deletes. */
.ch-savedwrap { position: relative; }
.ch-savedwrap + .ch-savedwrap, .ch-savedrow + .ch-savedwrap, .ch-savedwrap + .ch-savedrow { margin-top: 8px; }
.ch-savedwrap > .ch-bin { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); }
.ch-bin {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.ch-bin svg { width: 20px; height: 20px; }
.ch-bin.armed { color: #14171A; background: var(--bad, #B9603F); }
.ch-bin:disabled { opacity: 0.5; }
.ch-delbox { flex: 0 0 auto; margin-left: auto; display: inline-flex; }
.ch-delbox[hidden] { display: none; }
.ch-delbox + .ch-say { margin-left: 0; }

/* ---------- 24. Voice notes (Tal build #211) ---------- */
/* The mic beside Send: tap to record, tap again to stop; the words land in the question box. */
.ch-mic {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--hair);
  border-radius: 22px;
  color: var(--brass);
}
.ch-mic[hidden] { display: none; }
.ch-mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ch-mic:disabled { opacity: 0.4; }
.ch-mic-t { font-size: 14px; font-variant-numeric: tabular-nums; }
.ch-mic-t:empty { display: none; }
.ch-mic.ch-rec { border-color: var(--bad); color: var(--bad); }
.ch-mic.ch-rec svg rect { fill: currentColor; animation: ch-rec-pulse 1.2s ease-in-out infinite; }
.ch-mic.ch-busy svg { animation: ch-rec-pulse 1s ease-in-out infinite; }
@keyframes ch-rec-pulse { 50% { opacity: 0.35; } }

/* ---------- Tal mode (Tal build #222) ---------- */
/* Left of the question box: on, every question reads the game for its risks. */
.ch-tal {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--hair);
  border-radius: 22px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.ch-tal.on { border-color: var(--brass); background: var(--brass); color: #14171A; }
.ch-tal:disabled { opacity: 0.4; }
