
  /* ===== palette tokens ====================================================
     THREE layers, so one switch can move the tool without moving the stream image:
       --d-*      the DARK constants — the exact values from Theme.uss this tool has always used.
                  Also what every pinned surface below resolves to, in any theme.
       --t-*      the active THEME source: day here, dark in the [data-theme] block.
       --color-*  what the rest of the stylesheet reads. The names are unchanged, so no other
                  rule in this file had to be touched to make the tool themeable.
     Dark mode maps --t-* straight onto --d-*, which makes it byte-identical to the tool as it
     looked before this change — the day palette is the only new appearance. */
  :root{
    --d-bg:#0F111A; --d-bg-deep:#141722; --d-surface:#181B28;
    --d-elevated:#1E2234; --d-elevated-hover:#262B40; --d-border:#232736; --d-border-strong:#232736;
    --d-text:#E6E8F0; --d-text-muted:#969CAF;
    --d-accent:#60A5FF; --d-primary:#285AD2; --d-primary-hover:#386CE4; --d-on-primary:#ffffff;
    --d-state:#37d67a; --d-state-soft:rgba(55,214,122,0.15);
    --d-warning:#E8AC48; --d-warning-soft:rgba(232,172,72,0.14);
    --d-danger:#E2557C; --d-danger-soft:rgba(226,85,124,0.16); --d-danger-soft-hover:rgba(226,85,124,0.28);
    /* F-02 — dieselbe Gefahrenfarbe, nur hell genug fuer den Not-Aus-Knopf. Auf seiner Flaeche
       (--d-danger-soft ueber --d-surface = rgb(56,36,53)) kommt --d-danger #E2557C auf 3,94:1 und
       verfehlt die 4,5:1 der WCAG-AA; #EE6E90 kommt dort auf 4,92:1 (im echten Render nachgemessen,
       nicht nur gerechnet: Textfarbe rgb(238,110,144) auf rgb(56,36,53), Traeger #ae-tools; die
       Schrift ist 13px/600, also gilt 4,5:1 und nicht die Large-Text-Schwelle). Eigener Token statt --d-danger
       anzuheben: an --d-danger haengt jeder Loesch-Knopf des Werkzeugs, das waere eine Entscheidung
       ueber die ganze Oberflaeche statt die Behebung an der einen Stelle, die im Ernstfall in
       Sekunden lesbar sein muss. Hell braucht nichts (4,66:1, bestanden) — dort zeigt der Token
       weiter auf --t-danger, damit es genau EINE helle Gefahrenfarbe bleibt. */
    --d-danger-estop:#EE6E90;

    /* DAY — derived from the website palette (global.css). Measured contrasts:
       text on surface 16.7:1, text on bg 15.1:1, muted on surface 5.6:1 (AA),
       on-primary on primary 8.6:1 (white on that cyan would be 1.6:1 and is never used),
       warning 4.6:1, danger 4.6:1. accent is 3.5:1 — headings and icons only, never body copy.
       border-strong exists because a 1.1:1 hairline is fine between panels but not as the
       outline of a control, where WCAG 1.4.11 asks for 3:1. */
    /* The ground sits a real step below the raised surfaces: white on #dbe9f2 measures 1.22:1,
       where the website's #eef9fc left only 1.08:1 and every card dissolved into the page. The
       hairline barely moves (1.46:1 to 1.51:1); it only leaves the violet-grey family for the cool
       one the rest of the palette speaks. Elevation does the remaining work, see --t-lift below. */
    --t-bg:#dbe9f2; --t-bg-deep:#ffffff; --t-surface:#ffffff;
    --t-elevated:#eef4f9; --t-elevated-hover:#e4edf5; --t-border:#c3d5e2; --t-border-strong:#7d8b99;
    /* muted is a step deeper than the website's #6b6678: on the new ground that would have been
       4.48:1, just under AA. #635e70 measures 4.97:1 there and 6.2:1 on white. */
    --t-text:#171325; --t-text-muted:#635e70;
    /* Two elevation steps, tinted with the text ink instead of neutral black so the shadow belongs
       to the palette. Only ever used inside the [data-theme="day"] rules further down — dark never
       declares them and never reads them. */
    --t-lift:0 1px 2px rgba(23,19,37,.05), 0 6px 16px -8px rgba(23,19,37,.18);
    --t-lift-hi:0 2px 4px rgba(23,19,37,.06), 0 12px 26px -10px rgba(23,19,37,.24);
    /* THREE hues, one job each. Cyan acts, violet reports a state, magenta asks for care.
       Accent is the SAME hue as primary, one tier down, so identity belongs to action instead of
       competing with it — the website's brand / brandink pairing, applied here.
       The green this replaced was never in the brand: the site removed its green ticks on purpose
       (FeatureList.astro), so a green "active" was a foreign body in a StreamTik surface. */
    --t-accent:#0a6b7d; --t-primary:#22e0ff; --t-primary-hover:#12c9ea; --t-on-primary:#06323a;
    /* live / active / connected. #7c3aed is the website's own --color-grapeink, the deep tier that
       exists for text on light. The bright brand violet #8b5cff measures 4.13:1 on white and fails
       AA for label-sized text, which is exactly why the brand ships a deep tier at all. */
    --t-state:#7c3aed; --t-state-soft:rgba(124,58,237,0.10);
    /* warning and danger share the ATTENTION hue: magenta is the one warm colour the brand owns,
       and a second alarm colour would just be a fourth hue. They differ in weight, not in hue. */
    --t-warning:#c4186d; --t-warning-soft:rgba(196,24,109,0.10);
    --t-danger:#c4186d; --t-danger-soft:rgba(196,24,109,0.12); --t-danger-soft-hover:rgba(196,24,109,0.20);
    --t-danger-estop:var(--t-danger);   /* F-02: hell besteht bereits — keine zweite helle Gefahrenfarbe */
  }
  :root[data-theme="dark"]{
    --t-bg:var(--d-bg); --t-bg-deep:var(--d-bg-deep); --t-surface:var(--d-surface);
    --t-elevated:var(--d-elevated); --t-elevated-hover:var(--d-elevated-hover);
    --t-border:var(--d-border); --t-border-strong:var(--d-border-strong);
    --t-text:var(--d-text); --t-text-muted:var(--d-text-muted);
    --t-accent:var(--d-accent); --t-primary:var(--d-primary); --t-primary-hover:var(--d-primary-hover);
    --t-on-primary:var(--d-on-primary);
    --t-state:var(--d-state); --t-state-soft:var(--d-state-soft);
    --t-warning:var(--d-warning); --t-warning-soft:var(--d-warning-soft);
    --t-danger:var(--d-danger); --t-danger-soft:var(--d-danger-soft); --t-danger-soft-hover:var(--d-danger-soft-hover);
    --t-danger-estop:var(--d-danger-estop);
  }
  :root{
    --color-bg:var(--t-bg); --color-bg-deep:var(--t-bg-deep); --color-surface:var(--t-surface);
    --color-elevated:var(--t-elevated); --color-elevated-hover:var(--t-elevated-hover);
    --color-border:var(--t-border); --color-border-strong:var(--t-border-strong);
    --color-text:var(--t-text); --color-text-muted:var(--t-text-muted);
    --color-accent:var(--t-accent); --color-primary:var(--t-primary); --color-primary-hover:var(--t-primary-hover);
    --color-on-primary:var(--t-on-primary);
    --color-state:var(--t-state); --color-state-soft:var(--t-state-soft);
    --color-warning:var(--t-warning); --color-warning-soft:var(--t-warning-soft);
    --color-danger:var(--t-danger); --color-danger-soft:var(--t-danger-soft); --color-danger-soft-hover:var(--t-danger-soft-hover);
    --color-danger-estop:var(--t-danger-estop);
  }
  /* ---- pinned: the STREAM IMAGE, never themed -------------------------------
     The overlay canvas and every embedded live preview show what OBS shows. They resolve the
     --color-* names to the dark constants, so the toggle cannot reach inside them. Custom
     properties inherit, so pinning the container covers everything it holds, today and later.
     The list is curated, not a wildcard: .ae-prevbtn is a BUTTON despite its name and must NOT
     be here, while .gl-prevwrap / .lb-prevwrap / .tm-prevwrap ARE the dark stage despite theirs. */
  #stage, .stk-ped__stage, #overlay, #gridLayer, .elem-box, .handle, .rot-handle, .rot-badge, .guide, .guide-label,
  .snap-guide, .marquee,
  .al-prev, .al-canvas, .al-stage, .al-lay-canvas-col,
  .gl-prevwrap, .lb-prevwrap, .tm-prevwrap, .tm-stage,
  .tg-prevwrap, .tg-canvas, .tg-canvas-fit, .gs-prevwrap, .gs-canvas, .gs-canvas-fit,
  .bi-pvwrap, .bi-pvgrid, .wg-prev,
  .hf-preview, .hf-prev-wrap, .fw-preview, .fw-prev-wrap, .fg-preview, .fg-prev-wrap,
  .cb-preview, .cb-prev-wrap, .co-preview, .co-prev-wrap, .lu-preview, .lu-prev-wrap,
  .ss-preview, .ss-prev-wrap, .th-preview, .th-prev-wrap, .wt-preview, .wt-prev-wrap,
  .gg-lc-prev, .gg-pos-wrap, .gg-pos-canvas, .gg-mini-canvas, .gg-pv-cur, .gg-pv-tgt,
  .gg-pv-divider, .gg-pv-fxlayer, .gg-pv-riselayer, .gl-card-prev,
  .wh-gd-stage, .wh-gd-canvaswrap, .wh-cb-prev, .bi-card-prev, .bi-pv-corner,
  .tg-lc-prev, .gs-lc-prev, .co-col--preview, .hf-col--preview{
    --color-bg:var(--d-bg); --color-bg-deep:var(--d-bg-deep); --color-surface:var(--d-surface);
    --color-elevated:var(--d-elevated); --color-elevated-hover:var(--d-elevated-hover);
    --color-border:var(--d-border); --color-border-strong:var(--d-border-strong);
    --color-text:var(--d-text); --color-text-muted:var(--d-text-muted);
    --color-accent:var(--d-accent); --color-primary:var(--d-primary); --color-primary-hover:var(--d-primary-hover);
    --color-on-primary:var(--d-on-primary);
    --color-state:var(--d-state); --color-state-soft:var(--d-state-soft);
    --color-warning:var(--d-warning); --color-warning-soft:var(--d-warning-soft);
    --color-danger:var(--d-danger); --color-danger-soft:var(--d-danger-soft); --color-danger-soft-hover:var(--d-danger-soft-hover);
    --color-danger-estop:var(--d-danger-estop);
  }
  /* Dialogs are tool UI, never a config page, so they follow the theme even while the page behind
     them is still locked. Declaring the tokens ON the dialog beats what it would otherwise inherit
     from a locked #module-view, which is why one rule covers dialogs inside and outside it. */
  .modal-overlay, .al-modal{
    --color-bg:var(--t-bg); --color-bg-deep:var(--t-bg-deep); --color-surface:var(--t-surface);
    --color-elevated:var(--t-elevated); --color-elevated-hover:var(--t-elevated-hover);
    --color-border:var(--t-border); --color-border-strong:var(--t-border-strong);
    --color-text:var(--t-text); --color-text-muted:var(--t-text-muted);
    --color-accent:var(--t-accent); --color-primary:var(--t-primary); --color-primary-hover:var(--t-primary-hover);
    --color-on-primary:var(--t-on-primary);
    --color-state:var(--t-state); --color-state-soft:var(--t-state-soft);
    --color-warning:var(--t-warning); --color-warning-soft:var(--t-warning-soft);
    --color-danger:var(--t-danger); --color-danger-soft:var(--t-danger-soft); --color-danger-soft-hover:var(--t-danger-soft-hover);
    --color-danger-estop:var(--t-danger-estop);
  }
  *{box-sizing:border-box;}
  html,body{margin:0;height:100%;background:var(--color-bg);color:var(--color-text);
    font-family:-apple-system,"Segoe UI",Roboto,sans-serif;font-size:14px;overflow:hidden;}
  button{font-family:inherit;color:inherit;cursor:pointer;border:0;}
  input,textarea,select{font-family:inherit;}
  .app{display:flex;flex-direction:column;height:100%;}
  .hidden{display:none !important;}
  .spacer,.tb-spacer{flex:1;}

