:root{
  --bg:#0F1012;--s1:#18191C;--s2:#222327;--line:#2B2D31;--tx:#F2F2F0;--mu:#9A9CA3;
  --ac:#C8F169;--ac-tx:#0F1012;--water:#7CC4F5;--warn:#F2A65A;
  --mono:ui-monospace,"JetBrains Mono","SF Mono",Menlo,monospace;
  --sat:env(safe-area-inset-top);--sab:env(safe-area-inset-bottom);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--tx);font:15px/1.4 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
body{padding-top:var(--sat);overscroll-behavior-y:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
main{max-width:560px;margin:0 auto;padding:16px 14px calc(96px + var(--sab))}
h1{font-size:28px;font-weight:700;letter-spacing:-.02em;margin:2px 0 0}
h2{font-size:22px;font-weight:700;margin:0;line-height:1.2}
.k{font:600 11px/1 var(--mono);letter-spacing:.06em;color:var(--mu);text-transform:uppercase}
.mono{font-family:var(--mono)}
.mu{color:var(--mu)}.ac{color:var(--ac)}
.row{display:flex;align-items:center;gap:10px}
.col{display:flex;flex-direction:column;gap:8px}
.grow{flex:1;min-width:0}
.sp{height:14px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.card{background:var(--s1);border-radius:16px;padding:14px}
.btn{height:44px;padding:0 14px;border-radius:12px;border:1px solid var(--line);background:transparent;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn.fill{background:var(--s2);border-color:var(--s2);font-weight:600}
.btn.pri{background:var(--ac);border-color:var(--ac);color:var(--ac-tx);font-weight:700}
.btn.big{height:60px;border-radius:16px;font-size:18px;width:100%}
.btn.sm{height:36px;padding:0 10px;font-size:13px;border-radius:10px}
.btn.icon{width:44px;padding:0}
.btn:disabled{opacity:.4}
.btn.danger{color:var(--warn);border-color:#4a3524}
.ex{display:flex;align-items:center;gap:12px;background:var(--s1);border:1px solid var(--s1);border-radius:14px;padding:12px 14px;width:100%;text-align:left}
.ex.on{border-color:var(--ac)}.ex.skip{opacity:.45}
.ex .n{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ex .t{font:12px var(--mono);color:var(--mu)}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
.week button{border:0;background:var(--s1);border-radius:10px;padding:7px 0;display:flex;flex-direction:column;align-items:center;gap:3px;position:relative}
.week button .d{font-size:11px;opacity:.75}.week button .c{font:600 12px var(--mono)}
.week button.sel{background:var(--ac);color:var(--ac-tx)}
.week button.today:not(.sel){outline:1px solid var(--line)}
.week button .dot{position:absolute;bottom:3px;width:4px;height:4px;border-radius:2px;background:var(--ac)}
.week button.sel .dot{background:var(--ac-tx)}
.bar{height:6px;background:var(--s2);border-radius:3px;overflow:hidden}.bar>i{display:block;height:100%;background:var(--ac)}
.bar.t{height:8px}
.setrow{display:flex;align-items:center;gap:12px;background:var(--s1);border-radius:12px;height:52px;padding:0 4px 0 14px}
.setrow .w{flex:1;font:600 17px var(--mono)}
.stepper{background:var(--s1);border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:6px;align-items:center}
.stepper .row{width:100%;gap:6px}
.stepper button{width:48px;height:48px;border-radius:12px;border:0;background:var(--s2);font-size:22px;font-weight:600}
.stepper input{flex:1;min-width:0;width:100%;text-align:center;background:transparent;border:0;font:700 24px var(--mono);padding:0}
input.f,select.f,textarea.f{width:100%;height:44px;border-radius:12px;border:1px solid var(--line);background:var(--s1);padding:0 12px}
textarea.f{height:auto;min-height:72px;padding:10px 12px;resize:vertical}
select.f{appearance:none}
label.l{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--mu)}
.chip{height:52px;border-radius:12px;border:1px solid var(--line);background:var(--s1);text-align:left;padding:0 12px;display:flex;flex-direction:column;justify-content:center;gap:2px}
.chip b{font-weight:600;font-size:14px}.chip span{font:11px var(--mono);color:var(--mu)}
.item{display:flex;align-items:center;gap:10px;background:var(--s1);border-radius:12px;min-height:48px;padding:4px 4px 4px 14px}
.x{width:44px;height:44px;border:0;background:transparent;color:var(--mu);display:flex;align-items:center;justify-content:center;flex:none}
.x svg{width:18px;height:18px}
.tabs{position:fixed;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(4,1fr);background:rgba(15,16,18,.96);backdrop-filter:blur(8px);border-top:1px solid var(--s2);padding-bottom:var(--sab);z-index:5}
.tabs button{height:64px;border:0;background:none;color:var(--mu);font-size:11px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
.tabs button.on{color:var(--ac)}
.timer{position:fixed;left:10px;right:10px;top:calc(8px + var(--sat));max-width:540px;margin:0 auto;z-index:6;background:var(--ac);color:var(--ac-tx);border-radius:14px;padding:10px 12px 10px 14px;display:flex;align-items:center;gap:8px;box-shadow:0 8px 24px rgba(0,0,0,.5)}
.timer[hidden]{display:none}
.timer .tt{flex:1;font:700 26px var(--mono)}
.timer .tl{font:600 11px var(--mono);letter-spacing:.06em}
.timer button{height:40px;padding:0 12px;border-radius:10px;border:1.5px solid var(--ac-tx);background:transparent;color:var(--ac-tx);font-weight:600}
.timer button.d{background:var(--ac-tx);color:var(--ac);border:0}
.timer.over{background:var(--warn)}
body.has-timer main{padding-top:88px}
.sheet{position:fixed;inset:0;z-index:10;background:rgba(0,0,0,.6);display:flex;align-items:flex-end;justify-content:center}
.sheet[hidden]{display:none}
.sheet .in{background:var(--bg);border-top:1px solid var(--line);border-radius:20px 20px 0 0;width:100%;max-width:560px;max-height:88vh;overflow:auto;padding:16px 14px calc(18px + var(--sab));display:flex;flex-direction:column;gap:10px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(80px + var(--sab));background:var(--s2);border:1px solid var(--line);padding:10px 16px;border-radius:12px;z-index:20;font-size:14px;max-width:90vw}
.toast[hidden]{display:none}
.ai{white-space:pre-wrap;font-size:14px;line-height:1.5}
.spark{width:100%;height:90px}
.spark svg{width:100%;height:90px}
details summary{list-style:none;cursor:pointer}details summary::-webkit-details-marker{display:none}
.tag{font:600 10px var(--mono);padding:3px 6px;border-radius:6px;background:var(--s2);color:var(--mu)}
.switch{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px}
.switch input{width:22px;height:22px;accent-color:var(--ac)}

.toast{left:14px;transform:none;max-width:calc(100% - 150px)}
@media (min-width:600px){.toast{left:50%;transform:translateX(-50%)}}
.undo{position:fixed;right:14px;bottom:calc(76px + var(--sab));z-index:7;height:48px;padding:0 16px 0 12px;border-radius:24px;border:1px solid var(--line);background:var(--s2);color:var(--tx);font-weight:600;display:flex;align-items:center;gap:6px;box-shadow:0 6px 18px rgba(0,0,0,.45)}
.undo[hidden]{display:none}
.undo span:not(:empty){font:700 11px var(--mono);background:var(--ac);color:var(--ac-tx);border-radius:9px;min-width:18px;height:18px;padding:0 5px;display:inline-flex;align-items:center;justify-content:center}
main{padding-bottom:calc(140px + var(--sab))}
.seg{background:var(--s1);border-radius:12px;padding:4px;gap:4px}
.seg button{height:38px;border:0;border-radius:9px;background:transparent;color:var(--mu);font-weight:600}
.seg button.on{background:var(--s2);color:var(--tx)}
.lx{display:flex;flex-direction:column;gap:6px;padding:6px 0 4px 2px;border-top:1px solid var(--s2)}
.lx .x{margin:-6px 0}
.sets{display:flex;flex-wrap:wrap;gap:6px}
.pill{display:inline-flex;align-items:center;gap:2px;background:var(--s2);border-radius:10px;padding:0 0 0 10px;font:600 13px var(--mono);height:36px}
.pill button{width:36px;height:36px;border:0;background:transparent;color:var(--mu);display:flex;align-items:center;justify-content:center}
.pill button svg{width:14px;height:14px}
.pill .mu{margin-left:6px;font-weight:500}
