:root {
 color-scheme: dark;
 font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
 color: #eef2ed; background: #121615; --mint: #b7e499; --muted:#a7b3ac;
}
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; min-height:100dvh; }
button,input,textarea { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
button { cursor:pointer; min-height:44px; border:0; border-radius:12px; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible {
 outline:3px solid var(--mint); outline-offset:3px;
}
[hidden] { display:none!important; }
.shelf { max-width:640px; padding:0 20px max(36px,env(safe-area-inset-bottom)); margin:auto; }
header,.section-head,.dialog-head,.haptics { display:flex; align-items:center; justify-content:space-between; gap:12px; }
header { padding: max(16px,env(safe-area-inset-top)) 0 14px; border-bottom:1px solid #303a33; }
.wordmark { font-size:1.5rem; font-weight:780; letter-spacing:-.07em; text-decoration:none; color:inherit; }
.wordmark span { color:var(--mint); }
.small,.round { padding:8px 15px; background:#242b27; color:#eef2ed; font-weight:650; }
h1,h2,p { margin:0; } h1 { font-size:clamp(2.5rem,9vw,3.5rem); letter-spacing:-.065em; line-height:1.1; margin:38px 0 10px; }
h2 { font-size:1.25rem; letter-spacing:-.025em; }
.fine { color:var(--muted); font-size:.94rem; }
.preset { margin:25px 0 30px; padding:22px 24px; width:100%; min-height:150px; display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:start; border-radius:23px; background:#223a30; color:#edf5e8; border:1px solid #375543; }
.preset-copy { display:grid; gap:2px; }
.preset-label { font-size:1rem; font-weight:650; }
.preset strong { font-size:clamp(1.9rem,7vw,2.6rem); letter-spacing:-.065em; color:var(--mint); font-variant-numeric:tabular-nums; }
.preset i { margin:0 .12em; font-style:normal; color:#739a71; }
.preset small { font-size:.875rem; color:#c6d8cb; }
.beads { width:72px; height:72px; border-radius:100%; border:7px dotted #c7e8ac; transform:rotate(-20deg); flex:none; }
.section-head { flex-wrap:wrap; margin-bottom:14px; }
.accent { background:var(--mint); color:#17321e; padding:10px 16px; font-weight:750; }
.counter-card,.empty { display:grid; gap:12px; width:100%; margin-bottom:10px; background:#202623; color:#f5f6f3; border:1px solid #333c36; border-radius:15px; padding:17px 20px; text-align:start; }
.counter-name { font-weight:700; overflow-wrap:anywhere; }
.counter-details { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:6px; color:var(--muted); }
.card-progress { color:var(--mint); font-variant-numeric:tabular-nums; font-size:1.15rem; }
.track { background:#374139; height:4px; border-radius:4px; overflow:hidden; }
.track span { display:block; height:100%; background:var(--mint); }
.empty { font-size:.94rem; color:var(--muted); border-style:dashed; }
.haptics { margin:28px 0 5px; font-weight:650; min-height:44px; }
.haptics input { accent-color:var(--mint); width:21px; height:21px; }
.home { display:inline-flex; align-items:center; min-height:44px; margin-top:14px; color:var(--mint); text-underline-offset:4px; }
dialog { width:min(450px,calc(100% - 28px)); max-height:calc(100dvh - 28px); overflow:auto; padding:23px; border:1px solid #3a463e; border-radius:23px; background:#1a201c; color:#eef2ed; }
dialog::backdrop { background:#000b; }
.dialog-head { margin-bottom:20px; }
.round,.exit { min-width:44px; padding:3px 6px; border-radius:50%; font-size:1.5rem; line-height:1; }
form label { display:grid; gap:5px; margin-bottom:13px; color:#d1d8d2; font-size:.94rem; }
form input,textarea { border:1px solid #424b44; border-radius:10px; width:100%; min-width:0; background:#282f29; color:#fff; padding:11px 12px; font-size:1rem; }
.fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.start-button { width:100%; margin-top:14px; }
#focus { position:fixed; inset:0; z-index:10; background:#101311; color:#f5f8f2; }
body.counting { overflow:hidden; }
#pad { height:100%; width:100%; padding: max(60px,env(safe-area-inset-top)) 16px max(25px,env(safe-area-inset-bottom)); border-radius:0; color:inherit; background:#101311; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(11px,4vh,35px); user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
#pad:focus-visible { outline-offset:-5px; }
.pad-title { color:#d9e3d8; font-weight:600; max-width:90%; overflow-wrap:anywhere; line-height:1.25; }
.dial { width:min(100%,960px); display:grid; }
.dial-face { display:flex; justify-content:center; align-items:center; flex-direction:column; gap:5px; }
#number { width:100%; color:#c0f29e; line-height:1; font:600 clamp(3rem,40vw,21rem)/1 system-ui,-apple-system,BlinkMacSystemFont,sans-serif; font-variant-numeric:tabular-nums; letter-spacing:-.025em; white-space:nowrap; }
.caption,#target,.tap-hint { font-size:.94rem; color:var(--muted); }
#milestone { min-height:1.5em; color:#c9e9b5; font-weight:650; }
#switchLayer { position:absolute; inset:0; overflow:hidden; z-index:1; }
#tapSwitch { position:absolute; top:0; left:0; margin:0; opacity:0; appearance:auto; -webkit-appearance:auto; transform-origin:top left; transform:scale(var(--scale-x,1),var(--scale-y,1)); touch-action:manipulation; }
.exit { position:absolute; z-index:2; right:max(12px,env(safe-area-inset-right)); top:max(12px,env(safe-area-inset-top)); width:44px; height:44px; background:#262e29; color:#d6ded7; }
.notice,#focusWarning { position:fixed; left:50%; transform:translateX(-50%); width:min(90vw,460px); bottom:max(16px,env(safe-area-inset-bottom)); padding:10px 16px; border-radius:10px; background:#f4dfad; color:#312715; z-index:20; font-size:.9rem; }
@media(max-width:340px) { .shelf{padding-inline:14px;} .preset{padding:18px;} .beads{width:50px;height:50px;} }
#pad { padding-inline:max(8px,env(safe-area-inset-left),env(safe-area-inset-right)); gap:clamp(8px,2.5vh,24px); }
#target { display:block; margin-top:12px; }
.dial::after { content:""; display:block; width:min(48%,280px); height:4px; margin:16px auto 0; background:linear-gradient(to right,var(--mint) var(--filled,0%),#304038 var(--filled,0%)); border-radius:4px; }
#pad.flash .dial::after { box-shadow:0 0 12px 2px #87ad7390; }
#pad.flash #number { color:#efffe6; }
@media (max-height:460px) and (orientation:landscape) { #pad {gap:4px; padding-block:4px;} #target,.dial::after{margin-top:4px;} }
.restart { margin:0 0 16px; }
.counter-card .fine { overflow-wrap:anywhere; }

.counter-wrapper{position:relative;touch-action:pan-y}
.counter-wrapper .counter-card{padding-right:60px}
.counter-delete{position:absolute;right:8px;top:6px;width:44px;background:transparent;color:#efb5ae;font-size:28px}
.completed-counters{margin-top:20px}
.completed-counters summary{cursor:pointer;background:#26332a;border:1px solid #405345;border-radius:14px;padding:16px;margin-bottom:12px;font-weight:650;min-height:48px}
#number{padding-inline:12px}

.repeat-option{display:flex;align-items:center;gap:12px}.repeat-option input{width:22px;min-height:22px;flex:none;accent-color:var(--mint)}
