:root {
  --bg:        #090c10;
  --surface:   #0f1419;
  --surface2:  #161d26;
  --border:    #1e2d3d;
  --accent:    #00d4ff;
  --accent2:   #0099bb;
  --agent:     #00d4ff;
  --user:      #64ffb4;
  --muted:     #3a4a5a;
  --text:      #c8d8e8;
  --text-dim:  #4a6070;
  --danger:    #ff4466;
  --warn:      #ffaa00;
  --radius:    12px;
  --mono:      'DM Mono', monospace;
  --display:   'Syne', sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Scanline overlay ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,212,255,0.015) 2px,
    rgba(0,212,255,0.015) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* ── Layout ── */
.shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-icon::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.logo-text {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-text span { color: var(--accent); }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  transition: all 0.3s;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.3s;
}

.status-pill.connected .status-dot  { background: var(--user); box-shadow: 0 0 8px var(--user); }
.status-pill.running .status-dot    { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.2s infinite; }
.status-pill.waiting .status-dot    { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-pill.done .status-dot       { background: var(--user); }
.status-pill.connected              { color: var(--user); border-color: rgba(100,255,180,0.2); }
.status-pill.running                { color: var(--accent); border-color: rgba(0,212,255,0.2); }
.status-pill.waiting                { color: var(--warn); border-color: rgba(255,170,0,0.2); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Main ── */
main {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 20px 0;
}

/* ── Visualizer ── */
.visualizer-wrap {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  height: 4px;
  transition: height 0.1s ease;
  opacity: 0.7;
}

.bar.user-bar { background: var(--user); }

/* ── Transcript panel ── */
.transcript-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.transcript-panel::-webkit-scrollbar { width: 4px; }
.transcript-panel::-webkit-scrollbar-track { background: transparent; }
.transcript-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.empty-state svg { opacity: 0.3; }

/* ── Transcript entries ── */
.turn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  animation: fadeUp 0.2s ease;
  position: relative;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.turn.agent { background: rgba(0,212,255,0.05); border-left: 2px solid var(--agent); }
.turn.user  { background: rgba(100,255,180,0.05); border-left: 2px solid var(--user); margin-left: 20px; }

.turn-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.turn.agent .turn-label { color: var(--agent); }
.turn.user  .turn-label { color: var(--user); }

.turn-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.turn.streaming .turn-text::after {
  content: '▋';
  animation: blink 0.8s step-end infinite;
  color: var(--agent);
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── System messages ── */
.sys-msg {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px;
  animation: fadeUp 0.2s ease;
}

.sys-msg.barge { color: var(--warn); }

/* ── Footer controls ── */
footer {
  padding: 16px 0 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.btn-start {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 14px 36px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 24px rgba(0,212,255,0.25);
}

.btn-start:hover { background: #33deff; box-shadow: 0 0 36px rgba(0,212,255,0.4); transform: translateY(-1px); }
.btn-start:active { transform: translateY(0); }

.btn-start.active {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  box-shadow: 0 0 20px rgba(255,68,102,0.2);
}

.btn-start.active:hover {
  background: rgba(255,68,102,0.1);
  box-shadow: 0 0 32px rgba(255,68,102,0.35);
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mic icon */
.mic-ring {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mic-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Stop icon */
.stop-sq { width: 10px; height: 10px; background: currentColor; border-radius: 2px; }

/* ── Info strip ── */
.info-strip {
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.info-kv { display: flex; gap: 6px; }
.info-k { text-transform: uppercase; }
.info-v { color: var(--text); }

/* ── Reset test panel ── */
.reset-panel {
  width: 100%;
  margin-top: 8px;
}

.reset-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-toggle:hover { color: var(--warn); border-color: var(--warn); }

.reset-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.reset-grid.open { display: grid; }

.reset-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--warn);
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.reset-btn:hover {
  background: rgba(255,170,0,0.1);
  border-color: var(--warn);
  transform: translateY(-1px);
}

.reset-btn:active { transform: translateY(0); }
