:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #687482;
  --page: #eef3f2;
  --surface: #fbfcfa;
  --line: #d8dfdd;
  --source: #0f766e;
  --source-soft: #dff4f0;
  --output: #6c4d10;
  --output-soft: #f5ecd8;
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(31, 48, 66, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(108, 77, 16, 0.16), transparent 32%),
    var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px);
  display: grid;
  align-items: center;
}

.call-surface {
  width: 100%;
  min-height: min(760px, calc(100vh - 36px));
  padding: clamp(18px, 3vw, 34px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto;
  gap: 22px;
  background: rgba(251, 252, 250, 0.92);
  border: 1px solid rgba(216, 223, 221, 0.88);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--source);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.status-pill {
  min-width: 118px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #394654;
  background: #eef1ef;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  background: #8d98a5;
  border-radius: 50%;
}

.status-pill[data-state="connecting"] .status-dot {
  background: #d99b23;
}

.status-pill[data-state="live"] .status-dot {
  background: #16a34a;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.16);
}

.status-pill[data-state="error"] .status-dot {
  background: var(--danger);
}

.provider-switcher {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.provider-option {
  min-height: 58px;
  padding: 11px 13px;
  color: var(--ink);
  text-align: left;
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.provider-option:hover {
  transform: translateY(-1px);
}

.provider-option span,
.provider-option strong {
  display: block;
}

.provider-option span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-option strong {
  margin-top: 3px;
  font-size: 1.02rem;
}

.provider-option.active {
  background: #eef2ff;
  border-color: rgba(76, 96, 164, 0.58);
}

.language-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.language-option {
  min-height: 74px;
  padding: 14px 16px;
  color: var(--ink);
  text-align: left;
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.language-option:hover {
  transform: translateY(-1px);
}

.language-option span,
.language-option strong {
  display: block;
}

.language-option span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.language-option strong {
  margin-top: 4px;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.language-option.active {
  background: var(--source-soft);
  border-color: rgba(15, 118, 110, 0.56);
}

.conversation-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.transcript-panel {
  min-height: 340px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.source-panel {
  border-top: 5px solid var(--source);
}

.output-panel {
  border-top: 5px solid var(--output);
}

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

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-heading span {
  padding: 5px 9px;
  color: #253241;
  background: #edf1ef;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.transcript-copy {
  min-height: 240px;
  padding-right: 4px;
  color: #293542;
  font-size: clamp(1.35rem, 2.8vw, 2.6rem);
  line-height: 1.15;
  overflow: auto;
}

.transcript-copy.translated {
  color: #2a271d;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.primary-button,
.secondary-button {
  height: 54px;
  min-width: 132px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: #0c615b;
}

.secondary-button {
  color: #1d2a36;
  background: #fff;
  border-color: var(--line);
}

.primary-button:disabled,
.secondary-button:disabled,
.provider-option:disabled,
.language-option:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-icon {
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
}

.prototype-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.latency-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.prototype-notes div {
  padding: 13px 14px;
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.latency-cell {
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.prototype-notes strong {
  font-size: 1rem;
}

.latency-cell strong {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

@media (max-width: 760px) {
  .shell {
    align-items: stretch;
    padding: 0;
  }

  .call-surface {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar,
  .panel-heading {
    align-items: flex-start;
  }

  .topbar,
  .controls {
    flex-direction: column;
  }

  .status-pill,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .language-switcher,
  .provider-switcher,
  .conversation-grid,
  .latency-panel,
  .prototype-notes {
    grid-template-columns: 1fr;
  }

  .transcript-panel {
    min-height: 260px;
  }

  .transcript-copy {
    min-height: 160px;
  }
}
