/* Tutor player — presentation only. No lesson content lives in this file. */

:root {
  --bg:        #fbfcfe;
  --surface:   #ffffff;
  --fg:        #14161c;
  --muted:     #5c6472;
  --line:      #dde2ea;
  --line-soft: #eef1f6;
  --accent:    #1f5fd0;
  --accent-sf: #e8f0fd;
  --ok:        #16794a;
  --ok-sf:     #e6f5ec;
  --bad:       #b02a30;
  --bad-sf:    #fdecec;
  --warn:      #8a5a05;
  --warn-sf:   #fdf4e1;
  --tile:      #f2f5fa;
  --radius:    12px;
  --tap:       44px;         /* minimum touch target, everywhere */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ── shell ───────────────────────────────────────────────────────────── */

.shell { max-width: 760px; margin: 0 auto; padding: 0 18px 140px; }

header.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251,252,254,0.94);
  backdrop-filter: saturate(1.6) blur(8px);
  border-bottom: 1px solid var(--line-soft);
  margin: 0 0 22px; padding: 12px 0 10px;
}
header.top .shell { padding: 0 18px; }
.top-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.top h1 { font-size: 16px; margin: 0; letter-spacing: -0.01em; font-weight: 650; }
.top .std {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent); background: var(--accent-sf);
  padding: 4px 7px; border-radius: 5px; letter-spacing: 0.02em;
}
.top .count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.bar { height: 4px; background: var(--line-soft); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .35s cubic-bezier(.4,0,.2,1); }

/* ── step card ───────────────────────────────────────────────────────── */

.step { animation: rise .28s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.step > h2 { font-size: 25px; line-height: 1.25; margin: 4px 0 16px; letter-spacing: -0.02em; }
.prose p { margin: 0 0 13px; }
.prose strong { font-weight: 650; }
.prose .katex-display { margin: 18px 0; }

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 13px 16px; margin: 20px 0 4px;
}
.callout .k {
  display: block; font: 700 10.5px/1 -apple-system, sans-serif;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); margin-bottom: 6px;
}
.callout.warning { border-left-color: var(--warn); }
.callout.warning .k { color: var(--warn); }
.callout.next { border-left-color: var(--muted); }
.callout.next .k { color: var(--muted); }
.callout p { margin: 0; }

/* ── area model ──────────────────────────────────────────────────────── */

.model { margin: 26px 0 6px; display: flex; justify-content: center; }

.area {
  display: grid; gap: 6px;
  grid-template-columns: 34px repeat(var(--cols), minmax(84px, 116px));
  grid-template-rows:    34px repeat(var(--rows), minmax(84px, 104px));
  touch-action: manipulation;
}
.area .corner { }
.area .lbl {
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--accent); font-weight: 600;
}
.area .lbl.col { border-bottom: 2px solid var(--accent); border-radius: 2px; }
.area .lbl.row { border-right:  2px solid var(--accent); border-radius: 2px; }

.slot {
  position: relative;
  min-height: var(--tap);
  border: 2px dashed var(--line); border-radius: 10px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: var(--fg);
  cursor: pointer; padding: 0;
  transition: border-color .15s, background .15s, transform .12s;
  font-family: inherit;
}
.slot .tag {
  position: absolute; top: 5px; left: 7px;
  font: 700 10px/1 ui-monospace, Menlo, monospace; color: var(--muted); letter-spacing: 0.05em;
}
.slot.filled { border-style: solid; border-color: var(--accent); background: var(--accent-sf); }
.slot.armed  { border-color: var(--accent); background: var(--accent-sf); transform: scale(1.03); }
.slot.over   { border-color: var(--accent); background: var(--accent-sf); border-style: solid; }
.slot.right  { border-style: solid; border-color: var(--ok);  background: var(--ok-sf); }
.slot.wrong  { border-style: solid; border-color: var(--bad); background: var(--bad-sf); }
.slot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── tile tray ───────────────────────────────────────────────────────── */

.tray { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0 4px; justify-content: center; }
.tile {
  min-width: 62px; min-height: var(--tap);
  padding: 8px 15px; font-size: 18px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: var(--tile); color: var(--fg);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.tile.armed { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(31,95,208,.3); }
.tile.armed .katex { color: #fff; }
.tile.used {
  pointer-events: none; color: transparent; background: transparent;
  border-style: dashed; border-color: var(--line-soft);
}
.tile.used .katex { visibility: hidden; }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile.ghost {
  position: fixed; z-index: 999; pointer-events: none; margin: 0;
  box-shadow: 0 8px 24px rgba(20,22,28,.22); opacity: .95; cursor: grabbing;
}

/* ── steppers (factor search) ────────────────────────────────────────── */

.search { margin: 24px 0 6px; }
.target {
  text-align: center; font-size: 21px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.target .k { display: block; font: 700 10.5px/1 -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 8px; }

.dials { display: flex; gap: 14px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.dial { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: center; }
.dial .name { font: 600 12px/1 -apple-system, sans-serif; color: var(--muted); margin-bottom: 9px; }
.dial .row { display: flex; align-items: center; gap: 4px; }
.dial button {
  width: var(--tap); height: var(--tap); flex: none;
  font: 300 26px/1 -apple-system, sans-serif; color: var(--accent);
  background: var(--accent-sf); border: none; border-radius: 10px; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.dial button:active { background: var(--accent); color: #fff; }
.dial button:disabled { opacity: .3; cursor: default; }
.dial button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dial .val {
  min-width: 66px; font: 600 24px/var(--tap) ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.live {
  text-align: center; font-size: 19px; padding: 16px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); transition: background .2s, border-color .2s;
}
.live.match { border-color: var(--ok); background: var(--ok-sf); }
.live .k { display: block; font: 700 10.5px/1 -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 8px; }
.live .chk { margin-top: 11px; font-size: 14px; color: var(--muted); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.live .chk span.yes { color: var(--ok); font-weight: 600; }
.live .chk span.no  { color: var(--muted); }

/* ── choice / numeric ────────────────────────────────────────────────── */

.opts { display: grid; gap: 10px; margin: 22px 0 4px; }
.opt {
  display: flex; align-items: center; gap: 13px; width: 100%;
  min-height: 56px; padding: 12px 16px; text-align: left; font: inherit; font-size: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--fg); cursor: pointer; touch-action: manipulation;
  transition: border-color .15s, background .15s;
}
.opt .dot { width: 22px; height: 22px; flex: none; border: 2px solid var(--line); border-radius: 50%; transition: all .15s; }
.opt.sel { border-color: var(--accent); background: var(--accent-sf); }
.opt.sel .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--accent-sf); }
.opt.right { border-color: var(--ok);  background: var(--ok-sf); }
.opt.right .dot { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 4px var(--ok-sf); }
.opt.wrong { border-color: var(--bad); background: var(--bad-sf); }
.opt.wrong .dot { border-color: var(--bad); background: var(--bad); box-shadow: inset 0 0 0 4px var(--bad-sf); }
.opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.fields { display: flex; gap: 22px; flex-wrap: wrap; margin: 24px 0 4px; }
.field { display: flex; align-items: center; gap: 10px; }
.field label { font-size: 20px; }
.field input {
  width: 96px; height: var(--tap); padding: 0 12px; font: 600 20px ui-monospace, Menlo, monospace;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg);
  text-align: center;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-sf); }
.field.right input { border-color: var(--ok); background: var(--ok-sf); }
.field.wrong input { border-color: var(--bad); background: var(--bad-sf); }

/* ── feedback ────────────────────────────────────────────────────────── */

.fb { margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; animation: rise .22s both; }
.fb .k { display: block; font: 700 10.5px/1 -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 7px; }
.fb p { margin: 0 0 9px; } .fb p:last-child { margin: 0; }
.fb.ok  { border-color: #bce3cd; background: var(--ok-sf); }
.fb.ok  .k { color: var(--ok); }
.fb.no  { border-color: #f3c9c9; background: var(--bad-sf); }
.fb.no  .k { color: var(--bad); }
.fb.hint { border-color: #ecd9a8; background: var(--warn-sf); }
.fb.hint .k { color: var(--warn); }

/* ── action bar ──────────────────────────────────────────────────────── */

.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(251,252,254,0.94); backdrop-filter: saturate(1.6) blur(8px);
  border-top: 1px solid var(--line-soft);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
}
.actions .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.btn {
  min-height: var(--tap); padding: 0 22px; font: 600 16px/1 -apple-system, sans-serif;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; touch-action: manipulation;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; margin-left: auto; }
.btn.ghost   { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.go      { background: var(--ok); color: #fff; margin-left: auto; }
.btn[disabled] { opacity: .38; cursor: default; }

/* ── done ────────────────────────────────────────────────────────────── */

.done { text-align: center; padding: 46px 0; }
.done .mark { font-size: 46px; }
.done h2 { font-size: 27px; margin: 12px 0 8px; }
.done .stats { display: flex; gap: 26px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.done .stat { }
.done .stat b { display: block; font: 700 27px/1.2 ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.done .stat span { font-size: 12.5px; color: var(--muted); }

.boot { padding: 70px 0; text-align: center; color: var(--muted); }
.boot.err { color: var(--bad); }
.boot code { background: var(--tile); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ── narrow screens ──────────────────────────────────────────────────── */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell { padding: 0 14px 130px; }
  .step > h2 { font-size: 22px; }
  .area { grid-template-columns: 28px repeat(var(--cols), minmax(0, 1fr)); gap: 5px; }
  .area .lbl { font-size: 15px; }
  .slot { font-size: 17px; }
  .tile { font-size: 17px; padding: 8px 13px; }
  .opt { font-size: 16.5px; }
}

/* ── objective, branch bar, inspector ────────────────────────────────── */

.objective { margin: 0 0 26px; color: var(--muted); font-size: 15px; }

.simrow { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; align-items: center; }
.chip {
  font: 500 11.5px/1 -apple-system, sans-serif; color: var(--warn);
  background: var(--warn-sf); border: 1px solid #ecd9a8; border-radius: 99px;
  padding: 6px 11px; cursor: pointer;
}
.chip b { font-weight: 700; }
.chip.quiet { color: var(--muted); background: var(--tile); border-color: var(--line); cursor: default;
  font-family: ui-monospace, Menlo, monospace; }

.branchbar {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-left: 3px solid var(--warn); background: var(--warn-sf);
  padding: 9px 13px; border-radius: 0 8px 8px 0; margin: 0 0 16px;
}
.branchbar .k { font: 700 10px/1 -apple-system, sans-serif; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--warn); }
.branchbar span:last-child { font-size: 13.5px; color: var(--fg); }

#inspect { margin: 0 0 26px; padding: 14px 16px; background: #12151b; border-radius: var(--radius); color: #c9d1e0; }
.insnote { margin: 0 0 12px; font-size: 12.5px; line-height: 1.55; color: #8b94a7; }
#inspect-body { max-height: 340px; overflow-y: auto; }
.ins { border-top: 1px solid #242a35; padding: 9px 0; }
.ins:first-child { border-top: none; }
.inshead { font: 700 11.5px/1.4 ui-monospace, Menlo, monospace; color: #7fb3ff; margin-bottom: 5px; }
.insrow { display: flex; gap: 9px; font: 11.5px/1.6 ui-monospace, Menlo, monospace; }
.insrow b { color: #e0b755; flex: none; min-width: 92px; font-weight: 600; }
.insrow code { color: #c9d1e0; word-break: break-word; }
#inspect details { margin-top: 5px; font: 11px/1.5 ui-monospace, Menlo, monospace; }
#inspect summary { color: #8b94a7; cursor: pointer; padding: 3px 0; }
#inspect pre { margin: 6px 0 0; padding: 9px; background: #0b0e13; border-radius: 6px; overflow-x: auto; color: #9fb4d0; }

.fb .ref { margin-top: 9px; font: 10.5px/1 ui-monospace, Menlo, monospace; color: var(--muted); opacity: .75; }

/* Visually hidden, still in the accessibility tree. Correctness reaches a
   screen reader through these, never through colour alone (WCAG 1.4.1). */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── factor-pair-picker ──────────────────────────────────────────────── */

.pairs {
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 20px 0;
}
.pair {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 84px; min-height: var(--tap); padding: 9px 14px;
  font: inherit; font-size: 18px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; touch-action: manipulation;
  transition: border-color .15s, background .15s, transform .12s;
}
.pair .sum { font-size: 13px; color: var(--muted); }
.pair.sel   { border-color: var(--accent); background: var(--accent-sf); transform: translateY(-1px); }
.pair.right { border-color: var(--ok);  background: var(--ok-sf); }
.pair.wrong { border-color: var(--bad); background: var(--bad-sf); }
.pair:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── expand-a-rectangle ──────────────────────────────────────────────── */

.goalbox {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px; margin: 20px 0 6px;
}
.goalbox .k {
  display: block; font: 700 10.5px/1 -apple-system, sans-serif;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); margin-bottom: 6px;
}
.goalbox p { margin: 0; }

.rect {
  display: grid; gap: 5px; margin: 22px auto 6px; justify-content: center;
  grid-template-columns: 30px 118px var(--qw, 45px);
  grid-template-rows:    30px 104px var(--ph, 45px);
  transition: grid-template-columns .18s cubic-bezier(.4,0,.2,1),
              grid-template-rows    .18s cubic-bezier(.4,0,.2,1);
}
.rect .lbl {
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--accent); font-weight: 600;
}
.rect .lbl.col { border-bottom: 2px solid var(--accent); border-radius: 2px; }
.rect .lbl.row { border-right:  2px solid var(--accent); border-radius: 2px; }
.rect .lbl.neg { color: var(--bad); border-color: var(--bad); }
.rect .cell {
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-sf);
  font-size: 18px; min-width: 0; min-height: 0;
}

.splits { display: grid; gap: 12px; margin: 20px 0; }
.split {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px;
}
.split .name { display: block; font: 600 12px/1 -apple-system, sans-serif; color: var(--muted); margin-bottom: 9px; }
.split .name b { color: var(--accent); font-size: 14px; }
.split .row { display: flex; align-items: center; gap: 8px; }
.split button {
  width: var(--tap); height: var(--tap); flex: none;
  font: 300 26px/1 -apple-system, sans-serif; color: var(--accent);
  background: var(--accent-sf); border: none; border-radius: 10px; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.split button:active   { background: var(--accent); color: #fff; }
.split button:disabled { opacity: .3; cursor: default; }
.split button:focus-visible,
.split input[type=range]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.split input[type=range] {
  flex: 1 1 auto; min-width: 90px; height: var(--tap); accent-color: var(--accent);
  touch-action: none; cursor: grab;
}
.split .val {
  min-width: 46px; text-align: center;
  font: 600 22px/var(--tap) ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums;
}

/* ── tap-to-classify ─────────────────────────────────────────────────── */

.prompt { margin: 0 0 14px; }

.bins { display: grid; gap: 10px; margin: 20px 0 6px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.bucket {
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 6px; min-height: 118px;
}
.bucket.over { border-style: solid; border-color: var(--accent); background: var(--accent-sf); }
.bucketlab {
  display: block; width: 100%; min-height: var(--tap); padding: 10px 12px;
  font: 600 14px/1.3 -apple-system, sans-serif; color: var(--muted); text-align: center;
  background: var(--tile); border: 1px solid var(--line-soft); border-radius: 8px;
  cursor: pointer; touch-action: manipulation;
}
.bucketlab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.binitems { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 2px 2px; justify-content: center; }

.cards { min-height: 60px; }
.card {
  min-height: var(--tap); padding: 9px 14px; font: inherit; font-size: 17px; color: var(--fg);
  background: var(--tile); border: 1px solid var(--line); border-radius: 10px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.card.armed { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(31,95,208,.3); }
.card.armed .katex { color: #fff; }
.card.right { border-color: var(--ok);  background: var(--ok-sf); }
.card.wrong { border-color: var(--bad); background: var(--bad-sf); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card.ghost {
  position: fixed; z-index: 999; pointer-events: none; margin: 0;
  box-shadow: 0 8px 24px rgba(20,22,28,.22); opacity: .95; cursor: grabbing;
}

/* ── build-the-middle-term ───────────────────────────────────────────── */

/* build-the-middle-term. Namespaced as .term* because .chip is already
   the header's status pill, and a bare .chip here silently restyled it. */
.terms {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  margin: 26px 0 6px; padding: 16px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.terms.right { border-color: var(--ok);  background: var(--ok-sf); }
.terms.wrong { border-color: var(--bad); background: var(--bad-sf); }
.terms .plus { font-size: 20px; color: var(--muted); }
.termwrap { display: inline-flex; align-items: center; gap: 4px; }
.term {
  min-width: 62px; min-height: var(--tap); padding: 8px 15px; font: inherit; font-size: 19px;
  color: var(--fg); background: var(--tile); border: 1px solid var(--line); border-radius: 10px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.term.armed  { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(31,95,208,.3); }
.term.armed .katex { color: #fff; }
.term.merged { border-color: var(--accent); background: var(--accent-sf); }
.term.over   { border-color: var(--accent); border-style: dashed; }
.term.refused { animation: refuse .42s cubic-bezier(.36,.07,.19,.97) both; border-color: var(--bad); background: var(--bad-sf); }
.term:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.term.ghost {
  position: fixed; z-index: 999; pointer-events: none; margin: 0;
  box-shadow: 0 8px 24px rgba(20,22,28,.22); opacity: .95; cursor: grabbing;
}
@keyframes refuse {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50%      { transform: translateX(-4px); }
}
.unmerge {
  width: var(--tap); height: var(--tap); flex: none; padding: 0;
  font: 16px/1 -apple-system, sans-serif; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; touch-action: manipulation;
}
.unmerge:active { background: var(--tile); }
.unmerge:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 560px) {
  .rect { grid-template-columns: 26px 96px var(--qw, 40px); }
  .bins { grid-template-columns: 1fr; }
  .bucket { min-height: 92px; }
}
