:root {
  --bg: #18181b; --panel: #27272a; --line: #3f3f46;
  --text: #fafafa; --muted: #a1a1aa; --accent: #facc15; --danger: #f87171;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, sans-serif;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
header { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; }
header .title { font-size: 1.25rem; font-weight: 700; color: var(--accent); text-decoration: none; }
header .nav, a { color: var(--muted); }
main { max-width: 640px; margin: 0 auto; padding-bottom: 110px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.card { background: var(--panel); border-radius: 10px; padding: 12px; margin: 8px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.row > .fixed { flex: none; }
input, select, textarea, button {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px;
}
button { background: var(--accent); color: #18181b; border: 0; font-weight: 600; cursor: pointer; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: .9rem; }
.set { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.set:first-of-type { border-top: 0; }
a.item { display: block; text-decoration: none; color: var(--text); }
.stack > * + * { margin-top: 8px; }

header nav { display: flex; gap: 16px; }
a.button { display: block; text-align: center; background: var(--accent); color: #18181b; font-weight: 600; text-decoration: none; border-radius: 8px; padding: 10px; }
label.field { display: block; color: var(--muted); font-size: .9rem; }
label.field > input, label.field > textarea, label.field > .row { margin-top: 4px; }
label.field input, label.field textarea { width: 100%; color: var(--text); font-size: 1rem; }
select { width: 100%; }
fieldset.checks { border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 20px; flex-wrap: wrap; }
fieldset.checks label { display: flex; align-items: center; gap: 6px; }
.error { color: var(--danger); margin: 0; min-height: 1.2em; }
.holdout { font-size: 3rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--accent); }
#timerbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 2px solid var(--accent);
}
#timerbar[hidden] { display: none; }
#timerbar.done { background: var(--accent); color: #18181b; }
#timerbar.done .ghost, #timerbar.done [data-act="minus"], #timerbar.done [data-act="plus"] { display: none; }
#timerbar.done button { background: #18181b; color: var(--accent); }
.rest-label { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rest-buttons { display: flex; gap: 8px; }
