/* ============================================================
   CURSOR WORKBENCH, HorizonX design system (light editor theme)
   One family (Inter), near-black and white, no accent colour.
   Chrome: #ececee canvas, white rounded panels, 14px gutters.
   Stage: #171717, because the cursors are light and glowing.
   Motion: opacity and transform only, HorizonX duration tokens.
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* HorizonX design tokens: every colour, radius and timing in the UI reads from here */
  --color-brand-navy: #171717;
  --color-brand-ink: #171717;
  --color-brand-ink-soft: #2a2a2a;
  --color-success: #1a8f5c;
  --color-error: #d03821;

  --ink: #111111;
  --ink-72: rgba(17, 17, 17, 0.72);
  --ink-62: rgba(17, 17, 17, 0.62);
  --ink-55: rgba(17, 17, 17, 0.55);
  --ink-50: rgba(17, 17, 17, 0.5);
  --ink-45: rgba(17, 17, 17, 0.45);
  --line: rgba(17, 17, 17, 0.07);
  --line-strong: rgba(17, 17, 17, 0.09);
  --line-hover: rgba(17, 17, 17, 0.16);
  --fill-1: rgba(17, 17, 17, 0.025);
  --fill-2: rgba(17, 17, 17, 0.04);
  --fill-3: rgba(17, 17, 17, 0.06);
  --track: rgba(17, 17, 17, 0.14);

  --canvas: #ececee;
  --panel: #ffffff;
  --stage: #171717;
  --stage-panel: #1c1c1c;

  --radius-panel: 1.25rem;
  --radius-md: 12px;
  --radius-chip: 100px;

  --shadow-panel: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 24px rgba(17, 17, 17, 0.05);

  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --duration-enter: 520ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-enter: cubic-bezier(0.33, 1, 0.68, 1);
  --motion-distance-sm: 12px;

  --font-display: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: var(--font-display);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: 14px;
  --rail-w: 300px;
  --insp-w: 300px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input { font: inherit; color: inherit; background: none; border: 0; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── shell ─────────────────────────────────────────────── */
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--insp-w);
  gap: var(--gutter);
  padding: var(--gutter);
}

.panel {
  min-height: 0;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.mbar { display: none; }

/* thin scrollbars, drawn like the HorizonX editor panels */
.panel-scroll { scrollbar-width: thin; scrollbar-color: var(--line-hover) transparent; }
.panel-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--line-hover); border-radius: 999px; }
.panel-scroll::-webkit-scrollbar-thumb:hover { background: rgba(17, 17, 17, 0.28); }
.panel-scroll--dark { scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
.panel-scroll--dark::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); }

/* ── segmented control (HorizonX "source type" group) ──── */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 4px; padding: 4px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  background: var(--fill-2);
  border-radius: var(--radius-md);
}
.seg button {
  min-height: 32px; padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px; font-weight: 500; line-height: 16px;
  color: rgba(17, 17, 17, 0.68);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.seg button:hover { background: rgba(17, 17, 17, 0.05); color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--ink); color: #fff; }
.seg__n { font-variant-numeric: tabular-nums; opacity: 0.55; margin-left: 2px; }
.seg--tabs button { min-height: 36px; font-size: 13px; }

.seg--dark { border-color: rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.04); }
.seg--dark button { color: rgba(255, 255, 255, 0.65); min-height: 30px; padding: 5px 12px; }
.seg--dark button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.seg--dark button[aria-selected="true"] { background: #fff; color: var(--color-brand-navy); }

/* ── buttons (HorizonX Button: rounded-full, fs-sm) ────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--color-brand-navy); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23, 23, 23, 0.24); }
.btn--outline { color: var(--color-brand-navy); border-color: rgba(23, 23, 23, 0.15); }
.btn--outline:hover { border-color: rgba(23, 23, 23, 0.35); box-shadow: 0 6px 18px rgba(23, 23, 23, 0.14); }
.btn--light { height: 34px; padding: 0 14px; font-size: 13px; background: #fff; color: var(--color-brand-navy); }
.btn--light:hover { background: rgba(255, 255, 255, 0.88); }
.btn--light svg { width: 14px; height: 14px; }
.btn--grow { flex: 1; }

.iconbtn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-strong);
  color: var(--ink-62);
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.iconbtn:hover { color: var(--ink); border-color: var(--line-hover); background: var(--fill-2); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn--dark { width: 34px; height: 34px; border-color: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }
.iconbtn--dark:hover { color: #fff; border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); }
.iconbtn--dark svg { width: 16px; height: 16px; }

/* inline status text in the source panel */
.status {
  font-size: 12px; font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.status.on { opacity: 1; }

/* ── catalogue rail ────────────────────────────────────── */
.rail__head { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--color-brand-navy); color: #fff;
}
.brand__mark svg { width: 17px; height: 17px; }
.brand__t { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }

.nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; }

.nav__group {
  display: flex; align-items: center; gap: 6px;
  padding: 16px 8px 8px;
  font-size: 11px; font-weight: 600; color: var(--ink-45);
}
.nav__group:first-child { padding-top: 4px; }
.nav__group b { font-weight: 500; color: rgba(17, 17, 17, 0.4); font-variant-numeric: tabular-nums; }

.item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 6px 8px; margin-bottom: 2px;
  text-align: left;
  border-radius: var(--radius-md); border: 1px solid transparent;
  color: var(--ink-72);
  transition: background-color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
  opacity: 0;
  animation: enter var(--duration-enter) var(--ease-enter) forwards;
}
.item:hover { background: rgba(17, 17, 17, 0.05); color: var(--ink); }
.item[aria-current="true"] { background: var(--fill-3); border-color: var(--line-hover); color: var(--ink); }
.item__ico {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--stage); color: #fff;
}
.item__ico svg { width: 18px; height: 18px; }
.item__ico[data-pixel="1"] svg { image-rendering: pixelated; }
.item__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__idx { font-size: 11px; font-weight: 500; color: rgba(17, 17, 17, 0.4); font-variant-numeric: tabular-nums; }

.rail__foot { padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.credit { font-size: 12px; line-height: 1.5; color: var(--ink-55); }
.credit a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(17, 17, 17, 0.25); text-underline-offset: 2px; }
.credit a:hover { text-decoration-color: currentColor; }

@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── stage ─────────────────────────────────────────────── */
.center {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: var(--stage);
  isolation: isolate;
}
.dot-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.075) 1px, transparent 1.2px);
  background-size: 18px 18px;
  background-position: center;
}

.stage {
  position: absolute; inset: 0;
  overflow: hidden; isolation: isolate;
  display: grid; place-items: center;
  color: #fff;
  touch-action: none;
}
.stage[data-hide].is-live,
.stage[data-hide].is-live * { cursor: none; }

.stage__hint {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.05);
  font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, 0.6);
  pointer-events: none; z-index: 8; white-space: nowrap;
  transition: opacity var(--duration-base) var(--ease-out);
}
.stage.is-live .stage__hint { opacity: 0; }

.stage__body {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; padding: 32px;
  animation: enter var(--duration-enter) var(--ease-enter) both;
}
.stage__title {
  font-weight: 600;
  font-size: clamp(1.75rem, calc(1.2rem + 1.6vw), 2.875rem); line-height: 1.05;
  letter-spacing: -0.035em; color: #fff;
}
.stage__note { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.45); }

.ghost-chip {
  padding: 11px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px;
  font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.8);
  transition: border-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.ghost-chip:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }

.demo-card {
  width: min(340px, 74vw); padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-panel);
  display: flex; flex-direction: column; gap: 28px; text-align: left;
  background: var(--stage-panel);
}
.demo-card b { font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: -0.02em; color: #fff; }
.demo-card i { font-style: normal; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, 0.45); }
.demo-pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  background: #fff; color: var(--color-brand-navy);
  font-size: 13px; font-weight: 500;
}

/* design preview */
.dsp { display: grid; place-items: center; gap: 24px; }
.dsp__art { transition: transform var(--duration-fast) var(--ease-out); }
.dsp__art.is-press { transform: scale(0.94); }
.dsp__art svg { width: 128px; height: 128px; }
.dsp__art[data-pixel="1"] svg { image-rendering: pixelated; }

/* ── settings panel ────────────────────────────────────── */
.insp__head { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.insp__eyebrow { font-size: 12px; font-weight: 500; color: var(--ink-50); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.insp__title {
  font-size: clamp(1.25rem, calc(1.16rem + 0.38vw), 1.5rem); font-weight: 600;
  line-height: 1.15; letter-spacing: -0.03em; color: var(--color-brand-navy);
  margin-bottom: 8px;
}
.insp__title.is-in { animation: enter var(--duration-enter) var(--ease-enter) both; }
.insp__desc { font-size: 13px; line-height: 1.55; color: var(--ink-62); }

.insp__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
.insp__foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

/* ── parameter groups ──────────────────────────────────── */
.grp + .grp, .ctl + .grp, .grp + .ctl { border-top: 1px solid var(--line); }
.grp__t {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 14px 0 10px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--ink-45);
  transition: color var(--duration-fast) var(--ease-out);
}
.grp__t:hover { color: var(--ink-62); }
.grp__t svg { width: 12px; height: 12px; flex: none; transition: transform 300ms var(--ease-out); }
.grp.is-folded .grp__t svg { transform: rotate(-90deg); }
.grp__n { font-weight: 500; color: rgba(17, 17, 17, 0.4); font-variant-numeric: tabular-nums; }
.grp.is-folded .grp__b { display: none; }
.grp__b { display: flex; flex-direction: column; gap: 16px; padding: 2px 0 16px; }

.insp__body > .ctl { padding: 14px 0; }
.ctl { display: flex; flex-direction: column; gap: 8px; }
.ctl__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; }
.ctl__lbl { font-size: 12px; font-weight: 500; color: var(--ink-50); }
.ctl__val {
  font-size: 12px; color: var(--ink-72); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%;
}
.ctl__val em { font-style: normal; color: var(--ink-45); margin-left: 1px; }
.ctl--empty { padding: 16px 0; font-size: 13px; color: var(--ink-55); }

/* range: the HorizonX .tool-range */
.tool-range {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 14px;
  background: transparent; cursor: pointer;
  --fill: 0%;
}
.tool-range::-webkit-slider-runnable-track {
  height: 3px; border-radius: 999px;
  background: linear-gradient(to right, var(--ink) var(--fill), var(--track) var(--fill));
}
.tool-range::-moz-range-track { height: 3px; border-radius: 999px; background: var(--track); }
.tool-range::-moz-range-progress { height: 3px; border-radius: 999px; background: var(--ink); }
.tool-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5.5px;
  border-radius: 50%; background: var(--ink); cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}
.tool-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); cursor: pointer; }
.tool-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.tool-range:focus-visible { outline: none; }
.tool-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.tool-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }

/* select rows hold 3 to 5 options inside the 300px panel */
.ctl .seg button { padding: 6px 4px; }

/* switch */
.sw {
  width: 36px; height: 20px; flex: none; border-radius: 999px;
  background: var(--track); position: relative;
  transition: background-color var(--duration-base) var(--ease-out);
}
.sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.2);
  transition: transform var(--duration-base) var(--ease-out);
}
.sw[aria-pressed="true"] { background: var(--ink); }
.sw[aria-pressed="true"]::after { transform: translateX(16px); }

/* colour: HorizonX swatch tiles */
.paint { display: flex; flex-direction: column; gap: 8px; }
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.swatch {
  height: 28px; min-width: 0;
  border-radius: 7px; border: 1px solid var(--line-strong);
  transition: box-shadow var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.swatch:hover { border-color: var(--line-hover); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.paint__row { display: flex; align-items: center; gap: 6px; }
.stop {
  position: relative; width: 36px; height: 36px; flex: none;
  border-radius: 7px; border: 1px solid var(--line-strong);
  overflow: hidden; cursor: pointer;
  transition: opacity var(--duration-base) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.stop:hover { border-color: var(--line-hover); }
.stop:has(:focus-visible) { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.stop.is-off { opacity: 0.3; }
.stop input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; opacity: 0; }
.stop span { display: block; width: 100%; height: 100%; }
.chip {
  margin-left: auto; height: 32px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--ink-72);
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.chip:hover { border-color: rgba(17, 17, 17, 0.3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* text field: HorizonX editor input */
.field {
  width: 100%; padding: 8px 12px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--fill-2);
  font-size: 13px; color: var(--ink);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.field:focus { outline: none; border-color: rgba(17, 17, 17, 0.3); }

/* ── source drawer (dark, sits on the stage) ───────────── */
.drawer {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 20;
  height: min(60%, 460px);
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--stage-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transform: translateY(var(--motion-distance-sm));
  visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base);
}
.drawer.open {
  opacity: 1; transform: none; visibility: visible;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out), visibility 0s;
}
.drawer__head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.drawer__t { margin-right: auto; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__body { overflow: auto; padding: 16px 18px 24px; }
.drawer__body pre {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  color: rgba(255, 255, 255, 0.62); tab-size: 2;
  white-space: pre-wrap; word-break: break-word;
}
.tok-key { color: #fff; }
.tok-str { color: rgba(255, 255, 255, 0.82); }
.tok-com { color: rgba(255, 255, 255, 0.4); }
.tok-fn  { color: rgba(255, 255, 255, 0.9); }
.tok-num { color: #fff; }

.scrim { display: none; }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 1279px) {
  :root { --rail-w: 260px; --insp-w: 288px; }
}

/* below lg the editor goes full-bleed, like the HorizonX editor on a phone */
@media (max-width: 1023px) {
  :root { --gutter: 0px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 44%);
    padding: 0; gap: 0;
  }
  .mbar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
  .mbar__t { flex: 1; min-width: 0; text-align: center; font-size: 14px; font-weight: 600; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .center { border-radius: 0; border: 0; }
  .insp { border-radius: 0; border: 0; border-top: 1px solid var(--line); box-shadow: none; }
  .insp__head { padding: 14px 16px 12px; }
  .insp__desc { display: none; }
  .insp__title { margin-bottom: 0; font-size: 20px; }
  .insp__body { padding: 0 16px 12px; }
  .insp__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .btn { height: 40px; }

  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
    width: min(320px, 86vw);
    border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform var(--duration-slow) var(--ease-out), visibility 0s linear var(--duration-slow);
  }
  body.nav-open .rail {
    transform: none; visibility: visible;
    transition: transform var(--duration-slow) var(--ease-out), visibility 0s;
  }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(17, 17, 17, 0.32);
    opacity: 0; pointer-events: none;
    transition: opacity var(--duration-slow) var(--ease-out);
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .drawer { left: 8px; right: 8px; bottom: 8px; height: calc(100% - 16px); }
  .drawer__head { flex-wrap: wrap; padding: 8px 8px 8px 14px; gap: 8px; }
  .drawer__t { flex-basis: calc(100% - 48px); }
  .status { order: 5; }
}

@media (max-width: 1023px) and (min-width: 700px) {
  .app { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto minmax(0, 1fr); }
  .mbar { grid-column: 1 / -1; }
  .insp { border-top: 0; border-left: 1px solid var(--line); }
  .insp__desc { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .item, .stage__body { opacity: 1; transform: none; }
}
