:root{--bg:#f5f6f1;--paper:#fffefa;--ink:#29352e;--muted:#7b867d;--line:#e7ebe2;--green:#647d68;--green-dark:#47614d;--green-soft:#e9efe6;--sage:#dce6d8;--sand:#f3eee2;--rose:#f4e9e2;--shadow:0 10px 30px rgba(47,65,49,.055);--radius:22px}
*{box-sizing:border-box}html{min-height:100%;background:var(--bg)}body{margin:0;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei','Noto Sans CJK SC','Segoe UI',sans-serif;background:var(--bg);-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}.app-shell{max-width:620px;min-height:100dvh;margin:0 auto;background:var(--bg);position:relative;padding-bottom:calc(86px + env(safe-area-inset-bottom))}.app-header{height:76px;padding:14px 22px;display:flex;align-items:center;justify-content:space-between}.brand-lockup{display:flex;align-items:center;gap:11px}.brand-mark{width:39px;height:39px;border-radius:14px;background:var(--green-soft);color:var(--green-dark);display:grid;place-items:center;font-size:23px}.brand-name{font-size:16px;font-weight:700;letter-spacing:.04em}.brand-subtitle{font-size:8px;letter-spacing:.17em;color:#98a398;margin-top:2px}.icon-button{border:0;background:var(--paper);width:39px;height:39px;border-radius:14px;display:grid;place-items:center;color:var(--muted);box-shadow:0 3px 12px rgba(45,65,47,.04)}.icon-button svg{width:19px;fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}main{padding:0 18px}.view{display:none;animation:fade .2s ease}.view.active{display:block}@keyframes fade{from{opacity:.45;transform:translateY(4px)}to{opacity:1;transform:none}}.welcome-row{display:flex;align-items:center;justify-content:space-between;padding:24px 5px 20px}.eyebrow{margin:0 0 8px;color:#91a090;font-size:9px;font-weight:700;letter-spacing:.19em}.welcome-row h1,.page-intro h1{font-size:26px;line-height:1.35;letter-spacing:-.04em;margin:0;font-weight:700}.welcome-copy{font-size:12px;color:var(--muted);margin:8px 0 0}.sun-art{width:76px;height:76px;border-radius:27px;background:var(--sand);display:grid;place-items:center;position:relative;overflow:hidden;color:#b18d57}.sun-art span{font-size:42px;line-height:1;z-index:1}.sun-art i{position:absolute;width:55px;height:18px;border-radius:50%;background:#e6d7ba;bottom:10px;right:-12px;transform:rotate(-25deg)}.summary-card{background:var(--green-dark);border-radius:var(--radius);padding:20px 21px 17px;color:#fff;box-shadow:0 12px 24px rgba(67,91,69,.14)}.summary-topline{display:flex;justify-content:space-between;align-items:center}.summary-label{font-size:11px;color:#d1ddcf;letter-spacing:.08em}.summary-number{font-size:32px;font-weight:700;line-height:1.25;margin-top:4px;letter-spacing:-.04em}.summary-number small{font-size:13px;font-weight:500;color:#d1ddcf;letter-spacing:0}.progress-ring{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#dce8d7 0deg,#dce8d7 0deg,rgba(255,255,255,.18) 0deg);position:relative}.ring-inner{width:56px;height:56px;border-radius:50%;background:var(--green-dark);display:flex;flex-direction:column;align-items:center;justify-content:center}.ring-inner strong{font-size:13px}.ring-inner span{font-size:8px;color:#d1ddcf;margin-top:1px}.progress-track{height:5px;border-radius:9px;background:rgba(255,255,255,.2);margin-top:16px;overflow:hidden}.progress-fill{height:100%;width:0;background:#dce8d7;border-radius:9px;transition:width .25s ease}.summary-foot{font-size:10px;color:#d1ddcf;margin-top:10px}.mode-row{display:flex;align-items:center;justify-content:space-between;padding:15px 2px 18px;border-bottom:1px solid var(--line);margin-bottom:23px}.mode-copy{display:flex;flex-direction:column;gap:4px}.mode-copy strong{font-size:12px}.mode-copy span{font-size:10px;color:var(--muted)}.switch{position:relative;width:43px;height:25px;display:inline-block;flex:none}.switch input{opacity:0;width:0;height:0}.switch-slider{position:absolute;inset:0;border-radius:20px;background:#dfe4dc;transition:.2s}.switch-slider:before{content:"";height:19px;width:19px;position:absolute;left:3px;top:3px;border-radius:50%;background:white;box-shadow:0 1px 3px #0002;transition:.2s}.switch input:checked+.switch-slider{background:var(--green)}.switch input:checked+.switch-slider:before{transform:translateX(18px)}.section-heading{display:flex;align-items:end;justify-content:space-between;margin:0 3px 13px}.section-heading h2{font-size:18px;margin:0;font-weight:700;letter-spacing:-.025em}.section-heading .eyebrow{margin-bottom:5px}.date-chip{font-size:10px;color:var(--green-dark);background:var(--green-soft);padding:6px 10px;border-radius:20px}.task-groups{display:flex;flex-direction:column;gap:13px}.task-group{background:var(--paper);border:1px solid #edf0e9;border-radius:18px;padding:14px 14px 8px;box-shadow:var(--shadow)}.group-heading{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;color:#627666;margin:0 1px 8px}.group-dot{width:7px;height:7px;border-radius:50%;background:#9bad98}.group-caption{font-size:9px;color:#a0aaa0;margin-left:auto;font-weight:400}.task-row{display:flex;align-items:center;gap:11px;padding:11px 1px;border-top:1px solid #f0f1ec;min-height:54px}.task-row:first-of-type{border-top:0}.task-check{appearance:none;-webkit-appearance:none;width:21px;height:21px;border:1.5px solid #cbd4c8;border-radius:7px;flex:none;margin:0;display:grid;place-items:center;background:#fff;cursor:pointer;transition:.15s}.task-check:checked{background:var(--green);border-color:var(--green)}.task-check:checked:after{content:"✓";color:white;font-size:13px;font-weight:700}.task-text{min-width:0;display:flex;flex-direction:column;gap:3px;flex:1}.task-title{font-size:12px;font-weight:600;line-height:1.4}.task-detail{font-size:10px;color:#99a198;line-height:1.4}.task-row.is-done .task-title{text-decoration:line-through;color:#9aa39a}.task-row.is-done .task-detail{opacity:.65}.essential-tag{font-size:8px;padding:4px 6px;border-radius:8px;color:#6d806e;background:#edf2ea;white-space:nowrap}.gentle-note{display:flex;align-items:center;gap:12px;padding:17px;background:#f0f2eb;border-radius:17px;margin-top:14px}.note-icon{font-size:24px;color:#8c9d8c}.gentle-note strong{font-size:12px}.gentle-note p{font-size:10px;color:var(--muted);margin:4px 0 0}.page-intro{padding:27px 5px 22px}.page-intro h1{font-size:27px}.page-intro>p:last-child{font-size:11px;color:var(--muted);margin:8px 0 0}.plan-tabs{display:flex;background:#e9ede5;border-radius:13px;padding:4px;margin:0 0 17px}.plan-tab{flex:1;border:0;border-radius:10px;background:transparent;color:#7d897e;padding:10px;font-size:12px;font-weight:600}.plan-tab.active{background:var(--paper);color:var(--green-dark);box-shadow:0 2px 7px #29352e0c}.plan-panel{display:flex;flex-direction:column;gap:11px}.day-card,.month-card{background:var(--paper);border:1px solid #edf0e9;border-radius:17px;padding:14px 15px;box-shadow:var(--shadow)}.day-card.rest{background:#f1f3ed}.day-card-head,.month-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.day-name,.month-name{font-size:12px;font-weight:700}.day-meta{font-size:9px;color:#97a196}.plan-task{display:flex;align-items:flex-start;gap:8px;padding:7px 0;font-size:11px;color:#58645a;line-height:1.5}.plan-task:before{content:"";width:5px;height:5px;margin-top:5px;border-radius:50%;background:#a5b5a1;flex:none}.rest-label{font-size:10px;color:#829082}.plan-tip{display:flex;gap:10px;align-items:flex-start;background:#f0eee5;border-radius:15px;padding:13px 14px;margin-top:17px}.plan-tip span{color:#b09b6f;font-size:14px}.plan-tip p{margin:0;color:#817d6c;font-size:10px;line-height:1.7}.history-summary{background:var(--green-dark);color:#fff;border-radius:20px;padding:18px;display:grid;grid-template-columns:1fr 1fr;gap:15px}.history-stat span{display:block;font-size:10px;color:#d1ddcf}.history-stat strong{display:block;font-size:26px;margin-top:3px;letter-spacing:-.03em}.compact-heading{margin-top:25px}.history-list{display:flex;flex-direction:column;gap:9px}.history-row{display:flex;align-items:center;justify-content:space-between;padding:13px 14px;background:var(--paper);border:1px solid #edf0e9;border-radius:15px}.history-date{display:flex;flex-direction:column;gap:3px}.history-date strong{font-size:11px}.history-date span{font-size:9px;color:#98a197}.history-result{text-align:right}.history-result strong{font-size:13px;color:var(--green-dark)}.history-result span{display:block;font-size:9px;color:#98a197;margin-top:2px}.empty-history{text-align:center;padding:28px 15px;color:#929d92;background:var(--paper);border-radius:16px;font-size:11px}.settings-card{display:flex;align-items:center;gap:12px;background:var(--paper);border:1px solid #edf0e9;border-radius:17px;padding:15px;margin-bottom:18px}.settings-icon{width:39px;height:39px;border-radius:13px;background:var(--green-soft);display:grid;place-items:center;font-size:21px;color:var(--green-dark)}.settings-copy{display:flex;flex-direction:column;gap:4px;flex:1}.settings-copy strong{font-size:11px}.settings-copy span{font-size:9px;color:var(--muted);line-height:1.5}.status-dot{height:7px;width:7px;border-radius:50%;background:#8ba58a}.settings-group{background:var(--paper);border:1px solid #edf0e9;border-radius:17px;padding:15px;margin-bottom:14px}.settings-group h3{font-size:12px;margin:0 0 10px}.settings-action{width:100%;display:flex;align-items:center;gap:11px;text-align:left;border:0;background:transparent;padding:10px 0;border-top:1px solid #f0f1ec;color:var(--ink)}.settings-action:first-of-type{border-top:0}.action-icon{width:30px;height:30px;border-radius:10px;background:#f0f3ed;color:var(--green-dark);display:grid;place-items:center;font-size:16px}.settings-action span:nth-child(2){display:flex;flex-direction:column;gap:3px;flex:1}.settings-action strong{font-size:11px}.settings-action small{font-size:9px;color:#9aa39a}.settings-action b{font-size:20px;color:#aab3a8;font-weight:400}.help-item{border-top:1px solid #f0f1ec;padding:10px 0}.help-item strong{font-size:10px}.help-item p{font-size:9px;line-height:1.6;color:#8d988e;margin:5px 0 0}.settings-footer{text-align:center;color:#a1aaa0;font-size:10px;padding:14px 0 5px}.settings-footer span{color:#91a58f}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,620px);padding:9px 13px calc(9px + env(safe-area-inset-bottom));background:rgba(255,254,250,.94);backdrop-filter:blur(15px);border-top:1px solid rgba(222,228,218,.8);display:grid;grid-template-columns:repeat(4,1fr);z-index:10}.nav-item{border:0;background:transparent;color:#9aa49a;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:9px;padding:3px}.nav-icon{font-size:20px;line-height:1.15}.nav-item.active{color:var(--green-dark);font-weight:700}.nav-item.active .nav-icon{transform:translateY(-1px)}.toast{position:fixed;left:50%;bottom:calc(83px + env(safe-area-inset-bottom));transform:translate(-50%,10px);background:#2f4132;color:white;border-radius:20px;padding:9px 15px;font-size:11px;opacity:0;pointer-events:none;transition:.2s;z-index:30;white-space:nowrap}.toast.show{opacity:1;transform:translate(-50%,0)}.modal-backdrop{position:fixed;inset:0;background:rgba(28,39,30,.35);display:grid;place-items:center;padding:20px;z-index:40}.modal-backdrop[hidden]{display:none}.modal{width:min(100%,340px);background:var(--paper);border-radius:23px;padding:24px 20px 18px;text-align:center;box-shadow:0 18px 50px #1e2b2030}.modal-mark{font-size:25px;color:#819881}.modal h2{font-size:16px;margin:8px 0}.modal p{font-size:11px;color:var(--muted);line-height:1.7}.modal-actions{display:flex;gap:9px;margin-top:18px}.modal-actions button{flex:1;border:0;border-radius:11px;padding:11px;font-size:11px;font-weight:600}.button-secondary{background:#eff1eb;color:#657165}.button-primary{background:var(--green-dark);color:#fff}.install-hint{font-size:10px;color:#879387;margin-top:10px}
@media(min-width:620px){body{background:#e9ede7}.app-shell{box-shadow:0 0 50px rgba(39,57,42,.06);min-height:100vh}.bottom-nav{box-shadow:0 -5px 20px rgba(30,45,32,.04)}}
@media(max-width:370px){main{padding:0 14px}.welcome-row h1{font-size:23px}.sun-art{width:65px;height:65px}.summary-card{padding:17px}.task-group{padding:12px}.task-title{font-size:11px}}

/* Habit management and expanded statistics */
.manage-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 2px 17px;border-bottom:1px solid var(--line);margin-bottom:17px}.manage-toolbar>div{display:flex;flex-direction:column;gap:4px}.manage-toolbar strong{font-size:13px}.manage-toolbar span{font-size:10px;color:var(--muted)}
.button-primary,.button-secondary{border:0;border-radius:12px;padding:11px 15px;font-size:11px;font-weight:650}.button-primary{background:var(--green-dark);color:white;box-shadow:0 4px 10px rgba(71,97,77,.13)}.button-secondary{background:#eff1eb;color:#657165}.add-habit-button{white-space:nowrap;padding:11px 14px}
.habit-groups{display:flex;flex-direction:column;gap:17px}.habit-category{display:flex;flex-direction:column;gap:8px}.habit-category-heading{display:flex;align-items:center;justify-content:space-between;padding:0 4px 2px}.habit-category-heading h2{font-size:13px;margin:0}.habit-category-heading span{font-size:10px;color:#9aa49a}.habit-card{display:flex;align-items:center;gap:10px;background:var(--paper);border:1px solid #edf0e9;border-radius:16px;padding:12px 13px;box-shadow:var(--shadow)}.habit-card-main{min-width:0;flex:1}.habit-title-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.habit-title-row strong{font-size:11px;line-height:1.5}.habit-card-main>p{font-size:9px;color:#929c92;line-height:1.5;margin:3px 0 5px}.habit-meta{display:flex;align-items:center;gap:7px;color:#91a091;font-size:9px;margin-top:5px;flex-wrap:wrap}.habit-meta i{width:3px;height:3px;border-radius:50%;background:#bdc7bc}.habit-actions{display:flex;flex-direction:column;gap:5px;align-items:flex-end;flex:none}.text-action{border:0;background:#eef3ec;color:var(--green-dark);border-radius:8px;padding:6px 9px;font-size:9px;white-space:nowrap}.muted-action{color:#929b91;background:#f4f4ef}.habit-card.is-archived{opacity:.72}.archived-details{margin-top:17px;padding:13px 15px;background:#f0f2ec;border-radius:15px}.archived-details summary{font-size:11px;color:#758276;cursor:pointer;font-weight:650}.archived-details summary span{font-size:9px;margin-left:5px;color:#9aa49a}.archived-list{margin-top:12px}.archived-details[hidden]{display:none}
.stats-tabs{display:flex;background:#e9ede5;border-radius:13px;padding:4px;margin:0 0 14px}.stats-tab{flex:1;border:0;border-radius:10px;background:transparent;color:#7d897e;padding:10px 5px;font-size:11px;font-weight:600}.stats-tab.active{background:var(--paper);color:var(--green-dark);box-shadow:0 2px 7px #29352e0c}.stats-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:13px}.metric-card{min-width:0;background:var(--paper);border:1px solid #edf0e9;border-radius:15px;padding:12px 10px;box-shadow:var(--shadow)}.metric-card>span{display:block;font-size:9px;color:#8f9a8f;white-space:nowrap}.metric-card strong{display:block;font-size:22px;line-height:1.2;margin-top:7px;color:var(--green-dark);letter-spacing:-.04em;white-space:nowrap}.metric-card strong small{font-size:10px;font-weight:500;color:#9ba69b;letter-spacing:0}.metric-card em{display:block;font-size:8px;color:#a0a9a0;font-style:normal;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stats-card{background:var(--paper);border:1px solid #edf0e9;border-radius:18px;padding:15px 13px 12px;box-shadow:var(--shadow)}.stats-card-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.stats-card-heading .eyebrow{margin-bottom:4px}.stats-card-heading h2{font-size:14px;margin:0}.stats-card-heading>span{font-size:9px;color:#9aa49a;background:#f1f3ed;padding:5px 8px;border-radius:9px}.stats-chart{display:flex;align-items:stretch;gap:5px;height:143px;padding:15px 1px 0;overflow-x:auto;overflow-y:hidden}.chart-column{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px}.chart-value{font-size:8px;color:#8b998b;min-height:10px;white-space:nowrap}.chart-track{height:90px;width:min(20px,70%);min-width:8px;background:#f0f3ed;border-radius:7px 7px 3px 3px;display:flex;align-items:flex-end;overflow:hidden}.chart-track i{width:100%;display:block;border-radius:7px 7px 2px 2px;background:#8da58b;min-height:2px}.chart-track i.no-data{background:#dce3d9}.chart-date{font-size:8px;color:#a1aaa0;white-space:nowrap}.wide-chart{gap:3px;justify-content:flex-start}.wide-chart .chart-column{min-width:12px}.wide-chart .chart-value{display:none}.wide-chart .chart-track{width:9px}.wide-chart .chart-date{font-size:7px}.chart-legend{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:7px;font-size:8px;color:#9ba59b}.chart-legend span:first-child{display:flex;align-items:center;gap:5px}.chart-legend i{display:inline-block;width:7px;height:7px;border-radius:2px;background:#8da58b}.insight-card{display:flex;align-items:flex-start;gap:10px;background:#f0eee5;border-radius:15px;padding:13px 14px;margin-top:13px}.insight-mark{font-size:17px;color:#b09b6f;line-height:1}.insight-card strong{font-size:10px;color:#6c756b}.insight-card p{font-size:9px;line-height:1.65;color:#858477;margin:5px 0 0}.compact-heading{margin-top:22px}
.habit-modal{width:min(100%,420px);max-height:90dvh;overflow-y:auto;text-align:left;padding:20px 19px 17px}.habit-modal>.modal-mark,.habit-modal>h2,.habit-modal>.modal-subtitle{text-align:center}.habit-modal>h2{font-size:16px;margin:5px 0}.modal-subtitle{font-size:10px;color:var(--muted);margin:0 0 14px}.habit-modal form{display:flex;flex-direction:column;gap:11px}.form-field{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}.form-field>span,.schedule-field legend{font-size:10px;font-weight:650;color:#667467}.form-field>span b{color:#b77d68}.form-field input,.form-field select{width:100%;min-width:0;border:1px solid #e4e9e1;border-radius:10px;background:#fff;padding:10px 11px;color:var(--ink);font:inherit;font-size:11px;outline:none}.form-field input:focus,.form-field select:focus{border-color:#9eb19b;box-shadow:0 0 0 3px rgba(141,165,139,.12)}.form-row{display:flex;gap:10px}.schedule-field{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:9px}.schedule-field[hidden]{display:none}.schedule-field legend{padding:0;margin-bottom:8px}.choice-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.choice-grid label{position:relative}.choice-grid input{position:absolute;opacity:0;pointer-events:none}.choice-grid span{height:33px;border:1px solid #e4e9e1;border-radius:9px;background:#fff;color:#7c897d;display:grid;place-items:center;font-size:10px;cursor:pointer}.choice-grid input:checked+span{background:var(--green-dark);border-color:var(--green-dark);color:#fff}.essential-option{display:flex;align-items:center;gap:9px;padding:10px 11px;background:#f1f4ee;border-radius:11px}.essential-option input{width:16px;height:16px;accent-color:var(--green-dark)}.essential-option span{display:flex;flex-direction:column;gap:3px}.essential-option strong{font-size:10px}.essential-option small{font-size:9px;color:#929d92}.habit-modal .modal-actions{margin-top:3px}.habit-modal .modal-actions button{font-size:11px}.modal-backdrop{overflow-y:auto}.modal-backdrop[hidden]{display:none}
@media(max-width:390px){.manage-toolbar{align-items:flex-start}.manage-toolbar span{max-width:170px;line-height:1.5}.add-habit-button{padding:10px 11px}.metric-card{padding:10px 7px}.metric-card>span{font-size:8px}.metric-card strong{font-size:19px}.metric-card em{font-size:7px}.habit-card{padding:11px 10px}.habit-actions{gap:4px}.text-action{padding:6px 7px}}
@media(min-width:500px){.stats-chart{height:160px}.chart-track{height:105px}}
