/* Publisor hub design system. One sheet for every page: Startseite (index), Zahlen, Technik, Postfach.
   Look: "Nachtlicht" – a studio at night; light mode "Tageslicht" follows the system until the toggle is used.
   Type: Big Shoulders Display for titles and big numbers, Figtree for UI, JetBrains Mono for readouts.
   Every tool owns one colour (studio pink, lagetafel orange, zahlen green, technik blue, postfach violet);
   status uses ok/warn/fail/off and never only colour (LED + word). Phones: one column, cables hidden, tab bar. */

:root {
  color-scheme: dark;
  --bg: #0b0a1a; --bg-2: #0f0d23; --panel: #13112c; --panel-2: #1a1738; --panel-3: #211d45;
  --line: #272341; --line-2: #3b365e; --line-3: #4b4677;
  --fg: #eef2ff; --fg-2: #a3aecb; --fg-3: #7c88a8; --fg-4: #596380;
  --ok: #69db7c; --warn: #ffd43b; --fail: #ff6b6b; --off: #5b6480; --info: #4dabf7;
  --c-studio: #f783ac; --c-lage: #ffa94d; --c-zahlen: #69db7c; --c-technik: #4dabf7; --c-post: #9775fa; --you: #ffa94d;
  --glow-a: rgba(151, 117, 250, 0.20); --glow-b: rgba(77, 171, 247, 0.14);
  --on-accent: #0b0a1a;
  --shadow: 0 30px 80px -40px rgba(151, 117, 250, 0.45);
  --f-display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', 'Segoe UI', sans-serif;
  --f-ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, 'SF Mono', monospace;
  --r: 14px; --r-s: 8px; --r-xs: 5px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --maxw: 1320px;
  --tabbar: 0px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eceef3; --bg-2: #f4f5f8; --panel: #ffffff; --panel-2: #f5f6f9; --panel-3: #eceef4;
    --line: #d7dae2; --line-2: #b9bec9; --line-3: #9aa1b0;
    --fg: #15171c; --fg-2: #4c5260; --fg-3: #6f7686; --fg-4: #9097a6;
    --ok: #2b8a3e; --warn: #b08900; --fail: #c92a2a; --off: #868e96; --info: #1971c2;
    --c-studio: #d6336c; --c-lage: #d9730d; --c-zahlen: #2b8a3e; --c-technik: #1971c2; --c-post: #6741d9; --you: #d9730d;
    --glow-a: rgba(103, 65, 217, 0.10); --glow-b: rgba(25, 113, 194, 0.08);
    --on-accent: #ffffff;
    --shadow: 0 24px 60px -40px rgba(21, 23, 28, 0.35);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eceef3; --bg-2: #f4f5f8; --panel: #ffffff; --panel-2: #f5f6f9; --panel-3: #eceef4;
  --line: #d7dae2; --line-2: #b9bec9; --line-3: #9aa1b0;
  --fg: #15171c; --fg-2: #4c5260; --fg-3: #6f7686; --fg-4: #9097a6;
  --ok: #2b8a3e; --warn: #b08900; --fail: #c92a2a; --off: #868e96; --info: #1971c2;
  --c-studio: #d6336c; --c-lage: #d9730d; --c-zahlen: #2b8a3e; --c-technik: #1971c2; --c-post: #6741d9; --you: #d9730d;
  --glow-a: rgba(103, 65, 217, 0.10); --glow-b: rgba(25, 113, 194, 0.08);
  --on-accent: #ffffff;
  --shadow: 0 24px 60px -40px rgba(21, 23, 28, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(900px 480px at 12% -8%, var(--glow-a), transparent 70%),
                    radial-gradient(800px 520px at 92% 4%, var(--glow-b), transparent 70%);
  background-repeat: no-repeat;
  color: var(--fg); font-family: var(--f-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.muted { color: var(--fg-3); }
.small { font-size: 12.5px; }
.display { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; line-height: 0.95; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- LEDs, chips, buttons ---------- */
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; vertical-align: 0; }
.led.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.led.warn { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.led.fail { background: var(--fail); box-shadow: 0 0 8px var(--fail); }
.led.off { background: transparent; border: 1.5px solid var(--off); }
.led.planned { background: transparent; border: 1.5px dashed var(--c-post); }
.led.you { background: var(--you); box-shadow: 0 0 7px var(--you); }
@media (prefers-reduced-motion: no-preference) {
  .led.blink { animation: blink 1.8s ease-in-out infinite; }
  @keyframes blink { 50% { opacity: 0.35; } }
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: 11.5px; color: var(--fg-2);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; background: transparent;
}
.chip.tone-ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.chip.tone-warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
.chip.tone-fail { border-color: color-mix(in srgb, var(--fail) 55%, transparent); color: var(--fail); }
.chip.demo { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--panel-2);
  font-weight: 600; font-size: 14px; color: var(--fg); min-height: 38px; text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--line-3); background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { opacity: .92; }
.btn.accent { background: var(--c, var(--info)); color: var(--on-accent); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 13px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon svg, .btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; background: var(--panel); }
.seg button { padding: 7px 12px; font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); min-height: 34px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--fg); }
.seg button:hover { color: var(--fg); }
input.field, select.field, textarea.field {
  width: 100%; padding: 9px 12px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--panel);
  color: var(--fg); min-height: 38px;
}
input.field:focus, select.field:focus, textarea.field:focus { outline: 2px solid var(--info); outline-offset: 0; border-color: transparent; }
label.lbl { display: grid; gap: 5px; font-size: 12.5px; color: var(--fg-3); }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.grow { flex: 1; }

/* ---------- top bar ---------- */
.transport {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.transport .inner {
  display: flex; align-items: center; gap: 10px 16px; min-height: 54px; padding-block: 8px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.brand .word { font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); }
.brand .sub { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a {
  padding: 7px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 13.5px; color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 7px;
}
.nav a:hover { color: var(--fg); background: var(--panel-2); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--panel-3); }
.nav a .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.nav a .ext svg { width: 12px; height: 12px; color: var(--fg-3); margin-left: -2px; }
.tabbar a[target="_blank"] svg { color: var(--c); }

/* red bubbles: things that need the operator */
.bubble { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fail); color: #fff; font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; line-height: 1; letter-spacing: 0; box-shadow: 0 0 0 2px var(--bg); }
.bubble.amber { background: var(--warn); color: #1b1300; }
.nav a .bubble { margin-left: 2px; }
.tabbar a { position: relative; }
.tabbar a .bubble { position: absolute; top: 4px; left: calc(50% + 6px); }

/* launcher (start page) */
.launcher { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.launch { position: relative; display: grid; gap: 10px; align-content: start; padding: 18px 18px 16px; min-height: 168px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); text-decoration: none; color: inherit; min-width: 0; transition: transform .18s, border-color .18s, box-shadow .2s; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.launch:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, var(--line-2)); box-shadow: 0 18px 40px -26px var(--c); }
.launch:focus-visible { outline-color: var(--c); }
.launch.planned { border-style: dashed; }
.launch .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.launch .ic svg { width: 24px; height: 24px; }
.launch .nm { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: .03em; text-transform: uppercase; line-height: 1; }
.launch .st { font-size: 13px; color: var(--fg-2); line-height: 1.4; min-height: 2.8em; }
.launch .st b { color: var(--fg); font-weight: 600; }
.launch .bubble { position: absolute; top: 14px; right: 14px; min-width: 24px; height: 24px; font-size: 12.5px; box-shadow: 0 0 0 3px var(--panel), 0 6px 16px -6px var(--fail); }
.launch .bubble.amber { box-shadow: 0 0 0 3px var(--panel), 0 6px 16px -6px var(--warn); }
.launch .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); margin-top: auto; min-width: 0; }
.launch .foot > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.launch .foot .go { flex: none; }
.launch .foot .led { margin-right: 6px; }
.launch .foot .go { color: var(--c); display: inline-flex; align-items: center; gap: 4px; }
.launch .foot .go svg { width: 13px; height: 13px; }
@media (max-width: 1100px) { .launcher { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .launcher { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .launch { padding: 14px; min-height: 150px; } .launch .nm { font-size: 22px; } .launch .st { font-size: 12.5px; } }
.module.current { cursor: default; }
.transport .sp { flex: 1; }
.transport .chips { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
#todayGrid { align-items: start; }
.feed .t { overflow-wrap: anywhere; }
.clock { font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); white-space: nowrap; }
@media (max-width: 899px) {
  .nav, .transport .chips, .clock { display: none; }
  .brand .sub { display: none; }
}

/* bottom tab bar (phones) */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 8px 4px 7px; text-decoration: none; color: var(--fg-3); font-size: 10.5px; font-weight: 600; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--fg); }
.tabbar a[aria-current="page"] svg { color: var(--c); }
@media (max-width: 899px) {
  :root { --tabbar: 58px; }
  .tabbar { display: flex; }
}

/* ---------- masthead ---------- */
.masthead { padding-block: 26px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end; }
.masthead h1 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: clamp(44px, 7vw, 92px); line-height: 0.86; letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--fg) 0%, color-mix(in srgb, var(--fg) 70%, var(--c-post)) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.masthead .lede { color: var(--fg-2); font-size: 15px; max-width: 44em; margin-top: 10px; }
.masthead .lede b { color: var(--fg); font-weight: 600; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(140px, auto)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.readouts > div { background: var(--panel); padding: 12px 16px 10px; min-width: 0; display: grid; gap: 2px; align-content: start; }
.readouts .k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
.readouts .v { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readouts .v.sm { font-size: 22px; padding-top: 6px; }
.readouts .s { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readouts .v.tone-ok { color: var(--ok); }
.readouts .v.tone-warn { color: var(--warn); }
.readouts .v.tone-you { color: var(--you); }
@media (max-width: 1100px) { .masthead { grid-template-columns: 1fr; } .readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 899px) { .masthead { padding-block: 18px 14px; gap: 14px; } .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .readouts .v { font-size: 30px; } }

/* ---------- section heads ---------- */
section.block { padding-block: 34px 6px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 14px; }
.sec-head h2 { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: clamp(26px, 3.4vw, 38px); line-height: 0.95; letter-spacing: 0.01em; }
.sec-head h2 small { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .14em; color: var(--fg-3); margin-bottom: 7px; text-transform: uppercase; }
.sec-head p { color: var(--fg-3); font-size: 13.5px; max-width: 48em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- patchbay ---------- */
.patchbay {
  position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 14px 56px;
  padding: 18px 18px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); box-shadow: var(--shadow);
  overflow: hidden;
}
.patchbay::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(color-mix(in srgb, var(--line-2) 60%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; background-position: 9px 9px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.6), rgba(0,0,0,.15));
}
.pb-col { position: relative; display: grid; gap: 10px; align-content: start; min-width: 0; z-index: 2; }
.pb-col .colhead { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); padding: 2px 0 4px; }
.pb-col.sources, .pb-col.outputs { padding-top: 2px; }
.cables { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.cables path { fill: none; stroke: var(--line-2); stroke-width: 1.5; transition: opacity .2s, stroke .2s; }
.cables path.live { stroke: color-mix(in srgb, var(--c) 55%, var(--line-2)); stroke-dasharray: 2 7; stroke-linecap: round; stroke-width: 2; }
.cables path.loop { stroke-dasharray: 6 5; stroke: color-mix(in srgb, var(--you) 55%, var(--line-2)); }
.cables path.planned { stroke-dasharray: 4 5; stroke: color-mix(in srgb, var(--c-post) 45%, var(--line-2)); }
.cables.focus path { opacity: .12; }
.cables.focus path.hot { opacity: 1; stroke: var(--c); stroke-width: 2.2; }
.cables .pulse { fill: var(--c); filter: url(#pbGlow); }
.cables .pulse.ring { fill: none; stroke: var(--c); stroke-width: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .cables path.live { animation: flow 1.1s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -18; } }
}

/* source & output nodes */
.pnode {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 0;
  transition: border-color .15s, transform .15s;
}
.pnode .led { grid-row: span 2; }
.pnode .nl { font-weight: 600; font-size: 13.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnode .ns { font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnode.planned { border-style: dashed; color: var(--fg-2); }
.pnode.hot, .pnode:hover { border-color: var(--line-3); }
.pnode .port { position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--bg-2); border: 1.5px solid var(--line-3); transform: translateY(-50%); }
.sources .pnode .port { right: -5px; }
.outputs .pnode .port { left: -5px; }

/* modules (rack units) */
.module {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: start;
  padding: 14px 16px 14px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  text-decoration: none; color: inherit; min-width: 0; transition: border-color .15s, transform .15s, box-shadow .2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.module::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.module:hover, .module.hot { border-color: color-mix(in srgb, var(--c) 55%, var(--line-2)); transform: translateY(-1px); box-shadow: 0 14px 36px -24px var(--c); }
.module:focus-visible { outline-color: var(--c); }
.module.planned { border-style: dashed; }
.module.planned::before { background: repeating-linear-gradient(180deg, var(--c) 0 6px, transparent 6px 11px); }
.module .head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.module .name { font-family: var(--f-display); font-weight: 800; font-size: 24px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.module .tag { font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-3); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module .desc { grid-column: 1 / -1; font-size: 13px; color: var(--fg-2); line-height: 1.4; }
.module .ro { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px 14px; margin-top: 4px; }
.module .ro div { min-width: 0; }
.module .ro .k { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module .ro .v { font-family: var(--f-mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module .ro .v.big { font-family: var(--f-display); font-weight: 800; font-size: 26px; line-height: 1; }
.module .ro .v.tone-ok { color: var(--ok); }
.module .ro .v.tone-warn { color: var(--warn); }
.module .ro .v.tone-fail { color: var(--fail); }
.module .go { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11.5px; color: var(--c); white-space: nowrap; }
.module .go svg { width: 14px; height: 14px; }
.module .port { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--bg-2); border: 1.5px solid var(--line-3); }
.module .port.in { left: -5px; }
.module .port.out { right: -5px; }
.module .port.on { border-color: var(--c); background: var(--c); box-shadow: 0 0 6px var(--c); }
@media (max-width: 1150px) { .patchbay { grid-template-columns: 190px minmax(0, 1fr) 190px; gap: 12px 40px; } }
@media (max-width: 899px) {
  .patchbay { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .cables, .port { display: none; }
  .pb-col.sources, .pb-col.outputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-col.sources .colhead, .pb-col.outputs .colhead { grid-column: 1 / -1; }
  .pb-col.sources { order: 2; }
  .pb-col.modules { order: 1; }
  .pb-col.outputs { order: 3; }
  .pnode { padding: 8px 10px; }
  .module .name { font-size: 22px; }
}

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid.c2, .grid.c3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid.c4 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 16px 18px; min-width: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.card h3 { font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: .03em; text-transform: uppercase; line-height: 1; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.card h3 .led { margin-right: 2px; }
.card h3 .right { margin-left: auto; font-family: var(--f-mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; color: var(--fg-3); text-transform: none; }
.card.accent { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bullets li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.4; color: var(--fg); }
.bullets li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); margin-top: 7px; }
.bullets li.singhance::before { background: #4dabf7; }
.bullets li.publisor::before { background: var(--c-studio); }
.bullets li.jovo::before { background: var(--c-lage); }
.bullets li b { color: var(--fg); font-weight: 600; }
.bullets li .pj { font-weight: 600; }
.empty { color: var(--fg-3); font-size: 13.5px; padding: 8px 0; }

/* KPI tiles */
.tile { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px 12px; display: grid; gap: 4px; min-width: 0; position: relative; overflow: hidden; }
.tile .k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); display: flex; justify-content: space-between; gap: 8px; }
.tile .k .hint { cursor: help; color: var(--fg-4); font-size: 12px; letter-spacing: 0; text-transform: none; }
.tile .v { font-family: var(--f-display); font-weight: 800; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .d { font-family: var(--f-mono); font-size: 11.5px; color: var(--fg-3); display: flex; gap: 6px; align-items: center; min-height: 16px; }
.tile .d.up { color: var(--ok); }
.tile .d.down { color: var(--fail); }
.tile svg.spark { width: 100%; height: 34px; display: block; margin-top: 4px; }
.tile.demo { border-style: dashed; border-color: var(--warn); }
.tile.demo::after { content: "DEMO"; position: absolute; top: 8px; right: 10px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em; color: var(--warn); }

/* feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); color: var(--c, var(--fg-2)); grid-row: span 2; }
.feed .ic svg { width: 18px; height: 18px; }
.feed .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.feed .b { font-size: 12.5px; color: var(--fg-3); line-height: 1.35; white-space: pre-line; }
.feed .w { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); white-space: nowrap; grid-row: span 2; padding-top: 2px; }
.feed li.sandbox .t::after { content: " Sandbox"; font-family: var(--f-mono); font-size: 10px; color: var(--warn); letter-spacing: .08em; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); padding: 6px 10px 8px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .sub { font-size: 12px; color: var(--fg-3); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; border: 1px solid var(--line-2); color: var(--fg-2); white-space: nowrap; }
.badge .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* checks (Technik) */
.check { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; min-width: 0; }
.check .led { margin-top: 7px; width: 10px; height: 10px; }
.check .l { font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; gap: 8px; }
.check .l .st { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.check .l .st.ok { color: var(--ok); } .check .l .st.warn { color: var(--warn); } .check .l .st.fail { color: var(--fail); }
.check .d { grid-column: 2; font-size: 12.5px; color: var(--fg-2); line-height: 1.4; overflow-wrap: anywhere; }
.check .m { grid-column: 2; font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-3); }

/* drawers, toasts, gate */
.drawer { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 16px 18px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.drawer-head h3 { font-family: var(--f-display); font-weight: 800; font-size: 24px; letter-spacing: .03em; text-transform: uppercase; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.gate { min-height: 70dvh; display: grid; place-items: center; padding: 24px 0; }
.gate .card { width: min(440px, 100%); display: grid; gap: 12px; }
.gate h2 { font-family: var(--f-display); font-weight: 800; font-size: 34px; text-transform: uppercase; line-height: 1; }
.gate p { color: var(--fg-2); font-size: 14px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: var(--r-s); border: 1px dashed var(--warn); color: var(--fg); font-size: 13.5px; margin-bottom: 14px; background: color-mix(in srgb, var(--warn) 8%, transparent); }
.banner .btn { margin-left: auto; }
.notice { border-radius: var(--r-s); border: 1px solid var(--line-2); padding: 10px 14px; font-size: 13.5px; color: var(--fg-2); background: var(--panel-2); }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.notice.fail { border-color: color-mix(in srgb, var(--fail) 45%, transparent); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .axis { font-family: var(--f-mono); font-size: 10.5px; fill: var(--fg-3); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--c-zahlen); }
.chart .bar.refund { fill: var(--fail); }
.chart .line { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.cost { stroke: var(--fg-3); stroke-dasharray: 5 5; }
.chart .area { fill: color-mix(in srgb, var(--c-zahlen) 14%, transparent); }
.chart .hover-l { stroke: var(--fg-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); padding: 6px 9px; border-radius: 6px; font-family: var(--f-mono); font-size: 11.5px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; display: none; }
.heat { display: grid; grid-template-columns: auto repeat(var(--weeks, 13), minmax(0, 36px)); gap: 3px; align-items: center; justify-content: start; }
.heat .dow { font-family: var(--f-mono); font-size: 10px; color: var(--fg-3); padding-right: 4px; }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: var(--panel-3); border: 1px solid transparent; cursor: pointer; min-width: 0; }
.heat .cell.l1 { background: color-mix(in srgb, var(--c-zahlen) 25%, var(--panel-3)); }
.heat .cell.l2 { background: color-mix(in srgb, var(--c-zahlen) 50%, var(--panel-3)); }
.heat .cell.l3 { background: color-mix(in srgb, var(--c-zahlen) 75%, var(--panel-3)); }
.heat .cell.l4 { background: var(--c-zahlen); }
.heat .cell.future { background: transparent; border-color: var(--line); cursor: default; }
.heat .cell.today { outline: 2px solid var(--fg); outline-offset: 1px; }
.heat .cell.sel { border-color: var(--fg); }
.heat .cell.camp { box-shadow: inset 0 -3px 0 var(--c-technik); }
.heat .wk { font-family: var(--f-mono); font-size: 9.5px; color: var(--fg-3); text-align: center; }

footer.foot { padding-block: 40px 28px; margin-top: 40px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 11.5px; color: var(--fg-3); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer.foot a { color: var(--fg-3); }

/* studio drawer bits */
.reels { display: grid; gap: 8px; }
.reel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.reel .id { font-family: var(--f-mono); font-weight: 600; font-size: 13.5px; }
.reel .st { grid-column: 2; font-size: 12.5px; color: var(--fg-3); }
.reel .dec { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; grid-row: span 2; }
.reel .dec.approve { color: var(--ok); } .reel .dec.change { color: var(--warn); } .reel .dec.discard { color: var(--fail); } .reel .dec.none { color: var(--fg-3); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 7px; background: var(--panel-2); display: grid; gap: 2px; min-width: 0; }
.week .d { font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-3); }
.week .i { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .s { font-family: var(--f-mono); font-size: 10px; color: var(--fg-3); }
.week div.posted { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.week div.approved .s, .week div.posted .s { color: var(--ok); }
.week div.rendered .s { color: var(--info); }
@media (max-width: 680px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* print */
@media print { .transport, .tabbar, .btn { display: none !important; } body { background: #fff; color: #000; } }
