  @font-face { font-family: "Space Grotesk"; src: url(fonts/space-grotesk-latin.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
  @font-face { font-family: "Inter"; src: url(fonts/inter-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
  @font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-latin.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }
  :root {
    color-scheme: dark; /* native pickers, menus and scrollbars match */
    --bg: #05030a; --panel: #0b0716; --shadow: #140a2e; --mid: #7b3ff2; --accent: #2fd6a8; --glow: #ffb46b; --text: #ece8ff;
    --line: color-mix(in srgb, var(--text) 9%, transparent);
    --dim: color-mix(in srgb, var(--text) 55%, transparent);
    --gap: 8px;
  }
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.3 Inter, system-ui, sans-serif; overflow: hidden; }
  canvas#gl, canvas#ui { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
  canvas#gl { z-index: 0; }
  canvas#ui { z-index: 2; pointer-events: none; }

  .bar { position: relative; z-index: 3; display: flex; align-items: center; gap: 18px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .group { display: flex; align-items: center; gap: 8px; }
  .spacer { flex: 1; }
  button, .btn, select { font: 500 12px Inter, sans-serif; color: var(--text); background: color-mix(in srgb, var(--text) 6%, var(--bg)); border: 1px solid var(--line); border-radius: 8px; height: 30px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; flex: none; }
  button:hover, .btn:hover, select:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
  button:disabled { opacity: 0.4; cursor: default; }
  button.primary { background: var(--accent); color: var(--bg); border-color: transparent; font-weight: 600; }
  select { padding: 0 8px; }
  #transport { display: flex; align-items: center; gap: 10px; min-width: 0; }
  /* No track, nothing to play: the button waits out of sight. */
  #btnPlay:disabled { display: none; }
  #srcName { color: var(--dim); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  #prog { width: 160px; height: 6px; border-radius: 3px; background: var(--line); cursor: pointer; display: none; }
  #progFill { height: 100%; width: 0; border-radius: 3px; background: var(--accent); }
  #time { font: 500 11px "JetBrains Mono", monospace; color: var(--dim); display: none; }
  #transport.has-buffer #prog, #transport.has-buffer #time { display: block; }
  .mon { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 11px; }
  .mon input { width: 70px; accent-color: var(--accent); }
  body.live #srcName::before { content: "● "; color: #ff4d5e; }

  #stage { position: absolute; z-index: 1; top: 52px; left: 0; right: 0; bottom: 0; padding: var(--gap); }
  .panel { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .panel > header { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
  .panel h2 { margin: 0; font: 600 11px "Space Grotesk", sans-serif; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }
  .panel h2::before { content: "· "; color: var(--accent); }
  .opts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .opt { display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: 10px; white-space: nowrap; }
  .opt span { text-transform: uppercase; letter-spacing: 0.08em; font-family: "JetBrains Mono", monospace; }
  .opt select { height: 22px; font-size: 11px; padding: 0 4px; border-radius: 6px; }
  .panel .view { flex: 1; min-height: 0; position: relative; }

  #stage { display: flex; flex-direction: column; gap: 0; }
  #stage.frame-vertical { aspect-ratio: 9 / 16; width: auto; left: 50%; right: auto; transform: translateX(-50%); }
  #stage.frame-vertical .opts { display: none; }
  /* Instagram and TikTok fill a taller phone with a 9:16 video and trim
     the sides: an iPhone 16 Pro screen is 0.46 wide to 1 tall, so 9.1% goes
     off each edge. The meters keep 9.5% of the width clear on both sides
     (0.095 x 9/16 of the stage's height), so what shows here survives. */
  #stage.frame-vertical { padding-left: calc((100vh - 52px) * 0.0534); padding-right: calc((100vh - 52px) * 0.0534); }
  body.clean #stage.frame-vertical, body.strip #stage.frame-vertical { padding-left: calc(100vh * 0.0534); padding-right: calc(100vh * 0.0534); }
  .row { display: flex; min-height: 110px; min-width: 0; } /* a meter always keeps room to draw */
  .split { flex: none; position: relative; }
  .split.v { width: var(--gap); cursor: col-resize; }
  .split.h { height: var(--gap); cursor: row-resize; }
  .split::after { content: ""; position: absolute; border-radius: 2px; background: var(--accent); opacity: 0; transition: opacity 0.15s; }
  .split.v::after { left: calc(50% - 1px); width: 2px; top: 6px; bottom: 6px; }
  .split.h::after { top: calc(50% - 1px); height: 2px; left: 6px; right: 6px; }
  .split:hover::after { opacity: 0.6; }
  body.clean .split { pointer-events: none; }
  .panel { flex: 1 1 0; }
  .panel.drop-left { box-shadow: inset 4px 0 0 var(--accent); }
  .panel.drop-right { box-shadow: inset -4px 0 0 var(--accent); }
  .panel.drop-top { box-shadow: inset 0 4px 0 var(--accent); }
  .panel.drop-bottom { box-shadow: inset 0 -4px 0 var(--accent); }
  .panel.drop-swap { box-shadow: inset 0 0 0 2px var(--accent); }
  .panel > header h2 { cursor: grab; user-select: none; }
  .panel > header h2::before { content: none; }
  .panel > header h2 { touch-action: none; }
  .panel.dragging { opacity: 0.55; outline: 1px dashed var(--accent); }
  .panel.dragging h2 { cursor: grabbing; }
  .acts { display: flex; gap: 2px; margin-left: 4px; }
  /* Narrow meters keep their name: the header settings move into the
     gear menu (Panel.fitHeader), then the title tightens and pop-out
     steps aside (maximise and it is back). Only past all that does the
     title shorten with an ellipsis. */
  .panel > header { container-type: inline-size; }
  .panel h2 { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; }
  .panel > header.tight .opts { display: none; }
  .opts, .acts { flex-shrink: 0; }
  @container (max-width: 340px) {
    .panel h2 { font-size: 10px; letter-spacing: 0.08em; }
    .act.pop { display: none; }
  }
  /* Narrower still: the buttons tighten and fill-the-window steps aside
     too (double-click the title does the same). Replace stays. */
  @container (max-width: 270px) {
    .act.max { display: none; }
    .acts { margin-left: 0; gap: 0; }
    .acts .act { width: 20px; }
  }
  .act { height: 22px; width: 24px; padding: 0; justify-content: center; border-color: transparent; background: transparent; color: var(--dim); }
  .act:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
  body.clean .acts { display: none; }
  /* At rest a meter shows only its name. Its settings and buttons fade
     in while the pointer is over it (after a beat, so passing across
     does not flicker), while one of them has focus, after a touch, and
     on the very first run until the first hover. They keep their room,
     so the header never reflows. */
  .panel > header .opts, .panel > header .acts { opacity: 0; pointer-events: none; transition: opacity 0.25s 0.2s; }
  .panel:hover > header .opts, .panel:hover > header .acts,
  .panel:focus-within > header .opts, .panel:focus-within > header .acts,
  .panel.hot > header .opts, .panel.hot > header .acts,
  body.reveal .panel > header .opts, body.reveal .panel > header .acts { opacity: 1; pointer-events: auto; transition: opacity 0.15s 0.12s; }
  body.popup .panel { position: fixed; inset: 0; border-radius: 0; border: 0; }
  body.clean .bar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; transform: translateY(-100%); transition: transform 0.18s; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
  body.clean.peek .bar { transform: none; }
  body.recording .bar { display: none; }
  body.clean #stage { top: 0; }
  body.clean .panel > header { display: none; }
  body.visual .panel > header { display: none; }
  #hint { position: fixed; z-index: 5; top: 14px; left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity 0.4s; font: 500 12px Inter, sans-serif; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; white-space: nowrap; }
  #hint.on { opacity: 1; transition-duration: 0.15s; }
  #note { position: fixed; z-index: 5; bottom: 16px; left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity 0.4s; font: 500 12px Inter, sans-serif; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
  #note.on { opacity: 1; transition-duration: 0.15s; }
  #note.act.on { pointer-events: auto; display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 5px 0 12px; width: max-content; overflow: visible; }
  #note button { height: 24px; padding: 0 10px; border-radius: 6px; color: var(--accent); }
  .empty { margin: auto; height: 40px; padding: 0 20px; font-size: 13px; }
  #rec { position: fixed; z-index: 5; top: 10px; right: 10px; display: none; align-items: center; gap: 8px; }
  body.recording #rec { display: flex; }
  #rec .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4d5e; animation: blink 1s infinite; }
  #recTime { font: 600 12px "JetBrains Mono", monospace; }
  @keyframes blink { 50% { opacity: 0.25; } }

  /* Strip: a short, wide window. One row of meters fills it. The top bar
     slides in from the top edge, and a meter's header shows only while
     the pointer is on that meter. */
  body.strip { --gap: 4px; }
  body.strip #stage { top: 0; }
  body.strip .row { min-height: 0; }
  body.strip .bar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; height: 44px; transform: translateY(-100%); transition: transform 0.18s; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
  body.strip.peek .bar { transform: none; }
  /* The app's strip has no title bar: the top 28 px are the window's
     (drag to move, its three buttons), the bar's own row sits under. */
  body.strip.nochrome .bar { height: 72px; padding-top: 28px; }
  body.strip.nochrome .bar { cursor: grab; }
  /* The handle: a short pill in the middle of the drag zone. */
  body.strip.nochrome .bar::before { content: ""; position: absolute; top: 11px; left: 50%; width: 48px; height: 5px; margin-left: -24px; border-radius: 3px; background: color-mix(in srgb, var(--text) 30%, transparent); transition: background 0.15s; }
  body.strip.nochrome .bar:hover::before { background: color-mix(in srgb, var(--text) 55%, transparent); }
  body.strip.nochrome .bar:active { cursor: grabbing; }
  /* Close, minimize, zoom, drawn by the page in the strip's bar. */
  .lights { display: none; }
  body.strip.nochrome .lights { display: flex; gap: 8px; position: absolute; top: 8px; left: 12px; }
  .lights button { width: 12px; height: 12px; min-width: 0; padding: 0; border: 0; border-radius: 50%; }
  .lights button svg { opacity: 0; }
  .lights:hover button svg { opacity: 1; }
  .lights .close { background: #ff5f57; }
  .lights .min { background: #febc2e; }
  .lights .zoom { background: #28c840; }
  body.strip.nochrome .bar button, body.strip.nochrome .bar input, body.strip.nochrome .bar canvas { cursor: pointer; }
  body.strip .panel { border-radius: 7px; }
  body.strip .panel > header { display: none; height: 26px; padding: 0 6px 0 8px; }
  body.strip .panel:hover > header, body.strip .panel:focus-within > header, body.strip .panel.hot > header { display: flex; }
  body.strip #start { display: none; }

  /* Top bar */
  .bar { gap: 10px; }
  .bar select { max-width: 150px; }
  .icon { width: 30px; padding: 0; justify-content: center; }
  .source { gap: 8px; max-width: 280px; padding: 0 10px; }
  .source #srcName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); max-width: 220px; }
  .source .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
  body.live .source .dot { background: #ff4d5e; }
  body.live #srcName::before { content: none; }
  .vol { display: flex; align-items: center; gap: 6px; color: var(--dim); }
  .vol { flex: none; }
  .vol input { width: 84px; min-width: 64px; flex: none; accent-color: var(--accent); }
  /* Drawn by hand: the Mac app's WebKit ignores accent-color on a range
     and left the track almost invisible on the dark bar. --fill is the
     level, set by app.js. */
  .vol input { -webkit-appearance: none; appearance: none; height: 16px; margin: 0; background: transparent; cursor: pointer; }
  .vol input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 80%), color-mix(in srgb, var(--text) 18%, transparent) var(--fill, 80%)); }
  .vol input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 80%), color-mix(in srgb, var(--text) 18%, transparent) var(--fill, 80%)); }
  .vol input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; border: 0; background: var(--text); }
  .vol input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--text); }
  .rec { gap: 7px; }
  .rec .rdot { width: 8px; height: 8px; border-radius: 50%; background: #ff4d5e; }
  #srcName { color: var(--text); max-width: none; font-size: 12px; }

  /* Header: main settings sit unlabeled, the rest behind the gear */
  .opts select { height: 22px; font-size: 11px; padding: 0 4px; border-radius: 6px; }
  .act[hidden] { display: none; }

  /* Floating menus (above the canvases) */
  .popover { position: fixed; z-index: 10; min-width: 220px; max-height: 70vh; overflow: auto; padding: 6px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--text) 16%, transparent); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); }
  .pop-title { font: 600 10px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding: 8px 8px 4px; }
  .pop-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 8px; font-size: 12px; }
  .pop-row select { height: 26px; font-size: 12px; min-width: 150px; }
  /* Dropdowns drawn by the page (core.js dropdown) */
  .dd { gap: 6px; padding: 0 8px; justify-content: space-between; }
  .dd svg { flex: none; opacity: 0.6; }
  .opt .dd, .opts .dd { height: 22px; font-size: 11px; padding: 0 6px; border-radius: 6px; }
  .pop-row .dd { height: 26px; font-size: 12px; min-width: 150px; }
  .menu { position: fixed; z-index: 12; max-height: 60vh; overflow: auto; padding: 4px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--text) 16%, transparent); border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); }
  .menu-item { display: flex; width: 100%; height: 26px; padding: 0 8px; border: 0; background: transparent; border-radius: 5px; font-size: 12px; }
  .menu-item:hover { background: color-mix(in srgb, var(--text) 9%, transparent); border: 0; }
  .menu-item.on { color: var(--accent); }
  .pop-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; height: auto; padding: 7px 8px; border: 0; background: transparent; border-radius: 6px; text-align: left; }
  .pop-item:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
  .pop-item small { color: var(--dim); font-size: 11px; }
  .pop-sep { height: 1px; margin: 6px 2px; background: color-mix(in srgb, var(--text) 10%, transparent); }
  .pop-item.on { color: var(--accent); }
  .pop-item.on > span::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
  .pop-item.fold { flex-direction: row; align-items: center; justify-content: space-between; color: var(--dim); }
  .pop-item.fold svg { transition: transform 0.15s; }
  .pop-item.fold.open svg { transform: rotate(90deg); }
  .pop-group { padding-left: 8px; }
  .pop-group .pop-item { padding: 5px 8px; font-size: 11.5px; }

  /* Whole-track strip in the top bar: always there while a track plays */
  #strip { display: none; flex: 1; min-width: 80px; width: 0; height: 30px; border-radius: 5px; cursor: pointer; background: color-mix(in srgb, var(--text) 4%, transparent); touch-action: none; }
  #transport.has-buffer #strip { display: block; }
  #transport.has-buffer { flex: 1; }
  #transport.has-buffer + .spacer { display: none; }

  /* Menus with pictures */
  .popover.wide { width: min(760px, calc(100vw - 24px)); overflow-x: hidden; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; padding: 4px 6px 10px; }
  .card { white-space: normal; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; height: auto; padding: 6px; text-align: left; border-radius: 9px; border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 3%, transparent); cursor: pointer; }
  .card:hover, .card:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); outline: none; }
  .card img { width: 100%; aspect-ratio: 320 / 198; object-fit: cover; border-radius: 6px; background: var(--bg); display: block; }
  .card b { font: 600 12px Inter, sans-serif; margin-top: 3px; }
  .card small { color: var(--dim); font-size: 11px; line-height: 1.3; }
  .card-del { position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 6px; background: rgba(0, 0, 0, 0.6); border: 0; font-size: 15px; opacity: 0; }
  .card:hover .card-del { opacity: 1; }
  .mini { display: flex; flex-direction: column; gap: 2px; aspect-ratio: 16 / 10; padding: 2px; border-radius: 6px; background: var(--bg); }
  .mini.tall { aspect-ratio: auto; height: 100%; min-height: 104px; width: 56%; margin: 0 auto; }
  .mini-row { display: flex; gap: 2px; min-height: 0; }
  .mini-cell { border-radius: 2px; background-size: cover; background-position: center; background-color: var(--panel); }
  .save-row { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px; margin-top: 4px; border-top: 1px solid var(--line); }
  .save-label { font: 600 10px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
  .card.on { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
  #btnLayout { gap: 6px; min-width: 132px; justify-content: space-between; }
  #layoutName { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

  /* First run: what to meter. */
  /* Lifted off the meters: a lighter card, a clear edge, and the page dimmed behind it. */
  #start { position: fixed; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); padding: 26px 28px 22px; border: 1px solid color-mix(in srgb, var(--text) 26%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--text) 9%, var(--panel)); text-align: center; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 100vmax rgba(0, 0, 0, 0.5); }
  #start h1 { margin: 0 0 18px; font: 600 20px "Space Grotesk", sans-serif; letter-spacing: 0.01em; }
  .start-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
  .start-row button { height: 38px; padding: 0 18px; font-size: 13px; }
  #start p { margin: 16px 0 0; color: color-mix(in srgb, var(--text) 72%, transparent); font-size: 12px; line-height: 1.5; }
  body.clean #start { display: none; }
  /* In the plugin the track is the source; browser-only controls go:
     sources and transport, volume, and pop-out windows (native ones
     come later). Recording stays: the plugin writes the take. */
  body.plugin:not(.app) #btnSource, body.plugin:not(.app) #transport, body.plugin:not(.app) .vol,
  body.plugin .act.pop, body.plugin #btnFull { display: none; }
  /* The plugin's bar: layouts as tabs where the browser has its source
     and transport. One line; tabs that do not fit wrap out of sight and
     stay reachable from the Layouts menu. */
  #layoutTabs { display: none; }
  body.plugin:not(.app) #layoutTabs { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 0; height: 30px; overflow: hidden; }
  body.plugin:not(.app) #layoutTabs + .spacer { display: none; }
  #layoutTabs .tab { background: none; border-color: transparent; color: color-mix(in srgb, var(--text) 62%, transparent); padding: 0 10px; }
  #layoutTabs .tab:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
  #layoutTabs .tab.on { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
  /* The app plays tracks too; the volume only matters while one plays. */
  body.app .vol { display: none; }
  body.app:has(#transport.has-buffer) .vol { display: flex; }
  .save-row input { flex: 1; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 5%, var(--bg)); color: var(--text); font: 500 12px Inter, sans-serif; }
  .swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 6px 8px; }
  .swatch { flex-direction: column; align-items: stretch; gap: 5px; height: auto; padding: 6px; border-radius: 8px; font-size: 11px; }
  .swatch.on { border-color: var(--accent); }
  .swatch .bar { height: 16px; border-radius: 4px; }
  .picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px 6px 8px; }
  .picks input[type=color] { width: 100%; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
  .pop-row input[type=color] { width: 44px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
  #btnColors { width: 46px; }
  #btnAdd { font-size: 17px; font-weight: 400; }
  /* Narrow windows keep every control in less room: names give way to
     icons (each keeps its tooltip), the volume goes last. */
  @media (max-width: 1220px) {
    .bar { gap: 10px; }
    .vol input { width: 64px; }
  }
  @media (max-width: 1020px) {
    #btnRecord .lbl { display: none; }
    #btnRecord { width: 30px; padding: 0; justify-content: center; }
    #btnLayout { min-width: 0; }
    #layoutName { max-width: 96px; }
    #srcName { max-width: 120px; }
  }
  @media (max-width: 820px) {
    .vol { display: none; }
  }
  #btnVisual { width: 34px; }
  .update { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); font: 600 12px Inter, sans-serif; text-decoration: none; white-space: nowrap; flex: none; }
  .update[hidden] { display: none; }
  .update:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  #btnVisual .knock { stroke: color-mix(in srgb, var(--text) 6%, var(--bg)); }
  #btnVisual.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
  #btnPin.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
  #btnColors .sw { width: 34px; height: 12px; border-radius: 3px; }

/* The free browser version (app.js LITE): no recording, one layout, no
   pop-outs, and the way to the full version where Record would be. */
body.lite .act.pop, body.lite #btnLayout { display: none !important; }
/* Locked meters in the free version: the meter's loop under a lock. */
.locked-view { position: absolute; inset: 0; background: rgba(5, 4, 10, 0.55); container-type: size; }
/* The meters' text is drawn on a canvas above the stage; in the free
   version the stage sits above it instead, so a locked meter's dim layer
   and card cover its text too. The stage's own boxes are transparent. */
body.lite #stage { z-index: 3; }
@container (max-width: 300px) { .locked-card span { display: none; } }
@container (max-height: 150px) { .locked-card span, .locked-card svg { display: none; } .locked-card { padding: 8px; } }
.locked-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 70%; height: 60%; min-width: min(240px, calc(100% - 24px)); min-height: min(130px, calc(100% - 24px)); padding: 16px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); border-radius: 14px; background: rgba(6, 5, 12, 0.86); border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); text-align: center; color: var(--text); font: 500 15px Inter, sans-serif; }
.locked-card svg { color: var(--accent); }
.locked-card a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 9px; background: var(--accent); color: var(--bg); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.panel.is-locked > header h2::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 2px; background: var(--accent); opacity: 0.7; vertical-align: middle; }
.cards .card.locked { position: relative; }
.cards .card.locked::after { content: 'LOCKED'; position: absolute; top: 8px; right: 8px; padding: 2px 6px; border-radius: 4px; font: 600 9px "JetBrains Mono", monospace; letter-spacing: 0.08em; background: rgba(6, 5, 12, 0.85); color: var(--accent); }
.popover.upsell { max-width: 280px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.popover.upsell b { font: 600 13px Inter, sans-serif; }
.popover.upsell p { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.45; }
.popover.upsell .upsell-cta { display: inline-flex; justify-content: center; align-items: center; min-height: 34px; border-radius: 8px; background: var(--accent); color: var(--bg); font: 600 12px Inter, sans-serif; text-decoration: none; }
#getFull { display: none; align-items: center; height: 30px; padding: 0 14px; border-radius: 8px; font: 600 12px Inter, sans-serif; color: var(--bg); background: var(--accent); text-decoration: none; white-space: nowrap; flex: none; }
#getFull:hover { filter: brightness(1.08); }
body.lite #getFull { display: inline-flex; }
/* ?design on the free page: hands over the layout being built. */
.design-copy { border-color: var(--accent); color: var(--accent); }
  /* Open space at a row's end, and the bar that drags the row's last edge. */
  .row { position: relative; }
  .slot { min-width: 0; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 8px; opacity: 0; transition: opacity 0.15s; }
  .slot:hover, .slot:focus-within { opacity: 1; }
  .slot button { height: 32px; padding: 0 14px; font-size: 13px; }
  .split.edge { position: absolute; top: 0; bottom: 0; right: calc(var(--gap) * -1); }
  body.clean .slot { visibility: hidden; }
  .split.h.edge { position: absolute; left: var(--gap); right: var(--gap); top: auto; bottom: 0; }
  .slot.below { min-height: 0; }
  /* The grip: three lines left of the title that pick a meter up. Only on
     the stage; a popped-out window has nowhere to move it. */
  .panel > header .grip { display: none; flex: none; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 0 -4px 0 -6px; border-radius: 5px; color: var(--dim); cursor: grab; touch-action: none; user-select: none; }
  #stage .panel > header .grip { display: flex; }
  .panel > header .grip:hover { color: var(--text); background: var(--line); }
  .panel.dragging .grip { cursor: grabbing; color: var(--accent); }
  body.strip .panel > header .grip { display: none; }
  /* The edges that open space always show a handle, so they can be found. */
  .split.h.edge { height: var(--gap); cursor: row-resize; }
  /* The + in a gap between meters or rows. */
  .split-add { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 24px; height: 24px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
  .split:hover .split-add, .split-add:hover, .split-add:focus-visible { opacity: 1; pointer-events: auto; }
  .split-add:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }
  body.clean .split-add { display: none; }
  /* A narrow locked meter: the button wraps inside the card. */
  @container (max-width: 220px) { .locked-card { width: calc(100% - 12px); min-width: 0; padding: 10px 6px; } .locked-card a { white-space: normal; text-align: center; font-size: 11px; padding: 6px 8px; line-height: 1.3; } }
  /* Start edges (left of each row, top of the stage) only hold a +. */
  .split.v.edge.start { right: auto; left: calc(var(--gap) * -1); cursor: default; }
  .split.h.edge.start { top: 0; bottom: auto; cursor: default; }
  .split.edge.start::after { content: none; }
  /* Thin edges get a wider invisible hover target. */
  .split.edge::before { content: ""; position: absolute; inset: -4px; }
  /* On the outer edges the + sits inside the window, not half past it. */
  .split.v.edge:not(.start) .split-add { left: auto; right: 0; transform: translateY(-50%); }
  .split.v.edge.start .split-add { left: 0; transform: translateY(-50%); }
  .split.h.edge:not(.start) .split-add { top: auto; bottom: 0; transform: translateX(-50%); }
  .split.h.edge.start .split-add { top: 0; transform: translateX(-50%); }
  .split-add { width: 26px; height: 26px; background: color-mix(in srgb, var(--text) 14%, var(--bg)); border-color: color-mix(in srgb, var(--text) 30%, transparent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
  /* Every bar that drags shows a small handle at rest; on hover the whole
     bar lights in the accent, with its + in the middle. */
  .split::after { background: var(--text); opacity: 0.28; transition: opacity 0.15s, background 0.15s; }
  .split.v::after { top: calc(50% - 16px); bottom: auto; height: 32px; width: 3px; left: calc(50% - 1.5px); }
  .split.h::after { left: calc(50% - 16px); right: auto; width: 32px; height: 3px; top: calc(50% - 1.5px); }
  .split:hover::after { background: var(--accent); opacity: 0.85; }
  .split.v:hover::after { top: 6px; height: calc(100% - 12px); width: 2px; left: calc(50% - 1px); }
  .split.h:hover::after { left: 6px; width: calc(100% - 12px); height: 2px; top: calc(50% - 1px); }
  .split.edge.start::after { content: none; }
  .split-add:hover, .split-add:focus-visible { color: var(--bg); background: var(--accent); border-color: var(--accent); }
  /* The + rides on the bar: drag it to resize, click it to add. */
  .split.v > .split-add { cursor: col-resize; }
  .split.h > .split-add { cursor: row-resize; }
  .split.edge.start > .split-add { cursor: pointer; }
