:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  --ink: #20252a; --muted: #7f7e78; --canvas: #fbf8f2;
  --sage: #91a94f; --sage-dark: #617d2e; --coral: #ff7061;
  --paper: #fffefa; --shadow: 0 12px 28px rgba(92,76,52,.085), 0 2px 7px rgba(92,76,52,.035);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { color: var(--ink); background: radial-gradient(circle at 80% 6%, rgba(221,226,184,.22) 0, transparent 27%), radial-gradient(circle at 8% 45%, rgba(255,255,255,.86) 0, transparent 25%), var(--canvas); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus { outline: 0; }
.app { width: min(100%, 430px); margin: auto; padding: calc(25px + env(safe-area-inset-top)) 18px calc(84px + env(safe-area-inset-bottom)); }
.masthead { position: relative; z-index: 6; display: flex; justify-content: space-between; align-items: flex-start; }
.mast-copy p { margin: 0 0 8px; color: #777873; font-size: 14px; font-weight: 620; }
h1, h2 { margin: 0; letter-spacing: -.05em; }
h1 { font-size: 43px; line-height: 1; font-weight: 790; }
h2 { font-size: 28px; line-height: 1.1; font-weight: 780; }
.mast-actions { display: flex; gap: 8px; }
.square-action { display: grid; place-items: center; gap: 2px; width: 50px; height: 60px; padding: 7px 3px; border-radius: 18px; color: #545a56; background: rgba(248,245,238,.94); box-shadow: 0 10px 24px rgba(92,78,56,.09), inset 0 1px #fff; }
.square-action.sage { color: var(--sage-dark); background: #f0f1d9; }
.square-action svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.square-action span { font-size: 9.5px; font-weight: 650; white-space: nowrap; }

.hero-wrap { position: relative; margin-top: 5px; padding-top: 56px; }
.hero-scene { position: absolute; z-index: 3; top: -34px; left: 50%; width: calc(100% + 36px); height: 102px; object-fit: contain; object-position: center bottom; transform: translateX(-50%); filter: drop-shadow(0 8px 8px rgba(75,64,43,.08)); }
.progress-card { position: relative; height: 206px; padding: 24px 25px 18px; overflow: visible; border-radius: 29px; background: linear-gradient(145deg,#fffefa,#fdfbf6); box-shadow: 0 24px 56px rgba(84,70,49,.15), 0 5px 14px rgba(84,70,49,.055), inset 0 1px #fff; }
.progress-card::after { position: absolute; top: 0; right: 0; width: 190px; height: 190px; border-radius: 0 29px 0 100%; background: radial-gradient(circle at 75% 25%,rgba(228,232,195,.38),transparent 68%); content: ""; }
.progress-copy { position: relative; z-index: 2; width: 52%; }
.progress-copy strong { display: flex; align-items: baseline; font-size: 54px; line-height: .95; font-weight: 750; letter-spacing: -.065em; white-space: nowrap; }
.progress-copy strong small { margin: 0 5px; color: #777a78; font-size: 39px; font-weight: 520; letter-spacing: -.04em; }
.progress-copy strong em { color: #707371; font-size: 39px; font-style: normal; font-weight: 570; letter-spacing: -.04em; }
.progress-copy p { margin: 11px 0 0; color: #72746f; font-size: 15px; line-height: 1.3; font-weight: 540; white-space: nowrap; }
.track { height: 8px; margin-top: 22px; overflow: hidden; border-radius: 99px; background: #ebe9d8; }
.track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#a9bc69,var(--sage)); }
.mascot { position: absolute; z-index: 4; right: -15px; bottom: 18px; width: 225px; height: 230px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 14px 16px rgba(62,53,42,.13)); }
.progress-foot { position: absolute; z-index: 5; right: 24px; bottom: 17px; left: 25px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.progress-foot b { font-weight: 720; }
.progress-foot em { color: var(--sage-dark); font-style: normal; }
.progress-foot button { padding: 0; color: var(--sage-dark); background: transparent; font-weight: 720; }

.filter-bar { position: sticky; z-index: 8; top: calc(8px + env(safe-area-inset-top)); display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 18px 0 14px; }
.filter-bar button { display: flex; justify-content: center; align-items: center; gap: 7px; height: 39px; border-radius: 20px; color: #686c68; background: rgba(255,253,248,.96); box-shadow: 0 9px 20px rgba(87,73,52,.07), inset 0 1px #fff; font-size: 14px; font-weight: 650; backdrop-filter: blur(18px); }
.filter-bar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-bar button:first-child svg rect { fill: currentColor; stroke: none; }
.filter-bar .active { color: #fff; background: linear-gradient(145deg,#a7bb66,#819b40); box-shadow: 0 11px 22px rgba(106,128,57,.25), inset 0 1px rgba(255,255,255,.28); }
.task-groups { display: grid; gap: 8px; }
.group { display: grid; gap: 8px; }
.group-head { display: none; }
.group-head strong { font-size: 14px; font-weight: 740; }
.group-head span { color: #929089; font-size: 11px; font-weight: 570; }
.task-card { display: grid; grid-template-columns: 34px 44px minmax(0,1fr) auto 10px; gap: 8px; align-items: center; min-height: 62px; padding: 7px 9px; border-radius: 20px; background: linear-gradient(145deg,#fffefa,#fdfbf6); box-shadow: 0 11px 24px rgba(91,75,52,.07), 0 2px 7px rgba(91,75,52,.028); }
.task-card[data-state="overdue"] { background: linear-gradient(145deg,#fffaf8,#fff5f2); box-shadow: 0 10px 23px rgba(190,91,70,.065); }
.task-card[data-state="done"] { opacity: .55; }
.task-check { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: #fff; box-shadow: 0 4px 10px rgba(77,67,53,.095), inset 0 0 0 1px rgba(131,119,99,.06); }
.task-check i { display: none; width: 10px; height: 17px; margin: 6px auto 0; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
[data-state="done"] .task-check { background: var(--sage); }
[data-state="done"] .task-check i { display: block; }
.task-art { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(145deg,#faeddd,#f7f1e5); box-shadow: 0 6px 14px rgba(96,78,52,.07), inset 0 1px #fff; }
.task-art img { width: 43px; height: 43px; object-fit: contain; }
.task-copy { min-width: 0; }
.task-copy h3 { margin: 0 0 3px; overflow: hidden; color: var(--ink); font-size: 14px; line-height: 1.25; font-weight: 690; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.task-copy p { margin: 0; color: #898781; font-size: 12.5px; line-height: 1.25; font-weight: 480; }
.task-status { padding: 6px 8px; border-radius: 999px; color: #77736b; background: #f1eee7; font-size: 11px; font-weight: 670; white-space: nowrap; }
[data-state="overdue"] .task-status { color: #fff; background: linear-gradient(145deg,#ff806e,var(--coral)); box-shadow: 0 6px 12px rgba(225,91,74,.16); }
[data-state="overdue"] .task-copy time { color: var(--coral); font-weight: 570; }
[data-state="done"] .task-status { color: #536a30; background: #e5efd4; }
.chevron { color: #8d8e89; font-size: 24px; font-weight: 300; }
.empty { padding: 60px 0; color: var(--muted); text-align: center; }
.reward { position: fixed; z-index: 10; right: 15px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 15px; display: grid; grid-template-columns: 67px minmax(0,1fr) 18px; align-items: center; width: min(400px,calc(100% - 30px)); min-height: 73px; margin: auto; padding: 7px 14px 7px 5px; border-radius: 24px; background: rgba(253,250,243,.96); box-shadow: 0 18px 48px rgba(65,55,41,.16); backdrop-filter: blur(18px); }
.reward[hidden] { display: none; }
.reward img { width: 67px; height: 60px; object-fit: contain; }
.reward div { display: grid; gap: 3px; }
.reward strong { font-size: 13px; }
.reward span { color: #85827b; font-size: 11px; }
.reward-arrow { font-size: 26px!important; }

.sheet { position: fixed; inset: auto 0 0; width: min(100%,430px); height: min(76dvh,700px); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; border: 0; border-radius: 32px 32px 0 0; background: linear-gradient(155deg,#fffdf9,#f8f2e8); box-shadow: 0 28px 90px rgba(34,30,24,.24); }
.sheet[open] { animation: sheet-up .34s cubic-bezier(.2,.82,.25,1); }
.sheet::backdrop { background: rgba(32,30,25,.43); backdrop-filter: blur(7px) saturate(.8); }
.sheet-inner { position: relative; display: flex; flex-direction: column; height: 100%; padding: 12px 19px calc(16px + env(safe-area-inset-bottom)); }
.grabber { flex: 0 0 auto; width: 47px; height: 5px; margin: 0 auto 18px; border-radius: 99px; background: #d7d2c7; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.round-close { display: grid; place-items: center; width: 45px; height: 45px; padding: 0 0 4px; border-radius: 50%; color: #676b66; background: #f4efe5; box-shadow: 0 8px 20px rgba(84,70,49,.1); font-size: 30px; font-weight: 300; }
.task-total { display: flex; align-items: center; gap: 15px; min-height: 78px; margin: 16px 0 12px; padding: 10px 16px; border-radius: 23px; background: var(--paper); box-shadow: var(--shadow); color: #686b66; font-size: 17px; }
.task-total img { width: 52px; height: 52px; object-fit: contain; }
.task-total b { color: var(--sage-dark); font-size: 28px; }
.settings-rows { display: grid; flex: 1; gap: 9px; min-height: 0; padding: 2px 1px 10px; overflow: auto; }
.settings-row { display: grid; grid-template-columns: minmax(0,1fr) 82px 44px; gap: 7px; min-height: 62px; padding: 8px; border-radius: 20px; background: var(--paper); box-shadow: 0 8px 20px rgba(91,75,52,.065); }
.settings-row input { min-width: 0; height: 46px; padding: 0 11px; appearance: none; border: 0; border-radius: 14px; outline: 0; color: var(--ink); background: #f6f0e6; font-size: 13px; }
.settings-row input[type=time]::-webkit-calendar-picker-indicator { display: none; }
.settings-row button { width: 44px; height: 46px; padding: 0; border-radius: 14px; color: var(--coral); background: #fff0eb; font-size: 11px; font-weight: 670; }
.add-task { flex: 0 0 auto; height: 50px; border-radius: 19px; color: var(--sage-dark); background: var(--paper); box-shadow: var(--shadow); font-size: 15px; font-weight: 700; }
.sheet-buttons { display: grid; grid-template-columns:.72fr 1.28fr; gap: 11px; padding-top: 12px; }
.sheet-buttons button, .guide-done { height: 52px; border-radius: 19px; font-size: 15px; font-weight: 720; }
.cancel { color: #676963; background: #faf7f0; box-shadow: 0 8px 20px rgba(91,75,52,.07); }
.save, .guide-done { color: #fff; background: linear-gradient(145deg,#a4b967,#819c43); box-shadow: 0 11px 23px rgba(104,128,57,.23); }
.install-sheet { height: min(75dvh,700px); }
.floating-close { position: absolute; z-index: 3; top: 34px; right: 18px; }
.guide-head { display: grid; grid-template-columns: 126px minmax(0,1fr); align-items: end; min-height: 137px; margin: -6px 0 8px; }
.guide-head img { width: 139px; height: 145px; margin-left: -10px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 10px 12px rgba(60,50,39,.12)); }
.guide-head div { align-self: center; padding: 18px 36px 0 0; }
.guide-head h2 { font-size: 25px; white-space: nowrap; }
.guide-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.steps { display: grid; flex: 1; gap: 9px; min-height: 0; margin: 0; padding: 2px 1px 9px; overflow: auto; list-style: none; }
.steps li { display: grid; grid-template-columns: 31px 52px minmax(0,1fr); gap: 10px; align-items: center; min-height: 78px; padding: 10px 12px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); font-size: 13px; font-weight: 680; }
.steps li>b { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#a3b968,#7f9941); }
.step-art { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; color: var(--sage-dark); background: #f6f0e5; box-shadow: 0 6px 14px rgba(91,75,52,.08); }
.step-art svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.compass { color: #3c91ca; }
.compass path { fill: var(--coral); stroke: var(--coral); }
.guide-done { flex: 0 0 auto; width: 100%; }
.history-rows { display: grid; gap: 9px; margin-top: 18px; overflow: auto; }
.history-row { position: relative; display: grid; grid-template-columns: 1fr auto; min-height: 58px; padding: 16px 14px 19px; overflow: hidden; border-radius: 19px; background: var(--paper); box-shadow: 0 8px 19px rgba(91,75,52,.06); }
.history-row i { position: absolute; bottom: 0; left: 0; width: var(--p); height: 4px; background: var(--sage); }
@keyframes sheet-up { from { opacity:.7; transform:translateY(100%); } to { opacity:1; transform:none; } }
@media (max-width: 370px) {
  .app { padding-right: 14px; padding-left: 14px; }
  h1 { font-size: 39px; }
  .square-action { width: 51px; height: 60px; }
  .progress-card { height: 214px; padding-right: 20px; padding-left: 20px; }
  .progress-copy strong { font-size: 49px; }
  .mascot { right: -11px; width: 174px; }
  .task-card { grid-template-columns: 37px 44px minmax(0,1fr) auto 10px; gap: 7px; padding: 8px; }
  .task-art { width: 44px; height: 44px; }
  .task-art img { width: 39px; height: 39px; }
  .task-status { padding: 6px 7px; font-size: 10px; }
}
