/* =============================================================================
   Neurodesy Core — client styling.

   The HUD section below is carried over verbatim from the original
   standalone build so the hosted Core module looks and behaves exactly like
   the build it replaces. Styling is not IP: what moved to the server is the
   pose solve, the montage geometry and the projection, none of which lives
   here. Keeping the CSS identical is what makes "same application" true
   visually as well as functionally.

   Sections:
     1. HUD — stage, menu, telemetry panel, overlay/selection panels
     2. Account form — signup, sign-in, verification states
     3. Touch — coarse-pointer sizing for phones and tablets
   ========================================================================== */


  :root {
    /* ------------------------------------------------------------------
       ONE PALETTE ACROSS THE PRODUCT.  This block, the 3D designer's
       designer.css and the website's public/css/site.css hold the same
       values, and NEURODESY_AR/neurodesy_theme.py is their Python mirror.
       Change a colour here and change it in all four.

       It replaces a dark teal and gold scheme carried over from the
       standalone build, which had drifted away from everything else the
       product shows anyone.  The names below are this file's own, kept
       because forty-odd rules and the desktop theme read them; where a
       name means something different on the website, the comment says so.
       ------------------------------------------------------------------ */

    /* Surfaces: deep navy, each step lighter than the last. */
    --bg:      #04070b;
    --bg-2:    #070c14;
    --panel:   #0b131f;
    --panel-2: #101b2b;
    --panel-3: #15223a;

    /* Hairlines are a translucent blue rather than a flat grey, so an edge
       reads at the same strength over a panel, over the camera picture and
       over a glow. */
    --line:        rgba(126, 172, 255, 0.14);
    --line-strong: rgba(126, 172, 255, 0.28);

    --ink:     #e9eff8;
    --ink-dim: #a3b4cc;
    --ink-3:   #6c7d95;

    /* Brand. */
    --blue:   #2b8cff;
    --blue-d: #1257c4;
    --cyan:   #4fd8ff;
    --orange: #ff7a1a;
    --amber:  #ffb02e;
    /* --burnt is this app's ACCENT: a primary button, an armed toggle, the
       DESY half of the wordmark.  On the website the same name is the dark
       #c26213, which is --burnt-d here. */
    --burnt:   var(--orange);
    --burnt-d: #c26213;
    --ok:      var(--cyan);
    --danger:  #ff5f57;
    --pink:    #f472b6;
    /* Ink to put ON an accent fill: the page's own background rather than
       black, so a button reads as cut out of the page. */
    --on-accent: #04070b;

    --grad-brand: linear-gradient(100deg, var(--cyan) 0%, var(--blue) 32%, var(--orange) 74%, var(--amber) 100%);
    --grad-warm:  linear-gradient(100deg, var(--amber), var(--orange) 55%, var(--burnt-d));

    /* Glows.  Each is one spread shadow -- no blur filter, no extra layer --
       because these sit over a live camera picture and must cost nothing. */
    --glow-amber: 0 0 22px rgba(255, 122, 26, 0.32);
    --glow-blue:  0 0 24px rgba(43, 140, 255, 0.30);
    --glow-cyan:  0 0 18px rgba(79, 216, 255, 0.28);
    --ring:       0 0 0 3px rgba(255, 122, 26, 0.28);

    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --menu-size: 380px;
    --menu-bottom-size: 42vh;
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--mono);
    -webkit-font-smoothing: antialiased;
  }

  /* ---------- Header (HUD overlay) ---------- */
  header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: linear-gradient(to bottom, rgba(4, 7, 11, 0.85), rgba(4, 7, 11, 0));
    pointer-events: none;
  }
  header * { pointer-events: auto; }
  .logo {
    font-weight: 700;
    letter-spacing: 0.14em;
    font-size: 15px;
    text-transform: uppercase;
  }
  .logo b { color: var(--burnt); text-shadow: 0 0 18px rgba(255, 122, 26, 0.55); }
  .tagline {
    color: var(--ink-dim);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  .header-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
  }
  .rec {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--ink-dim);
    text-transform: uppercase;
  }
  .rec-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #1a2740;
    box-shadow: none;
    transition: background .2s;
  }
  .rec-dot.live {
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(255, 95, 87, 0.6);
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 95, 87, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(255, 95, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 95, 87, 0); }
  }
  .fps { font-size: 12px; color: var(--burnt); min-width: 66px; text-align: right; }

  /* ---------- Video stage (full viewport) ---------- */
  .stage-frame {
    position: fixed;
    inset: 0;
    background: #000;
    overflow: hidden;
    z-index: 1;
    transition: right .25s ease, bottom .25s ease;
  }
  #videoStage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    touch-action: none;
  }
  #videoStage.zoomed { cursor: grab; }
  #videoStage.zoomed:active { cursor: grabbing; }

  #zoomWrap {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    will-change: transform;
  }
  .mirror-wrap {
    position: absolute; inset: 0;
  }
  .mirror-wrap.mirrored { transform: scaleX(-1); }
  /* `contain`, not `cover`. The stage is a full-viewport rectangle — it is
     `inset: 0`, so its width and height are both already determined and the
     `aspect-ratio` sizeCanvas() used to set on it never applied. `cover` then
     scaled the frame to fill that rectangle and threw away whatever did not
     fit: a 1280x960 capture (the first rung of CAPTURE_LADDER) in a 16:9 window
     lost about a quarter of its vertical field, montage points included.

     Letterboxing instead shows the whole sensor, which is what the desktop
     build does with Qt.KeepAspectRatio and the reason its field of view looked
     wider. Both elements carry the same rule and the canvas is sized to the
     video's intrinsic dimensions, so the two letterbox identically and stay
     registered.

     Coupled to videoFit() in app.js, which must use the same min/max as this
     property or every pointer mapping is offset. */
  #video, #overlay {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
  }
    #overlay { pointer-events: none; }
  /* Selection mode is the only time the canvas takes pointer events, so
     drag-to-pan and pinch-zoom keep working normally the rest of the time. */
  #videoStage.selecting #overlay { pointer-events: auto; cursor: crosshair; }
  #videoStage.selecting { touch-action: none; }

  .zoom-indicator {
    position: absolute; right: 14px; top: 68px;
    z-index: 5;
    background: rgba(4, 7, 11, 0.78);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--ink-dim);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
  }
  .zoom-indicator.show { opacity: 1; }

  .placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 18px;
    color: var(--ink-dim);
    text-align: center;
    padding: 24px;
  }
  .placeholder p { margin: 0; font-size: 12px; letter-spacing: 0.06em; max-width: 34ch; }

  /* ---------- Helix loader (uiball.com/ldrs #22) ---------- */
  .helix {
    --uib-size: 200px;
    --uib-color: var(--burnt);
    --uib-speed: 4.0s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: var(--uib-size);
    width: var(--uib-size);
  }
  .helix .slice {
    position: relative;
    height: calc(var(--uib-size) / 6);
    width: 100%;
  }
  .helix .slice::before,
  .helix .slice::after {
    --uib-a: calc(var(--uib-speed) / -2);
    --uib-b: calc(var(--uib-speed) / -6);
    content: '';
    position: absolute;
    top: 0;
    left: calc(50% - var(--uib-size) / 12);
    height: 100%;
    width: calc(100% / 6);
    border-radius: 50%;
    background-color: var(--uib-color);
    flex-shrink: 0;
    animation: orbit var(--uib-speed) linear infinite;
    transition: background-color 0.3s ease;
  }
  .helix .slice:nth-child(1)::after { animation-delay: var(--uib-a); }
  .helix .slice:nth-child(2)::before { animation-delay: var(--uib-b); }
  .helix .slice:nth-child(2)::after { animation-delay: calc(var(--uib-a) + var(--uib-b)); }
  .helix .slice:nth-child(3)::before { animation-delay: calc(var(--uib-b) * 2); }
  .helix .slice:nth-child(3)::after { animation-delay: calc(var(--uib-a) + var(--uib-b) * 2); }
  .helix .slice:nth-child(4)::before { animation-delay: calc(var(--uib-b) * 3); }
  .helix .slice:nth-child(4)::after { animation-delay: calc(var(--uib-a) + var(--uib-b) * 3); }
  .helix .slice:nth-child(5)::before { animation-delay: calc(var(--uib-b) * 4); }
  .helix .slice:nth-child(5)::after { animation-delay: calc(var(--uib-a) + var(--uib-b) * 4); }
  .helix .slice:nth-child(6)::before { animation-delay: calc(var(--uib-b) * 5); }
  .helix .slice:nth-child(6)::after { animation-delay: calc(var(--uib-a) + var(--uib-b) * 5); }

  @keyframes orbit {
    0%   { transform: translateX(calc(var(--uib-size) * 0.25)) scale(0.73684); opacity: 0.65; }
    5%   { transform: translateX(calc(var(--uib-size) * 0.235)) scale(0.684208); opacity: 0.58; }
    10%  { transform: translateX(calc(var(--uib-size) * 0.182)) scale(0.631576); opacity: 0.51; }
    15%  { transform: translateX(calc(var(--uib-size) * 0.129)) scale(0.578944); opacity: 0.44; }
    20%  { transform: translateX(calc(var(--uib-size) * 0.076)) scale(0.526312); opacity: 0.37; }
    25%  { transform: translateX(0%) scale(0.47368); opacity: 0.3; }
    30%  { transform: translateX(calc(var(--uib-size) * -0.076)) scale(0.526312); opacity: 0.37; }
    35%  { transform: translateX(calc(var(--uib-size) * -0.129)) scale(0.578944); opacity: 0.44; }
    40%  { transform: translateX(calc(var(--uib-size) * -0.182)) scale(0.631576); opacity: 0.51; }
    45%  { transform: translateX(calc(var(--uib-size) * -0.235)) scale(0.684208); opacity: 0.58; }
    50%  { transform: translateX(calc(var(--uib-size) * -0.25)) scale(0.73684); opacity: 0.65; }
    55%  { transform: translateX(calc(var(--uib-size) * -0.235)) scale(0.789472); opacity: 0.72; }
    60%  { transform: translateX(calc(var(--uib-size) * -0.182)) scale(0.842104); opacity: 0.79; }
    65%  { transform: translateX(calc(var(--uib-size) * -0.129)) scale(0.894736); opacity: 0.86; }
    70%  { transform: translateX(calc(var(--uib-size) * -0.076)) scale(0.947368); opacity: 0.93; }
    75%  { transform: translateX(0%) scale(1); opacity: 1; }
    80%  { transform: translateX(calc(var(--uib-size) * 0.076)) scale(0.947368); opacity: 0.93; }
    85%  { transform: translateX(calc(var(--uib-size) * 0.129)) scale(0.894736); opacity: 0.86; }
    90%  { transform: translateX(calc(var(--uib-size) * 0.182)) scale(0.842104); opacity: 0.79; }
    95%  { transform: translateX(calc(var(--uib-size) * 0.235)) scale(0.789472); opacity: 0.72; }
    100% { transform: translateX(calc(var(--uib-size) * 0.25)) scale(0.73684); opacity: 0.65; }
  }

  .scan-line {
    position: absolute; left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--burnt), transparent);
    opacity: 0;
    z-index: 5;
  }
  .scan-line.sweep { animation: sweep 1.1s ease-in-out; }
  @keyframes sweep {
    0%   { opacity: 0; top: 0; }
    10%  { opacity: 0.9; }
    90%  { opacity: 0.9; }
    100% { opacity: 0; top: 100%; }
  }

  .status-banner {
    position: absolute; left: 14px; bottom: 14px; right: 14px;
    max-width: 640px;
    padding: 9px 12px;
    font-size: 12px;
    letter-spacing: 0.03em;
    background: rgba(4, 7, 11, 0.82);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
    z-index: 5;
  }
  .status-banner.show { opacity: 1; transform: none; }
  .status-banner.ok { border-color: rgba(79, 216, 255, 0.5); color: var(--burnt); }
  .status-banner.error { border-color: rgba(255, 95, 87, 0.6); color: var(--danger); }

  /* ---------- Auto-hiding side menu ---------- */
  .menu-edge {
    position: fixed;
    top: 0; right: 0;
    height: 100vh; width: 18px;
    z-index: 30;
    background: transparent;
  }
  body[data-dock="bottom"] .menu-edge {
    top: auto; bottom: 0; left: 0; right: 0;
    height: 18px; width: 100%;
  }

  .menu-handle {
    position: fixed;
    top: 50%; right: 0;
    transform: translateY(-50%);
    z-index: 41;
    width: 28px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel);
    border: 1px solid var(--line); border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--ink-dim);
    cursor: pointer;
    transition: right .25s ease, bottom .25s ease, color .15s, border-color .15s;
    font-size: 15px;
  }
  .menu-handle:hover { color: var(--burnt); border-color: var(--burnt); }
  .menu-handle .arrow { display: inline-block; transition: transform .25s ease; }
  body.menu-open .menu-handle { right: var(--menu-size); }
  body.menu-open .menu-handle .arrow { transform: rotate(180deg); }

  /* Horizontal position is a variable so long-press can move it. Default is
     hard right: centred put it directly under the Android home pill, where
     the system gesture wins and the tab is effectively untappable. */
  body[data-dock="bottom"] .menu-handle {
    top: auto; bottom: 0; right: auto;
    left: var(--handle-x, 88%);
    transform: translateX(-50%);
    width: 56px; height: 26px;
    border: 1px solid var(--line); border-bottom: none;
    border-radius: 8px 8px 0 0;
  }
  body[data-dock="bottom"] .menu-handle .arrow { transform: rotate(-90deg); }
  body[data-dock="bottom"].menu-open .menu-handle { bottom: var(--menu-bottom-size); right: auto; }
  body[data-dock="bottom"] .menu-handle.repositioning { transition: none; }
  body[data-dock="bottom"].menu-open .menu-handle .arrow { transform: rotate(90deg); }

  .side-menu {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: var(--menu-size);
    max-width: 92vw;
    background: rgba(11, 19, 31, 0.97);
    backdrop-filter: blur(6px);
    border-left: 1px solid var(--line);
    z-index: 40;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .34s cubic-bezier(.22, .61, .36, 1);
    box-shadow: -10px 0 26px rgba(0,0,0,0.35);
  }
  body.menu-open .side-menu { transform: translateX(0); }

  body.menu-open .side-menu { transition-duration: .22s; }

  body[data-dock="bottom"] .side-menu {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: var(--menu-bottom-size); max-height: 80vh;
    max-width: none;
    border-left: none; border-top: 1px solid var(--line);
    transform: translateY(100%);
    box-shadow: 0 -10px 26px rgba(0,0,0,0.35);
  }
  body[data-dock="bottom"].menu-open .side-menu { transform: translateY(0); }

  /* Pinned: reserve space in the stage instead of floating over it. */
  body.menu-pinned.menu-open .stage-frame,
  body.menu-pinned.menu-open .menu-handle { right: var(--menu-size); }
  body[data-dock="bottom"].menu-pinned.menu-open .stage-frame { right: 0; bottom: var(--menu-bottom-size); }
  body[data-dock="bottom"].menu-pinned.menu-open .menu-handle { right: auto; bottom: var(--menu-bottom-size); }

  .menu-topbar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
  }
  .menu-seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
  .seg-btn {
    font-family: var(--mono); font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    background: var(--panel-2); color: var(--ink-dim);
    border: none; padding: 6px 10px; cursor: pointer;
  }
  .seg-btn.active { background: var(--burnt); color: var(--on-accent); }
  .pin-btn {
    font-family: var(--mono); font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    background: var(--panel-2); color: var(--ink-dim);
    border: 1px solid var(--line); border-radius: 6px;
    padding: 6px 10px; cursor: pointer;
  }
  .pin-btn[aria-pressed="true"] { background: var(--burnt); color: var(--on-accent); border-color: var(--burnt); }
  .menu-close {
    margin-left: auto;
    background: transparent; border: none;
    color: var(--ink-dim); font-size: 18px; line-height: 1;
    cursor: pointer; padding: 2px 4px;
  }
  .menu-close:hover { color: var(--danger); }

  .menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex; flex-direction: column; gap: 16px;
  }
  /* Bottom dock lays the panels out as columns that scroll sideways. Each
     column then has to scroll VERTICALLY on its own — the Probe Designer is
     far taller than 42vh, and without this its lower half (export, reset,
     labelled areas) is simply unreachable. `min-height: 0` is the part that
     actually lets a flex child shrink enough to scroll; overflow alone does
     nothing inside a flex row. */
  body[data-dock="bottom"] .menu-body {
    flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    align-items: stretch;
    scroll-snap-type: x proximity;
  }
  body[data-dock="bottom"] .menu-body .panel {
    min-width: 300px; flex: 0 0 300px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-align: start;
  }

  /* Side dock: the column scrolls, and a long panel must not be clipped by a
     parent that has already sized itself. Same reasoning as above. */
  .menu-body { min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .side-menu { min-height: 0; }

  /* .ff-ov-scope is a logical wrapper only — overlay.js adopts controls inside it.
     display:contents lets its two panels lay out as direct menu-body items. */
  .ff-ov-scope { display: block; }

  /* ---------- Panels ---------- */
  .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
  }
  /* Section headers double as collapse toggles. Rendered as a <button> so the
     keyboard and screen readers get the affordance for free; the visual weight
     is unchanged from the old <p> heading. */
  .panel-title {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin: 0 0 12px;
    padding: 0;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
    transition: color .15s;
  }
  .panel-title:hover { color: var(--burnt); }
  .panel-title__chev {
    flex: 0 0 auto;
    width: 0; height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .2s ease;
  }
  .panel-title[aria-expanded="true"] .panel-title__chev { transform: rotate(90deg); }
  .panel-title__count {
    margin-left: auto;
    font-size: 10px;
    letter-spacing: 0.08em;
    opacity: 0.65;
  }

  /* Divides a panel that holds two subjects. Spatial Tracking is the only one:
     the room-and-body controls above it are Edge's, the responsiveness and
     round-trip figures below it are both platforms'. Sits INSIDE the
     [data-edge-only] block on purpose, so on Core it disappears with the
     section it was separating rather than leaving a line above nothing. */
  .panel-rule {
    height: 0;
    margin: 16px 0 4px;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .panel.collapsed .panel-body { display: none; }
  .panel.collapsed .panel-title { margin-bottom: 0; }
  /* In the bottom dock the panels lay out as a row; a collapsed one should give
     its width back instead of holding a 300px column open. */
  body[data-dock="bottom"] .menu-body .panel.collapsed { min-width: 0; flex: 0 0 auto; }

  /* ---------- Metric readouts (Eye Tracking) ---------- */
  .metric__row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
  }
  .metric__row:last-of-type { border-bottom: none; }
  .metric__lbl { font-size: 11px; color: var(--ink-dim); letter-spacing: 0.04em; }
  .metric__val {
    font-size: 15px; font-weight: 600; color: var(--burnt);
    font-variant-numeric: tabular-nums;
  }
  .metric__state {
    font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px;
    color: var(--ink-dim);
  }
  .metric__state[data-state="ok"]   { color: var(--burnt); border-color: var(--burnt); }
  .metric__state[data-state="wait"] { color: var(--amber); border-color: rgba(255, 176, 46, 0.5); }
  .metric__note {
    margin: 10px 0 0;
    font-size: 10.5px; line-height: 1.5;
    color: var(--ink-dim); opacity: 0.8;
  }

  .btn {
    width: 100%;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--on-accent);
    background: var(--grad-warm);
    border: 1px solid var(--burnt);
    border-radius: 7px;
    padding: 11px 14px;
    cursor: pointer;
    /* Lit from the start, brighter under the pointer.  box-shadow rather than
       a filter: a filter on a button over the camera picture forces the whole
       HUD onto its own layer. */
    box-shadow: var(--glow-amber);
    transition: box-shadow .15s, filter .15s, background .15s, color .15s;
  }
  .btn:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 0 30px rgba(255, 122, 26, 0.52);
  }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
  .btn.stop { background: transparent; color: var(--danger); border-color: rgba(255, 95, 87, 0.6); }
  .btn.ghost {
    margin-top: 10px;
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
  }
  .btn.ghost:hover:not(:disabled) { border-color: var(--burnt); color: var(--burnt); }

  .opt-inline {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 12px;
  }
  .opt-inline label { display: flex; align-items: center; gap: 9px; color: var(--ink); cursor: pointer; }
  .opt-inline input[type="checkbox"] { accent-color: var(--burnt); width: 15px; height: 15px; cursor: pointer; }

  .opt-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--ink-dim);
  }
  .opt-row label { display: flex; align-items: center; gap: 9px; color: var(--ink); cursor: pointer; }
  .opt-row input[type="checkbox"] { accent-color: var(--burnt); width: 15px; height: 15px; cursor: pointer; }
  select {
    font-family: var(--mono); font-size: 12px;
    background: var(--panel-2); color: var(--ink);
    border: 1px solid var(--line); border-radius: 6px;
    padding: 5px 8px; cursor: pointer;
  }

  /* The recording controls live in the Capture panel, which is not
     .ff-ov-scope and so does not inherit the full-width field styling the
     probe panel gets. A select sized to its longest option, stacked under a
     full-width button, reads as a mistake rather than as a choice. */
  #recEpoch { width: 100%; box-sizing: border-box; }

  /* ---------- Telemetry (floating, movable, dockable, minimizable) ---------- */
  .tele-panel {
    position: fixed;
    top: 64px; right: 14px;
    width: 310px;
    max-height: 62vh;
    display: flex;
    flex-direction: column;
    background: rgba(11, 19, 31, 0.95);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: 10px;
    z-index: 25;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
  }
  .tele-panel.dragging { transition: none; opacity: 0.92; }
  .tele-head {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    cursor: grab;
    user-select: none;
    flex: 0 0 auto;
    background: var(--panel);
  }
  .tele-head:active { cursor: grabbing; }
  .tele-grip { color: var(--ink-dim); font-size: 11px; letter-spacing: 2px; }
  .tele-title {
    font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ink-dim);
  }
  .telemetry-count { font-size: 11px; color: var(--burnt); letter-spacing: 0.1em; margin-left: auto; }
  .tele-min {
    background: transparent; border: 1px solid var(--line); border-radius: 5px;
    color: var(--ink-dim); font-family: var(--mono); font-size: 12px; line-height: 1;
    width: 22px; height: 22px; cursor: pointer; flex: 0 0 auto;
  }
  .tele-min:hover { color: var(--burnt); border-color: var(--burnt); }
  .tele-body {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
  }
  .tele-panel.minimized { max-height: none; }
  .tele-panel.minimized .tele-body { display: none; }
  .tele-panel.minimized .tele-head { border-bottom: none; }

  #telemetryList { display: grid; gap: 12px; }
  .empty-state {
    margin: 0; font-size: 12px; line-height: 1.5;
    color: var(--ink-dim); letter-spacing: 0.02em;
  }
  .face-card {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--burnt);
    border-radius: 8px;
    padding: 11px 12px;
  }
  .face-card-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
  }
  .face-id { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
  .face-source {
    font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-dim);
    border: 1px solid var(--line); border-radius: 4px;
    padding: 1px 6px;
  }
  .face-swatch { width: 11px; height: 11px; border-radius: 3px; margin-left: auto; }
  .telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 8px;
    font-size: 12px;
  }
  .telemetry-grid .section {
    grid-column: 1 / -1;
    font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-dim);
    margin-top: 6px;
  }
  .telemetry-grid .section:first-child { margin-top: 0; }
  .telemetry-grid .lbl { color: var(--ink-dim); font-size: 10px; }
  .telemetry-grid .val { color: var(--ink); font-variant-numeric: tabular-nums; }

  footer {
    position: fixed;
    bottom: 8px; left: 12px;
    z-index: 15;
    font-size: 10px; letter-spacing: 0.1em;
    color: var(--ink-dim); text-transform: uppercase;
    opacity: 0.7;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .rec-dot.live, .scan-line.sweep,
    .helix .slice::before, .helix .slice::after { animation: none; }
  }

  /* ---------- Overlay control styling (shared by AR Assets + Probe Designer) ---------- */
  .ff-ov-scope .ff-ov-lbl {
    display: block; font-size: 10px; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--ink-dim); margin: 0 0 5px;
  }
  .ff-ov-scope select, .ff-ov-scope input[type="text"] {
    width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: 12px;
    background: var(--panel-2); color: var(--ink);
    border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  }
  .ff-ov-scope input[type="range"] { width: 100%; accent-color: var(--burnt); }
  .ff-ov-scope .ff-ov-row { display: flex; gap: 6px; }
  .ff-ov-scope .ff-ov-btn {
    flex: 1; font-family: var(--mono); font-size: 11px; font-weight: 600; cursor: pointer;
    color: var(--ink); background: var(--panel-2);
    border: 1px solid var(--line); border-radius: 6px; padding: 7px 6px;
    transition: border-color .15s, color .15s, background .15s;
  }
  .ff-ov-scope .ff-ov-btn:hover { border-color: var(--burnt); color: var(--burnt); }
  .ff-ov-scope .ff-ov-btn.on { background: var(--burnt); color: var(--on-accent); border-color: var(--burnt); }
  .ff-ov-scope .ff-ov-btn.primary { border-color: rgba(79, 216, 255, 0.5); }
  .ff-ov-scope .ff-ov-chk {
    display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); cursor: pointer;
  }
  .ff-ov-scope .ff-ov-chk input { accent-color: var(--burnt); width: 15px; height: 15px; }
  /* Compact 2-column toggle group (Probe Designer) */
  .ff-ov-scope .ff-ov-chkgrid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
  }
  .ff-ov-scope .ff-ov-chkgrid .ff-ov-chk { font-size: 11px; gap: 6px; }
  /* Overlay visibility list (AR Assets) and design surface list (Probe
     Designer). One set of rules for both, because overlayRow() builds both from
     the same shape and only the input type differs.

     The design surface list was never covered here, so its rows had no flex, no
     gap and no padding — the name ran straight into the point count. Invisible
     while the swatch was a decorative 11px span; not invisible once it became a
     control somebody has to hit. */
  .ff-ov-scope #ff-ov-list,
  .ff-ov-scope #ff-ov-probe-surface { display: flex; flex-direction: column; gap: 5px; }
  .ff-ov-scope #ff-ov-list .ov-row,
  .ff-ov-scope #ff-ov-probe-surface .ov-row {
    display: flex; align-items: center; gap: 8px; font-size: 11px; cursor: pointer;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  }
  .ff-ov-scope #ff-ov-list .ov-row input,
  .ff-ov-scope #ff-ov-probe-surface .ov-row input {
    accent-color: var(--burnt); width: 14px; height: 14px; flex: 0 0 auto;
  }
  .ff-ov-scope #ff-ov-list .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
  .ff-ov-scope #ff-ov-list .nm,
  .ff-ov-scope #ff-ov-probe-surface .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ff-ov-scope #ff-ov-probe-surface .ct { opacity: 0.6; }

  /* The overlay swatch is an <input type="color">, so it is the control as well
     as the indication. Native colour inputs come with a chrome border and inner
     padding that make a 16px square look like a tiny sunken button; stripped
     back to a plain filled square so the row reads the way it did when this was
     a <span>.

     Scoped to .ov-row rather than .sw: the swatches in #ff-ov-areas are still
     spans showing an area's assigned colour, and those are not editable.

     Listed ahead of the generic `.ov-row input` sizing rule it has to beat, and
     more specific than it, so the checkbox stays 14px and this does not. */
  .ff-ov-scope .ov-row input[type="color"].sw {
    width: 16px; height: 16px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: none;
    flex: 0 0 auto;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
  }
  .ff-ov-scope .ov-row input[type="color"].sw:hover { border-color: var(--burnt); }
  .ff-ov-scope .ov-row input[type="color"].sw::-webkit-color-swatch-wrapper { padding: 0; }
  .ff-ov-scope .ov-row input[type="color"].sw::-webkit-color-swatch { border: none; border-radius: 2px; }
  .ff-ov-scope .ov-row input[type="color"].sw::-moz-color-swatch { border: none; border-radius: 2px; }
  .ff-ov-scope #ff-ov-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ff-ov-scope #ff-ov-list .ct { opacity: 0.6; }
  .ff-ov-scope #ff-ov-areas { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
  .ff-ov-scope #ff-ov-areas .area {
    display: flex; align-items: center; gap: 8px; font-size: 11px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  }
  .ff-ov-scope #ff-ov-areas .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
  .ff-ov-scope #ff-ov-areas .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ff-ov-scope #ff-ov-areas .ct { opacity: 0.6; }
  .ff-ov-scope #ff-ov-areas .x { cursor: pointer; opacity: 0.6; padding: 0 2px; }
  .ff-ov-scope #ff-ov-areas .x:hover { opacity: 1; color: var(--danger); }
  .ff-ov-scope .st { font-size: 10.5px; line-height: 1.4; color: var(--ink-dim); min-height: 14px; }
  .ff-ov-scope .st.ok { color: var(--burnt); }
  .ff-ov-scope .st.warn { color: var(--amber); }
  .ff-ov-scope .st.error { color: var(--danger); }

  /* ---------- The live Probe Designer (Edge) ----------
     Sources warm and detectors cool, as in the 3D Probe Designer, so a design
     reads the same in the panel, on the picture and in the 3D tool. */
  /* No display here: [data-edge-only] owns it, and the flex is set beside that
     rule (search "ld[data-edge-only]"). */
  .ff-ov-scope .ld {
    flex-direction: column; gap: 8px;
    margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--line);
  }
  .ff-ov-scope .ld .ff-ov-lbl { margin: 0; }
  .ff-ov-scope .ld-name { display: flex; align-items: center; gap: 8px; }
  .ff-ov-scope .ld-name input { flex: 1; min-width: 0; }
  .ff-ov-scope .ld-save { font-family: var(--mono); font-size: 10px; color: var(--ink-dim); white-space: nowrap; }
  .ff-ov-scope .ld-save[data-state="dirty"] { color: var(--amber); }
  .ff-ov-scope .ld-save[data-state="saved"] { color: var(--burnt); }
  .ff-ov-scope .ld-prompt {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid #ff7a1a;
    border-radius: 6px; padding: 8px 10px;
  }
  .ff-ov-scope .ld-step {
    flex: 0 0 auto; min-width: 30px; text-align: center; padding: 3px 6px; border-radius: 5px;
    font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--on-accent); background: #ff7a1a;
  }
  .ff-ov-scope .ld-step[data-kind="detector"] { background: #4fd8ff; }
  .ff-ov-scope .ld-prompt__text { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; line-height: 1.4; min-width: 0; }
  .ff-ov-scope .ld-prompt__text span { color: var(--ink-dim); }
  .ff-ov-scope .ld-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .ff-ov-scope .ld-actions:empty { display: none; }
  .ff-ov-scope .ld-actions .ff-ov-btn { flex: 1 1 auto; }
  .ff-ov-scope .ld-actions kbd {
    margin-left: 6px; font-family: var(--mono); font-size: 9px; padding: 0 4px;
    border: 1px solid currentColor; border-radius: 3px; opacity: 0.7;
  }
  .ff-ov-scope .ld-counts { font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); }
  .ff-ov-scope .ld-list { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
  .ff-ov-scope .ld-row {
    display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; cursor: pointer;
    font-family: var(--mono); font-size: 11px; color: var(--ink); text-align: left;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
  }
  .ff-ov-scope .ld-row.is-detector { margin-left: 14px; width: calc(100% - 14px); }
  .ff-ov-scope .ld-row:hover { border-color: var(--burnt); }
  .ff-ov-scope .ld-row.is-selected { border-color: var(--amber); background: rgba(255, 176, 46, 0.08); }
  .ff-ov-scope .ld-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ff-ov-scope .ld-row .meta { opacity: 0.6; }
  .ff-ov-scope .ld-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
  .ff-ov-scope .ld-dot.source { background: #ff7a1a; }
  .ff-ov-scope .ld-dot.detector { background: #4fd8ff; }
  .ff-ov-scope .ld-item {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--panel-2); border: 1px solid rgba(255, 176, 46, 0.45); border-radius: 6px; padding: 8px;
  }
  .ff-ov-scope .ld-item__head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
  .ff-ov-scope .ld-link {
    margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--burnt);
    background: none; border: none; padding: 0; cursor: pointer;
  }
  .ff-ov-scope .ld-open, .ff-ov-scope .ld-draft {
    display: flex; flex-direction: column; gap: 5px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px;
  }
  .ff-ov-scope .ld-draft { font-size: 11px; border-color: var(--amber); }
  .ff-ov-scope .ld-open__row { display: flex; align-items: center; gap: 8px; }
  .ff-ov-scope .ld-open__row .ff-ov-btn { flex: 0 0 auto; }
  .ff-ov-scope .ld-open__main { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 11px; }
  .ff-ov-scope .ld-open__main .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ff-ov-scope .ld-open__main .meta { font-family: var(--mono); font-size: 10px; color: var(--ink-dim); }
  .ff-ov-scope .ld-open__row.is-current .nm { color: var(--burnt); }
  .ff-ov-scope .ld-origin { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-dim); }
  .ff-ov-scope .ld-origin select { flex: 1; min-width: 0; }
  .ff-ov-scope .ld-net { margin: 0; }
  /* A link's length beside its detector, in the link's cool end. */
  .ff-ov-scope .ld-row .len { font-family: var(--mono); font-size: 10px; color: #bfe9ff; white-space: nowrap; }
  .ff-ov-scope .ld-where { font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); overflow-wrap: anywhere; }
  /* Saved and handed to AR Assets: the panel says so, and waits for Edit. */
  .ff-ov-scope .ld-prompt[data-parked="true"] { border-left-color: #4fd8ff; }

  /* A saved probe design's swatch in AR Assets. A design is drawn in its own two
     colours — sources orange, detectors cyan — so the swatch shows both, and is not a
     colour picker. */
  .ff-ov-scope .ov-row .sw.sw--probe {
    display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto;
    background: linear-gradient(135deg, #ff7a1a 0 50%, #4fd8ff 50% 100%);
    border: 1px solid rgba(233, 239, 248, 0.25);
  }



/* =============================================================================
   2. Account form + verification
   ========================================================================== */

/* ---------- Account form ---------- */

/* The sign-in pages and the account page are the only ones with no camera
   picture behind them, so they carry the website's bloom instead of sitting on
   a flat slab: two soft radial washes, blue high and left, orange low and
   right.  They are painted on the element itself, not a pseudo-element, so
   nothing new stacks above the content. */
.auth-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 620px at 18% -10%, rgba(43, 140, 255, 0.16), transparent 62%),
    radial-gradient(900px 560px at 88% 108%, rgba(255, 122, 26, 0.13), transparent 60%),
    var(--bg);
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(43, 140, 255, 0.10);
}
/* A hairline of the brand gradient along the card's top edge.  It is the one
   place the full cyan-to-amber sweep appears on these pages, so the card reads
   as part of the same product as the website without repeating its logo. */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0.85;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.brand b { color: var(--burnt); text-shadow: 0 0 18px rgba(255, 122, 26, 0.55); }
/* The Neurodesy mark, beside the name in the page headers.  The auth cards
   carried a 56px copy of it above their wordmark; it crowded the heading and
   said nothing the text under it did not, so the cards are text alone now. */
.logo-mark { width: 22px; height: 22px; margin-right: 10px; vertical-align: -5px; }

.tagline {
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.auth-card h1 {
  font-size: 19px;
  margin: 0 0 6px;
  font-weight: 600;
}

.auth-sub {
  color: var(--ink-dim);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 0 0 22px;
}

label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

input[type="email"], input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
}
/* One focus treatment for every field: the accent edge plus its ring, so the
   caret's location is obvious over a bright camera picture as well as a panel. */
input:focus {
  outline: none;
  border-color: var(--burnt);
  box-shadow: var(--ring);
}

.hint {
  font-size: 11px;
  color: var(--ink-dim);
  margin: -10px 0 16px;
}
.hint.ok { color: var(--burnt); }
/* A sync that did not reach the account. Not an error — the calibration is
   cached locally and the session works — so it is warned about rather than
   shouted about. */
.hint.warn { color: var(--amber); }

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

/* One stored calibration. The account may legitimately hold several rows for
   one physical lens, because a deviceId is per-browser and per-origin, so each
   row has to carry enough for the operator to tell them apart: what they named
   it, and the resolution and field of view it was taken at. */
.calib-row {
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.calib-row:last-child { border-bottom: 0; }
.calib-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calib-row__name {
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.calib-row__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-dim);
}
/* The camera actually in use. Marked rather than sorted to the top: the list is
   ordered by when each was last touched, and re-ordering it under the operator
   when they switch camera is disorienting. */
.calib-row.is-current .calib-row__name { color: var(--burnt); }
.calib-row__actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
.btn.btn-sm { padding: 4px 8px; font-size: 10px; }

/* The panel's own spacing. .hint is built to sit under a button with a negative
   top margin; here it sits under labels and buttons alike, so it is reset. */
.calib-state { margin: 0 0 12px; }
.calib-note { margin: 6px 0 14px; line-height: 1.45; }
.calib-note b { color: var(--ink); font-weight: 600; }
.calib-board { display: block; text-align: center; text-decoration: none; }

/* The 3D Probe Designer panel: one button and what it opens. .hint is built to sit
   tight under a field with a negative top margin; under a full-width button it
   needs air instead. */
.designer-note { margin: 10px 0 0; line-height: 1.45; }

/* AR Assets: the account's saved probe designs, under their own caption after the
   montages. The caption is an .ff-ov-lbl, whose margins are set by two scoped
   rules, so this one is scoped to outrank both. */
.menu-body .ff-ov-lbl.ov-sub,
.ff-ov-scope .ff-ov-lbl.ov-sub { margin: 14px 0 6px; }
.ov-sub-note { font-size: 11px; color: var(--ink-dim); line-height: 1.45; }
.calib-actions { gap: 6px; }
.calib-actions .btn { flex: 1; }

/* ---------- Calibration tool (Edge) ---------- */

.calib-wizard {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 11, 0.84);
  backdrop-filter: blur(3px);
  padding: 20px;
}
.calib-wizard[hidden] { display: none; }
body.calib-wizard-open .thumb-arc,
body.calib-wizard-open .menu-handle { visibility: hidden; }

.calib-wizard__panel {
  width: min(1180px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--burnt);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.calib-wizard__head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim);
}
.calib-wizard__cam {
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: 0; text-transform: none; color: var(--ink);
}
.calib-wizard__head .menu-close { margin-left: auto; flex-shrink: 0; }

.calib-wizard__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 0;
}
.calib-wizard__stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  min-height: 240px;
}
.calib-wizard__stage canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  object-fit: contain;
}
.calib-wizard__flash {
  position: absolute; inset: 0;
  background: var(--burnt);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}
.calib-wizard__flash.on { opacity: 0.3; transition: none; }

.calib-wizard__side {
  padding: 14px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
}
.calib-wizard__step { display: flex; flex-direction: column; gap: 10px; }
.calib-wizard__step[hidden] { display: none; }
.calib-wizard__step .btn { width: 100%; }
.calib-wizard__step input[type="text"] { margin-bottom: 0; }

.calib-wizard__status { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink); }
.calib-wizard__status.ok { color: var(--burnt); }
.calib-wizard__status.warn { color: var(--amber); }
.calib-wizard__status.error { color: var(--danger); }
.calib-wizard__hint { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-dim); min-height: 3em; }

.calib-meter { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.calib-meter__fill { height: 100%; width: 0; background: var(--burnt); transition: width 0.25s; }
.calib-wizard__count { font-size: 11px; color: var(--ink-dim); }
.calib-wizard__count span { color: var(--ink); font-variant-numeric: tabular-nums; }

.calib-checks { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 5px; font-size: 11px; color: var(--ink-dim); }
.calib-checks li::before { content: '\25CB'; display: inline-block; width: 16px; }
.calib-checks li.done { color: var(--ink); }
.calib-checks li.done::before { content: '\25CF'; color: var(--burnt); }

.calib-wizard__auto { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-dim); }

.calib-result { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 11.5px; }
.calib-result dt { color: var(--ink-dim); }
.calib-result dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calib-warnings { margin: 0; padding-left: 16px; display: grid; gap: 4px; font-size: 11px; line-height: 1.4; color: var(--amber); }
.calib-warnings:empty { display: none; }

@media (max-width: 900px) {
  .calib-wizard { padding: 0; }
  .calib-wizard__panel { height: 100%; border-radius: 0; }
  .calib-wizard__body { grid-template-columns: 1fr; overflow-y: auto; }
  .calib-wizard__stage canvas { max-height: 50vh; max-height: 50dvh; }
  .calib-wizard__side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}

/* Edge-only sections. Core and Edge share this shell; the platform is stamped
   on <body> at send time, and anything marked here simply does not exist on
   Core. Display rather than visibility so it takes no layout either. */
[data-edge-only] { display: none; }
body[data-platform="edge"] [data-edge-only] { display: block; }
body[data-platform="edge"] .opt-inline[data-edge-only] { display: flex; }
/* The live Probe Designer's panel is a column. Set here, beside the rule it has
   to beat: `.ff-ov-scope .ld { display: flex }` loses to the block above on
   Edge, and one strong enough to win would show the panel on Core. */
body[data-platform="edge"] .ld[data-edge-only] { display: flex; }

/* The mirror image: shown on Core, hidden on Edge. For the places where Core
   explains the absence of a feature rather than simply not having it. */
body[data-platform="edge"] [data-core-only] { display: none; }

button {
  font-family: var(--mono);
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--burnt);
  border: none;
  border-radius: 8px;
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.switch {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-dim);
  text-align: center;
}
.switch button {
  background: none;
  border: none;
  color: var(--amber);
  text-decoration: underline;
  font-size: 12px;
  padding: 0;
}

.msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: rgba(255, 95, 87, 0.12); border: 1px solid rgba(255, 95, 87, 0.4); color: var(--danger); }
.msg.ok    { background: rgba(79, 216, 255, 0.10); border: 1px solid rgba(79, 216, 255, 0.35); color: var(--ok); }

/* ---------- Signup profile fields + verification states ---------- */

label .req, label .opt {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  margin-left: 6px;
  opacity: 0.75;
}
label .opt { color: var(--ink-dim); }
label .req { color: var(--burnt); }

input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
}
input[type="text"]:focus { outline: none; border-color: var(--burnt); box-shadow: var(--ring); }

/* Big glyph carrying the state of the confirmation flow. */
.pending-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 4px 0 18px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  background: rgba(255, 122, 26, 0.12);
  border: 1px solid rgba(255, 122, 26, 0.45);
  color: var(--burnt);
}
.pending-mark.ok {
  background: rgba(79, 216, 255, 0.12);
  border-color: rgba(79, 216, 255, 0.45);
  color: var(--ok);
}
.pending-mark.bad {
  background: rgba(255, 95, 87, 0.12);
  border-color: rgba(255, 95, 87, 0.45);
  color: var(--danger);
}

.fineprint {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* The continue link is an <a> styled as the primary button, so it needs the
   block/centre treatment that <button> gets for free. */
a.btn-primary {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

[hidden] { display: none !important; }

/* ---------- Touch devices ----------------------------------------------
   Keyed on (pointer: coarse) rather than a width breakpoint: what matters is
   that the input device is a fingertip, which is true of a large tablet and
   false of a small laptop window.

   Two specific problems this fixes:

   1. iOS Safari zooms the whole page whenever a focused input has a font-size
      below 16px. The user then has to pinch back out to see the form they are
      filling in. 16px is the threshold, not a preference.

   2. Apple's HIG and the WCAG target-size guidance both put the minimum
      comfortable tap target around 44px. The desktop controls sit near 39px,
      which is fine for a cursor and fiddly for a thumb.
   ---------------------------------------------------------------------- */
@media (pointer: coarse) {
  input[type="email"],
  input[type="password"],
  input[type="text"] {
    font-size: 16px;      /* stops iOS focus-zoom — do not lower */
    padding: 13px 14px;
    min-height: 48px;
  }

  .btn-primary,
  a.btn-primary {
    min-height: 48px;
    font-size: 14px;
  }

  .switch button { padding: 8px 4px; min-height: 44px; }

  /* Core HUD controls */
  .btn { min-height: 44px; font-size: 12px; }

  /* Checkbox rows in the montage list — the label is the tap target, so give
     the whole row height rather than trying to enlarge the box itself. */
  .ov-row { padding: 9px 0; min-height: 44px; }
  .ov-row input[type="checkbox"] { width: 20px; height: 20px; }
  /* A colour swatch is a target now, not a legend. 16px is a mouse size. */
  .ff-ov-scope .ov-row input[type="color"].sw { width: 26px; height: 26px; }
  .ov-row label { font-size: 13px; }
}

/* The stage must track the visible viewport, not the layout viewport. On
   mobile browsers the address bar shrinks and grows as you scroll, and 100vh
   refers to the LARGER of those states — so a 100vh stage is taller than the
   screen and the bottom of the control panel sits under the browser chrome.
   dvh follows the visible area; the vh line stays as the fallback. */
.core-body { height: 100vh; height: 100dvh; }
.stage { height: 100vh; height: 100dvh; }

/* Landscape on a phone is short. Cap the panel so it cannot swallow the
   camera view it is meant to control. */
@media (max-width: 900px) and (orientation: landscape) {
  .panel { max-height: 78vh; max-height: 78dvh; overflow-y: auto; }
}

/* =============================================================================
   4. Account page

   Same palette and typographic voice as the marketing site — burnt amber on
   near-black, mono throughout — so signing in does not feel like leaving the
   product. Deliberately plain: this page has one job, which is choosing what to
   launch.
   ========================================================================== */

.account-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* The same bloom as .auth-wrap; fixed so it stays put while the page scrolls. */
  background:
    radial-gradient(1100px 620px at 18% -10%, rgba(43, 140, 255, 0.16), transparent 62%),
    radial-gradient(900px 560px at 88% 108%, rgba(255, 122, 26, 0.13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* IN FLOW, deliberately.

   `header { position: fixed }` in section 1 styles the Core HUD, where the
   header floats over the camera picture. It is an ELEMENT selector, so it also
   caught this one — the account header was lifted out of the document and the
   page content ran underneath it. The markup compensated with five <br> tags,
   which is a fixed 87px against a header that wraps: give someone a normal
   institutional email address and the right-hand group moves to a second row,
   the header grows to ~143px, and it covers the greeting again.

   Declaring position here is the fix, and it holds at any header height. The
   background has to be re-stated too, because the HUD's fade-to-transparent
   gradient makes no sense above a scrolling page. */
.acct-header {
  position: relative;
  z-index: 1;
  background: var(--bg);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
/* The email can be long; let it wrap or ellipsise instead of forcing the
   whole right-hand group onto its own row at every width. */
.acct-who { min-width: 0; overflow-wrap: anywhere; }
.acct-header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.acct-who { font-size: 11.5px; color: var(--ink-dim); letter-spacing: 0.04em; }
.acct-signout {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.acct-signout:hover { border-color: var(--danger); color: var(--danger); }
.acct-signout:disabled { opacity: 0.55; cursor: not-allowed; }

.acct-main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) clamp(16px, 4vw, 40px) 48px;
}

.acct-eyebrow {
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--burnt); margin: 0 0 10px;
}
.acct-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.acct-lede {
  font-size: 13px; line-height: 1.7; color: var(--ink-dim);
  max-width: 60ch; margin: 0 0 clamp(24px, 5vw, 40px);
}

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

.acct-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--burnt);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 rgba(255, 122, 26, 0), 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.acct-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow-amber), 0 18px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}
/* A locked card is inactive, so it neither glows nor moves. */
.acct-card.locked:hover { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); transform: none; }
/* A product the account cannot launch yet still shows, so the roadmap is
   visible — but it reads as inactive rather than broken. */
.acct-card.locked { border-top-color: var(--line); opacity: 0.72; }

.acct-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.acct-card__name { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.acct-card__badge {
  margin-left: auto;
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px;
  color: var(--ink-dim);
}
.acct-card__badge[data-status="available"] { color: var(--burnt); border-color: var(--burnt); }

.acct-card__desc { font-size: 12.5px; line-height: 1.6; color: var(--ink-dim); margin: 0 0 14px; }
.acct-card__features { margin: 0 0 18px; padding-left: 16px; }
.acct-card__features li {
  font-size: 12px; line-height: 1.6; color: var(--ink-dim); margin-bottom: 5px;
}
.acct-card__features li::marker { color: var(--burnt); }

.acct-card__launch {
  margin-top: auto;
  display: block; text-align: center; text-decoration: none;
  box-sizing: border-box;
}

/* Edge tools: tools that open in their own tab, under the platform cards. */
.acct-tools { margin-top: clamp(28px, 5vw, 44px); }
.acct-tools[hidden] { display: none; }
.acct-tools__title {
  margin: 0 0 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim);
}

.acct-foot { margin-top: clamp(28px, 5vw, 44px); max-width: 60ch; }
/* IN FLOW, for the reason .acct-header is: `footer { position: fixed }` in
   section 1 styles the Core HUD's credit line, which floats over the camera
   picture, and it is an ELEMENT selector, so it caught this one too. The
   account page's footer was therefore pinned 8px off the bottom of the
   viewport with a transparent background, and every card scrolled underneath
   it. Declaring position here is the fix; left and pointer-events have to be
   undone as well, or the line sits 12px in and takes no clicks. */
.acct-footer {
  position: static;
  pointer-events: auto;
  padding: 18px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim); opacity: 0.7;
}

/* =============================================================================
   5. Handheld shell

   Everything below is additive and gated: either on `.touch-shell` (set by
   app.js only when the device is genuinely handheld) or on an explicit
   `[hidden]` removal. Desktop renders none of it, so the pointer-driven UI is
   untouched — the one exception is the loupe, which a mouse user can opt into
   from the Probe Designer because a dense fishnet is hard to hit with a
   cursor too.
   ========================================================================== */

/* ---------- Thumb arc ---------- */

/* The element is a zero-size PIVOT POINT, not a box: every button is placed
   relative to it and is centred on its own position via a negative margin.
   So the inset has to clear half the largest button (31px) plus a margin, or
   the pivot itself hangs off the corner. */
.thumb-arc {
  position: fixed;
  z-index: 30;
  width: 0; height: 0;
  bottom: calc(42px + env(safe-area-inset-bottom, 0px));
  right: calc(44px + env(safe-area-inset-right, 0px));
}
.thumb-arc[hidden] { display: none; }
.thumb-arc[data-hand="left"] {
  right: auto;
  left: calc(44px + env(safe-area-inset-left, 0px));
}

.arc-btn {
  position: absolute;
  left: 0; top: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(11, 19, 31, 0.94);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--mono);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  transition: transform .22s cubic-bezier(.22,.61,.36,1), opacity .16s ease, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.arc-btn:active { background: var(--panel-2); }
.arc-ico { font-size: 17px; line-height: 1; }
.arc-lbl {
  font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim);
}

/* The pivot. Larger, and present in both modes. */
.arc-menu {
  width: 62px; height: 62px; margin: -31px 0 0 -31px;
  border-color: var(--burnt);
  color: var(--burnt);
  z-index: 2;
}

/* Recording dot doubles as the start/stop state. */
.arc-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--burnt);
}
.thumb-arc.tracking .arc-dot { background: var(--danger); animation: arcPulse 1.6s ease-in-out infinite; }
@keyframes arcPulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }


/* ---------- Telemetry chip ---------- */

.tele-chip {
  position: fixed;
  z-index: 26;
  top: calc(58px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 7px;
  padding: 9px 13px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 19, 31, 0.92);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--mono);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  -webkit-tap-highlight-color: transparent;
}
.tele-chip[hidden] { display: none; }
.tele-chip__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-dim);
}
.tele-chip.live .tele-chip__dot { background: var(--danger); animation: arcPulse 1.6s ease-in-out infinite; }
.tele-chip__n { font-size: 13px; font-weight: 700; color: var(--burnt); }
.tele-chip__lbl { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }

/* ---------- Handheld layout ---------- */

/* Set by app.js, not by a media query: the decision needs maxTouchPoints and
   screen size together, which CSS alone cannot express. */
.touch-shell .tele-panel {
  top: auto; left: 0; right: 0; bottom: 0;
  width: 100%; max-width: none;
  max-height: 62vh; max-height: 62dvh;
  border-radius: 14px 14px 0 0;
  border-left: none; border-right: none; border-bottom: none;
  transform: translateY(101%);
  transition: transform .26s cubic-bezier(.22,.61,.36,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.touch-shell .tele-panel.sheet-open { transform: translateY(0); }
/* Dragging the header to reposition is a mouse idiom; on a sheet it fights
   the scroll. The chip is the control instead. */
.touch-shell .tele-head { cursor: default; }
.touch-shell .tele-grip { display: none; }

/* The stage owns the full window on a handheld; the header shrinks so it does
   not eat the picture. */
.narrow-shell header { padding: 8px 12px; }
.narrow-shell .tagline { display: none; }
.narrow-shell .logo { font-size: 12px; }

/* Bottom dock is the handheld default (app.js picks it). Give it more of the
   screen than the desktop default and let it be dragged taller. */
.touch-shell[data-dock="bottom"] {
  --menu-bottom-size: 52vh;
}
.touch-shell[data-dock="bottom"] .side-menu {
  height: var(--menu-bottom-size);
  max-height: 88vh; max-height: 88dvh;
  border-radius: 14px 14px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* A grab bar, so the sheet reads as draggable. */
.touch-shell[data-dock="bottom"] .menu-topbar { position: relative; padding-top: 18px; }
.touch-shell[data-dock="bottom"] .menu-topbar::before {
  content: '';
  position: absolute; top: 7px; left: 50%;
  width: 38px; height: 4px; margin-left: -19px;
  border-radius: 2px;
  background: var(--line);
}

/* Never let the menu cover the pivot of the arc while it is open. */
.touch-shell[data-dock="bottom"].menu-open .thumb-arc { opacity: 0; pointer-events: none; }
.touch-shell .thumb-arc { transition: opacity .18s ease; }

/* Selection mode hides the chip: during aiming the screen belongs to the
   loupe and the arc. */
.touch-shell.aiming .tele-chip { opacity: 0; pointer-events: none; }

/* Landscape on a phone. The arc would sit on top of the menu, and 52vh of
   sheet leaves nothing to look at. */
@media (orientation: landscape) and (max-height: 560px) {
  .touch-shell[data-dock="bottom"] { --menu-bottom-size: 76vh; }
  .touch-shell .thumb-arc { bottom: calc(34px + env(safe-area-inset-bottom, 0px)); }
  .arc-btn { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  .arc-menu { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
}

/* Very narrow phones: a 300px panel column plus padding overflows a 320px
   viewport, which is what turns a sideways scroll into a stuck one. */
@media (max-width: 380px) {
  body[data-dock="bottom"] .menu-body .panel { min-width: 262px; flex-basis: 262px; }
}

/* =============================================================================
   6. Fixes
   ========================================================================== */

/* ---------- Sliders and field labels were scoped too tightly ----------

   `.ff-ov-scope input[type="range"]` only ever matched the AR Assets and Probe
   Designer panels, because those are the only two carrying that class. The
   Tracking panel uses the same markup but sits outside it, so its
   Responsiveness slider fell back to the browser default — ~129px wide, no
   accent colour — next to two full-width accented ones. Same for .ff-ov-lbl,
   whose uppercase caption styling simply never applied there.

   Scoping to .menu-body instead covers every panel, present and future. */
.menu-body input[type="range"] {
  width: 100%;
  accent-color: var(--burnt);
  background: transparent;
}
.menu-body .ff-ov-lbl {
  display: block; font-size: 10px; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--ink-dim); margin: 0 0 5px;
}
/* The value readout sits inside the label; keep it legible against the caption. */
.menu-body .ff-ov-lbl span { color: var(--burnt); text-transform: none; letter-spacing: 0; }

/* A native range track is ~4px tall — under a fingertip that is a coin toss.
   Padding the control gives the thumb a real target without changing the
   track's appearance. */
.touch-shell .menu-body input[type="range"] {
  height: 34px;
  padding: 0;
  margin: 2px 0 4px;
}

/* ---------- Narrow bottom dock: stack, do not sidescroll ----------

   The bottom dock lays panels out as a horizontal row of 262-300px columns.
   On a phone that means one panel visible and four behind a sideways swipe
   nobody thinks to try — and the swipe competes with each panel's own vertical
   scroller, so it often does not take even when attempted.

   Stacked in one vertically scrolling column, every panel is reachable by the
   gesture a sheet already implies. The row layout stays for wide bottom docks,
   where the columns actually fit. */
.narrow-shell[data-dock="bottom"] .menu-body {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.narrow-shell[data-dock="bottom"] .menu-body .panel {
  min-width: 0;
  flex: 0 0 auto;
  width: 100%;
  max-height: none;
  overflow-y: visible;      /* the column scrolls, not each panel */
  scroll-snap-align: none;
}

/* Wide bottom dock keeps the row — and there the panels DO need their own
   vertical scroll, plus an explicit gesture split so a sideways swipe is not
   swallowed by a panel's scroller. */
body[data-dock="bottom"]:not(.narrow-shell) .menu-body { touch-action: pan-x; }
body[data-dock="bottom"]:not(.narrow-shell) .menu-body .panel { touch-action: pan-y; }

/* ---------- Menu handle ----------

   Bottom-centre put the tab under the Android home pill, where the system
   gesture wins. Default is now hard right; long-press picks it up and a drag
   moves it anywhere along the edge (see initMenuHandleDrag). */
.narrow-shell[data-dock="bottom"] .menu-handle {
  width: 62px; height: 30px;
}
.menu-handle.repositioning {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 176, 46, 0.22);
  z-index: 60;
}
/* Long-press has no affordance of its own, so the tab says what it is doing. */
.handle-hint {
  position: fixed;
  z-index: 61;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(11, 19, 31, 0.95);
  border: 1px solid var(--amber);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
  white-space: nowrap;
}
.handle-hint.show { opacity: 1; }

/* ---------- Diagnostics row ---------- */
.diag-row {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--line);
}
.diag-row .metric__lbl { flex: 0 0 auto; }
.diag-mode {
  font-size: 11px; font-weight: 700; color: var(--burnt);
  letter-spacing: 0.06em;
}
.diag-detail {
  margin-left: auto; font-size: 10px; color: var(--ink-dim);
  letter-spacing: 0.04em; text-align: right;
}

/* Checkbox ROWS are the tap target, not the 15px box inside them. Measured at
   19-29px on a phone, which is a coin toss for a thumb; the label is what
   actually receives the tap, so give it the height. */
.touch-shell .menu-body .ff-ov-chk {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.touch-shell .menu-body .ff-ov-chk input { width: 20px; height: 20px; flex: 0 0 auto; }
.touch-shell .menu-body .opt-row > label,
.touch-shell .menu-body .opt-inline label {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.touch-shell .menu-body .opt-inline input[type="checkbox"],
.touch-shell .menu-body .opt-row input[type="checkbox"] { width: 20px; height: 20px; }

/* =============================================================================
   7. Thumb arc as a panel launcher, and paint-select
   ========================================================================== */

/* The ring is a zero-size anchor at the pivot; JS positions each button on the
   quarter circle, so slot geometry lives in one place instead of being split
   between transform rules here and index maths there. */
.arc-ring {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
}

.arc-panel-btn {
  transition: transform .26s cubic-bezier(.22,.61,.36,1),
              opacity .18s ease, border-color .15s, background .15s;
}
/* Momentary press feedback only — no latched .active state. These buttons
   open a panel; they are not a selection you remain inside, and a button that
   stayed lit after its panel had been closed described a mode that did not
   exist. */
.arc-panel-btn:active {
  border-color: var(--burnt);
  background: rgba(255, 122, 26, 0.22);
  transform-origin: center;
}

/* The pivot is Start/Stop — the one control worth the shortest reach. */
.arc-pivot {
  width: 62px; height: 62px; margin: -31px 0 0 -31px;
  border-color: var(--burnt);
  color: var(--burnt);
  z-index: 2;
}

/* Paging chevrons, tucked either side of the pivot. They duplicate the drag
   gesture rather than replacing it: a swipe is faster once you know it exists,
   and a visible control is what tells you there is more than one screenful. */
.arc-page {
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(11, 19, 31, 0.92);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.arc-page[hidden] { display: none; }
.arc-page--prev { transform: translate(-14px, -128px); }
.arc-page--next { transform: translate(-128px, -14px); }
.thumb-arc[data-hand="left"] .arc-page--prev { transform: translate(14px, -128px); }
.thumb-arc[data-hand="left"] .arc-page--next { transform: translate(128px, -14px); }

/* ---------- Solo panel sheet ----------

   Opening one panel reuses the bottom-sheet menu and hides its siblings, so
   the panels keep their existing markup, collapse behaviour and controls
   rather than being duplicated into a second presentation.

   The open panel is marked with .solo by openSoloPanel rather than matched by
   id here. This used to be one selector per panel, listing them by name, and
   the Spatial panel was added to the markup without being added to the list —
   so on a handheld it hid every panel including itself, opened onto nothing,
   and flashed the others into view for one frame as the close button cleared
   the attribute. CSS cannot compare an attribute on the body against one on a
   descendant, so the choice is a list that must be maintained by hand or a
   class that cannot be forgotten. This is the class.

   Specificity note: .panel.solo has to outrank both the hide rule above and
   [data-edge-only]'s own display rules, which it does. */
body[data-solo-panel] .menu-body .panel { display: none; }
body[data-solo-panel] .menu-body .panel.solo { display: block; }

/* The product boundary outranks the sheet.

   [data-edge-only] is hidden on Core by a rule far weaker than .panel.solo, so
   a panel that somehow arrived marked solo on Core would be shown by the sheet
   in spite of it. Unreachable through the arc, which builds no button for it,
   and openSoloPanel refuses it as well — but the line between two products is
   not a thing to leave resting on one guard in one function. */
body:not([data-platform="edge"]) .menu-body .panel[data-edge-only].solo { display: none; }

/* A single panel needs no dock switcher or pin; the arc is the navigation.

   Scoped to the topbar. A bare .menu-seg matched every segmented control in
   the menu, not just the dock switcher — which on a handheld took the thumb-arc
   side switcher and the left/right sides check down with it, on exactly the
   device where both of them matter. */
.touch-shell[data-solo-panel] .menu-topbar .menu-seg,
.touch-shell[data-solo-panel] #pinBtn { display: none; }

/* Sized to the one panel rather than to the whole menu, so a short panel does
   not leave half the screen as empty sheet. */
.touch-shell[data-solo-panel][data-dock="bottom"] .side-menu {
  height: auto;
  max-height: 74vh; max-height: 74dvh;
}

/* ---------- Paint-select ---------- */

.paint-hint {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11, 19, 31, 0.94);
  border: 1px solid var(--burnt);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.paint-hint.show { opacity: 1; }

/* While a stroke is down, the cursor and any text selection would both fight
   the gesture. */
body.painting { user-select: none; -webkit-user-select: none; }
body.painting #videoStage { cursor: crosshair; }

/* Selection mode dims the chrome that is not part of it, so the mesh is the
   brightest thing on screen while picking. */
body.aiming .tele-chip { opacity: 0; pointer-events: none; }

/* ---------- Sheet swipe-down ---------- */

/* While a finger is on the grab bar the sheet follows it 1:1, so the transition
   has to be off or every frame would lag behind the thumb. It comes back for
   the spring-back and for the close. */
.side-menu.dragging {
  transition: none;
  will-change: transform;
}

/* The bar is the drag handle, so the browser must not claim the gesture for
   scrolling first. */
.touch-shell[data-dock="bottom"] .menu-topbar {
  touch-action: none;
  cursor: grab;
}
.touch-shell[data-dock="bottom"] .menu-topbar:active { cursor: grabbing; }

/* A wider, more obvious grab bar now that it does something. */
.touch-shell[data-dock="bottom"] .menu-topbar::before {
  width: 46px;
  height: 5px;
  margin-left: -23px;
  background: var(--ink-dim);
  opacity: 0.55;
}

/* ---------- Design-surface rows ----------

   Radios rather than checkboxes: the Probe Designer works on one surface at a
   time, and two visible at once would compete for every pick. The row styling
   is shared with AR Assets so the two lists read as the same kind of control
   with different arity. */
.ov-row--radio input[type="radio"] {
  accent-color: var(--burnt);
  width: 15px; height: 15px;
  flex: 0 0 auto;
  cursor: pointer;
}
.touch-shell .menu-body .ov-row--radio input[type="radio"] { width: 20px; height: 20px; }

/* The active surface is the one being designed on, so it earns emphasis in a
   way an AR asset checkbox does not. */
.ov-row--radio:has(input:checked) .nm { color: var(--burnt); font-weight: 600; }
.ov-row--radio:has(input:checked) .ct { color: var(--ink); }

/* ---------- Account card statuses ----------

   The badge carries the state; the card body dims for anything not launchable.
   An unknown status still renders — it falls through to the neutral base style
   rather than vanishing, so a new value in products.json is a colour choice to
   make later, not a broken card today. */
.acct-card__badge[data-status="coming_soon"] { color: var(--ink-dim); border-color: var(--line); }
.acct-card__badge[data-status="beta"]        { color: var(--amber); border-color: var(--amber); }
.acct-card__badge[data-status="maintenance"] { color: var(--danger); border-color: var(--danger); }

/* A locked card keeps its top rule neutral so the amber accent reads as
   "this one is ready" across a grid of several. */
.acct-card.locked .acct-card__launch { opacity: .5; cursor: not-allowed; }

/* ---------- Camera chooser (desktop) ----------

   A dialog rather than a dropdown: the list is short, the labels are long
   ("HD Pro Webcam C920 (046d:082d)"), and picking one restarts the stream —
   an action worth a deliberate click rather than a hover-away. */
.cam-chooser {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 11, 0.72);
  backdrop-filter: blur(3px);
  padding: 24px;
}
.cam-chooser[hidden] { display: none; }

.cam-chooser__panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--burnt);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  overflow: hidden;
}
.cam-chooser__head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim);
}
.cam-chooser__head .menu-close { margin-left: auto; }
.cam-chooser__list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.cam-option {
  display: block; width: 100%; text-align: left;
  font-family: var(--mono); font-size: 12.5px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cam-option:hover { border-color: var(--burnt); }
.cam-option.active { border-color: var(--burnt); color: var(--burnt); }
.cam-option.active::after { content: ' — in use'; color: var(--ink-dim); font-size: 11px; }

/* ---------- Subscribe ----------------------------------------------------
   Shares the account page's card, because a plan and a product are the same
   kind of object to the reader — a thing with a name, a description and one
   button. What is added here is the money and the emphasis: a price needs to
   be the biggest thing on the card, and one plan needs to look like the
   recommendation without the other looking like a mistake. */

.sub-grid { align-items: start; }

.sub-card { position: relative; }

/* The recommendation. A brighter rule and a lift, not a different colour
   scheme — the annual plan is the same product on better terms, and making it
   look like a different tier would be a lie about what it is. */
.sub-card--featured {
  border-color: var(--burnt);
  box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.25);
}

.sub-card__badge {
  position: absolute; top: -9px; right: 16px;
  background: var(--burnt); color: var(--bg);
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 4px; padding: 3px 8px;
}

.sub-card__price {
  display: flex; align-items: baseline; gap: 7px;
  margin: 2px 0 12px;
}
.sub-card__amount {
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sub-card__per { font-size: 12px; color: var(--ink-dim); }

.sub-card__trial {
  margin: -6px 0 12px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber);
}

.sub-card__cta { cursor: pointer; }
.sub-card__cta:disabled { opacity: 0.6; cursor: progress; }

.sub-card__note {
  margin: 10px 0 0;
  font-size: 11px; line-height: 1.5; color: var(--ink-dim);
}

/* The one line above the plans that says what just happened — a completed
   checkout, a cancelled one, a subscription they already hold. */
.sub-notice {
  margin: 0 0 clamp(20px, 3vw, 30px);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-dim);
  border-radius: 8px;
  background: var(--panel);
  font-size: 12.5px; line-height: 1.6; color: var(--ink-dim);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.sub-notice--ok   { border-left-color: var(--burnt); }
.sub-notice--warn { border-left-color: var(--amber); }
.sub-notice a:not(.btn) { color: var(--burnt); }
.sub-notice .btn, .sub-notice .acct-signout { flex: 0 0 auto; }

/* A product this account does not hold but COULD. Not dimmed like a locked
   card — there is a live button on it, and dimming the one card with something
   to do would be exactly backwards. */
.acct-card.buyable { border-top-color: var(--amber); }
.acct-card.buyable .acct-card__badge { color: var(--amber); border-color: var(--amber); }

/* On what terms this account holds the product: free while in beta, a trial
   with days left on it, a subscription with a renewal date. Amber rather than
   the dim ink the description uses, because every sentence that appears here is
   about something that ends. */
.acct-card__terms {
  margin: -4px 0 10px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber);
}

/* ---------- Beta and the free trial --------------------------------------
   The band above the plan cards: how to have Edge without paying today.
   Wider and louder than the notice above it, because on the pages where it
   appears it is the thing to do, and the cards below it are the alternative. */

.sub-trial {
  margin: 0 0 clamp(20px, 3vw, 30px);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  background: var(--panel);
}
.sub-trial[hidden] { display: none; }
.sub-trial--beta   { border-left-color: var(--burnt); }
.sub-trial--used   { border-left-color: var(--ink-dim); }

.sub-trial__lead {
  margin: 0 0 6px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.01em;
  color: var(--ink);
}
.sub-trial__note {
  margin: 0;
  font-size: 12px; line-height: 1.6; color: var(--ink-dim);
}
/* Only present when there is something to press. The margin lives on the
   button rather than the note above it so a band without one does not carry
   the gap where it would have been. */
/* `width: 100%` on .btn is right inside a card column and wrong here — a
   band-width button reads as the page's only action, and the plan cards below
   it are the point of the page. */
.sub-trial__cta {
  display: inline-block;
  width: auto;
  margin-top: 14px;
  min-height: 44px; line-height: 22px;
  text-align: center; text-decoration: none;
  cursor: pointer;
}
.sub-trial__cta:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Agreements ---------------------------------------------------
   Shown before a first launch, one at a time. Deliberately not a <dialog>:
   this must not close on Escape or a backdrop click without a decision being
   recorded, and both are the native element's default. */

.agr-veil {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 4, 7, 0.86);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 4vw, 40px);
}
.agr-veil[hidden] { display: none; }

/* The page behind must not scroll while this is up — on a phone, a modal you
   can scroll past is a modal you can ignore. */
body.agr-open { overflow: hidden; }

.agr {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--burnt);
  border-radius: 12px;
  width: min(760px, 100%);
  /* dvh as well as vh: on a phone the address bar shrinks and grows, 88vh is
     measured against the LARGER state, and the difference is exactly the strip
     the tick-box row sits in. Quoting a height taller than the screen puts the
     one control that has to be reachable off the bottom of it. */
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  display: flex; flex-direction: column;
  /* Nothing may paint outside the rounded box. If a child ever escapes it, the
     part that escapes is over the backdrop, which is the one surface here that
     is not a control — see the note in account.html about what that cost. */
  overflow: hidden;
}

/* position and pointer-events are stated rather than left to default, because
   the element selectors in section 1 set both for the HUD and would otherwise
   apply to anything semantic used in here. Every part of the dialog, not just
   the two that were caught: the same rule has now bitten this markup twice, and
   the second time it was a tick-box nobody could tick. See account.html. */
.agr,
.agr__head, .agr__body, .agr__foot,
.agr__title, .agr__step, .agr__close,
.agr__check, .agr__agree { position: static; pointer-events: auto; }

.agr__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.agr__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.02em; }
.agr__step {
  margin-left: auto;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.agr__close {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-dim); font-size: 22px; line-height: 1;
  padding: 0 2px;
}
.agr__close:hover { color: var(--ink); }

/* The document itself. This is the part that scrolls. */
.agr__body {
  overflow-y: auto;
  padding: 4px 20px 18px;
  font-size: 13px; line-height: 1.65; color: var(--ink-dim);
}
.agr__body:focus-visible { outline: 2px solid var(--burnt); outline-offset: -2px; }
.agr__body h2, .agr__body h3, .agr__body h4 {
  color: var(--ink); font-size: 13px; letter-spacing: 0.02em;
  margin: 20px 0 6px;
}
.agr__body p { margin: 0 0 12px; }
.agr__body ul, .agr__body ol { margin: 0 0 12px; padding-left: 20px; }
.agr__body li { margin-bottom: 5px; }
.agr__body li::marker { color: var(--burnt); }
.agr__body strong { color: var(--ink); }
.agr__body a { color: var(--burnt); }
.agr__error { color: var(--danger); }

.agr__foot {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
/* The bare `label` rule dresses form labels as small uppercase captions, which
   is right for the control panel and wrong for a sentence somebody has to read
   and agree to. Reset here rather than there. */
.agr__check {
  display: flex; align-items: center; gap: 11px;
  text-transform: none; letter-spacing: normal; margin-bottom: 0;
  font-size: 12.5px; line-height: 1.5; color: var(--ink);
  cursor: pointer; flex: 1 1 260px;
  /* The whole row is the target, not the 17px box. A miss here used to close
     the dialog; it now does nothing, but a control somebody has to hit before
     they can proceed should not need aiming at either. */
  min-height: 44px;
  padding: 4px 6px; margin-left: -6px;
  border-radius: 8px;
}
.agr__check:hover { background: var(--panel-2); }
.agr__check input { width: 20px; height: 20px; accent-color: var(--burnt); cursor: pointer; flex: 0 0 auto; }
.agr__check input:focus-visible { outline: 2px solid var(--burnt); outline-offset: 2px; }

.agr__agree { flex: 0 0 auto; cursor: pointer; min-width: 130px; }
.agr__agree:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 520px) {
  .agr { max-height: 94vh; max-height: 94dvh; }
  .agr__agree { width: 100%; }
}

/* A finger is not a mouse pointer, and this is the one dialog where a near miss
   used to cost somebody their launch. */
@media (pointer: coarse) {
  .agr__check { min-height: 48px; font-size: 13px; }
  .agr__check input { width: 24px; height: 24px; }
  .agr__agree { min-height: 48px; }
  /* The X is the only way out now, so it has to be big enough to mean it. */
  .agr__close { min-width: 44px; min-height: 44px; font-size: 26px; }
}

/* ---- The live Probe Designer: a link's length, typed (edge/live-designer.mjs) ----------
   The box that opens over the picture when a length tag is tapped, and the Link row of
   the selected detector. */
.ld-lenedit {
  position: fixed;
  z-index: 60;
  width: 232px;
  padding: 8px 10px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--burnt);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  font-size: 12px;
}
.ld-lenedit__title { margin-bottom: 6px; font-size: 11px; color: var(--ink-dim); }
.ld-lenedit__row { display: flex; align-items: center; gap: 6px; }
.ld-lenedit__row input,
.ld-length input {
  width: 78px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.ld-lenedit__row span,
.ld-length .unit { color: var(--ink-dim); font-size: 11px; }
.ld-lenedit__note { margin-top: 6px; color: var(--ink-dim); font-size: 10.5px; line-height: 1.4; }
.ld-lenedit__error { margin-top: 4px; color: var(--danger); font-size: 11px; }
.ld-length label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-dim); }

/* ---- AR Assets: Alter position (app.js) --------------------------------------------------
   The right-click menu on a movable overlay's row, the bar over the picture while one is
   being moved, and the word that says a row has been moved. */
.ff-ov-menu {
  position: fixed;
  z-index: 70;
  min-width: 170px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.ff-ov-menu__title {
  margin-bottom: 3px;
  padding: 5px 9px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 10.5px;
}
.ff-ov-menu button {
  display: block;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.ff-ov-menu button:hover:not(:disabled),
.ff-ov-menu button:focus-visible { background: var(--panel-2); color: var(--burnt); outline: none; }
.ff-ov-menu button:disabled { color: var(--ink-dim); opacity: 0.55; cursor: default; }
.ov-row.is-placed .nm::after { content: ' · moved'; color: var(--burnt); font-size: 0.85em; }
.ff-move-bar {
  position: fixed;
  z-index: 65;
  top: 64px;
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  max-width: min(720px, calc(100vw - 24px));
  padding: 8px 12px;
  transform: translateX(-50%);
  background: rgba(11, 19, 31, 0.94);
  border: 1px solid var(--line);
  border-left: 3px solid var(--burnt);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 12px;
}
.ff-move-bar__text { flex: 1 1 260px; line-height: 1.4; }
.ff-move-bar__msg { flex-basis: 100%; color: var(--ink-dim); font-size: 11px; }
.ff-move-bar__msg[data-kind="error"] { color: var(--danger); }
.ff-move-bar__msg[data-kind="ok"] { color: var(--burnt); }
body.moving-overlay #videoStage { cursor: grab; }
body.moving-overlay #videoStage:active { cursor: grabbing; }
