:root {
  --bg: #05080e;
  --bg-2: #0a121c;
  --panel: rgba(10, 16, 26, 0.82);
  --panel-solid: #0c141e;
  --line: #1d3348;
  --line-hot: #2a5a72;
  --cyan: #6ee7ff;
  --cyan-dim: #1a6a80;
  --gold: #e8c56b;
  --gold-dim: #8a6e2e;
  --red: #ff5a6e;
  --ok: #3dffb0;
  --text: #e4eef6;
  --muted: #7d93a8;
  --follow: #6b7c93;
  --font: "IBM Plex Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display: "Syne", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.aurora, .grid-bg, .scan {
  position: fixed; inset: 0; pointer-events: none;
}
.aurora {
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(232, 197, 107, 0.10), transparent 55%),
    radial-gradient(ellipse 45% 40% at 8% 20%, rgba(94, 224, 255, 0.10), transparent 50%),
    radial-gradient(ellipse 40% 45% at 92% 80%, rgba(61, 255, 176, 0.05), transparent 50%);
  z-index: 0;
}
.grid-bg {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(20, 48, 74, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 48, 74, 0.55) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 78%);
  z-index: 0;
}
.scan {
  opacity: 0.05;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, #000 3px);
  z-index: 0;
}

.top, .layers, .main { position: relative; }
.layers, .main { z-index: 1; }
.top { z-index: 20; }
.top, .layers { flex: 0 0 auto; }

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 28px 10px;
  gap: 16px;
}
.brand { display: flex; gap: 14px; align-items: center; }
.mark {
  width: 44px; height: 44px;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(232, 197, 107, 0.45));
  flex: 0 0 auto;
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  line-height: 1;
}
.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ring-wrap { display: grid; place-items: center; }
.ring {
  position: relative;
  width: 138px; height: 138px;
  display: grid; place-items: center;
}
.ring-svg {
  position: absolute; inset: 0;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none; stroke: #15202c; stroke-width: 6;
}
.ring-arc {
  fill: none; stroke: var(--muted); stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px currentColor);
  transition: stroke 0.5s ease;
}
.ring-ticks {
  fill: none; stroke: rgba(110, 231, 255, 0.18); stroke-width: 1.2;
  stroke-dasharray: 2 10;
  transform-origin: 60px 60px;
  animation: spin 18s linear infinite;
}
.ring[data-status="ok"] .ring-arc { stroke: var(--ok); }
.ring[data-status="warning"] .ring-arc { stroke: var(--gold); }
.ring[data-status="critical"] .ring-arc { stroke: var(--red); }
.ring[data-status="critical"] .ring-ticks { animation-duration: 4s; stroke: rgba(255, 90, 110, 0.35); }
.ring-inner {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #101820, var(--bg));
  border: 1px solid rgba(232, 197, 107, 0.12);
  display: grid; place-items: center;
  text-align: center;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}
.overall {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.overall-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 2px;
  text-align: center;
  max-width: 92px;
  line-height: 1.25;
  text-transform: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.meta { text-align: right; }
.clock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  letter-spacing: 0.06em;
  font-size: 13px;
}
.map-pill {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}
.map-pill .bar {
  width: 72px; height: 4px;
  background: #15202c;
  border-radius: 99px;
  overflow: hidden;
}
.map-pill .bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  width: 0%;
}
.sources { margin-top: 8px; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  background: rgba(8, 14, 22, 0.6);
}
.sources .pill { text-transform: none; font-weight: 500; }
.llm-flag, #llm-flag, #who { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; }
.pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.pill.ok { color: var(--ok); border-color: #1e5c44; }
.pill.bad { color: var(--red); border-color: #5c1e2a; }
.pill.dim { color: var(--muted); }
.pill.dim::before { opacity: 0.4; }

.layers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 4px 28px 12px;
  flex: 0 0 auto;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 14px 10px;
  min-height: 84px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ok);
}
.card.warning::before { background: var(--gold); }
.card.critical::before { background: var(--red); }
.card.follow::before { background: var(--follow); }
.card::after {
  content: "";
  position: absolute; top: -1px; right: -1px;
  width: 12px; height: 12px;
  border-top: 1px solid var(--cyan);
  border-right: 1px solid var(--cyan);
  opacity: 0.35;
}
.card:hover { border-color: var(--line-hot); transform: translateY(-1px); }
.card.active {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(232, 197, 107, 0.18) inset;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.card h3 {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-pill {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.card-pill.ok { color: var(--ok); border-color: #1e5c44; }
.card-pill.warning { color: var(--gold); border-color: #6a5420; }
.card-pill.critical { color: var(--red); border-color: #6a2020; }
.card .stat {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.card .stat.ok { color: var(--ok); }
.card .stat.warning { color: var(--gold); }
.card .stat.critical { color: var(--red); }
.card .stat.follow { color: var(--follow); }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.main {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  padding: 0 28px 18px;
  flex: 1 1 auto;
  min-height: 0;
}
.main.no-chat {
  grid-template-columns: 1fr;
}
.panel.chat[hidden] { display: none !important; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.panel > header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.panel h2 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.chk { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }

.list, .messages { flex: 1; overflow: auto; padding: 10px; }
.inc {
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(7, 12, 18, 0.75);
  cursor: pointer;
  border-top: 1px solid transparent;
  border-right: 1px solid transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.inc:hover { border-color: var(--line); background: rgba(12, 20, 30, 0.9); }
.inc.critical { border-left-color: var(--red); }
.inc.warning { border-left-color: var(--gold); }
.inc.suppressed { opacity: 0.45; border-left-color: var(--follow); }
.inc.resolved { opacity: 0.62; }
.inc.muted { opacity: 0.5; }
.inc .title { font-weight: 600; }
.inc .meta {
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  margin-top: 3px;
  font-family: var(--mono);
}
.inc .action { color: var(--cyan); font-size: 12px; margin-top: 6px; }
.inc-actions {
  display: none;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.inc:hover .inc-actions, .inc:focus-within .inc-actions { display: flex; }

a.tiny { text-decoration: none; display: inline-flex; align-items: center; }

@media (max-width: 980px) {
  body { overflow: auto; }
  .top, .main { grid-template-columns: 1fr; }
  .layers { grid-template-columns: 1fr 1fr; }
  .main { height: auto; flex: none; }
  .brand { justify-content: center; }
  .meta { text-align: center; }
  .sources, .userbar { justify-content: center; }
}

.empty {
  display: grid; place-items: center;
  min-height: 140px;
  color: var(--muted);
  text-align: center;
  gap: 4px;
}
.empty .glyph {
  color: var(--ok);
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(61, 255, 176, 0.4));
  margin-bottom: 6px;
}
.empty .title { color: var(--text); font-weight: 600; }

.messages:empty::before {
  content: "Die Petze hört zu.\AFrag nach einem Sender, einem Coder oder der Kette.";
  white-space: pre-line;
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
}

.msg { margin: 10px 8px; max-width: 92%; }
.msg.user { margin-left: auto; }
.msg .who {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.msg .body {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 18, 0.7);
}
.msg.user .body {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(30, 90, 110, 0.12);
}
.msg.assistant .body { color: var(--text); white-space: pre-wrap; }
.msg.tool {
  max-width: 100%;
  margin: 4px 8px 2px;
}
.msg.tool .who { display: none; }
.src-chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ok);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid #1e5c44;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(8, 22, 16, 0.55);
}
.src-chip::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.composer {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.composer input {
  background: #070b11;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 13px;
  outline: none;
  font: 14px/1.4 var(--font);
}
.composer input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(232, 197, 107, 0.15);
}
.send, .mic, #detail-close, #users-close, #tg-close, #lessons-close, #hint-close, #activity-close {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 8px 14px;
  cursor: pointer;
  font: 11px/1 var(--font);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.send:hover, .mic:hover { background: rgba(110, 231, 255, 0.08); }
.mic.listening { color: var(--red); border-color: var(--red); box-shadow: 0 0 10px var(--red); }
.hint { margin: 0 12px 10px; color: var(--muted); font-size: 11px; min-height: 14px; }

dialog {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--line);
  width: min(720px, 92vw);
  max-height: 80vh;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 0;
}
dialog.sheet {
  width: min(640px, 94vw);
  border-color: var(--line-hot);
  background:
    radial-gradient(ellipse 80% 40% at 0% 0%, rgba(232, 197, 107, 0.08), transparent 55%),
    var(--panel-solid);
}
dialog.sheet-sm { width: min(420px, 94vw); }
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
dialog header { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; }
dialog.sheet header h3 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.06em;
}
dialog pre { white-space: pre-wrap; font-size: 12px; overflow: auto; font-family: var(--mono); padding: 0 20px 16px; }
.sheet-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.sheet-copy {
  margin: 0 20px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.sheet-tabs {
  display: flex; gap: 0;
  margin: 0 20px;
  border-bottom: 1px solid var(--line);
}
.sheet-tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer;
  font: 12px/1 var(--font);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 14px 10px;
}
.sheet-tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.sheet-pane { padding: 14px 20px 18px; overflow: auto; max-height: 58vh; }
.sheet-pane .sheet-copy { margin-left: 0; margin-right: 0; }
.sheet-pane .sheet-actions { padding: 8px 0 0; }
.sheet-actions { display: flex; gap: 8px; padding: 0 20px 18px; }

.nav-drop { position: relative; }
.nav-toggle {
  background: rgba(8, 14, 22, 0.7);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 6px 14px;
  cursor: pointer;
  font: 11px/1 var(--font);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav-drop.open .nav-toggle { background: rgba(232, 197, 107, 0.1); }
.nav-sheet {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(280px, 86vw);
  z-index: 30;
  padding: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--line-hot);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.nav-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  font: 14px/1.25 var(--font);
}
.nav-item[hidden] { display: none !important; }
.nav-item:hover { background: rgba(110, 231, 255, 0.06); }
.nav-item strong { font-family: var(--display); letter-spacing: 0.04em; font-size: 15px; }
.nav-kicker {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.nav-sub { font-size: 11px; color: var(--muted); }
.nav-item-out { border-top: 1px solid var(--line); margin-top: 4px; }
.nav-item-out strong { color: var(--red); }

.lesson-grid { display: grid; gap: 10px; }
.lesson-card {
  border: 1px solid var(--line);
  background: rgba(7, 12, 18, 0.7);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.lesson-card header { display: flex; justify-content: space-between; align-items: center; padding: 0; }
.lesson-card .tag {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}
.lesson-card .hits { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.lesson-card p { margin: 0; font-size: 13px; line-height: 1.45; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  background: rgba(8, 14, 22, 0.65);
}
.vip-col { margin-bottom: 14px; }
.vip-col b { color: var(--gold); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

.userbar { margin-top: 8px; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.tiny {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); padding: 3px 9px; cursor: pointer; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.tiny:hover { color: var(--gold); border-color: var(--gold-dim); }

.users-list { max-height: 40vh; overflow: auto; padding: 8px 0; }
.user-row {
  display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 8px; align-items: center;
  padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.user-create { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; padding: 10px 20px 16px; }
#users-dialog .users-list { padding: 0 20px; }
.user-create input, .user-create select {
  background: #070b11; border: 1px solid var(--line); color: var(--text); padding: 8px;
}

/* Login --------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
.login-card {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  padding: 40px 36px 32px;
  background: rgba(8, 14, 22, 0.88);
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px rgba(232, 197, 107, 0.06) inset,
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(94, 224, 255, 0.07);
  backdrop-filter: blur(12px);
}
.login-card::before, .login-card::after,
.corners i {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--gold);
  opacity: 0.7;
}
.login-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.login-card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.corners { position: absolute; inset: -1px; pointer-events: none; }
.corners i:nth-child(1) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.corners i:nth-child(2) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.login-mark {
  display: block;
  width: 52px; height: 52px;
  margin: 0 auto 12px;
}
.login-card h1 {
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
}
.login-card .sub { text-align: center; }
.rule {
  height: 1px;
  margin: 22px 0 16px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.status {
  margin: 0 0 22px;
  text-align: center;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.login-card label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.login-card input {
  display: block;
  width: 100%;
  margin-top: 7px;
  appearance: none;
  background: #070b11 !important;
  color: var(--text) !important;
  caret-color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  font: 15px/1.4 var(--font);
  outline: none;
}
.login-card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(232, 197, 107, 0.22), 0 0 16px rgba(232, 197, 107, 0.1);
}
.login-card .send {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  color: var(--gold);
  border-color: var(--gold-dim);
}
.login-card .send:hover {
  background: rgba(232, 197, 107, 0.1);
  box-shadow: 0 0 18px rgba(232, 197, 107, 0.14);
}
.login-card .send[disabled] { opacity: 0.55; cursor: wait; }
.login-error {
  min-height: 1.3em;
  margin: 0 0 10px;
  color: var(--red);
  font-size: 13px;
}
.foot {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Sender-Tafel (eigene Seite) ------------------------------------------- */
body.page-senders {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.senders-top {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px 10px;
  flex: 0 0 auto;
}
.brand-link { text-decoration: none; color: inherit; }
.senders-nav { display: flex; align-items: center; gap: 12px; }
.hls-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.stat-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.stat-chip.ok { color: var(--ok); border-color: #1e5c44; }
.stat-chip.idle { color: var(--follow); }
.stat-chip.down { color: var(--red); border-color: #5c1e2a; }
.stat-chip.pay { color: var(--gold); border-color: var(--gold-dim); }
.senders-toolbar {
  position: relative; z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 28px 12px;
  flex: 0 0 auto;
}
.hls-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.hls-filters .tiny.on {
  color: var(--gold);
  border-color: var(--gold-dim);
}
#hls-q {
  margin-left: auto;
  width: min(280px, 40vw);
  background: #070b11;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  font: 14px/1.3 var(--font);
  outline: none;
}
#hls-q:focus { border-color: var(--gold-dim); }
.udp-day {
  position: relative; z-index: 1;
  margin: 0 28px 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 0;
}
.udp-day-head {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.udp-day-head span { color: var(--text); letter-spacing: 0; text-transform: none; margin-left: 8px; }
.udp-day-body {
  font: 12px/1.45 var(--mono);
  color: var(--text);
  max-height: 132px;
  overflow: auto;
}
.udp-day-body .udp-ev { cursor: pointer; padding: 2px 0; }
.udp-day-body .udp-ev:hover { color: var(--cyan); }
.udp-day-body .st-down { color: var(--red); }
.udp-day-body .st-up { color: var(--ok); }
.udp-day-empty { color: var(--muted); }
.senders-main {
  position: relative; z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 28px 16px;
}
.senders-main:has(#log-panel:not([hidden])) {
  grid-template-columns: 1fr 340px;
}
.senders-table-wrap { min-height: 0; }
.senders-scroll { flex: 1; overflow: auto; }
.senders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.senders-table th {
  position: sticky; top: 0;
  background: #0c141e;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.senders-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(29, 51, 72, 0.55);
  vertical-align: middle;
}
.senders-table tbody tr { cursor: pointer; }
.senders-table tbody tr:hover { background: rgba(12, 20, 30, 0.9); }
.senders-table .mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.senders-table .st {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.senders-table .st.ok { color: var(--ok); }
.senders-table .st.idle { color: var(--muted); }
.senders-table .st.pos, .senders-table .st.dc, .senders-table .st.udp { color: var(--red); }
.senders-table .st.quality { color: var(--gold); }
.senders-table .st.scrambled { color: var(--gold); }
.senders-table .st.paused { color: var(--muted); }
.senders-table .mono.np-fail { color: var(--gold); }
.senders-table tr.udp td:first-child,
.senders-table tr.dc td:first-child,
.senders-table tr.pos td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.senders-table tr.quality td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.senders-table tr.ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.senders-table tr.idle td:first-child { box-shadow: inset 3px 0 0 var(--follow); }
.senders-table tr.scrambled td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.senders-table tr.paused td:first-child { box-shadow: inset 3px 0 0 var(--muted); }
.senders-table tr.br-low td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.senders-table .br-low { color: var(--gold); font-weight: 600; }
.empty-cell { text-align: center; color: var(--muted); padding: 40px 12px !important; }
.senders-log { min-height: 0; }
.senders-log pre {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 12px 16px;
  font: 12px/1.5 var(--mono);
  color: var(--text);
  white-space: pre-wrap;
}
body.page-stats {
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.stats-meaning {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  max-width: 42rem;
}
.stats-main {
  position: relative; z-index: 1;
  display: grid;
  gap: 14px;
  padding: 0 28px 28px;
}
.stats-block {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stats-head {
  padding: 12px 16px 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats-head span { color: var(--text); letter-spacing: 0; text-transform: none; margin-left: 8px; }
.stats-note {
  margin: 0 16px 10px;
  color: var(--muted);
  font-size: 12px;
}
.stats-langs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 0 16px 12px;
}
.stats-lang {
  border: 1px solid var(--line);
  padding: 8px 10px;
  font: 12px/1.4 var(--mono);
}
.stats-lang-h {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-family: var(--font);
}
.stats-lang b { color: var(--ok); font-weight: 600; }
.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 16px 14px;
}
.stats-split h3 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.stats-outages .udp-day-body { max-height: 280px; }
.page-stats .senders-table tbody tr { cursor: default; }
.page-stats .st-down { color: var(--red); }
.page-stats .ampel {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.page-stats .ampel.ok { color: var(--ok); }
.page-stats .ampel.gelb, .page-stats .ampel.langsam { color: var(--gold); }
.page-stats .ampel.rot { color: var(--red); }
.stats-freeze { max-height: 220px; padding: 0 16px 14px; }
.page-stats .stats-block { overflow: visible; }
.page-stats .senders-scroll { flex: none; overflow: visible; }

/* Live-Topologie (SVG-Karte, POS-Monitor-Muster) ------------------------ */
body.page-topology {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topo-main {
  position: relative; z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-hud {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  background: #05080e;
  overflow: hidden;
}
.map-hud svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.map-hud-scan {
  position: absolute;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  left: 53.5%;
  top: 36%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(26,232,255,0.18) 76%, transparent 84%);
  animation: map-sweep 9s linear infinite;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, #000 0 40%, transparent 72%);
  mask-image: radial-gradient(circle, #000 0 40%, transparent 72%);
}
.map-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, -130%);
  padding: 8px 12px;
  background: #0c141ef2;
  border: 1px solid var(--line-hot);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  min-width: 160px;
  max-width: 280px;
}
.map-tip strong { display: block; color: var(--gold); font-size: 12px; margin-bottom: 2px; }
.map-tip span { display: block; color: var(--text); }
.map-tip .dim { color: var(--muted); }
.map-tip .off { color: var(--red); }
.map-dock {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  flex: 0 0 auto;
}
.map-dock div {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.map-dock span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.map-dock strong { font-size: 15px; }

.map-link { fill: none; stroke-linecap: round; }
.map-link-stream {
  stroke: #3dff9a;
  stroke-width: 1.35;
  stroke-dasharray: 5 11;
  opacity: 0.85;
  animation: map-flow 1.15s linear infinite;
}
.map-link-idle {
  stroke: #e8c56b;
  stroke-width: 1;
  stroke-dasharray: 3 10;
  opacity: 0.45;
  animation: map-flow 2.4s linear infinite;
}
.map-link-off {
  stroke: #5c1e2a;
  stroke-width: 0.7;
  stroke-dasharray: 2 14;
  opacity: 0.18;
}
.map-link-uplink.map-link-idle,
.map-link-uplink.map-link-stream {
  stroke: #6ee7ff;
  stroke-width: 1.6;
  stroke-dasharray: 8 8;
  opacity: 0.7;
  animation-duration: 1.6s;
}
.map-link-observe {
  stroke: #e8c56b;
  stroke-width: 1.05;
  stroke-dasharray: 2 10;
  opacity: 0.5;
  animation: map-flow 5s linear infinite;
}
.map-link-control {
  stroke: #c9a4ff;
  stroke-width: 1.25;
  stroke-dasharray: 4 9;
  opacity: 0.72;
  animation: map-flow 2.1s linear infinite;
}
.map-link-udpmon {
  stroke: #e8c56b;
  stroke-width: 1.35;
  stroke-dasharray: 5 8;
  opacity: 0.8;
  animation: map-flow 1.8s linear infinite;
}
.map-link-peer {
  stroke: #6ee7ff;
  stroke-width: 1.2;
  stroke-dasharray: 6 10;
  opacity: 0.65;
  animation: map-flow 2.6s linear infinite;
}
.map-link-report {
  stroke: #e8c56b;
  stroke-width: 1.2;
  stroke-dasharray: 3 9;
  opacity: 0.7;
  animation: map-flow 2.4s linear infinite;
}
.map-hex.chanmon { stroke: var(--gold); fill: #161208; }
.map-ops-hull {
  fill: rgba(232, 197, 107, 0.07);
  stroke: rgba(232, 197, 107, 0.55);
  stroke-width: 1.1;
  stroke-dasharray: 7 8;
}
.map-ops-title {
  fill: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.map-ops-sub {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.map-ops-box {
  fill: #0c141e;
  stroke: var(--gold);
  stroke-width: 1.2;
}
.map-ops.off .map-ops-box { stroke: var(--red); opacity: 0.55; }
.map-ops-name {
  fill: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  text-anchor: middle;
}
.map-hex.cms { stroke: #c9a4ff; fill: #140e1c; }
.map-orbit {
  fill: none;
  stroke: rgba(110, 231, 255, 0.22);
  stroke-width: 1;
  stroke-dasharray: 3 8;
  opacity: 0.35;
  animation: map-orbit 12s linear infinite;
}
.map-band-label {
  fill: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.map-band-right { text-anchor: end; fill: var(--cyan); }
.map-corner {
  fill: var(--follow);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}
.map-corner-r { text-anchor: end; }
.map-star { fill: #8ab; opacity: 0.28; }
.map-hex { fill: #0c141e; stroke-width: 1.4; }
.map-hex.udp { stroke: var(--gold); }
.map-hex.coder { stroke: var(--cyan); fill: #082028; }
.map-hex.origin { stroke: var(--ok); }
.map-hex.core { stroke: var(--cyan); fill: #07141c; filter: url(#g-cyan); }
.map-host.off .map-hex, .map-host.off .map-dot { stroke: var(--red); opacity: 0.45; }
.map-dot { fill: #3dffb0; stroke: none; }
.map-dot.dc { fill: none; stroke: var(--muted); stroke-width: 1.3; }
.map-tv-idle .map-dot { fill: #e8c56b; }
.map-tv-off .map-dot { fill: #ff5a6e; }
.map-tv-stream .map-dot { fill: #3dff9a; }
.map-host-label, .map-leaf-label, .map-core-name, .map-core-sub {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 9px;
  text-anchor: middle;
}
.map-core-name { font-family: var(--display); font-size: 13px; letter-spacing: 0.12em; fill: var(--cyan); }
.map-core-sub { fill: var(--muted); font-size: 8px; letter-spacing: 0.08em; }
.map-core-ring {
  fill: none;
  stroke: rgba(110, 231, 255, 0.28);
  stroke-dasharray: 4 10;
  transform-origin: 0 0;
}
.map-core-ring.r1 { animation: map-spin 18s linear infinite; }
.map-core-ring.r2 { animation: map-spin 11s linear infinite reverse; }
.map-core-ring.r3 { animation: map-spin 7s linear infinite; }
.map-pulse {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
}
.map-pulse.stream { color: #3dff9a; animation: map-ping 1.8s ease-out infinite; }
.map-pulse.idle { color: #e8c56b; animation: map-ping 3.2s ease-out infinite; }
.map-hit { fill: transparent; stroke: none; }
.map-ha-hull {
  fill: rgba(201, 164, 255, 0.08);
  stroke: #c9a4ff;
  stroke-width: 1.1;
  stroke-dasharray: 5 6;
}
.map-ha-link {
  fill: none;
  stroke: #c9a4ff;
  stroke-width: 1.15;
  stroke-dasharray: 4 7;
  opacity: 0.8;
}
.map-ha-link.warn { stroke: var(--gold); }
.map-ha-link.down { stroke: var(--red); }
.map-ha-hull.warn { stroke: var(--gold); fill: rgba(232, 197, 107, 0.08); }
.map-ha-hull.down { stroke: var(--red); fill: rgba(255, 90, 110, 0.08); }
.map-ha-label {
  fill: #c9a4ff;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-anchor: middle;
  text-transform: uppercase;
}
.map-ha-badge {
  fill: #c9a4ff;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-anchor: middle;
  text-transform: uppercase;
}
.map-tv-ha .map-dot { stroke: #c9a4ff; stroke-width: 1.5; }
.map-legend {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding: 6px 12px;
  margin: 0 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
}
.map-legend b { display: none; }
.map-legend span, .map-legend div {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--muted);
}
.map-legend .lg {
  flex: 0 0 18px;
  height: 3px;
  margin-top: 0;
  border-radius: 2px;
}
.lg-green { background: #3dff9a; }
.lg-cyan { background: #6ee7ff; }
.lg-gold { background: #e8c56b; }
.lg-violet { background: #c9a4ff; }
.lg-ha { background: repeating-linear-gradient(90deg, #c9a4ff 0 6px, transparent 6px 10px); }
.map-node { cursor: help; }
.map-tv { cursor: pointer; }
.map-tv-on .map-dot {
  stroke: #fff;
  stroke-width: 2;
}
.map-pop-panel {
  position: absolute;
  left: 12px;
  top: 44px;
  z-index: 4;
  width: min(340px, 42vw);
  max-height: min(62vh, 560px);
  display: flex;
  flex-direction: column;
  background: #0c141ef5;
  border: 1px solid var(--line-hot);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
}
.map-pop-panel[hidden] { display: none; }
.map-pop-panel header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.map-pop-panel header strong { display: block; color: var(--gold); font-size: 13px; }
.map-pop-panel header span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.pop-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pop-close:hover { color: var(--text); }
.pop-body {
  overflow: auto;
  padding: 8px 12px 12px;
}
.pop-body section { margin: 0 0 10px; }
.pop-body h4 {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--cyan);
  font-weight: 600;
}
.pop-body h4 em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
  margin-left: 6px;
}
.pop-body ul { list-style: none; margin: 0; padding: 0; }
.pop-body li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  color: var(--text);
}
.pop-tv { color: var(--gold); }

@keyframes map-flow { to { stroke-dashoffset: -64; } }
@keyframes map-orbit { to { stroke-dashoffset: -80; } }
@keyframes map-spin { to { transform: rotate(360deg); } }
@keyframes map-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes map-ping {
  0% { transform: scale(0.7); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes map-twinkle { from { opacity: 0.15; } to { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  .map-hud-scan, .map-link-stream, .map-link-idle, .map-link-uplink,
  .map-link-observe, .map-link-control, .map-link-udpmon, .map-link-peer, .map-link-report,
  .map-core-ring, .map-pulse, .map-star, .map-orbit { animation: none; }
}

@media (max-width: 980px) {
  body.page-senders, body.page-topology { overflow: auto; }
  .stats-meaning { margin: 8px 0 0; max-width: none; }
  .stats-split { grid-template-columns: 1fr; }
  .senders-top, .senders-toolbar { flex-wrap: wrap; }
  .senders-main, .senders-main:has(#log-panel:not([hidden])) { grid-template-columns: 1fr; }
  #hls-q { width: 100%; margin-left: 0; }
  .map-dock { grid-template-columns: repeat(3, 1fr); }
  .map-hud { min-height: 70vh; }
}

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 40;
  max-width: 28rem; padding: 12px 16px;
  background: #120b08; border: 1px solid var(--gold-dim); color: var(--text);
  box-shadow: 0 8px 32px #000a; font-size: 14px;
}

/* --- Voice overlay (fullscreen) ----------------------------------------- */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 30%, rgba(61, 255, 176, 0.12), transparent 55%),
    rgba(3, 6, 10, 0.88);
  backdrop-filter: blur(10px);
}
.voice-overlay[hidden] { display: none !important; }
.voice-bubble {
  width: min(420px, 100%);
  text-align: center;
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.92);
  padding: 28px 22px 20px;
  box-shadow: 0 0 40px rgba(61, 255, 176, 0.08);
}
.voice-kicker {
  margin: 0 0 18px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
}
.voice-orb {
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 2px solid var(--cyan-dim);
  background:
    radial-gradient(circle at 40% 35%, rgba(110, 231, 255, 0.35), transparent 55%),
    radial-gradient(circle at 60% 70%, rgba(61, 255, 176, 0.25), transparent 50%),
    #0a1218;
  box-shadow: 0 0 30px rgba(110, 231, 255, 0.15);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}
.voice-orb[data-state="greeting"],
.voice-orb[data-state="speaking"] {
  border-color: var(--cyan);
  box-shadow: 0 0 40px rgba(110, 231, 255, 0.35);
  animation: voice-pulse 1.4s ease-in-out infinite;
}
.voice-orb[data-state="listening"] {
  border-color: var(--red);
  box-shadow: 0 0 40px rgba(255, 90, 90, 0.35);
  animation: voice-pulse 0.9s ease-in-out infinite;
}
.voice-orb[data-state="processing"] {
  border-color: var(--gold);
  animation: voice-spin 1.1s linear infinite;
}
.voice-status {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  font-weight: 700;
  color: var(--text);
}
.voice-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  min-height: 1.2em;
}
.voice-transcript {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  font-size: 14px;
  text-align: left;
  white-space: pre-wrap;
}
.voice-transcript[hidden] { display: none !important; }
.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
.voice-action, .voice-close {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.voice-action {
  border-color: var(--cyan-dim);
  color: var(--cyan);
  flex: 1 1 160px;
}
.voice-close { color: var(--muted); }
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes voice-spin {
  to { transform: rotate(360deg); }
}

.activity-list {
  display: grid;
  gap: 8px;
  margin: 0;
  min-height: 52px;
  max-height: none;
  overflow: visible;
}
.activity-section {
  margin: 0 0 18px;
}
.activity-section:last-child { margin-bottom: 0; }
.activity-section .sheet-kicker {
  margin: 0 0 8px;
  color: var(--muted);
}
.activity-panel[hidden],
.activity-list[hidden],
.activity-thread[hidden] {
  display: none !important;
}
.activity-panel {
  display: block;
  min-height: 0;
  padding: 0 20px 8px;
  overflow: auto;
  flex: 1 1 auto;
}
.activity-home-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px;
  padding: 0;
}
.activity-home-toolbar.sheet-actions { padding: 0; }
.activity-row {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #0a121c;
  font-size: 13px;
  text-align: left;
  color: inherit;
  width: 100%;
  font: inherit;
  cursor: default;
}
.activity-row.empty {
  color: var(--muted);
  border-style: dashed;
}
button.activity-row {
  cursor: pointer;
}
button.activity-row:hover {
  border-color: var(--cyan-dim);
  background: rgba(30, 90, 110, 0.16);
}
.activity-row .who { color: var(--cyan); font-weight: 600; }
.activity-row .meta { color: var(--muted); font-size: 11px; }
.activity-row .detail { color: var(--text); }
.activity-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.activity-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.activity-thread-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.activity-thread-head h4 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 1.15rem;
}
.activity-thread-body {
  flex: 1 1 auto;
  min-height: 240px;
  max-height: none;
  height: auto;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #080e16;
  align-content: start;
}
.activity-msg .meta {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.activity-msg .bubble {
  padding: 8px 10px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}
.activity-msg.user .bubble {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(30, 90, 110, 0.12);
}
.activity-msg.assistant .bubble {
  color: var(--text);
  background: rgba(7, 12, 18, 0.7);
}
.sheet-activity {
  width: min(640px, 94vw);
  max-height: min(88vh, 820px);
  flex-direction: column;
  overflow: hidden;
  background: var(--panel-solid);
}
.sheet-activity[open] {
  display: flex;
}
.sheet-activity #activity-msg {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 20px 16px;
  min-height: 1.2em;
}
@media (max-width: 980px) {
  .activity-thread-body { min-height: 200px; }
  .sheet-activity {
    width: 96vw;
    max-height: 92vh;
  }
}

@media (max-width: 980px) {
  .top {
    gap: 12px;
    padding: 10px 12px;
  }
  .brand h1 { font-size: 1.35rem; }
  .ring-wrap { order: -1; }
  .ring { width: 96px; height: 96px; }
  .layers {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 10px;
  }
  .main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 10px 16px;
    min-height: 0;
  }
  .panel.incidents { max-height: 36vh; }
  .panel.chat {
    flex: 1;
    min-height: 42vh;
  }
  .composer {
    gap: 8px;
  }
  .mic, .send {
    min-width: 48px;
    min-height: 48px;
  }
  #prompt {
    font-size: 16px; /* iOS zoom avoid */
  }
  .userbar { flex-wrap: wrap; }
  .nav-sheet {
    max-height: min(70vh, 520px);
    overflow: auto;
  }
  .voice-bubble { padding: 24px 16px 16px; }
  .voice-orb { width: 100px; height: 100px; }
}
