:root {
  --bg: #0e1013; --card: #181b20; --line: #2a2f37; --text: #f1f3f5; --muted: #98a1ad;
  --accent: #c8f04a; --accent-ink: #141a00; --warn: #ffb454;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 calc(96px + env(safe-area-inset-bottom));
}
header { display: flex; justify-content: space-between; align-items: flex-end; padding: 20px 18px 8px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
h2 { margin: 0 0 4px; font-size: 20px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.pill { font-size: 14px; font-variant-numeric: tabular-nums; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.done { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
main { padding: 8px 14px; }
.status { margin: 6px 4px 10px; padding: 11px 13px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 15px; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.status button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; padding: 4px; }
.status.error { border-color: var(--warn); color: var(--warn); }

.ex { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; margin-bottom: 9px; }
.ex.done { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ex-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ex-name { font-weight: 600; }
.ex-plan { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 6px; margin-top: 9px; }
.dot { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.dot.on { background: var(--accent); }
.sets { list-style: none; margin: 9px 0 0; padding: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.sets li { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.sets button { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px; }
.last { margin-top: 7px; font-size: 13px; color: var(--muted); }
.rest { text-align: center; color: var(--muted); padding: 60px 20px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 4px 8px; font-weight: 600; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
input, select { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 12px; width: 100%; min-width: 0; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.send { font: inherit; font-weight: 700; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 13px 18px; }
.ghost { font: inherit; background: none; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 13px 18px; }
.mic { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.mic.live { background: #ff5d5d; color: #fff; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .mic.live { animation: none; } }
button:disabled { opacity: 0.5; }

dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(420px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog form { display: grid; gap: 12px; }
dialog label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); flex: 1; min-width: 0; }
dialog input, dialog select { background: var(--bg); }
.row { display: flex; gap: 10px; }
.row > button { flex: 1; }
.said { font-style: italic; }
.said:empty { display: none; }
