/* Noor — premium, mobile-first, Safari-first. No framework. */

@font-face { font-family: "Instrument Serif"; src: url(fonts/instrument-serif.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Amiri"; src: url(fonts/amiri.woff2) format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Noto Nastaliq Urdu"; src: url(fonts/nastaliq.woff2) format("woff2"); font-display: swap; font-weight: 400 700; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }

/* ============ Tokens ============ */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f1f0eb;
  --fill: rgba(16, 32, 26, .05);
  --fill-2: rgba(16, 32, 26, .09); --switch-off: rgba(16, 32, 26, .16);
  --line: rgba(16, 32, 26, .075);
  --line-2: rgba(16, 32, 26, .16);
  --ink: #0f1b16;
  --ink-2: #56625d;
  --ink-3: #939d98;
  --brand: #0f5741;
  --brand-hi: #17795b;
  --brand-ink: #ffffff;
  --brand-soft: #e4efe9;
  --gold: #a47a3a;
  --gold-hi: #e9cf94;
  --gold-soft: #f4ecdb;
  --danger: #b42318;
  --danger-soft: #fcebe8;
  --track: rgba(16, 32, 26, .08);
  --q0: #ebe9e2; --q1: #cfe2d7; --q2: #9dc9b0; --q3: #529d78; --q4: #0f5741;
  --tone-brand: #148063; --tone-ink: #3c4a44; --tone-teal: #1b7a8c; --tone-gold: #b5843b; --tone-rose: #b9584a; --tone-danger: #d13a2c;
  --shadow-1: 0 1px 2px rgba(15, 27, 22, .04), 0 1px 12px rgba(15, 27, 22, .045);
  --shadow-2: 0 2px 6px rgba(15, 27, 22, .05), 0 16px 40px rgba(15, 27, 22, .1);
  --hero-shadow: 0 22px 44px -18px rgba(9, 55, 41, .55), 0 2px 6px rgba(9, 55, 41, .15);
  --hero: radial-gradient(130% 95% at 100% 0%, rgba(233, 207, 148, .30) 0%, rgba(233, 207, 148, 0) 52%),
          radial-gradient(90% 80% at 0% 100%, rgba(31, 143, 108, .45) 0%, rgba(31, 143, 108, 0) 60%),
          linear-gradient(155deg, #13654c 0%, #0c4436 48%, #072a21 100%);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23e9cf94' stroke-width='.9' stroke-opacity='.22'%3E%3Crect x='19' y='19' width='26' height='26'/%3E%3Crect x='19' y='19' width='26' height='26' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 32h13.6M50.4 32H64M32 0v13.6M32 50.4V64'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3C/g%3E%3C/svg%3E");
  --r-xl: 28px; --r-lg: 22px; --r: 18px; --r-sm: 13px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", ui-serif, "New York", Georgia, serif;
  --font-ar: "Amiri", "Geeza Pro", "Traditional Arabic", serif;
  --font-ur: "Noto Nastaliq Urdu", "Geeza Pro", serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;
    --bg: #090e0c; --surface: #121a17; --surface-2: #18221e;
    --fill: rgba(255, 255, 255, .055); --fill-2: rgba(255, 255, 255, .09); --switch-off: rgba(255, 255, 255, .2);
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .16);
    --ink: #edf1ee; --ink-2: #a3aea8; --ink-3: #6c7872;
    --brand: #4fc59c; --brand-hi: #63d3ab; --brand-ink: #062118; --brand-soft: rgba(79, 197, 156, .13);
    --gold: #dcbd7c; --gold-soft: rgba(220, 189, 124, .13);
    --danger: #f28b7f; --danger-soft: rgba(242, 139, 127, .12);
    --track: rgba(255, 255, 255, .09);
    --q0: #1a2420; --q1: #1c3f2f; --q2: #286147; --q3: #3a9069; --q4: #66c79b;
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, .045); --shadow-2: 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 50px rgba(0, 0, 0, .5);
    --hero-shadow: 0 0 0 1px rgba(233, 207, 148, .1), 0 24px 50px -20px rgba(0, 0, 0, .8);
  }
}
[data-theme="dark"], .immersive {
  color-scheme: dark;
  --bg: #090e0c; --surface: #121a17; --surface-2: #18221e;
  --fill: rgba(255, 255, 255, .055); --fill-2: rgba(255, 255, 255, .09); --switch-off: rgba(255, 255, 255, .2);
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .16);
  --ink: #edf1ee; --ink-2: #a3aea8; --ink-3: #6c7872;
  --brand: #4fc59c; --brand-hi: #63d3ab; --brand-ink: #062118; --brand-soft: rgba(79, 197, 156, .13);
  --gold: #dcbd7c; --gold-soft: rgba(220, 189, 124, .13);
  --danger: #f28b7f; --danger-soft: rgba(242, 139, 127, .12);
  --track: rgba(255, 255, 255, .09);
  --q0: #1a2420; --q1: #1c3f2f; --q2: #286147; --q3: #3a9069; --q4: #66c79b;
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, .045); --shadow-2: 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 50px rgba(0, 0, 0, .5);
  --hero-shadow: 0 0 0 1px rgba(233, 207, 148, .1), 0 24px 50px -20px rgba(0, 0, 0, .8);
}

@view-transition { navigation: auto; }

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; padding: 0 var(--sar) 0 var(--sal);
}
html[lang="ur"] body { font-family: var(--font-ur), var(--font); line-height: 1.95; font-size: 15px; letter-spacing: 0; }
html[lang="ur"] .display { font-family: var(--font-ur); font-style: normal; }
html[lang="ur"] .num, html[lang="ur"] [dir="ltr"], html[lang="ur"] .goal-val, html[lang="ur"] .tap-center b, html[lang="ur"] .item-val,
html[lang="ur"] .hero-pct, html[lang="ur"] .tile-val, html[lang="ur"] .life-val, html[lang="ur"] .streak-main b, html[lang="ur"] .dnum b { font-family: var(--font); }
.ur { font-family: var(--font-ur); }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
/* Native dropdown lists: never inherit a transparent background (white-on-white on Windows/Linux). */
select option, select optgroup { background-color: var(--surface); color: var(--ink); }
select option:checked { background-color: var(--surface-2); color: var(--brand); }
select option:disabled { color: var(--ink-3); }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
img, svg { display: block; }
.i { flex: none; }
[dir="rtl"] .i-chev, [dir="rtl"] .i-chevl, [dir="rtl"] .i-arrow, [dir="rtl"] .i-logout { transform: scaleX(-1); }
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.contents { display: contents; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ Shared pieces ============ */
.hdr, .page { max-width: 640px; margin: 0 auto; }
.hdr { display: flex; align-items: flex-end; gap: 12px; padding: calc(var(--sat) + 22px) 20px 6px; }
.hdr-text { flex: 1; min-width: 0; }
.hdr h1 { margin: 0; font-size: 38px; line-height: 1.05; }
.hdr h1 em { font-style: italic; color: var(--brand); }
html[lang="ur"] .hdr h1 { font-size: 26px; line-height: 1.9; }
.hdr-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.hdr-actions { display: flex; gap: 8px; padding-bottom: 4px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
html[lang="ur"] .eyebrow { letter-spacing: 0; font-size: 13px; margin-bottom: 0; }
.page { display: grid; gap: 20px; padding: 14px 16px calc(var(--sab) + 112px); }
.bare .page { padding-bottom: calc(var(--sab) + 24px); }
.block-title { margin: 0 4px 12px; font-size: 24px; line-height: 1.1; }
html[lang="ur"] .block-title { font-size: 18px; line-height: 1.8; }

.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); transition: transform .15s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 18px -8px rgba(15, 87, 65, .6); }
.icon-btn.ghost { background: transparent; box-shadow: none; color: var(--ink-3); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.date-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; cursor: pointer; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--fill); color: var(--ink-2); white-space: nowrap; line-height: 1.3; }
.chip.sm { font-size: 11px; padding: 3px 8px; gap: 3px; }
.chip-brand { background: var(--brand-soft); color: var(--brand); }
.chip-gold { background: var(--gold-soft); color: var(--gold); }
.glass-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; font-style: normal;
  color: #f3dda6; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 15px;
  font-weight: 600; font-size: 16px; text-align: center; transition: transform .15s var(--ease), opacity .15s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .6; }
.btn-lg { height: 56px; border-radius: 17px; font-size: 17px; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #187d5e 0%, #0f5741 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 22px -10px rgba(15, 87, 65, .7); }
.btn-soft { background: var(--fill); color: var(--ink); }
.btn-text { background: transparent; color: var(--ink-2); }
.btn-text.danger, .btn-danger { color: var(--danger); }
.btn-danger { background: var(--danger-soft); }
.btn-danger-solid { background: var(--tone-danger); color: #fff; }
.btn.block { width: 100%; }

.banner { margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 500; }
.banner.error { background: var(--danger-soft); color: var(--danger); }

.ring-bg { stroke: var(--track); }
.ring-fg { stroke: var(--brand); transition: stroke-dashoffset .5s var(--ease), stroke .3s; }
.ring.ring-zero .ring-fg { opacity: 0; }
.ring.gold .ring-fg { stroke: url(#gGold); }

.hero { position: relative; isolation: isolate; overflow: hidden; color: #f6f0e3; background: var(--hero); border-radius: var(--r-xl); box-shadow: var(--hero-shadow); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pattern); background-size: 56px;
  -webkit-mask-image: linear-gradient(225deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 75%); mask-image: linear-gradient(225deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 75%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); pointer-events: none; }
.hero .ring-bg { stroke: rgba(255, 255, 255, .13); }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 23px; line-height: 1.1; }
html[lang="ur"] .card-head h2 { font-size: 17px; line-height: 1.8; }
.card-meta { font-size: 13px; color: var(--ink-3); font-weight: 500; }

.type-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--ink-2); }
.type-ic.t-count { background: var(--brand-soft); color: var(--brand); }
.type-ic.t-list { background: var(--gold-soft); color: var(--gold); }

.empty-state { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 44px 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.empty-state p { margin: 0; color: var(--ink-2); max-width: 280px; }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

/* ============ Floating tab bar ============ */
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: calc(var(--sab) + 12px); display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.tabbar-in { pointer-events: auto; display: flex; gap: 2px; width: 100%; max-width: 420px; padding: 6px; border-radius: 26px;
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(15, 27, 22, .14); }
[data-theme="dark"] .tabbar-in { background: rgba(22, 31, 27, .78); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 36px rgba(0, 0, 0, .55); }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .tabbar-in { background: rgba(22, 31, 27, .78); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 36px rgba(0, 0, 0, .55); } }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 20px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; transition: color .2s, background .2s; }
.tab.on { color: var(--brand); background: var(--brand-soft); }
.tab:active { transform: scale(.96); }
html[lang="ur"] .tab { font-size: 11.5px; line-height: 1.5; gap: 0; }

/* ============ Today ============ */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 10px 6px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.day { display: grid; justify-items: center; gap: 6px; padding: 2px 0; border-radius: 14px; color: var(--ink-2); }
.dow { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
html[lang="ur"] .dow { text-transform: none; letter-spacing: 0; font-size: 11px; line-height: 1.6; }
.dnum { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.dnum .ring { position: absolute; inset: 0; }
.dnum b { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; transition: background .2s; }
.day.hit .ring-fg { stroke: url(#gGold); }
.day.sel .dnum b { background: var(--brand); color: var(--brand-ink); }
.day.sel .dow { color: var(--brand); }
.day:active .dnum { transform: scale(.94); }
.back-today { justify-self: center; margin-top: -6px; }

.hero-today { display: flex; align-items: center; gap: 20px; padding: 22px 22px 22px 20px; }
.hero-ring { position: relative; flex: none; width: 128px; height: 128px; }
.hero-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; }
.hero-pct b { font-size: 52px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-pct span { font-size: 18px; color: rgba(246, 240, 227, .65); margin-top: 14px; }
.hero-body { min-width: 0; display: grid; justify-items: start; gap: 8px; }
.hero-kicker { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: rgba(246, 240, 227, .62); }
html[lang="ur"] .hero-kicker { letter-spacing: 0; font-size: 13px; }
.hero-title { margin: -4px 0 2px; font-size: 15px; color: rgba(246, 240, 227, .78); }
.hero-title b { font-size: 26px; font-weight: 650; color: #fff; letter-spacing: -.02em; margin-inline-end: 2px; }
.hero-next { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: 2px 0 0; font-size: 13px; color: rgba(246, 240, 227, .7); }
.hero-next b { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); gap: 10px; }
.goal { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 14px 13px 13px; text-align: start;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); color: var(--ink); transition: transform .15s var(--ease); min-width: 0; }
.goal:active { transform: scale(.97); }
.goal-ring { position: relative; width: 46px; height: 46px; margin-bottom: 12px; }
.goal-ring i, .mini i, .sec-ring i { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); }
.goal-ring i { color: var(--gold); }
.goal-val { font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goal-of { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.goal-name { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goal.done { background: linear-gradient(180deg, var(--gold-soft), var(--surface) 80%); }

.secs { display: grid; gap: 12px; }
.sec { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.sec-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.sec-ring { position: relative; width: 28px; height: 28px; flex: none; }
.sec-ring i { opacity: 0; transition: opacity .2s; }
.sec.complete .sec-ring i { opacity: 1; }
.sec-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.sec.complete .sec-title { color: var(--ink-2); }
.sec-count { font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sec-chev { color: var(--ink-3); transition: transform .25s var(--ease); display: grid; }
.sec[open] .sec-chev { transform: rotate(180deg); }
.sec-body { padding: 0 6px 6px; }

.item { position: relative; display: block; color: var(--ink); border-radius: 15px; }
.item + .item::before { content: ""; position: absolute; top: 0; inset-inline: 58px 12px; height: 1px; background: var(--line); }
.item-main { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 12px; text-align: start; border-radius: 15px; cursor: pointer; transition: background .15s; }
.item-main:active { background: var(--fill); }
.lead { width: 34px; display: grid; place-items: center; flex: none; }
.check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 1.75px var(--line-2);
  transition: background .2s var(--ease), box-shadow .2s, color .2s, transform .25s var(--ease); }
.check.sm { width: 22px; height: 22px; }
.item.done > .item-main .check, .step.done .check, .goal.done .check { background: var(--brand); box-shadow: none; color: var(--brand-ink); }
.pop { animation: pop .38s var(--ease); }
@keyframes pop { 0% { transform: scale(.8); } 45% { transform: scale(1.15); } 100% { transform: scale(1); } }
.mini { position: relative; width: 34px; height: 34px; display: block; }
.item.done .mini .ring-fg { stroke: var(--brand); }
.item-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.item-title { font-size: 16px; font-weight: 500; line-height: 1.3; }
.item-note { font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.item.done .item-title { color: var(--ink-3); }
.item-val { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-val small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.item-chev { color: var(--ink-3); display: grid; transition: transform .25s var(--ease); }
.item-list[open] .item-chev.turn { transform: rotate(180deg); }
.item-ar { display: block; margin: -4px 12px 12px; font-family: var(--font-ar); font-size: 1.15rem; line-height: 2; color: var(--ink-2); text-align: right; }
[dir="ltr"] .item-ar { margin-left: 58px; }
[dir="rtl"] .item-ar { margin-right: 58px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp.open { -webkit-line-clamp: unset; display: block; }
p.clamp { cursor: pointer; }
.steps { display: grid; padding: 0 12px 10px; padding-inline-start: 58px; }
.step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 0; text-align: start; font-size: 15px; color: var(--ink); }
.step + .step { border-top: 1px solid var(--line); }
.step.done .step-txt { color: var(--ink-3); }
.pledge { text-align: center; color: var(--ink-3); font-size: 19px; margin: 6px 0 0; font-style: italic; }
html[lang="ur"] .pledge { font-size: 15px; }

.install-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); }
.install-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.install-card p { flex: 1; margin: 0; display: grid; font-size: 15px; }
.install-card small { color: var(--ink-2); font-size: 13px; }

/* ============ Counter (immersive) ============ */
body.immersive { overflow: hidden; background: #071d16; color: #f6f0e3; }
body.immersive::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(70% 45% at 50% 52%, rgba(233, 207, 148, .16), rgba(233, 207, 148, 0) 70%),
              radial-gradient(120% 70% at 50% 0%, #11553f 0%, rgba(17, 85, 63, 0) 70%),
              linear-gradient(180deg, #0c3a2d 0%, #072219 55%, #04130e 100%); }
body.immersive::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--pattern); background-size: 72px; opacity: .55;
  -webkit-mask-image: radial-gradient(circle at 50% 52%, transparent 28%, #000 85%); mask-image: radial-gradient(circle at 50% 52%, transparent 28%, #000 85%); }
.counter { position: relative; z-index: 1; height: 100vh; height: 100dvh; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(var(--sat) + 12px) 18px calc(var(--sab) + 18px); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.counter-head { display: flex; align-items: center; gap: 12px; }
.glass-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #f6f0e3;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform .15s var(--ease); }
.glass-btn:active { transform: scale(.92); }
.counter-title { flex: 1; min-width: 0; display: grid; text-align: center; }
.counter-title b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.counter-title small { font-size: 13px; color: rgba(246, 240, 227, .55); }
.counter-ar { margin: 26px 8px 0; max-height: 28vh; overflow: auto; text-align: center; font-family: var(--font-ar); font-size: clamp(23px, 6.4vw, 31px); line-height: 2.05; color: #f2e4c1; }
.tap-zone { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; touch-action: manipulation; color: inherit; }
.tap-ring { position: relative; width: min(300px, 78vw, 44vh); aspect-ratio: 1; display: grid; place-items: center; transition: transform .12s var(--ease); }
.tap-ring::before { content: ""; position: absolute; inset: 9%; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02) 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 30px 60px -20px rgba(0, 0, 0, .6); }
.tap-ring > .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.tap-ring .ring-bg { stroke: rgba(255, 255, 255, .1); }
.tap-ring .ring.full { filter: drop-shadow(0 0 10px rgba(233, 207, 148, .55)); }
.tap-zone.hit .tap-ring { transform: scale(.965); }
.tap-center { position: relative; display: grid; justify-items: center; gap: 4px; }
.tap-center b { font-size: clamp(64px, 21vw, 96px); font-weight: 200; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.tap-center small { font-size: 15px; color: rgba(246, 240, 227, .55); font-weight: 500; }
.tap-center em { margin-top: 8px; }
.ripple { position: absolute; inset: 9%; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px rgba(243, 221, 166, .55); animation: ripple .65s var(--ease) forwards; }
@keyframes ripple { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.22); opacity: 0; } }
.tap-hint { margin: 0 0 16px; text-align: center; font-size: 13px; color: rgba(246, 240, 227, .4); }
.counter-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.glass-pill { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px; font-size: 15px; font-weight: 600; color: #f6f0e3;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform .15s var(--ease); }
.glass-pill:active { transform: scale(.95); }
.rounds { font-size: 14px; font-weight: 600; color: #f3dda6; font-variant-numeric: tabular-nums; }
.big-input { width: 100%; height: 76px; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); text-align: center;
  font-size: 40px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; outline: none; -webkit-appearance: none; appearance: none; }
.big-input:focus { box-shadow: 0 0 0 2px var(--brand); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.chip-btn:active { transform: scale(.95); }

/* ============ Bottom sheets ============ */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 94vh; max-height: 94dvh; overflow: hidden;
  background: var(--bg); color: var(--ink); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -24px 60px rgba(0, 0, 0, .22); }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .38s var(--ease); }
.sheet::backdrop { background: rgba(5, 12, 9, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .3s ease; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: var(--r-xl); max-width: 520px; } .sheet[open] { animation: sheet-pop .3s var(--ease); } }
@keyframes sheet-pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.sheet-form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; width: 100%; }
.sheet-head { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 22px 16px 12px; }
.sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--line-2); }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 650; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-btn { justify-self: start; padding: 6px 2px; font-size: 16px; color: var(--brand); }
.sh-btn.strong { justify-self: end; font-weight: 700; }
.sheet-body { display: grid; gap: 20px; padding: 6px 16px calc(var(--sab) + 22px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.group-title { margin: 0 6px 8px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
html[lang="ur"] .group-title { letter-spacing: 0; font-size: 13px; }
.group { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.cell { position: relative; display: grid; gap: 3px; padding: 11px 16px; }
.cell + .cell::before { content: ""; position: absolute; top: 0; inset-inline: 16px 0; height: 1px; background: var(--line); }
.cell-label { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; transition: color .2s; }
.cell:focus-within .cell-label { color: var(--brand); }
.cell input:not(.switch), .cell textarea, .cell select { width: 100%; min-height: 28px; padding: 2px 0; border: 0; background: transparent; outline: none; font-size: 17px; -webkit-appearance: none; appearance: none; border-radius: 0; }
.cell textarea { resize: none; line-height: 1.5; }
.cell .ar-input { font-family: var(--font-ar); font-size: 20px; line-height: 2; }
.cell-static { font-size: 17px; color: var(--ink-2); }
.cell-select select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 6px) 55%, 100% 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-end: 22px; }
[dir="rtl"] .cell-select select { background-position: 6px 55%, 0 55%; }
.cell-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; cursor: pointer; }
.cell-switch > span { display: grid; }
.cell-switch b { font-weight: 500; font-size: 16px; }
.cell-switch small { color: var(--ink-3); font-size: 13px; }
.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; box-sizing: border-box; width: 51px; min-width: 51px; height: 31px; min-height: 31px;
  margin: 0; padding: 0; border: 0; border-radius: 999px; cursor: pointer; background: var(--switch-off); outline: none;
  box-shadow: inset 0 0 0 1px var(--line); transition: background-color .25s var(--ease), box-shadow .25s var(--ease); -webkit-tap-highlight-color: transparent; }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 1px 1px rgba(0, 0, 0, .08); transition: transform .28s var(--ease); }
.switch:checked { background: var(--brand); box-shadow: none; }
.switch:checked::after { transform: translateX(20px); }
[dir="rtl"] .switch:checked::after { transform: translateX(-20px); }
.switch:active::after { width: 31px; }
.switch:checked:active::after { transform: translateX(16px); }
[dir="rtl"] .switch:checked:active::after { transform: translateX(-16px); }
.switch:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft), inset 0 0 0 1px var(--line); }
[data-show] { display: none; }
.show-count [data-show="count"], .show-list [data-show="list"] { display: grid; }

.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card > span { display: grid; justify-items: center; gap: 4px; height: 100%; padding: 14px 6px 12px; text-align: center; cursor: pointer;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); transition: box-shadow .2s, background .2s; }
.type-card .type-ic { margin-bottom: 4px; }
.type-card b { font-size: 14px; font-weight: 650; }
.type-card small { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.type-card input:checked + span { box-shadow: inset 0 0 0 2px var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--surface)); }
.type-card input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ Auth ============ */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-hero { position: relative; isolation: isolate; overflow: hidden; color: #f6f0e3; background: var(--hero); text-align: center;
  padding: calc(var(--sat) + 54px) 24px 74px; }
.auth-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pattern); background-size: 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%); }
.auth-hero-in { max-width: 380px; margin: 0 auto; }
.auth-mark { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 20px; box-shadow: 0 14px 34px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .14); }
.auth-hero h1 { margin: 0; font-size: 52px; line-height: 1; letter-spacing: -.01em; }
.auth-hero p { margin: 12px auto 0; max-width: 300px; font-size: 15px; line-height: 1.5; color: rgba(246, 240, 227, .72); }
.auth-panel { position: relative; flex: 1; margin-top: -30px; padding: 34px 22px calc(var(--sab) + 30px); background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.auth-panel-in { max-width: 400px; margin: 0 auto; display: grid; gap: 24px; }
.auth-head h2 { margin: 0; font-size: 34px; line-height: 1.05; }
html[lang="ur"] .auth-head h2 { font-size: 24px; line-height: 1.8; }
.auth-head p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }
.auth-form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-ic { position: absolute; inset-inline-start: 15px; display: grid; color: var(--ink-3); pointer-events: none; transition: color .2s; }
.input { width: 100%; height: 54px; padding-inline: 46px 16px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1);
  font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; transition: border-color .2s, box-shadow .2s; }
.input.has-end { padding-inline-end: 52px; }
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input-wrap:focus-within .input-ic { color: var(--brand); }
.pw-toggle { position: absolute; inset-inline-end: 6px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-3); }
.pw-toggle .i-eyeoff, .pw-toggle.on .i-eye { display: none; }
.pw-toggle.on .i-eyeoff { display: block; }
.choices { display: grid; gap: 10px; border: 0; padding: 0; margin: 4px 0 0; }
.choices legend { margin-bottom: 10px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 14px; cursor: pointer; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); transition: box-shadow .2s, background .2s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--ink-2); transition: background .2s, color .2s; }
.choice-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.choice-txt b { font-size: 15px; font-weight: 650; }
.choice-txt small { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.radio { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.75px var(--line-2); transition: box-shadow .2s, background .2s; }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--brand), var(--shadow-1); }
.choice:has(input:checked) .choice-ic { background: var(--brand-soft); color: var(--brand); }
.choice:has(input:checked) .radio { background: var(--brand); box-shadow: inset 0 0 0 6px var(--surface), 0 0 0 1.75px var(--brand); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-alt { margin: 0; text-align: center; color: var(--ink-2); font-size: 15px; }
.auth-alt a { font-weight: 650; }
.lang-switch { justify-self: center; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--fill); }
.lang-switch button { padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .2s; }
.lang-switch button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
@media (min-width: 900px) {
  .auth { flex-direction: row; }
  .auth-hero { flex: 1 1 50%; display: flex; align-items: center; justify-content: center; padding: 60px; position: sticky; top: 0; height: 100vh; }
  .auth-hero h1 { font-size: 76px; }
  .auth-hero p { font-size: 17px; max-width: 340px; }
  .auth-mark { width: 84px; height: 84px; border-radius: 24px; }
  .auth-panel { flex: 1 1 50%; margin: 0; border-radius: 0; display: flex; align-items: center; justify-content: center; padding: 56px 40px; }
  .auth-panel-in { width: 100%; }
}
.solo { min-height: 100vh; min-height: 100dvh; max-width: 420px; margin: 0 auto; padding: 40px 24px; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; }
.solo h1 { margin: 0; font-size: 40px; }
.solo p { margin: 0 0 8px; color: var(--ink-2); }

/* ============ Routine editor ============ */
.ed-sec { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; scroll-margin-top: 20px; }
.ed-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; }
[dir="rtl"] .ed-head { padding: 14px 18px 10px 10px; }
.ed-head-text { flex: 1; min-width: 0; display: grid; }
.ed-head h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-head small { font-size: 13px; color: var(--ink-3); }
.ed-list { padding: 0 6px 6px; }
.ed-row { position: relative; display: flex; align-items: center; border-radius: 15px; }
.ed-row + .ed-row::before, .ed-add::before { content: ""; position: absolute; top: 0; inset-inline: 58px 12px; height: 1px; background: var(--line); }
.ed-row.inactive .ed-text, .ed-row.inactive .type-ic { opacity: .45; }
.ed-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; text-align: start; border-radius: 15px; transition: background .15s; }
.ed-main:active { background: var(--fill); }
.ed-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ed-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-meta { font-size: 13px; color: var(--ink-3); }
.ed-chev { color: var(--ink-3); display: grid; }
.ed-add { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 12px; border-radius: 15px; color: var(--brand); font-weight: 600; font-size: 15px; }
.ed-add:active { background: var(--fill); }
.add-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); }
.reorder { display: none; align-items: center; gap: 4px; padding-inline-end: 6px; }
.mv { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); color: var(--ink-2); }
.mv:disabled { opacity: .3; }
.mv:active:not(:disabled) { background: var(--fill-2); }
.reordering .reorder { display: flex; }
.reordering .ed-chev, .reordering .ed-more, .reordering .ed-add { display: none; }
.reordering .ed-main { pointer-events: none; }

/* ============ Insights ============ */
.hero-streak { display: flex; align-items: center; gap: 18px; padding: 24px 22px; }
.streak-ic { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; flex: none; color: #f3dda6;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.streak-main { flex: 1; display: grid; }
.streak-main b { font-size: 60px; line-height: .9; }
.streak-main span { margin-top: 4px; font-size: 14px; color: rgba(246, 240, 227, .7); }
.streak-side { display: grid; gap: 12px; margin: 0; text-align: end; }
.streak-side dt { font-size: 11px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: rgba(246, 240, 227, .55); }
.streak-side dd { margin: 0; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { display: grid; align-content: space-between; gap: 10px; min-width: 0; padding: 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); }
.tile-label { font-size: 12px; font-weight: 600; color: var(--ink-3); line-height: 1.3; }
.tile-val { font-size: 34px; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tile-val i { font-style: normal; font-size: 18px; color: var(--ink-3); }
.key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.key-line { width: 16px; border-top: 1.5px dashed var(--gold); }
.bars { width: 100%; height: auto; overflow: visible; }
.bars .bar { fill: var(--q2); transition: fill .15s; }
.bars .bar.hit { fill: var(--q4); }
.bars .bar-empty { fill: var(--track); }
.bars .hit-area { fill: transparent; }
.bars g:hover .bar, .bars g.active .bar { fill: var(--gold); }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .goal-line { stroke: var(--gold); stroke-width: 1.25; stroke-dasharray: 3 4; }
.axis { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.table-view { margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.table-view summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
.table-view table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.table-view td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.table-view td:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.hm-wrap { overflow-x: auto; }
.heat { width: 100%; max-width: 460px; height: auto; margin: 0 auto; overflow: visible; }
.hm-label { fill: var(--ink-3); font-size: 9.5px; font-weight: 600; font-family: var(--font); }
.hm { transition: opacity .15s; }
.hm.l0, .hm-key.l0 { fill: var(--q0); background: var(--q0); }
.hm.l1, .hm-key.l1 { fill: var(--q1); background: var(--q1); }
.hm.l2, .hm-key.l2 { fill: var(--q2); background: var(--q2); }
.hm.l3, .hm-key.l3 { fill: var(--q3); background: var(--q3); }
.hm.l4, .hm-key.l4 { fill: var(--q4); background: var(--q4); }
.hm.active { stroke: var(--ink); stroke-width: 1.5; }
.legend-scale { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.legend-scale span { margin: 0 4px; }
.hm-key { width: 12px; height: 12px; border-radius: 3.5px; display: inline-block; }
.rates { display: grid; gap: 16px; }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; }
.rate-label { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate-val { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rate-bar { grid-column: 1 / -1; width: 100%; height: 6px; }
[dir="rtl"] .rate-bar { transform: scaleX(-1); }
.rate .track { fill: var(--q0); }
.rate .fill { fill: var(--q3); }
.life { display: grid; margin: -6px 0; }
.life-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.life-row + .life-row::before { content: ""; position: absolute; top: 0; inset-inline: 46px 0; height: 1px; background: var(--line); }
.life-text { flex: 1; min-width: 0; display: grid; }
.life-text b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.life-text small { font-size: 13px; color: var(--ink-3); }
.life-val { font-size: 19px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tip { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
  padding: 7px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); }

/* ============ Settings ============ */
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.avatar { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 26px; color: #f3dda6;
  background: var(--hero); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.profile-text { flex: 1; min-width: 0; display: grid; }
.profile-text b { font-size: 18px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text small { font-size: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-group { display: block; }
.set-row { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 16px; text-align: start; color: var(--ink); font-size: 16px; cursor: pointer; transition: background .15s; }
.set-row:active { background: var(--fill); }
.set-row::before { content: ""; position: absolute; top: 0; inset-inline: 62px 0; height: 1px; background: var(--line); }
.group > .set-row:first-child::before, .group > :first-child > .set-row::before, .group > :first-child.set-row::before { display: none; }
.set-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; }
.tone-brand { background: var(--tone-brand); } .tone-ink { background: var(--tone-ink); } .tone-teal { background: var(--tone-teal); }
.tone-gold { background: var(--tone-gold); } .tone-rose { background: var(--tone-rose); } .tone-danger { background: var(--tone-danger); }
.set-label { flex: 1; min-width: 0; display: grid; }
.set-label small { font-size: 13px; color: var(--ink-3); }
.set-value { max-width: 48%; color: var(--ink-3); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-chev { color: var(--ink-3); display: grid; opacity: .7; }
.set-row select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.set-row.danger .set-label { color: var(--danger); }
.warn { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: var(--danger-soft); }
.warn p { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.5; }
.foot-note { margin: 0; text-align: center; font-size: 12px; color: var(--ink-3); }

/* ============ Toast + haptic ============ */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--sab) + 96px); max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2);
  opacity: 0; transform: translate(-50%, 16px) scale(.98); transition: opacity .25s, transform .35s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.immersive .toast { bottom: calc(var(--sab) + 92px); background: #f3dda6; color: #0b2a20; }
.haptic { position: fixed; left: -100px; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

@media (min-width: 700px) {
  .hdr { padding-top: calc(var(--sat) + 36px); }
  .hdr h1 { font-size: 46px; }
  .page { gap: 22px; }
  .goals { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
