:root {
  color-scheme: dark;
  --bg: #07100c;
  --surface: rgba(15, 31, 24, 0.9);
  --surface-2: rgba(20, 43, 32, 0.76);
  --border: rgba(158, 255, 201, 0.14);
  --text: #eef8f1;
  --muted: #9eb5a7;
  --accent: #45e38f;
  --accent-2: #c7ffe0;
  --danger: #ff8d8d;
  --warning: #ffd27a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 143, 93, 0.22), transparent 32rem),
    radial-gradient(circle at 90% 0%, rgba(39, 84, 68, 0.2), transparent 26rem),
    linear-gradient(150deg, #050a08 0%, #0a1811 55%, #050a08 100%);
}
button, input { font: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 28px; }
.hero { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.brand-mark {
  display: grid; width: 76px; height: 76px; place-items: center;
  border: 1px solid rgba(79, 229, 145, 0.5); border-radius: 24px;
  color: #07100c; background: linear-gradient(135deg, #bfffd9, #36d783);
  box-shadow: 0 14px 40px rgba(38, 215, 128, 0.16);
  font-size: 24px; font-weight: 800; letter-spacing: -0.06em;
}
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.15em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(34px, 7vw, 64px); line-height: 0.95; letter-spacing: -0.055em; }
h2 { margin-bottom: 6px; font-size: 18px; letter-spacing: -0.025em; }
h3 { margin-bottom: 0; font-size: clamp(22px, 4vw, 30px); letter-spacing: -0.035em; }
.subtitle, .explanation, .next-step p, .status-card p, footer { color: var(--muted); }
.subtitle { margin-bottom: 0; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.status-card, .transcription-panel, .next-step {
  border: 1px solid var(--border);
  background: linear-gradient(150deg, var(--surface), rgba(8, 20, 14, 0.82));
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.status-card { display: flex; min-height: 112px; align-items: flex-start; gap: 14px; padding: 22px; border-radius: 22px; }
.status-card p { margin-bottom: 0; font-size: 14px; }
.status-dot { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 6px rgba(255, 210, 122, 0.08); }
.status-dot.ok { background: var(--accent); box-shadow: 0 0 0 6px rgba(69, 227, 143, 0.09); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 6px rgba(255, 141, 141, 0.09); }
.transcription-panel { padding: clamp(24px, 5vw, 42px); border-radius: 28px; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.panel-head h2 { font-size: clamp(24px, 5vw, 38px); }
.privacy-badge {
  flex: 0 0 auto; padding: 8px 11px; border: 1px solid rgba(69, 227, 143, 0.25); border-radius: 999px;
  color: var(--accent-2); background: rgba(69, 227, 143, 0.07); font-size: 12px; font-weight: 600;
}
.explanation { max-width: 850px; margin: 8px 0 26px; line-height: 1.7; }
.controls-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: end; margin-bottom: 22px; }
.field { display: grid; gap: 8px; }
.field span, .state-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input {
  width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid rgba(181, 255, 214, 0.18); border-radius: 14px;
  outline: none; color: var(--text); background: rgba(2, 8, 5, 0.72); transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus { border-color: rgba(69, 227, 143, 0.65); box-shadow: 0 0 0 4px rgba(69, 227, 143, 0.08); }
.field input:disabled { opacity: 0.62; }
.session-state {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; min-height: 52px; padding: 10px 14px;
  border: 1px solid rgba(181, 255, 214, 0.13); border-radius: 14px; background: rgba(255, 255, 255, 0.025);
}
.state-label { grid-column: 1 / -1; }
.session-state strong { font-size: 13px; }
#session-timer { color: var(--accent-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.meter { overflow: hidden; height: 20px; border: 1px solid rgba(152, 245, 193, 0.12); border-radius: 999px; background: #030705; }
.meter-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #31c878, #b8ffda); box-shadow: 0 0 28px rgba(69, 227, 143, 0.4); transition: width 80ms linear; }
.meter-row { display: flex; justify-content: space-between; gap: 16px; margin: 9px 0 20px; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 48px; padding: 0 20px; border-radius: 14px; cursor: pointer; font-weight: 700; transition: transform 160ms ease, opacity 160ms ease, border-color 160ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.42; }
.button.primary { border: 0; color: #06100b; background: linear-gradient(135deg, #bdfed7, #42db89); }
.button.secondary { border: 1px solid rgba(229, 255, 240, 0.15); color: var(--text); background: rgba(255, 255, 255, 0.04); }
.button.danger { border: 1px solid rgba(255, 141, 141, 0.25); color: #ffd6d6; background: rgba(255, 89, 89, 0.08); }
.transcript-card { margin-top: 26px; padding: clamp(20px, 4vw, 30px); border: 1px solid rgba(158, 255, 201, 0.14); border-radius: 22px; background: rgba(1, 7, 4, 0.5); min-height: 260px; }
.transcript-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.live-pill { flex: 0 0 auto; padding: 7px 10px; border: 1px solid rgba(255, 210, 122, 0.22); border-radius: 999px; color: var(--warning); background: rgba(255, 210, 122, 0.06); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.live-pill.live { border-color: rgba(69, 227, 143, 0.35); color: var(--accent); background: rgba(69, 227, 143, 0.08); box-shadow: 0 0 20px rgba(69, 227, 143, 0.09); }
.live-pill.error { border-color: rgba(255, 141, 141, 0.35); color: var(--danger); background: rgba(255, 141, 141, 0.08); }
.final-transcript { display: grid; gap: 14px; }
.transcript-line { margin: 0; font-size: clamp(20px, 3.2vw, 29px); line-height: 1.48; letter-spacing: -0.025em; }
.transcript-line + .transcript-line { padding-top: 14px; border-top: 1px solid rgba(180, 255, 213, 0.08); }
.partial-transcript { min-height: 36px; margin: 18px 0 0; color: var(--accent-2); font-size: clamp(18px, 2.8vw, 25px); line-height: 1.5; opacity: 0.72; }
.empty-state { margin: 32px 0; color: var(--muted); text-align: center; line-height: 1.6; }
.message-box { margin-top: 18px; padding: 14px 16px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.message-box.info { border: 1px solid rgba(181, 255, 214, 0.14); color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.message-box.success { border: 1px solid rgba(69, 227, 143, 0.25); color: var(--accent-2); background: rgba(69, 227, 143, 0.07); }
.message-box.error { border: 1px solid rgba(255, 141, 141, 0.26); color: #ffd3d3; background: rgba(255, 89, 89, 0.08); }
.next-step { margin-top: 18px; padding: 24px; border-radius: 22px; }
.next-step p:last-child { margin-bottom: 0; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 4px 0; font-size: 12px; }
@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 1120px); padding-top: 26px; }
  .hero { align-items: flex-start; }
  .brand-mark { width: 58px; height: 58px; border-radius: 18px; }
  .status-grid, .controls-grid { grid-template-columns: 1fr; }
  .panel-head { display: block; }
  .privacy-badge { display: inline-block; margin-bottom: 14px; }
  .meter-row, .transcript-head, footer { flex-direction: column; }
  .meter-row { display: grid; }
}
