:root {
  color-scheme: light;
  --bg-top: #f7f0df;
  --bg-bottom: #edf6f6;
  --card: rgba(255, 255, 255, 0.88);
  --card-border: rgba(25, 28, 32, 0.08);
  --ink: #202630;
  --muted: #66717d;
  --english: #de6537;
  --english-soft: rgba(222, 101, 55, 0.14);
  --hindi: #1f6f72;
  --hindi-soft: rgba(31, 111, 114, 0.14);
  --accent: #178a45;
  --error: #c83c3c;
  --shadow: 0 24px 60px rgba(26, 34, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  padding:
    max(16px, env(safe-area-inset-top))
    0
    max(24px, env(safe-area-inset-bottom));
  font-family: "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button {
  font: inherit;
}

.app-shell {
  width: min(100% - 20px, 760px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.hero-card,
.control-card,
.conversation-pane,
.log-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-card,
.control-card,
.log-card {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.subtitle {
  margin-top: 14px;
  max-width: 34rem;
  font-size: 1.08rem;
  color: var(--muted);
}

.network-banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(200, 60, 60, 0.1);
  color: var(--error);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.secondary-button,
.side-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.primary-button {
  background: var(--english);
  color: white;
  font-weight: 700;
}

.secondary-button {
  background: rgba(24, 32, 40, 0.08);
  color: var(--ink);
  font-weight: 600;
}

.side-button {
  background: rgba(24, 32, 40, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.side-button.active {
  background: var(--ink);
  color: white;
}

button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

.status-text {
  margin-top: 16px;
  color: var(--muted);
  font-weight: 600;
}

.control-header,
.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.control-header p {
  margin-top: 6px;
  color: var(--muted);
}

.status-chip,
.pane-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(24, 32, 40, 0.08);
}

.speaker-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.pane-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.conversation-pane {
  padding: 22px;
}

.active-pane {
  border-color: rgba(222, 101, 55, 0.55);
  box-shadow: 0 18px 44px rgba(222, 101, 55, 0.12);
}

.inactive-badge {
  background: rgba(24, 32, 40, 0.05);
  color: var(--muted);
}

.transcript-block + .transcript-block {
  margin-top: 18px;
}

.block-label {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.transcript-text {
  min-height: 56px;
  font-size: 1.38rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.log-card {
  overflow: hidden;
}

.debug-log {
  margin-top: 16px;
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: #161a20;
  color: #dbe5f0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.status-chip.connected {
  color: var(--accent);
  background: rgba(23, 138, 69, 0.12);
}

.status-chip.error {
  color: var(--error);
  background: rgba(200, 60, 60, 0.12);
}

@media (max-width: 860px) {
  .pane-grid,
  .speaker-toggle {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 20px, 680px);
  }
}

@media (max-width: 640px) {
  .transcript-text {
    font-size: 1.1rem;
  }
}
