:root {
  --bg: #07100d;
  --surface: rgba(14, 26, 22, 0.82);
  --surface-strong: #111f1a;
  --line: rgba(176, 225, 203, 0.14);
  --text: #f2f8f5;
  --muted: #93a89f;
  --green: #55e6a5;
  --green-dim: #1d6045;
  --amber: #ffc86b;
  --red: #ff7a78;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(43, 160, 108, 0.18), transparent 38%),
    linear-gradient(150deg, #050a08, var(--bg) 55%, #09130f);
  overflow-x: hidden;
}

button { font: inherit; }

.glow {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.14;
}

.glow-one { width: 420px; height: 420px; background: #4ce29f; top: 10%; right: -180px; }
.glow-two { width: 320px; height: 320px; background: #26aef0; bottom: -180px; left: -120px; }

.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 34px; }

.hero { display: flex; justify-content: space-between; gap: 36px; align-items: end; }
.eyebrow, .panel-kicker { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 750; letter-spacing: 0.18em; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 70px); line-height: 0.95; letter-spacing: -0.055em; }
.lede { max-width: 710px; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.mode-badge { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(8, 18, 14, 0.72); font-size: 12px; }

.topology {
  display: grid;
  grid-template-columns: 1fr 36px 1fr 36px 1fr 36px 1fr;
  align-items: center;
  margin: 42px 0 20px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 18, 15, 0.62);
  backdrop-filter: blur(18px);
}

.node { display: flex; align-items: center; gap: 11px; min-width: 0; }
.node strong, .node small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node strong { font-size: 13px; }
.node small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #42534c; box-shadow: 0 0 0 4px rgba(115, 143, 131, 0.08); transition: 180ms ease; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 5px rgba(85, 230, 165, 0.12), 0 0 18px rgba(85, 230, 165, 0.55); }
.status-dot.busy { background: var(--amber); box-shadow: 0 0 0 5px rgba(255, 200, 107, 0.12); }
.connector { height: 1px; background: linear-gradient(90deg, var(--line), rgba(85, 230, 165, 0.45), var(--line)); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.72fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.transcript-panel { min-height: 430px; padding: 28px; display: flex; flex-direction: column; }
.control-panel { padding: 28px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
h2 { margin: 0; font-size: 21px; letter-spacing: -0.025em; }
.transcript { flex: 1; margin-top: 28px; font-size: clamp(20px, 3vw, 30px); line-height: 1.55; letter-spacing: -0.02em; }
.transcript p { margin: 0 0 18px; }
.transcript .placeholder { color: #5d7168; }
.transcript .final { animation: enter 250ms ease both; }
.partial { min-height: 28px; margin: 14px 0 0; color: var(--green); font-size: 17px; line-height: 1.5; }
.partial:not(:empty)::after { content: ""; display: inline-block; width: 6px; height: 18px; margin-left: 5px; vertical-align: -3px; background: var(--green); animation: blink 0.8s infinite; }

.audio-level { display: flex; align-items: center; gap: 3px; height: 24px; }
.audio-level i { width: 3px; height: 5px; border-radius: 4px; background: var(--green-dim); transition: height 80ms linear, background 120ms; }
.audio-level.active i { background: var(--green); }

.control-panel > button, .button-row button { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); background: #14251f; cursor: pointer; transition: 160ms ease; }
.control-panel > button:hover:not(:disabled), .button-row button:hover:not(:disabled) { border-color: rgba(85, 230, 165, 0.5); transform: translateY(-1px); }
.control-panel > button:disabled, .button-row button:disabled { cursor: not-allowed; opacity: 0.4; }
.control-panel .primary { margin-top: 28px; color: #042116; border-color: transparent; background: var(--green); font-weight: 800; }
.control-panel .danger { color: #ffaaa8; background: rgba(255, 87, 84, 0.08); }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 9px 0; }
.session-meta { margin: 28px 0 14px; }
.session-meta div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.session-meta dt { color: var(--muted); }
.session-meta dd { margin: 0; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.session-meta, details { font-size: 12px; }
details { color: var(--muted); }
summary { cursor: pointer; padding: 8px 0; }
pre { max-height: 140px; overflow: auto; padding: 12px; border-radius: 9px; color: #9abaae; background: #09110e; font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 18px; color: #62746d; font-size: 11px; }

@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 680px); padding-top: 34px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .topology { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .connector { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .transcript-panel { min-height: 360px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
