/* Home dashboard, home-ui.js. Bevel-style daily overview in Ascension green. */
:root {
  --hm-effort: #f59e0b;
  --hm-readiness: var(--accent);
  --hm-sleep: #6366f1;
  --hm-z2: #14b8a6;
}

/* Layout: phone is one column in the hm-oN order; desktop is two columns. */
.hm-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.hm-col { display: contents; }
.hm-o1 { order: 1; } .hm-o2 { order: 2; } .hm-o3 { order: 3; } .hm-o4 { order: 4; } .hm-o5 { order: 5; }
.hm-o6 { order: 6; } .hm-o7 { order: 7; } .hm-o8 { order: 8; } .hm-o9 { order: 9; } .hm-o10 { order: 10; } .hm-o11 { order: 11; }
@media (min-width: 900px) {
  .hm-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0 22px; align-items: start; }
  .hm-col { display: flex; flex-direction: column; min-width: 0; }
}
.hm-grid > .hm-col > div:empty { display: none; }

.hm-section { margin-bottom: 22px; }
.hm-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 12px; }
.hm-section-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.hm-section .panel { margin-bottom: 12px; }
.hm-section .panel:last-child, .hm-section .hero-dark:last-child { margin-bottom: 0; }

button.panel, .hm-mon, .hm-card, .hm-ring, .hm-tl-row {
  font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
button.panel { width: 100%; display: block; }
button.panel:hover, .hm-tl-row:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
button.panel:active, .hm-ring:active, .hm-tl-row:active { transform: scale(0.99); }
.hm-arrow { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.hm-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

.hm-status { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 700; color: var(--muted); }
.hm-status svg { width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: var(--accent); fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.hm-status.good { color: var(--accent-dark); }
.hm-status.warn { color: var(--hl-warn, #d97706); }
.hm-status.bad { color: var(--danger); }
.hm-status-big { font-size: 20px; font-weight: 700; margin-bottom: 6px; }

/* ---------- daily overview ---------- */
.hm-overview { padding: 0; overflow: hidden; }
.hm-rings { display: grid; grid-template-columns: repeat(3, 1fr); padding: 22px 10px 18px; background: var(--panel); }
.hm-rings > .hm-ring + .hm-ring { border-left: 1px solid var(--border); }
.hm-ring { background: none; border: 0; padding: 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-radius: 0; }
.hm-ring-dial { position: relative; width: min(112px, 26vw); }
.hm-ring-dial .dr { width: 100%; }
.hm-ring-dial b { font-size: clamp(18px, 5.2vw, 25px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hm-ring-dial b small { font-size: 0.55em; font-weight: 700; margin-left: 1px; }
.hm-ring-label { font-size: 15px; font-weight: 700; color: var(--muted); margin-top: -4px; }
.hm-ring-sub { font-size: 11.5px; font-weight: 700; color: var(--accent-dark); margin-top: -8px; text-align: center; white-space: nowrap; }
.hm-ring-sub.sleep { color: var(--hm-sleep); }
.hm-ring.effort .hm-ring-sub { color: var(--accent-dark); }
.hm-ring.is-empty b { color: var(--muted); }
.hm-coach { padding: 16px 22px 20px; background: var(--panel-2); border-top: 1px solid var(--border); }
.hm-coach p { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 500; }

/* ---------- today's plan (dark hero) ---------- */
.hm-plan { margin-bottom: 0; }
.hm-ex-list { margin: 16px 0 4px; display: grid; gap: 2px; }
.hm-ex { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.hm-ex span { color: rgba(255, 255, 255, 0.82); min-width: 0; }
.hm-ex b { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-ex b.up { color: var(--acc-400); }
.hm-ex b.down { color: #fbbf24; }
.hm-ex.more { color: rgba(255, 255, 255, 0.55); border: 0; }
.hm-plan-cardio { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); }
.hm-plan-cardio div { display: flex; flex-direction: column; }
.hm-plan-cardio b { font-size: 15px; }
.hm-plan-cardio span:not(.icon-tile) { font-size: 13px; color: rgba(255, 255, 255, 0.65); }
.hm-plan-cardio.done b { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.4); }
.hm-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.hm-week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.55); }
.hm-week-day i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.hm-week-day.planned i { background: transparent; border: 2px solid rgba(255, 255, 255, 0.45); }
.hm-week-day.done i { background: var(--accent); }
.hm-week-day.missed i { background: rgba(239, 68, 68, 0.8); }
.hm-week-day.is-today { color: #fff; }
.hm-week-day.is-today i { box-shadow: 0 0 0 3px rgba(var(--acc-500-rgb), 0.35); }
.hm-week-day.today i { background: transparent; border: 2px solid var(--accent); }

/* ---------- stress & energy ---------- */
.hm-card { padding: 20px 22px; border: 0; }
.hm-card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.hm-card-title .hm-arrow { margin-left: auto; }
.hm-card-title .ico { width: 18px; height: 18px; color: var(--muted); }
.hm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hm-dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px var(--hl-warn-soft, #fef3c7); }
.hm-stress { display: flex !important; align-items: center; gap: 12px; }
.hm-card-text { flex: 1; min-width: 0; }
.hm-trio { display: flex; gap: 0; margin-top: 14px; }
.hm-trio > div { display: flex; flex-direction: column; padding: 0 12px; white-space: nowrap; border-left: 1px solid var(--border); }
.hm-trio > div:first-child { padding-left: 0; border-left: 0; }
.hm-trio b { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.hm-trio b.warn { color: #eab308; } .hm-trio b.good { color: var(--hm-z2); }
.hm-trio span { font-size: 13px; color: var(--muted); font-weight: 600; }
.hm-gauge { position: relative; width: 92px; flex-shrink: 0; display: grid; place-items: center; }
.hm-gauge .tl-dial { width: 100%; display: block; }
.hm-gauge b { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-size: 22px; font-weight: 700; line-height: 1; }
.hm-gauge span { position: absolute; left: 0; right: 0; top: 62%; text-align: center; font-size: 10.5px; font-weight: 700; }
.hm-energy { display: block !important; padding: 16px 20px 12px; }
.hm-energy-head { display: flex; align-items: center; gap: 8px; }
.hm-energy-title { font-size: 16px; font-weight: 700; margin-right: auto; }
.hm-bolt { width: 20px; height: 20px; fill: #3b82f6; flex-shrink: 0; }
.hm-energy-head > b { font-size: 22px; font-weight: 700; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.hm-chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.hm-chip.good { background: var(--accent-soft); color: var(--accent-dark); }
.hm-chip.bad { background: #fee2e2; color: #b91c1c; }
:root[data-theme="dark"] .hm-chip.bad { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.hm-meter { position: relative; height: 40px; margin-top: 8px; }
.hm-meter-track, .hm-meter-fill { position: absolute; left: 0; top: 14px; height: 6px; border-radius: 99px; }
.hm-meter-track { right: 0; background: var(--panel-2); box-shadow: inset 0 1px 2px rgba(var(--n-ink-rgb), 0.08); }
.hm-meter-fill { background: linear-gradient(90deg, #93c5fd, #2563eb); }
.hm-meter-cap { position: absolute; top: 10px; width: 3px; height: 14px; border-radius: 2px; background: #d6d9de; }
.hm-meter-cap.lo { left: -1px; } .hm-meter-cap.hi { right: -1px; }
.hm-meter-peak { position: absolute; top: 9px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; background: #9ca3af; }
.hm-meter-peak em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 1px; font-size: 10px; font-style: normal; font-weight: 700; color: var(--muted); white-space: nowrap; }
.hm-meter-knob { position: absolute; top: 17px; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 3px rgba(var(--n-ink-rgb), 0.3); }
.hm-meter-knob::after { content: ''; position: absolute; inset: 3.5px; border-radius: 50%; background: #2563eb; }
.hm-meter-scale { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; color: var(--muted); opacity: 0.8; font-variant-numeric: tabular-nums; }

/* ---------- training ---------- */
.hm-pair { display: grid; gap: 12px; }
@media (min-width: 560px) and (max-width: 899px) { .hm-pair { grid-template-columns: 1fr 1fr; } }
.hm-pair > .panel { margin: 0; }
.hm-load { display: flex !important; align-items: flex-end; gap: 12px; }
.hm-load .hm-card-text { align-self: stretch; display: flex; flex-direction: column; }
.hm-load-value { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; margin-top: auto; padding-top: 18px; line-height: 1; }
.hm-spark { width: 46%; height: 84px; flex-shrink: 0; overflow: visible; }
.hm-spark path { fill: none; stroke: #8b5cf6; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hm-spark-band { fill: rgba(139, 92, 246, 0.14); }
.hm-spark circle { fill: #fff; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
.hm-cardio { display: flex !important; flex-direction: column; gap: 8px; }
.hm-cardio .hm-card-title { margin-bottom: 4px; }
.hm-cardio-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; color: var(--muted); }
.hm-cardio-row b { color: var(--text); font-size: 18px; font-weight: 700; }
.hm-cardio-row small { color: var(--muted); font-size: 13px; font-weight: 600; }
.hm-bar { height: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.hm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hm-bar i.z2 { background: var(--hm-z2); }
.hm-bar i.warn { background: #f59e0b; }
.hm-bar i.bad { background: var(--danger); }

/* ---------- health monitor ---------- */
.hm-mon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hm-mon-grid > .hm-mon:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* A touch more lift than --shadow so the tiles don't look flat. */
.hm-mon { box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.05), 0 8px 24px rgba(var(--n-ink-rgb), 0.08); }
.hm-mon { display: flex !important; align-items: stretch; gap: 8px; padding: 18px 16px 18px 20px; border: 0; margin: 0 !important; min-height: 132px; }
.hm-mon-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-mon-title { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 700; color: var(--muted); }
.hm-mon-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hm-mon-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 10px 0 6px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hm-mon-value small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.hm-mon.is-empty .hm-mon-value { color: var(--muted); opacity: 0.6; }
.hm-mon .hm-status { font-size: 14px; margin-top: auto; }
.hm-pill { position: relative; width: 28px; flex-shrink: 0; border-radius: 99px; margin: 2px 0; background: linear-gradient(90deg, var(--n-bg), #f8f9fa 55%, var(--n-badge)); box-shadow: inset 0 1px 3px rgba(var(--n-ink-rgb), 0.07), inset 0 -1px 0 rgba(255, 255, 255, 0.9); }
.hm-pill i { position: absolute; left: 50%; width: 8px; margin-left: -4px; border-radius: 99px; }
.hm-pill-band { top: 20%; bottom: 20%; background: linear-gradient(#7dd3c0, var(--acc-mint)); }
.hm-pill-cap { height: 6px; background: #cdeedc; }
.hm-pill-cap.top { top: 9%; }
.hm-pill-cap.bot { bottom: 9%; }
.hm-pill.is-high .hm-pill-cap.top, .hm-pill.is-low .hm-pill-cap.bot { background: var(--hot, #f5b14c); }
/* Out of range: the band shades from green toward --hot at the end the value moved past (oklch keeps the blend warm, not muddy). */
.hm-pill.is-high .hm-pill-band { background: linear-gradient(var(--hot, #f59e0b), #7dd3c0 62%, var(--acc-mint)); background: linear-gradient(in oklch, var(--hot, #f59e0b), #7dd3c0 62%, var(--acc-mint)); }
.hm-pill.is-low .hm-pill-band { background: linear-gradient(#7dd3c0, var(--acc-mint) 38%, var(--hot, #f59e0b)); background: linear-gradient(in oklch, #7dd3c0, var(--acc-mint) 38%, var(--hot, #f59e0b)); }
.hm-pill-empty { top: 10%; bottom: 10%; background: var(--n-seg); }
.hm-pill b { position: absolute; left: 50%; width: 15px; height: 15px; margin-left: -7.5px; border-radius: 50%; background: #fff; border: 3px solid #4fb98a; box-sizing: border-box; box-shadow: 0 1px 4px rgba(var(--n-ink-rgb), 0.18); z-index: 1; }
.hm-pill.is-high b, .hm-pill.is-low b { border-color: var(--hot, #f59e0b); }
:root[data-theme="dark"] .hm-pill { background: var(--panel-2); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4); }
:root[data-theme="dark"] .hm-pill-empty { background: var(--d-line); }
:root[data-theme="dark"] .hm-pill-cap { background: rgba(111, 207, 151, 0.3); }
.hm-connect { margin-bottom: 22px; }

/* ---------- habits ---------- */
.hm-habits { display: grid; gap: 12px; }
.hm-habits > .panel { margin: 0; }
.hm-habit { display: flex !important; padding: 14px 18px; }
.hm-habit .ring b { font-size: 15px; }
.hm-habit-ring { width: 72px; }
.hm-habit-ring b { font-size: 14px; font-weight: 700; }
.hm-steps { align-items: center; gap: 14px; }
.hm-steps .hm-habit-ring { width: 84px; }
.hm-steps-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hm-steps-num { display: flex; align-items: baseline; gap: 6px; }
.hm-steps-num b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hm-steps-num span { font-size: 14px; font-weight: 600; color: var(--muted); }
.hm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hm-mini-bars { position: relative; display: flex; align-items: flex-end; gap: 5px; height: 28px; margin-top: 2px; }
.hm-mini-bars span { width: 10px; border-radius: 4px; background: var(--acc-200); }
.hm-mini-bars span.hit { background: var(--accent); }
.hm-mini-bars span.today { box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent); }
.hm-mini-goal { position: absolute; left: 0; width: 100px; border-top: 1.5px dashed #b7bcc4; }
:root[data-theme="dark"] .hm-mini-bars span { background: rgba(var(--acc-500-rgb), 0.3); }
:root[data-theme="dark"] .hm-mini-bars span.hit, :root[data-theme="dark"] .hm-mini-bars span.today { background: var(--accent); }

/* ---------- timeline ---------- */
.hm-timeline { padding: 10px 14px 14px; }
.hm-tl-row { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; border-radius: 18px; padding: 10px 8px; }
.hm-tl-row + .hm-tl-row { border-top: 1px solid var(--border); border-radius: 0; }
.hm-tl-row.is-planned { opacity: 0.7; }
.hm-tl-main { flex: 1; min-width: 0; }
.hm-tl-title { font-weight: 700; font-size: 16px; }
.hm-tile-purple { background: #eef2ff; color: var(--hm-sleep); }
.hm-tile-purple .ico { stroke: var(--hm-sleep); }
:root[data-theme="dark"] .hm-tile-purple { background: rgba(99, 102, 241, 0.18); }
.hm-tl-all { width: 100%; margin-top: 8px; justify-content: center; }

/* ---------- this week ---------- */
.hm-week-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hm-week-stats .stat-card { min-height: 104px; padding: 16px; }
.hm-week-stats .stat-value { font-size: 22px; }
@media (max-width: 420px) { .hm-week-stats .stat-label { font-size: 12px; } .hm-week-stats .stat-value { font-size: 19px; } }

/* ---------- sheets ---------- */
.hm-sheet-ring { display: flex; justify-content: center; margin: 4px 0 14px; }
.hm-sheet-ring .hm-ring { cursor: default; }
.hm-sheet-ring .hm-ring-dial { width: 150px; }
.hm-sheet-ring .hm-ring-dial b { font-size: 38px; }
.hm-sheet-ring .hm-ring-label { display: none; }
.hm-sheet-value { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.hm-sheet-value small { font-size: 18px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.hm-chart { margin: 8px 0 12px; }
.hm-chart svg { width: 100%; height: 180px; display: block; overflow: visible; }
.hm-chart rect { fill: var(--accent); }
.hm-c-band, .hm-chart rect.hm-c-band { fill: var(--accent-soft); }
.hm-c-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hm-c-dot { fill: var(--panel); stroke-width: 3; vector-effect: non-scaling-stroke; }
.hm-chart-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.hm-factors { display: grid; gap: 10px; }
.hm-factor { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.hm-factor b { text-align: right; font-variant-numeric: tabular-nums; }
.hm-stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; }
.hm-stack i, .hm-legend i { background: var(--hl-light); }
.hm-stack i.deep, .hm-legend i.deep { background: var(--hl-deep); }
.hm-stack i.rem, .hm-legend i.rem { background: var(--hl-rem); }
.hm-stack i.awake, .hm-legend i.awake { background: var(--hl-awake); }
.hm-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.hm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hm-legend b { color: var(--text); }
.hm-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }


/* 75 Hard habit card (home-ui.js hard75CardHtml) */
.hm-h75 { flex-direction: column; align-items: stretch !important; gap: 12px; }
.hm-h75-top { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.hm-h75-text { flex: 1; min-width: 0; }
.hm-h75-segs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.hm-h75-segs i { height: 6px; border-radius: 3px; background: var(--n-soft); }
.hm-h75-segs i.on { background: var(--acc-500); }
.hm-h75-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-h75-chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.hm-h75-chip.blue { background: #dbeafe; color: #1d4ed8; }
.hm-h75-chip.amber { background: #fef3c7; color: #92400e; }
.hm-h75-chip.dark { background: var(--n-hero); color: #fff; }
.hm-h75-chip.green { background: var(--acc-100); color: var(--acc-700); }
.hm-h75-chip.purple { background: #f3e8ff; color: #6b21a8; }
:root[data-theme="dark"] .hm-h75-segs i { background: var(--d-line); }
:root[data-theme="dark"] .hm-h75-segs i.on { background: var(--acc-500); }
:root[data-theme="dark"] .hm-h75-chip.blue { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
:root[data-theme="dark"] .hm-h75-chip.amber { background: rgba(217, 119, 6, 0.2); color: #fcd34d; }
:root[data-theme="dark"] .hm-h75-chip.dark { background: #f4f5f6; color: var(--n-ink); }
:root[data-theme="dark"] .hm-h75-chip.green { background: rgba(var(--acc-500-rgb), 0.16); color: var(--acc-400); }
:root[data-theme="dark"] .hm-h75-chip.purple { background: rgba(126, 34, 206, 0.22); color: #d8b4fe; }

/* Steps sheet (home-ui.js stepsSheetHtml). */
.sp-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 16px 14px; border-radius: 24px; background: var(--panel); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.04), 0 8px 24px rgba(var(--n-ink-rgb), 0.07); margin: 12px 0; }
.sp-ring { width: 220px; filter: drop-shadow(0 0 8px rgba(var(--acc-500-rgb), 0.25)); }
.sp-ring .dr-in b { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.sp-ring .dr-in span { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.sp-legend { display: flex; gap: 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.sp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sp-legend i { width: 10px; height: 10px; border-radius: 50%; }
.sp-legend i.you { background: var(--acc-500); box-shadow: 0 0 6px rgba(var(--acc-500-rgb), 0.6); }
.sp-legend i.pace { background: var(--acc-200); }
.sp-legend i.avg { background: var(--panel); box-shadow: inset 0 0 0 2px var(--acc-600); }
.sp-pace { background: var(--n-hero); color: #fff; border-radius: 22px; padding: 16px 18px; box-shadow: 0 16px 32px -16px rgba(var(--n-ink-rgb), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.sp-pace-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sp-pace-top b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.sp-pace-top span { font-size: 13px; font-weight: 600; color: var(--n-line); }
.sp-pace p { margin: 8px 0 12px; font-size: 13px; line-height: 1.5; color: #e4e6ea; }
.sp-good { color: var(--acc-400); text-shadow: 0 0 18px rgba(var(--acc-400-rgb), 0.45); }
.sp-warn { color: #fbbf24; text-shadow: 0 0 18px rgba(251, 191, 36, 0.4); }
.sp-pace-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sp-pace-nums div { display: flex; flex-direction: column; gap: 2px; }
.sp-pace-nums em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--n-faint); }
.sp-pace-nums b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.sp-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; background: var(--panel); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.04), 0 8px 24px rgba(var(--n-ink-rgb), 0.07); }
.sp-tile span { font-size: 12px; font-weight: 600; color: var(--muted); }
.sp-tile b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sp-tile b.sp-good { color: var(--acc-600); text-shadow: none; }
.sp-tile em { font-style: normal; font-size: 12px; color: var(--muted); }
.sp-week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 170px; padding: 14px 14px 10px; border-radius: 20px; background: var(--panel); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.04), 0 8px 24px rgba(var(--n-ink-rgb), 0.07); box-sizing: border-box; }
.sp-wday { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sp-wbar { position: relative; flex: 1; width: 100%; max-width: 30px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--panel-2, #f2f3f5); overflow: hidden; }
.sp-wbar i { display: block; width: 100%; border-radius: 8px; background: #cbd0d6; }
.sp-wday.hit .sp-wbar i { background: linear-gradient(180deg, var(--acc-400), var(--acc-500)); box-shadow: 0 0 10px rgba(var(--acc-500-rgb), 0.5); }
.sp-wday.today .sp-wbar { box-shadow: inset 0 0 0 2px var(--acc-500); }
.sp-wday b { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-wday span { font-size: 11px; font-weight: 600; color: var(--muted); }
.sp-week-goal { position: absolute; left: 10px; right: 10px; border-top: 1.5px dashed rgba(22, 163, 74, 0.55); pointer-events: none; z-index: 1; }
.sp-week-goal span { position: absolute; right: 0; top: -16px; font-size: 10px; font-weight: 700; color: var(--acc-600); font-style: normal; }
:root[data-theme="dark"] .sp-wbar { background: #22262b; }
:root[data-theme="dark"] .sp-wbar i { background: #4b5159; }
.sp-wbar s { position: absolute; left: -4px; right: -4px; height: 0; border-top: 1.5px dashed rgba(22, 163, 74, 0.6); z-index: 1; }
.sp-month { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 12px 12px 0; border-radius: 20px 20px 0 0; background: var(--panel); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.04), 0 8px 24px rgba(var(--n-ink-rgb), 0.07); }
.sp-month i { flex: 1; min-width: 0; border-radius: 3px 3px 0 0; background: #cbd0d6; }
.sp-month i.hit { background: var(--acc-500); box-shadow: 0 0 6px rgba(var(--acc-500-rgb), 0.4); }
.sp-month i.today { outline: 2px solid var(--acc-500); outline-offset: 1px; }
.sp-month s { position: absolute; left: 12px; right: 12px; border-top: 1.5px dashed rgba(22, 163, 74, 0.6); z-index: 1; pointer-events: none; transform: translateY(0); }
.sp-month-x { display: flex; justify-content: space-between; padding: 6px 12px 10px; margin-bottom: 14px; border-radius: 0 0 20px 20px; background: var(--panel); font-size: 11px; font-weight: 600; color: var(--muted); box-shadow: 0 8px 24px rgba(var(--n-ink-rgb), 0.07); }
:root[data-theme="dark"] .sp-month i { background: #4b5159; }

/* Tomorrow line on the plan card */
.hm-plan-next { margin-top: 12px; font-size: 12.5px; color: #c9ccd1; }
.hm-plan-next span { display: inline-block; margin-right: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--acc-400); }

/* Edit Home */
.hm-edit-foot { order: 99; display: flex; justify-content: center; margin: 4px 0 24px; grid-column: 1 / -1; }
body.hm-editing .hm-edit-foot, body.hm-editing .fab { display: none; }

/* Edit mode on Home itself: grip + hide on every card, drag to reorder */
#homeRoot.is-editing [data-hm-card] { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: grab; }
#homeRoot.is-editing [data-hm-card] > :not(.hm-ed):not(.hm-off-row) { pointer-events: none; }
#homeRoot.is-editing .hm-section-head .link, #homeRoot.is-editing .hm-section-head > .muted { visibility: hidden; }
#homeRoot.is-editing [data-hm-card]:not(.hm-off) > :not(.hm-ed) { animation: hm-ed-in .22s ease both; }
@keyframes hm-ed-in { from { opacity: .6; } to { opacity: 1; } }
.hm-ed { position: absolute; top: -12px; right: -8px; z-index: 4; display: flex; gap: 6px; animation: hm-ed-pop .2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes hm-ed-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.hm-ed-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--u-hair), 0 4px 12px rgba(var(--n-ink-rgb), .12); -webkit-tap-highlight-color: transparent; }
.hm-ed-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hm-ed-grip { cursor: grab; touch-action: none; }
.hm-ed-grip svg { fill: currentColor; stroke: none; }
.hm-ed-grip:focus-visible, .hm-ed-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-ed-show { color: var(--accent-dark); box-shadow: 0 0 0 1px var(--u-hair); }
/* A hidden card while editing: slim dashed row that keeps its place */
.hm-off-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 20px; border: 1.5px dashed rgba(var(--n-ink-rgb), .2); background: rgba(var(--n-ink-rgb), .02); }
.hm-off-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-off-text b { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.hm-off-text em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--u-faint); }
.hm-off-row .hm-ed-grip { box-shadow: none; background: transparent; color: var(--muted); }
:root[data-theme="dark"] .hm-off-row { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .02); }
/* While dragging every card shrinks to its top, so long moves stay short */
#homeRoot.is-dragging [data-hm-card]:not(.hm-off), .hm-ghost:not(.hm-off) { max-height: 116px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent 98%); mask-image: linear-gradient(#000 55%, transparent 98%); }
#homeRoot.is-dragging [data-hm-card] { cursor: grabbing; }
#homeRoot.is-dragging .hm-ed { animation: none; }
#homeRoot [data-hm-card].hm-ph > * { visibility: hidden; }
#homeRoot [data-hm-card].hm-ph { -webkit-mask-image: none; mask-image: none; }
#homeRoot [data-hm-card].hm-ph::after { content: ''; position: absolute; inset: 0 0 10px; border-radius: 24px; border: 2px dashed rgba(var(--acc-500-rgb), .45); background: rgba(var(--acc-500-rgb), .06); }
.hm-ghost { position: absolute !important; z-index: 50; margin: 0; pointer-events: none; order: 0 !important; transform: scale(1.03) rotate(-.6deg); transform-origin: 50% 20%;
  filter: drop-shadow(0 18px 30px rgba(var(--n-ink-rgb), .22)); transition: transform .15s ease; }
.hm-ghost.is-dropping { transform: none; transition: top .17s cubic-bezier(.2,.8,.2,1), transform .17s ease; }
.hm-ghost .hm-ed { animation: none; }
/* Edit bar: sits where the tab bar is on phone, bottom centre on desktop */
.hm-ed-bar { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 28px); padding: 8px; border-radius: 28px; background: var(--n-hero); color: #fff;
  box-shadow: 0 16px 40px rgba(var(--n-ink-rgb), .35); animation: hm-bar-in .24s cubic-bezier(.2,.8,.2,1) both; }
@keyframes hm-bar-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translateX(-50%); } }
.hm-ed-tip { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; min-width: 0; }
.hm-ed-reset, .hm-ed-done { border: 0; border-radius: 20px; padding: 10px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; flex: none; }
.hm-ed-reset { background: rgba(255, 255, 255, .1); color: #fff; }
.hm-ed-done { background: var(--accent); color: #fff; box-shadow: 0 6px 16px var(--accent-glow); }
@keyframes hm-bar-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  body.hm-editing .tabs { visibility: hidden; }
  .hm-ed-bar { left: 14px; right: 14px; width: auto; max-width: none; transform: none; bottom: calc(14px + env(safe-area-inset-bottom)); justify-content: space-between; animation-name: hm-bar-up; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-ed, .hm-ed-bar, #homeRoot.is-editing [data-hm-card] > * { animation: none !important; }
  .hm-ghost { transform: none; }
}
.hm-grid > .hm-col > div[hidden] { display: none; }

/* Streak sheet: hero (current/best + this week), freeze note, 16-week heatmap, totals */
.sk-hero, .sk-card { background: var(--panel); border-radius: 24px; box-shadow: var(--u-card); padding: 16px; }
.sk-hero { margin: 4px 0 12px; }
.sk-stats { display: grid; grid-template-columns: 1fr 1fr; }
.sk-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sk-stat + .sk-stat { border-left: 1px solid var(--u-hair); padding-left: 16px; }
.sk-k { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.sk-k svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sk-stat.cur .sk-k svg { color: var(--accent); }
.sk-stat b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sk-stat b small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sk-week-head { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--u-hair); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sk-week-head span:first-child { color: var(--text); font-size: 13px; }
.sk-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sk-wd { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.sk-wd i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--u-tile); }
.sk-wd i svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sk-wd.on i { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(var(--acc-500-rgb), .35); }
.sk-wd.fz i { background: #bfe3f7; color: #3b8fc0; box-shadow: inset 0 0 0 1.5px #7cc4ea; }
.sk-wd.fz i svg { stroke-width: 2; }
.sk-wd.next i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--u-hair); }
.sk-wd.open i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.sk-wd.today span { color: var(--text); }
.sk-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 20px 4px 8px; }
.sk-sec b { font-size: 15px; font-weight: 700; }
.sk-sec span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sk-heat { display: grid; grid-template-columns: 14px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 6px; row-gap: 6px; }
.sk-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--cols, 16), minmax(0, 1fr)); column-gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); height: 13px; line-height: 13px; }
.sk-months span { white-space: nowrap; overflow: visible; }
.sk-days { grid-column: 1; display: grid; grid-template-rows: repeat(7, minmax(0, 1fr)); row-gap: 3px; font-size: 10px; font-weight: 600; color: var(--muted); }
.sk-days span { display: grid; place-items: center start; }
.sk-heat .hm-heat { grid-column: 2; display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.hm-heat-col { display: contents; }
.hm-heat i, .hm-heat-scale i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--u-tile); }
.hm-heat i.l1, .hm-heat-scale i.l1 { background: rgba(var(--acc-500-rgb), .28); }
.hm-heat i.l2, .hm-heat-scale i.l2 { background: rgba(var(--acc-500-rgb), .5); }
.hm-heat i.l3, .hm-heat-scale i.l3 { background: rgba(var(--acc-500-rgb), .75); }
.hm-heat i.l4, .hm-heat-scale i.l4 { background: var(--accent); }
.hm-heat i.today { box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 3px var(--text); }
.hm-heat-key { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--u-hair); font-size: 11.5px; font-weight: 500; color: var(--muted); }
.hm-heat-scale { display: inline-flex; align-items: center; gap: 4px; }
.hm-heat-scale i { width: 11px; flex: none; border-radius: 3px; }
.hm-heat-scale i:first-child { margin-left: 2px; }
.sk-totals { margin-top: 12px; padding: 14px 16px; }

/* Painted from the last snapshot while fresh data loads */
#homeRoot { position: relative; }
#homeRoot.is-snap::before { content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: hm-snap 1.1s linear infinite; }
@keyframes hm-snap { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { #homeRoot.is-snap::before { animation: none; background: rgba(var(--acc-500-rgb), .5); } }

/* ---------- easy-day prompt (low readiness three days running) ---------- */
.hm-easy { display: flex; gap: 12px; padding: 14px 22px 18px; background: var(--panel-2); border-top: 1px solid var(--border); }
.hm-easy-ico { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(129, 140, 248, 0.16); color: #6366f1; }
.hm-easy-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.hm-easy b { font-size: 15px; }
.hm-easy p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.hm-easy-btns { display: flex; gap: 18px; margin-top: 8px; }
.hm-easy-btns .link { font-size: 14px; font-weight: 700; }
.hm-easy-btns button.link, .mo-goal button.link, .fr-sheet button.link, .fr-card button.link, .nu-bed button.link { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }

/* Streak freeze (shared/streak.js) on the activity streak sheet. */
.hm-heat i.fz, .hm-heat-scale i.fz { background: #bfe3f7; box-shadow: inset 0 0 0 1.5px #7cc4ea; }
:root[data-theme="dark"] .hm-heat i.fz, :root[data-theme="dark"] .hm-heat-scale i.fz { background: #1d3a4d; box-shadow: inset 0 0 0 1.5px #3b7fa6; }
.hm-heat-scale i.fz { margin-right: 2px; }
:root[data-theme="dark"] .sk-wd.fz i { background: #1d3a4d; color: #8fd0f2; box-shadow: inset 0 0 0 1.5px #3b7fa6; }
.hm-freeze { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(125, 196, 234, 0.16), rgba(125, 196, 234, 0.05)); border: 1px solid rgba(125, 196, 234, 0.35); }
.hm-freeze.used { background: var(--u-tile, var(--panel-2)); border-color: transparent; }
.hm-freeze-ico { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(125, 196, 234, 0.22); color: #3b8fc0; }
:root[data-theme="dark"] .hm-freeze-ico { color: #8fd0f2; }
.hm-freeze.used .hm-freeze-ico { background: var(--panel); color: var(--muted); }
.hm-freeze-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hm-freeze > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hm-freeze b { font-size: 14px; font-weight: 600; }
.hm-freeze em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.45; }
:root[data-theme="dark"] .hm-ed-bar { background: var(--panel); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 16px 40px rgba(0, 0, 0, .5); }
