:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --bg: #0B0F1A;
  --bg2: #0F1624;
  --card: #151D2E;
  --border: #1E2A3E;
  --gold: #FFC107;
  --gold-dark: #F9A825;
  --gold-light: #FFD54F;
  --gray: #8899AA;
  --text: #C8D4E0;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, var(--bg2) 0, var(--bg) 55%); }
.shell { width: min(100% - 32px, 560px); margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 0 28px; }
header { margin: 8px 4px 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.3rem; }
.brand img.logo { width: 44px; height: 44px; border-radius: 13px; background: var(--bg2); border: 1px solid var(--border); }
.brand .wordmark { color: #F4F6F8; }
.brand .wordmark span { color: var(--gold); }
header p { color: var(--gray); line-height: 1.5; margin: 12px 0 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 20px; box-shadow: 0 16px 45px rgba(0,0,0,.35); }
.guide { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 4px 18px; margin-bottom: 16px; }
.guide summary { padding: 14px 0; font-weight: 700; color: var(--gold-light); cursor: pointer; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "▸ "; display: inline-block; transition: transform .15s ease-out; }
.guide[open] summary::before { transform: rotate(90deg); }
.guide-intro { margin: 14px 0 6px; font-size: .82rem; font-weight: 700; color: var(--gray); }
.guide ul { margin: 0 0 4px; padding-left: 18px; color: var(--text); font-size: .88rem; line-height: 1.6; }
.guide-example { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: .85rem; line-height: 1.55; color: var(--text); margin: 0 0 14px; }
.guide-example b { color: var(--gold-light); }
.field { display: block; margin: 0 0 16px; }
.field span { display: block; margin: 0 0 6px; font-size: .82rem; font-weight: 700; color: var(--gray); }
.field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); font: inherit; font-weight: 700; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; background: var(--bg2); border-radius: 14px; }
.tab { border: 0; background: transparent; border-radius: 11px; padding: 11px; font: inherit; font-weight: 700; color: var(--gray); cursor: pointer; }
.tab.active { background: var(--card); color: var(--gold-light); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.panel { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hidden { display: none !important; }
.record { width: 104px; height: 104px; padding: 0; border: 0; border-radius: 50%; background: var(--bg2); box-shadow: 0 0 0 10px #101826; cursor: pointer; }
.record span { display: block; width: 64px; height: 64px; margin: auto; border-radius: 50%; background: linear-gradient(145deg, var(--gold-light), var(--gold-dark)); transition: .2s; }
.record.recording span { width: 38px; height: 38px; border-radius: 9px; background: #dc2626; }
#recordHint { margin: 24px 0 5px; color: var(--gray); }
#timer { color: var(--gold-light); font-variant-numeric: tabular-nums; font-weight: 800; }
.file-drop { width: 100%; padding: 34px 18px; text-align: center; border: 2px dashed var(--border); border-radius: 18px; cursor: pointer; }
.file-drop span, .file-drop strong, .file-drop small { display: block; }
.upload-icon { font-size: 2rem; color: var(--gold); margin-bottom: 8px; }
.file-drop small { color: var(--gray); margin-top: 6px; line-height: 1.4; }
#fileName { max-width: 100%; overflow-wrap: anywhere; color: var(--gold-light); }
audio { width: 100%; margin: 0 0 16px; }
.primary { width: 100%; border: 0; border-radius: 14px; padding: 15px; background: var(--gold); color: #14110A; font: inherit; font-weight: 800; cursor: pointer; }
.primary:disabled { opacity: .35; cursor: not-allowed; }
.status { margin-top: 16px; padding: 15px 17px; border-radius: 14px; line-height: 1.45; overflow-wrap: anywhere; border: 1px solid transparent; }
.status.loading { color: var(--gold-light); background: rgba(255,193,7,.08); border-color: rgba(255,193,7,.25); }
.status.error { color: #FCA5A5; background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.35); }
.status.success { color: #86EFAC; background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.35); }
.result { margin-top: 16px; }
.result h2 { margin: 0 0 14px; font-size: 1.1rem; color: #F4F6F8; }
.result dl { display: grid; grid-template-columns: 92px 1fr; margin: 0; gap: 9px; }
.result dt { color: var(--gray); }
.result dd { margin: 0; overflow-wrap: anywhere; color: var(--text); }
.transcript { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--gray); line-height: 1.5; }
footer { color: #5C6B7A; font-size: .78rem; text-align: center; margin: 20px 12px; line-height: 1.4; }
@media (max-width: 380px) { .shell { width: min(100% - 20px, 560px); } .card { padding: 15px; } }
