/* Nhary — Apple restraint × monday warmth */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .07);
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --line: rgba(0, 0, 0, .08);
  --accent: #6161ff;
  --accent-ink: #4d4df0;
  --accent-soft: #ececff;
  --on-accent: #ffffff;
  --good: #1a8f3c;
  --good-soft: #e4f6e8;
  --bad: #d63b3b;
  --bad-soft: #fde8e8;
  --warn: #b46a00;
  --now: #ff3b30;
  --shadow: 0 2px 48px rgba(205, 208, 223, .42);
  --shadow-2: 0 10px 40px rgba(0, 0, 0, .12);
  --glass: rgba(245, 245, 247, .78);
  --night-1: #1b1b3a;
  --night-2: #3a2d7a;
  --r-card: 24px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 980px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --fill: rgba(120, 120, 128, .28); --fill-2: rgba(120, 120, 128, .16);
    --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93; --line: rgba(255, 255, 255, .1);
    --accent: #7b7bff; --accent-ink: #9d9dff; --accent-soft: rgba(123, 123, 255, .18);
    --good: #34c759; --good-soft: rgba(52, 199, 89, .16); --bad: #ff6961; --bad-soft: rgba(255, 105, 97, .16); --warn: #ffb340;
    --shadow: none; --shadow-2: 0 10px 40px rgba(0, 0, 0, .5); --glass: rgba(22, 22, 24, .78);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --fill: rgba(120, 120, 128, .28); --fill-2: rgba(120, 120, 128, .16);
  --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93; --line: rgba(255, 255, 255, .1);
  --accent: #7b7bff; --accent-ink: #9d9dff; --accent-soft: rgba(123, 123, 255, .18);
  --good: #34c759; --good-soft: rgba(52, 199, 89, .16); --bad: #ff6961; --bad-soft: rgba(255, 105, 97, .16); --warn: #ffb340;
  --shadow: none; --shadow-2: 0 10px 40px rgba(0, 0, 0, .5); --glass: rgba(22, 22, 24, .78);
}

/* category color: light step by default, dark step in dark mode */
.cc { --k: var(--c); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cc { --k: var(--cd); } }
:root[data-theme="dark"] .cc { --k: var(--cd); }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 17px; line-height: 1.47; letter-spacing: -0.016em;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
}
body.sheet-open, body.onboarding { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
b, strong { font-weight: 600; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-2); }
.muted-l { color: rgba(255, 255, 255, .72); }
.sm { font-size: 13px; letter-spacing: -0.01em; }
.block { display: block; }
.center { text-align: center; justify-content: center; }
.pad-b { padding-bottom: 12px; }
.pad-t { padding-top: 12px; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; padding-top: var(--safe-t);
  background: transparent; transition: background .25s, box-shadow .25s;
}
.topbar.scrolled { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.topbar.titled { box-shadow: 0 .5px 0 var(--line); }
.topbar-inner { max-width: 600px; margin: 0 auto; height: 50px; padding: 0 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.tb-title { font-weight: 600; font-size: 17px; opacity: 0; transform: translateY(4px); transition: .25s; }
.topbar.titled .tb-title { opacity: 1; transform: none; }
.tb-brand { transition: opacity .2s; }
.topbar.titled .tb-brand { opacity: 0; }
.tb-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.tb-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.tb-btn:active { background: var(--fill); }
.badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--now); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; letter-spacing: 0; border: 2px solid var(--bg); box-sizing: content-box; }
.badge[hidden] { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #8181ff, #33dbdb); }
.avatar.xl { width: 56px; height: 56px; font-size: 24px; }

.logo-ring { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 270deg, #8181ff 15%, #33dbdb 40%, #33d58e 55%, #ffd633 65%, #fc527d 85%, #8181ff 100%); -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%); mask: radial-gradient(circle, transparent 52%, #000 54%); flex: none; }
.logo-ring.xl { width: 112px; height: 112px; -webkit-mask: radial-gradient(circle, transparent 58%, #000 59.5%); mask: radial-gradient(circle, transparent 58%, #000 59.5%); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main#view { max-width: 600px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + var(--safe-b) + 40px); }

/* large title */
.lt { padding: 6px 4px 18px; }
.lt-sub { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); }
.lt-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lt h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding-bottom: var(--safe-b);
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -.5px 0 var(--line);
}
.tabbar-inner { max-width: 600px; margin: 0 auto; height: var(--tab-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 500; letter-spacing: 0; padding: 6px 0; transition: color .2s; }
.tab.on { color: var(--accent); }
.tab:active .ic { transform: scale(.9); }
.fab { justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(97, 97, 255, .4); transform: translateY(-6px); transition: transform .2s; }
.fab:active { transform: translateY(-6px) scale(.92); }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.compact { padding: 6px 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.card-h h2 .count { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow.light { color: rgba(255, 255, 255, .7); }
.label-sm { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 18px 4px 8px; letter-spacing: -0.005em; }
.label-sm.warn { color: var(--warn); }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.label-row .label-sm { margin-left: 0; }
.big-emoji { font-size: 30px; line-height: 1; }
.huge-emoji { font-size: 56px; line-height: 1; display: block; margin-bottom: 16px; }
.empty { padding: 12px 0; text-align: center; font-size: 15px; }
.empty-cta { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: var(--r-md); border: 1.5px dashed var(--fill); color: var(--accent-ink); font-weight: 500; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty-state .big-emoji { display: block; margin-bottom: 12px; font-size: 44px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 20px; border-radius: var(--r-pill); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; transition: transform .15s, background .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--fill); color: var(--ink); }
.btn-tinted { background: var(--accent-soft); color: var(--accent-ink); }
.btn-white { background: #fff; color: #1d1d1f; }
.btn-glass { background: rgba(255, 255, 255, .16); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn-danger-ghost { background: var(--bad-soft); color: var(--bad); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; gap: 5px; }
.btn.lg { height: 52px; font-size: 17px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.btn-row .btn { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.link { color: var(--accent-ink); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; }
.link.strong { font-weight: 600; }
.link.sm { font-size: 13px; }
.link.light { color: rgba(255, 255, 255, .75); margin-top: 18px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:active { background: var(--fill); }
.icon-btn.tinted { background: var(--accent-soft); color: var(--accent-ink); }
.col-btns { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* ---------- ring ---------- */
.ring-card { padding: 22px 20px 18px; }
.ring-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.ring { display: block; overflow: visible; }
.ring-track { fill: none; stroke: var(--fill-2); }
.ring-sleep { fill: none; stroke: var(--k); opacity: .16; }
.ring-plan { fill: none; stroke: var(--k); opacity: .38; }
.ring-real { fill: none; stroke: var(--k); }
.ring-lbl { font-size: 10px; font-weight: 600; fill: var(--ink-3); letter-spacing: 0; }
.ring-dot { fill: var(--ink-3); opacity: .5; }
.ring-hand { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.ring-hand-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.rc-time { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.rc-sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); max-width: 120px; line-height: 1.3; letter-spacing: -0.005em; }
.ring-key { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.ring-key span { display: inline-flex; align-items: center; gap: 6px; }
.key-plan, .key-real { width: 16px; height: 6px; border-radius: 3px; background: var(--ink-3); }
.key-plan { opacity: .4; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-item b { color: var(--ink); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k); flex: none; display: inline-block; }
.ring-empty { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 10px; }

/* ---------- now ---------- */
.now-head { display: flex; align-items: center; gap: 12px; }
.now-txt { flex: 1; min-width: 0; }
.now-txt h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bub { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex: none; background: color-mix(in srgb, var(--k) 16%, transparent); }
.bub.lg { width: 48px; height: 48px; border-radius: 15px; font-size: 24px; }
.timer { font-size: 56px; font-weight: 600; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1; margin: 18px 0 18px; }
.timer.light { color: #fff; margin: 12px 0 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-tile { aspect-ratio: 1 / 1.02; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: color-mix(in srgb, var(--k) 12%, var(--surface)); transition: transform .15s; padding: 4px; }
.cat-tile:active { transform: scale(.94); }
.cat-tile.cat-focus { background: var(--accent-soft); }
.ct-emoji { font-size: 26px; line-height: 1; }
.ct-name { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; text-align: center; line-height: 1.15; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; scroll-snap-type: x proximity; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); background: var(--fill-2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: transform .15s; }
.chip.cc { background: color-mix(in srgb, var(--k) 13%, var(--surface)); }
.chip:active { transform: scale(.95); }
.chip-accent { background: var(--accent); color: var(--on-accent); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--k) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--k); }
.plan-now p { font-size: 15px; }
.next-row { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding-top: 14px; border-top: .5px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.next-row .ic { color: var(--ink-3); }

.focus-pill { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--r-pill); background: linear-gradient(135deg, #6161ff, #9450fd); color: #fff; font-size: 15px; box-shadow: 0 8px 24px rgba(97, 97, 255, .3); }
.focus-pill span:nth-child(2) { flex: 1; }
.fp-dot { width: 8px; height: 8px; border-radius: 50%; background: #bcfe90; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- night & soft cards ---------- */
.night-card { background: linear-gradient(150deg, var(--night-1), var(--night-2) 70%, #6b3fa0); color: #fff; box-shadow: 0 10px 40px rgba(58, 45, 122, .25); position: relative; overflow: hidden; }
.night-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -50px; top: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); }
.night-card .eyebrow { color: rgba(255, 255, 255, .7); }
.night-card h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 4px; }
.night-sub { color: rgba(255, 255, 255, .78); font-size: 15px; margin-bottom: 16px; }
.night-card .btn-row { position: relative; z-index: 1; }
.night-card.sleeping { text-align: center; padding: 28px 20px 24px; }
.done-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: rgba(255, 255, 255, .8); flex: 1; }
.soft-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.soft-card p { font-size: 15px; }
.hint-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, #33dbdb 12%, var(--surface))); box-shadow: none; }
.hint-card p { font-size: 14px; }

/* ---------- coach / alerts ---------- */
.coach-card .card-h h2 .ic { color: var(--accent); }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.alert-row + .alert-row { border-top: .5px solid var(--line); }
.al-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--fill-2); display: grid; place-items: center; font-size: 18px; flex: none; }
.al-main { flex: 1; min-width: 0; }
.al-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.al-body { font-size: 14px; color: var(--ink-2); line-height: 1.35; margin-top: 1px; }
.al-time { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.alert-row.unread .al-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 2px; }
.list-card { background: var(--surface); border-radius: 18px; padding: 4px 16px; }

/* ---------- tasks ---------- */
.task { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; transition: opacity .25s, transform .25s; }
.task + .task { border-top: .5px solid var(--line); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 9px 0; text-align: left; }
.task-title { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.task-meta { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-top: 2px; }
.task-meta span { display: inline-flex; align-items: center; gap: 3px; }
.task-meta .sep { font-style: normal; margin: 0 4px; color: var(--ink-3); }
.task-meta .overdue { color: var(--bad); font-weight: 600; }
.late-tag { color: var(--warn); font-weight: 600; }
.chk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; flex: none; color: transparent; transition: .2s; font-size: 12px; font-weight: 600; }
.chk.ghost { border-style: dashed; border-color: var(--fill); color: var(--ink-3); }
.task.done .chk { background: var(--accent); border-color: var(--accent); color: #fff; }
.task.done .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.task.just-done .chk { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.12); }
.task.just-done { opacity: .5; }
.task-empty { color: var(--ink-3); }
.task-empty .muted { font-size: 15px; padding: 12px 0; }

/* ---------- habits ---------- */
.habit-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px 4px; }
.habit-row::-webkit-scrollbar { display: none; }
.habit { position: relative; flex: none; width: 118px; padding: 14px 12px 12px; border-radius: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; cursor: pointer; user-select: none; transition: transform .15s, background .25s; }
.habit:active { transform: scale(.96); }
.habit.done { background: color-mix(in srgb, #33d58e 16%, var(--surface)); }
.habit-emoji { font-size: 24px; line-height: 1.1; }
.habit-name { font-size: 13px; font-weight: 600; line-height: 1.25; min-height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.habit-count { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.habit-count small { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.habit-minus { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); color: var(--ink-2); font-size: 16px; line-height: 1; display: grid; place-items: center; }
.streak { position: absolute; bottom: 30px; right: 10px; font-size: 11.5px; font-weight: 600; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.meter.cc i { background: var(--k); }
.meter.over i { background: var(--bad); }
.habit .meter i { background: #1baf7a; }

/* ---------- plan ---------- */
.week { display: flex; align-items: center; gap: 2px; margin: -4px -6px 14px; }
.wd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border-radius: 14px; }
.wd span { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .02em; }
.wd b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 500; }
.wd i { width: 5px; height: 5px; border-radius: 50%; }
.wd i.has { background: var(--ink-3); }
.wd.today b { color: var(--accent-ink); font-weight: 700; }
.wd.sel b { background: var(--ink); color: var(--bg); font-weight: 600; }
.wd.sel.today b { background: var(--accent); color: #fff; }
.tpl-row { margin: 0 -16px 10px; padding: 2px 16px; }
.plan-summary { font-size: 13px; color: var(--ink-2); padding: 0 4px 12px; }
.tl-card { padding: 12px 12px 16px 6px; }
.tl-head { display: grid; grid-template-columns: 46px 1fr 30px; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 0 0 8px; }
.tl-head span:last-child { text-align: center; }
.tl { position: relative; display: grid; grid-template-columns: 46px 1fr 30px; gap: 6px; }
.tl-hour { position: absolute; left: 0; right: 0; height: 0; border-top: .5px solid var(--line); }
.tl-hour span { position: absolute; left: 0; top: -8px; width: 40px; text-align: right; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; background: var(--surface); padding-right: 4px; }
.tl-hour:first-child span { top: 2px; }
.tl-plan { grid-column: 2; position: relative; cursor: copy; }
.tl-real { grid-column: 3; position: relative; border-radius: 8px; background: var(--fill-2); }
.tl-sleep { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--fill-2) 0 6px, transparent 6px 12px); border-radius: 10px; }
.tl-sleep span { position: sticky; top: 60px; display: block; padding: 8px 10px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.tl-block { position: absolute; display: flex; flex-direction: column; justify-content: flex-start; gap: 1px; padding: 6px 10px; border-radius: 10px; overflow: hidden; text-align: left; background: color-mix(in srgb, var(--k) 15%, var(--surface)); box-shadow: inset 3px 0 0 var(--k); transition: transform .15s; z-index: 1; }
.tl-block:active { transform: scale(.98); }
.tl-block b { font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-block span { font-size: 11.5px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.tl-block.short { flex-direction: row; align-items: center; gap: 8px; padding: 2px 10px; }
.tl-task { position: absolute; right: 4px; z-index: 2; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--surface); box-shadow: 0 1px 6px rgba(0, 0, 0, .12); font-size: 11.5px; font-weight: 500; white-space: nowrap; max-width: 75%; overflow: hidden; text-overflow: ellipsis; }
.tl-task.done { color: var(--ink-3); text-decoration: line-through; }
.tl-r { position: absolute; left: 4px; right: 4px; border-radius: 4px; background: var(--k); display: block; }
.tl-now { position: absolute; left: 40px; right: 0; height: 0; border-top: 2px solid var(--now); z-index: 3; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.tl-now span { position: absolute; left: -42px; top: -9px; font-size: 11px; font-weight: 700; color: var(--now); background: var(--surface); padding: 0 2px; font-variant-numeric: tabular-nums; }

/* ---------- goals ---------- */
.goal-row { display: block; width: 100%; padding: 12px 0; text-align: left; }
.goal-row + .goal-row { border-top: .5px solid var(--line); }
.goal-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.goal-title { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--fill-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.dots7 { display: flex; gap: 5px; margin-top: 10px; }
.dots7 i { width: 10px; height: 10px; border-radius: 50%; background: var(--fill); }
.dots7 i.ok { background: var(--good); }
.dots7 i.no { background: var(--bad); opacity: .75; }
.dots7.lg { gap: 8px; justify-content: space-between; max-width: 260px; }
.dots7.lg i { width: 24px; height: 24px; }
.habit-line { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main step" "dots dots"; align-items: center; gap: 0 12px; padding: 10px 0; }
.habit-line + .habit-line { border-top: .5px solid var(--line); }
.hl-main { grid-area: main; display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.hl-main .habit-emoji { width: 36px; height: 36px; border-radius: 11px; background: var(--fill-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.habit-line .dots7 { grid-area: dots; margin: 8px 0 0 48px; }
.stepper { grid-area: step; display: flex; align-items: center; gap: 2px; background: var(--fill-2); border-radius: var(--r-pill); padding: 3px; }
.stepper button { width: 30px; height: 30px; border-radius: 50%; font-size: 18px; display: grid; place-items: center; color: var(--ink); }
.stepper button:active { background: var(--fill); }
.stepper b { min-width: 38px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.sleep-targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sleep-targets .big { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- stats ---------- */
.seg { display: flex; background: var(--fill-2); border-radius: 10px; padding: 2px; gap: 2px; }
.seg > button, .seg > label { flex: 1; position: relative; text-align: center; }
.seg > button, .seg label span { display: block; height: 32px; line-height: 32px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: background .2s, box-shadow .2s; cursor: pointer; white-space: nowrap; padding: 0 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg > button.on, .seg input:checked + span { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-weight: 600; }
:root[data-theme="dark"] .seg > button.on, :root[data-theme="dark"] .seg input:checked + span { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg > button.on, :root:not([data-theme="light"]) .seg input:checked + span { background: #636366; } }
.seg-wide { margin-bottom: 16px; }
.score-card { display: flex; flex-direction: column; gap: 18px; }
.hero-num { font-size: 64px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; margin: 4px 0 2px; }
.hero-num small { font-size: 22px; color: var(--ink-3); font-weight: 500; letter-spacing: -0.01em; margin-left: 2px; }
.score-parts { display: flex; flex-direction: column; gap: 8px; }
.sp { display: grid; grid-template-columns: 82px 1fr 24px; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.sp b { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
.tile-l { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.tile-v { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; margin: 2px 0; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 104px 1fr 54px; align-items: center; gap: 10px; font-size: 14px; }
.bar-lbl { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; }
.bar-fill { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--k); }
.bar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.hstrip { position: relative; height: 34px; border-radius: 8px; background: var(--fill-2); overflow: hidden; }
.hs-seg { position: absolute; top: 0; bottom: 0; background: var(--k); border-right: 1px solid var(--surface); }
.hs-ticks { position: relative; height: 18px; margin-top: 6px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hs-ticks span { position: absolute; transform: translateX(-50%); }
.hs-ticks span:first-child { transform: none; }
.hs-ticks span:last-child { transform: translateX(-100%); }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.spark i { flex: 1; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .3; min-height: 3px; }
.spark i.cur { opacity: 1; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.base { stroke: var(--ink-3); opacity: .5; }
.chart .axis { font-size: 10.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .axis.strong { fill: var(--ink); font-weight: 600; }
.chart .target { stroke: var(--accent); stroke-width: 1.5; }
.chart .fill-k { fill: var(--k); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: var(--fill-2); }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.insight + .insight { border-top: .5px solid var(--line); }
.insight p { font-size: 15px; line-height: 1.4; padding-top: 6px; }
#tip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 500; line-height: 1.4; padding: 8px 11px; border-radius: 10px; white-space: pre-line; box-shadow: var(--shadow-2); max-width: 240px; }

/* ---------- sheets ---------- */
#sheetRoot { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#sheetRoot.open { pointer-events: auto; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .3s; }
#sheetRoot.open .backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 600px; margin: 0 auto; max-height: 92vh; max-height: 92dvh;
  background: var(--bg); border-radius: 24px 24px 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .9, .25, 1); box-shadow: var(--shadow-2);
}
#sheetRoot.open .sheet { transform: none; }
.grabber { width: 100%; height: 22px; flex: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grabber::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--fill); }
.sheet-body { overflow-y: auto; padding: 0 16px calc(28px + var(--safe-b)); overscroll-behavior: contain; }
.sheet-nav { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 0 14px; background: var(--bg); }
.sheet-nav h3 { font-size: 17px; font-weight: 600; text-align: center; }
.sheet-nav > :last-child { justify-self: end; }
.big-input { width: 100%; border: 0; outline: 0; background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 4px; }
.big-input.sm { font-size: 16px; margin: 12px 0 0; }
.big-input.center { text-align: center; }
.big-input::placeholder { color: var(--ink-3); }
.group { background: var(--surface); border-radius: var(--r-md); margin-top: 12px; overflow: hidden; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 0 16px; font-size: 16px; }
.field + .field, .group > * + * { border-top: .5px solid var(--line); }
.field > span:first-child { flex: 1; min-width: 0; }
.field input:not([type=checkbox]), .field select { border: 0; outline: 0; background: var(--fill-2); border-radius: 8px; padding: 6px 10px; font-size: 16px; text-align: right; min-width: 0; max-width: 60%; color: var(--ink); }
.field input[type=time], .field input[type=date] { min-height: 34px; }
.field input:not([type=checkbox]):focus, .field select:focus { box-shadow: 0 0 0 2px var(--accent); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.field-note { font-size: 13px; color: var(--ink-2); padding: 8px 16px; }
.field-note.center { text-align: center; padding-top: 20px; }
.num-badge { width: 26px; height: 26px; flex: none !important; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.field:has(.num-badge) input { flex: 1; max-width: none; text-align: left; background: transparent; padding-left: 0; }
.time-pair { display: flex; align-items: center; gap: 6px; }
.time-pair input { max-width: none !important; }
.time-pair i { font-style: normal; color: var(--ink-3); }
/* iOS switch */
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; cursor: pointer; transition: background .25s; outline-offset: 2px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .1); transition: transform .25s cubic-bezier(.3, .9, .3, 1); }
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }
/* category picker */
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); transition: .15s; }
.cat-opt input:checked + span { background: color-mix(in srgb, var(--k) 16%, var(--surface)); box-shadow: inset 0 0 0 2px var(--k); font-weight: 600; }
.cat-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.days-pick { display: flex; gap: 6px; margin-top: 10px; }
.days-pick label { flex: 1; position: relative; }
.days-pick input { position: absolute; opacity: 0; }
.days-pick span { display: grid; place-items: center; height: 40px; border-radius: 12px; background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.days-pick input:checked + span { background: var(--accent); color: #fff; }
.danger-zone { margin-top: 16px; }
.danger-zone .btn { margin-top: 8px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { background: var(--surface); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 2px; text-align: left; transition: transform .15s; }
.quick:active { transform: scale(.97); }
.q-emoji { font-size: 28px; margin-bottom: 8px; }
.quick b { font-size: 16px; }
.emoji-name { display: flex; gap: 8px; margin-top: 12px; }
.emoji-input { width: 58px; flex: none; border: 0; outline: 0; background: var(--surface); border-radius: var(--r-md); text-align: center; font-size: 26px; }
.emoji-name .big-input { margin: 0; }
.mood { display: flex; justify-content: space-between; gap: 6px; background: var(--surface); border-radius: var(--r-md); padding: 10px; }
.mood label { flex: 1; position: relative; }
.mood input { position: absolute; opacity: 0; }
.mood span { display: grid; place-items: center; height: 52px; border-radius: 12px; font-size: 30px; cursor: pointer; filter: grayscale(.85); opacity: .55; transition: .2s; }
.mood input:checked + span { filter: none; opacity: 1; background: var(--accent-soft); transform: scale(1.06); }
.area { display: block; margin-top: 12px; }
.area span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 4px 6px; }
.area textarea { width: 100%; border: 0; outline: 0; background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; font-size: 16px; resize: none; line-height: 1.4; }
.review-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--surface); border-radius: var(--r-md); padding: 14px 8px; text-align: center; }
.review-sum b { display: block; font-size: 18px; letter-spacing: -0.02em; }
.review-sum span { font-size: 11.5px; color: var(--ink-2); }
.row-btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; font-size: 16px; text-align: left; cursor: pointer; }
.row-btn .ic:first-child { color: var(--accent); }
.row-btn .ic:last-child { color: var(--ink-3); }
.row-btn.danger, .row-btn.danger .ic { color: var(--bad); }
.profile-head { display: flex; align-items: center; gap: 14px; background: var(--surface); padding: 16px; border-radius: var(--r-md); }
.profile-head b { font-size: 19px; }
.install .step { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 8px; }
.install .step p { padding-top: 2px; font-size: 15.5px; }
.install .muted { padding: 8px 4px; }
.focus-hero { text-align: center; padding: 8px 0 16px; }
.focus-hero .big-emoji { font-size: 44px; display: block; margin-bottom: 8px; }

/* ---------- toast ---------- */
#toastRoot { position: fixed; top: calc(var(--safe-t) + 8px); left: 0; right: 0; z-index: 90; display: flex; justify-content: center; pointer-events: none; padding: 0 10px; }
.toast { pointer-events: auto; width: 100%; max-width: 420px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: 0 10px 40px rgba(0, 0, 0, .18), inset 0 0 0 .5px var(--line); transform: translateY(-140%); opacity: 0; transition: transform .45s cubic-bezier(.2, .9, .25, 1.05), opacity .3s; cursor: pointer; }
.toast.in { transform: none; opacity: 1; }
.toast.static { transform: none; opacity: 1; position: relative; margin-bottom: 8px; cursor: default; background: var(--surface); box-shadow: var(--shadow); }
.toast-icon { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #f5f5ff, #e7ecff); display: grid; place-items: center; font-size: 20px; flex: none; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .06); }
.toast-body { flex: 1; min-width: 0; }
.toast-app { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.toast-title { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; }
.toast-text { font-size: 14px; color: var(--ink-2); line-height: 1.3; }

/* ---------- focus overlay ---------- */
.focus-ov { position: fixed; inset: 0; z-index: 70; background: radial-gradient(120% 80% at 50% 0%, #2b2470 0%, #12122a 55%, #07070f 100%); color: #fff; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 40px) 24px calc(var(--safe-b) + 30px); animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.focus-min { position: absolute; top: calc(var(--safe-t) + 14px); left: 16px; color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .1); width: 40px; height: 40px; }
.focus-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; width: 100%; max-width: 420px; }
.focus-inner h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 16px; }
.focus-ring { position: relative; width: 280px; height: 280px; margin-bottom: 26px; max-width: 78vw; max-height: 78vw; }
.focus-ring svg { width: 100%; height: 100%; }
.fr-track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 12; }
.fr-prog { fill: none; stroke: url(#fg); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.focus-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 300; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.focus-ov.done .focus-inner h2 { margin-bottom: 4px; }
.focus-ov.done .btn-col { margin-top: 24px; }

/* ---------- onboarding ---------- */
.ob { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; padding: calc(var(--safe-t) + 8px) 20px calc(var(--safe-b) + 24px); }
.ob-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 44px; max-width: 480px; width: 100%; margin: 0 auto; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--fill); transition: .3s; }
.ob-dots i.on { width: 22px; background: var(--accent); }
.ob-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; max-width: 480px; width: 100%; margin: 0 auto; padding: 16px 0; animation: obIn .45s cubic-bezier(.2, .9, .25, 1); }
@keyframes obIn { from { opacity: 0; transform: translateY(14px); } }
.ob-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.ob-title { font-size: 56px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-top: 18px; }
.ob-sub { font-size: 19px; font-weight: 400; color: var(--ink-2); line-height: 1.4; max-width: 360px; letter-spacing: -0.015em; }
.ob-q { text-align: center; margin-bottom: 10px; }
.ob-q h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 8px; }
.ob-q p { font-size: 16px; }
.ob-list { display: flex; flex-direction: column; gap: 8px; }
.ob-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 16px; font-size: 16px; font-weight: 500; text-align: left; box-shadow: inset 0 0 0 1.5px transparent; transition: .2s; }
.ob-opt.on { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.ob-emoji { font-size: 24px; width: 32px; text-align: center; }
.ob-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--fill); display: grid; place-items: center; color: transparent; transition: .2s; }
.ob-opt.on .ob-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.ob-preview { margin: 6px 0; }
.ob .group { margin-top: 0; }


/* ======================= v2 ======================= */
/* now card extras */
.limit-bar { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; }
.limit-bar .meter { flex: 1; height: 8px; }
.limit-bar .meter i { background: var(--warn); }
.limit-bar .meter.over i { background: var(--bad); }
.backdate { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -8px 0 16px; }
.chip-sm { height: 28px; padding: 0 11px; font-size: 13px; }
.next-row.tight { margin-top: 8px; padding-top: 0; border-top: 0; }
.np-ic { width: 16px; text-align: center; font-size: 14px; }
.ring-prayer { fill: #33dbdb; stroke: var(--surface); stroke-width: 1.5; }
.task-meta .slot { color: var(--accent-ink); font-weight: 600; }

/* capacity */
.capacity { margin-top: 16px; padding-top: 14px; border-top: .5px solid var(--line); }
.cap-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.cap-top .muted { font-weight: 500; }
.capacity .meter { height: 8px; }
.cap-warn { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--bad); }
.capacity .btn { margin-top: 12px; height: 40px; font-size: 15px; }

/* plan timeline extras */
.tl-prayer { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid #33dbdb; opacity: .7; z-index: 2; pointer-events: none; }
.tl-pr-badge { position: absolute; left: 30px; z-index: 3; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: color-mix(in srgb, #33dbdb 22%, var(--surface)); box-shadow: 0 0 0 2px var(--surface); cursor: default; }
.tl-block.short span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-block.is-task { box-shadow: inset 3px 0 0 var(--k), inset 0 0 0 1px color-mix(in srgb, var(--k) 40%, transparent); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--k) 13%, var(--surface)) 0 8px, color-mix(in srgb, var(--k) 18%, var(--surface)) 8px 16px); }
.tl-block.done { opacity: .5; }
.tl-block.done b { text-decoration: line-through; }

/* goals extras */
.debt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.rt-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rt-row + .rt-row { border-top: .5px solid var(--line); }
.rt-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.rt-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: color-mix(in srgb, #ffd633 18%, var(--surface)); flex: none; }
.rt-row.done .goal-title { color: var(--ink-2); }

/* energy */
.energy-card .card-h { margin-bottom: 6px; }
.en-night { margin-bottom: 10px; }
.energy-chart { margin: 4px 0 10px; }
.en-band.peak { fill: var(--accent); opacity: .08; }
.en-band.dip { fill: var(--ink-3); opacity: .1; }
.en-area { fill: var(--accent); opacity: .12; }
.en-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.en-now { stroke: var(--ink); stroke-width: 1; opacity: .35; }
.en-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.en-now-txt { font-size: 15px; line-height: 1.4; }

/* morning planning */
.plan-cta { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, color-mix(in srgb, #ffd633 22%, var(--surface)), color-mix(in srgb, #fc527d 12%, var(--surface))); box-shadow: none; }
.plan-cta p { font-size: 15px; }
.planday .pd-step { margin-bottom: 22px; }
.pd-h { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 10px; }
.pd-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 0; }
.pd-row + .pd-row, .pd-row + .pd-add { border-top: .5px solid var(--line); }
.pd-row .grow { font-size: 15.5px; line-height: 1.3; }
.pd-empty { padding: 14px 0; }
.pd-all { margin: 8px 4px 0; }
.star { width: 32px; height: 32px; border-radius: 50%; font-size: 18px; color: var(--fill); display: grid; place-items: center; flex: none; transition: .15s; }
.star.on { color: #f5b301; }
.est-pill { flex: none; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--fill-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.est-pill.set { background: var(--accent-soft); color: var(--accent-ink); }
.pd-add { display: flex; align-items: center; gap: 8px; padding: 8px 0 6px; }
.pd-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15.5px; padding: 8px 0; }
.nlp { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; margin: 8px 4px 0; }
.nlp-chip { height: 24px; padding: 0 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; }

/* scroll pause */
.scroll-pause { padding-bottom: 6px; }
.breath { position: relative; width: 168px; height: 168px; margin: 6px auto 18px; display: grid; place-items: center; }
.breath-ring, .breath-core { position: absolute; border-radius: 50%; }
.breath-ring { inset: 0; background: conic-gradient(from 270deg, #8181ff 15%, #33dbdb 40%, #33d58e 55%, #ffd633 65%, #fc527d 85%, #8181ff 100%); opacity: .28; filter: blur(14px); animation: breathe 8s ease-in-out infinite; }
.breath-core { inset: 34px; background: var(--surface); box-shadow: var(--shadow-2); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.72); } 50% { transform: scale(1); } }
.breath-txt { position: relative; z-index: 1; font-size: 15px; font-weight: 600; height: 22px; width: 100px; text-align: center; }
.breath-txt span { position: absolute; inset: 0; animation: fadeA 8s ease-in-out infinite; }
.breath-txt .b-out { animation-name: fadeB; }
@keyframes fadeA { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
@keyframes fadeB { 0%, 45% { opacity: 0; } 50%, 95% { opacity: 1; } 100% { opacity: 0; } }
.sp-q { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
.scroll-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.scroll-opts .btn { padding: 0 6px; }
.scroll-opts .btn:disabled { opacity: .35; }
#scrollWait { margin-top: 8px; }

/* heatmap */
.heat .hm { stroke: none; }
.hm0 { fill: var(--fill-2); background: var(--fill-2); }
.hm1 { fill: color-mix(in srgb, var(--accent) 18%, var(--surface)); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.hm2 { fill: color-mix(in srgb, var(--accent) 38%, var(--surface)); background: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
.hm3 { fill: color-mix(in srgb, var(--accent) 58%, var(--surface)); background: color-mix(in srgb, var(--accent) 58%, var(--surface)); }
.hm4 { fill: color-mix(in srgb, var(--accent) 78%, var(--surface)); background: color-mix(in srgb, var(--accent) 78%, var(--surface)); }
.hm5 { fill: var(--accent); background: var(--accent); }
.heat .today { stroke: var(--ink); stroke-width: 1.5; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.heat-legend i { width: 14px; height: 14px; border-radius: 4px; display: block; }
.heat-legend span { margin: 0 4px; }

/* settings: prayers */
.prayer-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 14px; }
.prayer-list span { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: var(--fill-2); }
.prayer-list small { font-size: 11.5px; color: var(--ink-2); }
.prayer-list b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* routine editor */
.steps-edit { display: flex; flex-direction: column; gap: 8px; }
.step-row { display: flex; align-items: center; gap: 6px; background: var(--surface); border-radius: var(--r-md); padding: 6px; }
.emoji-input.sm { width: 42px; height: 42px; font-size: 20px; background: var(--fill-2); border-radius: 10px; }
.step-name { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 8px 4px; }
.step-min { display: flex; align-items: center; gap: 2px; background: var(--fill-2); border-radius: 10px; padding: 0 8px; height: 42px; font-size: 13px; color: var(--ink-2); }
.step-min input { width: 34px; border: 0; outline: 0; background: transparent; font-size: 16px; text-align: right; color: var(--ink); }

/* routine run */
.run-ov { background: radial-gradient(120% 80% at 50% 0%, #4a2a64 0%, #1a1230 55%, #09070f 100%); }
.run-dots { display: flex; gap: 6px; margin: 4px 0 18px; }
.run-dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .2); transition: .3s; }
.run-dots i.ok { background: #33d58e; }
.run-dots i.on { width: 22px; background: #fff; }
.run-prog { stroke: url(#rg); }
.run-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.run-emoji { font-size: 56px; line-height: 1; }
.run-center b { font-size: 40px; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.run-center b.over { color: #ffb340; }
.run-name { margin-bottom: 18px !important; }
.small-row { margin-top: 12px; }
.small-row .btn { height: 38px; font-size: 14px; flex: 0 1 auto; }
.run-next { margin-top: 16px; }
.run-streak { font-weight: 600; margin-top: 4px; }
.run-pill { background: linear-gradient(135deg, #fc527d, #ffb340); box-shadow: 0 8px 24px rgba(252, 82, 125, .3); }

/* undo snackbar */
#undoRoot { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 85; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; transform: translateY(20px); opacity: 0; transition: transform .3s cubic-bezier(.2, .9, .25, 1), opacity .25s; }
#undoRoot.in { transform: none; opacity: 1; }
.snack { pointer-events: auto; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-2); max-width: 440px; }
#undoRoot:not(.in) .snack { pointer-events: none; }
.snack button { height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font-weight: 700; font-size: 14px; }


/* ======================= v3: cloud, beta, extension ======================= */
.beta-tag { margin-left: 6px; height: 17px; padding: 0 6px; border-radius: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; display: inline-grid; place-items: center; color: var(--accent-ink); background: var(--accent-soft); }
.beta-tag[hidden], .tb-btn[hidden] { display: none; }
.status-group { padding: 14px 16px; }
.ns { display: flex; align-items: flex-start; gap: 12px; }
.ns-icon { font-size: 24px; line-height: 1.2; flex: none; }
.ns-title { font-size: 16px; font-weight: 600; letter-spacing: -0.012em; }
.ns-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0 36px; }
.row-emoji { width: 18px; text-align: center; font-size: 17px; }
.btn.loading { opacity: .6; pointer-events: none; position: relative; }
.btn.loading::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.sync-sheet, #fJoin, #fFeedback { padding-bottom: 8px; }
.sync-hero { text-align: center; padding: 4px 8px 14px; }
.sync-hero .big-emoji { display: block; font-size: 40px; margin-bottom: 8px; }
.sync-code { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface); border-radius: var(--r-md); padding: 18px 10px; margin-bottom: 12px; user-select: all; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.steps-list { margin-top: 18px; }
.steps-list .step { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; }
.steps-list .step p { font-size: 15px; padding-top: 2px; }
.ob-join { display: block; margin: 6px auto 0; }
#updateRoot { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 58px); z-index: 75; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; transform: translateY(-12px); opacity: 0; transition: .3s cubic-bezier(.2, .9, .25, 1); }
#updateRoot.in { transform: none; opacity: 1; }
.update-bar { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 600; box-shadow: 0 8px 28px rgba(97, 97, 255, .35); }
.update-bar button { height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: #fff; color: var(--accent-ink); font-weight: 700; font-size: 14px; }

/* PC extension popup: a fixed 400×600 window */
html.popup body { width: 400px; min-height: 600px; }
html.popup .tabbar-inner, html.popup .topbar-inner, html.popup main#view { max-width: 400px; }
html.popup .lt h1 { font-size: 28px; }
html.popup .ring-wrap { transform: scale(.92); margin: -8px auto; }
html.popup .sheet { max-height: 560px; }
html.popup #toastRoot { padding: 0 8px; }
html.ext .tabbar { padding-bottom: 0; }

/* ---------- alert dialog ---------- */
.dlg-wrap { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .3); opacity: 0; transition: opacity .2s; }
.dlg-wrap.in { opacity: 1; }
.dlg { width: 100%; max-width: 280px; border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-2); overflow: hidden; text-align: center; transform: scale(1.08); transition: transform .25s cubic-bezier(.2, .9, .25, 1.1); }
.dlg-wrap.in .dlg { transform: none; }
.dlg p { padding: 20px 18px 18px; font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.dlg-btns { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid var(--line); }
.dlg-btns button { height: 46px; font-size: 16px; color: var(--accent-ink); text-align: center; }
.dlg-btns button + button { border-left: .5px solid var(--line); }
.dlg-btns button:active { background: var(--fill-2); }
.dlg-btns .danger { color: var(--bad); font-weight: 600; }
.dlg-btns .strong { font-weight: 600; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .lt h1 { font-size: 40px; }
  .card { padding: 24px; }
  .chip-scroll, .habit-row { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
}
@media (hover: hover) {
  .btn:hover { filter: brightness(1.05); }
  .chip:hover, .cat-tile:hover, .quick:hover { filter: brightness(.97); }
  .tl-block:hover { filter: brightness(.97); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
