:root {
  --bg: #f7faf9;
  --surface: #ffffff;
  --ink: #16201f;
  --muted: #687574;
  --line: #dce7e4;
  --teal: #0f766e;
  --teal-strong: #0b5f59;
  --cobalt: #285bd4;
  --success: #18895f;
  --danger: #a33b36;
  --shadow: 0 24px 70px rgba(19, 38, 35, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(40, 91, 212, 0.08), transparent 36%),
    var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 36px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--teal);
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.12);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
}

.brand h1,
.brand p,
.voice-copy h2,
.voice-copy p,
.panel-heading h2,
.event-log h3,
.chat-heading h3 {
  margin: 0;
}

.brand h1 {
  font-size: 26px;
  line-height: 1.05;
  font-weight: 760;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-strip span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #344240;
  font-size: 13px;
  font-weight: 650;
}

.status-strip span.is-private {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-strong);
}

.voice-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
}

.voice-stage,
.session-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.voice-stage {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  padding: 58px;
}

.wave-field {
  position: absolute;
  inset: 30px;
  display: grid;
  place-items: center;
  opacity: 0.7;
  pointer-events: none;
}

.wave-field span {
  position: absolute;
  width: calc(180px + var(--i, 1) * 80px);
  height: calc(180px + var(--i, 1) * 80px);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 48% 52% 51% 49%;
}

.wave-field span:nth-child(1) { --i: 1; transform: rotate(8deg); }
.wave-field span:nth-child(2) { --i: 2; transform: rotate(22deg); }
.wave-field span:nth-child(3) { --i: 3; transform: rotate(38deg); }
.wave-field span:nth-child(4) { --i: 4; transform: rotate(56deg); }
.wave-field span:nth-child(5) { --i: 5; transform: rotate(73deg); }

.voice-orb {
  position: relative;
  display: grid;
  width: 230px;
  height: 230px;
  margin: 22px auto 42px;
  place-items: center;
}

.orb-core,
.orb-ring {
  position: absolute;
  border-radius: 50%;
}

.orb-core {
  width: 128px;
  height: 128px;
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #20a59b, var(--teal-strong) 68%, #073f3a);
  box-shadow:
    0 20px 60px rgba(15, 118, 110, 0.28),
    inset 0 0 26px rgba(255, 255, 255, 0.28);
}

.orb-ring {
  width: 208px;
  height: 208px;
  border: 1px solid rgba(15, 118, 110, 0.32);
  box-shadow: inset 0 0 0 18px rgba(15, 118, 110, 0.05);
}

.voice-orb.is-connecting .orb-ring,
.voice-orb.is-live .orb-ring {
  animation: pulse 1.8s ease-in-out infinite;
}

.voice-orb.is-live .orb-core {
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #33b9ad, var(--cobalt) 90%);
}

.voice-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.eyeline {
  color: var(--teal);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
}

.voice-copy h2 {
  margin-top: 12px;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.98;
  font-weight: 780;
  letter-spacing: 0;
}

.voice-copy p:last-child {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.controls {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.primary-button,
.secondary-button,
.event-log button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 720;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.24);
}

.primary-button:hover {
  background: var(--teal-strong);
}

.secondary-button {
  padding: 0 18px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-icon,
.button-icon svg {
  width: 20px;
  height: 20px;
}

.button-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-panel {
  padding: 24px;
}

.panel-heading,
.event-log-heading,
.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2 {
  font-size: 20px;
}

.panel-heading span {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(104, 117, 116, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.panel-heading span.is-live {
  background: rgba(24, 137, 95, 0.12);
  color: var(--success);
}

.session-details {
  display: grid;
  gap: 0;
  margin: 22px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.session-details div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.session-details div:last-child {
  border-bottom: 0;
}

.session-details dt,
.session-details dd {
  margin: 0;
  font-size: 14px;
}

.session-details dt {
  color: var(--muted);
}

.session-details dd {
  font-weight: 720;
  text-align: right;
}

.event-log {
  padding-top: 18px;
}

.event-log h3,
.chat-heading h3 {
  font-size: 15px;
}

.chat-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.event-log button {
  min-height: 34px;
  padding: 0 10px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.event-log ol {
  display: grid;
  max-height: 280px;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.event-log li {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: #3a4746;
  font-size: 13px;
  line-height: 1.45;
}

.event-log li.error {
  border-color: rgba(163, 59, 54, 0.3);
  background: rgba(163, 59, 54, 0.06);
  color: var(--danger);
}

.chat-panel {
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.private-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.private-form > div:first-child,
.private-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.private-form label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.private-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.private-form input {
  min-height: 42px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.private-form input:focus {
  border-color: rgba(15, 118, 110, 0.65);
  outline: 3px solid rgba(15, 118, 110, 0.12);
}

.private-actions {
  justify-content: flex-end;
}

.private-actions .secondary-button {
  min-height: 36px;
  font-size: 13px;
}

.chat-messages {
  display: grid;
  max-height: 250px;
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.chat-messages li {
  width: fit-content;
  max-width: 92%;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.assistant-message {
  justify-self: start;
  border: 1px solid var(--line);
  background: #fbfdfc;
  color: #344240;
}

.user-message {
  justify-self: end;
  background: var(--teal);
  color: #ffffff;
}

.chat-form {
  display: grid;
  gap: 10px;
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 78px;
  max-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.chat-form textarea:focus {
  border-color: rgba(15, 118, 110, 0.65);
  outline: 3px solid rgba(15, 118, 110, 0.12);
}

.chat-submit {
  justify-content: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.45;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding-top: 16px;
  }

  .topbar,
  .voice-console {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .voice-stage {
    min-height: auto;
    padding: 30px 18px;
  }

  .voice-orb {
    width: 180px;
    height: 180px;
    margin-bottom: 28px;
  }

  .orb-core {
    width: 104px;
    height: 104px;
  }

  .orb-ring {
    width: 160px;
    height: 160px;
  }

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