/* =====================================================================
   MS-2401H instrument panel.
   Palette: warm-white 1980s ABS, a blue-gray keyboard/control deck,
   dark screens, warm paper, and Stone seal-red accents.
   ===================================================================== */

:root {
  --case:        #e6e6df;
  --case-hi:     #f4f3ed;
  --case-dark:   #c9cbc6;
  --case-deep:   #a4aaa9;
  --panel:       #35415d;
  --panel-hi:    #46526b;
  --panel-deep:  #253047;
  --bezel:       #30363d;
  --bezel-hi:    #4a525b;
  --lcd-bg:      #101a2e;
  --lcd-fg:      #d8e8f0;
  --paper:       #f6f3ec;
  --ink:         #1b2430;
  --ink-soft:    rgba(27, 36, 48, 0.60);
  --ink-faint:   rgba(27, 36, 48, 0.34);
  --seal:        #c4442a;
  --seal-glow:   rgba(196, 68, 42, 0.55);

  --ui-font: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
             "Noto Sans CJK SC", system-ui, sans-serif;
  --mono-font: "SFMono-Regular", "DejaVu Sans Mono", "Consolas", ui-monospace,
               monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--ui-font);
  color: var(--ink);
  background: var(--case-deep);
  /* subtle molded-plastic sheen behind the whole facia */
  background-image:
    radial-gradient(120% 80% at 50% -10%, var(--case-hi), transparent 60%),
    linear-gradient(180deg, var(--case) 0%, var(--case-dark) 100%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---- bilingual molded label system (the typographic personality) ---- */
.label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1;
  white-space: nowrap;
}
.label b {
  font-size: 12px;
  letter-spacing: 0.03em;
  font-weight: 700;
  color: var(--ink);
}
.mono { font-family: var(--mono-font); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Machine shell
   ===================================================================== */
.machine {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 1680px;
  margin: 0 auto;
  padding: 14px 18px 12px;
  gap: 12px;
}

/* ---- top facia ---- */
.facia-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 12px;
  border-bottom: 1px solid var(--case-deep);
  box-shadow: 0 1px 0 var(--case-hi);
}
.wordmark { display: flex; align-items: baseline; gap: 14px; }
.wordmark-seal {
  font-size: 30px;
  font-weight: 800;
  color: var(--seal);
  letter-spacing: 0.14em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.wordmark-model {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.wordmark-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.facia-top-right { display: flex; align-items: center; gap: 18px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--case-deep);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.025em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.top-action-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(37, 48, 71, 0.10);
  color: var(--panel-deep);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}
.top-action:hover {
  border-color: #858d91;
  background: var(--case-hi);
  transform: translateY(-1px);
}
.top-action:active { transform: none; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.24); }
.top-action:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.top-action:disabled { opacity: 0.46; cursor: default; transform: none; box-shadow: none; }
.help-link {
  border-color: var(--seal);
  background: linear-gradient(180deg, #fff9f5, #ead9d1);
  color: #7f2d20;
}
.help-link .top-action-icon { background: var(--seal); color: #fff; }
.top-about { border-color: #7c8792; }
.display-expand-action[aria-pressed="true"] {
  border-color: var(--seal);
  color: #7f2d20;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(196, 68, 42, 0.18);
}
.display-expand-action[aria-pressed="true"] .top-action-icon {
  background: var(--seal);
  color: #fff;
}

/* power / pause */
.power-cluster { display: flex; align-items: center; gap: 18px; }
.power-dot { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.power-symbol { color: var(--ink); font-size: 18px; font-weight: 760; line-height: 1; }
.power-dot.is-on .power-symbol { color: var(--seal); }
.power-dot .label { flex-direction: column; align-items: center; gap: 1px; }

.btn-round {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}
.btn-glyph {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-round.is-active .btn-glyph { color: var(--seal); }
.btn-round:active .btn-glyph { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); }

/* =====================================================================
   Main split — 60% displays / 40% platen
   ===================================================================== */
.facia-main {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
  min-height: 0;
}

.machine.is-display-enlarged .facia-main { grid-template-columns: minmax(0, 1fr); }
.machine.is-display-enlarged .platen,
.machine.is-display-enlarged .print-drawer { display: none; }

/* ---- display stack ---- */
.display-stack { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.screen-region {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  outline: none;
  border-radius: 8px;
}
.screen-region:focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }

.crt-bezel, .lcd-bezel {
  background: linear-gradient(180deg, var(--bezel-hi), var(--bezel));
  border-radius: 10px;
  padding: 12px 12px 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.crt-bezel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.lcd-bezel { flex: 0 0 auto; }

.crt-inset, .lcd-inset {
  position: relative;
  background: var(--lcd-bg);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85),
              inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.crt-inset {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 8 / 5;
  max-height: 100%;
}
/* The LCD glass is sized from the panel geometry in display.css. */
.lcd-inset { width: fit-content; margin-inline: auto; }

/* Both screens are backed at device-pixel resolution by ScaledPresenter
   (web/ui/blit.js): integer zooms are presented pixel-perfect, fractional
   zooms antialiased. `image-rendering: pixelated` would fight that by
   re-resampling the already-device-sized raster — keep it off. */
#crt, #lcd {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  position: relative;
  z-index: 1;
}

/* phosphor glow + faint static scanlines (static: safe under reduced motion) */
.crt-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.45) 100%),
    repeating-linear-gradient(0deg, rgba(216, 232, 240, 0.05) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.crt-off {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(216, 232, 240, 0.34);
  background: var(--lcd-bg);
}
.crt-off.is-hidden { display: none; }

.capture-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.capture-hint.is-hidden { visibility: hidden; }
.capture-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint);
}

/* =====================================================================
   The platen — signature element
   ===================================================================== */
.platen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  border-radius: 12px;
  padding: 12px 14px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
              0 2px 6px rgba(0, 0, 0, 0.18);
}

.platen-tear {
  display: flex;
  align-items: center;
  gap: 12px;
}
.perforation {
  flex: 1 1 auto;
  height: 0;
  border-top: 2px dashed var(--case-deep);
  opacity: 0.7;
}
.btn-tear {
  border: 1px solid var(--case-deep);
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-tear:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-tear:not(:disabled):active { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35); }

/* paper well: a recessed tray the page scrolls through */
.paper-well {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bezel);
  border-radius: 6px;
  padding: 10px 26px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: var(--case-deep) transparent;
}
/* tractor-feed sprocket strips down each edge */
.sprockets {
  position: absolute;
  top: 0; bottom: 0;
  width: 16px;
  background-image: radial-gradient(circle, rgba(0,0,0,0.55) 2.2px, transparent 2.6px);
  background-size: 16px 22px;
  background-position: center 6px;
  opacity: 0.7;
  pointer-events: none;
}
.sprockets-left { left: 4px; }
.sprockets-right { right: 4px; }

.paper-sheet {
  position: relative;
  min-height: 100%;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.35);
  /* faint feed lines so an empty sheet still reads as paper */
  background-image: repeating-linear-gradient(
    0deg, transparent 0 27px, rgba(27, 36, 48, 0.05) 27px 28px);
}
#paper {
  display: block;
  width: 100%;
  height: auto;
  /* the page is downscaled (1303px -> platen width); smooth resampling keeps
     the thin dot-matrix strokes legible rather than dropping whole columns. */
  image-rendering: auto;
  opacity: 0;
}
#paper.is-visible { opacity: 1; }
.paper-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}
.paper-empty.is-hidden { display: none; }

/* carriage rail + physically animated head — the signature element */
.carriage { display: flex; flex-direction: column; gap: 8px; }
.carriage-rail {
  position: relative;
  height: 40px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, var(--case-dark), var(--case-deep));
  border-radius: 7px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}
/* the chrome guide rod the carriage rides on */
.rail-line {
  position: absolute;
  left: 10px; right: 10px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #6c6960, var(--bezel) 60%, #23221e);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 1px 1px rgba(0, 0, 0, 0.6);
}
.print-head {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 34px;
  transform: translateX(0);
  transition: transform 0.10s linear;
  will-change: transform;
}
/* the carriage sled body clamped over the rod */
.head-body {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--bezel-hi), var(--bezel));
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
/* the print-head "eye" — dark at rest, a red pinpoint when firing */
.head-body::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #14120f;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.8);
  transition: background 0.06s, box-shadow 0.06s;
}
/* the 24 pins protruding toward the paper */
.head-pins {
  width: 62%;
  height: 7px;
  margin: 1px auto 0;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(180deg, var(--bezel-hi), var(--bezel)),
    repeating-linear-gradient(90deg, #1a1916 0 1px, transparent 1px 3px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}
.print-head.is-busy .head-body {
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.45), 0 0 8px rgba(196, 68, 42, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.print-head.is-busy .head-body::after { background: #7a2b1e; }
.print-head.is-firing .head-body {
  background: linear-gradient(180deg, #7a2b1e, var(--seal));
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 0 14px var(--seal-glow),
              inset 0 1px 0 rgba(255, 200, 180, 0.4);
}
.print-head.is-firing .head-body::after {
  background: #ffd9c8;
  box-shadow: 0 0 8px rgba(255, 220, 200, 0.95);
}
.carriage-rail.is-active {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--seal-glow);
}

.platen-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-soft);
}
.label-inline { font-size: 9px; }
#platen-status { font-size: 11px; color: var(--ink); }

.print-drawer {
  display: none;
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  border: 1px solid var(--case-deep);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
              0 2px 5px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}
.print-drawer-tab {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 9px 12px;
  color: var(--ink);
  cursor: pointer;
}
.print-drawer-tab .label {
  min-width: 0;
  overflow: hidden;
}
.print-drawer-tab .mono {
  min-width: 0;
  max-width: 54%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ink-soft);
}
.print-drawer-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 0;
  padding: 0 10px;
  overflow: hidden;
  transition: max-height 0.18s ease, padding 0.18s ease;
}
.print-drawer.is-open .print-drawer-tab {
  border-bottom-color: var(--case-deep);
}
.print-drawer.is-open .print-drawer-panel {
  max-height: 260px;
  padding: 10px;
}
.print-drawer .btn-flat {
  min-width: 0;
  min-height: 38px;
}
.print-preview {
  position: relative;
  grid-column: 1 / -1;
  min-height: 132px;
  max-height: 164px;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(180deg, #23262b, #1a1d22);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}
#print-drawer-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 9px;
  image-rendering: auto;
}
#print-drawer-preview.is-empty {
  display: none;
}
.print-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(246, 243, 236, 0.58);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.print-preview-empty.is-hidden {
  display: none;
}

/* =====================================================================
   Bottom facia — floppy / sound / display / capture / status
   ===================================================================== */
.facia-bottom {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 8px 12px;
  border: 1px solid var(--panel-deep);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14),
              0 1px 3px rgba(0, 0, 0, 0.18);
  flex-wrap: wrap;
}
.ctl-group { display: flex; align-items: center; gap: 10px; }
.group-label {
  display: inline-flex; align-items: baseline; gap: 0.4em;
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600;
}
.group-label b { font-size: 11px; color: var(--ink); font-weight: 700; }
.facia-bottom > .ctl-group > .group-label,
.facia-bottom .ctl-capture .label,
.facia-bottom .ctl-capture .hint {
  color: rgba(239, 242, 246, 0.68);
}
.facia-bottom > .ctl-group > .group-label b,
.facia-bottom .ctl-capture .label b {
  color: #f0f2f5;
}

.btn-flat {
  border: 1px solid var(--case-deep);
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-flat:active { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3); }
.btn-flat.is-active { border-color: var(--seal); }
.btn-flat.is-active .label b { color: var(--seal); }

.mini-led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #6b3128;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
  transition: background 0.08s, box-shadow 0.08s;
}
.mini-led.is-on, .mini-led.is-flash {
  background: var(--seal);
  box-shadow: 0 0 7px var(--seal-glow);
}

.ctl-capture .hint { font-size: 9px; color: var(--ink-faint); letter-spacing: 0.06em; }
.ctl-status { margin-left: auto; }
#status-readout {
  font-size: 12px;
  color: #f0f2f5;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 5px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}
input[type="range"] {
  width: 96px;
  accent-color: var(--seal);
}

/* focus visibility across all interactive controls */
button:focus-visible,
input:focus-visible,
select:focus-visible,
.about-link:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

/* =====================================================================
   Boot overlay + error toast
   ===================================================================== */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 80% at 50% 20%, var(--case-hi), transparent 60%),
    var(--case-dark);
  transition: opacity 0.4s ease;
}
.boot-overlay.is-hidden { opacity: 0; pointer-events: none; }
.boot-card { text-align: center; }
.boot-seal {
  font-size: 56px; font-weight: 800; color: var(--seal);
  letter-spacing: 0.16em; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.25);
}
.boot-title {
  font-size: 20px; font-weight: 700; letter-spacing: 0.28em;
  color: var(--ink); margin-top: 4px;
}
.boot-msg { margin-top: 18px; font-size: 12px; color: var(--ink-soft); }
.boot-bar {
  margin: 14px auto 0;
  width: 240px; height: 5px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 4px;
  overflow: hidden;
}
.boot-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--seal);
  border-radius: 4px;
  animation: boot-slide 1.1s ease-in-out infinite;
}
@keyframes boot-slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.error-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--lcd-bg);
  border: 1px solid var(--seal);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 12px 18px;
  max-width: 640px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.error-toast.is-hidden { display: none; }
.error-title {
  color: var(--seal);
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.error-msg { margin-top: 6px; font-size: 11px; color: var(--lcd-fg); word-break: break-word; }

/* =====================================================================
   Built-in help dialog
   ===================================================================== */
.help-open body { overflow: hidden; }
.help-overlay[hidden] { display: none; }
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 48px);
  background: rgba(20, 27, 38, 0.68);
  backdrop-filter: blur(3px);
}
.help-dialog {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  max-height: min(88dvh, 860px);
  overflow: hidden;
  border: 1px solid var(--case-deep);
  border-radius: 12px;
  background: var(--case-hi);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(10, 16, 26, 0.48),
              inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.help-dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 15px 24px;
  border-bottom: 1px solid var(--case-dark);
  background: linear-gradient(180deg, #faf9f4, var(--case));
}
.help-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--seal);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.help-dialog h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0.04em;
}
.help-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 1px solid var(--case-deep);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.help-close:active { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.24); }
.help-dialog-body {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 26px;
  scrollbar-width: thin;
  scrollbar-color: var(--case-deep) transparent;
}
.help-intro {
  margin: 0;
  padding: 13px 15px;
  border-left: 3px solid var(--seal);
  border-radius: 0 6px 6px 0;
  background: rgba(53, 65, 93, 0.07);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.help-section {
  padding-top: 18px;
  border-top: 1px solid rgba(27, 36, 48, 0.14);
  margin-top: 18px;
}
.help-section h3 {
  margin: 0 0 9px;
  color: var(--panel);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.help-section p,
.help-section li,
.help-section dd {
  font-size: 13px;
  line-height: 1.72;
}
.help-section p { margin: 0; }
.help-section ul,
.help-section ol {
  margin: 0;
  padding-left: 1.45em;
}
.help-section li + li { margin-top: 6px; }
.help-ime {
  padding: 15px 16px 16px;
  border: 1px solid rgba(53, 65, 93, 0.18);
  border-left: 3px solid var(--seal);
  border-radius: 7px;
  background: rgba(53, 65, 93, 0.05);
}
.help-ime h3 { color: var(--seal); }
.help-ime p { margin-bottom: 8px; }
.help-section kbd {
  display: inline-block;
  margin-inline: 0.08em;
  padding: 1px 5px 2px;
  border: 1px solid var(--case-deep);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f8f8f4;
  color: var(--panel-deep);
  font-family: var(--ui-font);
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.help-section dl { margin: 0; }
.help-section dl > div {
  display: grid;
  grid-template-columns: 4em 1fr;
  gap: 10px;
}
.help-section dl > div + div { margin-top: 8px; }
.help-section dt {
  color: var(--seal);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.72;
}
.help-section dd { margin: 0; }
.help-access {
  padding: 15px;
  border: 0;
  border-radius: 7px;
  background: var(--panel);
  color: #f0f2f5;
}
.help-access h3 { color: #f0f2f5; }

@media (max-width: 640px) {
  .help-overlay {
    align-items: stretch;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
             max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .help-dialog { max-height: 100%; border-radius: 9px; }
  .help-dialog-header { padding: 14px 13px 12px 16px; }
  .help-dialog h2 { font-size: 19px; }
  .help-dialog-body { padding: 15px 16px 20px; }
  .help-intro { font-size: 13px; }
  .help-section { padding-top: 15px; margin-top: 15px; }
  .help-section dl > div { grid-template-columns: 3.5em 1fr; gap: 7px; }
}

/* =====================================================================
   On-screen (soft) keyboard — the MS-2401H's own 99-key matrix.
   Mounted as the last grid row of .machine, so opening it compresses the
   facia (display + platen) row rather than covering the platen. The blue-gray
   deck follows the real machine's keyboard/control panel, with pale keycaps;
   seal-red remains ONLY for latched modifiers and the 拷屏 print-key ring.
   ===================================================================== */
.soft-kbd {
  --u:  clamp(40px, 3.7vw, 64px);
  --uh: clamp(38px, 4.55vh, 46px);
  --kg: 5px;
  --deck-gap: 18px;
  --fn-w: calc((var(--u) * 2) + var(--kg));
  --alpha-w: calc((var(--u) * 15) + (var(--kg) * 14));
  --alpha-track: calc(var(--alpha-w) / 60);
  --right-w: calc((var(--u) * 4) + (var(--kg) * 3));
  --keycap: #e7edf0;
  --keycap-hi: #f8faf8;
  --keycap-low: #c5cbd0;
  --key-blue: #245176;
  --key-red: #a83b42;
  --key-green: #2f7c58;
  --key-black: #17202a;
  display: none;
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
  justify-self: center;
  margin-top: 2px;
  padding: 8px 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 36%),
    var(--panel);
  border-radius: 8px;
  border: 1px solid var(--panel-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16),
              0 -2px 8px rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
  scrollbar-color: var(--case-deep) transparent;
}
.soft-kbd.is-open { display: block; }
@keyframes skbd-rise {
  from { transform: translateY(26px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.skbd-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-width: min-content;
}

.skbd-alt-strip {
  display: grid;
  grid-template-columns: var(--fn-w) var(--alpha-w) var(--right-w);
  gap: var(--deck-gap);
  align-items: stretch;
  width: max-content;
  justify-content: start;
}
.skbd-alt-fn-spacer { min-width: var(--fn-w); }
.skbd-alt-center {
  display: grid;
  grid-template-columns: repeat(60, var(--alpha-track));
  gap: 0;
  width: var(--alpha-w);
}
.skbd-alt-right {
  display: grid;
  grid-template-columns: repeat(4, var(--u));
  gap: var(--kg);
}
.skbd-alt-label {
  min-height: 20px;
  display: grid;
  place-items: center;
  padding: 2px 5px;
  width: calc(100% - var(--kg));
  justify-self: start;
  background: rgba(213, 220, 214, 0.58);
  border: 1px solid rgba(50, 66, 76, 0.32);
  color: #37617c;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.skbd-alt-label.is-empty {
  visibility: hidden;
}

.skbd-deck {
  display: grid;
  grid-template-columns: var(--fn-w) var(--alpha-w) var(--right-w);
  align-items: start;
  gap: var(--deck-gap);
  justify-content: start;
  width: max-content;
}

.skbd-function-block,
.skbd-right-block {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.skbd-fn-grid,
.skbd-grid {
  display: grid;
  gap: var(--kg);
}
.skbd-fn-grid { grid-template-columns: repeat(2, var(--u)); }
.skbd-grid { grid-template-columns: repeat(var(--cols, 2), var(--u)); }

.skbd-alpha-block {
  display: flex;
  flex-direction: column;
  gap: var(--kg);
  width: var(--alpha-w);
}
.skbd-row {
  display: flex;
  gap: var(--kg);
}
.skbd-alpha-row {
  display: grid;
  grid-template-columns: repeat(60, var(--alpha-track));
  gap: 0;
  width: var(--alpha-w);
}
.skbd-alpha-row .skbd-key {
  width: calc(100% - var(--kg));
  min-width: 0;
  justify-self: start;
}
.skbd-right-block {
  display: flex;
  flex-direction: column;
  gap: var(--kg);
}

.skbd-numpad-toggle {
  display: none;
  min-height: 34px;
  border: 1px solid var(--case-deep);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--case-hi), var(--case-dark));
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.skbd-numpad-toggle[aria-expanded="true"] {
  border-color: var(--seal);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28),
              0 0 0 1px var(--seal-glow);
}

/* ---- the keycaps ---- */
.skbd-key {
  --w: 1;
  width: calc(var(--u) * var(--w));
  min-width: var(--u);
  height: var(--uh);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2px 3px;
  border: 1px solid #899198;
  border-radius: 7px 7px 5px 5px;
  background:
    linear-gradient(180deg, var(--keycap-hi) 0%, var(--keycap) 48%, var(--keycap-low) 100%);
  box-shadow: 0 2px 0 #767c82,
              0 3px 5px rgba(0, 0, 0, 0.24),
              inset 0 1px 0 rgba(255, 255, 255, 0.82),
              inset 0 -2px 3px rgba(0, 0, 0, 0.13);
  color: var(--ink);
  font-family: var(--ui-font);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  /* iOS: no gray tap flash, and no share-sheet callout interrupting the
     520ms hold that latches 取消/命令-style dual keys. */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  position: relative;
}
.skbd-grid .skbd-key { width: var(--u); }

.skcap-line {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
  line-height: 1.02;
}

.skcap-top {
  min-height: 10px;
  font-size: clamp(9px, 0.72vw, 11px);
  font-weight: 700;
  color: var(--key-blue);
}
.skcap-latin {
  font-size: clamp(16px, 1.18vw, 19px);
  font-weight: 750;
  color: var(--key-blue);
}
.skcap-red {
  font-size: clamp(12px, 0.95vw, 15px);
  font-weight: 750;
  color: var(--key-red);
}
.skcap-hint {
  font-size: clamp(7.5px, 0.60vw, 9px);
  font-weight: 700;
  color: var(--key-blue);
}
.skcap-green {
  font-size: clamp(10px, 0.88vw, 13px);
  font-weight: 750;
  color: var(--key-green);
}
.skcap-command {
  font-size: clamp(11px, 0.82vw, 14px);
  font-weight: 760;
  color: var(--key-black);
}
.skcap-padnum {
  font-size: clamp(18px, 1.3vw, 22px);
  font-weight: 680;
  color: var(--key-green);
}
.skcap-arrow {
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 800;
  color: var(--key-green);
}
.skcap-green-dot {
  font-size: clamp(16px, 1.2vw, 20px);
  font-weight: 800;
  color: var(--key-green);
}

.skcap-face {
  position: absolute;
  display: block;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.alpha-red,
.symbol-red {
  top: 5px;
  right: 7px;
  max-width: 56%;
  overflow: hidden;
  text-align: right;
  color: var(--key-red);
  font-size: clamp(11px, 0.82vw, 14px);
  font-weight: 760;
}
.alpha-main,
.symbol-main {
  left: 8px;
  bottom: 5px;
  width: 38%;
  overflow: hidden;
  text-align: left;
  color: var(--key-blue);
  font-size: clamp(18px, 1.32vw, 22px);
  font-weight: 520;
}
.alpha-hint {
  left: 43%;
  right: 5px;
  bottom: 5px;
  max-width: none;
  overflow: visible;
  text-align: right;
  color: var(--key-blue);
  font-size: clamp(6px, 0.50vw, 8px);
  font-weight: 780;
  line-height: 0.9;
  white-space: pre-line;
}
.skbd-key.has-long-hint .alpha-hint {
  bottom: 4px;
  font-size: clamp(5.8px, 0.46vw, 7.4px);
  line-height: 0.86;
}
.symbol-top {
  top: 5px;
  left: 8px;
  color: var(--key-blue);
  font-size: clamp(9px, 0.70vw, 11px);
  font-weight: 760;
}
.symbol-main {
  font-size: clamp(16px, 1.18vw, 20px);
}

.skbd-key.is-fn .skcap-main,
.skbd-key.is-fn .skcap-line {
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 650;
  color: var(--key-black);
}
.skbd-key.is-mod .skcap-command,
.skbd-key.is-enter .skcap-command,
.skbd-right-top .skcap-command {
  font-size: clamp(11px, 0.78vw, 13px);
}
.skbd-key.is-small .skcap-command {
  font-size: clamp(10px, 0.72vw, 12px);
}
.skbd-key.is-space {
  background:
    linear-gradient(180deg, var(--keycap-hi) 0%, var(--keycap) 48%, var(--keycap-low) 100%);
  border-color: #899198;
}

/* pressed / held */
.skbd-key.is-down,
.skbd-key:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #767c82,
              inset 0 2px 5px rgba(0, 0, 0, 0.34),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* latched modifier — the ONLY steady seal-red on the deck */
.skbd-key.is-latched {
  border-color: var(--seal);
  background: linear-gradient(180deg, #d8bfb6, #c9a99f);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.28),
              0 0 0 1px var(--seal-glow), 0 0 8px var(--seal-glow);
}
.skbd-key.is-latched .skcap-line { color: var(--seal); }

/* 拷屏 print key — a subtle seal-red ring so it reads as the print trigger */
.skbd-key.is-print {
  border-color: var(--seal);
  box-shadow: 0 2px 0 #767c82,
              0 3px 5px rgba(0, 0, 0, 0.24),
              inset 0 1px 0 rgba(255, 255, 255, 0.5),
              0 0 0 1px var(--seal-glow);
}
.skbd-key.is-print .skcap-command { color: var(--seal); }

.skbd-key.is-gap {
  visibility: hidden;
  background: none;
  border: none;
  box-shadow: none;
  cursor: default;
}

.soft-kbd.no-motion .skbd-key,
.soft-kbd.no-motion.is-open { transition: none; animation: none; }

/* =====================================================================
   Responsive: tablet/mobile single column and scaled physical keyboard.
   The main QWERTY block remains the same 60-column matrix at every size;
   only the surrounding blocks are allowed to stack around it.
   ===================================================================== */
@media (max-width: 1024px) {
  body { overflow: auto; }
  .machine {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 12px;
    gap: 10px;
  }
  .facia-main {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .platen { display: none; }
  .print-drawer { display: block; }
  .facia-top {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 4px 6px 10px;
  }
  .facia-top-right {
    flex: 1 1 360px;
    justify-content: flex-end;
    gap: 16px;
  }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .soft-kbd {
    --u: clamp(22px, 3.35vw, 36px);
    --uh: clamp(32px, 4.25vw, 43px);
    --kg: 4px;
    overflow-x: hidden;
    padding: 7px;
  }
  .skbd-inner {
    width: max-content;
    max-width: 100%;
    min-width: 0;
  }
  .skbd-alt-strip {
    gap: 12px;
    max-width: 100%;
  }
  .skbd-alt-label {
    min-height: 17px;
    padding: 2px 4px;
    overflow: hidden;
    text-overflow: clip;
    font-size: 9px;
  }
  .skbd-deck {
    gap: 12px;
    max-width: 100%;
  }
  .skbd-fn-grid {
    grid-template-columns: repeat(2, var(--u));
    justify-content: start;
  }
  .skbd-alpha-row {
    width: max-content;
    grid-template-columns: repeat(60, var(--alpha-track));
  }
  .skbd-key {
    border-radius: 6px 6px 4px 4px;
  }
  .alpha-red,
  .symbol-red {
    right: 5px;
    max-width: 58%;
    font-size: clamp(9px, 1.55vw, 13px);
  }
  .alpha-main,
  .symbol-main {
    left: 6px;
    font-size: clamp(15px, 2.25vw, 20px);
  }
  .alpha-hint {
    right: 4px;
    font-size: clamp(5.4px, 0.95vw, 7px);
  }
}

@media (max-width: 820px) {
  .soft-kbd {
    --u: clamp(24px, 9vw, 39px);
    --uh: clamp(38px, 11vw, 44px);
    --kg: 3px;
    width: 100%;
    padding: 6px;
    /* The fluid 60-column grid always fits the panel width here, so the
       scroll container is unnecessary — and any overflow-x value other than
       `visible` forces overflow-y to compute to `auto`, CLIPPING the
       pressed-key magnifier bubbles (::after) on the top key row. */
    overflow: visible;
  }
  .skbd-inner {
    width: 100%;
    align-items: stretch;
  }
  .skbd-alt-strip {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 6px;
    justify-items: stretch;
  }
  .skbd-alt-fn-spacer { display: none; }
  .skbd-alt-center {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(60, minmax(0, 1fr));
  }
  .skbd-alt-right {
    display: none;
    width: min(100%, 420px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--kg);
    justify-self: end;
  }
  .soft-kbd.is-numpad-open .skbd-alt-right {
    display: grid;
  }
  .skbd-deck {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
    justify-items: stretch;
  }
  .skbd-function-block {
    width: 100%;
  }
  .skbd-fn-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    width: 100%;
  }
  .skbd-alpha-block {
    width: 100%;
  }
  .skbd-alpha-row {
    display: grid;
    grid-template-columns: repeat(60, minmax(0, 1fr));
    width: 100%;
    gap: 0;
  }
  .skbd-alpha-row .skbd-key {
    width: calc(100% - var(--kg));
    flex: none;
  }
  .skbd-key {
    min-width: 0;
    transform-origin: center bottom;
  }
  .skbd-key .skcap-line,
  .skbd-key .skcap-face {
    display: none;
  }
  .skbd-key::before {
    content: attr(data-mobile);
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--key-blue);
    font-size: clamp(10px, 3.5vw, 18px);
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1;
    text-overflow: clip;
    white-space: nowrap;
  }
  .skbd-key.is-space::before {
    font-size: clamp(9px, 2.9vw, 13px);
    color: var(--key-green);
  }
  .skbd-key[data-mobile=""]::before {
    display: none;
  }
  .skbd-right-block .skbd-key::before,
  .skbd-key.is-print::before {
    color: var(--key-green);
  }
  .skbd-grid .skbd-key {
    width: 100%;
  }
  .skbd-numpad-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  .skbd-right-block {
    display: none;
    width: 100%;
    justify-items: center;
  }
  .soft-kbd.is-numpad-open .skbd-right-block {
    display: grid;
    grid-template-columns: 1fr;
  }
  .skbd-right-top,
  .skbd-right-pad {
    width: min(100%, 420px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .soft-kbd .skbd-key.is-down,
  .soft-kbd .skbd-key:active {
    z-index: 20;
    transform: translateY(-4px) scale(1.14);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.72),
                inset 0 -2px 3px rgba(0, 0, 0, 0.13);
  }
  .soft-kbd .skbd-key[data-mobile]::after {
    content: attr(data-mobile);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    min-width: max(40px, calc(100% + 12px));
    max-width: 96px;
    padding: 7px 9px 8px;
    transform: translateX(-50%) translateY(5px) scale(0.92);
    transform-origin: center bottom;
    border: 1px solid #899198;
    border-radius: 8px 8px 6px 6px;
    background: linear-gradient(180deg, var(--keycap-hi), var(--keycap));
    color: var(--key-blue);
    font-size: 20px;
    font-weight: 760;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.32),
                inset 0 1px 0 rgba(255, 255, 255, 0.82);
    transition: opacity 0.06s ease, transform 0.06s ease;
  }
  .soft-kbd .skbd-key.is-down[data-mobile]::after,
  .soft-kbd .skbd-key:active[data-mobile]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  .soft-kbd .skbd-key[data-mobile=""]::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .machine {
    padding: 8px;
    gap: 8px;
  }
  .wordmark {
    gap: 9px;
    flex-wrap: wrap;
  }
  .wordmark-seal { font-size: 24px; }
  .wordmark-model {
    font-size: 18px;
    letter-spacing: 0.12em;
  }
  .wordmark-sub {
    width: 100%;
    font-size: 9px;
    letter-spacing: 0.16em;
  }
  .facia-top-right {
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .top-actions {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 2;
  }
  .top-action {
    min-height: 38px;
    padding-inline: 8px;
  }
  .display-expand-action { grid-column: 1 / -1; }
  .power-cluster { gap: 10px; }
  .btn-glyph {
    width: 31px;
    height: 31px;
  }
  .facia-bottom {
    gap: 8px;
    padding: 8px 4px 2px;
  }
  .ctl-group { gap: 7px; }
  .ctl-status {
    width: 100%;
    margin-left: 0;
  }
  #status-readout {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  input[type="range"] { width: 72px; }
  .soft-kbd {
    --u: clamp(22px, 8.4vw, 34px);
    /* Keep phone keycaps at a finger-usable height even on small screens —
       the rows are fluid-width, so height is the touch-target lever here. */
    --uh: clamp(38px, 11.5vw, 42px);
  }
  .symbol-top,
  .symbol-red,
  .alpha-red {
    top: 4px;
  }
  .alpha-red,
  .symbol-red {
    right: 4px;
  }
  .alpha-main,
  .symbol-main {
    left: 5px;
    bottom: 4px;
  }
  .alpha-hint {
    left: 42%;
    right: 3px;
    bottom: 4px;
  }
  .skbd-key.has-long-hint .alpha-hint {
    bottom: 3px;
  }
}

/* =====================================================================
   Reduced motion — the platen head snaps; no boot shimmer
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .print-head { transition: none !important; }
  .boot-bar-fill { animation: none; width: 100%; margin-left: 0; }
  .skbd-key { transition: none !important; }
  .soft-kbd.is-open { animation: none !important; }
  * { scroll-behavior: auto !important; }
}
