/* ─── ASCEND · design system ────────────────────────────────────────────────
   Dark-first liquid glass. Apple HIG spacing, SF Pro system stack. */

:root {
  --bg: #050508;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.085);
  --text: #f5f5f7;
  --text-2: rgba(235, 235, 245, 0.62);
  --text-3: rgba(235, 235, 245, 0.38);
  --accent: #f5f5f7;
  --accent2: #c7c7cf;
  --on-accent: #0b0b0f;
  --blue: #0a84ff;
  --danger: #ff453a;
  --radius: 26px;
  --radius-s: 16px;
  --tabbar-h: 78px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
input, textarea, select { user-select: text; }

/* living background (canvas injected by js/background.js) */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }

/* ─── Liquid Glass material ──────────────────────────────────────────────────
   Four layers: frost (backdrop blur+saturate), lensing (SVG refraction filter,
   Chromium only — html.glass-refract), rim light (inset highlights), and a
   specular sheen that tracks the light source via --lx/--ly (pointer/gyro). */
:root { --lx: 50%; --ly: 30%; }

.lg {
  position: relative;
  isolation: isolate;
}
.glass-refract .lg {
  backdrop-filter: blur(18px) saturate(1.65) url(#liquid-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.65);
}
.glass-fallback .lg {
  backdrop-filter: blur(22px) saturate(1.65);
  -webkit-backdrop-filter: blur(22px) saturate(1.65);
}
/* quiet rim light — a single hairline top highlight, nothing that moves */
.card, .lg {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* layout */
#view {
  max-width: 660px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 18px calc(var(--tabbar-h) + 30px + env(safe-area-inset-bottom));
}
.view { display: flex; flex-direction: column; gap: 14px; }
.view.enter { animation: viewIn 0.42s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(0.992); } }

/* typography */
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.022em; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.018em; }
h3 { font-size: 16px; font-weight: 650; letter-spacing: -0.012em; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.sub { font-size: 13.5px; color: var(--text-2); }
.big { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }

/* header — centered iOS-style title; 3-column grid, collisions impossible */
.vhead {
  display: grid;
  grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  min-height: 52px;
  padding: 8px 0 4px;
}
.vhead-center { grid-column: 2; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.vhead-center h1 { overflow-wrap: anywhere; }
.vhead-left  { justify-self: start; display: flex; gap: 8px; }
.vhead-right { justify-self: end; display: flex; gap: 8px; }

/* compact bar — fades in when the large title scrolls away */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 55;
  display: flex; align-items: center; justify-content: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  font-size: 16px; font-weight: 650; letter-spacing: -0.01em;
  background: rgba(14, 14, 18, 0.72);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  opacity: 0; transform: translateY(-100%);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
body.scrolled #topbar { opacity: 1; transform: translateY(0); }

/* scroll reveal — sections below the fold rise in as they enter */
.pre-reveal { opacity: 0; transform: translateY(22px); }
.pre-reveal.reveal {
  opacity: 1; transform: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: transform 0.25s var(--ease);
}
.avatar:active { transform: scale(0.92); }

/* glass card — flat iOS grouped-card fill, no gradients */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
}
.card.pad { padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.card-head h3 { flex: 1; }

/* rows / grids */
.row { display: flex; align-items: center; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* pills */
.pill {
  font-size: 12.5px; font-weight: 650; padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.09); color: var(--text-2); white-space: nowrap;
}
.pill.up, .pill.down { color: var(--text); background: rgba(255, 255, 255, 0.12); }

/* icons */
.ic { display: inline-flex; width: 22px; height: 22px; flex-shrink: 0; }
.ic svg { width: 100%; height: 100%; }
.ic.dim { color: var(--text-3); }
.tile {
  display: inline-grid; place-items: center; border-radius: 12px; flex-shrink: 0;
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  color: var(--tc);
  border: 1px solid color-mix(in srgb, var(--tc) 22%, transparent);
}
.tile .ic { width: 55%; height: 55%; }
.tile-letter { font-weight: 700; font-size: 17px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em;
  padding: 13px 20px; border-radius: 18px; border: 1px solid transparent;
  cursor: pointer; color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  transition: transform 0.22s var(--ease), background 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.965); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
html[data-theme="midnight"] .btn.primary, html[data-theme="ember"] .btn.primary { color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, 0.07); border-color: var(--stroke); }
.btn.danger { background: rgba(255, 69, 58, 0.9); }
.btn.danger.ghost { background: rgba(255, 69, 58, 0.12); color: #ff6b61; border-color: rgba(255, 69, 58, 0.25); }
.btn.small { font-size: 13.5px; padding: 8px 14px; border-radius: 13px; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--stroke); color: var(--text);
  cursor: pointer; transition: transform 0.22s var(--ease); flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn.accent { background: rgba(255, 255, 255, 0.14); color: var(--text); border-color: transparent; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .ic { width: 16px; height: 16px; }

/* hero */
.hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero-side { flex: 1; min-width: 200px; }
.hero-mini { display: flex; flex-direction: column; }
.mini-num { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; display: flex; align-items: center; gap: 3px; }
.mini-lbl { font-size: 11.5px; color: var(--text-3); font-weight: 550; }
.flame-row .ic { width: 17px; height: 17px; color: var(--text-2); }

/* rings */
.ring { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.ring svg { position: absolute; inset: 0; }
.ring-fg { transition: stroke-dashoffset 1.1s var(--ease); }
.ring-center { position: relative; text-align: center; }
.ring-big { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ring-num { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.ring-lbl { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* progress bar */
.pbar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 99px; transition: width 0.9s var(--ease); }

/* coach */
.coach-row { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.coach-row p { font-size: 14.5px; color: var(--text); line-height: 1.5; }
.coach-ic { color: #64d2ff; margin-top: 1px; }

/* lists */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: none; border-left: none; border-right: none; border-top: none;
  color: inherit; font-family: inherit; text-align: left; width: 100%;
}
.list-item:last-child { border-bottom: none; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li-title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.li-sub { font-size: 12.5px; color: var(--text-2); }
.mission.done .li-title { text-decoration: line-through; color: var(--text-3); }
.group-lbl { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 2px 4px; }
button.picker-item { cursor: pointer; }

/* checkbox */
.checkbox {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  border: 1.8px solid rgba(255, 255, 255, 0.25); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  transition: all 0.28s var(--ease);
}
.checkbox .ic { width: 15px; height: 15px; }
.mission.done .checkbox, .checkbox.checked {
  background: var(--accent); color: var(--on-accent); border-color: transparent;
  animation: pop 0.34s var(--ease);
}
.checkbox.big { width: 36px; height: 36px; }
.checkbox.big .ic { width: 18px; height: 18px; }
@keyframes pop { 40% { transform: scale(1.18); } }

/* glance grid */
.glance { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.glance-card {
  display: flex; align-items: center; gap: 11px; padding: 14px;
  cursor: pointer; color: inherit; font-family: inherit; text-align: left;
  transition: opacity 0.15s;
}
.glance-card:active { opacity: 0.6; }
.glance-txt { display: flex; flex-direction: column; min-width: 0; }
.glance-val { font-size: 15.5px; font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-lbl { font-size: 12px; color: var(--text-3); font-weight: 550; }

/* pillars */
.pillar-row { display: flex; justify-content: space-between; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pillar-row::-webkit-scrollbar { display: none; }
.pillar-item { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; min-width: 64px; }
.pillar-pct { font-size: 13px; font-weight: 700; }
.pillar-name { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* heatmap */
.heatmap { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.heatmap::-webkit-scrollbar { display: none; }
.hm-grid { display: grid; gap: 3.5px; width: max-content; }
.hm-cell { width: 11px; height: 11px; border-radius: 3.5px; background: rgba(255, 255, 255, 0.06); }
.hm-cell.l1 { background: color-mix(in srgb, var(--hc) 30%, transparent); }
.hm-cell.l2 { background: color-mix(in srgb, var(--hc) 52%, transparent); }
.hm-cell.l3 { background: color-mix(in srgb, var(--hc) 76%, transparent); }
.hm-cell.l4 { background: var(--hc); box-shadow: 0 0 8px color-mix(in srgb, var(--hc) 50%, transparent); }

/* quote */
.quote-card { position: relative; padding-top: 22px; }
.quote-ic { position: absolute; top: 16px; right: 18px; color: rgba(255, 255, 255, 0.14); width: 30px; height: 30px; }
.quote { font-size: 17px; font-weight: 550; letter-spacing: -0.012em; line-height: 1.5; font-style: italic; padding-right: 30px; }
.quote-author { margin-top: 8px; font-size: 13px; color: var(--text-3); font-weight: 600; }

/* welcome */
.welcome { background: rgba(255, 255, 255, 0.05); }

/* segmented control */
.seg { display: flex; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke); border-radius: 15px; padding: 3px; gap: 2px; }
.seg-btn {
  flex: 1; padding: 9px 8px; font-size: 14px; font-weight: 620; color: var(--text-2);
  background: none; border: none; border-radius: 12px; cursor: pointer; font-family: inherit;
  transition: all 0.25s var(--ease); white-space: nowrap;
}
.seg-btn.on { background: rgba(255, 255, 255, 0.13); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }

/* weekday chips */
.day-chips { display: flex; gap: 7px; }
.day-chip {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke);
  color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.22s var(--ease);
}
.day-chip.on {
  background: var(--accent);
  color: var(--on-accent); border-color: transparent;
}
html[data-theme="mono"] .day-chip.on { color: #111; }

/* week strip */
.week-strip { display: flex; justify-content: space-between; gap: 4px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; }
.ws-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; transition: background 0.4s; }
.ws-day.today .ws-dot { outline: 2px solid rgba(255, 255, 255, 0.3); outline-offset: 2px; }
.ws-lbl { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* habit card */
.habit-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-mini {
  background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius-s);
  padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.stat-v { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.stat-l { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
@media (max-width: 420px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field-label { font-size: 12.5px; font-weight: 650; color: var(--text-2); padding-left: 3px; }
.input, textarea.input, select.input {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke);
  border-radius: 14px; padding: 12px 14px; outline: none;
  transition: border-color 0.2s, background 0.2s;
  appearance: none; -webkit-appearance: none;
}
.input:focus { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.09); }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { resize: vertical; min-height: 90px; }

/* sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 620px; max-height: 88dvh; overflow-y: auto;
  background: rgba(28, 28, 32, 0.9);
  border: 1px solid var(--stroke); border-bottom: none;
  border-radius: 30px 30px 0 0;
  backdrop-filter: blur(40px) saturate(1.6); -webkit-backdrop-filter: blur(40px) saturate(1.6);
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(60px); transition: transform 0.38s var(--ease);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.5);
}
.sheet-backdrop.show .sheet { transform: translateY(0); }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); margin: 4px auto 12px; }
.sheet-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-title h2 { font-size: 20px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-sec { font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 10px; }
body.sheet-open { overflow: hidden; }

/* toast */
.toast {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; z-index: 80;
  transform: translate(-50%, -80px); transition: transform 0.42s var(--ease);
  background: rgba(40, 40, 46, 0.92); border: 1px solid var(--stroke);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-radius: 20px; padding: 12px 22px; text-align: center; min-width: 180px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.toast.show { transform: translate(-50%, 0); }
.toast-msg { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.toast-sub { font-size: 12.5px; color: var(--text-2); }

/* celebrate */
.celebrate {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.35s var(--ease); padding: 30px;
}
.celebrate.show { opacity: 1; }
.celebrate-card {
  position: relative; width: 100%; max-width: 340px; text-align: center;
  background: rgba(30, 30, 36, 0.92); border: 1px solid var(--stroke); border-radius: 32px;
  padding: 36px 26px 26px; overflow: hidden;
  transform: scale(0.86); transition: transform 0.45s var(--ease);
}
.celebrate.show .celebrate-card { transform: scale(1); }
.celebrate-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  animation: glowPulse 2.4s ease-in-out infinite;
}
@keyframes glowPulse { 50% { opacity: 0.55; transform: translateX(-50%) scale(1.15); } }
.celebrate-icon { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--text); position: relative; }
.celebrate-icon svg { width: 100%; height: 100%; }
.celebrate-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.celebrate-title { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; margin-top: 4px; }
.celebrate-sub { font-size: 14px; color: var(--text-2); margin-top: 6px; }

/* gym */
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-2); animation: livePulse 1.8s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: 0.4; } }
.rest-bar { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.rest-time { flex: 1; text-align: right; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rest-bar.done .rest-time { color: var(--text); }
.set-head, .set-row { display: grid; grid-template-columns: 44px 1fr 1fr 36px; gap: 9px; align-items: center; }
.set-head { font-size: 10.5px; font-weight: 700; color: var(--text-3); letter-spacing: 0.06em; padding: 4px 2px; }
.set-row { margin-bottom: 7px; }
.set-row .input { padding: 10px 12px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.set-num { text-align: center; font-size: 14px; font-weight: 700; color: var(--text-3); }
.set-num.pr { color: var(--text); font-weight: 800; }
.sess-ex { padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.sess-ex:last-child { border-bottom: none; }
.plate-out { margin-top: 10px; font-size: 15px; font-weight: 650; color: var(--accent); }

/* life hub */
.hub-grid { display: flex; flex-direction: column; gap: 12px; }
.hub-card { display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; color: inherit; font-family: inherit; text-align: left; transition: opacity 0.15s; }
.hub-card:active { opacity: 0.6; }
.pb-row { display: grid; grid-template-columns: 96px 1fr 44px; gap: 12px; align-items: center; padding: 7px 0; }
.pb-name { font-size: 13.5px; font-weight: 620; color: var(--text-2); }
.pb-val { font-size: 13.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* macros */
.macro-row { display: grid; grid-template-columns: 60px 1fr 76px; gap: 10px; align-items: center; padding: 5px 0; }
.macro-name { font-size: 13px; font-weight: 650; color: var(--text-2); }
.macro-val { font-size: 12.5px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* journal */
.journal-text { font-size: 15px; line-height: 1.55; margin-top: 8px; white-space: pre-wrap; }

/* meditation overlay */
.med-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #0d1b2a 0%, #050508 75%);
  opacity: 0; transition: opacity 0.5s var(--ease);
}
.med-overlay.show { opacity: 1; }
.med-inner { display: flex; flex-direction: column; align-items: center; }
.med-time { font-size: 15px; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; margin-bottom: 34px; }
.orb-wrap { width: 240px; height: 240px; display: grid; place-items: center; }
.orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(160, 230, 255, 0.9), rgba(60, 130, 246, 0.55) 55%, rgba(90, 60, 220, 0.35));
  box-shadow: 0 0 70px rgba(100, 180, 255, 0.4), 0 0 140px rgba(120, 90, 240, 0.25);
  transition-property: transform; transition-timing-function: ease-in-out;
  transform: scale(0.72);
}
.orb.grow { transform: scale(1.35); }
.orb.shrink { transform: scale(0.72); }
.med-phase { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; margin-top: 30px; }

/* goals */
.goal-row { padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; gap: 8px; }
.goal-row:last-child { border-bottom: none; }

/* traits */
.trait-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.trait-row:last-child { border-bottom: none; }
.trait-name { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.stars { display: inline-flex; gap: 2px; }
.star { color: rgba(255, 255, 255, 0.16); font-size: 15px; }
.star.on { color: var(--text); }

/* awards */
.award-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 8px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); opacity: 0.4; }
.award.on { opacity: 1; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); }
.award-name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.award-desc { font-size: 11px; color: var(--text-3); }

/* charts */
.chart { width: 100%; display: block; }

/* tab bar — docked full-width, iOS native style */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(16, 16, 20, 0.8);
  border: none; border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 0; box-shadow: none;
  backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; max-width: 96px; padding: 6px 4px; border-radius: 12px;
  background: none; border: none; cursor: pointer; color: var(--text-3); font-family: inherit;
  transition: color 0.25s, opacity 0.15s;
}
.tab:active { opacity: 0.6; }
.tab.on { color: var(--text); }
.tab.on .ic { color: var(--text); }
.tab-lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }

/* desktop: side rail */
@media (min-width: 940px) {
  #view { max-width: 720px; padding-left: 120px; }
  #tabbar {
    left: 26px; right: auto; top: 50%; bottom: auto; transform: translateY(-50%);
    flex-direction: column; gap: 6px; padding: 10px 8px;
    border: 1px solid var(--stroke); border-radius: 26px;
    background: rgba(20, 20, 24, 0.7);
  }
  .tab { flex: none; }
  .glance { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* themes: background palette + accent */
html[data-theme="midnight"] { --accent: #0a84ff; --accent2: #5e5ce6; }
html[data-theme="ember"]    { --accent: #ff9f0a; --accent2: #ff375f; }
html[data-theme="mono"]     { --accent: #e5e5ea; --accent2: #98989f; }
html[data-theme="mono"] .btn.primary { color: #111; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
