:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --ink: #172033;
  --muted: #647084;
  --line: #d9e0ea;
  --panel: #ffffff;
  --assistant: #eef7f5;
  --user: #f7f9fc;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b42318;
  --shadow: 0 16px 40px rgb(18 31 53 / 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0;
}

.conversation-stage {
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
  box-shadow: var(--shadow);
}

.call-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  width: 100%;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.04;
}

.call-state {
  min-width: 148px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.call-state span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.call-state strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.voice-orb {
  position: relative;
  width: min(260px, 58vw);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.level-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, #dce7e5 0deg);
  transition: background 90ms linear;
}

.orb-core {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fbffff 0%, #9bd1ca 46%, #0f766e 100%);
  box-shadow: inset 0 0 36px rgb(255 255 255 / 0.55), 0 18px 45px rgb(15 118 110 / 0.22);
}

.primary-controls,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

button {
  min-width: 108px;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  border-color: #aab4c2;
  background: #aab4c2;
  cursor: not-allowed;
}

.live-line {
  min-height: 28px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.conversation-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-top: 16px;
}

.dialogue-panel,
.tool-panel,
.debug-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dialogue-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.bubble {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bubble span,
.panel-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.bubble p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  line-height: 1.65;
}

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

.bubble.assistant {
  background: var(--assistant);
}

.tool-panel {
  padding: 16px;
}

.tool-timeline {
  min-height: 210px;
  display: grid;
  gap: 10px;
  align-content: start;
  margin: 12px 0;
}

.tool-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.tool-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.debug-panel {
  margin-top: 16px;
  padding: 12px 16px;
}

.debug-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.debug-panel button {
  margin-top: 12px;
}

pre {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
  color: #d1fae5;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .call-header,
  .conversation-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .conversation-grid {
    display: grid;
  }

  .call-state {
    width: 100%;
  }
}
