:root { --bg:#f4f6f5; --card:#fff; --text:#14211f; --muted:#64736f; --line:#e1e7e5; --accent:#0f766e; --neg:#c2410c; --pos:#15803d; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1514; --card:#18211f; --text:#e8efed; --muted:#93a29e; --line:#2a3634; --accent:#14958a; --neg:#fb923c; --pos:#4ade80; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 system-ui, sans-serif; background: var(--bg); color: var(--text); padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
header, main { max-width: 640px; margin: 0 auto; padding: 0 14px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; }
header input { width: auto; margin: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 8px; }
h3 { margin: 0 0 10px; font-size: 16px; }
small { display: block; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px; margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 9px 14px; margin: 0 6px 6px 0; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--neg); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 12px; }
.hero strong { display: block; font-size: 34px; }
.hero.over strong { color: var(--neg); }
.hero.over .bar i { background: var(--neg); }
.bar { height: 7px; background: var(--line); border-radius: 9px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats .card { padding: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.stats b { font-size: 15px; }
.cat { display: grid; grid-template-columns: 1fr auto; }
.cat .bar { grid-column: 1 / -1; margin-bottom: 10px; }
.neg { color: var(--neg); } .pos { color: var(--pos); }
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.list li { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.list li:last-child { border: 0; }
.list li.done { opacity: .55; }
.list li.late small { color: var(--neg); }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.right { text-align: right; white-space: nowrap; }
.actions button { border: 0; background: none; padding: 4px 5px; margin: 0; }
.empty, .note { color: var(--muted); }
.total { margin: 0 0 8px; }
code { display: block; background: var(--bg); padding: 10px; border-radius: 8px; overflow-wrap: anywhere; margin-bottom: 10px; user-select: all; }
ol { padding-left: 20px; }
.file { display: block; margin-top: 8px; }
#nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#nav button { flex: 1; max-width: 107px; border: 0; margin: 0; padding: 8px 0; background: none; font-size: 18px; border-radius: 0; opacity: .6; min-width: 0; }
#nav button.on { opacity: 1; box-shadow: inset 0 3px var(--accent); }
#nav span { display: block; font-size: 10px; }
#fab { position: fixed; right: max(16px, calc(50% - 320px)); bottom: calc(74px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; margin: 0; padding: 0; background: var(--accent); color: #fff; font-size: 30px; box-shadow: 0 4px 14px #0004; }
dialog { width: min(420px, 92vw); border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); padding: 18px; }
dialog::backdrop { background: #0007; }
.row { display: flex; justify-content: flex-end; }
#toast { position: fixed; left: 14px; right: 14px; bottom: calc(140px + env(safe-area-inset-bottom)); max-width: 612px; margin: auto; background: #1f2d2a; color: #fff; padding: 12px 14px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#toast button { margin: 0; padding: 4px 10px; }
body.locked #nav, body.locked #fab, body.locked #month { display: none; }
