@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #0b0f1c;
  --panel: #12182a;
  --panel-2: #0f1424;
  --text: #e8ecf3;
  --muted: #9aa3b2;
  --accent: #7cf1c8;
  --accent-2: #6ea8ff;
  --danger: #ff7a7a;
  --border: #1e2740;
  --shadow: 0 18px 40px rgba(10, 14, 28, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1b2440 0%, var(--bg) 55%),
    linear-gradient(130deg, #0c1224 0%, #0b0f1c 60%, #0b1426 100%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  gap: 24px;
}

.hero {
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(140deg, #151c33 0%, #0f1325 55%, #0d152a 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(124, 241, 200, 0.12);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: 0.75rem;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 4vw, 3.3rem);
}

.subhead {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.panel {
  background: var(--panel);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
}

.controls {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 600;
  color: var(--muted);
}

select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2d3348;
  box-shadow: 0 0 0 6px rgba(124, 241, 200, 0.08);
  transition: background 0.2s ease;
}

.dot.live {
  background: var(--accent);
}

.buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent-2);
  color: #0b0f1c;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(110, 168, 255, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#disconnectBtn {
  background: var(--danger);
  color: #14080a;
}

.ptt {
  background: var(--accent);
  color: #0b0f1c;
  border: 2px solid rgba(124, 241, 200, 0.5);
}

.ptt.active {
  background: #b7fbe6;
  box-shadow: 0 0 0 4px rgba(124, 241, 200, 0.18);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
}

.mcp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.ghost:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(124, 241, 200, 0.2);
}

.log,
.transcript {
  min-height: 160px;
  max-height: 280px;
  overflow: auto;
  background: #0a0f1f;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #1b243b;
  font-size: 0.9rem;
  line-height: 1.5;
}

#waveform {
  width: 100%;
  height: 140px;
  border-radius: 14px;
  background: radial-gradient(circle at center, rgba(124, 241, 200, 0.08), rgba(10, 15, 31, 0.95));
  border: 1px solid #1b243b;
  display: block;
}

.transcript-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.turn {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(154, 163, 178, 0.2);
}

.turn:last-child {
  border-bottom: none;
}

.turn .role {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
  min-width: 72px;
}

.turn .text {
  white-space: pre-wrap;
  flex: 1;
}

.turn.user .text {
  color: var(--accent);
}

.turn.assistant .text {
  color: #f1f4ff;
}

.log-entry {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(154, 163, 178, 0.2);
}

.log-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .app {
    padding: 32px 18px 48px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
