[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0}
img{max-width:100%}
:root{
  --bg:#E9EFEC; --surface:#FFFFFF; --surface-2:#F3F7F5; --ink:#12201B; --muted:#5B6B65; --line:#D6E0DB;
  --accent:#1F8A5B; --accent-ink:#FFFFFF; --flame:#E8772E; --ice:#2F84D0; --danger:#D6456B;
  --shadow:0 1px 2px rgba(18,32,27,.06),0 8px 24px rgba(18,32,27,.06);
  --cell-empty:#DDE6E1; --sky:#E3F1EA; --soil:#7A5236;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0D1512; --surface:#16211D; --surface-2:#1C2924; --ink:#E4EEE9; --muted:#93A59E; --line:#26352F;
    --accent:#3BB47E; --accent-ink:#06130D; --flame:#F2944F; --ice:#6CB4F0; --danger:#F07393;
    --shadow:0 1px 2px rgba(0,0,0,.3); --cell-empty:#23312B; --sky:#1B2B25; --soil:#5E412C;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0D1512; --surface:#16211D; --surface-2:#1C2924; --ink:#E4EEE9; --muted:#93A59E; --line:#26352F;
  --accent:#3BB47E; --accent-ink:#06130D; --flame:#F2944F; --ice:#6CB4F0; --danger:#F07393;
  --shadow:0 1px 2px rgba(0,0,0,.3); --cell-empty:#23312B; --sky:#1B2B25; --soil:#5E412C;
}
*{box-sizing:border-box}
body{background:var(--bg);color:var(--ink);font-family:"Manrope",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
.app{max-width:440px;margin:0 auto;padding-inline:16px;padding-block:20px 120px;display:flex;flex-direction:column;gap:18px}
.view{display:flex;flex-direction:column;gap:18px}
h1,h2,.display{font-family:"Unbounded","Manrope",system-ui,sans-serif;font-weight:700;letter-spacing:-.01em;text-wrap:balance;margin:0}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.num{font-variant-numeric:tabular-nums}
.ico{width:1em;height:1em;flex:none}

/* header */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.top .date{color:var(--muted);font-size:13px}
.top .date::first-letter{text-transform:uppercase}
.top h1{font-size:22px;margin-top:2px}
.top .chips-row{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;padding:4px 9px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow)}
.pill.ice{color:var(--ice)}
.pill.xp{color:var(--accent)}
.ring{position:relative;width:64px;height:64px;flex:none}
.ring svg{transform:rotate(-90deg)}
.ring .lbl{position:absolute;inset:0;display:grid;place-items:center;font-family:"Unbounded",sans-serif;font-size:13px;font-weight:700}
.ring circle{fill:none;stroke-width:6}
.ring .track{stroke:var(--cell-empty)}
.ring .bar{stroke:var(--accent);stroke-linecap:round;transition:stroke-dashoffset .5s cubic-bezier(.2,.8,.2,1)}

/* garden */
.garden{display:flex;align-items:center;gap:14px;background:var(--surface);border-radius:20px;padding:12px 16px 12px 12px;box-shadow:var(--shadow)}
.garden .pot{width:92px;height:92px;flex:none;border-radius:16px;background:var(--sky);display:grid;place-items:center;overflow:hidden}
.garden .pot svg{width:92px;height:92px}
.garden .g-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.garden .k{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700}
.garden b{font-family:"Unbounded",sans-serif;font-size:16px}
.xpbar{height:8px;border-radius:4px;background:var(--cell-empty);overflow:hidden}
.xpbar i{display:block;height:100%;background:var(--accent);border-radius:4px;transition:width .5s}
.garden .hint{font-size:12.5px;color:var(--muted)}
.garden .hint.warn{color:var(--flame);font-weight:600}
.sway{transform-origin:60px 92px;animation:sway 4s ease-in-out infinite}
@keyframes sway{50%{transform:rotate(1.6deg)}}
.grow{animation:grow .7s cubic-bezier(.2,1.4,.4,1)}
@keyframes grow{from{transform:scale(.6);opacity:.3}}

/* week strip */
.week{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.day{border:0;background:var(--surface);border-radius:14px;padding:8px 0 10px;display:flex;flex-direction:column;align-items:center;gap:4px;box-shadow:var(--shadow)}
.day .wd{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.day .dn{font-weight:700;font-size:15px}
.day .dot{width:6px;height:6px;border-radius:50%;background:var(--cell-empty)}
.day .dot.part{background:color-mix(in srgb,var(--accent) 45%,var(--cell-empty))}
.day .dot.full{background:var(--accent)}
.day .dot.frz{background:var(--ice)}
.day[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.day[aria-pressed="true"] .wd{color:inherit;opacity:.7}
.day:disabled{opacity:.4;cursor:default;box-shadow:none;background:transparent}

.note{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:var(--muted);background:var(--surface-2);border:1px dashed var(--line);border-radius:12px;padding:10px 12px}
.note button{border:0;background:none;color:var(--accent);font-weight:700;padding:4px;flex:none}
.freeze{display:flex;align-items:center;gap:12px;background:color-mix(in srgb,var(--ice) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--ice) 35%,transparent);border-radius:16px;padding:12px 14px}
.freeze .fi{font-size:26px;color:var(--ice);display:grid}
.freeze p{margin:0;flex:1;font-size:13px}
.freeze p b{display:block;font-size:14px}
.freeze button{border:0;background:var(--ice);color:#fff;font-weight:700;border-radius:10px;padding:8px 12px;font-size:13px;flex:none}
.freeze button.ghost{background:none;color:var(--ice);padding:8px 4px}

/* habits */
.sec-h{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.sec-h h2{font-size:15px}
.sec-h span{font-size:13px;color:var(--muted)}
.list{display:flex;flex-direction:column;gap:10px}
.habit{display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:18px;padding:12px;box-shadow:var(--shadow)}
.ic{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;flex:none;background:color-mix(in srgb,var(--c) 16%,transparent);color:var(--c)}
.ic svg{width:22px;height:22px}
.habit .body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.habit .name{font-weight:700;font-size:15px;overflow-wrap:anywhere}
.habit .meta{font-size:12.5px;color:var(--muted);display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.streak{display:inline-flex;align-items:center;gap:3px;color:var(--flame);font-weight:700}
.streak svg{width:13px;height:13px}
.tag{display:inline-flex;align-items:center;gap:3px;font-weight:700;color:var(--c)}
.linkbtn{border:0;background:none;padding:0;color:var(--accent);font-weight:700;font-size:12.5px;display:inline-flex;align-items:center;gap:3px}
.check{width:40px;height:40px;border-radius:50%;border:2px solid var(--line);background:transparent;display:grid;place-items:center;flex:none;transition:background .2s,border-color .2s,transform .2s}
.check svg{width:20px;height:20px;stroke:#fff;opacity:0;transform:scale(.5);transition:.2s}
.habit.done .check{background:var(--c);border-color:var(--c)}
.habit.done .check svg{opacity:1;transform:none}
.habit.done .name{text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--ink) 35%,transparent)}
.check:active{transform:scale(.88)}
.empty{text-align:center;color:var(--muted);padding:28px 12px;background:var(--surface);border-radius:18px}

.quote{background:var(--ink);color:var(--bg);border-radius:18px;padding:16px 18px;display:flex;flex-direction:column;gap:6px}
.quote .k{font-size:11px;letter-spacing:.1em;text-transform:uppercase;opacity:.65}
.quote p{margin:0;font-family:"Unbounded",sans-serif;font-weight:500;font-size:15px;line-height:1.4}

/* challenges */
.ch{background:var(--surface);border-radius:20px;padding:14px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.ch-h{display:flex;align-items:center;gap:12px}
.ch-h .t{flex:1;min-width:0}
.ch-h .t b{display:block;font-size:15px}
.ch-h .t span{font-size:12.5px;color:var(--muted)}
.ch .join{border:0;background:var(--accent);color:var(--accent-ink);font-weight:700;border-radius:12px;padding:9px 14px;font-size:13px;flex:none}
.prog{display:flex;flex-direction:column;gap:6px}
.prog .row{display:flex;justify-content:space-between;font-size:12.5px;color:var(--muted)}
.prog .row b{color:var(--ink)}
.board{display:flex;flex-direction:column;gap:2px;border-top:1px solid var(--line);padding-top:8px}
.board .p{display:flex;align-items:center;gap:10px;padding:6px 4px;border-radius:10px;font-size:14px}
.board .p.me{background:var(--surface-2);font-weight:700}
.board .pos{width:18px;text-align:center;color:var(--muted);font-weight:700;font-size:12.5px}
.av{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700;color:#fff;flex:none}
.board .nm{flex:1;min-width:0}
.board .sc{font-weight:700}
.ch-actions{display:flex;gap:8px;flex-wrap:wrap}
.btn2{border:1px solid var(--line);background:var(--surface-2);border-radius:12px;padding:9px 12px;font-weight:700;font-size:13px;display:inline-flex;align-items:center;gap:6px}
.btn2.primary-s{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.muted-s{font-size:12px;color:var(--muted)}

/* stats */
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{background:var(--surface);border-radius:16px;padding:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px}
.stat b{font-family:"Unbounded",sans-serif;font-size:20px}
.stat span{font-size:12px;color:var(--muted)}
.chart{background:var(--surface);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.bars{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;align-items:end;height:120px;margin-top:12px}
.bars .col{display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end}
.bars .b{width:100%;max-width:28px;border-radius:8px 8px 4px 4px;background:var(--accent);min-height:4px}
.bars .b.zero{background:var(--cell-empty)}
.bars .v,.bars .l{font-size:11px;color:var(--muted)}
.bars .l{text-transform:uppercase}
.badges{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.badge{background:var(--surface);border-radius:16px;padding:12px 8px;box-shadow:var(--shadow);display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.badge .bi{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--c) 18%,transparent);color:var(--c)}
.badge .bi svg{width:22px;height:22px}
.badge b{font-size:12.5px;line-height:1.25}
.badge span{font-size:11px;color:var(--muted);line-height:1.3}
.badge.off{box-shadow:none;background:var(--surface-2)}
.badge.off .bi{background:var(--cell-empty);color:var(--muted)}
.badge.off b{color:var(--muted)}
.hm{background:var(--surface);border-radius:18px;padding:14px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:10px}
.hm-h{display:flex;align-items:center;gap:10px}
.hm-h .ic{width:32px;height:32px;border-radius:10px}
.hm-h .ic svg{width:17px;height:17px}
.hm-h .t{flex:1;min-width:0}
.hm-h .t b{display:block;font-size:14px}
.hm-h .t span{font-size:12px;color:var(--muted)}
.hm-h .pct{font-family:"Unbounded",sans-serif;font-weight:700;font-size:14px}
.grid{display:grid;grid-template-columns:repeat(15,1fr);gap:4px}
.grid i{aspect-ratio:1;border-radius:4px;background:var(--cell-empty);max-width:100%}
.grid i.on{background:var(--c)}
.grid i.frz{background:color-mix(in srgb,var(--ice) 45%,var(--cell-empty))}
.grid i.today{outline:1.5px solid var(--ink);outline-offset:1px}
.hm-f{display:flex;justify-content:space-between;align-items:center}
.del{border:0;background:none;color:var(--muted);font-size:12.5px;padding:2px 0}
.del.arm{color:var(--danger);font-weight:700}

/* tab bar */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:5;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));display:flex;justify-content:center;pointer-events:none}
.tabs-in{pointer-events:auto;width:100%;max-width:408px;display:flex;align-items:center;gap:4px;background:var(--surface);border-radius:22px;padding:6px;box-shadow:0 10px 30px rgba(0,0,0,.14);border:1px solid var(--line)}
.tab{flex:1;border:0;background:none;border-radius:16px;padding:7px 2px;display:flex;flex-direction:column;align-items:center;gap:2px;font-weight:700;font-size:11px;color:var(--muted);position:relative}
.tab svg{width:20px;height:20px}
.tab[aria-selected="true"]{background:var(--surface-2);color:var(--ink)}
.tab .badge-dot{position:absolute;top:5px;right:calc(50% - 16px);width:8px;height:8px;border-radius:50%;background:var(--flame)}
.fab{flex:none;width:52px;height:48px;border-radius:16px;border:0;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center}
.fab svg{width:22px;height:22px}

/* sheets */
.scrim{position:fixed;inset:0;background:rgba(6,12,10,.5);z-index:10;display:flex;align-items:flex-end;justify-content:center}
.sheet{width:100%;max-width:440px;max-height:92vh;overflow-y:auto;background:var(--surface);border-radius:24px 24px 0 0;padding:10px 16px calc(20px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:16px;animation:up .28s cubic-bezier(.2,.8,.2,1)}
@keyframes up{from{transform:translateY(40px);opacity:.4}}
.grab{width:40px;height:4px;border-radius:2px;background:var(--line);align-self:center;flex:none}
.sheet h2{font-size:18px}
.field{display:flex;flex-direction:column;gap:6px}
.field label,.flabel{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.06em}
.field input{font:inherit;font-size:16px;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips button{width:44px;height:44px;border-radius:12px;border:2px solid transparent;background:var(--surface-2);display:grid;place-items:center}
.chips button svg{width:20px;height:20px}
.chips button[aria-pressed="true"]{border-color:var(--ink)}
.chips.col button{border-radius:50%;width:36px;height:36px}
.sugs{display:flex;flex-wrap:wrap;gap:6px}
.sugs button{border:1px solid var(--line);background:none;border-radius:999px;padding:6px 12px;font-size:13px}
.primary{border:0;background:var(--accent);color:var(--accent-ink);font-weight:700;border-radius:14px;padding:14px;font-size:15px}
.err{color:var(--danger);font-size:12.5px;margin:0}
.share-img{width:min(100%,260px);align-self:center;border-radius:18px;box-shadow:0 12px 32px rgba(0,0,0,.2);aspect-ratio:9/16;background:var(--surface-2)}
.copybox{font:inherit;font-size:14px;width:100%;min-height:78px;resize:none;padding:12px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink)}
.row2{display:flex;gap:8px}
.row2>*{flex:1}

.toast{position:fixed;left:50%;bottom:100px;transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:600;font-size:13.5px;z-index:20;max-width:calc(100% - 32px);text-align:center}
#fx{position:fixed;inset:0;pointer-events:none;z-index:30;width:100%;height:100%}
@media (prefers-reduced-motion: reduce){*{transition:none!important;animation:none!important}}

/* --- Mini App qo'shimchalari --- */
.top-actions{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.icon-btn{border:0;background:var(--surface);box-shadow:var(--shadow);width:36px;height:36px;border-radius:12px;display:grid;place-items:center;color:var(--muted)}
.icon-btn svg{width:18px;height:18px}
.center{min-height:70vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center;padding-inline:8px}
.center h1{font-size:22px}
.center p{margin:0;color:var(--muted);max-width:32ch}
.spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--cell-empty);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.onboard{background:var(--surface);border-radius:20px;padding:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.onboard h2{font-size:16px}
.onboard p{margin:0;font-size:13px;color:var(--muted)}
.tpl{display:flex;flex-direction:column;gap:8px}
.tpl button{display:flex;align-items:center;gap:12px;border:1px solid var(--line);background:var(--surface-2);border-radius:14px;padding:8px 12px 8px 8px;text-align:left;font-weight:600}
.tpl button .ic{width:36px;height:36px;border-radius:11px}
.tpl button .ic svg{width:18px;height:18px}
.tpl button .plus{margin-left:auto;color:var(--accent);font-size:20px;line-height:1}
.tpl button:disabled{opacity:.5}
.select,.time{font:inherit;font-size:16px;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);width:100%}
.switch{display:flex;align-items:center;justify-content:space-between;gap:12px;font-weight:600}
.switch input{width:46px;height:28px;accent-color:var(--accent)}
.busy{opacity:.6;pointer-events:none}
#freezeBox:empty,#onboard:empty{display:none}
