:root {
  --bg: #fbfbfa; --fg: #1c1c1a; --muted: #6f6e69; --line: #e2e1dc; --card: #fff;
  --accent: #30a46c; --rec: #e5484d; --warn-bg: #fff4d5; --warn-line: #e2b33c; --err: #cd2b31;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --fg: #ededec; --muted: #a09f9a; --line: #31312e; --card: #1f1f1d;
    --warn-bg: #3a2e0a; --warn-line: #8f6c10; --err: #ff6369; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, sans-serif; }
main { max-width: 480px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; min-height: 100dvh; }
header { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
select, textarea { width: 100%; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
header select { width: auto; flex: 1; }
.setting { font-size: 13px; color: var(--muted); white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; text-align: center; }
#home { display: flex; flex-direction: column; align-items: center; padding-top: 12vh; }
.mic { width: 160px; height: 160px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font: 600 16px system-ui; margin: 24px 0 8px; box-shadow: 0 6px 24px rgb(0 0 0 / .15); }
.mic.rec { background: var(--rec); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.live { min-height: 3em; text-align: center; font-size: 18px; }
.type { width: 100%; margin-top: 32px; }
.type summary, details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.btn { font: 600 15px system-ui; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); margin-top: 8px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .4; }
#busy { text-align: center; padding-top: 25vh; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; }
h1 { font-size: 22px; margin: 0; }
.total { font: 600 22px system-ui; }
#r-payer { text-align: left; margin: 4px 0 12px; }
.items { list-style: none; padding: 0; margin: 0 0 12px; }
.items li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: 14px; }
.users { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.users td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.users td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 14px; }
.warn.err { border-color: var(--err); }
#r-said { margin-bottom: 16px; }
#r-said textarea { margin-top: 8px; }
.actions { display: flex; gap: 8px; position: sticky; bottom: 16px; }
.actions .btn { flex: 1; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 24px; max-width: 448px; margin: 0 auto; background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 10px; text-align: center; }
