:root {
  --bg: #0c0c0d; --card: #17171a; --card-2: #202024; --line: #2a2a30;
  --text: #f2f2f3; --muted: #8d8d96; --accent: #ff6b35; --accent-ink: #111;
  --done: #3ecf8e; --warn: #ffb020; --bad: #ff5d5d;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.35;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(150px + env(safe-area-inset-bottom));
}
.wrap { max-width: 520px; margin: 0 auto; }
header { margin-bottom: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.tag { display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.tag.target { background: var(--card-2); color: var(--muted); }
.tag.small { font-size: 10px; padding: 2px 7px; }
.sub, .note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.chip b { color: var(--text); }
.chip.hot b { color: var(--warn); }
.block { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.list { list-style: none; font-size: 14px; color: #c9c9cf; }
.list li { padding: 3px 0; }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 6px 0; font-variant-numeric: tabular-nums; }
.row span:last-child { color: var(--accent); font-weight: 700; white-space: nowrap; }

.ex { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 10px; transition: opacity .2s; }
.ex.complete { opacity: .6; }
.ex-top { display: flex; gap: 10px; align-items: flex-start; }
.num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--card-2); color: var(--muted); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.ex.complete .num { background: var(--done); color: #06140d; }
.ex-main { flex: 1; min-width: 0; }
.ex-name { font-size: 16px; font-weight: 700; }
.ex-spec { font-size: 14px; color: var(--accent); font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ex-spec span { color: var(--muted); font-weight: 500; }
.cue { font-size: 13px; color: var(--muted); margin-top: 4px; }
.last { font-size: 12px; color: var(--muted); margin-top: 10px; padding: 6px 10px; background: var(--bg); border-radius: 8px; font-variant-numeric: tabular-nums; }
.last b { color: #c9c9cf; font-weight: 600; }
.sethead, .setrow { display: grid; grid-template-columns: 30px 1fr 1fr 48px; gap: 8px; align-items: center; }
.sethead { margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5d5d66; }
.setrow { margin-top: 8px; }
.setno { font-size: 14px; font-weight: 800; color: var(--muted); text-align: center; }
.setrow input, .field {
  width: 100%; min-width: 0; height: 46px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums; padding: 0 10px;
}
.setrow input { text-align: center; }
.setrow input:focus, .field:focus { outline: none; border-color: var(--accent); }
.setrow input::placeholder, .field::placeholder { color: #4a4a52; font-weight: 600; }
.tick { width: 48px; height: 46px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card-2); color: var(--muted); font-size: 20px; font-weight: 800; display: grid; place-items: center; cursor: pointer; user-select: none; transition: transform .08s, background .15s; }
.tick:active { transform: scale(.94); }
.setrow.on .tick { background: var(--done); border-color: var(--done); color: #06140d; }
.setrow.on input { border-color: #1f5c40; color: var(--done); }
.pr { font-size: 12px; color: var(--done); margin-top: 8px; font-weight: 700; }

.btn { display: block; width: 100%; height: 48px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; cursor: pointer; margin-top: 10px; }
.btn.ghost { background: var(--card-2); color: var(--muted); font-weight: 700; }
.btn.small { width: auto; padding: 0 18px; margin-top: 0; height: 46px; }
.pair { display: flex; gap: 8px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.grid5 label span { display: block; font-size: 11px; color: var(--muted); text-transform: capitalize; margin-bottom: 4px; }
.grid5 .field { font-size: 15px; padding: 0 4px; text-align: center; }
.copied, .ok { text-align: center; font-size: 13px; color: var(--done); min-height: 18px; margin-top: 6px; }
.ok { text-align: left; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; }

.day { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.day-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; margin-top: 10px; }
.cells div span { display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.cells div b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cells b.warn { color: var(--warn); }

.timer { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: 496px; margin: 0 auto; background: #26262b; border: 1px solid var(--line); border-radius: 14px; display: none; align-items: center; justify-content: space-between; padding: 10px 14px; z-index: 20; }
.timer.show { display: flex; }
.timer .t { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer .t.zero { color: var(--done); }
.timer .what { font-size: 12px; color: var(--muted); }
.timer button { background: var(--card-2); color: var(--text); border: 0; border-radius: 10px; height: 38px; padding: 0 14px; font-size: 14px; font-weight: 700; }
.saving { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #1d3b2d; color: var(--done); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 40; }
.saving.show { opacity: 1; }
.saving.bad { background: #3b1d1d; color: var(--bad); }

nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(18,18,20,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
nav a { flex: 1; text-align: center; color: var(--muted); padding: 7px 1px; border-radius: 10px; font-size: 11px; font-weight: 700; line-height: 1.2; text-decoration: none; }
nav a b { display: block; font-size: 14px; }
nav a.active { color: var(--accent); background: var(--card); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--bg); padding: 8px 10px; border-radius: 8px; margin: 4px 0 8px; user-select: all; -webkit-user-select: all; }
details summary { list-style: none; margin-bottom: 0; }
details[open] summary { margin-bottom: 8px; }
