:root {
  color-scheme: dark;
  --bg: #070b14;
  --panel: #111827;
  --panel-2: #172033;
  --line: #293548;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #78e3b5;
  --accent-2: #4fd1a1;
  --danger: #ef6b73;
  --shadow: 0 18px 60px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% -10%, #17324d 0, transparent 38%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(760px, 100%); margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 16px calc(36px + env(safe-area-inset-bottom)); }
.hero { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin: 8px 2px 22px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.2rem); letter-spacing: -.04em; line-height: 1; }
.sub { color: var(--muted); line-height: 1.65; margin: 10px 0 0; max-width: 560px; }
.model-pill { flex: 0 0 auto; border: 1px solid var(--line); background: rgba(17,24,39,.8); color: var(--muted); padding: 7px 10px; border-radius: 999px; font-size: .72rem; }
.card { background: rgba(17,24,39,.92); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
h2 { margin: 0 0 14px; font-size: 1rem; }
label { display: block; color: #d8dde7; font-size: .86rem; font-weight: 650; margin-bottom: 7px; }
input, select { width: 100%; border: 1px solid #334155; border-radius: 13px; background: #0b1220; color: var(--text); padding: 13px 14px; outline: none; }
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(79,209,161,.14); }
.field-group { margin-top: 14px; }
.hint { color: var(--muted); font-size: .78rem; line-height: 1.55; margin: 8px 0 0; }
code { color: #b8f5dc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 11px 8px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); background: #0b1220; }
.segmented input:checked + span { color: #06130e; background: var(--accent); border-color: var(--accent); font-weight: 800; }
.hidden { display: none !important; }
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.quick { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 11px; border-radius: 12px; font-weight: 700; }
.control-card { position: sticky; bottom: 10px; z-index: 10; }
.status-line { display: flex; align-items: center; gap: 9px; color: #dce2ec; margin-bottom: 13px; font-size: .9rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 4px rgba(100,116,139,.12); }
.status-dot.live { background: var(--accent); box-shadow: 0 0 0 5px rgba(120,227,181,.14); }
.controls { display: grid; grid-template-columns: 1.35fr .75fr .9fr; gap: 8px; }
.controls button { border: 0; min-height: 48px; border-radius: 13px; font-weight: 800; padding: 10px 12px; }
.primary { background: var(--accent); color: #06130e; }
.danger { background: #3a171d; color: #ffb3b8; border: 1px solid #6e2832 !important; }
.secondary { background: #1b2537; color: #d8dee9; border: 1px solid #344057 !important; }
button:disabled { opacity: .42; }
.error { margin: 12px 0 0; background: #35161c; border: 1px solid #722934; color: #ffc2c7; border-radius: 12px; padding: 11px 12px; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; }
.transcript-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.transcript-card { min-height: 220px; }
.transcript-card.accent { border-color: rgba(120,227,181,.35); }
.transcript-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.transcript-title h2 { margin-bottom: 12px; }
.transcript-title span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.transcript { min-height: 145px; font-size: 1.05rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.accent .transcript { font-size: 1.17rem; }
.footer-actions { display: flex; justify-content: flex-end; margin: -2px 3px 14px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.help summary { cursor: pointer; font-weight: 800; }
.help ol { color: #d5dbe5; line-height: 1.7; padding-left: 1.3rem; }
.help p { color: var(--muted); line-height: 1.6; font-size: .82rem; }
footer { color: #737f92; font-size: .72rem; line-height: 1.55; padding: 4px 5px 20px; }
@media (max-width: 620px) {
  .hero { display: block; }
  .model-pill { display: inline-block; margin-top: 12px; }
  .controls { grid-template-columns: 1fr 1fr; }
  .controls .secondary { grid-column: 1 / -1; }
  .transcript-grid { grid-template-columns: 1fr; }
  .control-card { bottom: max(8px, env(safe-area-inset-bottom)); }
}
