/* stats page (stats.js): a dialog holding a grid of independent cards */
dialog.stdlg{width:min(1040px,96vw);max-height:92vh;background:var(--bg)}
.stdlg form>.wh{margin-right:34px}
.stgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));grid-auto-flow:row dense;gap:12px}
.stcard{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;min-width:0}
.stcard.wide{grid-column:span 2}
.stcard h4{margin:0;font-size:13px;font-weight:600;color:var(--mut)}
.stmut{margin:0;color:var(--mut);font-size:12.5px;line-height:1.45}
.stbig{font-size:28px;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}
.strow{display:flex;align-items:baseline;gap:8px;font-size:14px}.strow span{flex:1;color:var(--mut)}.strow b{font-variant-numeric:tabular-nums}.strow small{color:var(--mut);min-width:34px;text-align:right}
.stfocus{display:flex;align-items:center;gap:14px}.stfocus>div{display:flex;flex-direction:column}.stfocus small{color:var(--mut);font-size:12px}
.string{width:72px;height:72px;flex:none}.string .rt{fill:none;stroke:var(--soft);stroke-width:7}.string .rf{fill:none;stroke:var(--acc);stroke-width:7;stroke-linecap:round}.string.met .rf{stroke:#3aa36b}
.stchart{width:100%;height:auto;display:block;overflow:visible}
.stchart .stgl{stroke:var(--line);stroke-width:1}
.stchart .stbase{stroke:var(--mut);stroke-width:1;opacity:.5}
.stax{fill:var(--mut);font-size:11px}.stax.sttoday{fill:var(--fg);font-weight:700}
.stbars{opacity:.8}.stbars.sttoday{opacity:1}
.stseg2{shape-rendering:crispEdges}
.stax.stv{font-size:10.5px;fill:var(--fg);opacity:.75}
.stgoal{stroke:var(--fg);stroke-width:2;stroke-dasharray:3 3;opacity:.45}
.sthit{outline:none}.sthit:hover .stbars,.sthit:focus .stbars{opacity:1}.sthit:hover .stbg,.sthit:focus .stbg{fill:var(--soft)}
.stkey{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12px;color:var(--mut)}.stkey span{display:flex;align-items:center;gap:6px}
.stkey .kb{width:10px;height:10px;border-radius:3px;background:var(--acc)}.stkey .kc{width:10px;height:10px;border-radius:3px;background:var(--c)}.stkey .kg{width:14px;border-top:2px dashed var(--fg);opacity:.45}
.stdonut{display:flex;align-items:center;gap:12px}.stdonut svg{width:104px;height:104px;flex:none}
.stseg{fill:none;stroke-width:16}
.stdt{fill:var(--fg);font-size:17px;font-weight:700}
.stleg{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;min-width:0;flex:1;font-size:13px}
.stleg li{display:flex;align-items:center;gap:7px}.stleg i{width:10px;height:10px;border-radius:50%;background:var(--c);flex:none}
.stleg span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stleg b{font-variant-numeric:tabular-nums}.stleg small{color:var(--mut);width:30px;text-align:right;font-size:11px}
.sttask{display:flex;flex-direction:column;gap:5px}
.stmeter{height:8px;border-radius:4px;background:var(--soft);overflow:hidden}.stmeter i{display:block;height:100%;background:var(--acc);border-radius:4px}
.ststreak{display:flex;align-items:baseline;gap:8px}.ststreak span{color:var(--mut)}
.stlist{display:flex;flex-direction:column;gap:7px;border-top:1px solid var(--line);padding-top:10px}
.stlist .strow{font-size:13px}.stup{color:#3aa36b}.stdown{color:var(--mut)}.stoff{opacity:.7}
/* tasks: done of planned per day */
.stdays{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-top:auto;padding-top:4px}
.stday{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px;color:var(--mut)}.stday b{font-weight:600;color:var(--fg);font-variant-numeric:tabular-nums;font-size:11px}
.sttrack{width:100%;max-width:26px;height:44px;border-radius:5px;background:var(--soft);display:flex;align-items:flex-end;overflow:hidden}.sttrack i{display:block;width:100%;background:var(--acc);border-radius:4px 4px 0 0}
.stday.sttoday small{color:var(--fg);font-weight:700}.stday.fut{opacity:.55}
/* streak: last four weeks */
.stheat{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-top:auto}.stheat small{font-size:10.5px;color:var(--mut);text-align:center}
.stheat i,.sthk i{height:18px;border-radius:4px;background:var(--soft)}.sthk i{display:inline-block;width:10px;height:10px;border-radius:3px;vertical-align:-1px}
.stheat i.l1,.sthk i.l1{background:color-mix(in srgb,var(--acc) 22%,var(--soft))}.stheat i.l2,.sthk i.l2{background:color-mix(in srgb,var(--acc) 45%,var(--soft))}
.stheat i.l3,.sthk i.l3{background:color-mix(in srgb,var(--acc) 70%,var(--soft))}.stheat i.on,.sthk i.on{background:var(--acc)}
.stheat i.fut{background:none;border:1px dashed var(--line)}.stheat i.sttoday{outline:2px solid var(--fg);outline-offset:1px}
.sthk{display:flex;align-items:center;gap:3px;margin-left:auto}
/* pushed back & taken off */
.stsplit{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:16px;align-items:start}.stsplit>div:first-child{display:flex;flex-direction:column;gap:12px}
.stside{display:flex;flex-direction:column;gap:10px}
.sttiles{display:flex;flex-direction:column;gap:6px}
.sttile{background:var(--soft);border-radius:10px;padding:7px 10px;display:flex;align-items:center;gap:10px;min-width:0}
.sttile i{flex:none;width:10px;height:10px;border-radius:3px;background:var(--c)}.sttile>div{flex:1;display:flex;flex-direction:column;min-width:0}
.sttile b{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}.sttile span{font-size:13px;font-weight:600}.sttile small{font-size:11.5px;color:var(--mut)}
.stmost{display:flex;flex-direction:column;gap:5px}.stmost>small{color:var(--mut);font-size:12px}
.stmost .strow span{color:var(--fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.stdot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--c);margin-right:6px}
.stempty{padding:30px 0;text-align:center}
/* highlights */
.sthi{display:grid;grid-template-columns:1fr 1fr;gap:14px 12px}
.sthi>div{display:flex;gap:9px;min-width:0}.sthi>div>div{display:flex;flex-direction:column;min-width:0}
.stic{flex:none;width:28px;height:28px;border-radius:8px;background:var(--soft);display:grid;place-items:center;font-size:13px;color:var(--mut)}
.sthi small{color:var(--mut);font-size:11.5px}.sthi b{font-size:17px;font-weight:700;font-variant-numeric:tabular-nums}
.sthi em{font-style:normal;color:var(--mut);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* planned vs actual, top tasks */
.stmeter i.pl{background:var(--mut);opacity:.45}
.sttop{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
.sttop .strow{font-size:13px}.sttop .strow span{color:var(--fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.sttop .stmeter{height:6px}
@media (max-width:700px){
  dialog.stdlg{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0;border:0;padding:max(14px,env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom))}
  .stgrid{grid-template-columns:1fr}.stcard.wide{grid-column:auto}
  .stsplit{grid-template-columns:1fr}
  #statsBtn{min-width:28px;padding:0 4px}
}
.stheat i.rest{background:repeating-linear-gradient(135deg,var(--soft) 0 4px,color-mix(in srgb,#5fae94 30%,var(--soft)) 4px 7px)}
/* Overview / Charts tabs, the full-width score strip, same-day share */
.sttabs{margin:-2px 0 12px}
.stcard.full{grid-column:1/-1}
.sthi.one{grid-template-columns:1fr}
.sttrack{flex-direction:column;justify-content:flex-end}.sttrack i{border-radius:0;flex:none}.sttrack i.same{background:color-mix(in srgb,var(--acc) 45%,var(--soft))}
.stsame{font-size:13px}.stsame span{display:flex;align-items:center;gap:6px}.stsw{width:10px;height:10px;border-radius:3px;background:color-mix(in srgb,var(--acc) 45%,var(--soft))}
.khead{display:flex;align-items:center;gap:6px;margin-top:-4px}.khead small{color:var(--mut);font-size:12px;flex:1}
.ktiles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.ktile{background:var(--soft);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;min-width:0}
.kn{display:flex;align-items:center;gap:4px;font-size:12.5px;font-weight:600;color:var(--mut)}.kn span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kv{font-size:26px;font-weight:700;line-height:1.05;font-variant-numeric:tabular-nums}.kv.none{color:var(--mut)}
.kd{font-size:11.5px;color:var(--mut);line-height:1.35}.kd.stup{color:#3aa36b}
.ktile .stmeter{height:6px;background:color-mix(in srgb,var(--fg) 8%,transparent)}
.kib{border:0;background:none;color:var(--mut);font-size:13px;line-height:1;padding:3px 4px;border-radius:6px;cursor:pointer}.kib:hover{color:var(--acc);background:var(--panel)}
.kdial{position:relative;height:8px;border-radius:4px;background:linear-gradient(90deg,color-mix(in srgb,var(--acc) 25%,var(--soft)),color-mix(in srgb,#d4a052 45%,var(--soft)))}
.kband{position:absolute;top:-3px;bottom:-3px;border-radius:5px;background:color-mix(in srgb,var(--fg) 14%,transparent)}
.kmark{position:absolute;top:-4px;width:4px;height:16px;margin-left:-2px;border-radius:2px;background:var(--fg)}
.kends{display:flex;justify-content:space-between;margin-top:-3px}.kends small{font-size:10.5px;color:var(--mut)}
dialog.kpidlg{width:min(620px,94vw);max-height:88vh}
.kinfo{display:flex;flex-direction:column;gap:14px}.krules{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--mut);line-height:1.45}
.kitem{border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:6px;scroll-margin-top:8px;transition:box-shadow .3s}
.kitem.flash{box-shadow:0 0 0 2px var(--acc)}
.kitem summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:1fr auto;gap:2px 10px;align-items:center}.kitem summary::-webkit-details-marker{display:none}
.kitem summary::after{content:'›';grid-column:2;grid-row:1/span 2;font-size:20px;color:var(--mut);transition:transform .2s;transform:rotate(90deg)}.kitem[open] summary::after{transform:rotate(-90deg)}
.kitem summary .kq{grid-column:1}.kitem[open]>summary{margin-bottom:4px}
.kitem h4{margin:0;font-size:15px}.kitem p{margin:0;font-size:13px;line-height:1.45}.kq{font-weight:600}
.kitem dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:4px 10px;font-size:13px;line-height:1.45}.kitem dt{color:var(--mut)}.kitem dd{margin:0}
.kf{display:flex;flex-direction:column;gap:4px}.kf code{font-size:12px;background:var(--soft);border-radius:6px;padding:5px 8px;white-space:normal;line-height:1.5}
@media (max-width:900px){.ktiles{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:700px){.ktiles{grid-template-columns:repeat(2,minmax(0,1fr))}.ktile.kstyle{grid-column:1/-1}.stcard.full{grid-column:auto}}
/* weekly review (review.js) */
dialog.rvdlg{width:min(560px,94vw)}
#rvBody{display:flex;flex-direction:column;gap:12px}#rvBody h3{margin:0 40px 0 0}#rvBody>p{margin:-8px 0 0}#rvBody h4{margin:4px 0 -4px;font-size:13px;color:var(--mut)}
.rvscores{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.rvs{position:relative;background:var(--soft);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;min-width:0}
.rvs small{font-size:11px;color:var(--mut);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:14px}.rvs b{font-size:22px;font-variant-numeric:tabular-nums}.rvs em{font-style:normal;font-size:11px;color:var(--mut)}.rvs em.stup{color:#3aa36b}
.rvs .kib{position:absolute;top:4px;right:2px}
.rvnums{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.rvnums>div{border:1px solid var(--line);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column}
.rvnums small,.rvnums em{font-size:11.5px;color:var(--mut);font-style:normal}.rvnums b{font-size:17px}
.rvlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:13.5px}.rvlist li{display:flex;align-items:center;gap:2px}.rvlist small{margin-left:auto;color:var(--mut);font-size:12px}
.rvtip{border-radius:12px;padding:10px 12px;background:color-mix(in srgb,var(--acc) 10%,var(--panel));display:flex;flex-direction:column;gap:4px}.rvtip p{margin:0;font-size:13.5px;line-height:1.45}.rvtip button{align-self:flex-start}
.rvbtn{margin-left:auto}
@media (max-width:700px){.rvscores{grid-template-columns:repeat(3,minmax(0,1fr))}.rvbtn{margin-left:0}}
