/* Setter's Workbench. Tokens first; components only use tokens. */
:root {
  color-scheme: light;
  --ground: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --ink: #1b2430;
  --muted: #5c6b7a;
  --faint: #c9d2db;
  --rule: #dfe5eb;
  --pen: #2750c9;            /* player digits: pen blue */
  --select: #f4c542;         /* highlighter */
  --select-soft: rgba(244, 197, 66, 0.38);
  --same: rgba(39, 80, 201, 0.12);
  --focus: #2750c9;
  --bad: #c8322b;
  --bad-soft: rgba(200, 50, 43, 0.14);
  --good: #2e8b57;
  --step: rgba(46, 139, 87, 0.22);
  --sees: rgba(124, 92, 196, 0.16);
  --cell: #ffffff;
  --given: #1b2430;
  --grid-thin: #9aa6b2;
  --grid-thick: #1b2430;
  /* clue notation (SudokuPad conventions) */
  --thermo: #b9c0c7;
  --whisper: #5fbf6a;
  --renban: #c38be0;
  --palindrome: #aab2ba;
  --entropic: #e79a4a;
  --parity: #e26a6a;
  --regionsum: #5fa3e0;
  --between: #8c96a0;
  --arrow: #9aa3ab;
  --cage: #3b4652;
  --window: rgba(95, 163, 224, 0.13);
  --diagonal: rgba(27, 36, 48, 0.28);
  --tier1: #5aa06a; --tier2: #3f86c6; --tier3: #d59a2c; --tier4: #c8513b; --tier5: #7a4fb0;
  --shadow: 0 1px 2px rgba(27, 36, 48, 0.06), 0 4px 16px rgba(27, 36, 48, 0.05);
  --radius: 10px;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #12161c; --panel: #1a2029; --panel-2: #212833; --ink: #e6ebf1; --muted: #93a1b0;
    --faint: #3a4553; --rule: #2a323e; --pen: #86a8ff; --select: #d8ae36; --select-soft: rgba(216, 174, 54, 0.30);
    --same: rgba(134, 168, 255, 0.14); --focus: #86a8ff; --bad: #ff6b62; --bad-soft: rgba(255, 107, 98, 0.16);
    --good: #5cc98b; --step: rgba(92, 201, 139, 0.22); --sees: rgba(170, 140, 240, 0.18); --cell: #1f2630; --given: #eef2f6; --grid-thin: #4a5563;
    --grid-thick: #cfd8e2; --thermo: #5b6570; --whisper: #4aa956; --renban: #9f6cc0; --palindrome: #69737e;
    --entropic: #c97f34; --parity: #c65454; --regionsum: #4a88c2; --between: #7d8894; --arrow: #7d8894; --cage: #c3ccd6;
    --window: rgba(74, 136, 194, 0.18); --diagonal: rgba(230, 235, 241, 0.25);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #12161c; --panel: #1a2029; --panel-2: #212833; --ink: #e6ebf1; --muted: #93a1b0;
  --faint: #3a4553; --rule: #2a323e; --pen: #86a8ff; --select: #d8ae36; --select-soft: rgba(216, 174, 54, 0.30);
  --same: rgba(134, 168, 255, 0.14); --focus: #86a8ff; --bad: #ff6b62; --bad-soft: rgba(255, 107, 98, 0.16);
  --good: #5cc98b; --step: rgba(92, 201, 139, 0.22); --sees: rgba(170, 140, 240, 0.18); --cell: #1f2630; --given: #eef2f6; --grid-thin: #4a5563;
  --grid-thick: #cfd8e2; --thermo: #5b6570; --whisper: #4aa956; --renban: #9f6cc0; --palindrome: #69737e;
  --entropic: #c97f34; --parity: #c65454; --regionsum: #4a88c2; --between: #7d8894; --arrow: #7d8894; --cage: #c3ccd6;
  --window: rgba(74, 136, 194, 0.18); --diagonal: rgba(230, 235, 241, 0.25);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.45 var(--font-ui);
  padding-inline: 16px;
  padding-block: 0 24px;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Top bar */
.topbar {
  display: flex; align-items: baseline; gap: 16px 24px; flex-wrap: wrap;
  max-width: 1440px; margin: 0 auto; padding-block: 14px 12px;
}
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand-sub { color: var(--muted); font-size: 13px; }
.puzzle-title { flex: 1; font-weight: 500; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.timer { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); }

/* Layout: generate | board | inspect */
.bench {
  max-width: 1440px; margin: 0 auto;
  display: grid; gap: 16px;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  align-items: start;
}
@media (max-width: 1100px) {
  .bench { grid-template-columns: minmax(0, 1fr) 300px; }
  .gen { grid-column: 2; grid-row: 1; }
  .play { grid-column: 1; grid-row: 1 / span 2; }
  .inspect { grid-column: 2; grid-row: 2; }
}
@media (max-width: 760px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  .gen, .play, .inspect { grid-column: 1; grid-row: auto; }
  .play { order: -1; }
}

.panel {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.panel h2 {
  margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.hint-text { margin: 0; color: var(--muted); font-size: 12.5px; }
.link { background: none; border: 0; padding: 0; color: var(--pen); font-size: 12.5px; }
.link:hover { text-decoration: underline; }

/* Segmented controls */
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 6px 4px; font-size: 13px; color: var(--muted);
  white-space: nowrap;
}
.seg button[aria-checked="true"] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tiers button[aria-checked="true"][data-v="1"] { color: var(--tier1); }
.tiers button[aria-checked="true"][data-v="2"] { color: var(--tier2); }
.tiers button[aria-checked="true"][data-v="3"] { color: var(--tier3); }
.tiers button[aria-checked="true"][data-v="4"] { color: var(--tier4); }

/* Variant chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--rule); background: var(--panel); border-radius: 999px; padding: 3px 10px 3px 8px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink);
}
.chip .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--faint); flex: none; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--panel-2); font-weight: 600; }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

select, input[type="number"] {
  width: 100%; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel);
}
.seed-row { flex-direction: row; align-items: center; gap: 10px; }
.seed-row .label { flex: none; }

.primary {
  background: var(--ink); color: var(--panel); border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 600;
}
.primary:disabled { opacity: 0.55; cursor: progress; }
.status { margin: -6px 0 0; min-height: 1.2em; font-size: 12.5px; color: var(--muted); }
.status.error { color: var(--bad); }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.history button {
  width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12.5px;
}
.history button:hover { background: var(--panel-2); }
.history .h-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .h-meta { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; grid-column: 1 / -1; }
.history .done { color: var(--good); }

/* Board */
.play { display: flex; flex-direction: column; gap: 14px; align-items: center; min-width: 0; }
.board-wrap { position: relative; width: 100%; max-width: 640px; }
#board { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.empty-state {
  position: absolute; inset: 9%; display: grid; place-items: center; text-align: center; color: var(--muted); pointer-events: none;
}
.empty-state p { max-width: 26ch; background: var(--ground); padding: 8px 12px; border-radius: 8px; }

.controls { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 10px; }
.keypad { display: grid; grid-template-columns: repeat(9, 1fr); grid-auto-rows: 46px; gap: 6px; }
.keypad button {
  border: 1px solid var(--rule); background: var(--panel); border-radius: 8px;
  font-size: 20px; font-weight: 500; color: var(--pen); display: grid; place-items: center; padding: 0;
}
.keypad button:hover { border-color: var(--faint); background: var(--panel-2); }
.keypad.corner button { font-size: 13px; align-items: start; justify-items: start; padding: 5px 7px; }
.keypad.centre button { font-size: 13px; }
.keypad .sw { width: 26px; height: 26px; border-radius: 6px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button {
  flex: 1 1 auto; border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.actions button:hover { background: var(--panel-2); }
.actions .accent { border-color: var(--pen); color: var(--pen); font-weight: 600; }
.hint-box {
  border: 1px solid var(--rule); border-left: 3px solid var(--pen); background: var(--panel); border-radius: 8px;
  padding: 10px 12px; display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
}
.hint-box p { margin: 0; }
.hint-box.bad { border-left-color: var(--bad); }
.keys { margin: 0; color: var(--muted); font-size: 12px; }

/* Inspect */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); }
.tabs button {
  border: 0; background: none; padding: 6px 10px 8px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rules-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules-list li { display: grid; grid-template-columns: 12px 1fr; gap: 2px 10px; }
.rules-list .swatch { width: 12px; height: 12px; border-radius: 3px; margin-top: 4px; background: var(--faint); }
.rules-list b { font-weight: 600; text-transform: capitalize; }
.rules-list .rule-text { grid-column: 2; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }

.verdict { display: flex; align-items: center; gap: 12px; }
.tier-badge {
  font-family: var(--font-display); font-weight: 700; font-size: 20px; padding: 4px 12px; border-radius: 8px; color: #fff;
}
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.metrics div { display: flex; flex-direction: column; }
.metrics dt { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.metrics dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 14px; }
.profile { width: 100%; height: 64px; display: block; }
.profile-cap { margin: -6px 0 0; font-size: 12px; color: var(--muted); }

.path { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; border-top: 1px solid var(--rule); }
.path li button {
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 7px 4px;
  display: grid; grid-template-columns: 30px 38px 1fr; gap: 0 8px; align-items: baseline; font-size: 12.5px;
}
.path li button:hover { background: var(--panel-2); }
.path li button[aria-current="true"] { background: var(--step); }
.path .n { color: var(--muted); font-family: var(--font-mono); font-size: 11px; text-align: right; }
.path .w { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; border-radius: 4px; padding: 0 4px; text-align: center; color: #fff; }
.path .t { font-weight: 600; }
.path .d { grid-column: 3; color: var(--muted); overflow-wrap: anywhere; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

/* Board SVG text */
#board text { font-family: var(--font-ui); }
.dg { font-size: 36px; font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.dg.given { fill: var(--given); font-weight: 600; }
.dg.player { fill: var(--pen); }
.dg.bad { fill: var(--bad); }
.dg.sol { fill: var(--muted); opacity: 0.55; font-weight: 400; }
.pm { font-size: 13px; fill: var(--pen); }
.pm-c { font-size: 13px; fill: var(--pen); text-anchor: middle; dominant-baseline: central; }
.cage-sum { font-size: 12.5px; font-weight: 600; fill: var(--cage); }
.outside { font-size: 18px; font-weight: 600; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.xv { font-size: 15px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--cell); stroke-width: 4px; }
.quad-t { font-size: 10.5px; font-weight: 600; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Recipe builder */
.bench.wide-gen { grid-template-columns: 360px minmax(0, 1fr) 320px; }
@media (max-width: 1100px) { .bench.wide-gen { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 760px) { .bench.wide-gen { grid-template-columns: minmax(0, 1fr); } }
.summary { margin: 0; font-size: 13px; line-height: 1.5; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.builder { display: flex; flex-direction: column; gap: 14px; }
.b-sec { display: flex; flex-direction: column; gap: 6px; }
.b-rows { display: flex; flex-direction: column; gap: 6px; }
.b-row {
  border: 1px solid var(--rule); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--panel);
}
.b-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.b-line select, .b-line input { width: auto; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); font-size: 12.5px; color: var(--ink); }
.b-line input[type="number"] { width: 3.6em; }
.b-line .grow { flex: 1; min-width: 6em; }
.b-line .x { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.b-line .x:hover { color: var(--bad); background: var(--bad-soft); }
.mini-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-chips button { border: 1px solid var(--rule); background: var(--panel); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.mini-chips button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; background: var(--panel-2); }
.save-row { display: flex; gap: 6px; }
.save-row input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.save-row button { border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 7px 10px; font-size: 13px; }

/* Left panel views */
.gen-view, .ideas-view, .set-view { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ideas {
  list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 8px;
  max-height: min(560px, 62vh); overflow-y: auto; overscroll-behavior: contain;
}
.idea { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.idea-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.idea-name { font-weight: 600; font-size: 13.5px; }
.idea-score { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.idea-why { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.levels button {
  border: 1px solid var(--rule); background: var(--panel-2); border-radius: 6px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 0; font-size: 12px; line-height: 1.25;
}
.levels button:hover:not(:disabled) { border-color: var(--ink); background: var(--panel); }
.levels button b { font-size: 12px; font-weight: 600; }
.levels button span { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.levels button.weak { opacity: 0.55; }
.levels button:disabled { cursor: not-allowed; }

/* Rules text */
.rules-text-head { display: flex; justify-content: space-between; align-items: baseline; }
.rules-text {
  width: 100%; min-height: 140px; resize: vertical; padding: 10px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--panel-2); color: var(--ink); font: 13px/1.5 var(--font-ui);
}

/* Assists */
.assists { border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px 8px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.assists legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.assists label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dg.good { fill: var(--good); }
.tip {
  position: fixed; z-index: 10; pointer-events: none; max-width: 260px;
  background: var(--ink); color: var(--panel); border-radius: 6px; padding: 6px 8px;
  font: 12px/1.4 var(--font-mono); box-shadow: var(--shadow);
}
.tip b { font-family: var(--font-ui); font-weight: 600; }

/* Export */
.export-row { display: flex; flex-direction: column; gap: 4px; }
.export-row .label-row a { font-size: 12.5px; color: var(--pen); }
.export-link { width: 100%; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel-2); font: 11.5px var(--font-mono); color: var(--ink); }

/* Novelty Set */
.set-card { border: 1px solid var(--ink); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.set-card h3 { margin: 0; font-family: var(--font-display); font-size: 17px; }
.set-puzzles { display: flex; flex-direction: column; gap: 6px; }
.set-puzzle {
  text-align: left; border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px; font-size: 12.5px;
}
.set-puzzle:hover { border-color: var(--ink); }
.set-puzzle .sp-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.set-puzzle .sp-level { font-weight: 700; }
.set-puzzle .sp-pair { font-weight: 600; }
.set-puzzle .sp-meta { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.set-puzzle ul { margin: 2px 0 0; padding-left: 16px; color: var(--muted); }

.set-type { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.set-type:last-child { border-bottom: 0; }

/* Pen mode and the keyboard shortcuts panel (workbench and player) */
.pen-snap { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pen-snap select { width: auto; padding: 5px 8px; }
.keypad.pen .sw { border-radius: 50%; }
.keypad button.picked { outline: 3px solid var(--ink); outline-offset: -3px; }
.keys .link { font-size: 12px; }
.kbd-panel { position: fixed; inset: 0; background: rgba(15, 20, 28, 0.45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.kbd-card { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.kbd-card h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.kbd-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.kbd-card dt { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.kbd-card dd { margin: 0; color: var(--muted); }
.kbd-card .kbd-close { align-self: flex-end; }
.kbd-card .kbd-close { align-self: flex-end; background: var(--ink); color: var(--panel); border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600; }
.set-type .sp-why { color: var(--muted); font-size: 12px; line-height: 1.35; }

/* Pause (workbench and player) */
.timer-row { display: flex; align-items: center; gap: 10px; }
.pause-btn { border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 5px 11px; font-size: 13px; color: var(--ink); }
.pause-btn:hover { border-color: var(--faint); }
.pause-btn[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.pause-cover {
  position: absolute; inset: 0; z-index: 5; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
}
.pause-cover[hidden] { display: none; }
.pause-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; }
.pause-resume { background: var(--ink); color: var(--panel); border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 15px; }
.p-side[inert], .controls[inert] { opacity: 0.45; }
.set-type .sp-rules { font-size: 12px; color: var(--ink); opacity: 0.75; }

/* App tab: the app's bundled puzzles */
.app-group { margin: 10px 0 0; font-family: var(--font-display); font-size: 15px; }
.levels button[aria-expanded="true"] { border-color: var(--ink); background: var(--panel); }
.app-rows { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.app-rows li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 3px 0; border-top: 1px solid var(--rule); font-size: 12.5px; }
.app-rows .al-n { font-family: var(--font-mono); font-weight: 600; min-width: 2ch; text-align: right; }
.app-rows .al-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.app-rows .al-acts { margin-left: auto; }
.app-rows .link, .app-foot .link { font-size: 12.5px; }
.app-foot { padding-top: 4px; font-size: 12px; }
.app-rows .error { color: var(--bad); font-size: 11px; }
