/* Rift Rider. The chamber fills the screen; the readouts sit at the top edge and the
   thumbs' controls on the side edges, so the middle — where the rifts are aimed — stays clear. */
:root {
  /* R-C40: colours that were written out in rules, as tokens (theme-derive.py) */
  --kBg1: #171d26;
  --kBg10: rgba(255, 138, 31, .45);
  --kBg11: rgba(242, 33, 56, .45);
  --kBg12: rgba(168, 77, 255, .45);
  --kBg13: rgba(255, 255, 255, .9);
  --kBg14: #ffffff;
  --kBg15: #4a0d0d;
  --kBg16: rgba(10, 14, 20, .72);
  --kBg17: #ff5b4b;
  --kBg18: #ffb070;
  --kBg19: rgba(10, 14, 20, .85);
  --kBg2: #232c38;
  --kBg20: rgba(255, 255, 255, .08);
  --kBg21: rgba(255, 255, 255, .35);
  --kBg22: rgba(24, 30, 40, .6);
  --kBg23: rgba(30, 70, 140, .6);
  --kBg24: rgba(140, 70, 20, .6);
  --kBg25: rgba(140, 20, 35, .6);
  --kBg26: rgba(85, 35, 140, .6);
  --kBg27: rgba(255, 255, 255, .3);
  --kBg28: rgba(6, 8, 12, .55);
  --kBg29: rgba(20, 26, 34, .9);
  --kBg3: #2f3a49;
  --kBg30: rgba(0, 0, 0, .6);
  --kBg31: #10151c;
  --kBg32: #3a3020;
  --kBg4: #181f29;
  --kBg5: #141a22;
  --kBg6: #1f2732;
  --kBg7: #27313f;
  --kBg8: #000000;
  --kBg9: rgba(61, 139, 255, .45);
  --kInk1: #7fb2ff;
  --kInk2: #ffb070;
  --kInk3: #c8f7d0;
  --kInk4: #2b0703;
  --kLine1: #2a3340;
  --kLine2: #ffd27a;
  --kLine3: #4a7a5a;
  --kLine4: #7fb2ff;
  --kLine5: #ffb070;
  --kLine6: #ff7080;
  --kLine7: #c99bff;

  --hotInk: #3a2204;
  --bg: #12161d;
  --ink: #eef2f6;
  --dim: #a3afbd;
  --card: #1b222c;
  --line: #34404f;
  --hot: #ffb338;
  --good: #57d68d;
  --bad: #ff6b5b;
  --blue: #3d8bff;
  --orange: #ff8a1f;
  --glass: rgba(10, 14, 20, .72);
}

/* R-C40: the light look. This product's own is dark; the other is chosen with the switch beside Home. */
:root[data-theme="light"] {
  --kBg1: #bbc0c8;
  --kBg10: rgba(171, 87, 0, .45);
  --kBg11: rgba(199, 56, 60, .45);
  --kBg12: rgba(137, 80, 199, .45);
  --kBg13: rgba(31, 31, 31, .9);
  --kBg14: #1f1f1f;
  --kBg15: #d7a9a4;
  --kBg16: rgba(204, 208, 213, .72);
  --kBg17: #c73a2e;
  --kBg18: #5d3613;
  --kBg19: rgba(204, 208, 213, .85);
  --kBg2: #abb2bb;
  --kBg20: rgba(31, 31, 31, .08);
  --kBg21: rgba(31, 31, 31, .35);
  --kBg22: rgba(186, 191, 199, .6);
  --kBg23: rgba(125, 152, 198, .6);
  --kBg24: rgba(170, 125, 99, .6);
  --kBg25: rgba(140, 20, 35, .6);
  --kBg26: rgba(85, 35, 140, .6);
  --kBg27: rgba(31, 31, 31, .3);
  --kBg28: rgba(212, 214, 218, .55);
  --kBg29: rgba(190, 195, 202, .9);
  --kBg3: #9ea6b1;
  --kBg30: rgba(247, 247, 247, .6);
  --kBg31: #c4c8ce;
  --kBg32: #b2ab9f;
  --kBg4: #b9bec7;
  --kBg5: #bec3ca;
  --kBg6: #b1b7bf;
  --kBg7: #a6aeb8;
  --kBg8: #f7f7f7;
  --kBg9: rgba(30, 105, 212, .45);
  --kInk1: #001758;
  --kInk2: #330000;
  --kInk3: #000300;
  --kInk4: #431d16;
  --kLine1: #a5acb5;
  --kLine2: #453000;
  --kLine3: #67836f;
  --kLine4: #324d75;
  --kLine5: #5d3613;
  --kLine6: #c3384f;
  --kLine7: #8558b5;

  --hotInk: #ffffff;
  --bg: #f3f7fd;
  --ink: #1e1f21;
  --dim: #4e545b;
  --card: #e1e7ef;
  --line: #bac3ce;
  --hot: #a26a00;
  --good: #02a25d;
  --bad: #ef6051;
  --blue: #428cfa;
  --orange: #dc7000;
  --glass: rgba(242, 245, 251, .72);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; overflow: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none;
}
#app { display: flex; flex-direction: column; height: 100%; }

#hdr {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 8px 6px;
  background: var(--kBg1); border-bottom: 1px solid var(--kLine1);
}
#hdrTitle { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
            font-weight: 700; font-size: 15px; }
@media (max-width: 380px) { #hdrTitle { visibility: hidden; } }
/* R-C26: [hidden] loses to any display of our own */
[hidden] { display: none !important; }
.pill {
  min-width: 44px; min-height: 44px; border: 0; border-radius: 12px;
  background: var(--kBg2); color: var(--ink); font-size: 18px; cursor: pointer;
}
.pill:active { background: var(--kBg3); }

.scr { display: none; flex: 1; overflow-y: auto; padding: 12px; }
.scr.on { display: block; }
#scr-play.on { display: flex; padding: 0; overflow: hidden; }
#scr-menu, #scr-how { max-width: 720px; margin: 0 auto; width: 100%; }

h1 { font-size: 30px; margin: 8px 0 4px; }
.sub { color: var(--dim); font-size: 14px; line-height: 1.45; margin-bottom: 12px; }
.blueTxt { color: var(--kInk1); }
.orangeTxt { color: var(--kInk2); }
.stat { color: var(--dim); font-size: 13px; }
.goal { color: var(--ink); font-size: 14px; line-height: 1.45; margin: 4px 2px 8px; min-height: 20px; }

.big {
  display: block; width: 100%; min-height: 52px; margin: 8px 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--kBg2);
  color: var(--ink); font-size: 17px; font-weight: 600; cursor: pointer;
}
.big.primary { background: var(--hot); border-color: var(--kLine2); color: var(--hotInk); }

#custom { margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--kBg4); }
#custom > summary { list-style: none; }
#custom > summary::-webkit-details-marker { display: none; }
#custom > summary::after { content: "▾"; margin-left: auto; color: var(--dim); }
#custom[open] > summary::after { content: "▴"; }
summary { min-height: 48px; display: flex; align-items: center; padding: 0 12px; cursor: pointer; font-weight: 600; }
.setBody { padding: 10px 12px 14px; }
.setRow { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.setLbl { flex: 1 1 120px; font-size: 14px; }
.setNote { color: var(--dim); font-size: 12px; line-height: 1.4; }
.knob { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.knobBtn {
  min-height: 44px; min-width: 56px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--kBg5); color: var(--dim);
  font-size: 13px; cursor: pointer;
}
.knobBtn.on { background: var(--hot); color: var(--hotInk); border-color: var(--kLine2); font-weight: 700; }

/* R-C12b: the rungs */
.pickRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 6px 0 4px; }
.pick {
  min-width: 0; min-height: 72px;
  background: var(--kBg2); color: var(--ink); border: 2px solid transparent;
  border-radius: 14px; padding: 8px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.pick .te { font-size: 24px; }
.pick b { font-size: 14px; }
.pick small { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.pick.sel { border-color: var(--hot); background: var(--card); }

/* the chambers: a page of the track, then a page a set of ten; a grid that wraps */
#setNav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 0; }
#setName { font-size: 14px; font-weight: 700; color: var(--dim); text-align: center; flex: 1; }
.setBtn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 0; background: var(--kBg6); color: var(--ink); font-size: 18px; cursor: pointer; }
.setBtn:disabled { opacity: .3; cursor: default; }
#chamberRow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 6px 0 4px; }
.ch {
  min-height: 72px; min-width: 0; border-radius: 12px; border: 2px solid transparent;
  background: var(--kBg6); color: var(--ink); cursor: pointer; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; line-height: 1.2; text-align: center;
}
.ch .n { font-size: 18px; font-weight: 800; }
.ch .nm { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.ch .st { font-size: 12px; min-height: 14px; }
.ch.newest { border-color: var(--kLine3); }
.ch.sel { border-color: var(--hot); background: var(--kBg7); }
.ch.locked { opacity: .45; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 8px 0; font-size: 14px; line-height: 1.5; }
.card h2 { font-size: 17px; margin: 0 0 4px; }

/* ---- the chamber ------------------------------------------------------------ */
#stage { position: relative; flex: 1; width: 100%; overflow: hidden; touch-action: none; background: var(--kBg8); }
#cvs { display: block; width: 100%; height: 100%; touch-action: none; }
#glFail {
  position: absolute; inset: 20% 12% auto; padding: 14px; border-radius: 12px; z-index: 30;
  background: var(--kBg4); color: var(--ink); font-size: 14px; line-height: 1.5;
}
/* R3: the sight in the middle; its left half lights blue and its right half orange while that rift is open */
#sight {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  pointer-events: none; z-index: 3;
}
#sight i { position: absolute; top: 0; width: 15px; height: 30px; border: 3px solid rgba(255, 255, 255, .55); box-sizing: border-box; }
#sightB { left: 0; border-right: 0 !important; border-radius: 15px 0 0 15px; border-color: rgba(61, 139, 255, .6) !important; }
#sightO { right: 0; border-left: 0 !important; border-radius: 0 15px 15px 0; border-color: rgba(255, 138, 31, .6) !important; }
#sightB.on { background: var(--kBg9); border-color: var(--kLine4) !important; box-shadow: 0 0 8px var(--blue); }
#sightO.on { background: var(--kBg10); border-color: var(--kLine5) !important; box-shadow: 0 0 8px var(--orange); }
#sightR, #sightP { display: none; }
/* §19: three or four colours: a quarter each, clockwise from the top left in the chain's order */
body.c3 #sight i { width: 15px; height: 15px; }
body.c3 #sightB { top: 0; left: 0; border-radius: 15px 0 0 0; border-right: 0 !important; border-bottom: 0 !important; }
body.c3 #sightO { top: 0; right: 0; border-radius: 0 15px 0 0; border-left: 0 !important; border-bottom: 0 !important; }
body.c3 #sightR { display: block; top: 15px; right: 0; border-radius: 0 0 15px 0; border-left: 0 !important; border-top: 0 !important; border-color: rgba(242, 33, 56, .6) !important; }
body.c4 #sightP { display: block; top: 15px; left: 0; border-radius: 0 0 0 15px; border-right: 0 !important; border-top: 0 !important; border-color: rgba(168, 77, 255, .6) !important; }
#sightR.on { background: var(--kBg11); border-color: var(--kLine6) !important; box-shadow: 0 0 8px #f22138; }
#sightP.on { background: var(--kBg12); border-color: var(--kLine7) !important; box-shadow: 0 0 8px #a84dff; }
#sight::after { content: ""; position: absolute; left: 13px; top: 13px; width: 4px; height: 4px; border-radius: 50%; background: var(--kBg13); }
body.noGun #sight i { display: none; }
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s; background: var(--kBg14); }
#flash.on { opacity: .7; transition: none; }
#flash.dead { background: var(--kBg15); }
#flash.dead.on { opacity: .85; }

#hud {
  position: absolute; top: 6px; left: 6px; right: 6px; pointer-events: none; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
}
#hudL, #hudR { display: flex; flex-direction: column; gap: 4px; }
#hudL { align-items: flex-start; min-width: 0; }
#hudR { align-items: flex-end; }
#chChip { background: var(--glass); border-radius: 12px; padding: 5px 10px; font-size: 14px; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chainChip { background: var(--glass); border-radius: 12px; padding: 3px 10px; font-size: 14px; width: max-content; letter-spacing: 1px; }
#viewBtns { display: flex; gap: 4px; pointer-events: auto; margin-top: 2px; }
/* §12: health, shown only when a turret has hurt you */
#hpBar { width: 120px; height: 10px; border-radius: 5px; background: var(--kBg16); overflow: hidden; }
#hpFill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--kBg17), var(--kBg18)); }
#flash.hurt { background: none; box-shadow: inset 0 0 90px 30px rgba(255, 40, 30, .7); }
#flash.hurt.on { opacity: 1; }
.vb {
  min-width: 44px; min-height: 44px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--glass); color: var(--ink); font-size: 20px;
}

#toast {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 6;
  background: var(--kBg19); border-radius: 14px; padding: 10px 16px; font-size: 17px; font-weight: 700;
  text-align: center; max-width: 86%; pointer-events: none; opacity: 0; transition: opacity .3s;
}
#toast.on { opacity: 1; }

/* ---- the thumbs (R8.1) ---- */
#touch { position: absolute; inset: 0; z-index: 4; touch-action: none; }
.stickBase {
  position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  background: var(--kBg20); border: 2px solid rgba(255, 255, 255, .25); pointer-events: none;
}
.stickBase.look { border-color: rgba(255, 176, 112, .4); }
.stickKnob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: var(--kBg21); border: 2px solid rgba(255, 255, 255, .6);
}
/* The buttons sit on the side edges above mid height, ABOVE where a thumb rests on its
   stick, so a thumb working a stick does not land on one. */
#leftBtns { position: absolute; left: 8px; top: 30%; display: flex; flex-direction: column; gap: 10px; }
#rightBtns { position: absolute; right: 8px; top: 18%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tb {
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3);
  background: var(--kBg22); color: var(--ink); font-size: 24px; cursor: pointer; touch-action: none;
}
.tb.fireB { width: 64px; height: 64px; font-size: 26px; background: var(--kBg23); border-color: rgba(120, 175, 255, .7); }
.tb.fireO { width: 64px; height: 64px; font-size: 26px; background: var(--kBg24); border-color: rgba(255, 175, 110, .7); }
.tb.fireR { width: 64px; height: 64px; font-size: 26px; background: var(--kBg25); border-color: rgba(255, 120, 135, .7); }
.tb.fireP { width: 64px; height: 64px; font-size: 26px; background: var(--kBg26); border-color: rgba(200, 160, 255, .7); }
.tb.down { background: var(--kBg27); }
#fireBtns { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tb.fireR, .tb.fireP { display: none; }
/* §19: with three or four colours the fire buttons go two by two, in the chain's order */
body.c3 #fireBtns { display: grid; grid-template-columns: 64px 64px; gap: 10px; }
/* (jump beside the four, not above them, so the lowest row stays above where the right thumb rests) */
body.c3 #rightBtns { flex-direction: row; align-items: flex-start; }
body.c3 .tb.fireR, body.c4 .tb.fireP { display: block; }
body.noGun .tb.fireB, body.noGun .tb.fireO, body.noGun .tb.fireR, body.noGun .tb.fireP { display: none; }
body.blueOnly .tb.fireO { display: none; }
#touchHint {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); transform: translateX(-50%);
  background: var(--glass); border-radius: 12px; padding: 6px 12px; font-size: 13px; color: var(--dim); text-align: center;
  max-width: calc(100% - 200px); pointer-events: none; transition: opacity .6s;
}
#touchHint.gone { opacity: 0; }
#keysHint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4;
  background: var(--glass); border-radius: 12px; padding: 6px 12px; font-size: 12px; color: var(--dim);
  max-width: 92%; text-align: center; pointer-events: none; transition: opacity .6s;
}
#keysHint.gone { opacity: 0; }
/* a mouse needs none of the thumb controls */
body.mouse #leftBtns, body.mouse #rightBtns, body.mouse #touchHint { display: none; }

/* ---- overlays ---- */
.ovl {
  position: absolute; inset: 0; z-index: 20; display: none;
  align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto;
  background: var(--kBg28);
}
.ovl.on { display: flex; }
.ovlCard {
  margin: auto; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.ovlCard h2 { margin: 0 0 6px; font-size: 22px; }
.ovlCard p { color: var(--dim); font-size: 14px; line-height: 1.5; margin: 6px 0 10px; }
#brief { background: none; padding: 0; }
#briefBar {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); transform: translateX(-50%);
  width: calc(100% - 16px); max-width: 720px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  background: var(--kBg29); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px;
}
#briefWords { flex: 1 1 260px; min-width: 0; }
#briefWords h2 { margin: 0; font-size: 19px; }
#briefWords p { margin: 2px 0 0; color: var(--dim); font-size: 13px; line-height: 1.35; }
#briefBtns { flex: 0 0 auto; display: flex; gap: 8px; margin-left: auto; }
#briefBtns .big { width: auto; margin: 0; padding: 0 16px; min-height: 48px; }
#mapOv { background: none; padding: 0; pointer-events: none; }
#mapBar {
  position: absolute; top: 8px; left: 8px; right: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--glass); border-radius: 12px; padding: 4px 4px 4px 12px; pointer-events: auto;
}
#mapTitle { font-weight: 700; }
#mapKey { flex: 1 1 200px; color: var(--dim); font-size: 12px; }
.pb { min-width: 44px; min-height: 44px; border-radius: 12px; border: 0; background: var(--kBg2); color: var(--ink); font-size: 18px; cursor: pointer; }
/* the shared runtime's notices (a newer version is ready) */
.toast-host { position: fixed; left: 0; right: 0; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 40; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } #flash { transition: none; } }
/* a phone on its side: the result and pause cards put their buttons in a row */
@media (max-height: 480px) {
  .ovlCard { padding: 10px 12px; }
  .ovlCard h2 { font-size: 19px; margin-bottom: 2px; }
  .ovlCard p { margin: 4px 0 6px; font-size: 13px; }
  #done .big, #paused .big { display: inline-block; width: calc(33% - 8px); min-width: 120px; min-height: 46px; margin: 4px 2px; padding: 0 8px; font-size: 15px; }
}

/* the frame readout, for the owner. Out of the way, and it takes no taps. */
#fpsNow {
  position: absolute; left: calc(8px + env(safe-area-inset-left)); bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 5; padding: 3px 7px; border-radius: 6px; background: var(--kBg30); color: var(--kInk3);
  font: 600 11px/1.3 ui-monospace, Menlo, monospace; pointer-events: none;
}
#fpsNow[hidden] { display: none; }

/* ---- §15 the chamber maker ---- */
#madeList { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.madeRow { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 12px; }
.madeWords { flex: 1 1 auto; min-width: 0; }
.madeName { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.madeState { color: var(--dim); font-size: 13px; }
.madeRow .pb { flex: 0 0 auto; }
.madeRow .pb.sure { background: var(--bad); color: var(--kInk4); font-size: 14px; padding: 0 8px; min-height: 44px; min-width: 44px; }
.madeRow .pb:disabled { opacity: .4; }
#sizeRow .pick.sel { outline: 2px solid var(--hot); }
#editOv { background: none; padding: 0; pointer-events: none; flex-direction: column; justify-content: space-between; align-items: stretch; }
#editTop {
  margin: 8px 8px 0; display: flex; align-items: center; gap: 6px; pointer-events: auto;
  background: var(--glass); border-radius: 12px; padding: 4px;
}
#editName { flex: 1 1 80px; min-width: 0; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--kBg31); color: var(--ink); font: inherit; padding: 0 10px; }
.pb.wide { padding: 0 12px; font-size: 15px; font-weight: 700; min-height: 44px; min-width: 44px; }
.pb.go { box-shadow: inset 0 0 0 2px var(--hot); }
.pb:disabled { opacity: .5; }
#editMsg { margin: 6px 8px 0; align-self: center; max-width: 560px; text-align: center; font-size: 14px; line-height: 1.35; color: var(--ink);
  background: var(--glass); border-radius: 10px; padding: 6px 10px; pointer-events: none; }
#editMsg:empty { display: none; }
#editTools {
  margin: auto 8px calc(env(safe-area-inset-bottom, 0px) + 8px); display: grid; grid-template-columns: repeat(8, minmax(44px, 1fr)); gap: 4px;
  pointer-events: auto; background: var(--glass); border-radius: 14px; padding: 4px;
}
.tool { min-height: 52px; border-radius: 10px; border: 1px solid transparent; background: var(--kBg2); color: var(--ink); font-size: 20px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px 0; }
.tool small { font-size: 10px; color: var(--dim); }
.tool.on { border-color: var(--hot); background: var(--kBg32); }
.tool:disabled { opacity: .4; }
@media (max-width: 420px) { #editTools { grid-template-columns: repeat(4, 1fr); } }
