/* Positional Gym — calm, bookish, olive. Light + dark via tokens. */
:root {
  --bg: #eeefe8; --surface: #f9f9f4; --surface-2: #f2f3ec; --ink: #22271d; --ink-soft: #586051; --ink-faint: #686e60;
  --accent: #4e6b3c; --accent-ink: #f6f8f1; --accent-soft: #e2e9d6; --line: #d9dacd; --chip: #e7e8de;
  --good: #3f6b2e; --good-bg: #e3ecd6; --bad: #a3442c; --bad-bg: #f3e1d9; --bad-ink: #ffffff; --warn: #b9832a;
  --sq-l: #e8e6d1; --sq-d: #8d9d6e; --coord-l: #6f7f52; --coord-d: #eef0dd;
  --arrow-a: #3c6fb0; --arrow-b: #c07a1c; --arrow-good: #3f8a2a; --arrow-bad: #c0432a; --arrow-route: #3f8a2a; --arrow-threat: #d4892a;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  color-scheme: light;
  accent-color: var(--accent);   /* checkboxes and other form controls */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161913; --surface: #1f231a; --surface-2: #252a1f; --ink: #e6e8dc; --ink-soft: #a6ad97; --ink-faint: #8d947f;
    --accent: #9cbd7c; --accent-ink: #151a10; --accent-soft: #2c3524; --line: #343a2c; --chip: #2a2f23;
    --good: #9cc77f; --good-bg: #26331d; --bad: #e0937a; --bad-bg: #3b2820; --bad-ink: #1a0f0b;
    --sq-l: #a9ae8e; --sq-d: #5d6e47; --coord-l: #4f5e38; --coord-d: #d6dbc3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161913; --surface: #1f231a; --surface-2: #252a1f; --ink: #e6e8dc; --ink-soft: #a6ad97; --ink-faint: #8d947f;
  --accent: #9cbd7c; --accent-ink: #151a10; --accent-soft: #2c3524; --line: #343a2c; --chip: #2a2f23;
  --good: #9cc77f; --good-bg: #26331d; --bad: #e0937a; --bad-bg: #3b2820; --bad-ink: #1a0f0b;
  --sq-l: #a9ae8e; --sq-d: #5d6e47; --coord-l: #4f5e38; --coord-d: #d6dbc3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 .5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 1.6rem 0 .6rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
button { font: inherit; color: inherit; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 62ch; }

/* ---------- chrome */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px max(16px, calc((100vw - 1120px) / 2)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo-mark { width: 20px; height: 20px; border-radius: 4px; background: conic-gradient(var(--accent) 0 25%, var(--accent-soft) 0 50%, var(--accent) 0 75%, var(--accent-soft) 0); border: 1px solid var(--accent); }
#nav { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
#nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 11px; border-radius: 8px; font-size: .93rem; white-space: nowrap; }
#nav a:hover { background: var(--chip); color: var(--ink); }
#nav a.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.rating { margin-left: auto; font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); background: var(--chip); padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px 60px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px max(16px, calc((100vw - 1120px) / 2)); border-top: 1px solid var(--line); color: var(--ink-faint); font-size: .85rem; }
.foot a { color: var(--ink-soft); }
.page { padding-top: 28px; }
.page.narrow { max-width: 720px; }

/* ---------- buttons, chips, tags */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 7px 12px; font-size: .88rem; }
.link { background: none; border: none; padding: 4px 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .9rem; }
.link:hover { color: var(--ink); }
.link.danger { color: var(--bad); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 20px; background: var(--chip); color: var(--ink); text-decoration: none; font-size: .88rem; border: 1px solid transparent; }
.chip:hover { border-color: var(--line); }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.chip.small { font-size: .78rem; padding: 3px 10px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.tag.soft { background: var(--chip); color: var(--ink-soft); }
.tag.status-not_gated { background: #f3e7c8; color: #6d5115; }
.tag.status-approved { background: var(--good-bg); color: var(--good); }
.tag.status-auto_approved { background: #dfe9f7; color: #24508a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.status-not_gated { background: #3b3220; color: #e2c47d; } .tag.status-auto_approved { background: #1f2f45; color: #9cc0ee; } }

/* ---------- home */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; padding: 48px 0 30px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.hero-board { display: block; text-decoration: none; color: var(--ink-soft); }
.hero-board .mini { box-shadow: 0 12px 34px rgba(30, 40, 20, .18); border-radius: 8px; }
.hero-board .caption { display: block; text-align: center; font-size: .85rem; margin-top: 10px; }
.mini { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 4px; overflow: hidden; }
.mini > div { position: relative; }
.mini .l { background: var(--sq-l); } .mini .d { background: var(--sq-d); }
.mini svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 20px; }
.track { display: flex; flex-direction: column; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; }
.track:hover { transform: translateY(-2px); border-color: var(--accent); }
.track-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.track h2 { margin: 0; }
.track p { color: var(--ink-soft); font-size: .93rem; flex: 1; margin: 8px 0 14px; }
.meter { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.track-foot { font-size: .8rem; color: var(--ink-faint); margin-top: 7px; }
.how ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0; list-style: none; counter-reset: s; }
.how li { counter-increment: s; background: var(--surface-2); border-radius: var(--radius); padding: 16px 16px 16px 52px; position: relative; color: var(--ink-soft); font-size: .93rem; }
.how li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.how li b { color: var(--ink); display: block; margin-bottom: 2px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; }
.strip-head a { font-size: .9rem; }

/* ---------- puzzle */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; padding-top: 22px; align-items: start; }
.board-col { position: sticky; top: 64px; }
.board-wrap { width: 100%; max-width: min(640px, calc(100vh - 150px)); aspect-ratio: 1; margin: 0 auto; touch-action: none; }
.line-nav[hidden] { display: none; }
.line-nav { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px auto 0; max-width: 640px; }
.line-nav button { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.line-nav button:hover { border-color: var(--ink-faint); }
#lineLabel { font-family: var(--mono); font-size: .85rem; color: var(--ink-soft); min-width: 110px; text-align: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.panel-head .set { font-size: .8rem; color: var(--ink-faint); margin-left: auto; }
.panel-head .pid { font: 600 .8rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-faint); user-select: all; }
.panel-head .share { font: 600 .75rem var(--sans); color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; cursor: pointer; }
.panel-head .share:hover { border-color: var(--accent); background: var(--accent-soft); }
.step { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 0 0 4px; }
.prompt { font-size: 1.3rem; margin: 4px 0 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.opts.two { display: grid; grid-template-columns: 1fr 1fr; }
.opt { min-width: 74px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-weight: 600; font-size: 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt.big { padding: 16px; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; gap: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.a { background: var(--arrow-a); } .dot.b { background: var(--arrow-b); }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.fb { padding: 10px 12px; border-radius: 10px; background: var(--chip); margin: 12px 0; font-size: .95rem; }
.fb.ok { background: var(--good-bg); color: var(--ink); border-left: 4px solid var(--good); }
.fb.no { background: var(--bad-bg); color: var(--ink); border-left: 4px solid var(--bad); }
.fb.small { font-size: .85rem; padding: 7px 10px; }
.fb-line { font-family: var(--mono); font-size: .82rem; margin-top: 5px; color: var(--ink-soft); }
.fb-hint { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; }
.num { font-family: var(--mono); font-size: .85rem; color: var(--ink-soft); }
.result-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 6px 0 4px; }
.delta { font-family: var(--mono); font-weight: 700; font-size: .9rem; padding: 3px 8px; border-radius: 6px; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.title { font-size: 1.35rem; margin: 18px 0 6px; }
.concept { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--ink); margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--accent); }
.explain { font-size: .97rem; line-height: 1.68; }
.explain .para { display: block; margin-top: 1.05em; transition: opacity .2s; }
.explain .para:first-child { margin-top: 0; }
.explain .thread { display: block; font-family: var(--sans, inherit); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .15em; }
.explain .thread.answer { color: var(--good); }
.explain .thread.wrong { color: var(--bad); }
.explain.playing .para:not(.now) { opacity: .4; }
.explain.playing .para.now { background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; margin-left: -10px; margin-right: -10px; }
.explain-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.play-cap { display: none; }
@media (max-width: 900px) {
  .play-cap:not([hidden]) { display: block; margin: 8px auto 0; max-width: 640px; max-height: 9.5em; overflow-y: auto; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); font-size: .92rem; line-height: 1.5; }
}
.line { white-space: normal; }
.mv { font-family: var(--mono); font-size: .9em; font-weight: 600; background: var(--accent-soft); border: none; border-radius: 4px; padding: 0 3px; cursor: pointer; color: var(--ink); }
.mv:hover { background: color-mix(in srgb, var(--accent) 35%, var(--accent-soft)); }
.mv.on { background: var(--accent); color: var(--accent-ink); }
.tip { margin: 8px 0 0; }
.route { font-size: .88rem; color: var(--ink-soft); margin: 4px 0 0; }
.source { font-size: .8rem; color: var(--ink-faint); margin: 10px 0 0; }
.rate { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }
.vote { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: .9rem; }
.vote.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rate { flex-wrap: wrap; }
.link-btn { margin-left: auto; border: 0; background: none; padding: 4px 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; }
.fb-box { margin-top: 10px; display: grid; gap: 8px; font-size: .88rem; color: var(--ink-soft); }
.fb-box textarea { width: 100%; min-height: 84px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px; font: inherit; font-size: .9rem; }
.fb-reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.fb-reasons legend { padding: 0; margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.fb-reasons label { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; color: var(--ink); }
.fb-reasons input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.g-report { margin: 4px 0 0; font-size: .82rem; }
.g-report .link-btn { margin-left: 0; font-size: .82rem; color: var(--ink-soft); }
.fb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-thanks { margin-top: 8px; }
.review-box { margin-top: 16px; padding: 12px; border-radius: 10px; background: #f6efd9; border: 1px dashed #c9ad62; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .review-box { background: #2e2919; border-color: #6b5a2c; } }
.rv-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.rv-row span { width: 90px; color: var(--ink-soft); }
.review-box textarea, #rvOut { width: 100%; min-height: 64px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px; font: inherit; font-size: .88rem; }

/* board theme */
.cm-chessboard.pg .board .square.white { fill: var(--sq-l); }
.cm-chessboard.pg .board .square.black { fill: var(--sq-d); }
.cm-chessboard.pg.border-type-none .board .border { stroke-width: 0; fill: var(--sq-d); }
.cm-chessboard.pg .coordinates { pointer-events: none; user-select: none; }
.cm-chessboard.pg .coordinates .coordinate { font-size: 6.5px; font-weight: 600; font-family: var(--sans); }
.cm-chessboard.pg .coordinates .coordinate.white { fill: var(--coord-l); }
.cm-chessboard.pg .coordinates .coordinate.black { fill: var(--coord-d); }
.cm-chessboard .markers .marker.pg-last { fill: #d8c34a; opacity: .38; }
.cm-chessboard .markers .marker.pg-select { fill: #d8c34a; opacity: .5; }
.cm-chessboard .markers .marker.pg-piece { stroke: #3c6fb0; stroke-width: 2.4px; opacity: .85; }
.cm-chessboard .markers .marker.pg-target { stroke: var(--arrow-good); stroke-width: 3.2px; opacity: .85; }
.cm-chessboard .markers .marker.pg-choice { fill: #2d3a22; opacity: .42; }
.cm-chessboard .markers .marker.pg-good { fill: var(--arrow-good); opacity: .3; }
.cm-chessboard .markers .marker.pg-bad { fill: var(--arrow-bad); opacity: .35; }
.cm-chessboard .arrow-head { fill-rule: nonzero; }
.cm-chessboard .pg-arrow-answer .arrow-head { fill: var(--arrow-good); } .cm-chessboard .pg-arrow-answer .arrow-line { stroke: var(--arrow-good); stroke-linecap: round; opacity: .8; }
.cm-chessboard .pg-arrow-route .arrow-head { fill: var(--arrow-route); } .cm-chessboard .pg-arrow-route .arrow-line { stroke: var(--arrow-route); stroke-linecap: round; opacity: .7; }
.cm-chessboard .pg-arrow-wrong .arrow-head { fill: var(--arrow-bad); } .cm-chessboard .pg-arrow-wrong .arrow-line { stroke: var(--arrow-bad); stroke-linecap: round; opacity: .7; }
.cm-chessboard .pg-arrow-a .arrow-head { fill: var(--arrow-a); } .cm-chessboard .pg-arrow-a .arrow-line { stroke: var(--arrow-a); stroke-linecap: round; opacity: .75; }
.cm-chessboard .pg-arrow-b .arrow-head { fill: var(--arrow-b); } .cm-chessboard .pg-arrow-b .arrow-line { stroke: var(--arrow-b); stroke-linecap: round; opacity: .75; }
.cm-chessboard .pg-arrow-threat .arrow-head { fill: var(--arrow-threat); } .cm-chessboard .pg-arrow-threat .arrow-line { stroke: var(--arrow-threat); stroke-linecap: round; opacity: .7; stroke-dasharray: 2 2; }
.cm-chessboard .board.input-enabled .square { cursor: pointer; }

/* ---------- motifs / progress / review / prose */
.fam h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.motif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.motif { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
a.motif:hover { border-color: var(--accent); }
.motif span { font-size: .86rem; color: var(--ink-soft); flex: 1; }
.motif em { font-style: normal; font-size: .78rem; color: var(--accent); font-weight: 600; }
.motif.empty { opacity: .55; background: transparent; }
.motif.empty em { color: var(--ink-faint); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat span { display: block; font-size: .8rem; color: var(--ink-soft); }
.stat b { font-family: var(--serif); font-size: 1.7rem; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 48px 48px; gap: 10px; align-items: center; font-size: .9rem; }
.bar { height: 10px; background: var(--chip); border-radius: 5px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.bar-num { font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); text-align: right; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.hist li a { flex: 1; color: var(--ink); text-decoration: none; }
.hist .res { font-size: .78rem; color: var(--ink-soft); }
.prose p, .prose li { color: var(--ink-soft); }
.prose li b, .prose p b { color: var(--ink); }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.rv-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rv-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); border-bottom: 1px solid var(--line); padding: 8px 6px; }
.rv-table td { border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: middle; }
.rv-table td:first-child { width: 64px; }
.rv-table .mini { width: 56px; }
.rv-table a { color: var(--ink); font-weight: 600; }
.done-set { text-align: center; padding-top: 60px; }
.done-set .cta-row { justify-content: center; }

/* ---------- responsive */
@media (max-width: 900px) {
  .play { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 12px; }   /* minmax: long content must not widen the page */
  .board-col { position: static; }
  .board-wrap { max-width: 100%; }
  /* solved: keep a smaller board pinned while reading, so tapped lines stay visible */
  .play.done .board-col { position: sticky; top: 49px; z-index: 5; background: var(--bg); padding: 6px 0 4px; border-bottom: 1px solid var(--line); }
  .play.done .board-wrap { max-width: min(100%, 36vh); }
  .play.done .line-nav { margin-top: 4px; }
  .play.done .line-nav button { padding: 3px 10px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .hero-board { max-width: 360px; width: 100%; margin: 0 auto; }
  .tracks, .how ol { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .top { gap: 8px; }
  .logo { font-size: 0; gap: 0; }
  .logo-mark { width: 24px; height: 24px; }
  #nav { margin-left: 0; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }   /* hint that the row scrolls */
  #nav a { padding: 6px 8px; font-size: .88rem; }
  .rating { display: none; }
  .panel { padding: 14px; }
  .bar-row { grid-template-columns: 1fr 70px 40px; }
  .bar-row .link { display: none; }
  .rv-table th:nth-child(3), .rv-table td:nth-child(3) { display: none; }
}
.lesson { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); }
.lesson b { font-family: var(--serif); }
.rating a { color: inherit; text-decoration: none; }

/* ---------- in-browser analysis */
.ana-cta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
.ana-stop { border-color: var(--bad); color: var(--bad); font-weight: 600; }
.ana-box { margin: 8px 0 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.ana-head { display: flex; align-items: baseline; gap: 10px; }
.ana-eval { margin-left: auto; font-family: var(--mono); font-weight: 700; font-size: 1.15rem; }
.ana-bar { height: 8px; border-radius: 4px; background: #2b2f27; overflow: hidden; margin: 8px 0 10px; border: 1px solid var(--line); }
.ana-bar span { display: block; height: 100%; width: 100%; background: #f4f4ee; transform-origin: left; transition: transform .3s; }
.ana-lines { display: flex; flex-direction: column; gap: 4px; }
.ana-line { display: flex; gap: 10px; align-items: baseline; text-align: left; width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; background: var(--surface); cursor: pointer; }
.ana-line:hover { border-color: var(--accent); }
.ana-score { font-family: var(--mono); font-weight: 700; font-size: .85rem; min-width: 52px; }
.ana-pv { flex: 1; min-width: 0; font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* min-width 0: the ellipsis works instead of widening the panel */
.ana-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.ana-actions .btn[disabled] { opacity: .45; cursor: default; }
.cm-chessboard .pg-arrow-engine .arrow-head { fill: #3c6fb0; } .cm-chessboard .pg-arrow-engine .arrow-line { stroke: #3c6fb0; stroke-linecap: round; opacity: .7; }

/* ---------- hints, blitz */
.cue { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .95rem; }
.cue b { font-family: var(--serif); }
.mode-switch { display: inline-flex; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel-head .set + .mode-switch { margin-left: 8px; }
.mode-switch button { border: none; background: var(--surface-2); padding: 4px 10px; font-size: .78rem; cursor: pointer; color: var(--ink-soft); }
.mode-switch button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.clock { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.clock-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.clock-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transition: transform .2s linear; }
.clock.low .clock-bar span, .clock-bar.low span { background: var(--bad); }
#clockNum { font-family: var(--mono); font-weight: 700; min-width: 34px; text-align: right; }

/* ---------- installed app (PWA / TWA): notches, gesture bar, touch targets */
.top { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left), calc((100vw - 1120px) / 2)); padding-right: max(16px, env(safe-area-inset-right), calc((100vw - 1120px) / 2)); }
.foot { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.board-wrap { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) {
  .mode-switch button { padding: 8px 12px; font-size: .82rem; }
  .vote, .line-nav button, .btn.small, .chip.small, .link-btn { min-height: 40px; }
  .chip.small, .link-btn { display: inline-flex; align-items: center; }
  .mv { padding: 4px 5px; line-height: 1.9; }
}
@media (display-mode: standalone) { .foot { display: none; } }
.sol-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }
.sol-row .muted { font-family: var(--mono); font-size: .8rem; }
.stat em { display: block; font-style: normal; font-size: .78rem; color: var(--ink-faint); }
.rating-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rstat { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin: 2px 0 4px; background: var(--chip); color: var(--ink-soft); }
.rstat.active { background: var(--good-bg); color: var(--good); }
.rstat.returning { background: #f3e7c8; color: #6d5115; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rstat.returning { background: #3b3220; color: #e2c47d; } }
.rating-card .spark { width: 100%; height: 44px; color: var(--accent); margin-top: 6px; display: block; }
.spark.empty { font-size: .75rem; color: var(--ink-faint); margin-top: 8px; }
@media (max-width: 900px) { .rating-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- books */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.book { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.book-spine { flex: 0 0 54px; min-height: 120px; border-radius: 4px 8px 8px 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 80%, black) 0 6px, var(--accent) 6px); color: var(--accent-ink); font-family: var(--serif); font-size: .72rem; font-weight: 700; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; padding: 8px 4px; text-align: center; line-height: 1.15; }
.book-cover { flex: 0 0 90px; width: 90px; height: 135px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgb(0 0 0 / .25); background: var(--line); }
.book-body h3 { margin: 0 0 2px; font-size: 1.05rem; }
.book-body p { margin: 4px 0 8px; font-size: .9rem; }
.read-more { font-size: .88rem; color: var(--ink-soft); margin: 8px 0 0; }
.disclosure { margin-top: 26px; }

/* ---------- revisit, skill profile */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: var(--bad-ink); font-size: .72rem; font-weight: 700; text-align: center; line-height: 18px; }
.due-banner { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 12px 16px; margin: 0 0 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); text-decoration: none; border: 1px solid var(--line); }
.due-banner span { color: var(--ink-soft); font-size: .9rem; }
.endgame-section .due-banner { margin: 0; align-self: start; }   /* sits beside the Endgame card */
.prof-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat b.small-b { font-size: 1.1rem; display: block; margin: 2px 0; }

/* ---------- collections, structures */
.collections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 0 0 20px; }
.track.coll { background: var(--surface-2); }
.struct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.struct { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.struct h2 { margin: 0 0 2px; }
.struct p { font-size: .9rem; margin: 6px 0; color: var(--ink-soft); }
.struct p b { color: var(--ink); }
.struct.empty { opacity: .6; }
.struct-note { margin: 14px 0 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: .9rem; }
.struct-note p { margin: 4px 0; color: var(--ink-soft); }
@media (max-width: 900px) { .collections { grid-template-columns: 1fr; } }
.motif .subs { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .84rem; }
.motif .subs a { color: var(--ink); }
.motif .subs span { color: var(--ink-faint); }
.motif > a { color: var(--ink); text-decoration: none; }
.chip.feat { background: transparent; border-color: var(--line); }

/* keyboard focus and selection in the palette, not the browser's blue */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- game analysis with commentary (analysis.js) */
.g-form { display: grid; gap: 10px; margin-top: 18px; }
.g-form label { font-weight: 600; font-size: .93rem; }
.g-form textarea { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px; font-family: var(--mono); font-size: .88rem; }
.g-form .cta-row { margin: 4px 0; }
.live-banner b::before { content: "●"; color: var(--bad); margin-right: 7px; font-size: .8em; }
.g-schedule { padding-left: 18px; color: var(--ink-soft); }
.g-head { max-width: 640px; margin: 0 auto 8px; }
.g-title { font-size: 1.25rem; margin: 0; }
.g-players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: baseline; }
.g-players > span:last-child { text-align: right; }
.g-result { font-family: var(--mono); font-weight: 700; color: var(--ink-soft); }
.g-event { text-align: center; margin-top: 2px; }
.g-nav button { min-width: 40px; }
.g-nav #gNavLabel { min-width: 92px; text-align: center; font-family: var(--mono); font-size: .88rem; color: var(--ink-soft); }
.g-panel { display: flex; flex-direction: column; gap: 12px; }
#gStatus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
#gStatus:empty, #gGraph:empty, #gMoves:empty { display: none; }
#gStatus select { max-width: 100%; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; }
.g-live { font-weight: 700; font-size: .85rem; padding: 3px 10px; border-radius: 20px; background: var(--chip); color: var(--ink-soft); }
.g-live.live { background: var(--bad-bg); color: var(--bad); }
.g-live.interrupted, .g-live.error { background: var(--bad-bg); color: var(--ink); }
.g-edit { display: flex; gap: 8px; flex-wrap: wrap; }
.g-edit .btn[disabled] { opacity: .45; cursor: default; }
.g-story { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
.g-story summary { cursor: pointer; list-style-position: outside; }
.g-story ul { margin: 6px 0 2px; padding-left: 18px; }
.g-story li { margin: 3px 0; font-size: .92rem; line-height: 1.45; }
.g-comment { min-height: 150px; }
.g-comment p { margin: 6px 0; }
.g-move-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.12rem; }
.g-move-title b { font-family: var(--mono); }
.g-tier { margin-left: auto; font-size: .72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.g-verdict { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--ink-soft); }
.g-verdict.best, .g-verdict.good { background: var(--good-bg); color: var(--good); }
.g-verdict.inaccuracy { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); color: var(--ink); }
.g-verdict.mistake, .g-verdict.blunder { background: var(--bad-bg); color: var(--bad); }
.g-verdict.blunder { outline: 1px solid var(--bad); }
.g-verdict.prov { opacity: .75; font-style: italic; }
.g-line { font-size: .9rem; margin: 6px 0; line-height: 1.9; }
.g-line-label { color: var(--ink-soft); }
.g-now { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.g-now h3 { font-size: .98rem; margin: 0 0 2px; }
.g-terms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.g-terms .chip { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: .8rem; }
.g-term-def { flex-basis: 100%; font-size: .88rem; color: var(--ink-soft); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 2px 0 0; }
.g-explore { font-size: .88rem; }
.g-moves { display: grid; grid-template-columns: 2.4em 1fr 1fr; gap: 2px 6px; max-height: 190px; overflow-y: auto; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); align-items: center; position: relative; }
.g-moves > p { grid-column: 1 / -1; margin: 0; }
.g-n { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); text-align: right; }
.g-mv { font-family: var(--mono); font-size: .88rem; font-weight: 600; text-align: left; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 7px; cursor: pointer; color: var(--ink); min-height: 28px; }
.g-mv.gap { cursor: default; color: var(--ink-faint); }
.g-mv:hover:not(.gap) { border-color: var(--line); background: var(--surface); }
.g-mv.on { background: var(--accent); color: var(--accent-ink); }
.g-mv.inaccuracy::after, .g-mv.mistake::after, .g-mv.blunder::after { margin-left: 3px; font-weight: 700; }
.g-mv.inaccuracy::after { content: "?!"; color: var(--warn); }
.g-mv.mistake::after { content: "?"; color: var(--bad); }
.g-mv.blunder::after { content: "??"; color: var(--bad); }
.g-mv.on::after { color: inherit; }
.g-mv.prov::after { opacity: .5; }
.g-graph-wrap { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.g-graph { display: block; width: 100%; height: 64px; }
.g-graph-bg { fill: #2b2f27; }
.g-graph-area { fill: #f4f4ee; }
.g-graph-line { fill: none; stroke: #f4f4ee; stroke-width: 1; vector-effect: non-scaling-stroke; }
.g-graph-mid { stroke: #8d947f; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.g-graph-cur { stroke: var(--arrow-b); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g-turn { fill: var(--arrow-bad); stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; }
.g-turns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.g-turns .chip { border: 1px solid var(--line); cursor: pointer; font-family: var(--mono); font-size: .8rem; }
.g-engine summary { cursor: pointer; font-size: .88rem; color: var(--ink-soft); }
.g-engine .ana-line.static { cursor: default; }
.g-engine .ana-line.static:hover { border-color: transparent; }
.g-foot { margin: 0; }

/* ---------- celebrations (celebrate.js): chess-themed, tap to dismiss ---------- */
.cel-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(20, 24, 16, .45); animation: cel-fade .25s ease-out; }
.cel-overlay.cel-out, .cel-toast.cel-out { opacity: 0; transition: opacity .25s; }
.cel-card { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 22px 24px 18px; width: min(360px, 100%); text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.25);
  background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%), linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%);
  background-size: 28px 28px; background-position: 0 0, 14px 14px; }
.cel-card h2 { font-family: var(--serif); margin: 10px 0 4px; font-size: 1.45rem; }
.cel-card p { margin: 0 0 14px; color: var(--ink-soft); }
.cp { width: 100%; height: 100%; display: block; }

/* promotion: a file of 5 squares, the pawn walks up and becomes a queen */
.cel-file { position: relative; width: 52px; height: 260px; margin: 0 auto; border-radius: 6px; overflow: visible; display: flex; flex-direction: column; }
.cel-file i { flex: 1; background: var(--sq-l); }
.cel-file i:nth-child(odd) { background: var(--sq-d); }
.cel-file .cp { position: absolute; left: 2px; width: 48px; height: 48px; }
.cel-pawn { bottom: 2px; animation: cel-march 1.4s steps(4, end) .2s forwards, cel-vanish .2s 1.6s forwards; }
.cel-queen { top: 2px; opacity: 0; transform: scale(.3); animation: cel-promote .45s cubic-bezier(.2,1.6,.4,1) 1.65s forwards; }
.cel-crown { top: -34px; opacity: 0; animation: cel-crown .6s ease-out 2.05s forwards; }
@keyframes cel-march { to { transform: translateY(-208px); } }
@keyframes cel-vanish { to { opacity: 0; transform: translateY(-208px) scale(.4); } }
@keyframes cel-promote { to { opacity: 1; transform: scale(1); } }
@keyframes cel-crown { 0% { opacity: 0; transform: translateY(10px) scale(.5); } 60% { opacity: 1; transform: translateY(-4px) scale(1.15); } 100% { opacity: 1; transform: none; } }

/* seal: wax stamp drops, a knight leaps an L across it */
.cel-seal-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.cel-seal { position: absolute; inset: 15px; border-radius: 50%; display: grid; place-items: center; padding: 26px;
  background: radial-gradient(circle at 35% 30%, #c2463b, #8e2219 60%, #6b1611); box-shadow: 0 0 0 6px #a92f25 inset, 0 6px 14px rgba(0,0,0,.35);
  animation: cel-stamp .5s cubic-bezier(.3,1.5,.5,1) both; }
.cel-seal .cp { filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }
.cel-knight { position: absolute; width: 40px; height: 40px; left: -10px; bottom: -6px; opacity: 0; animation: cel-leap 1.1s ease-in-out .55s forwards; }
@keyframes cel-stamp { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 70% { transform: scale(.94) rotate(3deg); opacity: 1; } 100% { transform: none; } }
@keyframes cel-leap { 0% { opacity: 1; transform: none; } 45% { transform: translate(0, -110px); } 75% { transform: translate(60px, -120px); } 100% { opacity: 0; transform: translate(150px, -60px); } }

/* castling: king e1 to g1, rook h1 jumps to f1 */
.cel-rank { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); width: min(300px, 100%); aspect-ratio: 8 / 1; margin: 18px auto 4px; border-radius: 5px; overflow: hidden; }
.cel-rank i { background: var(--sq-l); }
.cel-rank i:nth-child(odd) { background: var(--sq-d); }
.cel-rank .cp { position: absolute; top: 0; width: 12.5%; height: 100%; }
.cel-king { left: 50%; animation: cel-king .7s ease-in-out .3s forwards; }
.cel-rook { left: 87.5%; animation: cel-rook .55s ease-in-out .95s forwards; }
@keyframes cel-king { 50% { transform: translateY(-30%); } to { left: 75%; } }
@keyframes cel-rook { 50% { transform: translateY(-45%); } to { left: 62.5%; } }

/* checkmate toast: the black king tips over */
.cel-toast { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 16px 10px 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: cel-up .3s ease-out; cursor: pointer; max-width: calc(100% - 32px); }
.cel-toast .cel-sq { width: 42px; height: 42px; flex: none; border-radius: 6px; background: var(--sq-l); display: grid; place-items: center; overflow: hidden; }
.cel-toast .cp { width: 34px; height: 34px; transform-origin: 50% 50%; animation: cel-topple .6s cubic-bezier(.5,0,.8,.6) .35s forwards; }
@keyframes cel-topple { 40% { transform: rotate(-12deg); } to { transform: translateY(5px) rotate(90deg); } }
@keyframes cel-up { from { transform: translate(-50%, 20px); opacity: 0; } }
@keyframes cel-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cel-overlay *, .cel-toast, .cel-toast * , .cel-overlay { animation: none !important; transition: none !important; }
  .cel-pawn { display: none; } .cel-queen, .cel-crown, .cel-seal { opacity: 1; transform: none; }
  .cel-king { left: 75%; } .cel-rook { left: 62.5%; } .cel-knight { display: none; }
}

/* today's goal (home) and the trophy cabinet (progress) */
.today { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; }
.today .goal-file { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.today .goal-file i { width: 18px; height: 18px; border-radius: 3px; background: var(--chip); display: inline-grid; place-items: center; }
.today .goal-file i.on { background: var(--sq-d); }
.today .goal-file i.q { background: var(--good-bg); }
.today .goal-file .cp { width: 16px; height: 16px; }
.today .count { font-family: var(--serif); font-size: 1.25rem; }
.today .streak { font-weight: 600; }
.today .muted { font-size: .85rem; }
.goal-pick, .theme-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.goal-pick button, .theme-pick button { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.goal-pick button.on, .theme-pick button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.theme-pick button { display: inline-flex; gap: 8px; align-items: center; }
.theme-pick button:disabled { opacity: .5; cursor: not-allowed; }
.theme-pick .sw { width: 22px; height: 11px; border-radius: 3px; display: inline-block; }
.cabinet { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 6px 0 18px; }
.seal-card { text-align: center; padding: 10px 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.seal-card .mini-seal { width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; padding: 11px;
  background: radial-gradient(circle at 35% 30%, #c2463b, #8e2219 60%, #6b1611); box-shadow: 0 0 0 3px #a92f25 inset; }
.seal-card.locked .mini-seal { background: var(--chip); box-shadow: 0 0 0 3px var(--line) inset; filter: grayscale(1); opacity: .55; }
.seal-card b { display: block; font-size: .88rem; }
.seal-card em { display: block; font-style: normal; font-size: .72rem; color: var(--ink-faint); }
.small-h { font-size: 1rem; margin: 14px 0 4px; }
