*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{margin:0;font-family:-apple-system,"SF Pro Rounded","Arial Rounded MT Bold","Trebuchet MS",Verdana,sans-serif;overflow:hidden;user-select:none;-webkit-user-select:none}
button{font-family:inherit;border:0;background:none;cursor:pointer;color:inherit}
.screen{position:fixed;inset:0;display:flex;flex-direction:column;transition:background .35s}
.hidden{display:none!important}
.iconbtn{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.18);backdrop-filter:blur(4px)}
.iconbtn svg{width:22px;height:22px;fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.iconbtn.off svg{opacity:.45}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 0}
.backbtn{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center}
.backbtn svg{width:20px;height:20px;stroke:#fff;stroke-width:2.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
.seg{display:flex;background:rgba(255,255,255,.22);border-radius:99px;padding:3px}
.seg button{padding:6px 18px;border-radius:99px;color:#fff;font-weight:700;font-size:15px}
.seg button.on{background:#fff;color:#333}
.toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px 0}
.toolgroup{display:flex;gap:10px}
.counter-name{color:#fff;font-size:17px;font-weight:700;letter-spacing:.5px;background:none;text-align:center;min-width:60px}
.main{flex:1;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}
.sidetools{position:absolute;left:16px;top:18px;display:flex;flex-direction:column;gap:14px}
.countwrap{display:flex;align-items:baseline;justify-content:center;gap:10px;margin-bottom:6px}
.count{color:#fff;font-size:clamp(64px,22vw,120px);font-weight:300;font-style:normal;letter-spacing:2px;line-height:1;font-variant-numeric:tabular-nums}
.stepbadge{color:#fff;font-size:18px;font-weight:700;opacity:.95;display:flex;align-items:center;gap:2px;padding:6px 8px;border-radius:10px}
.stepbadge svg{width:12px;height:12px;fill:#fff}
.bigbtn{width:min(73vw,305px);height:min(73vw,305px);border-radius:50%;background:rgba(255,255,255,.88);display:flex;align-items:center;justify-content:center;box-shadow:0 10px 30px rgba(0,0,0,.18);transition:transform .08s}
.bigbtn:active{transform:scale(.95)}
.bigbtn svg{width:44%;height:44%;fill:none;stroke-width:7;stroke-linecap:round;stroke-linejoin:round}
.smallbtn{width:75px;height:75px;border-radius:50%;background:rgba(255,255,255,.88);display:flex;align-items:center;justify-content:center;box-shadow:0 6px 16px rgba(0,0,0,.16);transition:transform .08s;margin-top:-12px;z-index:2}
.smallbtn:active{transform:scale(.92)}
.smallbtn svg{width:32px;height:32px;fill:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:rgba(0,0,0,.75);color:#fff;padding:10px 18px;border-radius:99px;font-size:15px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .25s;z-index:60}
.toast.show{opacity:1}
.picker-overlay{position:fixed;inset:0;z-index:50}
.picker{position:absolute;left:50%;top:16%;transform:translateX(-58%);width:min(74vw,300px);height:250px;border-radius:30px;background:rgba(255,255,255,.55);background:color-mix(in srgb,var(--theme,#35c463) 30%,rgba(255,255,255,.55));backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 14px 44px rgba(0,0,0,.22);overflow:visible}
.picker .pointer{position:absolute;right:-11px;top:50%;transform:translateY(-50%);width:22px;height:26px;background:inherit;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);clip-path:polygon(0 15%,100% 50%,0 85%)}
.picker .viewport{position:absolute;inset:0;overflow:hidden;border-radius:30px;touch-action:none;cursor:grab}
.picker .band{position:absolute;left:10px;right:10px;top:50%;height:40px;transform:translateY(-50%);background:rgba(255,255,255,.42);border-radius:14px;box-shadow:0 2px 10px rgba(0,0,0,.08);pointer-events:none;z-index:1}
.drum{position:absolute;inset:0;z-index:2}
.drum .cell{position:absolute;left:0;right:0;top:50%;height:34px;margin-top:-17px;display:flex;align-items:center;justify-content:center;font-size:19px;font-weight:700;color:var(--deep,#14532d);pointer-events:none;will-change:transform,opacity}
.sheet{position:fixed;inset:0;background:#f2f2f7;z-index:40;display:flex;flex-direction:column;overflow:hidden}
.sheet-head{display:flex;align-items:center;gap:12px;padding:14px 14px 10px;background:#f2f2f7}
.sheet-head .backbtn{background:#e4e4ea}
.sheet-head .backbtn svg{stroke:#333}
.sheet-title{flex:1;text-align:center;font-size:17px;font-weight:700;color:#111;margin-right:50px}
.sheet-body{flex:1;overflow-y:auto;padding:6px 14px 30px}
.card{background:#fff;border-radius:14px;margin-bottom:14px;overflow:hidden}
.card .row{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;font-size:16px;color:#111;border-bottom:1px solid #f0f0f4}
.card .row:last-child{border-bottom:0}
.card .row .val{color:#8a8a8e}
.card .row input[type=number]{width:80px;text-align:right;font-size:16px;padding:6px 8px;border:1px solid #e0e0e5;border-radius:8px;color:#111}
.sect{font-size:13px;color:#6d6d72;text-transform:uppercase;letter-spacing:.4px;margin:18px 6px 6px}
.switch{position:relative;width:50px;height:30px;background:#e4e4ea;border-radius:99px;transition:background .2s;flex:none}
.switch.on{background:#34c759}
.switch:after{content:"";position:absolute;top:2px;left:2px;width:26px;height:26px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.2);transition:left .2s}
.switch.on:after{left:22px}
.swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;padding:16px}
.swatch{aspect-ratio:1;border-radius:12px;border:2px solid rgba(0,0,0,.08)}
.swatch.on{border-color:#111;box-shadow:0 0 0 2px #fff inset}
.chart-wrap{background:#fff;border-radius:14px;padding:14px 10px 8px;margin-bottom:12px}
canvas.chart{width:100%;height:180px;display:block}
.pillrow{display:flex;background:#e9e9ee;border-radius:99px;padding:3px;margin:0 4px 12px}
.pillrow button{flex:1;padding:7px 0;border-radius:99px;font-weight:700;color:#333;font-size:14px}
.pillrow button.on{background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.daylog h4{margin:14px 4px 6px;font-size:14px;color:#6d6d72}
.daylog .row{display:flex;justify-content:space-between;align-items:center;background:#fff;padding:11px 16px;border-radius:12px;margin-bottom:6px;font-size:15px;color:#111}
.daylog .delta-pos{color:#34c759;font-weight:700}
.daylog .delta-neg{color:#ff3b30;font-weight:700}
.logdel{color:#c7c7cc;font-size:18px;padding:0 4px}
.cal-head{display:flex;align-items:center;justify-content:space-between;padding:8px 6px}
.cal-head b{font-size:17px;color:#111}
.cal-head button{font-size:22px;color:#333;padding:4px 14px}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;background:#fff;border-radius:14px;padding:10px}
.cal-grid .dow{text-align:center;font-size:11px;color:#8a8a8e;font-weight:700;padding:4px 0}
.cal-grid .day{aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:10px;font-size:14px;color:#111}
.cal-grid .day .tot{font-size:10px;font-weight:800}
.cal-grid .day.has{background:#e8f9f0}
.cal-grid .day.today{outline:2px solid #34c759}
@media (min-width:700px){.sheet{max-width:560px;left:50%;transform:translateX(-50%)}}
