/* Styles for the interactive tools on the static SEO pages.
   Loaded alongside /css/seo-page.css, whose palette it reuses exactly:
   ground #0a0f1a, panel #111827, deep panel #0d1424, border #1f2937,
   accent #6ee7b7, muted #94a3b8 / #64748b.
   Every class is prefixed ct- so it can never collide with the essay styles. */

.ct-tool {
  background: #0d1424;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 18px 18px 20px;
  margin: 0 0 28px;
}
.ct-tool-failed { color: #94a3b8; font-size: 14px; }

/* Wrapper around a mount point. Reserves vertical space before the script
   runs so the tool does not shove the article down as it appears. */
.ct-host { min-height: 120px; }
.ct-noscript {
  background: #111827; border: 1px solid #1f2937; border-radius: 10px;
  padding: 14px 18px; font-size: 14px; color: #94a3b8; margin: 0 0 28px;
}
/* One line of orientation above a tool that was added to an existing essay. */
.ct-intro { font-size: 15.5px; color: #cbd5e1; margin: 0 0 16px; }

/* The UA rule for [hidden] is display:none, but ANY author display rule beats
   it, so .ct-row on a hidden element kept it on screen (the wins/draws/losses
   row stayed visible in single-game mode). Make hiding win everywhere. */
.ct-tool [hidden] { display: none !important; }

/* ── layout ─────────────────────────────────────────────────────────── */
.ct-layout { display: flex; gap: 20px; align-items: flex-start; }
.ct-col { min-width: 0; }
.ct-col-board { flex: 0 0 300px; }
.ct-col-side { flex: 1 1 auto; }
.ct-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.ct-row > * { flex: 1 1 150px; min-width: 0; }
.ct-row-3 > * { flex: 1 1 80px; }
.ct-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 2 1 240px; }

/* ── form controls ──────────────────────────────────────────────────── */
.ct-field { margin: 0 0 14px; }
.ct-label {
  display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #64748b; margin: 0 0 6px;
}
.ct-hint { font-size: 12.5px; color: #64748b; margin: 6px 0 0; }
.ct-input, .ct-select, .ct-textarea {
  width: 100%; box-sizing: border-box;
  background: #0a0f1a; color: #e8edf5;
  border: 1px solid #1f2937; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; line-height: 1.4;
}
.ct-textarea { resize: vertical; min-height: 120px; }
.ct-input:focus, .ct-select:focus, .ct-textarea:focus {
  outline: none; border-color: #6ee7b7; box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.18);
}
.ct-mono { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit; padding: 11px 16px;
  /* Some of these are anchors (the board-editor handoff), and the essay
     stylesheet underlines an anchor on hover. A button does not. */
  text-decoration: none;
}
.ct-btn:disabled { opacity: 0.55; cursor: default; }
.ct-btn:hover { text-decoration: none; }
.ct-btn-primary { background: #6ee7b7; color: #0a0f1a; width: 100%; }
.ct-btn-primary:hover:not(:disabled) { background: #5ed5a5; }
.ct-btn-ghost { background: #111827; color: #cbd5e1; border-color: #1f2937; }
.ct-btn-ghost:hover { color: #e8edf5; border-color: #334155; }
.ct-actions .ct-btn-primary { width: auto; }

/* ── board ──────────────────────────────────────────────────────────── */
.ct-boardhost { width: 100%; }
.ct-board { width: 100%; }
.ct-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  /* Rows must be explicit too. With columns only, the rows size to their
     content and the board is visibly uneven until every piece SVG lands. */
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1 / 1; width: 100%;
  border: 1px solid #1f2937; border-radius: 8px; overflow: hidden;
}
.ct-sq {
  position: relative; padding: 0; margin: 0; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ct-light { background: #cfd8e3; }
.ct-dark { background: #6d84a1; }
.ct-selected { box-shadow: inset 0 0 0 3px #6ee7b7; }
.ct-from, .ct-to { box-shadow: inset 0 0 0 3px #f7c631; }
.ct-target::after {
  content: ''; position: absolute; width: 26%; height: 26%; border-radius: 50%;
  background: rgba(10, 15, 26, 0.35);
}
.ct-piece { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.ct-boardbar { display: flex; gap: 8px; margin-top: 10px; }
.ct-boardbar .ct-btn { flex: 1; padding: 9px 10px; font-size: 13px; }

/* ── status + progress ──────────────────────────────────────────────── */
.ct-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; margin: 10px 0 0; min-height: 20px; color: #94a3b8;
}
.ct-status:empty { margin: 0; min-height: 0; }
.ct-status-error { color: #f0a5a5; }
.ct-status-done { color: #6ee7b7; }
.ct-spinner {
  width: 13px; height: 13px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid #1f2937; border-top-color: #6ee7b7;
  animation: ct-spin 0.8s linear infinite;
}
@keyframes ct-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ct-spinner { animation-duration: 3s; } }

.ct-bar { height: 5px; background: #111827; border-radius: 3px; overflow: hidden; margin: 12px 0 0; }
.ct-bar-fill { height: 100%; width: 0; background: #6ee7b7; transition: width 0.2s linear; }

/* ── results ────────────────────────────────────────────────────────── */
.ct-result:empty { display: none; }
.ct-result { margin-top: 16px; }
.ct-verdict, .ct-report-head {
  display: flex; gap: 10px; align-items: flex-start;
  background: #111827; border: 1px solid #1f2937; border-left: 3px solid #6ee7b7;
  border-radius: 8px; padding: 13px 15px; margin: 0 0 14px; color: #cbd5e1; font-size: 14px;
}
.ct-verdict svg, .ct-report-head svg { color: #6ee7b7; flex-shrink: 0; margin-top: 2px; }
.ct-verdict strong { display: block; color: #e8edf5; font-size: 16px; margin-bottom: 3px; }
.ct-verdict-sub { font-size: 13px; color: #94a3b8; }
.ct-note { font-size: 12.5px; color: #64748b; margin: 12px 0 0; line-height: 1.55; }
.ct-subhead { font-size: 14px; color: #94a3b8; margin: 20px 0 6px; }

.ct-cands { display: flex; flex-direction: column; gap: 6px; }
.ct-cand {
  display: grid; grid-template-columns: 46px 62px 56px 1fr; gap: 10px; align-items: baseline;
  background: #0a0f1a; border: 1px solid #1f2937; border-radius: 8px; padding: 9px 12px; font-size: 13.5px;
  /* A candidate is a button: pressing it plays that move on the board, which
     is how a visitor asks "and then what?" without retyping a FEN. */
  font-family: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer;
  transition: border-color 0.2s;
}
.ct-cand:hover { border-color: #334155; }
.ct-cand-best { border-color: #2f6b57; }
.ct-cand-best:hover { border-color: #6ee7b7; }
.ct-cand-rank { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; }
.ct-cand-best .ct-cand-rank { color: #6ee7b7; }
.ct-cand-move { font-weight: 700; color: #e8edf5; font-size: 15px; }
.ct-cand-eval { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; color: #cbd5e1; }
.ct-cand-line {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  color: #64748b; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ct-sides { display: flex; gap: 12px; flex-wrap: wrap; }
.ct-side-card {
  flex: 1 1 200px; background: #0a0f1a; border: 1px solid #1f2937;
  border-radius: 10px; padding: 14px 16px;
}
.ct-side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ct-side-head strong { color: #e8edf5; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; border: 1px solid #475569; }
.ct-dot-white { background: #e8edf5; }
.ct-dot-black { background: #0a0f1a; }
.ct-accuracy { display: flex; align-items: baseline; gap: 5px; }
.ct-accuracy-value { font-size: 30px; font-weight: 700; color: #6ee7b7; letter-spacing: -0.02em; }
.ct-accuracy-unit { font-size: 12.5px; color: #64748b; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.ct-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #111827; border: 1px solid #1f2937; border-radius: 999px;
  padding: 3px 9px; font-size: 11.5px; color: #cbd5e1;
}
.ct-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ct-chip-color, #94a3b8); }

.ct-table-wrap { overflow-x: auto; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ct-table th, .ct-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #1f2937; }
.ct-table thead th, .ct-table tbody th {
  color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11.5px;
}
.ct-table tbody th { text-transform: none; letter-spacing: 0; font-size: 13px; color: #94a3b8; }
.ct-table td { color: #cbd5e1; }
.ct-table .ct-sub { display: block; font-size: 11.5px; color: #64748b; margin-top: 2px; }
.ct-quality { font-weight: 600; }
.ct-cost { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; }
.ct-pos { color: #6ee7b7; }
.ct-neg { color: #f0a5a5; }
.ct-row-active td { background: #111827; }

/* ── tabs (Elo) ─────────────────────────────────────────────────────── */
.ct-tabs { display: flex; gap: 6px; margin: 0 0 16px; }
.ct-tab {
  background: #111827; border: 1px solid #1f2937; color: #94a3b8;
  border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-family: inherit; cursor: pointer;
}
.ct-tab-on { background: #6ee7b7; border-color: #6ee7b7; color: #0a0f1a; font-weight: 700; }

/* ── conversion ask, after the result and never before it ───────────── */
.ct-cta-wrap { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #1f2937; }
.ct-cta-line { font-size: 14px; color: #cbd5e1; margin: 0 0 10px; }
.ct-cta {
  display: inline-block; background: #6ee7b7; color: #0a0f1a;
  padding: 11px 20px; border-radius: 9px; font-weight: 700; font-size: 14.5px; text-decoration: none;
}
.ct-cta:hover { background: #5ed5a5; text-decoration: none; }

/* ── cross-links between the tools ──────────────────────────────────── */
.ct-toollinks {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px;
}
.ct-toollinks span {
  font-size: 12px; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.07em; align-self: center; margin-right: 2px;
}
.ct-toollinks a {
  display: inline-flex; align-items: center; gap: 6px;
  background: #111827; border: 1px solid #1f2937; border-radius: 999px;
  padding: 6px 13px; font-size: 13px; color: #cbd5e1; text-decoration: none;
}
.ct-toollinks a:hover { border-color: #6ee7b7; color: #6ee7b7; text-decoration: none; }

/* ── narrow screens: the board stacks, tables stay at three columns ──── */
@media (max-width: 640px) {
  .ct-tool { padding: 14px 14px 16px; }
  .ct-layout { flex-direction: column; }
  .ct-col-board { flex: 1 1 auto; width: 100%; max-width: 340px; margin: 0 auto; }
  .ct-col-side { width: 100%; }
  .ct-cand { grid-template-columns: 40px 1fr 52px; grid-template-areas: 'rank move eval' '. line line'; }
  .ct-cand-rank { grid-area: rank; }
  .ct-cand-move { grid-area: move; }
  .ct-cand-eval { grid-area: eval; text-align: right; }
  .ct-cand-line { grid-area: line; white-space: normal; }
  .ct-table th, .ct-table td { padding: 7px 6px; font-size: 12.5px; }
  .ct-actions { flex: 1 1 100%; }
  .ct-actions .ct-btn { flex: 1 1 auto; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Components added for the reworked tools (editor, analysis board, the
   depth-confidence signal, the rating sliders). Same palette, same ct-
   prefix, same no-framework rules as everything above.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── confidence signal ───────────────────────────────────────────────────
   Never present a wrong number as certain. A shallow search says so, and
   the line changes colour when the answer has settled. */
.ct-conf {
  display: flex; align-items: center; gap: 9px; margin: 12px 0 0; padding: 9px 12px;
  background: #0a0f1a; border: 1px solid #1f2937; border-radius: 8px;
  font-size: 12.5px; color: #94a3b8; line-height: 1.45;
  transition: border-color 0.4s, background 0.4s;
}
.ct-conf svg { flex-shrink: 0; color: #64748b; }
.ct-conf b { color: #cbd5e1; font-weight: 600; }
.ct-conf-low { border-color: #5c4a1f; background: #151208; }
.ct-conf-low svg, .ct-conf-low b { color: #f7c631; }
.ct-conf-done { border-color: #2f6b57; }
.ct-conf-done svg, .ct-conf-done b { color: #6ee7b7; }
.ct-conf-act {
  margin-left: auto; flex-shrink: 0; background: none; border: 1px solid #334155;
  color: #cbd5e1; border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.ct-conf-act:hover { border-color: #6ee7b7; color: #6ee7b7; }

/* ── stepper + slider (the rating tool's inputs) ─────────────────────── */
.ct-num {
  display: flex; align-items: stretch; background: #0a0f1a; border: 1px solid #1f2937;
  border-radius: 8px; overflow: hidden; transition: border-color 0.15s;
}
.ct-num-btn {
  flex: 0 0 42px; background: #111827; border: none; color: #cbd5e1;
  font: inherit; font-size: 20px; line-height: 1; cursor: pointer; min-height: 46px;
  transition: 0.12s; -webkit-user-select: none; user-select: none;
}
.ct-num-btn:hover { color: #6ee7b7; }
.ct-num-btn:active { background: #1f2937; transform: scale(0.94); }
.ct-num-val {
  flex: 1; width: 100%; min-width: 0; background: none; border: none; color: #e8edf5;
  text-align: center; font: inherit; font-size: 19px; font-weight: 700;
  font-variant-numeric: tabular-nums; padding: 0;
}
.ct-num-val:focus { outline: none; }
.ct-num:focus-within { border-color: #6ee7b7; box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.18); }

.ct-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: none; margin: 2px 0 0; display: block; }
.ct-slider::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: #1f2937; }
.ct-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%;
  background: #6ee7b7; border: 3px solid #0d1424; cursor: grab;
  box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.25); transition: box-shadow 0.2s;
}
.ct-slider:active::-webkit-slider-thumb { box-shadow: 0 0 0 9px rgba(110, 231, 183, 0.14); cursor: grabbing; }
.ct-slider::-moz-range-track { height: 5px; border-radius: 3px; background: #1f2937; }
.ct-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #6ee7b7; border: 3px solid #0d1424; cursor: grab; }
.ct-slider:focus-visible { outline: 2px solid #6ee7b7; outline-offset: 4px; border-radius: 6px; }
.ct-scale { display: flex; justify-content: space-between; font-size: 11px; color: #475569; font-variant-numeric: tabular-nums; margin-top: -2px; }

/* ── three outcomes, always all three ───────────────────────────────── */
.ct-outs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 0; }
.ct-out {
  background: #0a0f1a; border: 1px solid #1f2937; border-radius: 10px;
  padding: 11px 6px 12px; text-align: center; transition: border-color 0.2s;
  /* A tile is a button: the visitor picks the result they actually played,
     and all three keep showing their number either way. */
  font: inherit; color: inherit; width: 100%; display: block; cursor: pointer;
}
.ct-out:hover { border-color: #334155; }
.ct-out-on { border-color: #2f6b57; }
.ct-out-lbl { display: block; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: #64748b; }
.ct-out-val {
  display: block; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  margin: 5px 0 2px; color: #cbd5e1; line-height: 1.1;
}
.ct-out-new { display: block; font-size: 11.5px; color: #64748b; font-variant-numeric: tabular-nums; }
.ct-out-win .ct-out-val { color: #6ee7b7; }
.ct-out-loss .ct-out-val { color: #f0a5a5; }

/* ── expected-score bar ─────────────────────────────────────────────── */
.ct-prob { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #111827; margin: 14px 0 0; }
.ct-prob-w { background: #6ee7b7; transition: width 0.22s ease-out; }
.ct-prob-d { background: #475569; transition: width 0.22s ease-out; }
.ct-prob-l { background: #f0a5a5; transition: width 0.22s ease-out; }
.ct-prob-key { display: flex; justify-content: space-between; font-size: 11.5px; color: #64748b; margin: 6px 0 0; font-variant-numeric: tabular-nums; }

/* ── K-factor tiles, inside the disclosure ──────────────────────────── */
.ct-kset { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.ct-ktile {
  background: #0a0f1a; border: 1px solid #1f2937; border-radius: 9px; padding: 9px 10px;
  font: inherit; color: #cbd5e1; text-align: left; cursor: pointer; line-height: 1.35;
}
.ct-ktile:hover { border-color: #334155; }
.ct-ktile-on { border-color: #6ee7b7; }
.ct-ktile strong { display: block; font-size: 14px; color: #e8edf5; }
.ct-ktile span { display: block; font-size: 11.5px; color: #64748b; margin-top: 2px; }

/* ── empty state, inline error, disclosure ──────────────────────────── */
.ct-blank {
  background: #0a0f1a; border: 1px dashed #334155; border-radius: 10px; padding: 15px;
  font-size: 13px; color: #94a3b8; line-height: 1.55;
}
.ct-blank strong { display: block; color: #e8edf5; font-size: 14.5px; font-weight: 600; margin: 0 0 4px; }
.ct-err { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #f0a5a5; margin: 8px 0 0; line-height: 1.45; }
.ct-err svg { flex-shrink: 0; margin-top: 2px; }
.ct-ok { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #6ee7b7; margin: 8px 0 0; line-height: 1.45; }
.ct-ok svg { flex-shrink: 0; margin-top: 2px; }

.ct-more { border-top: 1px solid #1f2937; margin: 16px 0 0; padding: 12px 0 0; }
.ct-more > summary { list-style: none; cursor: pointer; font-size: 13px; color: #94a3b8; display: flex; align-items: center; gap: 7px; }
.ct-more > summary::-webkit-details-marker { display: none; }
.ct-more[open] > summary { color: #6ee7b7; margin-bottom: 10px; }

/* ── streaming review progress ──────────────────────────────────────── */
.ct-prog-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: #94a3b8; }
.ct-prog-n { font-size: 26px; font-weight: 700; color: #e8edf5; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ct-prog-sub { font-size: 12.5px; color: #64748b; margin: 9px 0 0; line-height: 1.5; }
.ct-live { display: flex; flex-direction: column-reverse; gap: 4px; max-height: 260px; overflow-y: auto; margin: 12px 0 0; }
.ct-live-row {
  display: grid; grid-template-columns: 46px 1fr auto 12px; gap: 9px; align-items: center;
  background: #0a0f1a; border: 1px solid #1f2937; border-radius: 7px; padding: 7px 10px; font-size: 13px;
}
.ct-live-n { color: #64748b; font-variant-numeric: tabular-nums; font-size: 12px; }
.ct-live-san { color: #e8edf5; font-weight: 600; }
.ct-live-q { font-size: 12px; color: #94a3b8; }
.ct-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ct-chip-color, #94a3b8); }

/* ── position editor: the piece tray ────────────────────────────────── */
.ct-tray { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
.ct-tray-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ct-tray-btn {
  background: #111827; border: 1px solid #1f2937; border-radius: 8px; padding: 4px;
  aspect-ratio: 1 / 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ct-tray-btn:hover { border-color: #334155; }
.ct-tray-btn img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ct-tray-on { border-color: #6ee7b7; background: #0d1424; box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.18); }
.ct-tray-btn svg { color: #94a3b8; }
.ct-tray-on svg { color: #6ee7b7; }
.ct-editbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 0; }
.ct-editbar .ct-btn { padding: 9px 6px; font-size: 12.5px; }
.ct-drop { box-shadow: inset 0 0 0 3px #6ee7b7; }

/* ── segmented control (side to move, castling) ─────────────────────── */
.ct-seg { display: flex; gap: 6px; }
.ct-seg > button {
  flex: 1; background: #0a0f1a; border: 1px solid #1f2937; color: #94a3b8; border-radius: 8px;
  padding: 9px 10px; font: inherit; font-size: 13px; cursor: pointer; min-width: 0;
}
.ct-seg > button:hover { border-color: #334155; color: #cbd5e1; }
.ct-seg-on { border-color: #6ee7b7 !important; color: #e8edf5 !important; background: #0d1424 !important; }

/* ── analysis board: move tree, eval bar, navigation ────────────────── */
/* The bar is the whole bar when it sits alone under the board. */
.ct-boardbar > .ct-evalbar { flex: 1; }
.ct-evalbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #0a0f1a; border: 1px solid #1f2937; }
.ct-evalbar-w { background: #e8edf5; transition: width 0.25s ease-out; }
.ct-evalbar-b { background: #334155; flex: 1; }
.ct-evalhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
.ct-evalnum { font-size: 24px; font-weight: 700; color: #e8edf5; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ct-evaldepth { font-size: 12px; color: #64748b; }
.ct-pv {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  color: #94a3b8; line-height: 1.6; margin: 8px 0 0; word-break: break-word;
}
.ct-pv b { color: #6ee7b7; font-weight: 600; }

.ct-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 0; }
.ct-nav .ct-btn { padding: 9px 4px; }

.ct-moves {
  background: #0a0f1a; border: 1px solid #1f2937; border-radius: 8px; padding: 8px 10px;
  max-height: 230px; overflow-y: auto; font-size: 13.5px; line-height: 1.9;
}
.ct-moves:empty::after { content: 'No moves yet. Play one on the board, or paste a game above.'; color: #64748b; font-size: 13px; }
.ct-mvnum { color: #475569; font-variant-numeric: tabular-nums; margin-right: 2px; }
.ct-mv {
  background: none; border: none; font: inherit; color: #cbd5e1; cursor: pointer;
  padding: 1px 5px; border-radius: 5px; margin-right: 2px;
}
.ct-mv:hover { background: #111827; color: #e8edf5; }
.ct-mv-on { background: #6ee7b7; color: #0a0f1a; font-weight: 700; }
.ct-mv-q { font-size: 11px; margin-left: 3px; color: var(--ct-chip-color, #94a3b8); }
.ct-mv-on .ct-mv-q { color: #0a0f1a; }
.ct-var { display: block; margin: 2px 0 2px 14px; padding-left: 9px; border-left: 2px solid #1f2937; color: #94a3b8; font-size: 12.5px; }
.ct-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #64748b; margin: 10px 0 0; }
.ct-legend b { color: #94a3b8; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── the one paste box, and where it routes ─────────────────────────── */
.ct-detect { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 10px 0 0; line-height: 1.45; color: #94a3b8; }
.ct-detect svg { flex-shrink: 0; margin-top: 2px; color: #6ee7b7; }
.ct-detect strong { display: block; color: #e8edf5; font-size: 14px; }
.ct-detect-bad { color: #f0a5a5; }
.ct-detect-bad svg { color: #f0a5a5; }
.ct-detect-bad strong { color: #f0a5a5; }
.ct-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 14px 0 0; }
.ct-route {
  display: block; background: #0a0f1a; border: 1px solid #1f2937; border-radius: 10px;
  padding: 12px 13px; text-decoration: none; transition: border-color 0.2s, opacity 0.2s;
}
.ct-route strong { display: block; color: #e8edf5; font-size: 14px; margin: 0 0 3px; }
.ct-route span { font-size: 12.5px; color: #64748b; line-height: 1.45; }
.ct-route:hover { border-color: #334155; text-decoration: none; }
.ct-route-hit { border-color: #6ee7b7; }
.ct-route-dim { opacity: 0.42; }
.ct-chipbtn {
  background: #111827; border: 1px solid #1f2937; border-radius: 999px; padding: 5px 12px;
  font: inherit; font-size: 12.5px; color: #94a3b8; cursor: pointer;
}
.ct-chipbtn:hover { border-color: #6ee7b7; color: #6ee7b7; }
.ct-chiprow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 0; }
.ct-chiprow > span { font-size: 12px; color: #64748b; }

/* ── narrow screens ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ct-outs { gap: 6px; }
  .ct-out-val { font-size: 22px; }
  .ct-nav { gap: 4px; }
  /* Four icon buttons fit under a 340px board. Four labelled ones do not. */
  .ct-editbar { gap: 4px; }
  .ct-editbar .ct-btn { padding: 9px 4px; }
  .ct-editbar .ct-btn span { display: none; }
  .ct-live-row { grid-template-columns: 40px 1fr auto 10px; gap: 7px; }
}

/* ── pulling the tool above the fold ────────────────────────────────────
   These pages exist to be used, not read, so the tool has to be reachable
   without a scroll. The article shell was spending 213px on chrome before
   the board started: 48px of page padding, a logo row, a breadcrumb and an
   h1. Only the h1 and the breadcrumb earn that space, so the rest tightens
   on tool pages only. :has() is a progressive enhancement here, an older
   browser simply keeps the roomier original spacing. */
.wrap:has([data-chess-tool]) { padding-top: 22px; }
.wrap:has([data-chess-tool]) > header { margin-bottom: 8px; }
.wrap:has([data-chess-tool]) > header img { width: 34px; height: 34px; border-radius: 9px; }
.wrap:has([data-chess-tool]) > .lede { font-size: 17.5px; margin-bottom: 14px; }
