:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --sunk: #EDEAE3;
  --ink: #1B1D1C;
  --ink-2: #4A4E4C;
  --muted: #8A8E8B;
  --faint: #B7BAB6;
  --line: rgba(27, 29, 28, 0.08);
  --primary: #1B1D1C;
  --on-primary: #F6F4EF;
  --weak: #C4533A;
  --conf: #CCA52A;
  --maint: #2F8A68;
  --none: #D6D2C9;
  --leaf: #4C9A5E;
  --wilt: #B8975A;
  --trunk: #8B6B4E;
  --soil: #E3DED3;
  --bloom: #E8B84A;
  --olive: #4E4466;
  --birch: #ECE9E1;
  --sky: #EEF2EA;
  --meadow: #E5EAD8;
  --meadow-2: #DDE4CC;
  --grass: #B9C6A0;
  --r: 18px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #111111;
    --sunk: #1C1C1C;
    --ink: #F2F2F0;
    --ink-2: #C2C2BF;
    --muted: #858583;
    --faint: #4A4A48;
    --line: rgba(255, 255, 255, 0.08);
    --primary: #F2F2F0;
    --on-primary: #000000;
    --weak: #CC4840;
    --conf: #AE9128;
    --maint: #2A9C7A;
    --none: #2A2A2A;
    --leaf: #45A766;
    --wilt: #9C8150;
    --trunk: #8E7055;
    --soil: #1E1E1C;
    --bloom: #E2B24A;
    --olive: #6E5F8C;
    --birch: #CFCBC0;
    --sky: #0A0D0B;
    --meadow: #101611;
    --meadow-2: #131B14;
    --grass: #26382A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #000000;
    --surface: #111111;
    --sunk: #1C1C1C;
    --ink: #F2F2F0;
    --ink-2: #C2C2BF;
    --muted: #858583;
    --faint: #4A4A48;
    --line: rgba(255, 255, 255, 0.08);
    --primary: #F2F2F0;
    --on-primary: #000000;
    --weak: #CC4840;
    --conf: #AE9128;
    --maint: #2A9C7A;
    --none: #2A2A2A;
    --leaf: #45A766;
    --wilt: #9C8150;
    --trunk: #8E7055;
    --soil: #1E1E1C;
    --bloom: #E2B24A;
    --olive: #6E5F8C;
    --birch: #CFCBC0;
    --sky: #0A0D0B;
    --meadow: #101611;
    --meadow-2: #131B14;
    --grass: #26382A;
    color-scheme: dark;
}

/* Hide scrollbars everywhere (still scrollable) */
html, body, .sheet { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .sheet::-webkit-scrollbar { display: none; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
svg { display: block; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.view {
  padding: calc(env(safe-area-inset-top, 0px) + 32px) 20px calc(var(--tab-h) + var(--safe-b) + 48px);
}

/* ---------- Header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; margin: 4px 0 0; }
.head-action { font-size: 14px; font-weight: 500; padding: 8px 16px; border-radius: 99px; background: var(--sunk); margin-bottom: 2px; transition: background .2s, color .2s; }
.head-action.on { background: var(--primary); color: var(--on-primary); }

.progress { margin: -8px 0 34px; }
.progress-text { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.progress-text span:last-child { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .6s cubic-bezier(.2,.8,.2,1), background .3s; }
.progress.complete .bar i { background: var(--maint); }
.progress.complete .progress-text span:last-child { color: var(--maint); }

/* ---------- Blocks ---------- */
.block { margin-bottom: 30px; }
.label { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.label em { font-style: normal; color: var(--muted); font-weight: 400; }
.label .r { margin-left: auto; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot.weak { background: var(--weak); }
.dot.conf { background: var(--conf); }
.dot.maint { background: var(--maint); }
.dot.none { background: var(--none); }
.skip { margin: 0 4px; font-size: 14px; color: var(--muted); }

.card { background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); }

/* Revision modes */
.mode-banner { padding: 17px 18px; margin-bottom: 28px; border: 1px solid var(--line); border-left: 3px solid var(--weak); border-radius: 14px; background: var(--surface); }
.mode-banner.maint { border-left-color: var(--maint); }
.mode-heading { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.mode-heading svg { width: 19px; height: 19px; fill: none; stroke: var(--weak); stroke-width: 1.6; flex: none; }
.mode-banner.maint svg { stroke: var(--maint); }
.mode-heading .link { margin-left: auto; font-size: 12px; font-weight: 500; }
.mode-banner p { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.mode-paused { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.mode-description { padding: 18px; }
.mode-description h2 { font-family: var(--serif); font-size: 23px; font-weight: 500; margin: 0 0 8px; }
.mode-description p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.6; }
.mode-description .fine { font-size: 12px; color: var(--muted); margin-top: 10px; }
.mode-settings .seg { margin-bottom: 12px; }
.paused-note { margin: -4px 4px 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
button:focus-visible { outline: 2px solid var(--maint); outline-offset: 3px; }

/* Focus card (strengthening) */
.focus { padding: 20px; }
.f-head { display: block; width: 100%; text-align: left; }
.f-title { font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }
.f-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.segs { display: flex; gap: 4px; margin: 20px 0 16px; }
.segs span { flex: 1; height: 3px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.segs i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--weak); border-radius: 3px; transition: width .7s cubic-bezier(.2,.8,.2,1) .1s; }
.note { font-size: 14px; color: var(--ink-2); margin: 0 0 18px; line-height: 1.5; }
.note b { color: var(--ink); font-weight: 600; }
.note:last-child { margin-bottom: 0; }
.ok svg { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; stroke: var(--maint); fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 50px; border-radius: 14px;
  background: var(--primary); color: var(--on-primary);
  font-weight: 500; font-size: 15px;
  transition: transform .15s ease, opacity .15s;
}
.btn:active { transform: scale(.985); opacity: .9; }
.btn.danger { background: var(--weak); color: #fff; }
.links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; color: var(--faint); font-size: 14px; }
.link { color: var(--muted); font-size: 14px; font-weight: 500; padding: 4px 2px; transition: color .15s; }
.link:active { color: var(--ink); }
.link.red { color: var(--weak); }

/* Lists */
.list .item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; position: relative; min-height: 62px; }
.list .item + .item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.item-main { flex: 1; min-width: 0; text-align: left; }
.t { font-size: 15px; font-weight: 500; color: var(--ink); transition: color .2s; }
.s { font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta.due { color: var(--ink); font-weight: 500; }
.item.done .t { color: var(--muted); }

.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; flex: none; transition: background .2s, border-color .2s, transform .15s; }
.check:active { transform: scale(.88); }
.check svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: all .2s; }
.check.on { border-color: transparent; }
.check.on.weak { background: var(--weak); }
.check.on.conf { background: var(--conf); }
.check.on.maint { background: var(--maint); }
.check.on svg { opacity: 1; transform: none; }
.tag { font-size: 12px; font-weight: 600; color: var(--ink); padding: 5px 10px; border-radius: 99px; background: color-mix(in srgb, var(--conf) 14%, transparent); }

/* Onboarding */
.onboard { text-align: center; padding: 56px 8px 0; }
.onboard .mark { font-size: 42px; color: var(--faint); font-family: var(--serif); line-height: 1; }
.onboard h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -0.015em; margin: 18px 0 8px; }
.onboard p { color: var(--muted); margin: 0 auto 30px; max-width: 290px; }
.onboard .link { margin-top: 16px; }

/* ---------- Segmented ---------- */
.seg { display: flex; position: relative; background: var(--sunk); border-radius: 12px; padding: 3px; margin-bottom: 18px; }
.seg-ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 9px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); transition: transform .5s cubic-bezier(.3, 1.2, .5, 1); }
.seg button { flex: 1; position: relative; z-index: 1; height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; transition: color .3s; }
.seg button.on { color: var(--ink); }
.seg .n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.seg button.on .n { color: var(--muted); }
.seg.disabled { opacity: .4; pointer-events: none; }
.desc { font-size: 13.5px; color: var(--muted); margin: 0 4px 16px; line-height: 1.5; }

/* Queues */
.pos { width: 18px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; flex: none; }
.pos.cur { color: var(--weak); font-weight: 600; }
.now { font-size: 13px; color: var(--weak); font-weight: 500; white-space: nowrap; }
.arrows { display: flex; margin-right: -8px; }
.arrows button { width: 32px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: background .15s; }
.arrows button:active { background: var(--sunk); }
.arrows button:disabled { opacity: .25; }
.arrows svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; padding: 44px 20px; }
.empty h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 6px; }
.empty p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Map ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); margin: -4px 2px 24px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.forest { padding: 0; overflow: hidden; }
.scene { display: block; width: 100%; height: auto; }
.scene .grass { stroke: var(--grass); stroke-width: 0.9; stroke-linecap: round; fill: none; }
.ftree { cursor: pointer; outline: none; transition: opacity .2s; }
.ftree:active, .ftree:focus-visible { opacity: .7; }
.tree-big { width: 132px; margin: -6px auto 4px; }
.tree-big svg { width: 100%; display: block; overflow: visible; }
.opts .t .dot { margin-right: 8px; vertical-align: 1px; }
.legend b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.map-hint { font-size: 13px; color: var(--muted); margin: -12px 2px 20px; }
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 10px; }
.juz { min-width: 0; }
.jn { font-size: 11.5px; color: var(--muted); margin: 0 0 6px 2px; font-variant-numeric: tabular-nums; }
.halves { display: flex; gap: 3px; }
.half { flex: 1; height: 36px; position: relative; transition: transform .15s, box-shadow .15s, background .2s; }
.half:first-child { border-radius: 9px 3px 3px 9px; }
.half:last-child { border-radius: 3px 9px 9px 3px; }
.half:active { transform: scale(.92); }
.half.weak { background: var(--weak); }
.half.conf { background: var(--conf); }
.half.maint { background: var(--maint); }
.half.none { background: var(--sunk); }
.half.sel { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.half.cur::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fff; }

.selbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + var(--safe-b) + 22px);
  width: calc(min(480px, 100vw) - 32px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 12px; z-index: 30;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
  animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translate(-50%, 16px); opacity: 0; } }
.selbar.out { animation: sink .25s ease forwards; pointer-events: none; }
@keyframes sink { to { transform: translate(-50%, 16px); opacity: 0; } }
.sb-top { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 10px; font-size: 13px; color: var(--muted); }
.sb-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sb-acts button { background: var(--sunk); border-radius: 12px; padding: 11px 4px 10px; font-size: 12px; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 7px; transition: opacity .25s, transform .15s; }
.sb-acts button:active { transform: scale(.95); }
.sb-acts button:disabled { opacity: .4; }
.sb-acts .dot { width: 9px; height: 9px; }

/* ---------- Settings ---------- */
.group-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 4px 10px; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; font-size: 18px; line-height: 1; transition: opacity .2s; }
.stepper button:disabled { opacity: .3; }
.stepper span { min-width: 46px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.fixed { min-width: 110px; text-align: center; font-weight: 500; color: var(--muted); }
.list .item.total { min-height: 52px; }
.list .item.total .t { flex: 1; color: var(--muted); font-weight: 400; font-size: 14px; }
.list .item.total .meta { color: var(--ink); font-weight: 500; font-size: 14px; }
.link-row { width: 100%; text-align: left; }
.chev { width: 16px; height: 16px; stroke: var(--faint); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.link-row.red .t { color: var(--weak); }
.foot { text-align: center; font-size: 12.5px; color: var(--faint); margin: 0; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 12px);
  width: calc(min(480px, 100vw) - 32px);
  height: var(--tab-h);
  display: flex; padding: 6px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
  z-index: 20;
}
.tab-ind { position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); border-radius: 16px; background: var(--sunk); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .55s cubic-bezier(.3, 1.25, .5, 1); }
.tab { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--faint); font-size: 10.5px; font-weight: 500; transition: color .2s; }
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab svg { transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.tab.on { color: var(--ink); }
.tab.on svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(.88); }

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 10, 9, .35); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0;
  width: min(480px, 100vw);
  max-height: 88dvh; overflow-y: auto;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(var(--safe-b) + 24px);
  transform: translate(-50%, 105%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  z-index: 50;
}
.sheet.on { transform: translate(-50%, 0); }
.sheet-grip { width: 36px; height: 4px; border-radius: 99px; background: var(--faint); opacity: .6; margin: 4px auto 18px; }
.sh-head { margin: 0 4px 22px; }
.sh-head h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
.sh-head p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.field { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 4px 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin: -10px 4px 18px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin: 6px 4px 12px; }
.kv .item { min-height: 48px; padding: 12px 16px; }
.kv .k { flex: 1; color: var(--muted); font-size: 14px; }
.kv .v { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.actions { margin-top: 20px; }
.opt { width: 100%; text-align: left; }
.opts { margin-bottom: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg);
  padding: 11px 12px 11px 16px; border-radius: 14px;
  display: flex; align-items: center; gap: 14px;
  font-size: 13.5px; font-weight: 500;
  width: max-content; max-width: calc(min(480px, 100vw) - 40px);
  transition: all .3s cubic-bezier(.2,.8,.2,1); z-index: 60;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--bg); font-weight: 700; padding: 2px 6px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Motion ---------- */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }

/* Page entrance: children rise in, staggered, drifting from the tab direction */
.view.enter > * { animation: enter .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.view.enter .list .item, .view.enter-sub .list .item { animation: rise-in .5s var(--ease) both; animation-delay: calc(120ms + var(--k, 0) * 40ms); }
.view.enter-sub .qa { animation: enter .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.view.enter .juz { animation: cell .5s var(--ease) both; animation-delay: calc(140ms + var(--j, 0) * 12ms); }
@keyframes enter { from { opacity: 0; transform: translate(var(--dx, 0), 12px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes cell { from { opacity: 0; transform: scale(.8); } }

/* Sheet contents cascade in when it opens */
.sheet.fresh #sheet-body > * { animation: rise-in .5s var(--ease) both; animation-delay: calc(80ms + var(--i, 0) * 35ms); }

/* Checking something off */
.check.pop { animation: pop .5s cubic-bezier(.3, 1.5, .5, 1); }
.check.pop svg path, .ok.pop svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .4s .12s ease forwards; }
.ok.pop svg { animation: pop .5s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Small value changes */
.bump { display: inline-block; animation: bump .4s cubic-bezier(.3, 1.5, .5, 1); }
.half.bump { animation: bump-half .4s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes bump-half { 40% { transform: scale(1.12); } }

.bar i { transition: width .8s var(--ease) .15s, background .3s; }
.btn, .link, .item-main, .check, .arrows button { -webkit-user-select: none; user-select: none; }
.item-main:active .t { opacity: .6; }

/* Theme switch: circular reveal handled in JS */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------- Account ---------- */
#auth-form { display: flex; flex-direction: column; gap: 10px; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 16px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--line); }
.form-error { min-height: 20px; margin: 0 4px; font-size: 13.5px; color: var(--weak); }
.form-error.shake { animation: shake .4s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
#auth-form .btn:disabled { opacity: .6; }
.fine { font-size: 12.5px; color: var(--muted); margin: 14px 4px 0; line-height: 1.5; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--maint); flex: none; transition: background .3s; }
.sync-dot.syncing { background: var(--conf); animation: breathe 1.2s ease-in-out infinite; }
.sync-dot.offline, .sync-dot.paused { background: var(--faint); }
.sync-dot.error { background: var(--weak); }
@keyframes breathe { 50% { opacity: .35; } }
.onboard .links { margin-top: 16px; }

/* ---------- Forecast & logging ---------- */
.eta { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin: -18px 0 26px; padding: 10px 4px; font-size: 13.5px; color: var(--muted); }
.eta b { color: var(--ink); font-weight: 600; }
.eta .r { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; border-radius: 16px; border: 1.5px dashed var(--faint); color: var(--muted); font-weight: 500; font-size: 14.5px; transition: border-color .2s, color .2s, transform .15s; }
.log-btn:active { transform: scale(.985); color: var(--ink); border-color: var(--ink-2); }
.log-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.log-grid { margin-bottom: 14px; }
.half.rt::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fff; }
.half.none.rt::after { background: var(--muted); }
.half:disabled { opacity: .35; }
.log-key { display: flex; align-items: center; gap: 8px; margin: 0 4px 16px; }
.rt-key { width: 14px; height: 14px; border-radius: 4px; background: var(--maint); position: relative; }
.rt-key::after { content: ""; position: absolute; inset: 4.5px; border-radius: 50%; background: #fff; }
.btn:disabled { opacity: .4; }

/* ---------- Stats ---------- */
.khatm-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.khatm .big { font-family: var(--serif); font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.khatm-sub { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile .k { font-size: 12.5px; color: var(--muted); }
.tile .v { font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -0.015em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12px; color: var(--muted); }
.chart-card { padding: 16px 12px 8px 12px; }
.readout { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.readout b { color: var(--ink); font-weight: 600; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .bar-mark { fill: var(--maint); transition: opacity .2s; }
.chart .bar-mark.sel { stroke: var(--ink); stroke-width: 1.5; }
.chart .bar-zero { fill: var(--line); }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.view.enter .chart .bar-mark, .view.enter-sub .chart .bar-mark { transform-box: fill-box; transform-origin: bottom; animation: grow .6s var(--ease) both; animation-delay: calc(200ms + var(--b, 0) * 25ms); }
@keyframes grow { from { transform: scaleY(0); } }
.kv .k .dot { margin-right: 6px; vertical-align: 1px; }
.list .item > .dot { margin-left: 2px; }

/* ---------- Stats: ranges, calendar, weekdays, frequency ---------- */
:root {
  /* One-hue sequential ramp (more revision = stronger green), mixed from the surface. */
  --heat-0: var(--sunk);
  --heat-1: color-mix(in srgb, var(--maint) 28%, var(--surface));
  --heat-2: color-mix(in srgb, var(--maint) 52%, var(--surface));
  --heat-3: color-mix(in srgb, var(--maint) 76%, var(--surface));
  --heat-4: var(--maint);
}
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.label-row .group-title { margin-bottom: 0; }
.seg.mini { width: 150px; margin: 0; border-radius: 10px; padding: 2px; }
.seg.mini .seg-ind { top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 2)); border-radius: 8px; }
.seg.mini button { height: 28px; font-size: 12.5px; }

.heat { transition: stroke .15s; }
.heat.h0 { fill: var(--heat-0); } .heat.h1 { fill: var(--heat-1); } .heat.h2 { fill: var(--heat-2); }
.heat.h3 { fill: var(--heat-3); } .heat.h4 { fill: var(--heat-4); }
.heat.sel { stroke: var(--ink); stroke-width: 1.5; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 8px 4px 4px; font-size: 11.5px; color: var(--muted); }
.heat-legend span { margin: 0 4px; }
.heat-key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.heat-key.h0 { background: var(--heat-0); } .heat-key.h1 { background: var(--heat-1); } .heat-key.h2 { background: var(--heat-2); }
.heat-key.h3 { background: var(--heat-3); } .heat-key.h4 { background: var(--heat-4); }

.wd-row { display: grid; grid-template-columns: 34px 1fr 30px; align-items: center; gap: 10px; padding: 5px 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wd-track { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.wd-track i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--heat-3); transition: width .8s var(--ease) .1s; }
.wd-row.best { color: var(--ink); font-weight: 600; }
.wd-row.best .wd-track i { background: var(--maint); }
.wd-val { text-align: right; }

.fq-grid { gap: 12px 8px; margin-top: 4px; }
.fq { flex: 1; height: 32px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.fq:first-child { border-radius: 8px 3px 3px 8px; }
.fq:last-child { border-radius: 3px 8px 8px 3px; }
.fq:active { transform: scale(.92); }
.fq.h0 { background: var(--heat-0); color: var(--muted); } .fq.h1 { background: var(--heat-1); } .fq.h2 { background: var(--heat-2); }
.fq.h3 { background: var(--heat-3); color: #fff; } .fq.h4 { background: var(--heat-4); color: #fff; }
.fq.fq-none { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.fq.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }

.date-input { margin: -6px 0 18px; }
