/* ==========================================================================
   Überhört – Design-System
   Studio-Metapher: Tinte (ink), Signal-Rot (REC), Pegel-Amber, ruhige Flächen.
   Das eine laute Element ist der Produktions-Pegel (Folgenstatus).
   ========================================================================== */

/* Schriften lokal gehostet (keine Verbindung zu Google, DSGVO-freundlich) */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eceef4;
  --ink: #1e1b33;
  --ink-2: #5b5873;
  --ink-3: #8a87a1;
  --line: #e2e3eb;
  --line-strong: #cfd1dc;

  --primary: #3d35a8;
  --primary-hover: #322b8f;
  --primary-ink: #ffffff;
  --primary-soft: #ecebfa;

  --rec: #e2453c;
  --rec-soft: #fdeceb;
  --amber: #f2b705;
  --amber-soft: #fff6d6;
  --green: #1f9d6b;
  --green-soft: #e3f5ed;
  --grey-status: #8a86a3;

  --side-bg: #1e1b33;
  --side-ink: #c9c6dc;
  --side-ink-strong: #ffffff;
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-line: rgba(255, 255, 255, 0.08);

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow-pop: 0 12px 40px rgba(20, 16, 50, 0.18), 0 2px 6px rgba(20, 16, 50, 0.08);
  --focus: 0 0 0 3px rgba(61, 53, 168, 0.35);

  --sidebar-w: 248px;
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13121d;
    --surface: #1c1a2a;
    --surface-2: #211f32;
    --surface-3: #2a2740;
    --ink: #ecebf5;
    --ink-2: #a8a5bd;
    --ink-3: #7c7993;
    --line: #2e2b42;
    --line-strong: #3d3956;
    --primary: #9d95ff;
    --primary-hover: #b3adff;
    --primary-ink: #15122b;
    --primary-soft: #2a2650;
    --rec: #ff6b61;
    --rec-soft: #3a1f25;
    --amber: #f5c842;
    --amber-soft: #3a3220;
    --green: #3cc98f;
    --green-soft: #183326;
    --grey-status: #8d89a8;
    --side-bg: #0f0e18;
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.5);
    --focus: 0 0 0 3px rgba(157, 149, 255, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #13121d;
  --surface: #1c1a2a;
  --surface-2: #211f32;
  --surface-3: #2a2740;
  --ink: #ecebf5;
  --ink-2: #a8a5bd;
  --ink-3: #7c7993;
  --line: #2e2b42;
  --line-strong: #3d3956;
  --primary: #9d95ff;
  --primary-hover: #b3adff;
  --primary-ink: #15122b;
  --primary-soft: #2a2650;
  --rec: #ff6b61;
  --rec-soft: #3a1f25;
  --amber: #f5c842;
  --amber-soft: #3a3220;
  --green: #3cc98f;
  --green-soft: #183326;
  --grey-status: #8d89a8;
  --side-bg: #0f0e18;
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.5);
  --focus: 0 0 0 3px rgba(157, 149, 255, 0.4);
  color-scheme: dark;
}

/* ---------- Basis ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-size: 0.92em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-s); }

.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); font-size: 13px; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.prewrap { white-space: pre-wrap; word-break: break-word; }

/* ---------- App-Layout ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  color: var(--side-ink-strong);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0 4px rgba(226, 69, 60, 0.18);
  flex: 0 0 auto;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; overflow-y: auto; }
.nav-section {
  margin: 18px 10px 6px;
  font-size: 12px;
  color: rgba(201, 198, 220, 0.55);
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--side-ink);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.nav a.active { background: rgba(255, 255, 255, 0.09); color: var(--side-ink-strong); }
.nav a.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--amber);
}
.nav svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: 0.9; }
.nav .badge-count { margin-left: auto; }

.sidebar-foot { border-top: 1px solid var(--side-line); padding-top: 12px; margin-top: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  color: var(--side-ink-strong);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.user-chip:hover { background: var(--side-hover); }
.user-chip .who { min-width: 0; flex: 1 1 auto; }
.user-chip .who strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { display: block; font-size: 12px; color: var(--side-ink); }
.powered { font-size: 11px; color: rgba(201, 198, 220, 0.5); padding: 10px 8px 0; }

.user-menu {
  position: absolute;
  left: 14px; right: 14px; bottom: 86px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 60;
}
.user-menu button, .user-menu a {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 9px 10px;
  border: 0; background: none;
  color: var(--ink); font: inherit; text-align: left;
  border-radius: 8px; cursor: pointer; text-decoration: none;
}
.user-menu button:hover, .user-menu a:hover { background: var(--surface-3); text-decoration: none; }
.user-menu .seg { display: flex; gap: 4px; padding: 6px 6px 8px; }
.user-menu .seg button { justify-content: center; padding: 6px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.user-menu .seg button[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.user-menu .menu-label { font-size: 12px; color: var(--ink-3); padding: 6px 10px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
.btn.menu-toggle { display: none; }

.search-trigger {
  display: flex; align-items: center; gap: 10px;
  width: min(420px, 100%);
  height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-3);
  font: inherit;
  cursor: pointer;
}
.search-trigger:hover { border-color: var(--line-strong); }
.search-trigger svg { width: 17px; height: 17px; }
.search-trigger kbd { margin-left: auto; }
kbd {
  font-family: inherit; font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink-2);
  background: var(--surface-2);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.conn-state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.conn-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.conn-state.off i { background: var(--rec); }

.content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 64ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.back-link svg { width: 16px; height: 16px; }

.scrim { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(290px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 8, 25, 0.45); z-index: 35; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 16px 56px; }
  .conn-state span { display: none; }
  .search-trigger kbd { display: none; }
  h1 { font-size: 25px; }
}

/* ---------- Flächen ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 22px;
}
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 22px 0; }
.panel.quiet { background: var(--surface-2); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1080px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-ink);
  font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-3); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--rec); color: #fff; }
.btn.danger:hover { filter: brightness(0.95); }
.btn.danger-ghost { background: transparent; color: var(--rec); }
.btn.danger-ghost:hover { background: var(--rec-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid currentColor; border-color: var(--primary-ink) transparent var(--primary-ink) transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.btn.secondary.loading::after { border-color: var(--ink) transparent var(--ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulare ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.field-row .field + .field { margin-top: 0; }
label, .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-3); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="search"], input[type="url"], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
}
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone svg { width: 26px; height: 26px; }
.dropzone input { display: none; }

/* ---------- Badges & Avatare ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2);
  white-space: nowrap;
}
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.rec { background: var(--rec-soft); color: var(--rec); }
.badge.amber { background: var(--amber-soft); color: #8a6500; }
:root[data-theme="dark"] .badge.amber { color: var(--amber); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.amber { color: var(--amber); } }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--rec); color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

.avatar {
  --size: 34px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: calc(var(--size) * 0.4);
  color: #fff;
  background: var(--av, #5b55c4);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { --size: 26px; }
.avatar.lg { --size: 72px; }

/* ---------- Produktions-Pegel (Folgenstatus) ---------- */

.meter { display: inline-flex; flex-direction: column; gap: 6px; }
.meter-bars { display: inline-flex; gap: 3px; align-items: flex-end; }
.meter-bars i {
  display: block;
  width: 9px;
  border-radius: 2px;
  background: var(--surface-3);
}
.meter-bars i:nth-child(1) { height: 8px; }
.meter-bars i:nth-child(2) { height: 11px; }
.meter-bars i:nth-child(3) { height: 14px; }
.meter-bars i:nth-child(4) { height: 17px; }
.meter-bars i:nth-child(5) { height: 20px; }
.meter-bars i.on { background: var(--st); }
.meter-label { font-size: 12px; font-weight: 700; color: var(--st); }
.meter.inline { flex-direction: row; align-items: center; gap: 10px; }

.st-planning { --st: var(--grey-status); }
.st-recording { --st: var(--rec); }
.st-editing { --st: var(--amber); }
.st-ready { --st: var(--primary); }
.st-published { --st: var(--green); }

.meter.big .meter-bars { gap: 5px; }
.meter.big .meter-bars i { width: 22px; border-radius: 3px; }
.meter.big .meter-bars i:nth-child(1) { height: 14px; }
.meter.big .meter-bars i:nth-child(2) { height: 20px; }
.meter.big .meter-bars i:nth-child(3) { height: 26px; }
.meter.big .meter-bars i:nth-child(4) { height: 32px; }
.meter.big .meter-bars i:nth-child(5) { height: 38px; }

.stage-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-picker button {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.stage-picker button i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.stage-picker button[aria-pressed="true"] { border-color: var(--st); color: var(--ink); background: color-mix(in srgb, var(--st) 12%, var(--surface)); }
.stage-picker button:disabled { cursor: default; }

/* ---------- Listen ---------- */

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.list-item:first-child { border-top: 0; }
.panel.flush .list-item { padding: 13px 22px; }
.list-item .title { font-weight: 700; color: var(--ink); }
.list-item .meta { font-size: 13px; color: var(--ink-3); }
.list-item a.title { color: var(--ink); }
.list-item .end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover .title { color: var(--primary); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; white-space: nowrap; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  padding: 34px 16px;
  color: var(--ink-2);
}
.empty svg { width: 34px; height: 34px; color: var(--ink-3); }
.empty strong { color: var(--ink); font-family: var(--font-display); font-size: 16px; }
.empty p { max-width: 42ch; font-size: 14px; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton.line { height: 14px; margin: 12px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative;
  padding: 10px 14px 12px;
  border: 0; background: none;
  color: var(--ink-2);
  font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }
.tabs .badge-count { background: var(--primary); }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; gap: 2px; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(14, 12, 30, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.14s ease;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  animation: pop 0.16s ease;
}
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- Toasts ---------- */

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  animation: pop 0.18s ease;
}
.toast i { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }
.toast.success i { background: var(--green); }
.toast.error i { background: var(--rec); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all 0.2s ease; }

/* ---------- Befehlspalette (Suche) ---------- */

.palette { width: min(640px, 100%); align-self: flex-start; margin-top: 10vh; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 20px; height: 20px; color: var(--ink-3); }
.palette-input input { border: 0; box-shadow: none !important; padding: 4px 0; font-size: 17px; min-height: 0; background: transparent; }
.palette-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; cursor: pointer; }
.palette-item:hover, .palette-item.active { background: var(--primary-soft); text-decoration: none; }
.palette-item .meta { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.palette-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- Banner ---------- */

.banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  margin-bottom: 20px;
  font-size: 14px;
}
.banner.info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.banner .grow strong { display: block; }

/* ---------- Auth-Seiten ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-side {
  position: relative;
  background: var(--side-bg);
  color: #fff;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth-side .brand { padding: 0; font-size: 26px; }
.auth-claim { font-family: var(--font-display); font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; max-width: 12ch; color: #fff; }
.auth-sub { color: var(--side-ink); max-width: 42ch; margin-top: 18px; font-size: 16px; }
.auth-foot { color: rgba(201, 198, 220, 0.6); font-size: 12px; }

.wave { display: flex; align-items: center; gap: 4px; height: 120px; margin: 40px 0; }
.wave i {
  flex: 1 1 0; max-width: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  height: var(--h);
  transform-origin: center;
  max-height: 100%;
  animation: level 1.6s ease-in-out infinite alternate;
  animation-delay: var(--d);
}
.wave i.hot { background: var(--amber); }
.wave i.rec { background: var(--rec); }
@keyframes level { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 28px; }
.auth-card .lead { color: var(--ink-2); margin: 8px 0 26px; }
.auth-card .alt { margin-top: 22px; font-size: 14px; color: var(--ink-2); text-align: center; }
.form-error { display: none; margin-bottom: 16px; padding: 10px 12px; border-radius: 9px; background: var(--rec-soft); color: var(--rec); font-size: 14px; font-weight: 700; }
.form-error.show { display: block; }
.form-ok { display: none; margin-bottom: 16px; padding: 10px 12px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 700; }
.form-ok.show { display: block; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 8px; cursor: pointer; border-radius: 6px; }
.code-input { font-size: 26px !important; letter-spacing: 0.4em; text-align: center; font-family: var(--font-display) !important; }

@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 26px 20px 22px; }
  .auth-claim { font-size: 30px; max-width: none; }
  .auth-sub, .auth-foot { display: none; }
  .wave { height: 46px; margin: 18px 0 0; }
}

/* ---------- Dashboard ---------- */

.hello { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; margin-bottom: 20px; }
.kpi { background: var(--surface); padding: 16px 20px; }
.kpi strong { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.kpi span { font-size: 13px; color: var(--ink-2); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipeline a { display: block; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pipeline a:hover { border-color: var(--st); text-decoration: none; }
.pipeline strong { display: block; font-family: var(--font-display); font-size: 26px; margin-top: 8px; }
.pipeline span { font-size: 13px; color: var(--ink-2); }
@media (max-width: 760px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.note {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.note + .note { margin-top: 10px; }
.note .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.note .meta button { margin-left: auto; }

.changelog-body h1, .changelog-body h2, .changelog-body h3 { margin: 16px 0 6px; font-size: 16px; }
.changelog-body h1:first-child, .changelog-body h2:first-child, .changelog-body h3:first-child { margin-top: 0; }
.changelog-body ul { margin: 6px 0; padding-left: 20px; }
.changelog-body p { margin: 6px 0; }

/* ---------- Folgen ---------- */

.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.episode-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  color: var(--ink);
  text-decoration: none;
  min-height: 178px;
}
.episode-card:hover { border-color: var(--line-strong); text-decoration: none; }
.episode-card:hover h3 { color: var(--primary); }
.episode-card .ep-no { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink-3); }
.episode-card p { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-card .foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar input[type="search"] { max-width: 300px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--st, var(--ink-3)); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.ep-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.ep-hero h1 { font-size: 34px; max-width: 26ch; }
.ep-hero .desc { color: var(--ink-2); margin-top: 10px; max-width: 70ch; }
.ep-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.ep-facts strong { color: var(--ink); }

.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 120px; }
.kanban-col h4 { font-size: 13px; color: var(--ink-2); padding: 4px 4px 10px; display: flex; justify-content: space-between; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.task-card + .task-card { margin-top: 8px; }
.task-card .t { font-weight: 700; }
.task-card .d { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.task-card .m { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.task-card .acts { display: flex; gap: 4px; margin-top: 8px; }
.task-card.overdue { border-left: 3px solid var(--rec); }
@media (max-width: 860px) { .kanban { grid-template-columns: minmax(0, 1fr); } }

.file-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.file-icon svg { width: 19px; height: 19px; }
.file-icon.video { background: var(--rec-soft); color: var(--rec); }
.file-icon.image { background: var(--green-soft); color: var(--green); }
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.2s ease; }

.question { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.question:first-child { border-top: 0; }
.question .n { font-family: var(--font-display); font-weight: 700; color: var(--ink-3); min-width: 22px; }
.question .q { flex: 1 1 auto; }

.save-state { font-size: 12px; color: var(--ink-3); }
.save-state.dirty { color: #8a6500; }

/* ---------- Kalender ---------- */

.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head h2 { font-size: 22px; min-width: 190px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--surface-2); padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.cal-day { background: var(--surface); min-height: 112px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 4px; cursor: default; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .num { color: var(--ink-3); }
.cal-day .num { font-size: 13px; font-weight: 700; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .num { background: var(--rec); color: #fff; }
.cal-day.can-add { cursor: pointer; }
.cal-day.can-add:hover { background: var(--surface-2); }
.cal-ev { display: block; width: 100%; text-align: left; border: 0; font: inherit; font-size: 12px; font-weight: 700; padding: 3px 6px; border-radius: 5px; cursor: pointer; background: color-mix(in srgb, var(--ev) 16%, var(--surface)); color: var(--ink); border-left: 3px solid var(--ev); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-aufnahme { --ev: var(--rec); }
.ev-meeting { --ev: var(--primary); }
.ev-veroeffentlichung { --ev: var(--green); }
.ev-ausnahme { --ev: var(--amber); }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ev); display: inline-block; flex: 0 0 auto; }
.agenda-date { min-width: 52px; text-align: center; }
.agenda-date strong { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.agenda-date span { font-size: 12px; color: var(--ink-3); }
@media (max-width: 760px) {
  .cal-day { min-height: 64px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--ev); }
}

/* ---------- Chat ---------- */

.chat {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h) - 64px);
  min-height: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 14px; display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.chat-convs { overflow-y: auto; flex: 1 1 auto; }
.conv { display: flex; gap: 11px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font: inherit; color: var(--ink); }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--primary-soft); }
.conv .c-main { min-width: 0; flex: 1 1 auto; }
.conv .c-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .c-last { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .c-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--ink-3); }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-pane-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.chat-msgs { flex: 1 1 auto; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.msg-day { align-self: center; font-size: 12px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; margin: 10px 0; }
.msg { max-width: min(560px, 78%); align-self: flex-start; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 12px; color: var(--ink-3); margin: 8px 0 2px 4px; }
.bubble { position: relative; padding: 9px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.msg.mine .bubble { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.bubble img { display: block; max-width: 280px; max-height: 320px; border-radius: 10px; margin-bottom: 4px; cursor: zoom-in; }
.bubble .time { font-size: 11px; opacity: 0.65; margin-left: 8px; float: right; margin-top: 6px; }
.msg .del { visibility: hidden; border: 0; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.msg:hover .del, .msg:focus-within .del { visibility: visible; }
.chat-typing { font-size: 12px; color: var(--ink-3); padding: 0 18px; height: 18px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat-compose textarea { min-height: 42px; max-height: 160px; resize: none; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.chat-back { display: none; }
@media (max-width: 860px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 44px); }
  .chat.has-active .chat-list { display: none; }
  .chat:not(.has-active) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
}

.user-pick { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.user-pick label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); font-weight: 500; color: var(--ink); cursor: pointer; font-size: 14px; }
.user-pick label:first-child { border-top: 0; }
.user-pick label:hover { background: var(--surface-2); }
.user-pick input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- Admin ---------- */

.log-line { display: grid; grid-template-columns: 150px 120px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.log-line:first-child { border-top: 0; }
.log-line .t { color: var(--ink-3); }
@media (max-width: 760px) { .log-line { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.stat-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stat-row:first-child { border-top: 0; }
.stat-row span { color: var(--ink-2); }

.release-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.release-card h3 { display: flex; align-items: center; gap: 10px; }
.release-card .ver { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 8px 0 2px; }

.lightbox { position: fixed; inset: 0; background: rgba(8, 6, 20, 0.88); display: flex; align-items: center; justify-content: center; z-index: 150; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ---------- Fehlerseite ---------- */

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.error-page .code { font-family: var(--font-display); font-size: 110px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--ink); }
.error-page p { color: var(--ink-2); margin: 12px auto 24px; max-width: 44ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Korrekturen */
.conv .c-name, .conv .c-last { display: block; }
.chip.legend[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.chip.legend[aria-pressed="false"] { opacity: 0.5; text-decoration: line-through; }

/* ==========================================================================
   Anrufe
   ========================================================================== */

.call-page { margin: 0; min-height: 100vh; background: #0f0e18; color: #fff; overflow: hidden; }
.call {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  background: radial-gradient(120% 80% at 50% 0%, #241f45 0%, #0f0e18 60%);
}
.call-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; padding-top: max(16px, env(safe-area-inset-top)); }
.call-top .who { min-width: 0; }
.call-top h1 { color: #fff; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-top .sub { color: #c9c6dc; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.call-top .rec { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 4px rgba(226, 69, 60, 0.25); }
.call-top .relay { margin-left: auto; font-size: 12px; color: #a8a5bd; display: flex; align-items: center; gap: 6px; }

.call-stage { position: relative; min-height: 0; padding: 0 16px; display: flex; align-items: center; justify-content: center; }
.call-grid { position: relative; width: 100%; height: 100%; }
.call-grid.empty { display: flex; align-items: center; justify-content: center; }
.tile {
  position: absolute; left: 0; top: 0; overflow: hidden;
  background: #1c1a2a; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
  cursor: pointer;
}
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile.fill video { object-fit: cover; }
.tile.small .face .avatar { --size: 56px; }
.tile.small .label { left: 8px; bottom: 8px; font-size: 12px; padding: 3px 8px; }
.tile .fit-btn { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(15, 14, 24, 0.6); cursor: pointer; }
.tile .fit-btn::before { content: ""; position: absolute; inset: 10px; border: 2px solid #fff; border-radius: 3px; }
.tile.fill .fit-btn::before { inset: 12px 9px; }
.tile .face { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tile .face .avatar { --size: 96px; }
.tile .face .meterlive { display: flex; gap: 4px; align-items: flex-end; height: 26px; }
.tile .face .meterlive i { width: 7px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); height: 8px; transition: height 0.08s linear, background 0.08s linear; }
.tile .label { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(15, 14, 24, 0.7); font-size: 13px; font-weight: 700; }
.tile .label .muted-ico { color: var(--rec); }
.tile.speaking { box-shadow: 0 0 0 3px var(--amber); }
.tile .state { position: absolute; top: 12px; right: 12px; font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(15, 14, 24, 0.7); color: #c9c6dc; }

.self-view {
  position: absolute; right: 22px; bottom: 16px; width: min(220px, 30vw); aspect-ratio: 16 / 9; z-index: 2;
  border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); border: 2px solid rgba(255, 255, 255, 0.12);
  transition: width .25s ease;
}
.self-view.portrait { width: min(130px, 26vw); }
@media (max-width: 700px) { .self-view { right: 12px; bottom: 10px; } .self-view.portrait { width: min(110px, 28vw); } }
.self-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self-view.back video { transform: none; }
.self-view.off video { visibility: hidden; }

.call-center { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 20px; }
.call-center .avatar { --size: 120px; }
.call-center h2 { color: #fff; font-size: 26px; }
.call-center p { color: #c9c6dc; }
.call-center .pulse { animation: callpulse 1.6s ease-out infinite; border-radius: 50%; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(226, 69, 60, 0.5); } 100% { box-shadow: 0 0 0 28px rgba(226, 69, 60, 0); } }

.call-controls { display: flex; justify-content: center; gap: 14px; padding: 18px 16px 26px; padding-bottom: max(26px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
.cbtn {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(255, 255, 255, 0.12); color: #fff; transition: background 0.12s ease;
}
.cbtn:hover { background: rgba(255, 255, 255, 0.2); }
.cbtn svg { width: 24px; height: 24px; }
.cbtn.off { background: #fff; color: #1e1b33; }
.cbtn.hang { background: var(--rec); width: 68px; }
.cbtn.hang:hover { filter: brightness(1.08); }
.cbtn.accept { background: #1f9d6b; width: 68px; }
.cbtn-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #c9c6dc; }
.call-error { max-width: 420px; }

/* Eingehender Anruf (Overlay auf allen Seiten) */
.ring-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 10px 0 4px; }
.ring-card .avatar { --size: 84px; }
.ring-card .avatar { animation: callpulse 1.6s ease-out infinite; }
.ring-actions { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.btn.accept { background: #1f9d6b; color: #fff; }
.call-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--line); }
.call-banner .grow { color: var(--ink); }

/* ---------- Mikrofon-Test (Profil) ---------- */
.level-meter { display: flex; gap: 4px; align-items: flex-end; height: 34px; margin-top: 16px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, rgba(0,0,0,.04)); }
.level-meter i { flex: 1; height: 100%; border-radius: 3px; background: var(--line, rgba(0,0,0,.12)); transition: background .06s; }
.level-meter i.on { background: var(--green); }
.level-meter i.hot { background: var(--amber); }
#devTest .btn svg { width: 16px; height: 16px; }

/* ---------- Verbindungstest ---------- */
.nettest-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.nettest-row:last-child { border-bottom: 0; }
.nettest-row .dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--rec); }
.nettest-row.ok .dot { background: var(--green); }
.nettest-row.run .dot { background: var(--amber); animation: ntpulse 1s infinite alternate; }
@keyframes ntpulse { to { opacity: .3; } }
.call-page .nettest-box { background: rgba(255,255,255,.06); border-radius: 14px; padding: 6px 16px; width: min(520px, 100%); text-align: left; }
.call-page .nettest-row { border-color: rgba(255,255,255,.1); }

/* ---------- Meetings ---------- */
.meeting-item .btn svg { width: 16px; height: 16px; }
.meeting-item.live { background: var(--green-soft); border-radius: 12px; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(31, 157, 107, .25); animation: ntpulse 1s infinite alternate; }
.meeting-hint { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft, rgba(61,53,168,.08)); color: var(--ink); font-size: 14px; }
.meeting-hint svg { flex: none; width: 18px; height: 18px; color: var(--primary); margin-top: 2px; }

/* ---------- Als App auf dem Home-Bildschirm (iPhone/iPad/Android) ---------- */
.topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); }
.sidebar { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-left: max(14px, env(safe-area-inset-left)); }
.content { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
.auth-main { padding-top: max(40px, env(safe-area-inset-top)); padding-bottom: max(40px, env(safe-area-inset-bottom)); }
@media (max-width: 960px) {
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  .install-hint { display: none !important; }
}
.toasts { bottom: calc(20px + env(safe-area-inset-bottom)); }

.install-hint { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin-bottom: 18px; border-radius: 16px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.install-hint img { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.install-hint strong { display: block; margin-bottom: 4px; }
.install-hint ol { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2, inherit); font-size: 14px; line-height: 1.6; }
.install-hint .share-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
.install-hint .close { margin-left: auto; flex: none; }
.push-state { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 700; }
.push-state .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3, #8a87a1); }
.push-state.on .dot { background: var(--green); }
.push-state.off .dot { background: var(--rec); }
.push-state.warn .dot { background: var(--amber); }
.push-offer { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 8, 25, .5); padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); animation: offerin .2s ease; }
@keyframes offerin { from { opacity: 0; } }
.push-offer-card { width: min(420px, 100%); background: var(--surface); color: var(--ink); border-radius: 22px; padding: 26px 22px 14px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.push-offer-card img { width: 64px; height: 64px; border-radius: 15px; align-self: center; }
.push-offer-card h2 { margin: 6px 0 0; font-size: 21px; }
.push-offer-card p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.5; }
.push-offer-card .btn { justify-content: center; }
