:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111827;
  --panel-soft: #172033;
  --text: #f9fafb;
  --muted: #a7b0c0;
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --danger: #fb7185;
  --border: rgba(255, 255, 255, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 34rem),
    linear-gradient(180deg, #0f172a 0%, var(--bg) 70%);
  color: var(--text);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero {
  display: grid;
  gap: 18px;
  padding: 18px 2px 28px;
}

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

h1, h2 { margin: 0; line-height: 1.05; }
h1 { font-size: clamp(2.1rem, 10vw, 4.8rem); letter-spacing: -0.06em; }
h2 { font-size: clamp(1.5rem, 5vw, 2.3rem); }
.lead { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: clamp(1.05rem, 3vw, 1.35rem); line-height: 1.55; }
.speaker-name { margin: 8px 0 0; color: var(--muted); font-weight: 800; }

.panel {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  padding: clamp(18px, 4vw, 28px);
  backdrop-filter: blur(14px);
}

.setup-panel {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.setup-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input { min-height: 48px; }
textarea {
  min-height: 92px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.45;
}

input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14); }

.primary, .secondary, .mic-button {
  border: 0;
  border-radius: 16px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 850;
}

.primary { background: var(--primary); color: #06111f; }
.primary:hover { background: #7dd3fc; }
.secondary { background: rgba(255, 255, 255, 0.08); color: var(--text); border: 1px solid var(--border); }
.secondary:hover { background: rgba(255, 255, 255, 0.13); }
.danger { color: #fecdd3; }

.room-panel { margin-top: 18px; }
.room-header, .controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.controls { margin-top: 22px; }

.mic-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #06111f;
  min-width: 210px;
}

.mic-button[aria-pressed="true"] { background: #22c55e; }
.mic-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(6, 17, 31, 0.45);
}
.mic-button[aria-pressed="true"] .mic-dot { animation: pulse 1.2s infinite; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 12px rgba(6, 17, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 17, 31, 0); }
}

.status, .warning, .interim {
  margin-top: 16px;
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.45;
}

.manual-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}
.status { color: var(--muted); background: rgba(255, 255, 255, 0.05); }
.warning { color: #fde68a; background: rgba(234, 179, 8, 0.12); border: 1px solid rgba(234, 179, 8, 0.25); }
.interim { color: #dbeafe; background: rgba(56, 189, 248, 0.1); border: 1px dashed rgba(56, 189, 248, 0.35); font-size: 1.1rem; }

.transcript-wrap { margin-top: 18px; }
.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}

.message {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 16px;
}

.message-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.85rem;
}

.message-name { color: var(--primary); font-weight: 900; }
.message-text { font-size: clamp(1.15rem, 4vw, 1.6rem); line-height: 1.35; white-space: pre-wrap; }
.empty { color: var(--muted); text-align: center; padding: 26px 8px; }
.hidden { display: none !important; }

@media (max-width: 720px) {
  .setup-panel { grid-template-columns: 1fr; }
  .primary, .secondary, .mic-button { width: 100%; }
  .room-header { align-items: stretch; }
  .controls { align-items: stretch; }
}
