/* Hearth cockpit — warm, editorial, mobile-first PWA.
   Design language: charcoal hearth-dark, ember accent used sparingly for the
   single most important action, serif numerals for warmth, geometric glyphs
   (never emoji). */

:root {
  --bg:        #17130f;
  --surface:   #201a14;
  --surface-2: #2a2219;
  --surface-3: #342a1f;
  --line:      rgba(255, 240, 220, 0.08);
  --line-2:    rgba(255, 240, 220, 0.14);
  --text:      #f4ece1;
  --muted:     #b3a793;
  --faint:     #7d7565;
  --ember:     #ff7a3c;
  --ember-2:   #ff9a5c;
  --ember-soft: rgba(255, 122, 60, 0.14);
  --gold:      #e9c46a;
  --good:      #79b06a;
  --radius:    16px;
  --radius-sm: 11px;
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
  --tap: 0 0 0 rgba(255,122,60,0);
  /* Cormorant Garamond for display + numerals (the "castle" serif); Nunito body */
  --serif: "Cormorant Garamond", ui-serif, "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ===== Castle palette (Phase 2 "Living Hearth" art direction) ===== */
  --stone:     #4a3324;   /* warm hearthstone */
  --stone-2:   #2e2016;
  --wood:      #7a5230;   /* mantel beam */
  --wood-dark: #4e321a;
  --parchment: #f6ecdd;   /* warm off-white text */
  --gold-soft: rgba(233,196,106,0.18);
  --firelight: rgba(255,140,60,0.30);
  --warm-line: rgba(233,196,106,0.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overscroll-behavior: none;
}
body {
  min-height: 100dvh;
  color: var(--parchment);
  /* Castle hearth: warm firelit stone up top fading to deep ember-dark. */
  background:
    radial-gradient(120% 66% at 50% 16%, #4a3324 0%, #2e2016 44%, #1d130c 76%, #120b06 100%);
  background-attachment: fixed;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; font-size: 16px; }
::selection { background: var(--ember-soft); }

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .flame { width: 26px; height: 26px; color: var(--ember); }
.brand h1 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600; letter-spacing: 0.2px; margin: 0;
}
.brand .sub { font-size: 12px; color: var(--faint); margin-top: -2px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line-2);
  display: grid; place-items: center; font-weight: 600; font-size: 14px;
  color: var(--muted);
}

/* ===================== Living Hearth (Phase 2 castle) ===================== */
@keyframes blink { 0%,90%,100% { transform: scaleY(1); } 94% { transform: scaleY(0.08); } }
@keyframes chomp { 0% { transform: scale(1,1); } 22% { transform: scale(1.1,0.9); } 52% { transform: scale(0.94,1.08); } 100% { transform: scale(1,1); } }
@keyframes throwFood {
  0%   { transform: translate(-70px, 96px) rotate(-20deg) scale(1);   opacity: 0; }
  16%  { opacity: 1; }
  68%  { transform: translate(2px, 6px) rotate(210deg) scale(0.92);   opacity: 1; }
  100% { transform: translate(4px, 12px) rotate(320deg) scale(0.14);  opacity: 0; }
}
@keyframes feedFlash { 0% { transform: scale(0.2); opacity: 0; } 40% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes fireFlicker { 0%,100% { opacity: 0.82; transform: translateX(-50%) scale(1); } 30% { opacity: 1; transform: translateX(-50%) scale(1.03); } 55% { opacity: 0.9; transform: translateX(-50%) scale(0.99); } 80% { opacity: 0.97; transform: translateX(-50%) scale(1.02); } }
@keyframes emberRise { 0% { transform: translateY(8px) translateX(0); opacity: 0; } 18% { opacity: 0.9; } 82% { opacity: 0.5; } 100% { transform: translateY(-70px) translateX(10px); opacity: 0; } }
/* painted Cinder: a slow breath + a bounce when fed */
@keyframes cinderBreathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.018); } }
@keyframes cinderChomp { 0% { transform: scale(1,1); } 26% { transform: translateY(-5px) scale(1.06,0.95); } 55% { transform: scale(0.97,1.04); } 100% { transform: scale(1,1); } }

.cinder-flame.chomp { animation: chomp 0.62s ease !important; }
.cinder-feed { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 6; }
.cf-food { animation: throwFood 0.95s cubic-bezier(.35,.7,.4,1) forwards; }
.cf-flash { position: absolute; animation: feedFlash 0.5s ease 0.58s both; }

/* the fireplace scene backdrop */
.hearth-scene { position: relative; }
.hearth-firelight { position: absolute; left: 50%; top: 34%; width: 130%; max-width: 520px; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,140,60,0.30), rgba(255,110,40,0.10) 40%, transparent 66%); animation: fireFlicker 3.2s ease-in-out infinite; pointer-events: none; z-index: 0; }
.hearth-embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.hearth-embers span { position: absolute; border-radius: 50%; }
.cinder-stage { position: relative; z-index: 3; display: grid; place-items: end center; }
.paper-grain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; mix-blend-mode: soft-light; opacity: 0.08; }

@media (prefers-reduced-motion: reduce) {
  .cinder-img, .cinder-flame.chomp, .cf-food, .cf-flash, .hearth-firelight, .hearth-embers span { animation: none !important; }
}

/* the fireplace hero card */
.fireplace {
  position: relative; margin-bottom: 4px; border-radius: 22px; overflow: hidden;
  padding: 14px 0 10px;
  background: radial-gradient(120% 66% at 50% 18%, #4a3324, #2e2016 46%, #1d130c 78%, #140c07);
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,220,180,0.06);
}
#cinder-mount.cinder-stage { position: relative; z-index: 3;
  display: grid; place-items: center; pointer-events: none; }
#cinder-mount .cinder-img { width: 72%; max-width: 258px; height: auto; display: block;
  filter: drop-shadow(0 10px 22px rgba(255,120,40,0.30));
  animation: cinderBreathe 5.5s ease-in-out infinite;
  transform-origin: center bottom; will-change: transform; }
#cinder-mount .cinder-img.cinder-chomp { animation: cinderChomp 0.6s ease; }
/* the reactive Rive rig (progressively swapped in when cinder.riv exists) */
#cinder-mount .cinder-rive { width: 80%; max-width: 280px; aspect-ratio: 500 / 620; height: auto;
  display: block; filter: drop-shadow(0 10px 22px rgba(255,120,40,0.28)); }
/* hand-drawn SVG fallback (desktop before art is vendored / offline) */
#cinder-mount .monster { width: 62%; max-width: 210px; height: auto;
  filter: drop-shadow(0 6px 18px rgba(255,120,40,0.35)); }

.hearth-status { text-align: center; padding: 8px 8px 0; margin-bottom: 16px; }
.hearth-status .monster-name { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.hearth-status .monster-mood { font-size: 11px; letter-spacing: 2px; margin-top: 0; }
.warmth { display: flex; align-items: center; gap: 11px; margin: 13px 8px 0; }
.warmth-lbl { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8f7d68; }
.warmth-track { flex: 1; height: 9px; border-radius: 999px; background: rgba(255,240,220,0.09); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
.warmth-fill { height: 100%; border-radius: 999px; box-shadow: 0 0 10px rgba(255,150,70,0.5); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.warmth-num { font-family: var(--serif); font-size: 21px; font-weight: 700; min-width: 28px; text-align: right; }
.hearth-status .monster-msg { color: #e9dcc8; }
.hearth-status .monster-foot { justify-content: center; gap: 24px; border-top: 1px solid var(--warm-line); }

.fed-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--good); align-self: center; flex: none; }

/* bank feeds */
.bank-card { padding: 14px 15px; }
.bank-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bank-id { display: flex; align-items: center; gap: 11px; }
.bank-id svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.bank-name { font-weight: 700; font-size: 15px; }
.bank-sub { font-size: 12px; color: var(--faint); margin-top: 1px; }
.bank-acts { display: flex; gap: 14px; flex: none; }
.bank-acts .link { background: none; border: none; color: var(--ember-2); font-size: 13px; cursor: pointer; padding: 0; }
.bank-acts .link.danger { color: var(--faint); }
.bank-err { color: #e0866a; font-weight: 700; }
.bank-note { font-size: 11.5px; color: var(--faint); margin-top: 10px; line-height: 1.45; }
.sheet-note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 14px; }

/* ---------- monster hero ---------- */
.monster-hero {
  text-align: center;
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 22px;
  padding: 18px 18px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.monster-hero.mood-blazing { border-color: rgba(255,122,60,0.35); }
.monster-hero.mood-fading, .monster-hero.mood-dim { background: linear-gradient(170deg, #1c1c22, var(--surface)); }
.monster-stage { height: 178px; display: flex; align-items: flex-end; justify-content: center; }
.monster { display: block; overflow: visible; }
.monster-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--text);
  padding: 2px 6px; border-radius: 8px; margin-top: 2px;
}
.monster-name svg { width: 12px; height: 12px; color: var(--faint); }
.monster-name:active { background: var(--surface-3); }
.vitality { display: flex; align-items: center; gap: 10px; margin: 12px 6px 0; }
.vitality-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.vitality-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--gold)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.vitality-num { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--gold); flex: none; min-width: 30px; text-align: right; }
.monster-mood { text-align: center; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--faint); margin-top: 5px; }
.monster-msg { text-align: center; font-size: 14px; color: var(--text); margin: 12px 6px 0; line-height: 1.5; }
.monster-foot { display: flex; align-items: stretch; justify-content: center; gap: 20px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.mf-stat { text-align: center; }
.mf-num { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--gold); }
.mf-label { font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.mf-div { width: 1px; background: var(--line); }

/* monster animations — driven inline on the flame group; declared here */
@keyframes wobble { 0%,100% { transform: rotate(-2.2deg) scaleY(0.99); } 50% { transform: rotate(2.2deg) scaleY(1.05); } }
@keyframes sleepBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes shiver { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
@keyframes twinkle { 0%,100% { opacity: 0.2; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes emberFloat { 0% { transform: translateY(6px); opacity: 0; } 15% { opacity: .55; } 85% { opacity: .4; } 100% { transform: translateY(-46px) translateX(10px); opacity: 0; } }
@keyframes moteDrift { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-14px) translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .monster *, .ambient span { animation: none !important; } }

/* ambient floating embers + motes behind everything */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(0.5px); }
.app, .login-wrap, .tabbar { position: relative; z-index: 1; }

/* ---------- today hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  display: flex; gap: 18px; align-items: center;
  margin-bottom: 18px;
}
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 24px; font-weight: 600;
}
.hero-copy { flex: 1; min-width: 0; }
.hero-copy .eyebrow { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--faint); }
.hero-copy .line { font-family: var(--serif); font-size: 19px; margin: 3px 0 2px; }
.hero-copy .meta { font-size: 13px; color: var(--muted); }
.hero-copy .meta b { color: var(--gold); font-weight: 600; }

/* ---------- section heading ---------- */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 12px;
}
.sec-head h2 { font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600; }
.add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ember-2);
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--ember-soft);
}
.add-btn svg { width: 14px; height: 14px; }

/* ---------- month momentum strip ---------- */
.month-strip {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 4px;
}
.ms-stat { text-align: center; flex: none; }
.ms-num { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--gold); line-height: 1; }
.ms-label { font-size: 11px; color: var(--faint); margin-top: 3px; text-transform: uppercase; letter-spacing: .6px; }
.ms-bar-wrap { flex: 1; min-width: 0; }
.ms-bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.ms-fill { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.ms-fill.ahead { background: linear-gradient(90deg, var(--good), #9be0bd); }
.ms-fill.behind { background: linear-gradient(90deg, var(--ember), var(--ember-2)); }
.ms-sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ms-sub b { color: var(--text); }
.ms-sub .pace { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.ms-sub .pace svg { width: 12px; height: 12px; }
.ms-sub .pace.ahead { color: var(--good); }
.ms-sub .pace.behind { color: var(--ember-2); }

/* ---------- habit card ---------- */
.habit {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px; margin-bottom: 10px;
  transition: transform .12s ease, border-color .2s ease, background .2s ease;
}
.habit-row { display: flex; align-items: center; gap: 14px; }
.habit.done { background: linear-gradient(120deg, rgba(116,198,157,0.10), var(--surface)); border-color: rgba(116,198,157,0.28); }
.habit.offday { opacity: 0.5; }
.habit:active { transform: scale(0.99); }
.check {
  width: 44px; height: 44px; flex: none; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  display: grid; place-items: center; color: var(--muted);
  transition: all .16s ease;
}
.check svg { width: 22px; height: 22px; }
.habit.done .check {
  background: var(--good); border-color: var(--good); color: #10241a;
  box-shadow: 0 4px 14px rgba(116,198,157,0.35);
}
.habit-body { flex: 1; min-width: 0; }
.habit-name { font-size: 16px; font-weight: 600; letter-spacing: 0.1px; }
.habit.done .habit-name { }
.habit-meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 12.5px; color: var(--faint); }
.streak { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 600; }
.streak svg { width: 13px; height: 13px; }
.streak.zero { color: var(--faint); }
.fresh { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--good); background: rgba(116,198,157,0.12); border: 1px solid rgba(116,198,157,0.28); border-radius: 999px; padding: 2px 9px; }
.consistency { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.tone-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 11px; margin-top: 8px; }
.tone-chip svg { width: 13px; height: 13px; }
.tone-chip.settled { color: #b9a6e6; background: rgba(138,92,192,0.14); border: 1px solid rgba(138,92,192,0.28); }
.tone-chip.welcome { color: var(--good); background: rgba(116,198,157,0.12); border: 1px solid rgba(116,198,157,0.26); }
.monster-hero.tone-settled { background: linear-gradient(170deg, #221a2a, var(--surface)); }
.freeze { display: inline-flex; align-items: center; gap: 3px; color: #7fb8e6; font-weight: 600; }
.freeze svg { width: 12px; height: 12px; }
.sched-tag { color: var(--faint); }
.habit-week { display: flex; gap: 5px; margin-left: auto; }
.wk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); }
.wk-dot.on { background: var(--gold); }
.wk-dot.today { box-shadow: 0 0 0 2px var(--ember-soft); }

.kebab { flex: none; width: 30px; height: 30px; border-radius: 8px; color: var(--faint); display: grid; place-items: center; }
.kebab:active { background: var(--surface-2); }

/* per-habit goal progress */
.goal { margin: 11px 2px 1px; }
.goal-track { height: 6px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.goal-fill { height: 100%; border-radius: 5px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.goal-fill.ahead { background: var(--good); }
.goal-fill.behind { background: var(--ember); }
.goal-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--faint); }
.goal-meta .pace { font-weight: 600; }
.goal-meta .pace.ahead { color: var(--good); }
.goal-meta .pace.behind { color: var(--ember-2); }
.goal-hint { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; }
.goal-hint b { color: var(--gold); }

/* habit-science surfacings (cue, bundle, rescue) */
.cue-line, .bundle-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin: 9px 2px 0; }
.cue-line svg, .bundle-line svg { width: 13px; height: 13px; flex: none; color: var(--faint); }
.rescue { display: block; width: 100%; text-align: left; margin-top: 11px; padding: 10px 12px; border-radius: 11px; background: rgba(233,196,106,0.10); border: 1px solid rgba(233,196,106,0.24); color: var(--gold); font-size: 13px; }
.rescue b { color: var(--text); }
.rescue:active { background: rgba(233,196,106,0.16); }

/* "make it stick" sheet section */
.stick-toggle { display: inline-flex; align-items: center; gap: 7px; width: 100%; justify-content: center; margin: 4px 0 10px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-2); background: rgba(255,122,60,0.04); color: var(--ember-2); font-size: 14px; font-weight: 600; }
.stick-toggle svg { width: 15px; height: 15px; }
.stick-box { background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px 14px; margin: 4px 0 12px; }
.stick-head { font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--ember-2); font-weight: 700; padding: 14px 2px 6px; }
.stick-head span { color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.stick-box .field label .lh { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; margin-left: 5px; }

/* fresh-start landmark banner */
.landmark { display: flex; align-items: center; gap: 10px; background: linear-gradient(120deg, rgba(233,196,106,0.10), var(--surface)); border: 1px solid rgba(233,196,106,0.24); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 12px; }
.landmark-body { flex: 1; }
.landmark-title { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 15.5px; color: var(--gold); }
.landmark-title svg { width: 15px; height: 15px; }
.landmark-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.landmark-x { flex: none; width: 26px; height: 26px; color: var(--faint); transform: rotate(45deg); }
.landmark-x svg { width: 16px; height: 16px; }

/* ---------- empty state ---------- */
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(255,255,255,0.015);
}
.empty .flame { width: 34px; height: 34px; color: var(--ember); opacity: .8; margin-bottom: 10px; }
.empty h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 6px; color: var(--text); }
.empty p { font-size: 14px; margin: 0 0 16px; }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(23,19,15,0.85);
  backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--faint); font-size: 10.5px; letter-spacing: 0.3px;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--ember-2); }
.tab.active svg { filter: drop-shadow(0 0 8px rgba(255,122,60,0.5)); }

/* ---------- pillar shell (coming soon) ---------- */
.pillar-shell { padding: 8px 2px; }
.shell-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 12px;
}
.shell-card .glyph { width: 30px; height: 30px; color: var(--ember); opacity: .85; margin-bottom: 12px; }
.shell-card h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 6px; }
.shell-card p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.pill-list { list-style: none; padding: 0; margin: 0; }
.pill-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; padding: 7px 0; border-top: 1px solid var(--line); }
.pill-list li:first-child { border-top: none; }
.pill-list li svg { width: 17px; height: 17px; flex: none; }
.pill-list .tick { color: var(--ember); opacity: .8; }
.badge-soon { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--ember-2); background: var(--ember-soft); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); }

/* ---------- finance ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; margin-bottom: 12px; }
.fin-head {
  display: flex; gap: 12px; margin-bottom: 14px;
}
.fin-net, .fin-safe {
  flex: 1; background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
}
.fin-net-label, .fin-safe-label { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--faint); }
.fin-net-num { font-family: var(--serif); font-size: 26px; font-weight: 600; margin-top: 5px; }
.fin-safe-num { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-top: 5px; color: var(--good); }
.fin-safe.neg .fin-safe-num { color: #ff8f8f; }
.fin-safe-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.fin-budget-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.fin-budget-top .link { color: var(--ember-2); font-weight: 600; font-size: 13px; }
.fin-budget .goal-track { height: 9px; }
.fin-budget-sub { font-size: 12.5px; color: var(--muted); margin-top: 9px; }
.fin-budget.over .fin-budget-sub { color: #ff8f8f; }
.fin-set-budget { display: block; width: 100%; text-align: left; color: var(--ember-2); font-weight: 600; font-size: 14.5px; }
.fin-tie { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin: 2px 4px 4px; }
.fin-tie svg { width: 15px; height: 15px; color: var(--ember); }
.link { color: var(--ember-2); }
.empty.sm { padding: 20px; }
.empty.sm p { margin: 0; font-size: 13.5px; }

.fin-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
}
.fin-row:active { background: var(--surface-2); }
.fin-row-main { flex: 1; min-width: 0; }
.fin-row-name { font-size: 15px; font-weight: 600; }
.fin-row-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.fin-row-sub.soon { color: var(--ember-2); font-weight: 600; }
.fin-row-amt { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.fin-row-amt.neg { color: #ff8f8f; }
.pay-btn { flex: none; font-size: 12.5px; font-weight: 600; color: var(--ember-2); background: var(--ember-soft); border: 1px solid var(--line-2); padding: 7px 12px; border-radius: 999px; }
.pay-btn:active { transform: scale(.97); }

.fin-cats { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.cat-name { width: 84px; flex: none; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar { flex: 1; height: 7px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.cat-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); border-radius: 5px; }
.cat-amt { flex: none; font-weight: 600; color: var(--text); }

.fin-recent { }
.txn-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.txn-main { flex: 1; min-width: 0; }
.txn-cat { font-size: 14px; font-weight: 500; }
.txn-note { font-size: 12px; color: var(--faint); margin-top: 1px; }
.txn-day { font-size: 12px; color: var(--faint); flex: none; }
.txn-amt { font-family: var(--serif); font-weight: 600; flex: none; }
.txn-amt.in { color: var(--good); }

/* goal pots */
.pot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; margin-bottom: 10px; }
.pot.reached { border-color: rgba(116,198,157,0.35); background: linear-gradient(120deg, rgba(116,198,157,0.08), var(--surface)); }
.pot:active { background: var(--surface-2); }
.pot-top { display: flex; align-items: center; gap: 12px; }
.pot-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--ember-2); }
.pot-ico svg { width: 20px; height: 20px; }
.pot-main { flex: 1; min-width: 0; }
.pot-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pot-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pot-pct { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--gold); flex: none; }
.pot.reached .pot-pct { color: var(--good); }
.pot.reached .pot-pct svg { width: 20px; height: 20px; }
.pot-lock { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #7fb8e6; }
.pot-lock svg { width: 11px; height: 11px; }
.pot-auto { font-size: 11px; font-weight: 600; color: var(--good); background: rgba(116,198,157,0.1); border-radius: 999px; padding: 1px 8px; }
.pot-track { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 11px 0 0; }
.pot-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--gold)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.pot.reached .pot-fill { background: var(--good); }
.pot-actions { display: flex; gap: 8px; margin-top: 12px; }
.pot-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ember-2); background: var(--ember-soft); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px; }
.pot-btn svg { width: 13px; height: 13px; }
.pot-btn.ghost { color: var(--muted); background: var(--surface-2); }
.pot-btn:active { transform: scale(.98); }

/* weekly money check-in */
.checkin { display: flex; align-items: center; gap: 12px; background: linear-gradient(120deg, rgba(116,198,157,0.10), var(--surface)); border: 1px solid rgba(116,198,157,0.24); border-radius: var(--radius); padding: 14px 15px; margin-bottom: 14px; }
.checkin.care { background: linear-gradient(120deg, rgba(233,196,106,0.10), var(--surface)); border-color: rgba(233,196,106,0.24); }
.checkin-body { flex: 1; }
.checkin-title { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 15.5px; }
.checkin-title svg { width: 15px; height: 15px; color: var(--gold); }
.checkin-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.checkin-ok { flex: none; align-self: flex-start; font-size: 12.5px; font-weight: 600; color: var(--ember-2); background: var(--ember-soft); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 12px; }

/* financial well-being */
.wb-card { display: block; width: 100%; text-align: left; }
.wb-score { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--good); }
.wb-score span { font-size: 34px; }
.wb-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.wb-cta { color: var(--ember-2); font-weight: 600; font-size: 13.5px; margin-top: 8px; }
.wb-q { margin-bottom: 16px; }
.wb-qt { font-size: 14px; margin-bottom: 9px; }
.chip.mini { padding: 8px 0; width: 40px; text-align: center; }

.money-input { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 14px; }
.money-input:focus-within { border-color: var(--ember); }
.money-input span { color: var(--faint); font-size: 17px; }
.money-input input { flex: 1; background: none; border: none; color: var(--text); padding: 13px 8px; font-size: 17px; outline: none; }
.field input[type=date] { width: 100%; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line-2); color: var(--text); color-scheme: dark; }
.field input[type=password] { width: 100%; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line-2); color: var(--text); }
.field input[type=time] { color-scheme: dark; }
.acct-id { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.acct-name { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.acct-role { font-size: 12.5px; color: var(--faint); text-transform: capitalize; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; margin-bottom: 16px; }
.seg button { flex: 1; padding: 9px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600; }
.seg button.on { background: var(--ember-soft); color: var(--ember-2); }

/* ---------- alerts ---------- */
.alerts-summary {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 6px; box-shadow: var(--shadow);
}
.as-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.as-eyebrow svg { width: 14px; height: 14px; color: var(--gold); }
.as-line { font-family: var(--serif); font-size: 18px; margin-top: 8px; line-height: 1.4; }
.as-top { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.as-top-item { display: flex; align-items: flex-start; gap: 10px; }
.as-num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ember-soft); border: 1px solid var(--line-2); color: var(--ember-2); font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.as-txt { font-size: 13.5px; color: var(--text); }
.as-cue { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.quiet-times { display: flex; align-items: center; gap: 6px; }
.quiet-times input { background: var(--bg); border: 1px solid var(--line-2); color: var(--text); border-radius: 9px; padding: 6px 8px; color-scheme: dark; font-size: 13px; }
.quiet-times span { color: var(--faint); }
.cat-toggles { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cat-pill { font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--faint); }
.cat-pill.on { background: var(--ember-soft); border-color: var(--ember); color: var(--ember-2); }

.al-group { margin-bottom: 8px; }
.al-bucket { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); margin: 16px 4px 8px; }
.al-bucket.overdue { color: #ff8f8f; }
.tl-row {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
}
.tl-row:active { background: var(--surface-2); }
.tl-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted); }
.tl-ico svg { width: 19px; height: 19px; }
.src-reminder .tl-ico { color: var(--gold); }
.src-bill .tl-ico { color: var(--good); }
.src-habit .tl-ico { color: var(--ember-2); }
.tl-main { flex: 1; min-width: 0; }
.tl-title { font-size: 14.5px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.tl-done { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; }
.tl-done svg { width: 18px; height: 18px; }
.tl-done:active { background: var(--good); color: #10241a; border-color: var(--good); }
.tl-chev { color: var(--faint); }
.tl-chev svg { width: 16px; height: 16px; }

/* ---------- notifications ---------- */
.notif-card { padding: 4px 16px; }
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.notif-row.bordered { border-top: 1px solid var(--line); }
.notif-title { font-size: 14.5px; font-weight: 600; }
.notif-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.notif-card input[type=time] { background: var(--bg); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; padding: 8px 10px; color-scheme: dark; }
.notif-card .btn-ghost { padding: 12px 0 16px; }
.toggle { width: 48px; height: 28px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .2s ease; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.toggle.on { background: var(--ember); border-color: var(--ember); }
.toggle.on span { transform: translateX(20px); background: #1a0f07; }

/* ---------- family ---------- */
.fam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.fam-name { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.fam-members { display: flex; gap: -6px; }
.fam-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(150deg, #3a2f22, #241d15); border: 2px solid var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #e9c46a; margin-left: -6px; }
.fam-avatar.add { color: var(--ember-2); background: var(--ember-soft); }
.fam-avatar.add svg { width: 15px; height: 15px; }

.coop { background: linear-gradient(160deg, rgba(127,184,230,0.10), var(--surface)); border: 1px solid rgba(127,184,230,0.22); border-radius: var(--radius); padding: 16px 17px; margin-bottom: 8px; }
.coop-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.coop-eyebrow { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.coop-line { font-family: var(--serif); font-size: 18px; margin-top: 4px; }
.coop-streak { text-align: center; flex: none; }
.coop-num { font-family: var(--serif); font-size: 24px; font-weight: 600; color: #9ecbe8; }
.coop-lbl { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); }
.coop-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.coop-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6f9fd0, #9ecbe8); transition: width .5s cubic-bezier(.2,.8,.2,1); }

.chore { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px; }
.chore.mine { border-color: rgba(255,122,60,0.30); }
.chore-top { display: flex; align-items: center; gap: 12px; }
.chore-main { flex: 1; min-width: 0; }
.chore-title { font-size: 15.5px; font-weight: 600; }
.chore-turn { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.chore.mine .chore-turn { color: var(--ember-2); }
.chore-done { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; }
.chore-done svg { width: 20px; height: 20px; }
.chore-done:active { background: var(--good); color: #10241a; border-color: var(--good); }
.chore-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.chore-badge.extra { color: var(--good); background: rgba(116,198,157,0.12); border: 1px solid rgba(116,198,157,0.28); }
.chore-team { font-size: 12px; color: #9ecbe8; margin-top: 9px; display: flex; align-items: center; gap: 6px; }
.chore-team svg { width: 13px; height: 13px; }
.chore-ml { font-size: 11.5px; color: var(--faint); margin-top: 10px; padding: 8px 10px; background: rgba(255,255,255,0.02); border-radius: 9px; }

/* saver's draw (M8) */
.draw-card { padding: 15px 16px; }
.draw-card .draw-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.draw-row { display: flex; gap: 28px; margin-bottom: 10px; }
.draw-num { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--gold); }
.draw-lbl { font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.draw-won { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--good); margin-bottom: 10px; }
.draw-won svg { width: 15px; height: 15px; }
.chore-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.chore-rot { font-size: 11.5px; color: var(--faint); }
.chore-link { font-size: 12.5px; font-weight: 600; color: var(--ember-2); }

.fam-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.fl-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.fl-kind { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; }
.fl-empty { font-size: 12.5px; color: var(--faint); padding: 6px 2px; }
.li-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.li-item:first-of-type { border-top: none; }
.li-check { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; }
.li-check svg { width: 15px; height: 15px; }
.li-item.done .li-check { background: var(--good); color: #10241a; border-color: var(--good); }
.li-text { flex: 1; font-size: 14px; }
.li-item.done .li-text { color: var(--faint); text-decoration: line-through; }
.li-by { display: block; font-size: 11px; color: var(--faint); text-decoration: none; }
.li-x { flex: none; width: 22px; height: 22px; color: var(--faint); transform: rotate(45deg); }
.li-x svg { width: 14px; height: 14px; }
.fl-add { margin-top: 8px; }
.fl-input { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; }
.fl-input:focus { outline: none; border-color: var(--ember); }

.thanks-feed { display: flex; flex-direction: column; gap: 9px; }
.thanks-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.thanks-row svg { width: 15px; height: 15px; color: #ff8fa3; flex: none; }
.thanks-row b { color: var(--text); }
.ml-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ml-lbl { font-size: 12px; color: var(--muted); width: 96px; flex: none; }

/* ---------- modal / sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 520px; background: var(--surface-2);
  border-radius: 22px 22px 0 0; border: 1px solid var(--line-2); border-bottom: none;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(20px); transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.grabber { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 8px auto 14px; }
.sheet h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.field label .lh { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; margin-left: 5px; }
.field input[type=text] {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text);
}
.field input:focus { outline: none; border-color: var(--ember); }
.glyph-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.glyph-opt {
  aspect-ratio: 1; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted);
}
.glyph-opt svg { width: 22px; height: 22px; }
.glyph-opt.sel { border-color: var(--ember); color: var(--ember-2); background: var(--ember-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line-2); color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.chip.sel { border-color: var(--ember); color: var(--ember-2); background: var(--ember-soft); }
.weekday-row { display: flex; gap: 6px; }
.wd { flex: 1; padding: 10px 0; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); color: var(--muted); font-size: 12px; text-align: center; }
.wd.sel { border-color: var(--ember); color: var(--ember-2); background: var(--ember-soft); }

.btn-primary {
  width: 100%; padding: 15px; border-radius: 14px; margin-top: 6px;
  background: var(--ember); color: #1a0f07; font-weight: 700; font-size: 16px;
  box-shadow: 0 8px 22px rgba(255,122,60,0.30);
}
.btn-primary:active { transform: scale(0.99); }
.btn-ghost { width: 100%; padding: 13px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.btn-danger { color: #ff7a7a; }

/* ---------- login ---------- */
.login-wrap { max-width: 400px; margin: 0 auto; padding: 12dvh 22px; min-height: 100dvh; }
.login-brand { text-align: center; margin-bottom: 34px; }
.login-brand .flame { width: 46px; height: 46px; color: var(--ember); filter: drop-shadow(0 0 20px rgba(255,122,60,0.5)); }
.login-brand h1 { font-family: var(--serif); font-size: 32px; margin: 12px 0 4px; }
.login-brand p { color: var(--muted); font-size: 14px; margin: 0; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.login-card .field input { width: 100%; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line-2); color: var(--text); }
.login-err { color: #ff8f8f; font-size: 13.5px; text-align: center; min-height: 18px; margin-top: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .flame { width: 16px; height: 16px; color: var(--gold); }

.hidden { display: none !important; }

/* celebratory pulse on the ring when everything's done */
@keyframes emberPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,122,60,0); } 50% { box-shadow: 0 0 26px rgba(255,122,60,0.45); } }
.ring.complete { animation: emberPulse 2.2s ease-in-out infinite; border-radius: 50%; }

/* ---------- Cinder chat (Phase 2) ---------- */
.chat-wrap {
  /* top/height (not inset:0) so JS can track the iOS visual viewport when the
     keyboard opens — the layout viewport doesn't shrink under fixed overlays */
  position: fixed; top: 0; left: 0; right: 0; height: 100dvh;
  z-index: 55; /* above tabbar(40)+sheet(50), below toast(60) */
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1b1510, var(--bg));
}
.chat-top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(32, 26, 20, 0.7); backdrop-filter: blur(8px);
}
.chat-cinder { width: 44px; height: 50px; display: grid; place-items: end center; flex: 0 0 auto; }
.chat-cinder img { max-width: 100%; max-height: 100%; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h2 { font-family: var(--serif); font-size: 21px; margin: 0; }
.chat-sub { color: var(--faint); font-size: 12px; }
.chat-iconbtn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }
.chat-iconbtn svg { width: 20px; height: 20px; }
.chat-iconbtn:active { background: var(--surface-2); }
.chat-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chat-msg {
  max-width: 84%; padding: 10px 14px; border-radius: 16px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: break-word;
}
.chat-msg.cinder { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-msg.me { align-self: flex-end; background: var(--ember-soft); border: 1px solid rgba(255,122,60,0.25); border-bottom-right-radius: 6px; }
.chat-msg.err { color: var(--muted); font-style: italic; }
.chat-msg.thinking::after { content: "\2026"; animation: chatPulse 1.2s ease-in-out infinite; }
@keyframes chatPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.chat-bar {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.chat-bar textarea {
  flex: 1; resize: none; max-height: 120px; padding: 12px 14px;
  border-radius: 14px; background: var(--bg); border: 1px solid var(--line-2);
  color: var(--text); font-family: inherit; font-size: 16px; line-height: 1.4;
}
.chat-bar textarea:focus { outline: none; border-color: var(--ember); }
.chat-send {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  background: var(--ember); color: #1a0f07; display: grid; place-items: center;
}
.chat-send svg { width: 20px; height: 20px; }
.chat-send:disabled { opacity: 0.45; }

/* Bells: Claude-written morning brief */
.brief-card {
  background: linear-gradient(135deg, rgba(255,122,60,0.12), rgba(233,196,106,0.07));
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 14px;
}
.brief-card .brief-text { font-size: 15px; line-height: 1.5; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .chat-msg.thinking::after { animation: none !important; }
}

/* ---------- Tally (finance autopilot) ---------- */
.review-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  cursor: pointer; border: 1px solid var(--gold-soft); margin-bottom: 14px;
}
.review-num { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--gold); }
.review-txt { flex: 1; font-size: 14px; color: var(--text); }
.review-left { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.review-txn { padding: 10px 2px 4px; }
.review-note { font-size: 15px; font-weight: 600; }
.review-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.review-meta b { font-family: var(--serif); font-size: 15px; color: var(--text); }
.rv-remember { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); padding: 10px 2px 14px; }
.chip-row.wrap { flex-wrap: wrap; }

.cb-row { padding: 10px 0 6px; cursor: pointer; }
.cb-row + .cb-row { border-top: 1px solid var(--line-2); }
.cb-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cb-name { font-size: 14.5px; font-weight: 600; }
.cb-amt { font-family: var(--serif); font-size: 15px; color: var(--muted); }
.cb-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.cb-sub.over { color: var(--ember-2); }

.sub-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.sub-row + .sub-row { border-top: 1px solid var(--line-2); }
.sub-row.dim { opacity: .55; }
.sub-main { flex: 1; }
.sub-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sub-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.sub-was { color: var(--muted); font-size: 12px; }
.sub-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.sub-badge.new { color: var(--gold); background: var(--gold-soft); }
.sub-badge.up { color: var(--ember-2); background: var(--ember-soft); }

.tally-card { margin-bottom: 14px; }
.tally-head { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 8px; }
.tally-num { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--gold); }
.tally-plan { font-size: 13.5px; color: var(--muted); }
.tally-line { font-size: 13.5px; color: var(--text); padding: 3px 0; }
.tally-line b { font-family: var(--serif); font-size: 15px; }

.trend { display: block; width: 100%; max-width: 300px; margin: 12px auto 0; }
.trend-bar { fill: var(--ember-soft); }
.trend-bar.cur { fill: var(--gold); }
.trend-lbl { fill: var(--muted); font-size: 9.5px; font-family: var(--sans); }

.report-card { display: block; width: 100%; text-align: left; cursor: pointer; margin-bottom: 14px; }
.report-line { font-size: 14px; padding: 7px 0; }

.btn-ghost.danger { color: #e07070; }

/* ---------- The Forge ---------- */
.forge-week { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.forge-grade { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--gold); line-height: 1; min-width: 34px; }
.forge-week-sub { flex: 1; font-size: 13px; color: var(--muted); }
.forge-week .link { background: none; border: none; color: var(--ember-2); font-size: 12.5px; cursor: pointer; }

.fg-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; }
.fg-row + .fg-row { border-top: 1px solid var(--line-2); }
.fg-main { flex: 1; min-width: 0; }
.fg-name { font-size: 14.5px; font-weight: 600; }
.fg-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.fg-chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.fg-chip svg { width: 12px; height: 12px; }
.fg-chip.pass { color: var(--gold); background: var(--gold-soft); }
.fg-chip.partial { color: var(--ember-2); background: var(--ember-soft); }
.fg-chip.fail { color: var(--muted); background: rgba(255,255,255,0.05); }
.fg-chip.nodata { color: var(--muted); background: rgba(255,255,255,0.05); }
.fg-wk { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--gold); min-width: 38px; text-align: right; }
.fg-wk.dim { color: var(--muted); }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 9px); gap: 2.5px; margin-top: 12px; justify-content: center; }
.hm { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,0.05); }
.hm.hm1 { background: rgba(255,122,60,0.16); }
.hm.hm2 { background: rgba(255,122,60,0.32); }
.hm.hm3 { background: rgba(255,122,60,0.52); }
.hm.hm4 { background: rgba(255,154,92,0.75); }
.hm.hm5 { background: var(--gold); }

.hs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- Kindling (today's three) ---------- */
.kindling { margin-bottom: 14px; }
.kd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kd-head .link { background: none; border: none; color: var(--ember-2); font-size: 12.5px; cursor: pointer; }
.kd-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; padding: 9px 2px; cursor: pointer; color: var(--text); font-size: 14.5px; }
.kd-item + .kd-item { border-top: 1px solid var(--line-2); }
.kd-item.done .kd-title { color: var(--muted); text-decoration: line-through; }
.kd-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kd-item.done .kd-check { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.kd-check svg { width: 13px; height: 13px; }
.kd-empty { font-size: 13.5px; color: var(--muted); padding: 6px 2px 8px; }
.kd-tomorrow { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 11px; background: var(--gold-soft); border: 1px solid rgba(233,196,106,0.24); color: var(--gold); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.kd-tomorrow svg { width: 15px; height: 15px; }

/* ---------- The Week (5th tab) ---------- */
.wk-selector { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.wk-selector .chip[disabled] { opacity: .4; cursor: default; }
.wk-spacer { flex: 1; }
.wk-selector .link { background: none; border: none; color: var(--ember-2); font-size: 12.5px; cursor: pointer; }

.wd-card { margin-bottom: 10px; padding-top: 10px; padding-bottom: 10px; }
.wd-card.today { border-color: rgba(233,196,106,0.35); }
.wd-day { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.wd-today { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ember-2); background: var(--ember-soft); padding: 2px 7px; border-radius: 999px; }
.wd-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.wd-row.done .wd-title { color: var(--muted); text-decoration: line-through; }
.wd-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: none; display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; color: var(--gold); }
.wd-check.on { border-color: var(--gold); background: var(--gold-soft); }
.wd-check svg { width: 13px; height: 13px; }
.wd-main { flex: 1; min-width: 0; }
.wd-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.wd-title svg { width: 14px; height: 14px; color: var(--ember-2); }
.wd-note { font-size: 12px; color: var(--muted); margin-top: 1px; }
.wd-regen { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; }
.wd-regen svg { width: 14px; height: 14px; }
.wd-regen:hover { color: var(--ember-2); }
.wd-prios { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.wd-prio { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.05); color: var(--text); }
.wd-prio.done { text-decoration: line-through; color: var(--muted); }
.wd-prio.draft { border: 1px dashed var(--line-2); background: none; color: var(--muted); }

.gr-aisle { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ember-2); padding: 10px 0 4px; }
.gr-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; padding: 6px 0; cursor: pointer; color: var(--text); font-size: 14px; }
.gr-item.done span:last-child { color: var(--muted); text-decoration: line-through; }
.gr-item .kd-check.done { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.gr-note { font-size: 12px; color: var(--muted); padding-top: 10px; }

.bl-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.bl-main { flex: 1; }
.bl-title { font-size: 14.5px; font-weight: 600; }
.bl-sub { font-size: 12.5px; color: var(--muted); }

#rc-ings, #rc-bulk { width: 100%; margin-top: 8px; background: var(--surface-3, rgba(255,255,255,0.04)); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); padding: 10px 12px; font-size: 13.5px; font-family: var(--sans); resize: vertical; }
#rc-protein, #bl-rank { background: var(--surface-3, rgba(255,255,255,0.04)); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); padding: 10px 12px; font-size: 14px; }
