:root{--bg:#FBF8F3;--surface:#fff;--ink:#1F1D1A;--muted:#6B665E;--line:#E8E2D8;--green:#2F7D5B;--green-ink:#fff;--green-soft:#E3F1EA;--coral:#D9603F;--coral-soft:#FDEBE4;--shadow:0 1px 2px rgba(31,29,26,.05),0 8px 24px -12px rgba(31,29,26,.16);--r:18px;color-scheme:light}
@media(prefers-color-scheme:dark){:root{--bg:#12110F;--surface:#1B1A17;--ink:#F3EFE8;--muted:#A8A195;--line:#2D2B26;--green:#5CC49A;--green-ink:#0B1A14;--green-soft:#1B2D26;--coral:#F08A6C;--coral-soft:#3A2119;--shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px -12px rgba(0,0,0,.6);color-scheme:dark}}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;-webkit-font-smoothing:antialiased;min-height:100vh}
h1,h2,h3{line-height:1.15;letter-spacing:-.02em;margin:0}
a{color:inherit}
button,input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--green);outline-offset:2px;border-radius:8px}
.wrap{max-width:720px;margin:0 auto;padding:0 16px 120px}
.center{text-align:center;padding-top:20vh}
.muted{color:var(--muted)}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 20px;border-radius:999px;border:1px solid var(--line);background:var(--surface);cursor:pointer;text-decoration:none;font-weight:600;transition:transform .12s,background .12s}
.btn:hover{transform:translateY(-1px)}.btn:active{transform:none}
.btn.primary{background:var(--green);border-color:var(--green);color:var(--green-ink)}
.btn.small{min-height:34px;padding:0 14px;font-size:14px}
.btn.ghost{background:transparent}
/* top bar */
.top{display:flex;align-items:center;gap:10px;padding:18px 0 10px}
.logo{display:flex;align-items:center;gap:9px;font-weight:700;text-decoration:none;font-size:17px;letter-spacing:-.02em}
.logo svg{width:28px;height:28px;border-radius:8px}
.spacer{flex:1}
.pill{white-space:nowrap;flex:none;min-height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font-size:14px;font-weight:600}
.name{border:0;background:transparent;font-weight:700;font-size:20px;letter-spacing:-.02em;padding:4px 6px;margin:-4px -6px;border-radius:8px;width:100%;min-width:0}
.name:hover{background:var(--surface)}
.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:999px;margin:10px 0 18px;position:sticky;top:8px;z-index:5;box-shadow:var(--shadow)}
.tabs button{border:0;background:transparent;min-height:40px;border-radius:999px;font-weight:600;font-size:14.5px;cursor:pointer;color:var(--muted)}
.tabs button[aria-selected=true]{background:var(--green);color:var(--green-ink)}
/* cards */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;box-shadow:var(--shadow)}
.head{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.head h2{font-size:26px}.head p{margin:2px 0 0}
.ring{--p:0;width:64px;height:64px;border-radius:50%;background:conic-gradient(var(--green) calc(var(--p)*1%),var(--green-soft) 0);display:grid;place-items:center;flex:none}
.ring b{width:50px;height:50px;border-radius:50%;background:var(--surface);display:grid;place-items:center;font-size:14px}
.list{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.habit{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:12px 14px}
.tick{width:48px;height:48px;border-radius:50%;border:2px solid var(--line);background:var(--bg);cursor:pointer;font-size:22px;display:grid;place-items:center;transition:all .15s}
.tick[aria-pressed=true]{background:var(--green);border-color:var(--green);color:var(--green-ink);transform:scale(1.04)}
.tick[disabled]{cursor:default}
.habit h3{font-size:16.5px;letter-spacing:-.01em;word-break:break-word}
.streak{font-size:13.5px;color:var(--muted)}.streak.hot{color:var(--coral);font-weight:700}
.dots{display:flex;gap:5px;margin-top:6px}
.dot{width:20px;height:20px;border-radius:7px;border:0;background:var(--green-soft);cursor:pointer;padding:0;position:relative}
.dot[aria-pressed=true]{background:var(--green)}.dot[disabled]{cursor:default}
.dot.today{outline:2px solid var(--muted);outline-offset:1px}
.x{border:0;background:transparent;color:var(--muted);cursor:pointer;width:36px;height:36px;border-radius:50%;font-size:18px}.x:hover{background:var(--coral-soft);color:var(--coral)}
.add{display:flex;gap:8px;margin-top:14px}
.add input[type=text]{flex:1;min-width:0;height:48px;border-radius:14px;border:1px solid var(--line);background:var(--surface);padding:0 14px}
.add select{height:48px;border-radius:14px;border:1px solid var(--line);background:var(--surface);padding:0 8px;font-size:20px}
.empty{padding:28px;text-align:center;color:var(--muted)}
/* focus */
.timer{display:grid;justify-items:center;gap:16px;padding:26px 16px}
.dial{--p:0;width:min(260px,70vw);aspect-ratio:1;border-radius:50%;background:conic-gradient(var(--coral) calc(var(--p)*1%),var(--coral-soft) 0);display:grid;place-items:center}
.dial>div{width:calc(100% - 22px);aspect-ratio:1;border-radius:50%;background:var(--surface);display:grid;place-items:center;align-content:center}
.time{font-size:clamp(44px,14vw,60px);font-weight:700;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.modes{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.modes button{min-height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--bg);cursor:pointer;font-weight:600;font-size:14px}
.modes button[aria-pressed=true]{background:var(--coral-soft);border-color:var(--coral);color:var(--coral)}
.label{width:100%;max-width:360px;height:46px;border-radius:14px;border:1px solid var(--line);background:var(--bg);padding:0 14px;text-align:center}
.row{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.coral{background:var(--coral);border-color:var(--coral);color:#fff}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0}
.stat{padding:12px 14px}.stat b{display:block;font-size:24px;letter-spacing:-.03em}.stat span{font-size:13px;color:var(--muted)}
.bars{display:flex;align-items:flex-end;gap:8px;height:90px;margin-top:6px}
.bars div{flex:1;display:grid;gap:6px;justify-items:center;height:100%;align-content:end;font-size:11px;color:var(--muted)}
.bars i{display:block;width:100%;max-width:34px;background:var(--coral);border-radius:8px 8px 4px 4px;min-height:3px;opacity:.9}
.h3{font-size:15px;margin:22px 0 10px;color:var(--muted);font-weight:600}
.sess{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--line);font-size:15px}.sess:last-child{border:0}
/* journal */
.nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.nav h2{font-size:22px}
.moods{display:flex;gap:8px;margin:12px 0}
.moods button{width:46px;height:46px;border-radius:50%;border:2px solid var(--line);background:var(--bg);font-size:22px;cursor:pointer}
.moods button[aria-pressed=true]{border-color:var(--green);background:var(--green-soft)}
textarea.note{width:100%;min-height:150px;border-radius:14px;border:1px solid var(--line);background:var(--bg);padding:14px;resize:vertical;line-height:1.55}
.saved{font-size:13px;color:var(--muted);min-height:20px;margin-top:6px}
.entry{padding:12px 0;border-bottom:1px solid var(--line)}.entry small{color:var(--muted);display:block;margin-bottom:2px}.entry p{margin:0;white-space:pre-wrap;word-break:break-word}
/* month */
.heat{display:grid;gap:12px}
.hrow{display:grid;grid-template-columns:minmax(80px,28%) 1fr;gap:10px;align-items:center;font-size:14px}
.hrow span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cells{display:grid;grid-template-columns:repeat(28,1fr);gap:3px}
.cells i{aspect-ratio:1;border-radius:4px;background:var(--green-soft)}.cells i.on{background:var(--green)}
.legend{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-top:10px}
.banner{background:var(--green-soft);border-radius:14px;padding:12px 16px;margin-bottom:14px;display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:15px}
/* dialog */
dialog{border:1px solid var(--line);border-radius:22px;background:var(--surface);color:var(--ink);padding:22px;max-width:min(440px,92vw);box-shadow:0 30px 80px -20px rgba(0,0,0,.4)}
dialog::backdrop{background:rgba(20,18,15,.45)}
dialog h2{font-size:22px;margin-bottom:6px}
dialog input{width:100%;height:46px;border-radius:12px;border:1px solid var(--line);background:var(--bg);padding:0 12px;margin:12px 0}
.toast{position:fixed;left:50%;bottom:76px;transform:translate(-50%,20px);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:999px;font-size:14px;opacity:0;pointer-events:none;transition:all .2s;z-index:50}
.toast.show{opacity:1;transform:translate(-50%,0)}
/* landing */
.hero{padding:56px 0 24px;text-align:center}
.hero h1{font-size:clamp(40px,9vw,64px);margin:18px 0 14px}
.hero p.lead{font-size:clamp(17px,2.4vw,20px);color:var(--muted);max-width:520px;margin:0 auto 26px}
.preview{margin:34px auto 0;max-width:420px;text-align:left}
.feat{display:grid;gap:14px;margin:48px 0}
@media(min-width:640px){.feat{grid-template-columns:repeat(3,1fr)}}
.feat .card{box-shadow:none}.feat h3{font-size:18px;margin:8px 0 4px}.feat p{margin:0;color:var(--muted);font-size:15px}
footer{padding:30px 0;color:var(--muted);font-size:13.5px;text-align:center}
footer a{color:inherit}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
