/* VOICO Detective — Styles.
   Canvas im Look des Voico-Workflow-Editors (helle Punktfläche, Karten,
   schwarze Bedingungs-Pills), rechts Transkript im Apple-Music-Lyrics-Stil. */

:root {
  --bg: #f5f6f9;
  --card: #ffffff;
  --ink: #1d2634;
  --muted: #71798a;
  --line: #e4e7ee;
  --accent: #2f6cff;
  --accent-soft: #e8efff;
  --ok: #17a34a;
  --err: #e5484d;
  --pill: #16181d;
  --gold: #fffdf3;
  --gold-line: #eddfae;
  --green: #eafcf3;
  --green-line: #bfe8d2;
  --panel1: #10142a;
  --panel2: #1d1440;
  --shadow: 0 1px 2px rgba(20, 28, 45, .06), 0 8px 24px rgba(20, 28, 45, .09);
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
main { display: contents; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-rows: 58px 1fr 92px;
  grid-template-columns: 1fr clamp(320px, 30vw, 430px);
  grid-template-areas:
    "top top"
    "canvas lyrics"
    "player player";
  overflow: hidden;
}

/* ---------------------------------------------------------------- Topbar */

#topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-emoji { font-size: 22px; }
.brand-name { font-size: 16px; letter-spacing: .2px; }
.brand-name b { font-weight: 800; }

#loadForm { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
#loadForm .field { min-width: 0; flex: 0 1 auto; }
#loadForm .field input { max-width: 100%; }

.field { position: relative; display: flex; align-items: center; }
.field input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  background: #fafbfd;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.key-field input { width: clamp(140px, 16vw, 240px); padding-right: 34px; }
#callId { width: clamp(170px, 20vw, 280px); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#toggleKey {
  position: absolute; right: 4px;
  border: 0; background: none; cursor: pointer;
  font-size: 14px; opacity: .55; padding: 4px;
}
#toggleKey:hover { opacity: 1; }

#callId { padding-right: 30px; }
#btnRecent {
  position: absolute; right: 3px;
  border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--muted); padding: 5px 7px;
  border-radius: 7px;
}
#btnRecent:hover { background: #edf0f6; color: var(--ink); }
#recentList {
  position: absolute; top: 40px; left: 0; z-index: 60;
  width: 430px; max-height: 420px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 14px 44px rgba(15,23,42,.2);
  padding: 6px;
}
#recentList .rc-head {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 7px 10px 5px;
}
#recentList .rc-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 12.5px;
}
#recentList .rc-row:hover { background: #f2f5fb; }
#recentList .rc-when { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--muted); flex: none; width: 88px; }
#recentList .rc-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#recentList .rc-who b { font-weight: 650; }
#recentList .rc-dur { flex: none; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--muted); }
#recentList .rc-empty { padding: 12px; color: var(--muted); font-size: 12.5px; }

.force-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted); white-space: nowrap; cursor: pointer;
}

.btn {
  height: 34px; padding: 0 16px;
  border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: filter .15s, background .15s;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { background: #9db7f5; cursor: wait; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: #f3f5f9; }

.status {
  margin-left: auto;
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 34vw;
}
.status.error { color: var(--err); font-weight: 600; }
.status .spin {
  display: inline-block; width: 11px; height: 11px;
  border: 2px solid var(--accent); border-top-color: transparent;
  border-radius: 50%; margin-right: 6px; vertical-align: -1px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Canvas */

#canvasWrap {
  grid-area: canvas;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle, #d9dde6 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--bg);
}

#canvasWrap { cursor: grab; }
#canvasWrap.panning { cursor: grabbing; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* HTML-Ebene für Karten + Pills (synchron zum SVG transformiert).
   Grund: Safari rendert foreignObject in transformierten <g> falsch. */
#nodeLayers { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.agent-layer {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.epillw {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

#emptyState {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.empty-card {
  max-width: 520px; text-align: center;
  background: rgba(255,255,255,.86); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 34px 38px; box-shadow: var(--shadow);
}
.empty-emoji { font-size: 40px; margin-bottom: 6px; }
.empty-card h2 { margin: 4px 0 10px; font-size: 21px; }
.empty-card p { margin: 8px 0; color: var(--ink); line-height: 1.55; }
.empty-card .empty-hint { color: var(--muted); font-size: 13px; }

/* Agent-Tabs */
#agentTabs {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.agent-tab {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: border-color .15s, background .15s;
}
.agent-tab:hover { background: #f6f8fc; }
.agent-tab.on { border-color: var(--accent); background: var(--accent-soft); color: #1c47b8; }
.agent-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: #c3c9d6; }
.agent-tab.on .dot { background: var(--accent); animation: pulse 1.6s ease-out infinite; }
.agent-tab .entry-badge { font-size: 10.5px; font-weight: 700; color: #8a6d1a; background: #fdf3d0; border-radius: 6px; padding: 1px 6px; }

#zoomCtrls {
  position: absolute; right: 14px; top: 14px; z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
}
#zoomCtrls button {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 17px; cursor: pointer; box-shadow: var(--shadow);
}
#zoomCtrls button:hover { background: #f3f5f9; }

/* Banner (Warnungen / Demo-Hinweis) */
#banner {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%);
  z-index: 25; max-width: min(620px, 80%);
  background: #fff8e6; border: 1px solid #f0dfae; color: #7a5b12;
  padding: 8px 14px; border-radius: 11px; font-size: 12.5px;
  box-shadow: var(--shadow);
}
#banner.demo { background: #eef4ff; border-color: #c9dbff; color: #274f9e; }

/* ------------------------------------------------- Graph: Kanten + Pills */

.edge path.wire {
  fill: none;
  stroke: #b9c0cc;
  stroke-width: 1.6;
}
.edge.lit path.wire {
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-dasharray: 7 5;
  animation: dashflow 1s linear infinite;
  filter: drop-shadow(0 0 3px rgba(47,108,255,.45));
}
.edge.lit-ok path.wire { stroke: var(--ok); filter: drop-shadow(0 0 3px rgba(23,163,74,.4)); }
.edge.lit-err path.wire { stroke: var(--err); filter: drop-shadow(0 0 3px rgba(229,72,77,.4)); }
@keyframes dashflow { to { stroke-dashoffset: -24; } }

.edge .port { fill: #cdd3de; }
.edge.lit .port { fill: var(--accent); }

.epill {
  display: inline-block;
  max-width: 300px;
  background: var(--pill); color: #fff;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 7px 12px; border-radius: 99px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(10,14,25,.25);
  transition: background .2s, transform .2s;
}
.epill.ok  { background: var(--ok); }
.epill.err { background: var(--err); }
.epillw.lit .epill { background: var(--accent); transform: scale(1.08); }
.epillw.lit-ok .epill.ok { background: var(--ok); transform: scale(1.12); box-shadow: 0 0 0 4px rgba(23,163,74,.18); }
.epillw.lit-err .epill.err { background: var(--err); transform: scale(1.12); box-shadow: 0 0 0 4px rgba(229,72,77,.18); }

/* ------------------------------------------------------- Graph: Knoten */

.node {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;   /* Ebene selbst ist pointer-events:none */
  z-index: 3;
}
.node .card {
  position: relative;
  width: 100%; height: 100%;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 13px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  /* KEIN overflow:hidden — live-dot/fnstate/thinkbadge ragen bewusst heraus;
     Texte clampen selbst (.ttl ellipsis, .desc line-clamp) */
  font-size: 12px;
}
.node:hover .card { border-color: #c9d2e2; }

.node .hd { display: flex; align-items: center; gap: 7px; min-height: 18px; }
.node .hd svg { width: 14px; height: 14px; flex: none; opacity: .75; }
.node .hd .ttl {
  font-weight: 700; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node .desc {
  color: var(--muted); font-size: 11px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.node .badges { display: flex; gap: 6px; margin-top: auto; }
.node .badge {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 10px; color: var(--muted); padding: 2px 6px; background: #fff;
}
.node .badge svg { width: 10px; height: 10px; }

/* Typ-Varianten */
.node.t-override .card { background: var(--gold); border-color: var(--gold-line); }
.node.t-phone .card { background: var(--green); border-color: var(--green-line); }
.node.t-start .card, .node.t-end .card {
  border-radius: 99px; align-items: center; justify-content: center;
  flex-direction: row; gap: 8px; text-align: center; padding: 8px 16px;
}
.node.t-start .card { background: #0ca678; border-color: #0ca678; color: #fff; }
.node.t-start .ttl, .node.t-end .ttl { font-size: 13px; }
.node.t-start .sub, .node.t-end .sub { font-size: 10.5px; opacity: .8; }
.node.t-start .card svg, .node.t-end .card svg { opacity: 1; }
.node.t-end .card { background: #23262e; border-color: #23262e; color: #fff; }
.node.t-start .txt, .node.t-end .txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }

/* Replay-Zustände */
.node.lit .card { border-color: var(--accent); }
.node.active .card {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47,108,255,.20), 0 10px 28px rgba(47,108,255,.25);
  transform: translateY(-1px) scale(1.015);
}
.node.active .hd svg { opacity: 1; }
.node .live-dot {
  position: absolute; top: -5px; right: -5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  opacity: 0; transition: opacity .2s;
}
.node.active .live-dot { opacity: 1; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,108,255,.5); }
  70% { box-shadow: 0 0 0 9px rgba(47,108,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,108,255,0); }
}

.node.fn-ok .card { border-color: var(--ok); }
.node.fn-ok .live-dot { background: var(--ok); opacity: 1; }
.node.fn-err .card { border-color: var(--err); }
.node.fn-err .live-dot { background: var(--err); opacity: 1; }
.node.flash .card { animation: flashcard .55s ease-out 2; }
@keyframes flashcard {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* „Denkt nach"-Zustand: Sub-Agent/Knoten ruft gerade ein Tool auf */
.node.thinking .card {
  border-color: var(--accent);
  animation: thinkpulse 1.1s ease-in-out infinite;
}
@keyframes thinkpulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(47,108,255,.16), var(--shadow); }
  50%      { box-shadow: 0 0 0 8px rgba(47,108,255,.05), var(--shadow); }
}
.node .thinkbadge {
  position: absolute; top: -11px; right: -8px;
  display: none; align-items: center; gap: 3px;
  background: var(--accent); color: #fff;
  border-radius: 99px; padding: 4px 8px;
  box-shadow: 0 3px 10px rgba(47,108,255,.45);
}
.node .thinkbadge svg { width: 10px; height: 10px; fill: #fff; animation: thinkwrench 1.6s ease-in-out infinite; }
.node .thinkbadge i {
  width: 4px; height: 4px; border-radius: 50%; background: #fff;
  animation: thinkdot 1s ease-in-out infinite;
}
.node .thinkbadge i:nth-of-type(2) { animation-delay: .16s; }
.node .thinkbadge i:nth-of-type(3) { animation-delay: .32s; }
.node.thinking .thinkbadge { display: inline-flex; }
@keyframes thinkdot {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2.5px); }
}
@keyframes thinkwrench {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(14deg); }
}

/* Status-Chip im Tool-Knoten */
.node .fnstate {
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 800; color: #fff;
  border-radius: 99px; padding: 2px 9px; opacity: 0; transition: opacity .2s;
  white-space: nowrap;
}
.node.fn-ok .fnstate { background: var(--ok); opacity: 1; }
.node.fn-err .fnstate { background: var(--err); opacity: 1; }

/* ---------------------------------------------------------- Inspector */

#inspector {
  position: absolute; right: 14px; bottom: 14px; z-index: 26;
  width: 360px; max-height: min(65%, 520px);
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  box-shadow: 0 12px 40px rgba(15,23,42,.18);
  overflow: auto; padding: 15px 17px;
  font-size: 12.5px;
}
#inspector h3 { margin: 0 34px 2px 0; font-size: 14.5px; }
#inspector .close {
  position: absolute; top: 9px; right: 9px;
  border: 0; background: #f1f3f8; border-radius: 8px;
  width: 26px; height: 26px; cursor: pointer; font-size: 13px; color: var(--muted);
}
#inspector .close:hover { background: #e6e9f1; color: var(--ink); }
#inspector .typechip {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  background: var(--accent-soft); color: #1c47b8;
  padding: 2px 8px; border-radius: 6px; margin: 2px 0 8px;
}
#inspector .sec { margin-top: 10px; }
#inspector .sec .lbl {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 3px;
}
#inspector p { margin: 2px 0; line-height: 1.5; }
#inspector pre {
  background: #f6f8fb; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font-size: 11px; line-height: 1.5;
  overflow: auto; max-height: 180px; margin: 4px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; word-break: break-word;
}
#inspector .logrow { border-left: 3px solid var(--ok); padding-left: 9px; margin: 9px 0; }
#inspector .logrow.err { border-left-color: var(--err); }
#inspector .logrow .when { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------- Lyrics */

#lyricsPanel {
  grid-area: lyrics;
  position: relative;
  background:
    radial-gradient(120% 90% at 85% -10%, #35256e 0%, transparent 55%),
    radial-gradient(120% 100% at -10% 110%, #0c2f57 0%, transparent 60%),
    linear-gradient(165deg, var(--panel2) 0%, var(--panel1) 60%, #0b0e1d 100%);
  display: flex; flex-direction: column;
  overflow: hidden;
}

#callMeta {
  flex: none;
  padding: 13px 18px 11px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  color: #fff;
  background: rgba(8, 10, 24, .35);
  backdrop-filter: blur(8px);
}
#callMeta .who { font-weight: 800; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
#callMeta .who .demo-chip {
  font-size: 10px; font-weight: 800; letter-spacing: .6px;
  background: #ffd43b; color: #5f4a00; padding: 2px 7px; border-radius: 6px;
}
#callMeta .sub { color: rgba(255,255,255,.55); font-size: 11.5px; margin-top: 3px; }
#callMeta .sum { color: rgba(255,255,255,.75); font-size: 11.5px; margin-top: 7px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

#lines {
  flex: 1;
  overflow-y: auto;
  padding: 34px 22px 46vh;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.lines-empty { color: rgba(255,255,255,.4); text-align: center; margin-top: 40%; font-size: 13px; }

.line {
  margin: 0 0 20px;
  font-size: 19px; font-weight: 700; line-height: 1.38;
  color: rgba(255,255,255,.34);
  cursor: pointer;
  transition: color .3s, transform .3s, filter .3s;
  transform-origin: left center;
  filter: blur(.4px);
  max-width: 95%;
}
.line .who-tag {
  display: block; font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 3px; opacity: .55;
}
.line.user {
  margin-left: auto; text-align: right; transform-origin: right center;
  color: rgba(140, 190, 255, .40);
}
.line:hover { color: rgba(255,255,255,.75); filter: none; }
.line.user:hover { color: rgba(150,200,255,.8); }
.line.past { color: rgba(255,255,255,.60); filter: none; }
.line.user.past { color: rgba(140,190,255,.62); }
.line.active { color: #fff; transform: scale(1.03); filter: none; }
.line.user.active { color: #a7d0ff; }

.fnchip {
  display: flex; justify-content: center; margin: 18px 0;
  cursor: pointer;
}
.fnchip .inner {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  padding: 6px 13px; border-radius: 99px;
  transition: background .25s, box-shadow .25s;
}
.fnchip .inner .st { font-size: 12px; }
.fnchip.ok .inner .st { color: #4ade80; }
.fnchip.err .inner .st { color: #ff8a8e; }
.fnchip.active .inner {
  background: rgba(47,108,255,.35);
  box-shadow: 0 0 0 4px rgba(47,108,255,.15);
  color: #fff;
}
.fnchip .inner svg { width: 11px; height: 11px; fill: currentColor; opacity: .8; }
.fnchip.sys.transfer .inner {
  background: rgba(139,92,246,.16);
  border-color: rgba(167,139,250,.35);
  color: #cabdfc;
}
.fnchip.sys.transfer.active .inner {
  background: rgba(139,92,246,.42);
  box-shadow: 0 0 0 4px rgba(139,92,246,.16);
  color: #fff;
}
.fnchip.sys.end .inner {
  background: rgba(255,255,255,.05);
  border-style: dashed;
  color: rgba(255,255,255,.6);
}
.fnchip.sys.end.active .inner { background: rgba(255,255,255,.18); color: #fff; }

/* ------------------------------------------------------------- Player */

#player {
  grid-area: player;
  display: flex; align-items: center; gap: 20px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 0 20px;
  z-index: 30;
}
#player.disabled { pointer-events: none; filter: grayscale(1) opacity(.55); }

.controls { display: flex; align-items: center; gap: 9px; }
.pbtn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.pbtn svg { width: 17px; height: 17px; fill: var(--ink); }
.pbtn:hover { background: #f3f5f9; }
.pbtn:active { transform: scale(.94); }
.pbtn.main {
  width: 52px; height: 52px; border: 0;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(47,108,255,.4);
}
.pbtn.main svg { width: 22px; height: 22px; fill: #fff; }
.pbtn.main:hover { filter: brightness(1.07); background: var(--accent); }
.pbtn.speed { width: auto; border-radius: 99px; padding: 0 13px; font-size: 12.5px; font-weight: 700; color: var(--ink); }

.timeline { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.tstamp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); flex: none; }

#scrubWrap { position: relative; flex: 1; height: 26px; display: flex; align-items: center; }
#scrub {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 99px;
  background: #e6e9f0; outline: none; margin: 0;
  position: relative; z-index: 3; cursor: pointer;
}
#scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
  box-shadow: 0 1px 5px rgba(15,23,42,.3);
  cursor: grab;
}
#scrub::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
  cursor: grab;
}
#scrubFill {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 5px; border-radius: 99px; background: var(--accent);
  width: 0; z-index: 2; pointer-events: none;
}
#markers { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.marker {
  position: absolute; top: 50%;
  width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15,23,42,.35);
  pointer-events: auto; cursor: pointer;
}
.marker.fn-ok { background: var(--ok); }
.marker.fn-err { background: var(--err); }
.marker.transfer { background: #8b5cf6; border-radius: 3px; }

#playerMeta {
  flex: none; max-width: 300px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
#playerMeta b { color: var(--ink); }

/* ------------------------------------------------------------ Klein */

@media (max-width: 980px) {
  body {
    grid-template-rows: auto 1fr 42vh 92px;
    grid-template-columns: 1fr;
    grid-template-areas: "top" "canvas" "lyrics" "player";
  }
  #topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .status { max-width: 100%; }
  .key-field input, #callId { width: 160px; }
}
