:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent: #4f9cf9;
  --accent-soft: rgba(79, 156, 249, 0.14);
  --good: #3ecf8e;
  --warn: #f5a623;
  --bad: #ef5350;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9; --panel: #fff; --panel-2: #f0f2f5; --border: #dde1e8;
    --text: #141821; --muted: #5c6673; --accent-soft: rgba(79, 156, 249, 0.1);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 16px 64px; }

header { margin-bottom: 22px; }
h1 { font-size: 23px; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 14px; margin: 0; }
.sub code { font-family: var(--mono); font-size: 12.5px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }

input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%; padding: 9px 11px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; font-size: 14px; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

button {
  padding: 10px 18px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #06101f; font-weight: 600; }
button.recording { background: var(--bad); border-color: var(--bad); color: #fff; }

.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

.meter { flex: 1; min-width: 150px; height: 8px; background: var(--panel-2);
  border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.meter-fill { height: 100%; width: 0; background: var(--good); transition: width 70ms linear; }
.meter-fill.quiet { background: var(--muted); }

.status { font-size: 13px; color: var(--muted); min-height: 20px; }
.status.err { color: var(--bad); }
.status.live { color: var(--good); }

#transcript {
  min-height: 130px; max-height: 340px; overflow-y: auto; padding: 14px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px;
  white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.6;
}
#transcript:empty::before { content: "Transcript will appear here."; color: var(--muted); }
#transcript .pending { color: var(--muted); }

.stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px;
  font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.stats b { color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 13px; font-size: 13px; border-radius: 6px; background: transparent;
  border: 1px solid transparent; color: var(--muted); }
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

pre {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.6; margin: 0; color: var(--text);
}
.hidden { display: none; }

.note { font-size: 12.5px; color: var(--muted); margin-top: 10px; padding-left: 11px;
  border-left: 2px solid var(--border); }

a { color: var(--accent); }
.copy { float: right; font-size: 12px; padding: 4px 10px; }
