  /* SINFORGE — styles. The header, panels, buttons, toggle and footer stamp are
     the shared cyberdeck.tools chrome (copied from the sibling apps, not
     imported); keep them in sync when the family's chrome changes. */
  :root {
    --yellow: #fcee0a;
    --cyan: #00f0ff;
    --magenta: #ff003c;
    --bg: #050507;
    --panel: #0b0b10;
    --panel-2: #14141c;
    --text: #e8e8ee;
    --dim: #7a7a88;
    --accent: #fcee0a;
    --accent-rgb: 252,238,10;
    --main: #00f0ff;
    --main-rgb: 0,240,255;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  /* ---------- Cyberpunk scrollbars (ported from commlink-ui) ---------- */
  /* NOTE: do NOT set standard `scrollbar-color` / `scrollbar-width` on `*`.
     In Chromium they take precedence and silently disable every
     `::-webkit-scrollbar*` pseudo. Firefox fallback is scoped via @supports. */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.35);
  }
  ::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 0; box-shadow: none; }
  ::-webkit-scrollbar-thumb:hover { background: var(--yellow); }
  ::-webkit-scrollbar-corner { background: var(--panel); }
  ::-webkit-scrollbar-button {
    background-color: rgba(0, 240, 255, 0.08);
    background-repeat: no-repeat; background-position: center; background-size: 100% 100%;
    display: block; height: 8px; width: 8px;
  }
  ::-webkit-scrollbar-button:hover { background-color: rgba(0, 240, 255, 0.2); }
  ::-webkit-scrollbar-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='%2300f0ff'/></svg>");
  }
  ::-webkit-scrollbar-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='0,0 10,0 5,10' fill='%2300f0ff'/></svg>");
  }
  ::-webkit-scrollbar-button:horizontal:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='0,5 10,0 10,10' fill='%2300f0ff'/></svg>");
  }
  ::-webkit-scrollbar-button:horizontal:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='0,0 10,5 0,10' fill='%2300f0ff'/></svg>");
  }
  ::-webkit-scrollbar-button:start:increment,
  ::-webkit-scrollbar-button:end:decrement { display: none; }
  @supports (-moz-appearance: none) {
    * { scrollbar-color: var(--cyan) rgba(0, 240, 255, 0.06); scrollbar-width: thin; }
  }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    padding: 28px 18px 64px;
    background-image: repeating-linear-gradient(0deg, rgba(var(--main-rgb),0.03) 0 1px, transparent 1px 3px);
  }
  .app { max-width: 1800px; margin: 0 auto; }

  /* ---------- Header (shared across cyberdeck.tools apps) ---------- */
  header.top {
    display: flex; align-items: center; gap: 18px;
    border-bottom: 1px solid rgba(252,238,10,0.25); padding-bottom: 16px; margin-bottom: 22px;
  }
  .logo-menu { position: relative; }
  .logo {
    font-family: 'JetBrains Mono', monospace;
    color: var(--yellow); font-size: 22px; letter-spacing: 2px; font-weight: 700;
    background: none; border: none; cursor: pointer; transition: filter .15s;
  }
  .logo:hover { filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),0.6)); }
  .logo .chev { display: inline-block; transition: transform .2s ease; }
  .logo[aria-expanded="true"] .chev { transform: rotate(90deg); }
  .tag {
    color: var(--cyan); font-size: 12px; letter-spacing: 1px;
    border-left: 1px solid var(--dim); padding-left: 18px;
  }
  .tag .tag-meta { cursor: default; color: var(--cyan); }
  .lang-select {
    background: var(--panel); color: var(--main);
    border: 1px solid rgba(var(--main-rgb),0.4);
    padding: 6px 10px; font-family: 'JetBrains Mono', monospace;
    font-size: 12px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; cursor: pointer;
  }
  header.top .lang-select { margin-left: auto; }
  .app-menu {
    position: absolute; top: calc(100% + 12px); left: 0; z-index: 30;
    display: flex; flex-direction: column; gap: 4px;
    min-width: 240px; padding: 12px 14px;
    background: var(--panel);
    --aug-border-all: 1px; --aug-border-bg: rgba(var(--main-rgb),0.5);
    --aug-tl: 10px; --aug-br: 10px;
  }
  .app-menu[hidden] { display: none; }
  .app-menu-item {
    font-size: 16px; letter-spacing: 2px;
    color: var(--yellow); text-decoration: none; white-space: nowrap;
    padding: 6px 8px; transition: color .12s, background .12s;
  }
  .app-menu-item:hover { background: rgba(var(--main-rgb),0.12); color: var(--accent); }
  .app-menu-item.current { color: var(--main); cursor: default; }
  .app-menu-item.current:hover { background: none; }
  .glitchable { display: inline-block; white-space: pre; }
  .glitchable.glitching {
    color: var(--yellow);
    text-shadow: 2px 0 var(--cyan), -2px 0 var(--magenta);
    animation: tagGlitchJitter 0.08s steps(2) infinite;
  }
  @keyframes tagGlitchJitter {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
  }

  /* ---------- Layout: config left + right, working area center ---------- */
  .layout { display: flex; gap: 22px; align-items: stretch; }
  .config {
    width: 340px; flex-shrink: 0; padding: 16px 16px 22px;
    background: var(--panel);
    --aug-border-all: 1px; --aug-border-bg: rgba(var(--main-rgb),0.35);
    --aug-tl: 12px; --aug-br: 12px;
    align-self: flex-start;
  }
  .config h2 {
    font-size: 13px; letter-spacing: 2px; color: var(--dim);
    text-transform: uppercase; font-weight: 700; margin-bottom: 12px;
  }
  .config .hint { color: var(--dim); font-size: 12px; line-height: 1.6; }

  /* shared primary button (augmented-ui clipped corners) */
  .btn {
    --btn-color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 16px;
    background: transparent; color: var(--btn-color);
    font-family: 'JetBrains Mono', monospace; font-size: 14px; line-height: 1;
    letter-spacing: 3px; text-transform: uppercase; cursor: pointer; border: none;
    transition: background .15s, color .15s, box-shadow .15s, opacity .15s;
    --aug-border-all: 1px; --aug-border-bg: var(--btn-color);
    --aug-inlay-all: 0px; --aug-inlay-bg: transparent;
    --aug-tl: 12px; --aug-br: 12px;
  }
  .btn:hover { background: color-mix(in srgb, var(--btn-color) 22%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--btn-color) 45%, transparent); }
  .btn:disabled { opacity: .4; cursor: not-allowed; background: transparent; box-shadow: none; }
  .btn-sm { height: 36px; padding: 0 12px; font-size: 12px; letter-spacing: 2px; }
  .btn-block { width: 100%; margin-top: 16px; }
  #exportBtn::before { content: "⬇"; font-size: 1.6em; line-height: 1; letter-spacing: 0; }
  .btn-block + .btn-block { margin-top: 10px; }
  .btn-alt { --btn-color: var(--main); }

  /* shared sliding two-state toggle (ported from chronos-ui .side-switch) */
  .fx-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
  .fx-label { font-size: 12px; letter-spacing: 1.5px; color: var(--main); text-transform: uppercase; }
  .side-switch {
    position: relative; height: 30px; width: 112px; background: var(--panel);
    border: 1px solid rgba(var(--main-rgb), 0.3); cursor: pointer;
    display: flex; align-items: stretch; overflow: hidden; flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace; transition: border-color .15s;
  }
  .side-switch:hover { border-color: var(--main); }
  .side-switch .thumb {
    position: absolute; top: 0; left: 0; width: 50%; height: 100%;
    background: color-mix(in srgb, var(--main) 22%, transparent);
    transition: transform .22s cubic-bezier(.4, 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: 11px; font-weight: 700; letter-spacing: 1px; z-index: 1; position: relative;
    pointer-events: none; white-space: nowrap; color: var(--dim); transition: color .15s .08s;
  }
  .side-switch[data-pos="left"] .lab.l,
  .side-switch[data-pos="right"] .lab.r { color: var(--main); }
  .fx-toggle.disabled { opacity: .4; pointer-events: none; }

  /* faded-edge cyan horizontal divider between config sections */
  .divider {
    border: none; height: 1px; margin: 18px 0;
    background: linear-gradient(90deg, transparent, rgba(var(--main-rgb),0.55), transparent);
  }

  /* ---------- Form controls (config panels) ---------- */
  .field { margin-bottom: 12px; }
  .field > label {
    display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--dim);
    text-transform: uppercase; margin-bottom: 5px;
  }
  .config input[type="text"], .config input[type="password"], .config input[type="number"] {
    width: 100%; background: var(--bg); color: var(--text);
    border: 1px solid rgba(var(--main-rgb),0.3);
    padding: 8px 10px; font-family: 'JetBrains Mono', monospace; font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
  }
  .config input:focus {
    outline: none; border-color: var(--main);
    box-shadow: 0 0 8px rgba(var(--main-rgb),0.35);
  }
  .config input::placeholder { color: rgba(122,122,136,0.6); }
  .row { display: flex; gap: 10px; align-items: flex-end; }
  .row .field { flex: 1; margin-bottom: 0; }

  /* ---------- Center working area ---------- */
  /* sized to the viewport, not to the side columns: as they grow taller the
     preview stays put (sticky) instead of stretching and drifting down */
  .workspace {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px;
    align-self: flex-start; position: sticky; top: 16px;
  }
  .stage {
    height: max(440px, calc(100vh - 286px)); position: relative;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed rgba(var(--main-rgb),0.35);
    background: repeating-linear-gradient(45deg, rgba(var(--main-rgb),0.03) 0 12px, transparent 12px 24px);
    color: var(--dim); text-align: center; overflow: hidden;
  }
  .stage .placeholder { padding: 24px; font-size: 14px; letter-spacing: 1px; line-height: 1.8; }
  .stage .placeholder b { color: var(--main); font-size: 18px; letter-spacing: 3px; }

  @media (max-width: 1100px) {
    .layout { flex-wrap: wrap; }
    .config { width: 100%; }
    .workspace { order: -1; width: 100%; position: static; }
  }

  /* ---------- Toast (ported from eidolon-ui, augmented-ui clipped): status
     messages rise from the bottom centre and fade out; yellow = info,
     cyan = done, magenta = problem. ---------- */
  .toast {
    --toast-color: var(--yellow);
    position: fixed; left: 50%; bottom: 28px; z-index: 300;
    max-width: min(560px, calc(100vw - 40px)); padding: 11px 20px;
    background: var(--panel); color: var(--toast-color);
    font-size: 12px; letter-spacing: 2px; text-transform: uppercase; text-align: center; line-height: 1.5;
    --aug-border-all: 1px; --aug-border-bg: var(--toast-color);
    --aug-tl: 10px; --aug-br: 10px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--toast-color) 30%, transparent);
    opacity: 0; transform: translateX(-50%) translateY(20px);
    transition: opacity .2s, transform .2s; pointer-events: none;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .toast.ok { --toast-color: var(--cyan); }
  .toast.warn { --toast-color: var(--magenta); }

  /* faint fixed footer stamp (shared across cyberdeck.tools apps) */
  .footer-stamp {
    position: fixed; left: 0; right: 0; bottom: 6px; z-index: 0;
    text-align: center; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.15); pointer-events: none; user-select: none;
  }

  /* ---------- SINFORGE panels ---------- */
  .config-col { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 22px; align-self: flex-start; }
  .config-col .config { width: 100%; }
  .config h3.sub {
    font-size: 11px; letter-spacing: 2px; color: var(--yellow); font-weight: 700;
    text-transform: uppercase; margin-bottom: 8px;
  }
  .config .hint.mt, .config .mt { margin-top: 10px; }
  [data-shows][hidden] { display: none; }
  .btn-row { display: flex; gap: 8px; }
  .field-row { display: flex; gap: 8px; align-items: stretch; }
  .field-row input { flex: 1; min-width: 0; }
  .btn-icon { flex: 0 0 40px; height: auto; padding: 0; --aug-tl: 8px; --aug-br: 8px; }
  .btn-icon svg { width: 18px; height: 18px; pointer-events: none; }
  .btn-row .btn { flex: 1; padding: 0 6px; }
  /* name generator: GENERATE NAME + settings cog; the settings fold out below */
  .btn-gen { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .btn-gen svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
  .btn-gen.busy svg { animation: gen-spin .6s linear infinite; }
  @keyframes gen-spin { to { transform: rotate(360deg); } }
  .btn-icon.active { background: color-mix(in srgb, var(--btn-color) 22%, transparent); }
  .gen-config { margin-top: 4px; padding: 0 0 4px 10px; border-left: 2px solid rgba(var(--main-rgb),0.35); }
  .gen-config[hidden] { display: none; }
  /* blank picker: one icon per blank, drawn from its outline + photo window */
  .blank-pick { display: flex; flex-wrap: wrap; gap: 8px; }
  /* the bar over the stage holding the blank picker */
  .blank-bar { display: flex; align-items: center; gap: 14px; }
  .bar-label { font-size: 10px; letter-spacing: 1.5px; color: var(--dim); text-transform: uppercase; }
  .blank-bar .blank-opt, .frame-pop .blank-opt { width: 46px; height: 52px; padding: 5px; }
  .blank-opt {
    width: 56px; height: 64px; padding: 6px; line-height: 0; cursor: pointer;
    background: var(--panel); color: rgba(var(--main-rgb),0.55);
    border: 1px solid rgba(var(--main-rgb),0.3);
    transition: border-color .12s, box-shadow .12s, color .12s;
  }
  .blank-opt svg { width: 100%; height: 100%; }
  .blank-opt .bi-card { fill: color-mix(in srgb, currentColor 14%, transparent); stroke: currentColor; stroke-width: 2.5px; vector-effect: non-scaling-stroke; stroke-linejoin: miter; }
  .blank-opt .bi-photo { fill: none; stroke: currentColor; stroke-width: 1.5px; vector-effect: non-scaling-stroke; opacity: .7; }
  /* frame picker reuses the blank picker: the frame line, its ink marks and accent marks */
  .blank-opt .bi-frame { fill: color-mix(in srgb, currentColor 14%, transparent); stroke: currentColor; stroke-linejoin: miter; }
  .blank-opt .bi-mark { fill: currentColor; }
  .blank-opt .bi-accent { fill: currentColor; opacity: .5; }
  /* chip picker: the accent plate, unfilled shapes and the ink outlines */
  .blank-opt .bi-chip { fill: color-mix(in srgb, currentColor 30%, transparent); }
  .blank-opt .bi-none { fill: none; }
  .blank-opt .bi-line { stroke: currentColor; stroke-width: 1.5px; stroke-linejoin: miter; }
  .blank-opt:hover { color: var(--main); border-color: rgba(var(--main-rgb),0.8); }
  .blank-opt:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
  .blank-opt[aria-checked="true"] {
    color: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb),0.45);
  }

  /* range sliders — cyan thumb on a dim track (ported from eidolon / gridmap-ui POTENCY) */
  .potency-slider {
    -webkit-appearance: none; appearance: none; width: 112px; height: 4px;
    background: rgba(var(--main-rgb),0.25); cursor: pointer; outline: none; flex-shrink: 0;
  }
  .potency-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 12px; height: 16px;
    background: var(--main); border: none; cursor: pointer;
  }
  .potency-slider::-moz-range-thumb {
    width: 12px; height: 16px; background: var(--main); border: none; border-radius: 0; cursor: pointer;
  }
  .potency-slider:hover::-webkit-slider-thumb { box-shadow: 0 0 8px rgba(var(--main-rgb),0.7); }
  .potency-slider:hover::-moz-range-thumb { box-shadow: 0 0 8px rgba(var(--main-rgb),0.7); }
  .potency-slider:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
  .fx-label .val { color: var(--accent); font-weight: 700; letter-spacing: 1px; }

  /* dropdowns (ported from eidolon / gridmap-ui .scale-select) */
  .scale-select {
    background: var(--panel); color: var(--main); border: 1px solid rgba(var(--main-rgb),0.4);
    padding: 6px 8px; font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer; width: 158px; flex-shrink: 0;
  }
  .scale-select.wide { width: 100%; }
  .scale-select:focus { outline: none; border-color: var(--main); box-shadow: 0 0 6px rgba(var(--main-rgb),0.4); }

  /* colour swatch: a clickable augmented-ui rectangle opening a hidden colour input */
  .fill-group { position: relative; display: flex; align-items: center; width: 112px; flex-shrink: 0; }
  .fill-swatch {
    flex: 1; height: 30px; cursor: pointer; border: none; padding: 0;
    --aug-border-all: 1px; --aug-border-bg: rgba(255, 255, 255, 0.35);
    --aug-tl: 8px; --aug-br: 8px;
  }
  .fill-swatch:hover { --aug-border-bg: var(--main); }
  .fill-input { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

  /* rotation wheel: the needle points where the rotated content runs */
  .dial {
    --angle: 0deg;
    position: relative; width: 44px; height: 44px; flex-shrink: 0; margin-right: 34px;
    border-radius: 50%; border: 1px solid rgba(var(--main-rgb),0.45);
    background:
      repeating-conic-gradient(from -1deg, rgba(var(--main-rgb),0.5) 0 2deg, transparent 2deg 45deg),
      radial-gradient(circle, var(--panel) 0 62%, transparent 63%);
    cursor: grab; touch-action: none; transition: border-color .15s, box-shadow .15s;
  }
  .dial:hover, .dial:focus-visible { border-color: var(--main); box-shadow: 0 0 8px rgba(var(--main-rgb),0.45); outline: none; }
  .dial.active { cursor: grabbing; }
  .dial-needle {
    position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin-top: -1px;
    background: var(--accent); transform-origin: 0 50%; transform: rotate(var(--angle));
    box-shadow: 0 0 6px rgba(var(--accent-rgb),0.7); pointer-events: none;
  }
  .dial::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px;
    margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent);
  }

  /* colour schemes: each chip is a framed tile (like the blank picker) whose
     swatch shows card / ink / accent as three bands */
  .scheme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
  .scheme-chip {
    height: 38px; padding: 4px; line-height: 0; cursor: pointer;
    background: var(--panel); border: 2px solid rgba(var(--main-rgb),0.55);
    transition: border-color .12s, box-shadow .12s;
  }
  .scheme-swatch { display: block; width: 100%; height: 100%; border: 1px solid rgba(255,255,255,0.2); }
  .scheme-chip:hover { border-color: var(--main); }
  .scheme-chip:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
  .scheme-chip.active { border-color: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb),0.6); }

  /* the preview canvas: native resolution, scaled down to fit the stage */
  .stage { padding: 24px; }
  .stage.drop { border-color: var(--yellow); background-color: rgba(var(--accent-rgb),0.06); }
  .doc-canvas {
    display: block; max-width: 100%; max-height: 100%; min-height: min(400px, 100%);
    width: auto; height: auto; object-fit: contain; touch-action: none;
  }
  .doc-canvas.over-photo { cursor: pointer; }
  /* photo window marker: shown while the pointer is over the photo, so it
     reads as clickable (opens the frame picker) */
  .photo-hover { position: absolute; pointer-events: none; overflow: visible; display: none; }
  .photo-hover.show { display: block; }
  .photo-hover polygon {
    fill: rgba(var(--accent-rgb),0.08); stroke: var(--accent); stroke-width: 2px;
    vector-effect: non-scaling-stroke; stroke-dasharray: 8 6; animation: hover-march 0.8s linear infinite;
  }
  @keyframes hover-march { to { stroke-dashoffset: -14; } }
  .frame-pop {
    position: absolute; z-index: 41; width: auto;
    --aug-border-bg: rgba(var(--accent-rgb),0.45);
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
  }
  .frame-pop[hidden] { display: none; }
  .frame-pop .blank-pick { flex-wrap: nowrap; }
  /* date format picker: the blank picker's tiles, as text rows showing a sample date */
  .date-pick { display: grid; grid-template-columns: repeat(2, auto); gap: 8px; }
  .blank-opt.date-opt {
    width: auto; height: auto; padding: 7px 12px; line-height: 1.2;
    font-family: 'Quantico', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 1px;
  }
  .doc-canvas.dragging { cursor: grabbing; }

  /* EFFECTS / WATERMARK / PHOTO FX windows (EIDOLON's stage-tool + .adj-pop): the
     stage's top-left icons open them, one at a time; they float over the
     column to the left of the stage (same width as the left panel) */
  .stage-shell { position: relative; }
  .stage-tool {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    width: 34px; height: 34px; padding: 6px; line-height: 0; cursor: pointer;
    background: var(--panel); color: var(--main); border: 1px solid rgba(var(--main-rgb),0.35);
    transition: border-color .12s, box-shadow .12s, color .12s;
  }
  .stage-tool svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
  .stage-tool svg circle { fill: var(--panel); }
  .stage-tool-2 { top: 50px; }
  .stage-tool-3 { top: 92px; }
  .stage-tool:hover { border-color: rgba(var(--main-rgb),0.8); }
  .stage-tool:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
  .stage-tool[aria-expanded="true"] {
    color: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb),0.45);
  }
  .adj-pop {
    position: absolute; top: 0; right: calc(100% + 22px); z-index: 40;
    --aug-border-bg: rgba(var(--accent-rgb),0.45);
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
  }
  .adj-pop[hidden] { display: none; }
  .modal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .modal-head h2 { margin: 0; color: var(--accent); }
  .adj-close {
    background: none; border: none; cursor: pointer; padding: 0 4px;
    color: var(--dim); font-family: 'JetBrains Mono', monospace; font-size: 20px; line-height: 1;
  }
  .adj-close:hover { color: var(--magenta); }

  @media (max-width: 1100px) {
    .config-col { width: 100%; }
    /* no column beside the stage: drop the window inside it, under the icons */
    .config.adj-pop { top: 134px; right: auto; left: 8px; width: min(340px, calc(100% - 16px)); }
  }
