:root {
  color-scheme: light;
  --ink: #111714;
  --muted: #66736d;
  --line: #dfe7e2;
  --paper: #fbfdf9;
  --panel: rgba(255, 255, 255, 0.82);
  --blue: #1f6feb;
  --blue-dark: #154ea8;
  --orange: #ff8a00;
  --orange-dark: #c96a00;
  --soft-blue: #eaf2ff;
  --soft-orange: #fff3e3;
  --soft: #f2f6f1;
  --danger: #e45858;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Aptos", "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(31, 111, 235, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 138, 0, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 12% 6%, rgba(31, 111, 235, 0.15), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(255, 138, 0, 0.14), transparent 28%),
    var(--paper);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

button, input, select, textarea { font: inherit; }

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(17, 23, 20, 0.04);
}

button:disabled { cursor: not-allowed; opacity: 0.45; }
button:not(:disabled):hover { border-color: #b6c9c0; transform: translateY(-1px); }

.primary-action {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(31, 111, 235, 0.22);
}

.primary-action:not(:disabled):hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  outline: none;
}

select:focus, input:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

textarea { min-height: 220px; resize: vertical; line-height: 1.45; }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.brand-lockup img {
  width: 155px;
  height: 32px;
  object-fit: contain;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #9aa9a2;
  box-shadow: 0 0 0 5px rgba(154, 169, 162, 0.16);
}

.status-dot.live { background: var(--blue); box-shadow: 0 0 0 5px rgba(31, 111, 235, 0.16); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 5px rgba(228, 88, 88, 0.14); }

.eyebrow, .section-head p {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.session-actions, .button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel, .stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.workspace {
  display: block;
  margin-top: 4px;
}

.panel {
  padding: 18px;
}

.prompt-panel, .settings-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.config-drawer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0;
  overflow: hidden;
}

.config-drawer:not([open]) .config-grid {
  display: none;
}

.config-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  list-style: none;
}

.config-drawer > summary::-webkit-details-marker {
  display: none;
}

.config-drawer > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.config-drawer[open] > summary::after {
  content: "-";
  background: var(--orange);
}

.config-drawer > summary span {
  font-weight: 850;
}

.config-drawer > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 750;
}

.notes-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.stage {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
  min-height: 620px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(242,246,241,.86)),
    radial-gradient(circle at 50% 24%, rgba(31,111,235,.16), transparent 30%),
    radial-gradient(circle at 68% 22%, rgba(255,138,0,.13), transparent 24%);
}

.voice-core {
  display: grid;
  place-items: center;
  min-height: 210px;
}

.voice-core span {
  width: 152px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0 10%, transparent 20%),
    radial-gradient(circle at 54% 54%, #eaf2ff 0 20%, #1f6feb 45%, #0d2c66 78%),
    radial-gradient(circle at 72% 34%, #ff8a00, transparent 34%);
  box-shadow: 0 0 0 16px rgba(31,111,235,.06), 0 34px 70px rgba(17, 72, 156, 0.24);
  animation: breathe 2.8s ease-in-out infinite;
}

.in-stage {
  justify-content: center;
}

.in-stage button {
  min-width: 112px;
  min-height: 46px;
  font-weight: 800;
}

@keyframes breathe {
  0%, 100% { transform: scale(.96); }
  50% { transform: scale(1.04); }
}

.live-copy {
  display: grid;
  gap: 24px;
  align-content: center;
}

.speaker-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.speaker-block span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--blue-dark);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 850;
}

.speaker-block.assistant span {
  color: #fff;
  background: var(--orange);
}

.speaker-block p {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.text-send {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.check-row input {
  width: auto;
}

.hidden { display: none; }

.transcript-panel {
  margin-top: 14px;
}

.transcript-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.transcript-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.transcript-list li.assistant {
  background: var(--soft-orange);
}

.transcript-list b {
  color: var(--blue-dark);
}

.transcript-list span {
  color: var(--muted);
  font-size: 13px;
}

.transcript-list p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.latency-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.section-head.compact h2 {
  font-size: 17px;
}

.latency-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.latency-list li {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(234,242,255,.84), rgba(255,243,227,.72));
}

.latency-list b {
  color: var(--blue-dark);
}

.latency-list p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.latency-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.latency-metrics span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(31, 111, 235, .14);
  font-size: 13px;
  font-weight: 700;
}

.metric-notes {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
}

.metric-notes h3 {
  margin: 0;
  font-size: 15px;
}

.metric-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.metric-notes b {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .config-grid {
    grid-template-columns: 1fr;
  }

  .stage { min-height: 520px; }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .topbar, .field-grid, .text-send {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .brand-lockup {
    justify-content: space-between;
  }

  .stage {
    min-height: calc(100svh - 118px);
    padding: 18px;
  }

  .config-drawer > summary {
    display: grid;
    gap: 4px;
    padding: 12px 16px;
  }

  .config-drawer > summary small {
    margin-left: 0;
  }

  .config-drawer > summary::after {
    position: absolute;
    right: 20px;
  }

  .voice-core {
    min-height: 170px;
  }

  .voice-core span {
    width: 118px;
  }

  .in-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .in-stage button:first-child {
    grid-column: 1 / -1;
  }

  .speaker-block p {
    font-size: 30px;
  }
}
