/* Glas-Design (Glassmorphism) – Elysias Standard-Design für alle Apps.
   Herkunft: Streaming Control Center 4.3.0 (scc/static/app.css), hier ohne SCC-Teile zusammengefasst.
   Dunkel ist Standard; hell mit <html data-theme="light">. Umschalten: glas.js (merkt sich die Wahl).
   Farben, Maße und Schriften NUR in den beiden Token-Blöcken ändern. Version 1.0 (12.11.2026). */

/* ------------------------------------------------------------------ Tokens: dunkel */
:root { color-scheme: dark;
  /* Maße – gleich in hell und dunkel */
  --fs-h1: 22px; --fs-h2: 16px; --fs-title: 14px; --fs-text: 13px; --fs-meta: 12px;   /* nichts unter 12 px (Ausnahme Abzeichen 11.5) */
  --gap: 12px; --gap-s: 8px; --pad: 14px;
  --h-ctl: 32px; --h-btn: 40px; --h-head: 40px;                                        /* Bedienelement / großer Knopf / Panel-Kopf */
  --r-s: 12px; --r-m: 16px; --r-l: 22px; --r-xl: 28px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", sans-serif;
  --blur: blur(28px) saturate(135%);

  /* Flächen: durchscheinendes Weiß über ruhigem Verlauf */
  --bg: #232327; --glass: rgba(255, 255, 255, .055); --solid: rgba(46, 46, 52, .88); --sheet: #2a2a2f; --popup: #2e2e34;
  --surface: rgba(255, 255, 255, .075); --raised: rgba(255, 255, 255, .13); --sunken: rgba(0, 0, 0, .24);
  --line: rgba(255, 255, 255, .11); --line-strong: rgba(255, 255, 255, .22);
  --text: #f5f5f7; --muted: rgba(245, 245, 247, .66); --faint: rgba(245, 245, 247, .42);
  --blue: #6aa8ff; --blue-soft: rgba(106, 168, 255, .2);
  --ink: #ffffff; --ink-hover: #e6e6ea; --ink-text: #1b1b1f;                           /* Hauptaktion: weiße Pille */
  --on: #3ddc84; --on-soft: rgba(61, 220, 132, .18); --off: #ff6b6b; --off-soft: rgba(255, 107, 107, .18);
  --mid: #f6c453; --mid-soft: rgba(246, 196, 83, .17);
  --btn-off: rgba(222, 72, 78, .8); --btn-on: rgba(34, 160, 100, .82); --btn-mid: rgba(226, 170, 48, .9);
  --track: rgba(255, 255, 255, .26);
  --shadow: 0 8px 24px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .07);
  --hover: rgba(255, 255, 255, .09); --active: rgba(255, 255, 255, .18); --hi: inset 0 1px 0 rgba(255, 255, 255, .16);
  --scrim: rgba(10, 10, 14, .46);
  --backdrop: radial-gradient(900px 620px at 10% 6%, rgba(255, 255, 255, .15), transparent 60%),
    radial-gradient(820px 720px at 90% 88%, rgba(198, 172, 150, .24), transparent 62%),
    radial-gradient(720px 520px at 72% 8%, rgba(120, 136, 164, .22), transparent 60%),
    radial-gradient(600px 480px at 26% 96%, rgba(90, 96, 110, .3), transparent 60%),
    linear-gradient(160deg, #3b3b40, #242427 55%, #2d2a28);
}

/* ------------------------------------------------------------------ Tokens: hell */
:root[data-theme="light"] { color-scheme: light;
  --bg: #e9e9ee; --glass: rgba(255, 255, 255, .5); --solid: rgba(250, 250, 252, .94); --sheet: #f4f4f7; --popup: #ffffff;
  --surface: rgba(255, 255, 255, .62); --raised: rgba(255, 255, 255, .9); --sunken: rgba(20, 20, 30, .07);
  --line: rgba(20, 20, 30, .1); --line-strong: rgba(20, 20, 30, .2);
  --text: #1b1b1f; --muted: rgba(27, 27, 31, .66); --faint: rgba(27, 27, 31, .44);
  --blue: #2f6fde; --blue-soft: rgba(47, 111, 222, .14);
  --ink: #1b1b1f; --ink-hover: #34343b; --ink-text: #ffffff;                           /* Hauptaktion: dunkle Pille */
  --on: #14804d; --on-soft: rgba(23, 147, 90, .15); --off: #d0353b; --off-soft: rgba(217, 60, 66, .12);
  --mid: #9a6400; --mid-soft: rgba(214, 150, 20, .18);
  --btn-off: rgba(214, 62, 68, .94); --btn-on: rgba(28, 150, 94, .94); --btn-mid: rgba(222, 168, 46, .96);
  --track: rgba(20, 20, 30, .22);
  --shadow: 0 8px 24px rgba(40, 40, 60, .1), inset 0 1px 0 rgba(255, 255, 255, .7);
  --hover: rgba(20, 20, 30, .06); --active: rgba(255, 255, 255, .95); --hi: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 3px rgba(40, 40, 60, .12);
  --scrim: rgba(70, 70, 82, .32);
  --backdrop: radial-gradient(900px 620px at 10% 6%, rgba(255, 255, 255, .95), transparent 60%),
    radial-gradient(820px 720px at 90% 88%, rgba(226, 206, 188, .7), transparent 62%),
    radial-gradient(720px 520px at 72% 8%, rgba(190, 204, 228, .75), transparent 60%),
    radial-gradient(600px 480px at 26% 96%, rgba(206, 210, 222, .8), transparent 60%),
    linear-gradient(160deg, #eef0f4, #dfe1e7 55%, #e9e3de);
}

/* ------------------------------------------------------------------ Grundlage */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--backdrop); background-attachment: fixed; color: var(--text);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--blue-soft); }
h1 { font: 700 var(--fs-h1)/1.2 var(--display); letter-spacing: -.4px; margin: 0; }
h2 { font: 650 var(--fs-h2)/1.3 var(--display); margin: 0; }
h3 { font: 600 var(--fs-title)/1.3 var(--font); margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: var(--fs-meta); }
.eyebrow { font: 650 11.5px/1.2 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: var(--gap); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ App-Rahmen: Icon-Seitenleiste + Glasinhalt */
.shell { display: grid; grid-template-columns: 72px minmax(0, 1fr); height: 100vh; gap: 14px; padding: 14px; }
.side { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 12px; background: var(--glass);
  border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.side .spacer { flex: 1; }
.brand-mark { width: 38px; height: 38px; margin-bottom: 10px; position: relative; flex: none; border-radius: 13px;
  background: var(--active); border: 1px solid var(--line-strong); }
.brand-mark::after { content: ""; position: absolute; left: 10px; top: 14px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--on); box-shadow: 9px 0 0 var(--off); }
.nav-btn { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; position: relative;
  border-radius: 15px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn:hover { background: var(--hover); color: var(--text); }
.nav-btn[aria-current="page"] { background: var(--active); color: var(--text); border-color: var(--line-strong); box-shadow: var(--hi); }
.nav-btn .tip { position: absolute; left: 58px; top: 50%; transform: translateY(-50%); padding: 5px 10px; border-radius: 9px;
  background: var(--solid); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-meta); font-weight: 600;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 30; }
.nav-btn:hover .tip, .nav-btn:focus-visible .tip { opacity: 1; }
.content { display: flex; flex-direction: column; min-width: 0; height: calc(100vh - 28px); overflow: hidden; background: var(--glass);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px clamp(20px, 2.6vw, 36px) 6px; }
.main { flex: 1; min-height: 0; overflow: auto; padding: 16px clamp(20px, 2.6vw, 36px) 36px; }
.page { max-width: 1400px; margin: 0 auto; }

/* Statuslampen oben rechts */
.lights { display: flex; gap: 26px; }
.light { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 52px; }
.light .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--track); }
.light[data-s="on"] .dot { background: var(--on); box-shadow: 0 0 0 4px var(--on-soft); }
.light[data-s="off"] .dot { background: var(--off); box-shadow: 0 0 0 4px var(--off-soft); }
.light[data-s="mid"] .dot { background: var(--mid); box-shadow: 0 0 0 4px var(--mid-soft); animation: glas-pulse 1.6s ease-in-out infinite; }
.light .name { font-size: var(--fs-meta); font-weight: 650; color: var(--muted); }
@keyframes glas-pulse { 50% { opacity: .45; } }

/* ------------------------------------------------------------------ Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--hi); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: var(--gap-s); min-height: var(--h-head); padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
.panel-head .title { font: 650 var(--fs-title)/1.2 var(--display); margin-right: auto; white-space: nowrap; }
.panel-body { padding: var(--pad) 18px; }

/* ------------------------------------------------------------------ Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--text);
  font-weight: 550; white-space: nowrap; cursor: pointer; transition: background-color .12s, border-color .12s, filter .12s; }
.btn:hover:not(:disabled) { background: var(--raised); border-color: var(--line-strong); }
.btn:active:not(:disabled) { background: var(--sunken); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 28px; padding: 4px 10px; font-size: var(--fs-text); }
.btn.ghost { background: none; border-color: transparent; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ink-text); border-radius: 999px; font-weight: 600; padding-inline: 16px; }
.btn.primary:hover:not(:disabled) { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.go, .btn.stop, .btn.warn { color: #fff; border-radius: var(--r-m); font-weight: 600; }
.btn.go { background: var(--btn-on); border-color: var(--btn-on); }
.btn.stop { background: var(--btn-off); border-color: var(--btn-off); }
.btn.warn { background: var(--btn-mid); border-color: var(--btn-mid); color: #1b1407; }
:is(.btn.go, .btn.stop, .btn.warn, .btn.accent):hover:not(:disabled) { filter: brightness(1.07); }
.btn.danger { color: var(--off); }
.btn.big { min-height: 56px; padding: 0 22px; font: 700 17px/1.15 var(--display); border-radius: 20px; }

/* Segment-Umschalter */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunken); }
.seg button { border: 0; padding: 6px 14px; border-radius: 999px; background: transparent; color: var(--muted); font: 600 var(--fs-text) var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--active); color: var(--text); box-shadow: var(--hi); }

/* Schalter (input type=checkbox class="switch") */
.switch { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--track);
  position: relative; cursor: pointer; transition: background-color .15s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch:checked { background: var(--btn-on); }
.switch:checked::after { transform: translateX(16px); }

/* ------------------------------------------------------------------ Abzeichen, Hinweise, Pegel */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-meta); font-weight: 600;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--on-soft); color: var(--on); } .pill.off { background: var(--off-soft); color: var(--off); }
.pill.mid { background: var(--mid-soft); color: var(--mid); } .pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.live { background: var(--btn-off); color: #fff; font-weight: 650; }
.notice { border-radius: var(--r-m); padding: 10px 14px; background: var(--mid-soft); border: 1px solid color-mix(in srgb, var(--mid) 35%, transparent); }
.notice.info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.notice.err { background: var(--off-soft); border-color: color-mix(in srgb, var(--off) 35%, transparent); }
.notice.ok { background: var(--on-soft); border-color: color-mix(in srgb, var(--on) 35%, transparent); }
.meter { height: 12px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px;     /* Wert per style="--v: 62%" an .meter; Farben bleiben an ihrem Platz */
  background: linear-gradient(90deg, var(--on) 0 70%, var(--mid) 70% 88%, var(--off) 88%);
  clip-path: inset(0 calc(100% - var(--v, 0%)) 0 0 round 6px); transition: clip-path .1s linear; }
.big-num { font: 700 clamp(40px, 8vw, 120px)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Formulare */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-text); font-weight: 600; }
.field .hint { font-size: var(--fs-meta); color: var(--muted); }
:is(input[type=text], input[type=number], input[type=password], input[type=search], input[type=email], input[type=time], input[type=date], select, textarea) {
  min-height: 34px; padding: 7px 10px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); transition: border-color .12s, box-shadow .12s; }
:is(input, select, textarea):hover { border-color: var(--line-strong); }
:is(input, select, textarea):focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
::placeholder { color: var(--faint); }
select option { background: var(--popup); color: var(--text); }
input[type=checkbox]:not(.switch), input[type=radio], input[type=range] { accent-color: var(--blue); }
textarea { resize: vertical; }

/* Liste mit Zeilen */
.list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.list > li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-m); border: 1px solid transparent; }
.list > li:hover { background: var(--hover); }
.list > li.current { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }

/* ------------------------------------------------------------------ Dialog, Meldung */
.scrim { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--scrim);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { width: min(500px, calc(100vw - 40px)); background: var(--solid); border: 1px solid var(--line-strong); border-radius: var(--r-l);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.modal .m-body { padding: 20px 22px 8px; } .modal .m-body h2 { margin-bottom: 8px; font-size: 18px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: 420px; padding: 10px 18px;
  border-radius: 999px; background: var(--ink); color: var(--ink-text); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.toast.err { background: #e5484d; color: #fff; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; padding: 8px 12px; } .side .spacer { flex: 1; } .brand-mark { margin: 0 8px 0 0; }
  .nav-btn .tip { display: none; } .content { height: auto; min-height: 0; } }
