/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Firmware: Build's numbered steps beside the two displays, which stay in view. */
/* One top stays in view: the site, the modes, what is saved and the steps. --top is its height (configure.js). */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top, 124px) + 8px); }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg1) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .bar { padding-bottom: 8px; }
.bar-tools { gap: 8px; }
.bar .workspace-tabs { flex-wrap: nowrap; gap: 4px; }
.bar .workspace-tabs button { min-height: 38px; padding: 6px 12px; white-space: nowrap; }
.save-state { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px 0 8px; font: 400 12px var(--sans); color: var(--muted); white-space: nowrap; }
.save-state[data-state=saved]::after { content: "✓"; color: var(--accent); font-weight: 600; }
.save-state[data-state=trial], .save-state[data-state=error] { color: var(--warn); }
.save-state .short { display: none; }
.save-open { min-height: 40px; padding: 0 16px; white-space: nowrap; }
.save-open .short { display: none; }
/* The site's language pair, as in the explorer's bar. */
.lang { display: inline-flex; gap: 2px; font: 500 11px var(--mono); }
.lang button { min-width: 34px; min-height: 34px; padding: 0 8px; border-radius: 999px; color: var(--muted); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed=true] { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.jumps { padding: 0 max(22px, env(safe-area-inset-right)) 0 max(30px, env(safe-area-inset-left)); border-top: 1px solid var(--line); }
.jumps > div { display: flex; gap: 4px; max-width: 1240px; margin: 0 auto; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
.jumps button { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1 0 auto; white-space: nowrap; min-height: 42px; padding: 8px 10px; color: var(--muted); border-radius: 7px; font-size: 12px; transition: color .15s, background .15s; }
.jumps button > span { opacity: .55; font: 10px var(--mono); }
.jumps button:hover { background: var(--soft); color: var(--ink); }
.jumps button[aria-current] { color: var(--bg0); background: var(--ink); font-weight: 500; }
.jumps button[aria-current] > span { opacity: .75; }
.jumps button[data-done=true]:not([aria-current]) > span { opacity: 1; color: var(--accent); }

.bench { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; max-width: calc(1240px + 52px); margin: 0 auto; counter-reset: step;
  padding: 24px max(22px, env(safe-area-inset-right)) 96px max(30px, env(safe-area-inset-left)); }
.preview { grid-column: 1; grid-row: 1 / span 4; position: sticky; top: calc(var(--top, 124px) + 12px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px 16px; border-radius: 14px; background: var(--card); }
.screen-pair { display: flex; justify-content: center; gap: 12px; --scale: 2; }
.screen-pair figure { flex: none; width: calc(68px * var(--scale) + 12px); }
.preview #engine-status { text-align: center; }
/* a half the power-off key turned off */
.screen-pair figure[data-off=true] canvas { filter: brightness(0); }
.step { grid-column: 2; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; border-radius: 14px; background: var(--card); counter-increment: step; }
.step > h2 { display: flex; align-items: center; gap: 12px; min-height: 28px; margin: 0; font: 600 18px/1.2 var(--sans); }
.step > h2::before { content: var(--step-label, counter(step)); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on); font: 600 12px var(--sans); }
.step h3 { margin: 0; font-size: 14px; font-weight: 600; }
.step h3 span { margin-left: 6px; font-weight: 400; color: var(--muted); }
.step-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin: 0; }
.step-foot:not(:has(button:not([hidden]))) { display: none; }

/* keys: the CAD positions of the switches of the chosen size; legends follow the layer */
.key-stage { border-radius: 12px; outline-offset: 4px; }
.key-stage:focus-visible { outline: 2px solid var(--accent); }
/* The map in mm, as the PCB has it: Choc keycaps of 17.5 × 16.5 on an 18 × 17 pitch (keycaps/catalog.json).
   Its frame is the size's (frame() in legend.js): Flan36's is 280 × 104. */
.keymap-board { position: relative; aspect-ratio: var(--board-w, 280) / var(--board-h, 104); width: 100%; max-width: 900px; margin: 4px auto; }
.keymap-board button { position: absolute; left: calc(var(--key-x) * 100% / var(--board-w, 280)); top: calc(var(--key-y) * 100% / var(--board-h, 104)); transform: translate(-50%, -50%) rotate(var(--key-angle));
  width: calc(17.5 * 100% / var(--board-w, 280)); height: calc(16.5 * 100% / var(--board-h, 104)); min-height: 0; padding: 2px; border-radius: 6px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: var(--field); box-shadow: 0 3px 0 var(--line); font-size: clamp(10px, 1.05vw, 14px); line-height: 1.15; touch-action: none; user-select: none; }
.keymap-board button small { max-width: 100%; margin-top: 2px; font-size: max(10px, .62em); color: var(--muted); white-space: nowrap; }
.keymap-board button small[data-overflow=true] { display: none; }
.keymap-board button[data-long=true] span { font-size: max(10px, .72em); }
.keymap-board button.inherited { color: var(--muted); }
.keymap-board button.custom::after { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.custom-mark { display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.keymap-board button[aria-pressed=true] { background: var(--ink); color: var(--bg0); box-shadow: 0 1px 0 var(--line); }
.keymap-board button[aria-pressed=true] small { color: inherit; }
.keymap-board button.editing-key { outline: 3px solid var(--accent); outline-offset: 2px; z-index: 1; }
.key-action { min-height: 20px; text-align: center; }
.key-editor { position: sticky; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 14px; max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg0); box-shadow: 0 10px 30px #0003; }
/* the editor scrolls as a whole: its rows keep their height */
.key-editor > * { flex: none; }
.editor-head { display: flex; align-items: center; gap: 10px; min-height: 32px; margin: 0; font-size: 13px; }
.editor-head strong { font-size: 14px; }
.editor-head .link, .editor-head .close { margin-left: auto; }
.editor-head .link:not([hidden]) + .close { margin-left: 4px; }
.close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.close::before { content: "✕"; font-size: 13px; }
.close:hover { background: var(--soft); color: var(--ink); }
.edit-panel { display: flex; flex-direction: column; gap: 12px; }
.edit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.edit-label, .group-label { font-size: 12.5px; color: var(--muted); }
.edit-label { min-width: 84px; }
.group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* at the row's end, also when it wraps to a line of its own */
.group.end { align-items: flex-end; margin-left: auto; }
/* the key palette: every key of a group in view, shaped like the keys of the map */
.palette-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.palette-bar input { flex: 1 1 220px; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.palette-bar input::placeholder { color: var(--muted); }
.palette-bar .soft[aria-pressed=true] { background: var(--accent); color: var(--on); }
.tabs { position: relative; display: flex; flex-wrap: nowrap; gap: 0 16px; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px var(--line); }
.tabs button { flex: none; min-height: 36px; padding: 0 2px; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed=true] { border-bottom-color: var(--accent); color: var(--ink); }
.palette { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 92px; }
.palette button { min-width: 44px; min-height: 40px; padding: 6px 10px; border-radius: 7px; background: var(--field); box-shadow: 0 2px 0 var(--line); font-size: 13px; line-height: 1.2; }
.palette button:hover { background: color-mix(in srgb, var(--ink) 16%, var(--field)); }
.palette button[aria-pressed=true] { background: var(--ink); color: var(--bg0); box-shadow: 0 1px 0 var(--line); }
/* actions that are not a key: what each does, then its choices; one press assigns */
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.option { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--soft); }
.option strong { font-size: 13px; font-weight: 600; }
.option small { flex: 1; font-size: 12px; line-height: 1.45; color: var(--muted); }
.option .segments { margin-top: 4px; }
.option .segments button { background: var(--bg0); }
.option .segments button[aria-pressed=true] { border-color: var(--accent); color: var(--ink); }
.option .segments button[aria-pressed=true]::before { content: "✓ "; color: var(--accent); }
.option .segments button[data-suggested=true] { border-color: var(--accent); }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
/* a check mark drawn like the site's, not the system's */
input[type=checkbox] { appearance: none; flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin: 0; border: 1px solid var(--muted); border-radius: 4px; background: var(--field); cursor: pointer; }
input[type=checkbox]:checked { border-color: var(--accent); background: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border: solid var(--on); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
input[type=checkbox]:disabled { opacity: .4; cursor: not-allowed; }

/* displays: the pair chooses which one the step edits; one picker, every thumbnail at the panel's own 68 × 160 */
.screen-pair .bezel { display: block; outline: 2px solid transparent; outline-offset: 4px; transition: outline-color .15s; }
.screen-pair .bezel[aria-pressed=true] { outline-color: var(--accent); }
.screen-pair figcaption { color: var(--muted); }
.screen-pair figcaption small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-pair figure:has([aria-pressed=true]) figcaption { color: var(--ink); }
#display-side small { margin-left: 7px; font-size: inherit; font-weight: 400; opacity: .7; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.design-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 8px 4px 6px; border: 1px solid transparent; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 1.25; }
.design-grid button:hover { color: var(--ink); }
.design-grid button[aria-pressed=true] { border-color: var(--ink); background: var(--bg0); color: var(--ink); }
.design-grid canvas { display: block; width: 68px; height: 160px; image-rendering: pixelated; border-radius: 2px; }
.design-grid button[hidden] { display: none; }
#design-picker summary { cursor: pointer; padding: 12px 0; font-weight: 500; }
.design-pages { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; font-size: 12px; color: var(--muted); }
.design-pages button { padding: 8px 14px; }
.design-pages a { margin-left: auto; }

/* settings: one row each, what it does on the left and its value on the right */
.settings-list { display: flex; flex-direction: column; }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-child { padding-top: 0; border-top: 0; }
.setting > div:first-child { flex: 1 1 260px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting label, .setting-label { font-size: 13.5px; font-weight: 500; }
.step-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.setting small { font-size: 12px; line-height: 1.5; color: var(--muted); }
.text { min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.text::placeholder { color: var(--muted); }
.setting .text { flex: 0 1 210px; }
.stepper { flex: none; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.stepper:focus-within { border-color: var(--accent); }
.stepper[data-off=true] { opacity: .55; }
.stepper button { width: 40px; height: 40px; border-radius: 7px; color: var(--muted); font-size: 17px; line-height: 1; }
.stepper button:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.stepper input { width: 5ch; min-height: 40px; padding: 0; border: 0; outline: 0; background: none; text-align: right; font: 500 13.5px var(--mono); }
.stepper span { min-width: 36px; padding: 0 8px 0 5px; font-size: 12px; color: var(--muted); }

/* install: one action at a time */
.summary { margin: 0; font-size: 13px; line-height: 1.6; }
.build-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg0); }
.build-box .progress, .build-box p { flex: 1 1 220px; }
.build-box #local-build-help { flex-basis: 100%; }
.progress { height: 4px; overflow: hidden; border-radius: 2px; background: var(--line); }
.progress span { display: block; width: max(6%, calc(var(--done, 0) * 100%)); height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.installation { display: flex; flex-direction: column; gap: 14px; }
.installation[data-ready=false] { display: none; }
.install-steps button[data-done=true]::after { content: " ✓"; color: var(--accent); }
#install-connect, #install-controls, #install-test { display: flex; flex-direction: column; gap: 12px; }
/* how a copy ended: one statement, whether the half can be unplugged, and the next step */
.outcome { display: flex; flex-direction: column; gap: 10px; max-width: 70ch; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.outcome strong { font-size: 15px; font-weight: 600; }
.outcome p { font-size: 13.5px; line-height: 1.5; }
.outcome[data-state=done] { border-color: var(--accent); }
.outcome[data-state=done] strong::before { content: "✓ "; color: var(--accent); }
.outcome[data-state=failed] { border-color: var(--warn); }
.outcome[data-state=failed] strong { color: var(--warn); }
.outcome .install-actions:has(button:not([hidden])) { margin-top: 2px; }
.outcome .install-actions:not(:has(button:not([hidden]))) { display: none; }
#install-connect p, #install-test p { margin: 0; }
#install-instructions { font-size: 14px; max-width: 70ch; }
.install-confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; cursor: pointer; }
.install-confirm input { margin-top: 2px; }
.key-capture { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); cursor: text; }
.key-capture strong { display: block; font-size: 13px; font-weight: 500; }
.key-capture span { display: block; font-size: 12px; color: var(--muted); }
.key-capture:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.downloads { display: flex; flex-direction: column; }
.downloads a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.downloads a:hover { color: var(--accent); }
.downloads span { font-size: 12px; font-weight: 400; color: var(--muted); }
.save-row { display: flex; gap: 8px; margin-bottom: 12px; }
.save-row .text { flex: 1; }
.saved-list { margin: 0 0 12px; padding: 0; list-style: none; }
.saved-list li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--line); }
.saved-list div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.saved-list strong { overflow: hidden; font-size: 13.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.saved-list small { font-size: 12px; color: var(--muted); }
/* a button waiting for its second press */
[data-armed=true] { color: var(--warn) !important; }
.file-button { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.help { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 80ch; }
.help li { margin-bottom: 8px; }

/* Between a tablet held sideways and a laptop: the displays keep their column, at their native size. */
@media (min-width: 900px) and (max-width: 1080px) {
  .bench { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding-inline: 20px; }
  .preview { padding: 16px 12px 12px; }
  .screen-pair { --scale: 1; }
}
/* Narrower: one column, the displays first in every step; at twice their size where the screen is tall. */
@media (max-width: 899px) {
  .bench { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .preview, .step { grid-column: 1; grid-row: auto; }
  .preview { position: static; flex-direction: row; justify-content: center; flex-wrap: wrap; padding: 16px 12px 12px; }
  .preview #engine-status { flex-basis: 100%; }
  .screen-pair { --scale: 1; }
  .step { padding: 20px 16px; }
}
@media (max-width: 899px) and (min-width: 600px) and (min-height: 1000px) { .screen-pair { --scale: 2; } }
/* At their native size the displays' captions keep only the design's name. */
@media (max-width: 1080px) { .screen-pair .caption-theme { display: none; } }
@media (max-width: 899px) and (min-width: 600px) and (min-height: 1000px) { .screen-pair .caption-theme { display: inline; } }
@media (max-width: 760px) {
  .jumps { padding-inline: 12px; }
  .bench { gap: 16px; padding: 16px 12px 72px; }
  .step { padding: 18px 14px; }
  /* each half on its own row, as on a desk seen from above */
  .keymap-board { aspect-ratio: var(--half-w, 114) / var(--halves-h, 200); max-width: 430px; }
  .keymap-board button { left: calc(var(--half-x) * 100% / var(--half-w, 114)); top: calc(var(--half-y) * 100% / var(--halves-h, 200)); width: calc(17.5 * 100% / var(--half-w, 114)); height: calc(16.5 * 100% / var(--halves-h, 200)); font-size: clamp(11px, 3.7vw, 16px); }
  .keymap-board button small { font-size: 10px; }
  /* Where it is narrower, the map takes the card's side padding until its keys are 44 px tall: 304 px for Flan36,
     whose rows sit 44 px apart at 320 px and whose keys are 44 px from 330 px on. A half with an outer column
     (Flan42, Flan54) also takes the page's padding. */
  .key-stage { margin-inline: calc((100% - clamp(100%, 44px * var(--half-w, 114) / 16.5, 100% + 28px)) / 2); }
  .key-stage:has(> [data-outer=true]) { margin-inline: calc((100% - clamp(100%, 44px * var(--half-w, 114) / 16.5, 100% + 52px)) / 2); }
  .key-editor { padding: 10px 12px 12px; gap: 10px; }
  .edit-label { min-width: 0; flex-basis: 100%; }
  .group.end { align-items: flex-start; margin-left: 0; }
  .options { grid-template-columns: 1fr; }
  .design-grid { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: thin; }
  .design-grid button { flex: 0 0 84px; scroll-snap-align: center; }
  .setting .text { flex-basis: 100%; }
  #edit-kind { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #edit-kind button { flex: none; }
}
/* On a touch screen in one column, halves side by side would leave keys under 44 px: below 811 px wide for Flan36
   and Flan46, and up to 899 px for a map with an outer column (Flan42, Flan54). They are stacked as on a phone. */
@media (pointer: coarse) and (min-width: 761px) and (max-width: 810px) {
  .keymap-board { aspect-ratio: var(--half-w, 114) / var(--halves-h, 200); max-width: 430px; }
  .keymap-board button { left: calc(var(--half-x) * 100% / var(--half-w, 114)); top: calc(var(--half-y) * 100% / var(--halves-h, 200)); width: calc(17.5 * 100% / var(--half-w, 114)); height: calc(16.5 * 100% / var(--halves-h, 200)); }
}
@media (pointer: coarse) and (min-width: 811px) and (max-width: 899px) {
  .keymap-board[data-outer=true] { aspect-ratio: var(--half-w, 114) / var(--halves-h, 200); max-width: 430px; }
  .keymap-board[data-outer=true] button { left: calc(var(--half-x) * 100% / var(--half-w, 114)); top: calc(var(--half-y) * 100% / var(--halves-h, 200)); width: calc(17.5 * 100% / var(--half-w, 114)); height: calc(16.5 * 100% / var(--halves-h, 200)); }
}
@media (max-width: 371px) { .screen-pair { --scale: 1; } }
/* on a touch screen there is no keyboard to press */
@media (hover: none) { #edit-capture { display: none; } }

#keys.dropping { outline: 2px dashed var(--accent); outline-offset: 6px; }

/* Wide screens: the key editor beside the map, under the displays; the column scrolls if it must. */
body.editor-beside .preview { max-height: calc(100vh - var(--top, 124px) - 24px); }
body.editor-beside .preview > * { flex: none; }
body.editor-beside .preview .key-editor { position: static; align-self: stretch; flex: 0 1 auto; min-height: 0; max-height: none; overflow-y: auto; box-shadow: none; }
body.editor-beside .preview .key-editor .palette-bar { flex-wrap: wrap; }
body.editor-beside .preview .key-editor .palette-bar input { min-width: 0; flex: 1 1 100%; }

/* Tabs for layouts and layers: the main button chooses, the ⋯ of the chosen one opens its menu, and a
   dashed + makes a new one. A layer's tab carries its short name as the displays draw it. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tab { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 40px; border: 1px solid transparent; border-radius: 10px;
  background: var(--soft); color: var(--muted); transition: background .15s, color .15s, border-color .15s, transform .18s ease; }
.tab:hover { color: var(--ink); }
.tab.chosen { border-color: var(--ink); background: var(--bg0); color: var(--ink); }
.tab-main { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 9px; color: inherit; font-size: 12.5px; font-weight: 500; }
.tab.chosen .tab-main { padding-right: 4px; }
.tab.own .tab-name::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.tab-short { padding: 2px 6px; border-radius: 4px; background: #121016; color: #ece9f4; font: 600 10px/1.3 var(--mono); letter-spacing: .08em; box-shadow: inset 0 0 0 1px #ffffff14; }
.tab.chosen .tab-short { cursor: text; }
.tab.chosen .tab-short:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.tab-more { display: grid; place-items: center; width: 0; height: 28px; margin-right: 0; overflow: hidden; opacity: 0; color: var(--muted); border-radius: 999px; transition: width .15s, opacity .15s, margin .15s; }
.tab.chosen .tab-more { width: 28px; margin-right: 5px; opacity: 1; }
.tab-more:hover, .tab-more[aria-expanded=true] { background: var(--soft); color: var(--ink); }
.tab[data-drag] .tab-main { cursor: grab; }
.tab.dragging { z-index: 3; transition: none; cursor: grabbing; box-shadow: 0 10px 24px #0005; }
.tab.editing { border-color: var(--accent); background: var(--bg0); }
.tab-add { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px dashed color-mix(in srgb, var(--ink) 26%, transparent); border-radius: 10px;
  color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tab-add:hover { border-color: var(--accent); color: var(--accent); }
.in-place { min-height: 30px; margin: 4px; padding: 4px 8px; border: 0; border-radius: 7px; background: var(--field); color: var(--ink); font: 500 12.5px var(--sans); outline: none; }
.in-place.mono { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.in-place[aria-invalid=true] { box-shadow: inset 0 0 0 1px var(--warn); }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.group-head .micro { font-size: 11.5px; }
/* What an action did: one line, gone after a while; a problem stays until the next action. */
.keys-status { display: flex; align-items: center; gap: 8px; margin: -6px 0 0; font-size: 12.5px; color: var(--ink); animation: status-in .2s ease-out; }
.keys-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.keys-status.error::before { background: var(--warn); }
.keys-status[hidden] { display: none; }
@keyframes status-in { from { opacity: 0; transform: translateY(-3px); } }

/* Menus the page draws: under their button, over everything. */
.menu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 232px; max-width: 300px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: color-mix(in srgb, var(--bg2) 94%, var(--ink)); box-shadow: 0 18px 44px #0007; animation: menu-in .14s ease-out; transform-origin: top left; }
@keyframes menu-in { from { opacity: 0; transform: scale(.97) translateY(-2px); } }
.menu-item { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink); font-size: 13px; line-height: 1.3; text-align: left; }
.menu-item svg { color: var(--muted); }
.menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-item small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--soft); outline: none; }
.menu-item.danger, .menu-item.danger svg { color: #ef6b6b; }
.menu-item[data-armed=true] { background: color-mix(in srgb, #ef6b6b 16%, transparent); }
.menu-rule { height: 1px; margin: 5px 4px; background: var(--line); }
.menu-note { margin: 6px 10px 4px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }


/* Display choices stay visible. Only the six cards on this page can animate. */
#displays{gap:12px}#displays .step-row{gap:8px}#displays .segments button{font-size:12px;padding:7px 10px;min-height:34px}#display-side small{font-size:10px}#design-picker{border-block:1px solid var(--line);padding:12px 0 4px}.catalog-heading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px;align-items:baseline;margin-bottom:10px}.catalog-heading a{font-size:12px}.catalog-search{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-bottom:12px}.catalog-search select{min-width:0;width:100%;font-size:12px}.design-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}.design-grid button{padding:8px 4px;gap:6px;border-color:var(--line);justify-content:flex-start}.design-grid img{width:68px;height:160px;max-width:100%;object-fit:contain;image-rendering:pixelated}.design-grid small{font-size:10px;line-height:1.35}.design-grid small:empty{display:none}.catalog-note{font-size:11px!important;margin:0 0 4px}.display-scenarios{display:grid;gap:6px}#display-state{gap:4px}#display-state button{min-height:28px!important;font-size:11px!important;padding:5px 8px!important}#display-state-note{font-size:11px;line-height:1.45;min-height:32px;margin:0}
@media(max-width:1200px){.design-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.design-grid canvas,.design-grid img{height:128px;width:54.4px}}
@media(max-width:600px){.design-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;margin:0;padding:0}.design-grid button{min-width:0;flex:initial}.design-grid canvas,.design-grid img{height:160px;width:68px}.catalog-heading a{font-size:11px}.catalog-search{gap:6px}#display-side{width:100%}#display-side button{flex:1;min-width:0}#display-side small{display:block;margin:3px 0 0}.step-tools{width:100%;justify-content:space-between}}

.catalog-search select{padding:8px 28px 8px 10px;min-height:36px;border:1px solid var(--line);border-radius:7px;background:var(--field);color:var(--ink);font-family:var(--sans)}

.review-actions{display:flex;gap:1rem;flex-wrap:wrap}.trial-notice{display:grid;gap:.5rem;padding:1rem;background:var(--card);border:1px solid var(--line);border-radius:12px}.trial-notice[hidden]{display:none}/* Central comparison workspace. */
.comparison-toolbar{display:grid;gap:9px;padding:12px 0;flex:none}
.catalog-filters{display:flex;flex-wrap:wrap;gap:5px}.catalog-filters button{border-color:transparent;font-size:12px;min-height:32px;padding:6px 12px}.catalog-filters button[aria-pressed=true]{background:var(--ink);color:var(--bg0)}
.comparison-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.comparison-tools>input{flex:1;min-width:130px;max-width:250px}.comparison-tools .per-page{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;color:var(--muted)}#comparison-quantity{gap:4px;flex-wrap:nowrap}#comparison-quantity button{min-width:32px;padding:6px 8px}.comparison-tools button{font-size:12px;min-height:34px;padding:6px 10px}#comparison-count{color:var(--muted);font-size:10px;margin-left:5px}#compare-selection[aria-pressed=true]{border-color:var(--accent);background:var(--selection)}#comparison-play{margin-left:auto}
.comparison-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(var(--columns,3),minmax(0,1fr));grid-template-rows:repeat(var(--rows,2),minmax(0,1fr));gap:10px;padding-bottom:10px}
.comparison-card{display:flex;flex-direction:column;align-items:center;justify-content:space-between;min-width:0;min-height:0;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--card);gap:8px}.compare-heading{width:100%;min-width:0}.compare-heading label{display:flex;align-items:center;gap:7px;color:var(--ink)}.compare-heading input{width:15px;height:15px;margin:0;flex:none}.comparison-card h2{font:500 13px/1.25 Inter,sans-serif;margin:0;min-width:0;overflow-wrap:anywhere}.compare-heading small{display:block;font-size:10px;color:var(--muted);margin:3px 0 0 22px;line-height:1.3}.comparison-pair{display:flex;align-items:center;justify-content:center;gap:8px;max-width:100%;margin:auto 0}.comparison-pair figure{flex:none}.comparison-pair .bezel{padding:4px;border-radius:6px}.comparison-pair canvas{width:calc(var(--screen-height,160px)*.425);height:var(--screen-height,160px)}.comparison-pair figcaption{font-size:10px;line-height:12px;color:var(--muted);margin-top:4px}.card-actions{display:flex;justify-content:space-between;gap:6px;width:100%;flex-wrap:wrap}.card-actions button{font-size:11px;padding:5px 8px;min-height:30px}

.bar .workspace-tabs {padding:0;border:0}
#comparison {padding:12px 30px 18px;display:flex;flex-direction:column;height:calc(100dvh - var(--top, 64px));min-height:0;max-width:1800px;margin:auto}
.comparison-grid {align-content:start;grid-template-rows:repeat(var(--rows,2),minmax(0,1fr));max-height:760px}
.comparison-card {justify-content:start}.comparison-pair{margin:0 auto}.card-actions{margin-top:auto}
.comparison-tools input{border:1px solid var(--line);border-radius:8px;background:var(--field);padding:8px;color:var(--ink)}
.comparison-tools button,.card-actions button,.catalog-filters button {border:1px solid var(--line);border-radius:8px;padding:7px 10px}
.comparison-card[hidden],#comparison[hidden],.bench[hidden] {display:none}
#study-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center}#study-controls p{flex-basis:100%;margin:0;font-size:12px;color:var(--muted)}#study-controls label{display:flex;gap:8px;align-items:center;font-size:13px}

@media(max-width:760px){#comparison{height:auto;min-height:0;padding:0 12px 20px}.comparison-grid{flex:none;grid-template-rows:none;grid-auto-rows:auto;max-height:none}.comparison-card{padding:10px 6px}.comparison-card h2{font-size:12px}.comparison-tools{gap:6px}.comparison-pair{gap:6px}.comparison-pair .bezel{padding:3px}.card-actions button{font-size:10px;padding:5px}.comparison-tools input{max-width:100%;width:100%}#keyboard{height:260px}}

/* One animated pair while editing; the flat catalog is a compact list. */
#designs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;overflow:visible}
#designs button {width:auto;min-width:0;min-height:46px;padding:9px 12px;text-align:left;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:3px}
#designs button span {font-size:13px}#designs button small {font-size:10px;color:var(--muted)}
.catalog-search input {width:100%;min-width:0}.display-scenarios .setting-label{font-size:13px;color:var(--muted)}
#display-state{margin-top:6px}
@media(max-width:760px){#designs{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* One row per design: initial choice and shortcut membership share the catalog. */
.design-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.design-choice{display:flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--soft);padding-right:10px}
.design-choice button{flex:1;min-height:48px;justify-content:center;align-items:flex-start;text-align:left;font-size:12px;padding:8px 10px;border:0;background:transparent}
.design-choice input{accent-color:var(--ink);width:16px;height:16px;flex:none}
.design-choice:has([aria-pressed=true]){outline:1px solid var(--ink);background:var(--bg0)}
.design-choice button[aria-pressed=true]{background:transparent}
@media(max-width:600px){.design-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Static native previews keep the catalog visual without additional animation workers. */
#designs .design-choice{position:relative;padding:0;align-items:stretch}
#designs .design-choice>input{position:absolute;right:10px;top:10px;margin:0}
#designs .design-choice button{padding:12px;width:100%;gap:10px;justify-content:flex-start;align-items:stretch}
#designs .design-choice button>span:first-child{padding-right:24px;min-height:32px;display:flex;align-items:center}
#designs .design-preview{display:flex;gap:6px;justify-content:center;width:100%;padding:0}
#designs .design-preview img{display:block;width:min(68px,calc((100% - 6px)/2));height:auto;aspect-ratio:68/160;object-fit:contain;image-rendering:pixelated;border:1px solid var(--line);border-radius:2px}

.display-toggle{display:flex;align-items:center;gap:8px;min-height:40px;font-size:12px;color:var(--ink);cursor:pointer}.display-toggle input{width:16px;height:16px;accent-color:var(--ink);margin:0}

/* An editor inside the preview must fit its content box, including a visible scrollbar. */
.preview,.key-editor,.option{min-width:0}
.options{grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr))}
.key-editor{width:100%;box-sizing:border-box}
.editor-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px}
.editor-head strong{grid-column:1;grid-row:1}
.editor-head .close{grid-column:2;grid-row:1;margin:0}
#edit-current{grid-column:1 / -1;grid-row:2}
.editor-head .link{grid-column:1 / -1;grid-row:3;justify-self:start;margin:0;text-align:left}
/* with both links showing, each has its own line */
#edit-kind{flex-wrap:wrap;overflow:visible}
@media(min-width:1081px){.bench{grid-template-columns:360px minmax(0,1fr)}body.editor-beside .preview .key-editor{scrollbar-gutter:stable}
/* Beside the map the column is too narrow for one row of key groups: they wrap, each row on its own line. */
body.editor-beside .preview .key-editor .tabs { flex-wrap: wrap; gap: 0; overflow: visible; box-shadow: none; }
body.editor-beside .preview .key-editor .tabs button { padding: 0 8px; box-shadow: inset 0 -1px var(--line); }}

/* Away from the wide layout the editor is a sheet at the bottom of the screen, over the end of the map: short enough
   to leave the chosen key in view above it (configure.js scrolls it there). */
@media(max-width:1080px),(max-height:859px){.key-editor{position:sticky;bottom:0;max-height:min(46vh,440px);box-shadow:0 -10px 30px #0006}}
/* In one column the displays sit above the map: while a key is edited they stay under the top bar, at their native
   size and without captions, and the chosen key stays in view between them and the sheet (configure.js). Under
   700 px of height the three do not fit: the key and the sheet keep the room. */
@media (max-width: 899px) and (min-height: 700px) {
  body[data-step=keys]:has(#key-editor:not([hidden])) .preview { position: sticky; top: var(--top, 124px); z-index: 3; padding-block: 10px; background: linear-gradient(var(--card), var(--card)), var(--bg0); box-shadow: 0 10px 30px #0006; }
  body[data-step=keys]:has(#key-editor:not([hidden])) .screen-pair { --scale: 1; }
  body[data-step=keys]:has(#key-editor:not([hidden])) .screen-pair figcaption { display: none; }
}

/* Every static design is visible; only the selected pair animates. */
body[data-step=displays] #displays{padding:18px;gap:10px}
body[data-step=displays] #designs{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:7px}
#designs .design-choice button{padding:8px;gap:6px}
#designs .design-choice button>span:first-child{font-size:11px;min-height:28px;padding-right:19px;line-height:1.25}
#designs .design-choice>input{right:7px;top:9px;width:14px;height:14px}
#designs .design-preview{gap:4px}
#designs .design-preview img{width:41px;height:96px;max-width:calc((100% - 4px)/2)}
@media(max-width:600px){body[data-step=displays] #designs{grid-template-columns:repeat(3,minmax(0,1fr))}body[data-step=displays] .bench{padding-inline:12px}body[data-step=displays] #displays{padding:12px}#designs .design-preview img{width:34px;height:80px}}

/* Keeping and leaving: a preview is kept or left from its notice; each editor ends with Listo; saved copies are one dialog. */
.trial-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.done-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.done-bar > .micro { margin-right: auto; }
.done-bar .primary { min-width: 128px; }
/* the key editor's Listo stays at the bottom of the editor however far it scrolls */
/* bottom reaches into the scroll box's own 16 px padding, so nothing shows under it */
#key-editor > .done-bar { position: sticky; bottom: -16px; z-index: 1; margin: 0 -16px; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--bg0); }
/* the editor's padding is 12px on phones: the bar meets its edges there too */
@media (max-width: 760px) { #key-editor > .done-bar { bottom: -12px; margin: 0 -12px; padding-inline: 12px; } }
#displays > .done-bar { padding-top: 14px; border-top: 1px solid var(--line); }
.row-link { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; min-height: 48px; padding: 12px 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 13px; font-weight: 500; text-align: left; }
.row-link span { font-size: 12px; font-weight: 400; color: var(--muted); }
.row-link::after { content: "›"; margin-left: auto; font-size: 18px; line-height: 1; color: var(--muted); }
.row-link:hover { color: var(--accent); }
.saves { width: min(560px, calc(100vw - 24px)); max-height: min(84vh, 720px); padding: 16px 18px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg0); color: var(--ink); box-shadow: 0 24px 60px #0008; overflow-y: auto; overscroll-behavior: contain; }
.saves[open] { display: flex; flex-direction: column; gap: 12px; }
.saves::backdrop { background: #0009; }
.saves .save-row, .saves .saved-list { margin: 0; }
.saves > .done-bar { position: sticky; bottom: 0; margin: auto -18px 0; padding: 12px 18px 16px; border-top: 1px solid var(--line); background: var(--bg0); }

/* The bar folds: short labels first, then two rows with the modes under the save; on a phone the steps' and editors' Listo stay at hand. */
@media (max-width: 1399px) { .save-state .long { display: none; } .save-state .short { display: inline; } }
@media (max-width: 1180px) { .save-open .long { display: none; } .save-open .short { display: inline; } }
@media (max-width: 1080px) {
  .top .bar { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "home state lang save" "nav modes modes modes"; row-gap: 0; }
  .top .bar-tools { display: contents; }
  .top .nav-home { grid-area: home; }
  .top .app-nav { grid-area: nav; justify-self: start; margin-left: -14px; }
  .top .workspace-tabs { grid-area: modes; justify-self: end; }
  .top .save-state { grid-area: state; }
  .top .save-open { grid-area: save; }
  .top .lang { grid-area: lang; }
}
@media (max-width: 760px) {
  .top .bar { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "home modes modes save" "nav nav lang state"; column-gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 2px; }
  .top .app-nav { grid-area: nav; margin-left: -8px; }
  .top .app-nav a { min-height: 38px; padding: 0 8px; font-size: 14px; }
  .top .workspace-tabs { justify-self: center; }
  .top .workspace-tabs button { min-height: 36px; padding: 5px 10px; font-size: 12px; }
  .top .save-state { justify-self: end; padding: 0; font-size: 11px; }
  .top .save-open { min-height: 38px; padding: 0 14px; }
  .jumps > div { padding: 6px 0; }
  .jumps button { min-height: 38px; padding: 6px 8px; }
  .done-bar > .micro { display: none; }
  body[data-step=displays] #displays > .done-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0;
    padding: 10px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-top: 1px solid var(--line); background: var(--bg1); box-shadow: 0 -8px 24px #0004; }
  .done-bar .primary { flex: 1; }
  body[data-step=displays] .bench { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  /* what is scrolled into view stops above that bar */
  html:has(body[data-step=displays]) { scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .saves { width: 100vw; max-width: 100vw; max-height: 88dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
}
@media (max-width: 520px) {
  .top .workspace-tabs .long { display: none; }
  /* on a phone the pair is one button: the language not in use */
  .top .lang button[aria-pressed=true] { display: none; }
}
@media (max-width: 400px) { .top .app-nav a { padding: 0 5px; font-size: 13px; } .top .app-nav { margin-left: -5px; } .top .lang { margin-left: 6px; } }
@media (max-width: 380px) { .top .save-state { display: none; } .top .bar { grid-template-areas: "home modes modes save" "nav nav nav lang"; } .top .lang { justify-self: end; margin-left: 0; } }
@media (max-width: 420px) { .top .nav-home .word { display: none; } }

/* Each step ends with the step before and after it (configure.js). */
.step-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.step-pager button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 128px; min-height: 52px; padding: 8px 14px; border-radius: 10px; background: var(--soft); text-align: left; }
.step-pager button:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.step-pager small { font-size: 11px; color: var(--muted); }
.step-pager strong { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 500; }
.step-pager strong span { font: 10px var(--mono); color: var(--muted); }
.step-pager .step-next { margin-left: auto; align-items: flex-end; text-align: right; }

/* Touch screens: a 44 px tap area for every control. In the top, which stays in view, and between rows with room
   the area is invisible and nothing moves; elsewhere the control grows to 44 px. */
@media (pointer: coarse) {
  .top .nav-home { min-width: 44px; }
  .top .app-nav a::before { content: ""; position: absolute; inset: 0 0 -6px; }
  .top .workspace-tabs button, .top .save-open, .jumps button, .segments button, .soft, .tab-main, .tab-add, .tabs button, .palette button, .close { position: relative; }
  .top .workspace-tabs button::after { content: ""; position: absolute; inset: -6px 0 -2px; }
  .top .save-open::after, .jumps button::after { content: ""; position: absolute; inset: -3px 0; }
  .top .lang button { position: relative; }
  .top .lang button::after { content: ""; position: absolute; inset: -5px -1px; }
  .segments button::after, .soft::after, .tab-add::after, .palette button::after { content: ""; position: absolute; inset: -2px 0; }
  .tab-main::after { content: ""; position: absolute; inset: -3px 0; }
  /* the key groups sit on their underline and their row scrolls sideways: the area reaches up, into room the row makes */
  .tabs button::after { content: ""; position: absolute; inset: -8px -2px 0; }
  .tabs { padding-top: 8px; margin-top: -8px; row-gap: 8px; }
  .close::after { content: ""; position: absolute; inset: -6px; }
  /* the chosen tab's ⋯ reaches into its tab and the gaps around it */
  .tab.chosen .tab-more { position: relative; overflow: visible; }
  .tab.chosen .tab-more::after { content: ""; position: absolute; inset: -8px; }
  .segments button { min-width: 44px; }
  #displays .segments button { min-height: 44px; }
  /* an install step's ✓ is its ::after: those steps reach 44 px themselves and keep the ✓ in the line */
  .install-steps button { min-height: 44px; }
  .install-steps button::after { position: static; }
  .menu-item { min-height: 44px; }
  .stepper button { width: 44px; height: 44px; }
  .stepper input { min-width: 44px; min-height: 44px; }
  :is(input.text, input[type=search]), .link:not(p .link), .display-toggle, .install-confirm, #displays #assign-previous, #displays #assign-next,
  .comparison-tools button, .card-actions button, .catalog-filters button { min-height: 44px; }
  .pagination button { min-width: 44px; min-height: 44px; }
  :is(#install, #artifact-options) .micro > a:only-child { display: inline-flex; align-items: center; min-height: 44px; }
  p .link, p a:not(:only-child) { position: relative; min-height: 0; }
  p .link::after, p a:not(:only-child)::after { content: ""; position: absolute; inset: -12px -2px; }
  /* a design's place in the anterior / siguiente cycle: the same 14 px box, in a 44 px corner that takes its 4 px share of the gap */
  #designs .design-choice > input { -webkit-appearance: none; appearance: none; right: -4px; top: -4px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; cursor: pointer; }
  #designs .design-choice > input::before { content: ""; position: absolute; right: 11px; top: 13px; width: 14px; height: 14px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 3px; }
  #designs .design-choice > input:checked::before { border-color: var(--ink); background: var(--ink); }
  #designs .design-choice > input:checked::after { content: ""; position: absolute; right: 16px; top: 15px; width: 4px; height: 8px; border: solid var(--bg1); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  #designs .design-choice > input:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; }
}
/* On a phone's stacked map, a key shorter or narrower than 44 px reaches 44 px into the gap around it (its ::after is
   the custom-key dot). The wide map's pitch has no such room. */
@media (pointer: coarse) and (max-width: 760px) {
  .keymap-board button::before { content: ""; position: absolute; inset: min(0px, (100% - 44px) / 2); }
}
