/* The booth console.
 *
 * It takes the tokens from system.css but not the house layout rules: a
 * control panel is not a document, so the 17px baseline and section-owned
 * rhythm stay on the landing page. Everything here works at --fs-sm and
 * --fs-xs on the 4px spacing scale, which is the same system read at the
 * density a tool needs.
 *
 * Light and dark both come from the tokens. Dark is the better bench light
 * when the screen sits behind the camera — a bright panel throws glare onto a
 * glossy page — but that is the operator's call, not this file's.
 */

:root {
  /* Names the rest of this file already uses, pointed at the system. */
  --panel: var(--bg-elevated);
  --line: var(--hairline);
  --muted: var(--text-3);
}

* { box-sizing: border-box; }

/* A class that sets `display` outranks the UA's [hidden] rule, so state the
   intent once and let every hidden element mean it. */
[hidden] { display: none !important; }

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

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-sm)/1.5 var(--font-sans);
  letter-spacing: -0.006em;
  overflow: hidden;
}

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

.bar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

/* The lockup is also the way back to the overview. The chevron stays visible
   rather than appearing on hover: a way out nobody can see is not one.
   The house layout gives it 28px and --s-3; a 48px tool bar runs tighter. */
.brand {
  gap: var(--s-2);
  min-height: 0;
  margin-left: calc(var(--s-2) * -1);
  padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}

.brand__mark { inline-size: 22px; block-size: 22px; }

/* Only the chevron takes a colour. The mark carries its own tile and is
   never recoloured — that is the one rule the mark has. */
.brand__back {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand:hover { background: var(--fill-quiet); }
.brand:hover .brand__back { stroke: var(--accent); }

.session {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.session.active { color: var(--text); }

.counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.counter span { font-size: 22px; font-weight: 600; }
.counter small { color: var(--muted); }

/* The window controls: one row, one size, no labels competing with the album
   name for the middle of the bar. Grouped on a single quiet field so they read
   as one control cluster rather than four loose buttons. */
.tools {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1);
  border-radius: var(--r-sm);
  background: var(--fill-quiet);
}

button.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

button.icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.icon:hover { background: var(--fill-quiet-hover); color: var(--text); }
button.icon.on { background: var(--accent-wash); color: var(--accent); }

/* One glyph at a time: the control shows the state it is in, not the state it
   would move to — a moon that means "you are in light mode" is a coin toss. */
#theme-toggle svg { display: none; }
#theme-toggle[data-theme-state="system"] .ico-system,
#theme-toggle[data-theme-state="light"] .ico-light,
#theme-toggle[data-theme-state="dark"] .ico-dark { display: block; }
#theme-toggle:not([data-theme-state]) .ico-system { display: block; }

/* Same rule as the theme control: the glyph is the state you are in, so a
   struck-through microphone means the microphone is off, not that pressing
   will turn it off. It appears only while a hands-free trigger is armed — a
   permanent microphone button that does nothing most of the time is noise,
   and its arrival is itself the signal that the microphone has gone live. */
#mic-toggle svg { display: none; }
#mic-toggle[data-mic="listening"] .ico-mic-on,
#mic-toggle[data-mic="paused"] .ico-mic-off { display: block; }

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

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 380px);
  flex: 1;
  min-height: 0;
}

.viewport {
  position: relative;
  display: grid;
  place-items: center;
  background: #000; /* true black, deliberately: this is a camera viewport */
  overflow: hidden;
}

/* Sized by layoutPreview() so a rotated feed still fits the viewport. */
#video {
  display: block;
  transform-origin: center;
}

#video.mirror { transform: scaleX(-1); }
#video.rot-90 { transform: rotate(90deg); }
#video.rot-180 { transform: rotate(180deg); }
#video.rot-270 { transform: rotate(270deg); }
#video.mirror.rot-90 { transform: rotate(90deg) scaleY(-1); }
#video.mirror.rot-180 { transform: rotate(180deg) scaleX(-1); }
#video.mirror.rot-270 { transform: rotate(270deg) scaleY(-1); }

/* The preview wears the same tone curve the capture will bake in, so what
   you frame is what lands on disk. Keep these in step with LOOKS in app.js. */
#video.look-gray { filter: grayscale(1); }
#video.look-doc { filter: grayscale(1) contrast(1.45) brightness(1.06); }

.guides {
  position: absolute;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - 1px), rgba(255,255,255,.25) 33.33%, transparent calc(33.33% + 1px)),
    linear-gradient(to right, transparent calc(66.66% - 1px), rgba(255,255,255,.25) 66.66%, transparent calc(66.66% + 1px)),
    linear-gradient(to bottom, transparent calc(33.33% - 1px), rgba(255,255,255,.25) 33.33%, transparent calc(33.33% + 1px)),
    linear-gradient(to bottom, transparent calc(66.66% - 1px), rgba(255,255,255,.25) 66.66%, transparent calc(66.66% + 1px));
}

.flash {
  position: absolute;
  inset: 0;
  background: var(--text-hi);
  opacity: 0;
  pointer-events: none;
}

.flash.fire { animation: flash .18s ease-out; }

@keyframes flash {
  from { opacity: .85; }
  to { opacity: 0; }
}

/* What the shutter is set to do, without opening a panel to find out. */
.badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 24px);
  pointer-events: none;
}

.badges span {
  padding: 3px 9px;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, .55);
  color: #d8dde3;
  font-size: var(--fs-xs);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

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

/* Anything painted over the viewport sits on black whatever the theme is, so
   it cannot take its colour from the tokens: in light mode the key chip went
   dark ink on a black frame and disappeared. */
.hint kbd,
.badges kbd {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .12);
  color: #f2f5f8;
}

.hint {
  position: absolute;
  bottom: 18px;
  padding: 6px 14px;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, .6);
  color: #d8dde3;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* --------------------------------------------------------------- panel */

.panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Every section is content-sized and the panel is what scrolls. An earlier
   version let the Recent block flex-grow from a zero basis, which squeezed it
   under its own thumbnails and painted them over the block below. */
.block {
  flex: none;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.block[open] { padding-bottom: 14px; }

.block > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}

.block > summary::-webkit-details-marker { display: none; }
.block > summary:hover { color: var(--text); }

.block > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg) translate(-1px, 1px);
  transition: transform .15s ease;
}

.block[open] > summary::after { transform: rotate(45deg); }

/* A folded section still says what it is set to, so nothing has to be opened
   just to check. */
.summary-tag {
  padding: 1px 7px;
  border-radius: var(--r-chip);
  background: var(--fill-quiet);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
}

.summary-tag:empty { display: none; }
.block[open] .summary-tag { opacity: .5; }

.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.field b { color: var(--text); font-variant-numeric: tabular-nums; }

input[type="text"], select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  color: var(--text);
  font: inherit;
}

input[type="range"] { width: 100%; accent-color: var(--accent); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  cursor: pointer;
}

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

button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--fill-quiet);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:hover { border-color: var(--hairline-strong); }
button.primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* One control, three mutually exclusive answers — a row of radio buttons
   would cost three lines and read as three separate questions. */
.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.segmented button {
  flex: 1;
  padding: 7px 4px;
  border: 0;
  border-radius: 0;
  background: var(--bg-sunken);
  color: var(--muted);
  font-size: 12px;
}

.segmented button + button { border-left: 1px solid var(--line); }
.segmented button:hover { color: var(--text); background: var(--fill-quiet-hover); }
.segmented button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.path, .actual {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}

.queue {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--r-chip);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 10px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* `contain`, not `cover`: a cropped thumbnail of a page of text tells you
   nothing about the page. This shows the whole shot, and a click opens it. */
.thumb {
  position: relative;
  aspect-ratio: var(--thumb-aspect, 3 / 4);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--s-1);
  background: var(--bg-sunken);
  overflow: hidden;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  color: var(--text-2);
  font: 10px/1.3 var(--font-mono);
  font-style: normal;
  text-align: center;
}

.thumb:hover { border-color: var(--accent); }
.thumb.failed { border-color: var(--danger); opacity: .55; }

.keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--s-1);
  background: var(--fill-quiet);
  color: var(--text);
  font: 11px/1.6 var(--font-mono);
}

/* --------------------------------------------------------------- toast */

/* Top centre, under the bar — where the house system puts it, and where it
   does not sit on top of the shutter hint at the bottom of the viewport.
   Status is an icon colour, not a painted block: the previous version filled
   the whole toast with --danger and then set the text to --danger as well,
   which is a red rectangle with an invisible message in it. */
.toasts {
  position: fixed;
  inset-block-start: calc(var(--nav-h) + var(--s-3));
  inset-inline: var(--s-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  inline-size: min(100%, 420px);
  padding: var(--s-3) var(--s-5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: var(--fs-sm);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: toast-in var(--dur) var(--ease) both;
}

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

.toast__icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent);
}

/* One glyph, chosen by the kind of message. */
.toast .toast__icon { display: none; }
.toast:not(.error):not(.ok) .ico-info,
.toast.ok .ico-ok,
.toast.error .ico-danger { display: block; }

.toast.ok .toast__icon { color: var(--ok); }
.toast.error .toast__icon { color: var(--danger); }
.toast.error { border-color: color-mix(in oklab, var(--danger) 40%, transparent); }

@media (max-width: 860px) {
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
}

/* ------------------------------------------------------------- triggers */

.sub {
  margin: 10px 0 4px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.note.warn { color: var(--danger); }

.meter {
  position: relative;
  height: 8px;
  margin-bottom: 12px;
  border-radius: var(--s-1);
  background: var(--bg-sunken);
  overflow: hidden;
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .05s linear;
}

.meter b {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
}


.tag {
  padding: 1px 6px;
  border-radius: var(--r-chip);
  background: var(--accent-2-wash);
  color: var(--accent-2);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 10px 16px;
  background: var(--danger-wash);
  color: var(--danger);
  font-weight: 500;
  text-align: center;
}

.check + .field { margin-top: 14px; }

/* Depletes over the minimum-interval window, so a swallowed press reads as
   "not yet" rather than "the app missed it". */
.cooldown {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  pointer-events: none;
}

/* Full strength while it counts down to the shutter, faded once it is only
   the gap before the next shot: the same bar, two different waits. */
.cooldown.dim { background: color-mix(in oklab, var(--accent) 45%, transparent); }

/* Captures the server would not take are held, never silently dropped. */
.failed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--danger-wash);
  color: var(--danger);
}

.failed button {
  border-color: rgba(0, 0, 0, .35);
  background: rgba(0, 0, 0, .12);
  color: var(--danger);
  font-weight: 600;
}

/* Peak-hold marker: shows how loud the last sound actually was, so the
   threshold can be parked just under it. */
.meter u {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text);
  opacity: .8;
}

button.wide { width: 100%; margin-top: 10px; }
button:disabled { opacity: .45; cursor: default; }

/* --------------------------------------------------------------- review */

/* minmax(0, 1fr) rather than 1fr: a bare 1fr floors the row at the content's
   own height, and the content here is a full-resolution page — the stage grew
   past the window and took the filmstrip off the bottom of the screen. */
.review {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--bg);
}

.review header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.review header .grow { flex: 1; }
.review header kbd { margin-left: 4px; }
.review header strong { font-weight: 600; }

#review-title {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#review-status { color: var(--muted); font-variant-numeric: tabular-nums; }
#review-status.saving { color: var(--accent); }
#review-status.saved { color: var(--ok); }

.zoomer {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.zoomer button {
  min-width: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: var(--fill-quiet);
  color: var(--muted);
}

.zoomer button + button { border-left: 1px solid var(--line); }
.zoomer button:hover { color: var(--text); }
#zoom-reset { min-width: 62px; font-variant-numeric: tabular-nums; font-size: 12px; }

.review-stage {
  overflow: auto;
  overscroll-behavior: contain;
  background:
    repeating-conic-gradient(var(--bg) 0% 25%, var(--bg-sunken) 0% 50%) 50% / 22px 22px;
}

.review-stage.pannable { cursor: grab; }
.review-stage.panning { cursor: grabbing; }

/* min-width/height keep the page centred while it is smaller than the stage
   and let it push out scrollbars once it is not — which `place-items: center`
   alone cannot do without clipping the top-left of an over-sized image. */
.review-pan {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  min-height: 100%;
  padding: 16px;
}

#review-canvas {
  display: block;
  border-radius: var(--s-1);
  background: var(--bg-sunken);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

.review-strip {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  overflow-x: auto;
}

/* The tile carries the size, not the image, so the strip has its full geometry
   while the pages in it are still unloaded. Without a definite width every
   pending tile would be zero pixels across, they would all intersect at once,
   and the lazy loading in renderStrip() would defeat itself. */
.strip-item {
  position: relative;
  flex: none;
  height: 76px;
  aspect-ratio: var(--strip-aspect, 4 / 3);
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--s-1);
  background: var(--bg-sunken);
  overflow: hidden;
}

.strip-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.strip-item:hover { border-color: var(--hairline-strong); }
.strip-item.current,
.strip-item.current:hover { border-color: var(--accent); }

#connect-row button { margin-top: 0; }
#connect-row .note { margin-top: 8px; }

/* Offered, never forced: an update must not swap the app out mid-session. */
.update {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

/* --------------------------------------------------------------- booting */

/* Nothing is on screen until init() has run. Half the console reads from
   settings — which section is open, which rendering mode is lit, what the
   badges say — so a shell painted before the script has wired it is not a
   slower version of the app, it is a wrong one. */
.booting .bar,
.booting .stage { visibility: hidden; }

.boot {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-4);
  background: var(--bg);
  color: var(--text-3);
  text-align: center;
}

body:not(.booting) .boot { display: none; }

.boot .brand__mark { inline-size: 44px; block-size: 44px; }
.boot p { margin: 0; }
.boot__hint { max-width: 44ch; font-size: var(--fs-xs); line-height: 1.5; }
.boot--failed #boot-status { color: var(--danger); font-weight: 600; }

/* The mark breathes while it waits, so a slow start does not read as a hang. */
.boot .brand__mark { animation: boot-pulse 1.6s var(--ease) infinite; }
.boot--failed .brand__mark { animation: none; opacity: .5; }

@keyframes boot-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

/* ----------------------------------------------------------- empty state */

.empty {
  padding: var(--s-8) var(--s-4);
  border: 1px dashed var(--hairline);
  border-radius: var(--r-lg);
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-align: center;
}

.empty__title {
  margin: 0 0 var(--s-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.empty p { margin: 0; }

/* ------------------------------------------------------------- countdown */

/* Big enough to read from wherever the subject is standing, which is the only
   place it needs to be readable from. */
.countdown {
  position: absolute;
  z-index: 3;
  min-width: 1.6em;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-xl);
  background: rgba(0, 0, 0, .5);
  color: #f2f5f8;
  font-size: clamp(64px, 14vw, 160px);
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.countdown.last { color: var(--accent); }

/* ------------------------------------------------------------- fill light */

/* The screen as a lamp. It covers the viewport rather than the window, so the
   preview keeps its frame and you can still see yourself while it is up. */
.fill {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #fff;
  pointer-events: none;
}

/* ------------------------------------------------------------ stop motion */

/* Both sit exactly where the preview sits, sized from it in JS, so the ghost
   measures the real distance a puppet moved rather than an approximate one. */
.onion,
.playback {
  position: absolute;
  z-index: 2;
  object-fit: fill;
  pointer-events: none;
}

.playback { z-index: 3; background: #000; }

.play-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 3px 10px;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, .55);
  color: #d8dde3;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  pointer-events: none;
}

button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* A destructive control should not look like the ones beside it, and should
   look different again once it is one press from doing the thing. */
button.icon.danger:hover { background: var(--danger-wash); color: var(--danger); }

button.icon.danger.armed {
  background: var(--danger);
  color: var(--bg-elevated);
}

/* ------------------------------------------------------------- listening */

/* Over the viewport rather than in the panel: that the microphone is live is
   something you need to see while looking at what you are shooting, and the
   reason to stop it is always sudden. */
.listening {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border: 0;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, .55);
  color: #d8dde3;
  font: inherit;
  font-size: var(--fs-xs);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.listening:hover { background: rgba(0, 0, 0, .75); }

.listening__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: listening-pulse 1.6s var(--ease) infinite;
}

@keyframes listening-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Paused is a state, not an absence: the chip stays, the pulse stops. */
.listening.paused { color: var(--text-3); }
.listening.paused .listening__dot { background: var(--text-3); animation: none; }

@media (prefers-reduced-motion: reduce) { .listening__dot { animation: none; } }
