/* Messages — editor rows + dialog frame + message/choice preview */
  #clearMessages,
  #clearChoices { margin-left: auto; }

  .msg-row {
    background: var(--panel-2);
    padding: 10px 12px;
    margin-bottom: 10px;
    border-left: 2px solid var(--yellow);
    display: grid;
    grid-template-columns: 18px 1px 1fr;
    gap: 0 8px;
    align-items: stretch;
  }
  /* Messages without a resolvable contact link — red accent + visible badge */
  .msg-row.no-contact {
    border-left-color: #ff003c;
    background: color-mix(in srgb, #ff003c 6%, var(--panel-2));
  }
  /* Linked-to-contact rows: speaker + avatar are locked, save-as-contact hidden */
  .msg-row.linked .speaker-input { opacity: 0.7; cursor: default; }
  .msg-row.linked .portrait-preview { cursor: default; }
  .msg-row.linked [data-save-contact] { display: none; }
  .msg-row-divider {
    background: rgba(0, 240, 255, 0.22);
  }
  .msg-row-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
  }
  .msg-row-left .msg-pip {
    display: block;
    width: 8px;
    height: 8px;
    margin: 4px 0;
    padding: 0;
    background: var(--cyan);
    box-shadow: 0 0 7px color-mix(in srgb, var(--cyan) 65%, transparent);
    flex-shrink: 0;
  }
  .msg-row-left .idx {
    margin: 0;
    padding: 0;
    width: 18px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  .msg-row-left .idx-text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--cyan);
    font-size: 14px;
    line-height: 1;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(90deg);
    transform-origin: center;
  }
  .msg-row-left .reorder-btn {
    margin: 0;
    width: 100%;
    height: 18px;
    padding: 0;
    font-size: 12px;
    --aug-tl: 3px;
    --aug-br: 3px;
  }
  .msg-row-left .vspace {
    flex: 1 0 10px;
    align-self: stretch;
  }
  .msg-row-right {
    display: grid;
    gap: 6px;
    min-width: 0;
  }
  .portrait-wrap .portrait-preview {
    width: 32px;
    height: 32px;
    background: var(--panel);
    border: 1px dashed rgba(0, 240, 255, 0.35);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    position: relative;
  }
  .portrait-wrap .portrait-preview::before {
    content: '+';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    color: rgba(0, 240, 255, 0.55);
    pointer-events: none;
  }
  .portrait-wrap .portrait-preview.has-image::before {
    display: none;
  }
  /* Drag-and-drop hover style is shared from `.dnd-target` in base.css. */
  .portrait-icon {
    width: 100% !important;
    padding: 0 !important;
    height: 26px !important;
  }
  .portrait-icon .mi {
    width: 14px;
    height: 14px;
  }
  .msg-row .msg-row-head {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .msg-row input[type="text"] {
    flex: 1;
    background: var(--panel);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--text);
    padding: 0 10px;
    height: 32px;
    box-sizing: border-box;
    font-family: 'Tektur', sans-serif;
    font-size: 14px;
    outline: none;
  }
  .msg-row input.time-input {
    flex: 0 0 52px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 0 4px;
  }
  .side-switch {
    position: relative;
    height: 32px;
    width: 64px;
    background: var(--panel);
    border: 1px solid rgba(0, 240, 255, 0.3);
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.15s;
  }
  .side-switch:hover { border-color: var(--cyan); }
  .side-switch .thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--cyan);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
  }
  .side-switch[data-pos="right"] .thumb { transform: translateX(100%); }
  .side-switch .lab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    letter-spacing: 1px;
    z-index: 1;
    position: relative;
    pointer-events: none;
    color: var(--dim);
    transition: color 0.15s 0.08s;
  }
  .side-switch[data-pos="left"] .lab.l,
  .side-switch[data-pos="right"] .lab.r {
    color: var(--bg);
    font-weight: 700;
  }

  /* FX toggles (GLITCH / SCANLINES) — same shape, accent-colored active label */
  .fx-grid {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 8px 10px;
    align-items: center;
  }
  .fx-grid .side-switch.fx { justify-self: end; }
  .fx-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .fx-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--cyan);
    text-transform: uppercase;
  }
  .side-switch.fx { width: 70px; }
  .side-switch.fx:hover { border-color: var(--cyan); }
  .side-switch.fx .thumb {
    background: color-mix(in srgb, var(--cyan) 22%, transparent);
  }
  .side-switch.fx[data-pos="left"] .lab.l,
  .side-switch.fx[data-pos="right"] .lab.r {
    color: var(--cyan);
    font-weight: 700;
  }
  .side-switch.fx[data-pos="left"] .lab.r,
  .side-switch.fx[data-pos="right"] .lab.l {
    color: var(--dim);
    font-weight: 400;
  }
  .msg-row textarea {
    width: 100%;
    background: var(--panel);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--text);
    padding: 8px 10px;
    font-family: 'Tektur', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    min-height: 38px;
    resize: none;
    overflow: hidden;
    outline: none;
  }
  .msg-row input:focus, .msg-row textarea:focus {
    border-color: var(--yellow);
  }
  /* Drag-and-drop hover style is shared from `.dnd-target` in base.css. */
  .body-img-file { display: none !important; }
  .body-img-upload { cursor: pointer; }

  .img-popup-wrap {
    position: relative;
  }
  .img-toggle.has-image {
    background-size: cover !important;
    background-position: center !important;
    color: transparent;
    text-shadow: none;
  }
  .img-popup {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: var(--panel);
    border: 1px solid rgba(0, 240, 255, 0.45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    min-width: 160px;
  }
  .img-popup[hidden] { display: none; }
  /* Kaomoji picker — wider grid, scrollable */
  .img-popup.kao-popup {
    min-width: 300px;
    max-width: 360px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
  }
  .kao-popup .kao-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  /* Kaomoji wrap — direct rule on the span so .message.system .body's
     JetBrains Mono inheritance can't override it. Arial has wide Unicode
     coverage and renders kaomoji glyphs consistently across systems. */
  .kao,
  .kao-popup .kao-cell {
    font-family: Arial, sans-serif;
  }
  .kao-popup .kao-cell {
    height: auto;
    padding: 6px 8px;
    font-size: 12px;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
  }
  .img-popup .body-img-preview {
    width: 100%;
    height: 90px;
    background: var(--panel-2);
    border: 1px dashed rgba(0, 240, 255, 0.35);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
  }
  .img-popup .body-img-preview::before {
    content: '+';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    color: rgba(0, 240, 255, 0.55);
    pointer-events: none;
  }
  .img-popup .body-img-preview.has-image::before {
    display: none;
  }
  .img-popup .btn { width: 100%; }

  .msg-row-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
  }
  .msg-row-toolbar .btn.icon { padding: 0 8px; }
  .msg-row-toolbar .portrait-upload {
    cursor: pointer;
  }
  .toolbar-spacer {
    flex: 1;
  }

  /* Preview stage */
  .stage-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  /* stage-capture wraps the stage + floating signal-bars. The PNG exporter
     targets `stage.parentNode`, so this is now the capture rectangle —
     anything outside it (e.g. the choices dropdown) is excluded. */
  .stage-capture {
    position: relative;
  }
  /* ---------- Choices dropdown (lives below the preview, not captured) ---------- */
  .choices-dropdown {
    background: var(--panel);
    --aug-border-all: 1px;
    --aug-border-bg: rgba(0, 240, 255, 0.35);
    --aug-tl: 8px;
    --aug-br: 8px;
    padding: 0;
  }
  .choices-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-family: 'Tektur', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--cyan);
    user-select: none;
  }
  .choices-summary::-webkit-details-marker { display: none; }
  .choices-summary::marker { content: ''; }
  .choices-arrow {
    display: inline-block;
    transition: transform 0.15s ease;
    font-family: 'JetBrains Mono', monospace;
    color: var(--cyan);
  }
  details[open] .choices-arrow { transform: rotate(90deg); }
  .choices-count {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 1px;
  }
  .choices-body {
    padding: 0 12px 18px;
    border-top: 1px solid rgba(0, 240, 255, 0.12);
  }
  .choices-body #choices { padding: 14px 0 6px; }
  /* Top row above the editor: palette on the left, HIDE toggle on the right. */
  .choices-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    flex-wrap: wrap;
  }
  .choices-palette {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .hide-choices-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .choices-body .choice-edit-row {
    gap: 6px;
  }
  .choices-body .choice-edit-row .idx {
    width: auto;
    min-width: 0;
    padding: 0;
    color: var(--cyan);
    font-size: 15px;
  }
  .choices-body .reorder-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .choices-body .reorder-stack .reorder-btn {
    margin: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    --aug-tl: 3px;
    --aug-br: 3px;
  }
  .stage-meta {
    font-family: 'JetBrains Mono', monospace;
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 2px;
    display: flex;
    justify-content: space-between;
  }
  .stage {
    position: relative;
    width: 100%;
    min-height: 280px;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    --aug-border-all: 1px;
    --aug-border-bg: rgba(0, 240, 255, 0.35);
    --aug-inlay-all: 0px;
    --aug-inlay-bg: #000;
    --aug-tl: 18px;
    --aug-tr: 18px;
    --aug-br: 18px;
    --aug-bl: 18px;
  }
  #stageBg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.55) contrast(1.05) saturate(1.1);
  }
  /* Drag-and-drop highlight on the stage — class lives on `.stage-capture`
     (the parent) so the dashed frame isn't clipped by the stage's
     augmented-ui clip-path at the notched corners. Matches the universal
     `.dnd-target` look (cyan dashed + glow). */
  .stage-capture.bg-drop-target {
    position: relative;
  }
  .stage-capture.bg-drop-target::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px dashed var(--cyan);
    pointer-events: none;
    z-index: 10;
    box-shadow:
      inset 0 0 24px color-mix(in srgb, var(--cyan) 30%, transparent);
  }
  #stageBg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse at 30% 20%, rgba(252, 238, 10, 0.12), transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(0, 240, 255, 0.15), transparent 50%),
      linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.6) 100%);
  }

  /* The dialog itself (rendered to PNG) — augmented-ui driven */
  .dialog {
    --accent: var(--yellow);
    position: relative;
    margin: 40px 6%;
    padding: 32px 28px 24px;
    color: #f5f5f8;
    font-family: 'Tektur', sans-serif;

    /* augmented-ui */
    --aug-border-all: 2px;
    --aug-border-bg: var(--accent);
    --aug-inlay-all: 0px;
    --aug-inlay-bg: rgba(8, 8, 12, 0.82);
    --aug-tl: 18px;
    --aug-tr: 20px;
    --aug-br: 18px;
    --aug-bl: 14px;
    --aug-t: 16px;
    --aug-t-extend1: calc(50% - 8px);
    --aug-t-height: 2px;
    --aug-b: 16px;
    --aug-b-extend1: calc(50% - 8px);
    --aug-b-height: 2px;
  }

  /* Message frames toggle (FX → FRAMES) — wraps each message body in an
     augmented-ui chip with mirrored corner clips (TL+BR on left messages,
     TR+BL on right). The `data-augmented-ui` attribute is set per-body by
     `themes/default.js` so other themes can swap in their own bubble look. */
  .stage.frames .message:not(.system) .body {
    padding: 8px 14px;
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 10%, rgba(0, 0, 0, 0.35)),
        rgba(0, 0, 0, 0.45));
    width: fit-content;
    max-width: 100%;
    /* augmented-ui shape sizing — clips at the two diagonally-opposite
       corners, plus accent border drawn by aug-ui (no plain CSS border so
       it follows the clip silhouette correctly). */
    --aug-tl: 10px;
    --aug-tr: 10px;
    --aug-br: 10px;
    --aug-bl: 10px;
    --aug-border-all: 1px;
    --aug-border-bg: var(--accent);
  }
  .stage.frames .message.right:not(.system) .body {
    margin-left: auto;
  }

  .stage-channel {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255,255,255,0.78);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-align: center;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
    pointer-events: none;
  }
  .stage-channel.top { top: 24px; }
  .stage-channel.top:not(:empty)::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent, var(--yellow));
    box-shadow: 0 0 8px var(--accent, var(--yellow));
    vertical-align: middle;
    margin-right: 10px;
    transform: translateY(-1px);
  }
  .stage-channel.bottom { bottom: 24px; }
  .stage-channel.top:empty::before {
    content: 'COMMLINK';
    color: rgba(255,255,255,0.35);
  }
  .stage-channel.bottom:empty { display: none; }

  .messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .message {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 14px;
  }
  .message.has-portrait {
    grid-template-columns: 56px 1fr;
    align-items: start;
  }
  .message.right .content {
    text-align: right;
    align-items: flex-end;
  }
  .message.right.has-portrait {
    grid-template-columns: 1fr 56px;
  }
  .message.right.has-portrait .portrait {
    grid-column: 2;
    grid-row: 1;
  }
  .message.right.has-portrait .content {
    grid-column: 1;
    grid-row: 1;
  }
  .message + .message {
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,0.08);
  }
  .message .portrait {
    width: 56px;
    height: 56px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--accent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent);
  }
  .message .content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  .message .meta-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .message.right .meta-line {
    flex-direction: row-reverse;
  }
  .message .name {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 13px;
    letter-spacing: 3px;
  }
  .message .time {
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
  }
  .message .time:empty { display: none; }
  .message .body {
    font-size: 17px;
    line-height: 1.5;
    font-weight: 500;
    color: #eaeaf0;
    margin: 0;
    white-space: pre-wrap;
    text-shadow: 0 0 1px rgba(0,0,0,0.6);
  }
  .message .body-image {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    object-fit: contain;
    align-self: flex-start;
  }
  .message.right .body-image {
    margin-left: auto;
    align-self: flex-end;
  }

  /* System message (preview) — use inline <hr>s instead of borders, since
     applying border-top/-bottom directly to .message.system doesn't render
     reliably in this layout for reasons I haven't been able to isolate. */
  .message.system {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    padding: 0;
    max-width: 80%;
    border: none;
  }
  .message.system .sys-rule {
    display: block;
    width: 100%;
    height: 0;
    margin: 0;
    border: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.22);
  }
  /* Suppress the inherited border-top on the message immediately following
     a system message — the system's bottom <hr> already separates them. */
  .message.system + .message {
    border-top: none;
    padding-top: 0;
  }
  .message.system .body {
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 1.5px;
    text-align: center;
    margin: 0;
    white-space: pre-wrap;
  }

  /* System message (editor) — distinct visual */
  .msg-row.system {
    border-left-color: var(--cyan);
  }
  .msg-row.system .sys-label {
    font-family: 'JetBrains Mono', monospace;
    color: var(--cyan);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
  }

  .choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
    border-top: 1px dashed rgba(255,255,255,0.12);
  }
  .choice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 0.3px;
  }
  .choice .num {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 13px;
    min-width: 22px;
  }
  .choice .arrow {
    color: var(--accent);
    margin-right: 2px;
  }
  /* Pip lives in the choices EDITOR row. Cyan-edged black square; when the
     choice is marked chosen, fills with the BASE accent color. Chosen
     choices then render in the preview using `var(--accent)` instead of
     the palette-driven `--choices-color`. */
  .choice-pip {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    width: 10px;
    height: 10px;
    border: 1px solid var(--cyan);
    background: #000;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, box-shadow 0.12s;
  }
  .choice-pip:hover {
    box-shadow: 0 0 6px color-mix(in srgb, var(--cyan) 70%, transparent);
  }
  .choice-edit-row.chosen .choice-pip {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 6px color-mix(in srgb, var(--cyan) 60%, transparent);
  }
  /* Chosen choice in the preview uses the PALETTE-picked color, overriding
     the default --accent. Unchosen choices keep the base accent. */
  .choice.chosen,
  .choice.chosen .num,
  .choice.chosen .arrow {
    color: var(--choices-color);
  }

  /* ---------- Signal-strength bars ----------
     Live INSIDE .stage so the FX overlays (scanlines, vignette, noise) and
     the glitch/chromatic SVG filters layer on top of the bars too. z-index
     stays below the overlay layers (scanlines z=2, vignette z=3) so they
     tint the bars; the bars themselves render above the dialog content. */
  .stage-wrap { position: relative; }
  .signal-bars {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    pointer-events: none;
  }
  .signal-bars .bar {
    display: block;
    width: 3px;
    background: rgba(255, 255, 255, 0.18);
    transition: background 0.15s, box-shadow 0.15s;
  }
  .signal-bars .bar:nth-child(1) { height: 3px; }
  .signal-bars .bar:nth-child(2) { height: 7px; }
  .signal-bars .bar:nth-child(3) { height: 10px; }
  .signal-bars .bar:nth-child(4) { height: 13px; }
  .signal-bars .bar:nth-child(5) { height: 16px; }
  .signal-bars .bar.on {
    background: var(--accent, var(--yellow));
    box-shadow: 0 0 5px var(--accent, var(--yellow));
  }

  /* ---------- SVG stage filters (glitch + chromatic) ----------
     The actual filter chain (`url(#chromatic-aberration) url(#glitch-slices)`,
     or a subset, or `none`) is computed in render.js and pushed via the
     `--stage-filter` custom property. Listing both classes here makes
     either one a sufficient trigger. */
  .stage.glitch .dialog,
  .stage.glitch .stage-channel,
  .stage.glitch .signal-bars,
  .stage.chromatic .dialog,
  .stage.chromatic .stage-channel,
  .stage.chromatic .signal-bars {
    filter: var(--stage-filter, none);
  }
  /* Attached message images glitch harder than the surrounding text — they
     get their own `glitch-slices-strong` (~1.8x the slider) BEFORE the
     dialog's filter applies on top, so distortion compounds. */
  .stage.glitch .message .body-image {
    filter: url(#glitch-slices-strong);
  }

  .stage.scanlines::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, var(--scanline-alpha, 0.18)) 0px,
      rgba(0, 0, 0, var(--scanline-alpha, 0.18)) 1px,
      transparent 1px,
      transparent 3px
    );
    z-index: 2;
  }
  /* Vignette — radial dark fade from clear center to dark corners. Real DOM
     overlay (not ::after) because augmented-ui owns that pseudo on .stage.
     Drawn at z=3 so it sits above scanlines (z=2) and tints them too. */
  .stage-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    display: none;
  }
  .stage.vignette .stage-vignette {
    display: block;
    background: radial-gradient(
      ellipse at center,
      transparent 40%,
      rgba(0, 0, 0, var(--vignette-alpha, 0.6)) 100%
    );
  }
