/* Dither Studio - the console stylesheet.
 *
 * House style (DESIGN.md): a dark instrument panel. The chrome is a compact
 * rail of collapsible stations - Source, Press, Tone, Ink, Detail, Effects,
 * Motion, Type, Presets - and the proof sheet is the hero. Density and
 * grouping follow how professional dithering tools organise themselves
 * (arrow-stepped algorithm browsing, an additive reorderable effects stack,
 * a viewport-bottom Full/Live/Still update control); the tokens, the mono
 * face and the hairlines are the house's own.
 */

:root {
  /* The publicity site's own palette: void, press panel, ivory type, lapis
     ink. The console keeps its dark instrument-panel character, but it is the
     same room as the page that frames it. */
  --bg: #0B0D12;        /* page ground            */
  --panel: #121722;     /* rails, headers          */
  --panel-2: #1a2030;   /* controls, raised chips  */
  --line: #2a3346;      /* hairlines and borders   */
  --text: #EFEADF;      /* primary text            */
  --muted: #9099AB;     /* labels, secondary text  */
  --accent: #7E93BE;    /* lapis, the single accent */
  --radius: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "SF Mono", "Cascadia Code", Consolas, "JetBrains Mono", Menlo, monospace;

  /* Local, non-forked refinements: the well the artifact sits in, and the
     measured heights that keep every control on the same rhythm. */
  --well: #080a0f;
  --row: 26px;
  --gap: 7px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/* Mobile Safari collapses its own toolbar, which makes 100% of the *short*
   viewport clip the bottom bar on the way out. Ask for the dynamic viewport
   where it exists; on a desktop the two are the same number. */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}

body {
  margin: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--font);
  overflow: hidden;
}

/* An author `display` must never defeat the `hidden` attribute. */
[hidden] { display: none !important; }

/* ---------- the rail ---------- */

.panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.rail-head { padding: 14px 14px 8px; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.brand-mark {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.brand span { color: var(--accent); }

.tagline {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* The demo says what it is before the first slider: a shop window on a desktop,
   the whole recipe shelf on a phone or tablet. */
.demo-promo {
  margin: 9px 0 0;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.demo-promo-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.demo-promo a,
.demo-limits a {
  display: inline-block;
  margin-top: 3px;
  color: var(--accent);
  text-decoration: none;
}

.demo-promo a:hover,
.demo-limits a:hover { text-decoration: underline; }

.demo-limits {
  margin: 2px 0 0;
  padding: 8px 9px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.demo-limits b { color: var(--text); }

/* The console bar. On a phone the rail collapses to this one row, so it is off
   by default and the phone layer below turns it on. Its note carries the open
   station's own summary, which is what makes a collapsed bar worth reading. */
.console-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 110ms var(--ease-out), background 140ms ease, border-color 140ms ease;
}

.console-toggle-label {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.console-toggle-note {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel[data-console="closed"] .console-toggle .caret { transform: rotate(-90deg); }

/* Section jump strip: the rail is long, so the stations are also a row of
   chips. Click scrolls the station open; the visible one is marked. */
/* Five columns and two rows: every station reachable at a glance, and the
   strip stays short enough to leave the rail its height. */
.jump {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 0 10px 9px;
  border-bottom: 1px solid var(--line);
}

.jump-chip {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  padding: 4px 1px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 10.5px/1.4 var(--font);
  letter-spacing: -0.03em;
  text-align: center;
  text-overflow: ellipsis;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 110ms var(--ease-out), color 140ms ease, border-color 140ms ease;
}

.jump-chip:hover { color: var(--text); border-color: var(--line); }

.jump-chip[aria-current="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.rail-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px 12px;
  scroll-behavior: smooth;
}

.rail-hint {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.rail-hint b { color: var(--text); }

/* ---------- stations (collapsible groups) ---------- */

.group { border-bottom: 1px solid var(--line); }

.group:last-child { border-bottom: none; }

.group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 2px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.group-head:active { background: color-mix(in srgb, var(--accent) 9%, transparent); }

.group-head:hover .group-name { color: var(--accent); }

.group-name {
  flex: 0 0 auto;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 140ms ease;
}

.group-note {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--muted);
}

.caret {
  flex: 0 0 auto;
  width: 9px;
  font-size: 9px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.group[data-open="false"] .caret { transform: rotate(-90deg); }

.group-body {
  display: grid;
  gap: var(--gap);
  padding: 2px 2px 12px;
}

.group[data-open="false"] .group-body { display: none; }

.group-body > .hint { margin: 1px 0 0; }

/* ---------- rows ---------- */

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.buttons-1 { grid-template-columns: 1fr; }

.field {
  display: grid;
  gap: 2px;
}

.field > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.field > span > em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.check input { accent-color: var(--accent); }

.hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.hint b { color: var(--text); font-weight: 600; }

/* stepper rows: select + ◀ ▶, the way pro tools let you browse a list */
.row-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px 24px;
  gap: 4px;
}

.btn-step {
  padding: 0;
  height: var(--row);
  font-size: 9px;
  line-height: 1;
}

.seed-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px 0 1px;
}

.swatch {
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* ---------- controls ---------- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  margin: 0;
  background: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  height: var(--row);
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

select { cursor: pointer; }

input[type="color"] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  cursor: pointer;
}

.ink-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.btn {
  height: var(--row);
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: transform 110ms var(--ease-out), border-color 140ms ease, color 140ms ease;
}

.btn:hover { border-color: var(--accent); }

.btn:active { filter: brightness(0.94); transform: scale(0.98); }

.seg-btn:active,
.jump-chip:active,
.icon-btn:active,
.console-toggle:active { transform: scale(0.98); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn:disabled:hover { border-color: var(--line); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0B0D12;
  font-weight: 700;
}

.btn-primary:hover { filter: brightness(1.1); }

.btn-mini { height: 24px; padding: 0 8px; font-size: 12px; }

/* segmented control: one choice out of three, no dropdown round-trip */
.seg {
  display: inline-flex;
  height: var(--row);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.seg-btn {
  padding: 0 9px;
  border: none;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: transform 110ms var(--ease-out), background 140ms ease, color 140ms ease;
}

.seg-btn:first-child { border-left: none; }

.seg-btn:hover { color: var(--text); }

.seg-btn.is-on { background: var(--panel-2); color: var(--accent); font-weight: 600; }

/* ---------- effects stack ---------- */

.stack { display: grid; gap: 5px; }

.stack-row {
  display: grid;
  gap: 3px;
  padding: 6px 7px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.stack-top {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.stack-index {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.stack-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.stack-tools { display: flex; gap: 3px; }

.icon-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: transform 110ms var(--ease-out), color 140ms ease, border-color 140ms ease;
}

.icon-btn:hover { color: var(--text); border-color: var(--line); }

.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.stack-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.stack-row select { width: auto; min-width: 84px; height: 21px; font-size: 11.5px; }

.stack-empty {
  padding: 6px 2px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- stage ---------- */

.stage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
}

.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 11.5px;
  color: var(--muted);
}

.statusbar b { color: var(--text); font-weight: 600; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
}

.grow { flex: 1 1 auto; }

.readout { font-size: 11.5px; }

.readout,
.statusbar b,
.group-note,
.field em,
.stack-index { font-variant-numeric: tabular-nums; }

.canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
  background-color: var(--well);
  /* A press-bed dot grid under the proof, so an empty stage still reads as
     part of the instrument rather than a hole in the page. */
  background-image: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 1px, transparent 1.2px);
  background-size: 18px 18px;
}

/* The canvas owns touch gestures; this says so once, on the devices where
   there is no keyboard hint to explain it. */
.gesture-hint { display: none; }

.canvas-frame {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px;
}

#canvas {
  image-rendering: pixelated;
  background:
    repeating-conic-gradient(#141519 0% 25%, #0f1014 0% 50%) 50% / 16px 16px;
  box-shadow: 0 0 0 1px var(--line);
  cursor: grab;
}

#canvas.alpha-on {
  background:
    repeating-conic-gradient(#1b1e26 0% 25%, #14161c 0% 50%) 50% / 16px 16px;
}

#canvas.panning { cursor: grabbing; }

.canvas-wrap.drag-over { outline: 1px dashed var(--accent); outline-offset: -6px; }

/* viewport bar: update mode on the left, playback in the middle, state right */
.viewport-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 11px;
  color: var(--muted);
}

.transport { display: flex; align-items: center; gap: 6px; }

/* The footer's one way out of the page: the author's GitHub profile. */
.github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out),
    background 120ms var(--ease-out);
}

.github-link:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-2);
}

.github-link svg { display: block; }

.portfolio-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 120ms var(--ease-out);
}

.portfolio-link:hover {
  color: var(--text);
}

.portfolio-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- states ---------- */

:focus-visible,
.btn:focus-visible,
.seg-btn:focus-visible,
.jump-chip:focus-visible,
.icon-btn:focus-visible,
.group-head:focus-visible,
.check input:focus-visible,
.field select:focus-visible,
.field input:focus-visible,
.inline select:focus-visible,
.stack-row select:focus-visible,
input[type="color"]:focus-visible,
.github-link:focus-visible,
#canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--accent); color: #0B0D12; }

/* keep the bar honest on short windows */
@media (max-height: 620px) {
  .tagline { display: none; }
}

/* -------------------------------------------------------------------- */
/* responsive: the same console, contracted (DESIGN.md)                   */
/*                                                                        */
/* Three layers, in the order they overlap:                               */
/*   - pointer: coarse: bigger targets and thumbs (the iPad/phone layer). */
/*   - the tablet range: the rail takes the width touch labels need.      */
/*   - under 720px: the console collapses to its bar and the proof leads.  */
/* -------------------------------------------------------------------- */

@media (pointer: coarse) {
  /* Every control a finger has to hit, at a size a finger can hit. */
  .btn,
  select,
  input[type="number"],
  input[type="text"] { min-height: 38px; }

  .btn { font-size: 13px; }
  .btn-mini { min-height: 34px; }
  .btn-step { height: 38px; font-size: 11px; }
  .seg { height: 38px; }
  .seg-btn { padding: 0 12px; }
  input[type="color"] { width: 34px; height: 30px; }

  .group-head { padding: 12px 2px; }
  .jump-chip { min-height: 32px; padding: 4px 1px; font-size: 10.5px; }

  /* A slider is a control, not a hairline: thicken the track and grow the
     thumb, or it cannot be caught and dragged. */
  input[type="range"] { height: 28px; }
  input[type="range"]::-webkit-slider-runnable-track { height: 4px; }
  input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; }
  input[type="range"]::-moz-range-track { height: 4px; }
  input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; }

  .check { min-height: 34px; font-size: 12.5px; }
  .check input { width: 17px; height: 17px; }

  .icon-btn { width: 30px; height: 30px; font-size: 12px; }
  .github-link { width: 34px; height: 34px; }
  .stack-row { padding: 8px 9px 7px; }
  .stack-row select { height: 32px; min-width: 96px; }

  /* Double-tap is the browser's zoom, not ours. */
  button, select, input, label, .jump-chip, .group-head { touch-action: manipulation; }

  /* The keyboard hints are a lie on a device with no keyboard; the Compare
     button and the toolbar carry the same verbs. */
  .rail-hint { display: none; }

  /* The statusbar is one signature line on touch, scrolling sideways if it
     must: stacking it would cost the proof two rows of height. */
  .statusbar {
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .statusbar::-webkit-scrollbar { display: none; }
  .statusbar > span { flex: 0 0 auto; }

  /* Installed to the home screen, the console runs full-bleed on a notched
     iPad: keep the bottom bar clear of the home indicator. */
  .viewport-bar { padding-bottom: calc(7px + env(safe-area-inset-bottom)); }

  /* The canvas owns its gestures: one finger pans, two fingers pinch the
     zoom ladder. Letting the browser have them instead would scroll the page
     under the proof and zoom the whole console mid-gesture. */
  #canvas { touch-action: none; }
}

/* iPad, both ways up: the rail carries touch labels, so it takes a little
   more width than the desktop rail and the bars breathe. A short window is
   excluded: it belongs to the phone layer above, whatever its width. */
@media (min-width: 721px) and (max-width: 1180px) and (min-height: 521px) and (pointer: coarse) {
  body { grid-template-columns: 272px minmax(0, 1fr); }
  .rail-head { padding: 16px 16px 10px; }
  .statusbar,
  .toolbar,
  .viewport-bar { padding-left: 16px; padding-right: 16px; }
}

/* Phones: the console collapses to its bar. The proof keeps the lead, and a
         tap on the bar grows the rail in place - the stage shrinks, nothing is
         covered up and nothing is a modal. */
@media (max-width: 720px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }

  .panel {
    order: 1;
    grid-template-rows: auto auto minmax(0, 1fr);
    max-height: none;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .stage { order: 2; }

  .rail-head { padding: 11px 12px 10px; }
  .brand { font-size: 17px; }
  .tagline { display: none; }
  .console-toggle { display: flex; }

  /* Closed: the bar is all that is left. Open: the whole panel is capped and
     the rail scrolls inside it, so the proof never disappears off the bottom. */
  .panel[data-console="closed"] .jump,
  .panel[data-console="closed"] .rail-scroll { display: none; }

  .rail-hint { display: none; }
  .panel[data-console="open"] { max-height: 46dvh; }
  .panel[data-console="open"] .rail-scroll {
    max-height: none;
    min-height: 0;
    overscroll-behavior: contain;
  }

  /* Ten stations in one row: the strip scrolls sideways instead of wrapping. */
  .jump { display: flex; flex-wrap: nowrap; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none; }
  .jump::-webkit-scrollbar { display: none; }
  .jump-chip { width: auto; padding: 6px 10px; font-size: 12px; letter-spacing: 0; }

  /* The statusbar is the house signature, so it stays: as one scrollable
     line rather than four stacked ones. */
  .statusbar {
    flex-wrap: nowrap;
    gap: 12px;
    padding: 7px 12px;
    overflow-x: auto;
    font-size: 11px;
    scrollbar-width: none;
  }
  .statusbar::-webkit-scrollbar { display: none; }
  .statusbar > span { flex: 0 0 auto; }

  /* One scrolling row of tools. Two rows of chrome cost more than the
     less-used buttons on the far right are worth on a phone. */
  .toolbar {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: 0 0 auto; }
  .toolbar .grow { display: none; }

  .viewport-bar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  }
  .viewport-label,
  #quality-note,
  .viewport-bar .grow { display: none; }

  .canvas-frame { padding: 12px; }

  .gesture-hint {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    margin: 0;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
  }
}

/* Embedded in the publicity site: the frame already carries the title, so the
   console's own masthead comes off on a pointer device. The phone keeps the
   console bar - it is the only handle on the rail - but drops the wordmark. */
@media (min-width: 721px) {
  .is-embed .rail-head { display: none; }
  .is-embed .panel { grid-template-rows: auto minmax(0, 1fr) auto; }
}

@media (max-width: 720px) {
  .is-embed .rail-head { padding: 8px 12px; }
  .is-embed .rail-head .brand,
  .is-embed .rail-head .tagline,
  .is-embed .rail-head .demo-promo { display: none; }
  .is-embed .console-toggle { margin-top: 0; }
}

/* A short viewport gives the sheet more of itself, takes the last of the
   padding out of the proof, and keeps the bar itself thin: on a landscape
   phone every row of chrome is a row the proof does not get. */
/* A phone on its side: width is the plentiful axis, so the rail moves to the
   side instead of stacking. Full height for the proof, and the whole rail is
   still reachable without a sheet. */
@media (pointer: coarse) and (min-width: 721px) and (max-height: 520px) {
  body { grid-template-columns: 232px minmax(0, 1fr); }
  .rail-head { padding: 9px 12px 7px; }
  .brand { font-size: 16px; }
  .tagline { display: none; }
  .jump { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 8px 8px; }
  .jump-chip { padding: 4px 2px; font-size: 10.5px; }
  .statusbar { padding: 5px 12px; gap: 10px; }
  .toolbar { padding: 6px 12px; }
  .viewport-bar { padding: 4px 12px; }
  .canvas-frame { padding: 8px; }
}

@media (max-height: 520px) {
  .canvas-frame { padding: 6px; }
}

@media (pointer: coarse) and (max-height: 520px) {
  .rail-head { padding: 9px 12px 8px; }
  .brand { font-size: 15px; }
  .console-toggle { margin-top: 7px; padding: 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .caret,
  .console-toggle .caret,
  .jump-chip,
  .group-name,
  .btn,
  .seg-btn,
  .icon-btn,
  .console-toggle,
  .group-head { transition: none; }
  .btn:active,
  .seg-btn:active,
  .jump-chip:active,
  .icon-btn:active,
  .console-toggle:active { transform: none; }
  .rail-scroll { scroll-behavior: auto; }
}
