/* tools.tab4.dev: the toolbox rack. same hardware as tab4.dev, plus a daylight finish. */

@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Doto"; src: url("/assets/fonts/doto-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* the room and the metal */
  --room: #06020c;
  --wash-a: rgba(255, 42, 160, 0.07);
  --wash-b: rgba(46, 233, 255, 0.04);
  --wash-c: rgba(176, 38, 255, 0.1);
  --rail: #0e0617;
  --rail-hole: #030106;
  --metal: #140b20;
  --metal-raised: #1b1029;
  --recess: #0a0511;
  --screw: url("/assets/img/screw.svg");

  /* fields cut into the plate */
  --well: #08040d;
  --well-shadow: inset 0 0 0 1px rgba(214, 176, 255, 0.1);
  --well-line: rgba(214, 176, 255, 0.08);
  --line: rgba(214, 176, 255, 0.1);

  /* keycaps */
  --cap-top: #2c1a42;
  --cap-bottom: #1c1030;
  --cap-wall: #08040e;
  --cap-ink: #e8e2ff;
  --cap-hi: rgba(255, 255, 255, 0.15);
  --cap-legend-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
  --cap-cast: rgba(0, 0, 0, 0.85);

  /* ink on metal */
  --ink: #e8e2ff;
  --ink-2: #b2a7da;
  --ink-3: #8b7fb4;
  --acrylic: #f1eaff;
  --engrave: none;
  --link: #ffb54a;
  --err: #ff5cbd;
  --ok: #4dffa0;
  --focus: #2ee9ff;
  --select: #ff2aa0;
  --select-ink: #1a0010;
  --scrollbar: #3a2357;

  /* light sources */
  --vfd: #2ee9ff;
  --vfd-dim: rgba(46, 233, 255, 0.72);
  --vfd-soft: rgba(46, 233, 255, 0.5);
  --pink: #ff2aa0;
  --pink-phosphor: #ff5cbd;
  --violet: #b026ff;
  --green: #4dffa0;
  --amber: #ffb54a;

  --unit-shadow: inset 0 0 0 1px rgba(214, 176, 255, 0.08), 0 20px 40px -28px rgba(0, 0, 0, 0.8);
  --lifted: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 36px -10px rgba(0, 0, 0, 0.85);
  --stars: 1;
  --scan: rgba(0, 0, 0, 0.09);

  --display: "Doto", ui-monospace, monospace;
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --code: ui-monospace, "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;

  --gutter: clamp(12px, 3vw, 40px);
  --ear: 0px;
  --rack-max: 1280px;
  --radius: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --press: 90ms;

  color-scheme: dark;
}

/* daylight: the same rack in a bright room. the glass stays black. */
:root[data-theme="light"] {
  --room: #e6e1ee;
  --wash-a: rgba(255, 42, 160, 0.07);
  --wash-b: rgba(46, 233, 255, 0.1);
  --wash-c: rgba(176, 38, 255, 0.1);
  --rail: #c3bad3;
  --rail-hole: #8a7ea2;
  --metal: #f5f2f9;
  --metal-raised: #ffffff;
  --recess: #ebe6f2;
  --screw: url("/assets/img/screw-light.svg");

  --well: #ffffff;
  --well-shadow: inset 0 0 0 1px rgba(40, 20, 70, 0.16);
  --well-line: rgba(40, 20, 70, 0.1);
  --line: rgba(40, 20, 70, 0.12);

  --cap-top: #fdfcff;
  --cap-bottom: #e3dcef;
  --cap-wall: #a497bc;
  --cap-ink: #1b1226;
  --cap-hi: rgba(255, 255, 255, 0.95);
  --cap-legend-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  --cap-cast: rgba(50, 30, 80, 0.35);

  --ink: #1b1226;
  --ink-2: #43395a;
  --ink-3: #574c6d;
  --acrylic: #1b1226;
  --engrave: none;
  --link: #a8006a;
  --err: #a8006a;
  --ok: #0a6e3f;
  --focus: #5410b8;
  --select: #ff9fd4;
  --select-ink: #1b1226;
  --scrollbar: #a99cc2;

  --unit-shadow: inset 0 0 0 1px rgba(40, 20, 70, 0.08), 0 16px 32px -26px rgba(50, 30, 80, 0.35);
  --lifted: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 36px -12px rgba(50, 30, 80, 0.45);
  --stars: 0;
  --scan: transparent;

  color-scheme: light;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--scrollbar) var(--room);
  background:
    radial-gradient(60% 50% at 0% 0%, var(--wash-a), transparent 70%),
    radial-gradient(50% 55% at 100% 30%, var(--wash-b), transparent 70%),
    radial-gradient(70% 45% at 50% 105%, var(--wash-c), transparent 70%),
    var(--room);
  background-attachment: fixed;
}
body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
body::before {
  display: none;
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--stars);
  background:
    radial-gradient(circle at 23px 41px, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.6px) 0 0 / 230px 230px,
    radial-gradient(circle at 151px 97px, rgba(214, 176, 255, 0.7) 0 1px, transparent 1.6px) 0 0 / 310px 310px,
    radial-gradient(circle at 77px 260px, rgba(160, 240, 255, 0.6) 0 1.2px, transparent 1.8px) 0 0 / 470px 470px;
}
body::after {
  display: none;
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, var(--scan) 0 1px, transparent 1px 3px);
}
img, svg, video, canvas { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--select); color: var(--select-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
input, textarea { caret-color: var(--pink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--vfd); color: #021116; font-weight: 700; border-radius: 4px; text-decoration: none; }
.skip:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.num { font-variant-numeric: tabular-nums; }
code, kbd, samp { font-family: var(--code); font-size: 0.92em; }
kbd { padding: 1px 6px; border-radius: 4px; background: var(--well); box-shadow: var(--well-shadow); font-size: 0.8em; color: var(--ink-2); }

/* ---------- the rack ---------- */

.rack {
  position: relative;
  width: min(var(--rack-max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--ear);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.rack::before, .rack::after {
  display: none;
  content: "";
  position: absolute;
  top: -40px; bottom: -40px;
  width: calc(var(--ear) - 6px);
  background:
    repeating-linear-gradient(180deg, transparent 0 10px, var(--rail-hole) 10px 17px, transparent 17px 22px) center / 7px 100% no-repeat,
    var(--rail);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04), inset -1px 0 0 rgba(0, 0, 0, 0.3);
}
.rack::before { left: 3px; }
.rack::after { right: 3px; }
.rack > * { position: relative; z-index: 1; min-width: 0; }
.rack--top { padding-top: clamp(14px, 3vw, 34px); }
.rack--bottom { padding-bottom: clamp(30px, 5vw, 60px); margin-top: 18px; }

.unit {
  position: relative;
  background-color: var(--metal);
  border-radius: var(--radius);
  box-shadow: var(--unit-shadow);
  padding: clamp(22px, 3.4vw, 44px);
}
.unit::before, .unit::after {
  display: none;
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: var(--ear);
  background:
    var(--screw) center 14px / 15px no-repeat,
    var(--screw) center calc(100% - 14px) / 15px no-repeat,
    url("/assets/img/brushed.png") 0 0 / 320px 160px,
    var(--metal-raised);
  background-blend-mode: normal, normal, soft-light, normal;
}
.unit::before { left: calc(-1 * var(--ear)); border-radius: var(--radius) 0 0 var(--radius); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.07), inset -2px 0 3px -1px rgba(0, 0, 0, 0.45); }
.unit::after { right: calc(-1 * var(--ear)); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: inset -1px 1px 0 rgba(0, 0, 0, 0.2), inset 2px 0 3px -1px rgba(0, 0, 0, 0.45); }
.unit--short::before, .unit--short::after {
  background: var(--screw) center / 15px no-repeat, url("/assets/img/brushed.png") 0 0 / 320px 160px, var(--metal-raised);
  background-blend-mode: normal, soft-light, normal;
}

.engraved { color: var(--acrylic); text-shadow: var(--engrave); }
.unit-title { margin: 0; font-size: clamp(20px, 1.8vw, 24px); line-height: 1.1; font-weight: 720; font-stretch: 118%; letter-spacing: -0.01em; text-wrap: balance; }
.unit-lede { margin: 8px 0 0; color: var(--ink-2); max-width: 60ch; }
.unit-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 28px; margin-bottom: clamp(18px, 2.4vw, 28px); }
.unit-head > div { min-width: 0; }
.silk { font-size: 13px; font-weight: 600; font-stretch: 112%; color: var(--ink-3); letter-spacing: 0.02em; }
.muted { color: var(--ink-2); }
.prose-link, .panel p a, .field__hint a, .note a { color: var(--link); }

/* ---------- glass ---------- */

.vfd {
  position: relative;
  isolation: isolate;
  background-color: #020409;
  background-image: radial-gradient(rgba(46, 233, 255, 0.075) 0.9px, transparent 1.3px);
  background-size: 5px 5px;
  color: var(--vfd);
  font-family: var(--display);
  font-weight: 700;
  border-radius: 6px;
  text-shadow: 0 0 1px currentColor, 0 0 9px var(--vfd-soft), 0 0 28px rgba(46, 233, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(46, 233, 255, 0.12), inset 0 2px 10px rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  overflow: hidden;
  color-scheme: dark;
}
.vfd::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 28%, transparent 42%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  z-index: 2;
}
/* pink glass for faults */
.vfd--pink {
  background-color: #080209;
  background-image: radial-gradient(rgba(255, 42, 160, 0.08) 0.9px, transparent 1.3px);
  color: var(--pink-phosphor);
  text-shadow: 0 0 1px currentColor, 0 0 9px rgba(255, 42, 160, 0.55), 0 0 24px rgba(255, 42, 160, 0.22);
}
.vfd ::selection { background: var(--vfd); color: #021116; }

/* ---------- keys ---------- */

.key {
  --face: linear-gradient(180deg, var(--cap-top), var(--cap-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--face);
  color: var(--cap-ink);
  font-family: var(--text);
  font-size: 15px;
  font-weight: 620;
  font-stretch: 112%;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: var(--cap-legend-shadow);
  box-shadow: inset 0 1px 0 var(--cap-hi), 0 2px 0 var(--cap-wall);
  transition: transform var(--press) ease-out, box-shadow var(--press) ease-out, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.key:hover { filter: brightness(1.12); }
:root[data-theme="light"] .key:hover { filter: brightness(1.03); }
.key:active, .key.is-down {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 var(--cap-hi), 0 1px 0 var(--cap-wall);
}
.key:disabled, .key[aria-disabled="true"] { filter: none; opacity: 0.45; cursor: not-allowed; transform: none; }
.key .icon { width: 18px; height: 18px; }
.key--icon { width: 42px; padding: 0; }
.key--sm { min-height: 34px; padding: 0 12px; font-size: 14px; gap: 7px; }
.key--sm.key--icon { width: 34px; padding: 0; }
.key--sm .icon { width: 16px; height: 16px; }
.key--accent {
  --face: linear-gradient(180deg, #ff4fb6, #d1007c);
  color: #24000f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 0 #7a004a;
}
.key--accent:active, .key--accent.is-down { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 0 #7a004a; }
.keys { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- LEDs ---------- */

.led {
  --led: #2e1630;
  --led-on: var(--pink);
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s, box-shadow 0.2s;
}
:root[data-theme="light"] .led { --led: #c4a9c9; }
.led--green { --led: #13301f; --led-on: var(--green); }
.led--cyan { --led: #0f2a33; --led-on: var(--vfd); }
.led--amber { --led: #3a2c18; --led-on: var(--amber); }
.led--violet { --led: #24123a; --led-on: var(--violet); }
:root[data-theme="light"] .led--green { --led: #a9c9b6; }
:root[data-theme="light"] .led--cyan { --led: #a6c6cf; }
:root[data-theme="light"] .led--amber { --led: #d6c3a4; }
.led.is-on, .key[aria-pressed="true"] .led, .key[aria-current] .led {
  background: radial-gradient(circle at 40% 35%, #fff 0 12%, var(--led-on) 45%);
  box-shadow: 0 0 6px var(--led-on), 0 0 14px color-mix(in srgb, var(--led-on) 55%, transparent);
}
.led.is-blink { animation: blink 1.2s steps(2, jump-none) infinite; }
@keyframes blink { 50% { background: var(--led); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.7); } }

/* ---------- label tape ---------- */

.tape {
  --tape: #110a19;
  --tape-ink: #f4effc;
  display: inline-block;
  padding: 4px 9px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tape) 94%, #fff), var(--tape) 45%, color-mix(in srgb, var(--tape) 88%, #000));
  color: var(--tape-ink);
  font-size: 12.5px;
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 50%, 100% 100%, 0 100%, 3px 50%);
  transform: rotate(var(--tilt, 0deg));
  text-decoration: none;
  white-space: nowrap;
}
.tape--pink { --tape: #b0006f; }
.tape--violet { --tape: #6c16c9; }
.tape--cyan { --tape: #006478; }
.tape--white { --tape: #ddd6ec; --tape-ink: #1b1226; text-shadow: none; }
.tape--amber { --tape: #8a4a00; }

/* ---------- slide switch ---------- */

.switch {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  padding: 3px;
  border-radius: 8px;
  background: var(--well);
  box-shadow: var(--well-shadow);
  max-width: 100%;
}
.switch > * {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 640; font-stretch: 110%; font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.switch > :hover { color: var(--ink); }
.switch > [aria-pressed="true"], .switch > [aria-checked="true"], .switch > [aria-current] {
  background: linear-gradient(180deg, var(--cap-top), var(--cap-bottom));
  color: var(--cap-ink);
  box-shadow: inset 0 1px 0 var(--cap-hi), 0 2px 4px var(--cap-cast);
}
.switch .icon { width: 17px; height: 17px; }
.switch--icons > * { padding: 0 9px; }

/* ---------- fields ---------- */

.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .field > .field__label, .field legend { font-size: 13.5px; font-weight: 620; font-stretch: 108%; color: var(--ink-2); padding: 0; }
.field__hint { font-size: 13px; color: var(--ink-3); margin: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: var(--well);
  color: var(--ink);
  box-shadow: var(--well-shadow);
  font-size: 15px;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { outline: 2px solid var(--err); outline-offset: 1px; }
.input--num { font-variant-numeric: tabular-nums; }
.select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  background-color: var(--well);
  cursor: pointer;
}
.select option { background: var(--metal); color: var(--ink); }
.textarea {
  min-height: 220px;
  resize: vertical;
  font-family: var(--code);
  font-size: 14px;
  line-height: 1.55;
  padding: 12px 14px;
  tab-size: 4;
}
.textarea--prose { font-family: var(--text); font-size: 16px; }
.textarea[readonly] { color: var(--ink); }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > .input, .input-row > .select { flex: 1; min-width: 0; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit > .input { flex: 1; min-width: 0; }
.input-unit > span { color: var(--ink-3); font-size: 14px; }

/* checkbox as a small slide switch */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--ink); user-select: none; }
.check input {
  appearance: none; flex: none;
  width: 34px; height: 20px; margin: 0;
  border-radius: 10px;
  background: var(--well);
  box-shadow: var(--well-shadow);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.check input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(180deg, var(--cap-top), var(--cap-bottom));
  box-shadow: inset 0 1px 0 var(--cap-hi), 0 1px 2px var(--cap-cast);
  transition: transform 0.15s var(--ease-out);
}
.check input:checked { background: color-mix(in srgb, var(--pink) 70%, var(--well)); }
.check input:checked::after { transform: translateX(14px); }
.check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the fader from tab4.dev */
.fader { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; cursor: pointer; }
.fader::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: var(--well); box-shadow: var(--well-shadow); }
.fader::-moz-range-track { height: 8px; border-radius: 4px; background: var(--well); box-shadow: var(--well-shadow); }
.fader::-webkit-slider-runnable-track { height: 6px; }
.fader::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; border: 3px solid var(--pink); background: var(--metal-raised); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.fader::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--pink); background: var(--metal-raised); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.fader-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.5ch; align-items: center; gap: 12px; }
.fader-row output { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; color: var(--ink); }

.color-input { -webkit-appearance: none; appearance: none; width: 44px; height: 40px; padding: 4px; border: 0; border-radius: 6px; background: var(--well); box-shadow: var(--well-shadow); cursor: pointer; flex: none; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 3px; }
.color-input::-moz-color-swatch { border: 0; border-radius: 3px; }

/* ---------- top bar ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px 18px; padding: 12px clamp(14px, 2vw, 22px); flex-wrap: wrap; }
.topbar__brand { display: block; padding: 10px 16px 11px; font-size: 22px; line-height: 1; text-decoration: none; white-space: nowrap; }
.topbar__brand span { position: relative; z-index: 1; }
.topbar__brand .dim { color: var(--vfd-dim); }
.topbar__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.topbar__search { position: relative; display: flex; align-items: center; }
.topbar__search .icon { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.topbar__search .input { width: min(280px, 46vw); padding-left: 36px; min-height: 38px; }
.quick { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: min(420px, 86vw); padding: 6px; margin: 0; list-style: none; border-radius: 6px; background: var(--metal-raised); box-shadow: var(--lifted); max-height: 60vh; overflow: auto; }
.quick a { display: grid; gap: 1px; padding: 9px 11px; border-radius: 4px; text-decoration: none; }
.quick a small { color: var(--ink-3); font-size: 13px; }
.quick a:hover, .quick a[aria-selected="true"] { background: var(--recess); }
.quick__empty { padding: 10px 11px; color: var(--ink-2); font-size: 14px; }

/* ---------- home: the display ---------- */

.display { display: grid; gap: clamp(20px, 2.6vw, 30px); }
.display__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.model { margin: 0; font-size: clamp(22px, 2.4vw, 30px); line-height: 1; font-weight: 760; font-stretch: 125%; letter-spacing: -0.01em; }
.indicators { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.indicators li { display: inline-flex; align-items: center; gap: 8px; }
.display__intro { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 17px; }

.finder { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 18px; padding: clamp(10px, 1.4vw, 16px) clamp(14px, 2vw, 22px); }
.finder > * { position: relative; z-index: 1; }
.finder__field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.finder__prompt { font-size: clamp(20px, 2.2vw, 28px); line-height: 1; color: var(--vfd-dim); flex: none; }
.finder__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--vfd);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.1;
  text-shadow: inherit;
  caret-color: var(--vfd);
  padding: 4px 0;
}
.finder__input::placeholder { color: rgba(46, 233, 255, 0.62); text-shadow: none; opacity: 1; }
.finder__input:focus-visible { outline: none; }
.finder:focus-within { box-shadow: inset 0 0 0 1px #000, inset 0 3px 16px rgba(0, 0, 0, 0.95), 0 0 0 5px #0b0612, 0 0 0 7px var(--focus); }
.finder__input::-webkit-search-cancel-button { display: none; }
.finder__count { margin: 0; text-align: right; display: flex; align-items: baseline; gap: 7px; }
.finder__count b { font-size: clamp(18px, 1.8vw, 24px); line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.finder__count span { font-size: 13px; color: var(--vfd-dim); text-shadow: none; }

.display__keys { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.cat-keys { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-keys .key .icon { width: 17px; height: 17px; color: var(--ink-2); }

.shelf { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 18px; }
.shelf + .shelf { margin-top: 14px; }
.shelf__label { display: inline-flex; align-items: center; gap: 8px; min-width: 9ch; }
.shelf__items { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.shelf__items .key { font-size: 14px; }
.shelf__empty { color: var(--ink-3); font-size: 14px; margin: 0; }
.shelf__body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }

/* ---------- home: category units ---------- */

.cat-head { display: flex; align-items: center; gap: 14px; }
.cat-head__icon { width: 30px; height: 30px; color: var(--ink-2); flex: none; }
.cat-count { font-variant-numeric: tabular-nums; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tool-row { position: relative; display: grid; }
.tool-link {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 3px 12px;
  align-items: baseline;
  padding: 11px 44px 12px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}
.tool-link .led { transform: translateY(-2px); }
.tool-link__name { font-weight: 660; font-size: 16px; line-height: 1.25; }
.tool-link__desc { grid-column: 2; color: var(--ink-2); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-link:hover, .tool-link:focus-visible { background: var(--recess); }
.tool-link:hover .led, .tool-link:focus-visible .led { background: radial-gradient(circle at 40% 35%, #fff 0 12%, var(--led-on) 45%); box-shadow: 0 0 6px var(--led-on); }
.tool-link .tape { margin-left: 8px; vertical-align: 2px; font-size: 11px; padding: 2px 7px; }
.fav {
  position: absolute; top: 8px; right: 6px;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 0; border-radius: 5px;
  background: transparent;
  color: var(--ink-3);
}
.fav .icon { width: 18px; height: 18px; }
.fav:hover { color: var(--ink); background: var(--recess); }
.fav[aria-pressed="true"] { color: var(--pink); }
:root[data-theme="light"] .fav[aria-pressed="true"] { color: #c4007d; }
.no-results { margin: 0; padding: 6px 2px; color: var(--ink-2); }

/* ---------- tool page ---------- */

.tool-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: start; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 12px; padding: 0; list-style: none; font-size: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs li + li::before { content: "/"; color: var(--ink-3); margin-right: 10px; }
.page-title { margin: 0; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.02; font-weight: 780; font-stretch: 122%; letter-spacing: -0.015em; text-wrap: balance; }
.tool-desc { margin: 10px 0 0; color: var(--ink-2); font-size: 17px; max-width: 64ch; }
.tool-head__keys { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.bench { margin-top: clamp(22px, 3vw, 34px); display: grid; gap: 22px; }
.bench--side { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; }
.bench--calc { grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); align-items: start; }
.bench--calc .readouts { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.bench__col { display: grid; gap: 18px; min-width: 0; align-content: start; }

/* an inset panel holding a tool's controls */
.panel { display: grid; gap: 16px; padding: 18px; border-radius: 10px; background: var(--recess); min-width: 0; }
.panel__title { margin: 0; font-size: 15px; font-weight: 700; font-stretch: 115%; color: var(--ink); }
.panel--row { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); align-items: end; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* the input bay: where files are dropped */
.bay {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 28px 20px;
  border-radius: 10px;
  border: 2px dashed color-mix(in srgb, var(--ink-3) 55%, transparent);
  background: var(--recess);
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.bay--compact { min-height: 120px; padding: 20px; }
.bay__icon { width: 34px; height: 34px; color: var(--ink-3); }
.bay__title { margin: 0; font-size: 17px; font-weight: 680; font-stretch: 110%; }
.bay__hint { margin: 0; font-size: 14px; color: var(--ink-3); }
.bay .led { display: none; }
.bay:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bay:hover { border-color: var(--ink-2); }
.bay.is-over { border-color: var(--vfd); background: color-mix(in srgb, var(--vfd) 8%, var(--recess)); }
.bay.is-over .led { background: radial-gradient(circle at 40% 35%, #fff 0 12%, var(--vfd) 45%); box-shadow: 0 0 6px var(--vfd), 0 0 14px var(--vfd-soft); }
.bay input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* the file list */
.files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--recess) 70%, transparent);
}
.file__thumb { width: 44px; height: 44px; border-radius: 3px; object-fit: cover; background: var(--well); }
.file__body { min-width: 0; display: grid; gap: 1px; }
.file__name { font-weight: 620; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__meta { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__meta .good { color: var(--ok); }
.file__meta .bad { color: var(--err); }
.file__keys { display: flex; gap: 6px; align-items: center; }
.file__state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.file.is-error .file__meta { color: var(--err); }

/* the status strip: the machine says what it's doing */
.status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.status__glass { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 18px; padding: 11px 16px; min-height: 48px; grid-column: 1 / 3; }
.status__glass > * { position: relative; z-index: 1; }
.status__text { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.status__pct { font-size: 18px; font-variant-numeric: tabular-nums; }
.meter { grid-column: 1 / -1; height: 10px; border-radius: 2px; background: repeating-linear-gradient(90deg, rgba(46, 233, 255, 0.09) 0 8px, transparent 8px 11px); overflow: hidden; }
.meter__fill { height: 100%; width: 0%; background: repeating-linear-gradient(90deg, var(--vfd) 0 8px, transparent 8px 11px); box-shadow: 0 0 12px rgba(46, 233, 255, 0.35); transition: width 140ms linear; }
.meter.is-indeterminate .meter__fill { width: 30%; animation: sweep 1.3s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* results */
.results { display: grid; gap: 12px; }
.results__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.results__head h2 { margin: 0; font-size: 17px; font-weight: 700; font-stretch: 112%; }

.preview { display: grid; place-items: center; padding: 14px; border-radius: 8px; background: var(--well); box-shadow: var(--well-shadow); min-height: 160px; overflow: hidden; }
.preview img, .preview canvas { max-height: 520px; width: auto; height: auto; object-fit: contain; }
.checker { background-color: #d9d4e2; background-image: conic-gradient(#b9b2c6 25%, transparent 0 50%, #b9b2c6 0 75%, transparent 0); background-size: 18px 18px; }

/* calculators and stats: readouts on glass */
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 0; padding: 6px 0; }
.readouts > * { position: relative; z-index: 1; }
.readout { margin: 0; padding: 12px 18px; display: grid; gap: 4px; min-width: 0; align-content: start; }
.readout__label { font-size: 15px; color: var(--vfd-dim); text-shadow: none; font-weight: 700; }
.readout__value { font-size: clamp(20px, 2vw, 27px); line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.readout--big { grid-column: 1 / -1; }
.readout--big .readout__value { font-size: clamp(30px, 3.6vw, 48px); }
.readout__sub { font-size: 15px; color: var(--vfd-dim); text-shadow: none; overflow-wrap: anywhere; }

/* data tables */
.table-wrap { overflow-x: auto; border-radius: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--well-line); vertical-align: top; }
.table th { color: var(--ink-2); font-weight: 620; font-stretch: 108%; white-space: nowrap; }
.table td { overflow-wrap: anywhere; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: color-mix(in srgb, var(--recess) 60%, transparent); }
.table code { font-size: 13.5px; }

.out-code { margin: 0; padding: 14px 16px; border-radius: 6px; background: var(--well); box-shadow: var(--well-shadow); font-family: var(--code); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow: auto; }

/* inline notice lines */
.note { display: flex; gap: 10px; align-items: baseline; margin: 0; font-size: 14.5px; color: var(--ink-2); }
.note .led { transform: translateY(-1px); }
.note--err { color: var(--err); }

/* swatches for the palette tool */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.swatch { display: grid; border-radius: 6px; overflow: hidden; background: var(--well); box-shadow: var(--well-shadow); }
.swatch__chip { aspect-ratio: 4 / 3; border: 0; cursor: pointer; }
.swatch__chip:focus-visible { outline-offset: -4px; }
.swatch__text { padding: 8px 10px; display: grid; gap: 1px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.swatch__text b { font-size: 14.5px; }

/* the privacy plate */
.plate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px clamp(24px, 4vw, 56px); align-items: start; padding-block: clamp(18px, 2.4vw, 28px); }
.plate h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; font-stretch: 115%; display: flex; align-items: center; gap: 10px; }
.plate p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 52ch; }
.plate .keys .key { font-size: 14px; }

/* the rear panel */
.rear { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding-block: 22px; }
.rear p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.rear nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.rear nav a { color: var(--ink-2); font-size: 14.5px; font-weight: 600; font-stretch: 108%; }
.rear nav a:hover { color: var(--ink); }

/* toast for "copied" and friends */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 95; transform: translate(-50%, 20px); opacity: 0; padding: 11px 18px; border-radius: 6px; background: var(--metal-raised); color: var(--ink); box-shadow: var(--lifted); font-weight: 620; font-size: 15px; transition: transform 0.2s var(--ease-out), opacity 0.2s; pointer-events: none; display: flex; gap: 10px; align-items: center; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* text tool layout */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.split > .field .textarea { min-height: 320px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.toolbar .field { display: flex; align-items: center; gap: 8px; }
.toolbar .field > label { white-space: nowrap; }
.toolbar .select, .toolbar .input { width: auto; min-height: 36px; }

/* rendered markdown */
.md-out { padding: 18px 22px; border-radius: 6px; background: var(--well); box-shadow: var(--well-shadow); min-height: 320px; max-height: 70vh; overflow: auto; line-height: 1.6; font-size: 16px; }
.md-out > :first-child { margin-top: 0; }
.md-out pre { background: var(--recess); padding: 12px 14px; border-radius: 6px; overflow: auto; }
.md-out code { font-family: var(--code); }
.md-out a { color: var(--link); }
.md-out img { max-width: 100%; }
.md-out table { border-collapse: collapse; }
.md-out th, .md-out td { border: 1px solid var(--well-line); padding: 6px 10px; }
.md-out blockquote { margin: 0; padding-left: 14px; box-shadow: inset 2px 0 0 var(--ink-3); color: var(--ink-2); }

/* diff */
.diff { margin: 0; padding: 14px 16px; border-radius: 6px; background: var(--well); box-shadow: var(--well-shadow); font-family: var(--code); font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; }
.diff ins { text-decoration: none; background: rgba(77, 255, 160, 0.18); color: var(--ink); }
.diff del { text-decoration: line-through; text-decoration-color: rgba(255, 92, 189, 0.7); background: rgba(255, 42, 160, 0.18); color: var(--ink); }
:root[data-theme="light"] .diff ins { background: rgba(10, 160, 90, 0.18); }
:root[data-theme="light"] .diff del { background: rgba(200, 0, 110, 0.14); }
.diff-line { display: block; padding: 0 6px; }
.diff-line.is-add { background: rgba(77, 255, 160, 0.12); }
.diff-line.is-del { background: rgba(255, 42, 160, 0.12); }

/* regex highlighting */
.hl { margin: 0; padding: 12px 14px; border-radius: 6px; background: var(--well); box-shadow: var(--well-shadow); font-family: var(--code); font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 120px; max-height: 50vh; overflow: auto; }
.hl mark { background: rgba(46, 233, 255, 0.22); color: inherit; border-radius: 2px; box-shadow: 0 0 0 1px rgba(46, 233, 255, 0.45); }
.hl mark:nth-of-type(even) { background: rgba(255, 42, 160, 0.22); box-shadow: 0 0 0 1px rgba(255, 42, 160, 0.45); }
:root[data-theme="light"] .hl mark { background: rgba(0, 120, 150, 0.18); box-shadow: 0 0 0 1px rgba(0, 100, 120, 0.4); }
:root[data-theme="light"] .hl mark:nth-of-type(even) { background: rgba(200, 0, 110, 0.14); box-shadow: 0 0 0 1px rgba(160, 0, 90, 0.35); }

/* pdf page tiles */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.page-tile { position: relative; display: grid; gap: 8px; padding: 8px; border-radius: 6px; background: color-mix(in srgb, var(--recess) 70%, transparent); user-select: none; touch-action: none; }
.page-tile__sheet { display: grid; place-items: center; aspect-ratio: 1 / 1.3; background: var(--well); border-radius: 3px; overflow: hidden; }
.page-tile canvas { max-width: 100%; max-height: 100%; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.8); background: #fff; transition: transform 0.2s var(--ease-out); }
.page-tile__bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.page-tile__bar .keys { gap: 4px; }
.page-tile.is-selected { box-shadow: 0 0 0 2px var(--pink); }
.page-tile.is-removed .page-tile__sheet { opacity: 0.25; }
.page-tile.is-removed .page-tile__bar span:first-child { text-decoration: line-through; }
.page-tile.is-dragging { opacity: 0.4; }
.page-tile.is-target { box-shadow: -4px 0 0 var(--vfd); }
.page-tile__grip { cursor: grab; }

/* crop stage */
.crop-stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; }
.crop-stage img { max-height: 62vh; width: auto; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(6, 2, 12, 0.62); outline: 2px solid var(--vfd); cursor: move; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 33.33% 0; border-block: 1px solid rgba(46, 233, 255, 0.4); pointer-events: none; }
.crop-box::after { inset: 0 33.33%; border-block: 0; border-inline: 1px solid rgba(46, 233, 255, 0.4); }
.crop-handle { position: absolute; width: 16px; height: 16px; margin: -8px; background: var(--vfd); border-radius: 2px; box-shadow: 0 0 0 2px #021116; }
.crop-handle[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-handle[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-wrap { display: grid; place-items: center; padding: 14px; border-radius: 8px; background: var(--well); box-shadow: var(--well-shadow); overflow: hidden; }

/* inline confirm */
.confirm { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }

/* QR */
.qr-out { display: grid; place-items: center; padding: 18px; border-radius: 8px; background: var(--well); box-shadow: var(--well-shadow); }
.qr-out img, .qr-out canvas { image-rendering: pixelated; width: min(320px, 100%); height: auto; }
.qr-video { width: 100%; max-height: 420px; border-radius: 6px; background: #000; object-fit: cover; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .bench--side, .bench--calc { grid-template-columns: 1fr; }
  .plate { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .textio > .toolbar { order: -2; }
  .textio > .status { order: -1; }
  .split > .field .textarea { min-height: 200px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --ear: 0px; }
  .rack { width: 100%; padding-inline: 10px; gap: 12px; }
  .rack::before, .rack::after, .unit::before, .unit::after { display: none; }
  .unit { padding: 20px 16px; }
  .topbar { padding: 12px; }
  .topbar__brand { font-size: 19px; padding: 9px 13px; }
  .topbar__tools { display: contents; }
  .topbar__search { order: 3; flex: 1 1 100%; }
  .topbar__search .input { width: 100%; }
  .finder { grid-template-columns: 1fr; }
  .finder__count { text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .tool-head { grid-template-columns: 1fr; }
  .tool-head__keys { justify-content: flex-start; }
  .shelf { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .status { grid-template-columns: minmax(0, 1fr) auto; }
  .status__glass { grid-column: 1 / 2; }
}
@media (max-width: 420px) {
  .grid-3 { grid-template-columns: 1fr; }
  .key { padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media print {
  body::before, body::after, .topbar, .plate, .rear { display: none; }
}
.rot90 .icon { transform: rotate(90deg); }

/* ---------- simpler shell: plain sections between the panels ---------- */

.unit.cat { background: none; box-shadow: none; padding: clamp(18px, 2.6vw, 30px) 0 4px; border-radius: 0; }
.unit.cat .unit-head { padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); align-items: center; }
.unit.cat .unit-lede { margin-top: 4px; font-size: 15px; }
.cat-head__icon { width: 24px; height: 24px; }
.tool-link { padding-left: 10px; }
#shelves { padding-block: 18px; }
.unit.plate { background: none; box-shadow: none; padding: 8px 0 0; border-top: 1px solid var(--line); border-radius: 0; }
.unit.rear { background: none; box-shadow: none; padding: 18px 0 0; border-top: 1px solid var(--line); border-radius: 0; }
.unit.topbar { padding: 10px 14px; }
.topbar__brand { font-size: 19px; padding: 9px 14px 10px; }
.page-title, .model { font-stretch: 115%; }
.finder { border-radius: 12px; }
.status__glass { min-height: 44px; padding: 10px 16px; }
.status__text { font-size: 17px; }
.files .file, .page-tile { background: var(--recess); }
.file__thumb { border-radius: 6px; }
header.rack--top { margin-bottom: 18px; }
@media (max-width: 720px) { header.rack--top { margin-bottom: 12px; } }
/* the header and its finder dropdown sit above the page panels */
header.rack--top { position: relative; z-index: 20; }
