/*
  spirit-pet.css — extracted from the 400-line inline <style> block in
  spirit-baby.html during the 2026-04-15 UI review (item H3).
  (Renamed from spirit-twin.css 2026-05-25 — Dev Rule #15 vocabulary.)

  Loaded ONLY from spirit-baby.html via a dedicated <link> tag. Do NOT
  import this file from main.css or styles.css — the `:root` custom
  properties below (`--spirit`, `--spirit2`, `--panel`, `--card`) are
  Spirit-Twin-specific character colors (pink gradient) and would leak
  and clash with the site-wide lavender/aqua primary palette if loaded
  globally.

  Tokenization status: character colors stay local. Text/radius/shadow
  values will migrate to global design tokens in a follow-up pass once
  the cozy theme audit is complete (tracked alongside review H1).

  Sections:
    1. Root variables + body
    2. Room (sky, stars, ground, garden, overlays)
    3. CSS pet character (body, eyes, mouth, arms, feet, states)
    4. Stage evolution (seedling → mortal)
    5. Name, bubble, growth stages, streak pips
    6. Panel (home buttons, feed list, chat, reflect, loading)
    7. Quick reflect + voice button
    8. Home extras cards (narrative, identity, garden, heatmap)
    9. Family sharing
   10. Milestone celebration + hearts + sparkles
   11. Sticky header + toast
   12. Capture panel
   13. Responsive breakpoints
*/

:root {
    --spirit: #ff7eb3;
    --spirit2: #ff5e99;
    --spirit-glow: rgba(255, 126, 179, 0.4);
    --accent: #764ba2;
    --panel: #0d0b1a;
    --card: rgba(255, 255, 255, 0.06);
}

:root[data-ux-mode="cozy"] {
    --panel: var(--color-bg-body);
    --card: rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: radial-gradient(ellipse at 50% 30%, #1a1050 0%, #0a0620 50%, #060412 100%);
    color: var(--fg, #fff);
    min-height: 100vh;
    overflow-x: hidden;
}
[data-ux-mode="cozy"] body {
    background: var(--bg);
}

/* ============ ROOM ============ */
.room { position: relative; width: 100%; max-width: 500px; margin: 0 auto; height: 58vh; min-height: 320px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.room.morning, .room.day, .room.evening, .room.night { background: #4AB8E8; }
.room.night::before, .room.evening::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, .5) 0%, transparent 100%), radial-gradient(1.5px 1.5px at 45% 25%, rgba(255, 255, 255, .6) 0%, transparent 100%), radial-gradient(1px 1px at 65% 10%, rgba(255, 255, 255, .4) 0%, transparent 100%), radial-gradient(1px 1px at 80% 35%, rgba(255, 255, 255, .5) 0%, transparent 100%), radial-gradient(1px 1px at 25% 60%, rgba(255, 255, 255, .3) 0%, transparent 100%), radial-gradient(2px 2px at 90% 55%, rgba(255, 255, 255, .4) 0%, transparent 100%); animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { 0% { opacity: .3; } 100% { opacity: 1; } }
.ground { position: absolute; bottom: 0; left: 0; right: 0; height: 20%; background: linear-gradient(180deg, rgba(34, 120, 80, 0.12), rgba(20, 80, 50, 0.35)); border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
.garden-row { position: absolute; bottom: 5%; left: 0; right: 0; display: flex; justify-content: center; gap: .4rem; font-size: 1.2rem; z-index: 2; pointer-events: none; }
.garden-emoji { animation: sway 3s ease-in-out infinite; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.garden-emoji:nth-child(even) { animation-delay: -1.5s; }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
#feedLayer, #heartsLayer { position: absolute; inset: 0; pointer-events: none; z-index: 50; }

/* ============ CSS PET CHARACTER ============ */
.pet-wrap { position: relative; z-index: 10; cursor: pointer; margin-bottom: .25rem; }
.pet { position: relative; width: 140px; height: 160px; display: flex; flex-direction: column; align-items: center; animation: petIdle 3s ease-in-out infinite; }
@keyframes petIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.pet-body { width: 120px; height: 120px; border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 40% 35%, #ffa6d0, var(--spirit) 60%, var(--spirit2)); box-shadow: 0 8px 30px var(--spirit-glow), inset 0 -8px 15px rgba(0, 0, 0, .1), inset 0 4px 10px rgba(255, 255, 255, .2); position: relative; transition: transform .3s, background .5s; }
.pet-body::before { content: ''; position: absolute; width: 20px; height: 12px; border-radius: 50%; background: rgba(255, 100, 130, .35); top: 58%; left: 12%; filter: blur(3px); }
.pet-body::after { content: ''; position: absolute; width: 20px; height: 12px; border-radius: 50%; background: rgba(255, 100, 130, .35); top: 58%; right: 12%; filter: blur(3px); }

.pet-eyes { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); display: flex; gap: 24px; }
.eye { width: 16px; height: 18px; background: #2a1040; border-radius: 50%; position: relative; animation: eyeLook 6s ease-in-out infinite; }
.eye::after { content: ''; position: absolute; width: 5px; height: 5px; background: #fff; border-radius: 50%; top: 3px; left: 4px; animation: eyeShine 6s ease-in-out infinite; }
@keyframes eyeLook { 0%, 45%, 55%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
@keyframes eyeShine { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(1px, 1px); } }
.eye-lid { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: #ffa6d0; border-radius: 50%; transition: height .1s; animation: blink 4s ease infinite; }
@keyframes blink { 0%, 92%, 100% { height: 0; } 95% { height: 100%; } }

.pet-mouth { position: absolute; top: 62%; left: 50%; transform: translateX(-50%); width: 14px; height: 8px; border-radius: 0 0 50% 50%; background: #c44; transition: all .3s; }
.pet.happy .pet-mouth { width: 20px; height: 12px; border-radius: 0 0 50% 50%; background: #e55; }
.pet.sad .pet-mouth { width: 12px; height: 3px; border-radius: 50%; background: #a44; transform: translateX(-50%) translateY(3px); }
.pet.eating .pet-mouth { width: 18px; height: 18px; border-radius: 50%; background: #822; animation: chew .3s ease infinite; }
@keyframes chew { 0%, 100% { height: 18px; width: 18px; } 50% { height: 12px; width: 16px; } }

.pet-arm { position: absolute; top: 50%; width: 18px; height: 30px; border-radius: 50%; background: var(--spirit); transition: transform .3s; }
.pet-arm.left { left: -10px; transform: rotate(20deg); animation: armSwing 4s ease-in-out infinite; }
.pet-arm.right { right: -10px; transform: rotate(-20deg); animation: armSwing 4s ease-in-out infinite reverse; }
@keyframes armSwing { 0%, 100% { transform: rotate(20deg); } 50% { transform: rotate(35deg); } }
.pet.waving .pet-arm.right { animation: wave .5s ease 3 !important; }
@keyframes wave { 0%, 100% { transform: rotate(-20deg); } 50% { transform: rotate(-60deg); } }

.pet-feet { display: flex; gap: 20px; margin-top: -5px; }
.foot { width: 22px; height: 12px; border-radius: 50%; background: var(--spirit2); box-shadow: 0 2px 4px rgba(0, 0, 0, .15); }

.pet.tapped .pet-body { transform: scale(1.1); }
.pet.absorbing .pet-body { animation: absorb .8s ease; filter: brightness(1.3) drop-shadow(0 0 20px var(--spirit)); }
@keyframes absorb { 0% { transform: scale(1); } 30% { transform: scale(1.15); } 60% { transform: scale(.93); } 100% { transform: scale(1); } }
.pet.happy .pet-body { box-shadow: 0 8px 40px rgba(255, 200, 50, .3), inset 0 -8px 15px rgba(0, 0, 0, .1), inset 0 4px 10px rgba(255, 255, 255, .3); }
.pet.sad .pet-body { filter: saturate(0.6) brightness(0.85); }
.pet.sleeping .eye .eye-lid { height: 100% !important; animation: none !important; }
.pet.sleeping .pet-mouth { width: 8px; height: 4px; border-radius: 50%; }
.pet.cuddled .pet-body { transform: scale(1.08); filter: brightness(1.2) drop-shadow(0 0 25px rgba(255, 180, 200, .5)); transition: all .4s ease; }
.pet.cuddled { animation: cuddleWobble 1s ease-in-out !important; }
@keyframes cuddleWobble { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-3px) rotate(2deg); } 50% { transform: translateY(-5px) rotate(-2deg); } 75% { transform: translateY(-3px) rotate(1deg); } }
.pet.giggling { animation: giggleBounce .3s ease 4 !important; }
@keyframes giggleBounce { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-12px) scaleY(.92); } }

.zzz { position: absolute; top: 10%; right: -15px; font-size: .8rem; color: rgba(255, 255, 255, .4); animation: zzzFloat 2s ease-in-out infinite; }
@keyframes zzzFloat { 0%, 100% { transform: translateY(0) scale(1); opacity: .4; } 50% { transform: translateY(-12px) scale(1.2); opacity: .8; } }

.need-bubble { position: absolute; top: -8px; right: -20px; font-size: 1.4rem; animation: needBob 1.5s ease-in-out infinite; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .3)); }
@keyframes needBob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.1); } }

.pet.has-avatar .pet-body { background: none; box-shadow: none; border-radius: 0; }
.pet.has-avatar .pet-body::before,
.pet.has-avatar .pet-body::after { display: none; }
.pet.has-avatar .pet-eyes,
.pet.has-avatar .pet-mouth,
.pet.has-avatar .pet-arm,
.pet.has-avatar .pet-feet { display: none; }
.pet-avatar-full { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 220px; height: 280px; z-index: 5; pointer-events: none; background: transparent; border-radius: 14px; overflow: hidden; }
.pet-avatar-full img, .pet-avatar-full video { width: 100%; height: 100%; object-fit: contain; }
.pet-avatar-overlay { position: absolute; top: 5%; left: 50%; transform: translateX(-50%); width: 60px; height: 60px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255, 255, 255, .3); z-index: 5; }
.pet-avatar-overlay img { width: 100%; height: 100%; object-fit: cover; }
.pet.has-avatar .pet-avatar-overlay { display: none; }

/* ============ STAGE EVOLUTION ============ */
.stage-deco { position: absolute; top: 8px; right: 12px; font-size: 1.8rem; z-index: 20; animation: stagePulse 3s ease-in-out infinite; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
@keyframes stagePulse { 0%, 100% { transform: scale(1) rotate(-5deg); } 50% { transform: scale(1.15) rotate(5deg); } }

.stage-seedling .pet { width: 120px; height: 135px; }
.stage-seedling .pet-body { width: 100px; height: 100px; }
.stage-seedling .pet-avatar-full { width: 180px; height: 230px; }

.stage-spark .pet { width: 140px; height: 160px; }
.stage-spark .pet-body { width: 120px; height: 120px; }
.stage-spark .pet-avatar-full { width: 220px; height: 280px; }
.stage-spark.has-avatar .pet-body { filter: drop-shadow(0 0 8px rgba(255, 126, 179, .3)); }

.stage-ember .pet { width: 155px; height: 175px; }
.stage-ember .pet-body { width: 135px; height: 135px; background: radial-gradient(circle at 40% 35%, #ffb8d8, #ff7eb3 60%, #e040a0); }
.stage-ember .pet-avatar-full { width: 245px; height: 310px; }
.stage-ember.has-avatar .pet-body { filter: drop-shadow(0 0 15px rgba(255, 126, 179, .4)); }
.room.stage-ember .ground { background: linear-gradient(180deg, rgba(34, 140, 80, 0.15), rgba(20, 100, 50, 0.4)); }

.stage-flare .pet { width: 170px; height: 190px; }
.stage-flare .pet-body { width: 145px; height: 145px; background: radial-gradient(circle at 40% 35%, #ffd4e8, #ff8ec4 50%, #d040a0); box-shadow: 0 8px 40px rgba(255, 200, 100, .35), 0 0 60px rgba(255, 180, 80, .15), inset 0 -8px 15px rgba(0, 0, 0, .1), inset 0 4px 10px rgba(255, 255, 255, .3); }
.stage-flare .pet-avatar-full { width: 270px; height: 340px; }
.stage-flare.has-avatar .pet-body { filter: drop-shadow(0 0 20px rgba(255, 200, 100, .4)); }
.room.stage-flare .ground { background: linear-gradient(180deg, rgba(50, 150, 80, 0.18), rgba(30, 100, 50, 0.45)); }

.stage-mortal .pet { width: 180px; height: 200px; }
.stage-mortal .pet-body { width: 155px; height: 155px; background: radial-gradient(circle at 40% 35%, #ffe4f0, #ffa0d0 45%, #c830a0); box-shadow: 0 8px 50px rgba(255, 215, 0, .4), 0 0 80px rgba(255, 200, 50, .2), inset 0 -8px 15px rgba(0, 0, 0, .1), inset 0 6px 15px rgba(255, 255, 255, .35); }
.stage-mortal .pet-avatar-full { width: 290px; height: 370px; }
.stage-mortal.has-avatar .pet-body { filter: drop-shadow(0 0 30px rgba(255, 215, 0, .45)); }
.room.stage-mortal .ground { background: linear-gradient(180deg, rgba(60, 160, 80, 0.2), rgba(30, 120, 50, 0.5)); }
.room.stage-mortal::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 50% 40%, rgba(255, 215, 0, .06), transparent 70%); pointer-events: none; z-index: 1; }

/* ============ NAME + BUBBLE ============ */
.spirit-name { position: relative; z-index: 10; text-align: center; font-size: 1.25rem; font-weight: 700; color: #1a1040; text-shadow: 0 1px 3px rgba(255, 255, 255, .5); }
.growth-stages { position: relative; z-index: 10; display: flex; align-items: center; justify-content: center; gap: .25rem; margin-bottom: .25rem; flex-wrap: wrap; }
.gs { font-size: .65rem; padding: .15rem .45rem; border-radius: 8px; font-weight: 600; }
.gs-done { background: rgba(67, 233, 123, .15); color: #43e97b; }
/* P0 contrast fix 2026-05-10: pink-on-blue room sky was 1.0:1 (invisible).
   Switch to dark navy panel + white text → ~14:1 on the bright sky. */
.gs-current { background: #0f172a; color: #ffffff; border: 1px solid var(--spirit); }
/* P0 contrast fix 2026-05-10: 35%-opacity ink was 2.0:1. Bump to 75%
   opacity navy → ≥4.5:1 against the bright stage sky. */
.gs-future { background: rgba(0, 0, 0, .08); color: rgba(20, 10, 50, .75); }
.gs-arrow { font-size: .55rem; color: rgba(20, 10, 50, .25); }

/* Phase 2b — voice-forward tagline + pet-stats strip.
   Replaces .spirit-subtitle + .spirit-level (retired). Sits above the
   .bubble speech surface inside the bright .room sky; copy + type
   patterns lifted from docs/design/handoff/ui_kits/ispirit-app/app.css
   (PetHero .pet-info tagline + .pet-stats). The <em> inside .pet-tagline
   is the design-system voice anchor — see growth-dashboard.js render().
 */
.pet-tagline {
    position: relative; z-index: 10;
    text-align: center; max-width: 320px;
    margin: .15rem auto .5rem;
    font-size: .82rem; line-height: 1.5;
    color: rgba(20, 10, 50, .72);
    text-wrap: pretty;
    padding: 0 .9rem;
}
.pet-tagline em {
    font-style: normal;
    color: #1a1040;
    font-weight: 600;
}

.pet-stats {
    position: relative; z-index: 10;
    display: grid; grid-template-columns: repeat(3, 1fr);
    width: min(340px, 88%);
    margin: 0 auto .4rem;
    padding: .55rem 0;
    background: rgba(255, 255, 255, .28);
    border: 1px solid rgba(20, 10, 50, .08);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.pet-stat {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 0 .4rem; min-width: 0;
    border-right: 1px solid rgba(20, 10, 50, .08);
}
.pet-stat:last-child { border-right: 0; }
.ps-label {
    font-size: .58rem; letter-spacing: .08em;
    font-weight: 600; text-transform: uppercase;
    color: rgba(20, 10, 50, .88);   /* .55 measured 3.55:1 on the cyan pill — below AA */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
}
.ps-value {
    font-size: 1.1rem; font-weight: 700;
    color: #1a1040; letter-spacing: -.01em; line-height: 1.1;
    display: inline-flex; align-items: baseline; gap: 2px;
    font-variant-numeric: tabular-nums;
}
.ps-unit {
    font-size: .62rem; font-weight: 500;
    color: rgba(20, 10, 50, .5);
    margin-left: 1px; letter-spacing: 0;
}
.pet-stat--next .ps-value { color: var(--spirit2, #ff5e99); }

/* Cozy override — rose-on-paper matching the other cozy surfaces
   (home-banner, growth-chain). */
[data-ux-mode="cozy"] .pet-tagline { color: var(--fg-muted, rgba(75, 40, 55, .78)); }
[data-ux-mode="cozy"] .pet-tagline em { color: var(--fg-strong, #3a1f2a); }
[data-ux-mode="cozy"] .pet-stats {
    background: rgba(255, 244, 240, .6);
    border-color: rgba(196, 130, 118, .22);
}
[data-ux-mode="cozy"] .ps-label { color: var(--fg-muted, rgba(75, 40, 55, .62)); }
[data-ux-mode="cozy"] .ps-value { color: var(--fg-strong, #3a1f2a); }
[data-ux-mode="cozy"] .ps-unit { color: var(--fg-muted, rgba(75, 40, 55, .55)); }
[data-ux-mode="cozy"] .pet-stat { border-right-color: rgba(196, 130, 118, .18); }
[data-ux-mode="cozy"] .pet-stat--next .ps-value { color: #b94c6d; }

/* Tight column — <=380px devices. Label font shrinks, padding snugger. */
@media (max-width: 380px) {
    .pet-stats { width: 94%; }
    .pet-stat { padding: 0 .3rem; }
    .ps-value { font-size: 1rem; }
    .ps-label { font-size: .54rem; }
}
/* The bubble carries DARK ink (#1a1040), so its own background must be
   explicitly LIGHT — never a darkening overlay. `rgba(0,0,0,.12)` only read
   correctly while whatever sat behind it happened to be bright, so the text
   went invisible the moment anything repainted that surface (app-shell's
   generic `.bubble` did exactly that: measured 1.01:1). An opaque light panel
   is legible against ANY backdrop — sky, avatar art, stage tint or theme —
   which removes the whole class of bug rather than the one instance of it. */
.room .bubble { position: relative; z-index: 10; max-width: 280px; margin: .2rem auto .4rem; padding: .55rem 1rem; background: rgba(255, 255, 255, .88); backdrop-filter: blur(4px); border: 1px solid rgba(20, 10, 50, .12); box-shadow: 0 2px 10px rgba(10, 20, 40, .18); border-radius: 16px; font-size: .85rem; line-height: 1.4; text-align: center; color: #1a1040; animation: bubIn .35s ease; }
.room .bubble::after { content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-bottom-color: rgba(255, 255, 255, .88); }
@keyframes bubIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.pips { position: relative; z-index: 10; display: flex; gap: 6px; justify-content: center; margin-bottom: .3rem; align-items: center; }
/* I-03 (2026-04-14 audit): streak label was rgba(20,10,50,.45) on a cyan
   gradient — ~2.4:1 contrast. Bumped to a darker, more saturated value
   for legible contrast. Keep this override on any future refactor. */
.pips-label { font-size: .78rem; font-weight: 700; color: #0a0420; margin-left: .4rem; letter-spacing: 0.01em; }
.pip { width: 12px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .1); border: 1.5px solid rgba(0, 0, 0, .15); }
.pip.on { background: var(--spirit); border-color: var(--spirit); box-shadow: 0 0 4px var(--spirit-glow); }
.pip.now { border-color: var(--spirit); animation: pipGlow 1.5s infinite; }
@keyframes pipGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 126, 179, .4); } 50% { box-shadow: 0 0 0 4px rgba(255, 126, 179, 0); } }

/* ============ PANEL ============ */
.panel { position: relative; max-width: 500px; margin: 0 auto; min-height: 42vh; background: var(--panel); border-radius: 20px 20px 0 0; padding: .4rem 0 2rem; box-shadow: 0 -6px 25px rgba(0, 0, 0, .3); }
.handle { text-align: center; padding: .4rem; }
.handle-bar { width: 32px; height: 3px; background: rgba(255, 255, 255, .12); border-radius: 2px; margin: 0 auto; }
.pv { display: none; padding: .75rem 1.1rem; }
.pv.on { display: flex; flex-direction: column; animation: pvIn .2s ease; }
@keyframes pvIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hbtns { display: flex; gap: .65rem; justify-content: center; padding: .3rem 0; }
.hb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.1rem .4rem; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; font-size: .8rem; font-weight: 700; color: #fff; transition: transform .12s, background .15s, border-color .15s; }
.hb:active { transform: scale(.93); }
/* I-02 (2026-04-14 audit): Talk is the primary action; Feed and Capture
   are secondary and share a single neutral treatment so the row doesn't
   fight for attention with three competing hues. */
.hb-talk { background: linear-gradient(135deg, #4facfe, #3a7bd5); box-shadow: 0 4px 15px rgba(79, 172, 254, .3); }
.hb-feed,
.hb-capture { background: rgba(30, 41, 59, .85); border-color: rgba(148, 163, 184, .25); box-shadow: none; }
.hb-feed:hover,
.hb-capture:hover { border-color: rgba(79, 172, 254, .45); background: rgba(30, 41, 59, 1); }
.hb-icon { font-size: 1.8rem; }

.fhead { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.fback { background: none; border: none; color: var(--muted, rgba(255, 255, 255, .4)); font-size: 1.2rem; cursor: pointer; padding: .4rem .6rem; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.ftitle { font-size: .95rem; font-weight: 600; flex: 1; }
.fscroll { display: flex; flex-direction: column; overflow-y: auto; max-height: 400px; gap: 8px; padding: .2rem 0 .8rem; -webkit-overflow-scrolling: touch; }
.fscroll::-webkit-scrollbar { width: 3px; }
.fscroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 2px; }
.fc { display: flex; align-items: center; gap: 10px; border-radius: 10px; background: var(--color-surface-2, rgba(30, 41, 59, 1)); border: 1px solid var(--border, rgba(255, 255, 255, .08)); padding: 12px; cursor: pointer; transition: all .12s; }
.fc:active { transform: scale(.97); border-color: var(--spirit); background: rgba(255, 126, 179, .08); }
.fc-icon { font-size: 1.25rem; flex-shrink: 0; }
.fc-info { flex: 1; min-width: 0; }
.fc-title { font-size: .85rem; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--fg, #fff); }
.fc-meta { font-size: .7rem; color: var(--muted, rgba(255, 255, 255, .35)); margin-top: 2px; }
.fempty { text-align: center; padding: 1.5rem; color: var(--muted, rgba(255, 255, 255, .35)); font-size: .85rem; line-height: 1.5; }

/* CHAT */
.chtarea { flex: 1; overflow-y: auto; max-height: 26vh; padding: .2rem 0; }
.chtmsg { margin-bottom: .4rem; display: flex; }
.chtmsg.s { justify-content: flex-start; }
.chtmsg.u { justify-content: flex-end; }
.chtbub { max-width: 78%; padding: .65rem 1rem; border-radius: 12px; font-size: .95rem; line-height: 1.6; }
.chtmsg.s .chtbub { background: rgba(255, 126, 179, .15); border: 1px solid rgba(255, 126, 179, .22); color: var(--fg, #fff); }
.chtmsg.u .chtbub { background: rgba(79, 172, 254, .15); border: 1px solid rgba(79, 172, 254, .22); color: var(--fg, #fff); }
.chtrow { display: flex; gap: .4rem; margin-top: .4rem; }
.chtin { flex: 1; padding: .6rem .85rem; border-radius: 10px; border: 1px solid var(--border, rgba(255, 255, 255, .1)); background: var(--card); color: var(--fg, #fff); font-size: .95rem; outline: none; min-height: 44px; }
.chtin:focus { border-color: var(--spirit); }
.chtsend { padding: .6rem 1rem; border-radius: 10px; border: none; background: var(--spirit); color: #fff; font-weight: 600; cursor: pointer; font-size: .95rem; min-height: 44px; }
.cht-voice-toggle { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: .3rem; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; opacity: .6; transition: opacity .15s; }
.cht-voice-toggle:hover { opacity: 1; }
.typing-dots span { display: inline-block; animation: typingBounce 1.4s infinite both; font-size: 1.4rem; line-height: 1; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* REFLECT */
.rq { font-size: .9rem; line-height: 1.5; color: var(--fg, rgba(255, 255, 255, .8)); font-style: italic; margin-bottom: .6rem; text-align: center; }
.rta { width: 100%; min-height: 55px; padding: .6rem; border-radius: 10px; border: 1px solid var(--border, rgba(255, 255, 255, .1)); background: var(--card); color: var(--fg, #fff); font-size: .82rem; resize: none; outline: none; box-sizing: border-box; }
.rta:focus { border-color: var(--spirit); }
.racts { display: flex; gap: .4rem; margin-top: .6rem; }
.rbtn { flex: 1; padding: .6rem; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: .82rem; }
.rbtn-go { background: var(--spirit); color: #fff; }
.rbtn-skip { background: var(--card); color: var(--muted, rgba(255, 255, 255, .4)); border: 1px solid var(--border, rgba(255, 255, 255, .08)); }

/* LOADING */
.ldview { text-align: center; padding: 1.5rem; }
.ldots { font-size: 1.5rem; animation: dotPulse 1.5s infinite; }
@keyframes dotPulse { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* Quick Reflect */
.quick-reflect { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; margin-bottom: .5rem; background: rgba(255, 255, 255, .03); border-radius: 12px; border: 1px solid rgba(255, 255, 255, .06); }
.qr-label { font-size: .8rem; color: rgba(255, 255, 255, .45); white-space: nowrap; }
.qr-moods { display: flex; gap: .2rem; flex: 1; justify-content: center; flex-wrap: wrap; }
.qr-mood { font-size: 1.6rem; background: none; border: none; cursor: pointer; padding: .3rem .5rem; border-radius: 10px; transition: transform .15s, background .15s; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.qr-mood:hover, .qr-mood:active { transform: scale(1.25); background: rgba(255, 255, 255, .08); }

/* Voice First Button */
.voice-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; padding: .7rem 1rem; margin-top: .5rem; border: 1px dashed rgba(255, 126, 179, .3); background: rgba(255, 126, 179, .06); border-radius: 12px; color: rgba(255, 255, 255, .6); font-size: .85rem; cursor: pointer; transition: all .2s; min-height: 48px; }
.voice-btn:hover, .voice-btn:active { background: rgba(255, 126, 179, .12); color: #fff; border-color: rgba(255, 126, 179, .5); }
.voice-btn-icon { font-size: 1.3rem; }

/* Home Extras Cards */
.home-extras { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.home-card { display: flex; gap: .6rem; padding: .7rem .8rem; background: var(--card); border-radius: 12px; border: 1px solid var(--border, rgba(255, 255, 255, .06)); cursor: pointer; transition: background .15s; }
.home-card:hover, .home-card:active { background: rgba(255, 255, 255, .06); }
.home-card-icon { font-size: 1.5rem; flex-shrink: 0; display: flex; align-items: flex-start; padding-top: .1rem; }
.home-card-body { flex: 1; min-width: 0; }
.home-card-label { font-size: .7rem; color: var(--muted, rgba(255, 255, 255, .72)); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.home-card-text { font-size: .85rem; color: var(--fg, rgba(255, 255, 255, .75)); line-height: 1.4; }
.home-card-prompt { border-color: rgba(147, 130, 255, .15); background: rgba(147, 130, 255, .04); }
.home-card-history { border-color: rgba(255, 200, 87, .15); background: rgba(255, 200, 87, .04); }
.home-card-identity { border-color: rgba(79, 172, 254, .15); background: rgba(79, 172, 254, .04); }
.identity-bar { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; margin: .3rem 0 .15rem; }
.identity-fill { height: 100%; background: linear-gradient(90deg, #4facfe, #00f2fe); border-radius: 3px; transition: width .8s ease; }
.identity-pct { font-size: .9rem; font-weight: 700; color: #4facfe; }
.identity-dims { display: flex; gap: .25rem; margin-top: .25rem; }
.identity-dim { font-size: .55rem; background: rgba(79, 172, 254, .12); color: rgba(79, 172, 254, .7); padding: .1rem .35rem; border-radius: 4px; }

/* Narrative card */
.home-card-narrative { border-color: rgba(168, 130, 255, .15); background: rgba(168, 130, 255, .04); }
.narrative-text { font-style: italic; color: var(--muted, rgba(255, 255, 255, .6)); }

/* Memory request card */
.home-card-request { border-color: rgba(255, 126, 179, .2); background: rgba(255, 126, 179, .06); cursor: pointer; }

/* Adventure card */
.home-card-adventure { width: 100%; text-align: left; cursor: pointer; border-color: rgba(255, 200, 87, .2); background: rgba(255, 200, 87, .06); transition: all .2s; }
.home-card-adventure:hover, .home-card-adventure:active { background: rgba(255, 200, 87, .12); transform: translateY(-1px); }

/* Garden grid */
.garden-grid { display: flex; flex-wrap: wrap; gap: .15rem; margin-top: .25rem; }
.garden-plant { font-size: 1rem; cursor: default; transition: transform .15s; }
.garden-plant:hover { transform: scale(1.3); }
.home-card-garden { border-color: rgba(67, 233, 123, .15); background: rgba(67, 233, 123, .04); }

/* ============================================================
   Daily Engagement Banner + CEC callback (strategy §4.7)
   Time-of-day banner: top of the Spirit Twin home view.
   ============================================================ */
.home-banner { flex-direction: column; align-items: stretch; padding: .9rem 1rem; margin-bottom: .25rem; cursor: default; gap: .35rem; }
.home-banner-greeting { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, rgba(255, 255, 255, .78)); font-weight: 600; }
.home-banner-message { font-size: .96rem; color: var(--fg, rgba(255, 255, 255, .92)); line-height: 1.4; }
.home-banner-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .45rem; }
.home-banner-action { appearance: none; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); color: var(--fg, rgba(255, 255, 255, .85)); padding: .5rem .75rem; border-radius: 10px; font-size: .82rem; cursor: pointer; transition: all .15s; }
.home-banner-action:hover, .home-banner-action:active { background: rgba(255, 255, 255, .09); transform: translateY(-1px); }

/* Time-of-day palettes — morning amber, afternoon neutral, evening indigo, late_night muted */
.home-banner-morning { border-color: rgba(255, 200, 87, .25); background: linear-gradient(135deg, rgba(255, 200, 87, .07), rgba(255, 165, 87, .03)); }
.home-banner-afternoon { border-color: rgba(147, 130, 255, .2); background: linear-gradient(135deg, rgba(147, 130, 255, .06), rgba(168, 130, 255, .03)); }
.home-banner-evening { border-color: rgba(79, 140, 254, .22); background: linear-gradient(135deg, rgba(79, 140, 254, .08), rgba(148, 121, 255, .04)); }
.home-banner-late_night { border-color: rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .02); opacity: .75; }

/* Inline answerable Daily Question */
.home-card-question-active { border-color: rgba(147, 130, 255, .2); background: rgba(147, 130, 255, .05); flex-direction: row; cursor: default; }
.home-card-question-active .home-card-body { display: flex; flex-direction: column; gap: .5rem; }
.daily-q-answer { width: 100%; box-sizing: border-box; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; color: var(--fg, rgba(255, 255, 255, .92)); padding: .55rem .7rem; font-family: inherit; font-size: .88rem; line-height: 1.45; resize: vertical; min-height: 60px; }
.daily-q-answer:focus { outline: none; border-color: rgba(147, 130, 255, .45); background: rgba(255, 255, 255, .06); }
.daily-q-answer:disabled { opacity: .55; cursor: not-allowed; }
.daily-q-dim-hint { font-size: .76rem; color: var(--muted, rgba(255, 255, 255, .55)); line-height: 1.4; padding: .25rem 0; font-style: italic; }
.daily-q-dim-hint strong { color: rgba(148, 121, 255, .95); font-weight: 600; font-style: normal; }
.daily-q-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.daily-q-btn { appearance: none; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); color: var(--fg, rgba(255, 255, 255, .85)); padding: .5rem .9rem; border-radius: 10px; font-size: .82rem; cursor: pointer; transition: all .15s; min-height: 36px; }
.daily-q-btn:hover:not(:disabled), .daily-q-btn:active:not(:disabled) { transform: translateY(-1px); }
.daily-q-btn:disabled { opacity: .6; cursor: not-allowed; }
.daily-q-btn-submit { background: linear-gradient(135deg, #9479ff, #4facfe); border-color: transparent; color: white; font-weight: 600; }
.daily-q-btn-submit:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(148, 121, 255, .25); }
.daily-q-status { font-size: .78rem; color: var(--muted, rgba(255, 255, 255, .6)); margin-top: .25rem; padding: .35rem .5rem; background: rgba(67, 233, 123, .08); border-radius: 8px; border-left: 2px solid rgba(67, 233, 123, .5); }

/* CEC Delivery Plans (evening callback card) */
.home-card-cec-plans { border-color: rgba(148, 121, 255, .22); background: rgba(148, 121, 255, .05); cursor: default; }
.cec-plans-list { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.cec-plan-item { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .65rem; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 9px; font-size: .85rem; color: var(--fg, rgba(255, 255, 255, .85)); cursor: pointer; transition: all .15s; min-height: 40px; }
.cec-plan-item:hover, .cec-plan-item:active { background: rgba(148, 121, 255, .1); border-color: rgba(148, 121, 255, .25); transform: translateX(2px); }
.cec-plan-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cec-plan-arrow { flex-shrink: 0; color: var(--muted, rgba(255, 255, 255, .35)); font-size: .9rem; }

/* Weekly learning panel (§4.8 compound-value) */
.home-card-weekly { border-color: rgba(67, 233, 123, .18); background: rgba(67, 233, 123, .04); cursor: default; }
.weekly-stats { display: flex; flex-wrap: wrap; gap: .6rem .9rem; margin-top: .35rem; font-size: .82rem; color: var(--fg, rgba(255, 255, 255, .82)); }
.weekly-stat { display: inline-flex; align-items: baseline; gap: .25rem; }
.weekly-stat-num { font-size: 1.05rem; font-weight: 700; color: rgba(67, 233, 123, .95); }
.weekly-dims { margin-top: .55rem; font-size: .78rem; color: var(--muted, rgba(255, 255, 255, .55)); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.weekly-dim-chip { display: inline-block; padding: 2px 8px; background: rgba(67, 233, 123, .1); border: 1px solid rgba(67, 233, 123, .18); border-radius: 999px; color: rgba(255, 255, 255, .85); font-size: .74rem; font-weight: 500; }
.weekly-narrative { margin-top: .6rem; font-size: .82rem; font-style: italic; color: var(--muted, rgba(255, 255, 255, .7)); line-height: 1.45; padding: .4rem .55rem; background: rgba(255, 255, 255, .03); border-left: 2px solid rgba(67, 233, 123, .4); border-radius: 0 8px 8px 0; }

/* Heatmap */
.home-card-heatmap { border-color: rgba(255, 255, 255, .06); }
.heatmap-grid { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; margin-top: .3rem; }
.hm-cell { aspect-ratio: 1; border-radius: 2px; min-width: 0; }
.hm-0 { background: rgba(255, 255, 255, .04); }
.hm-1 { background: rgba(67, 233, 123, .25); }
.hm-2 { background: rgba(67, 233, 123, .5); }
.hm-3 { background: rgba(67, 233, 123, .8); }

/* Family Sharing */
.family-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; padding: .6rem 1rem; margin-top: .5rem; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); border-radius: 12px; color: rgba(255, 255, 255, .5); font-size: .82rem; cursor: pointer; transition: all .2s; min-height: 44px; }
.family-btn:hover, .family-btn:active { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .8); }
.family-btn-icon { font-size: 1.2rem; }
.family-form { display: flex; flex-direction: column; gap: 0; }
.family-list { display: flex; flex-direction: column; gap: .4rem; }
.family-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem .6rem; background: rgba(255, 255, 255, .03); border-radius: 10px; border: 1px solid rgba(255, 255, 255, .06); }
.family-info { flex: 1; min-width: 0; }
.family-name { font-size: .85rem; color: rgba(255, 255, 255, .8); font-weight: 500; }
.family-detail { font-size: .7rem; color: rgba(255, 255, 255, .35); margin-top: .1rem; }
.family-revoke { background: rgba(255, 80, 80, .1); border: 1px solid rgba(255, 80, 80, .2); color: rgba(255, 80, 80, .7); padding: .3rem .7rem; border-radius: 8px; font-size: .72rem; cursor: pointer; min-height: 36px; }
.family-revoke:hover { background: rgba(255, 80, 80, .2); color: #ff5050; }

/* Milestone celebration */
.milestone-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); animation: fadeIn .3s ease; }
.milestone-card { text-align: center; background: var(--card); border-radius: 16px; padding: 2rem; max-width: 300px; animation: milestoneIn .5s ease; }
.milestone-emoji { font-size: 3rem; margin-bottom: .5rem; }
.milestone-title { font-size: 1.1rem; font-weight: 700; color: var(--fg, #fff); margin-bottom: .3rem; }
.milestone-desc { font-size: .85rem; color: var(--muted, rgba(255, 255, 255, .6)); margin-bottom: 1rem; line-height: 1.4; }
.milestone-dismiss { background: var(--spirit); color: #fff; border: none; padding: .6rem 1.5rem; border-radius: 10px; font-weight: 600; cursor: pointer; min-height: 44px; }
@keyframes milestoneIn { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }

/* Hearts */
.hrt { position: absolute; pointer-events: none; font-size: 1.1rem; animation: hrtUp 1.1s ease-out forwards; }
@keyframes hrtUp { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), -90px) scale(.3); opacity: 0; } }
/* Sparkles */
.spk { position: fixed; width: 4px; height: 4px; border-radius: 50%; pointer-events: none; animation: spkFly .6s ease-out forwards; }
@keyframes spkFly { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* Sticky header */
.sb-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; padding: .6rem 1rem; background: var(--panel); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border, rgba(255, 255, 255, .06)); max-width: 500px; margin: 0 auto; width: 100%; }
.sb-header-back { display: flex; align-items: center; gap: .4rem; background: none; border: none; color: var(--fg, rgba(255, 255, 255, .7)); font-size: .95rem; cursor: pointer; padding: .4rem .6rem; border-radius: 8px; min-height: 44px; min-width: 44px; transition: background .15s; }
.sb-header-back:hover, .sb-header-back:active { background: rgba(255, 255, 255, .08); color: var(--fg, #fff); }
.sb-header-title { flex: 1; text-align: center; font-size: .85rem; font-weight: 600; color: var(--muted, rgba(255, 255, 255, .5)); }

/* Toast */
.sb-toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(67, 233, 123, .9); color: #000; padding: .6rem 1.2rem; border-radius: 12px; font-size: .85rem; font-weight: 600; z-index: 200; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; max-width: 320px; text-align: center; }
.sb-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Capture panel */
.cap-area { display: flex; flex-direction: column; gap: .6rem; }
.cap-preview { position: relative; width: 100%; aspect-ratio: 4/3; background: #111; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cap-placeholder { text-align: center; padding: 1.5rem; color: var(--muted, rgba(255, 255, 255, .6)); }
.cap-controls { display: flex; gap: .6rem; justify-content: center; }
.cap-btn { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem 1rem; border-radius: 12px; border: 1px solid var(--border, rgba(255, 255, 255, .12)); background: var(--card); color: var(--fg, #fff); cursor: pointer; font-size: .78rem; font-weight: 600; min-width: 80px; min-height: 44px; transition: transform .12s; }
.cap-btn:active { transform: scale(.93); }
.cap-btn:disabled { opacity: .35; cursor: default; }
.cap-btn-rec { border-color: rgba(255, 75, 43, .3); background: rgba(255, 75, 43, .1); }
.cap-btn-send { border-color: rgba(255, 126, 179, .3); background: rgba(255, 126, 179, .1); }

/* Visually-hidden for screen-reader-only H1 */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Mobile */
@media (max-width: 480px) {
    /* sb-header was position:sticky;top:0 — when the user scrolled even
       slightly, it pinned at viewport top and covered the top of the
       avatar video underneath. Global .top-nav already provides navigation
       (back via browser + hamburger menu) and the bottom MobileBottomNav
       has tabs; the sb-header back button is redundant on mobile and was
       the only reason for the sticky behavior. Drop sticky on mobile and
       add a hairline of breathing room above the room so the avatar's top
       edge is never blocked by the back button. */
    .sb-header { position: relative; top: auto; }
    .room { height: 50vh; min-height: 280px; margin-top: 0.5rem; }
    .panel { min-height: 50vh; }
    .pet-body { width: 100px; height: 100px; }
    .pet { width: 120px; height: 135px; }
    .pet-eyes { gap: 18px; top: 36%; }
    .eye { width: 13px; height: 15px; }
    .pet-arm { width: 15px; height: 25px; }
    .pet-mouth { top: 60%; }
    .hb { padding: .85rem .3rem; font-size: .75rem; }
    .hb-icon { font-size: 1.5rem; }
    .fc { padding: 10px; }
    .spirit-name { font-size: 1.1rem; }
}

/* I-01 (2026-04-14 audit): Desktop — widen the experience instead of
   locking it into a 400 px phone column on a 1568 px browser. Above
   1024 px we let the room and panel breathe to ~720 px. */
@media (min-width: 1024px) {
    .room { max-width: 720px; height: 62vh; }
    .panel { max-width: 720px; }
    .sb-header { max-width: 720px; }
}

@media (max-width: 480px) {
    .spirit-name,
    .gs, .gs-arrow,
    .pips-label,
    .qr-label {
        font-size: 14px !important;
    }
    .dashboard-footer-brand,
    .dashboard-footer-links a {
        font-size: 14px;
    }
}

/* ========================================================
 * Growth chain — 5 labelled stages (audit Spirit P1).
 * Pattern adapted from docs/design/handoff/ui_kits/ispirit-app/app.css.
 * Reads as: you've come X of 5 stages with {nick}. Never an XP bar —
 * the dots are discrete, the lines are hairline, nothing fills up.
 * ======================================================== */
.home-card-chain {
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
    cursor: default;
    padding: .8rem .95rem .85rem;
}
.growth-chain {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
}
.gc-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.gc-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-weight: 700;
    font-size: 11px;
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s, background .25s;
    background: rgba(15, 23, 42, .7);
    color: #94a3b8;  /* future/not-yet-reached dots use this base; #475569 was 2.33:1 dark-on-dark (sweep-03 B3). cur/done override below */
    border: 1px solid rgba(148, 163, 184, .18);
}
.gc-name {
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .78);  /* was 3.79:1 */
    letter-spacing: .02em;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.gc-line {
    flex: 0 0 22px;
    height: 2px;
    border-radius: 2px;
    background: rgba(148, 163, 184, .16);
    margin-top: -18px; /* align with dot centre */
}
.gc-line.done {
    background: linear-gradient(90deg, rgba(52, 211, 153, .45), rgba(79, 172, 254, .3));
}
.gc-stage.gc-done .gc-dot {
    background: rgba(52, 211, 153, .16);
    color: #34d399;
    border-color: rgba(52, 211, 153, .5);
}
.gc-stage.gc-cur .gc-dot {
    background: linear-gradient(135deg, #4FACFE 0%, #9479FF 100%);
    color: #fff;
    border-color: transparent;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(79, 172, 254, .5), 0 0 0 6px rgba(79, 172, 254, .1);
}
.gc-stage.gc-cur .gc-name {
    color: var(--fg, rgba(255, 255, 255, .92));
    font-weight: 600;
}
.gc-caption {
    font-size: .82rem;
    color: var(--muted, rgba(255, 255, 255, .55));
    line-height: 1.45;
    padding-top: .1rem;
}
.gc-caption em {
    font-style: normal;
    color: var(--fg, rgba(255, 255, 255, .82));
}

@media (prefers-reduced-motion: reduce) {
    .gc-dot { transition: none; }
}

/* Cozy mode — warm ink, rose active, sage done, gold lines */
[data-ux-mode="cozy"] .home-card-chain {
    background: #FFFBF2;
    border-color: rgba(166, 130, 85, .25);
}
[data-ux-mode="cozy"] .gc-dot {
    background: rgba(26, 36, 56, .04);
    color: #5A5540;
    border-color: rgba(166, 130, 85, .28);
}
[data-ux-mode="cozy"] .gc-line {
    background: rgba(166, 130, 85, .25);
}
[data-ux-mode="cozy"] .gc-line.done {
    background: linear-gradient(90deg, rgba(126, 151, 119, .55), rgba(182, 151, 99, .55));
}
[data-ux-mode="cozy"] .gc-stage.gc-done .gc-dot {
    background: rgba(126, 151, 119, .18);
    color: #5f755a;
    border-color: rgba(126, 151, 119, .55);
}
[data-ux-mode="cozy"] .gc-stage.gc-cur .gc-dot {
    background: #C66B6B;
    color: #FFFBF2;
    box-shadow: 0 6px 20px rgba(198, 107, 107, .45), 0 0 0 6px rgba(198, 107, 107, .08);
}
[data-ux-mode="cozy"] .gc-stage.gc-cur .gc-name { color: #1A2438; }
[data-ux-mode="cozy"] .gc-caption { color: #5A5540; }
[data-ux-mode="cozy"] .gc-caption em { color: #1A2438; font-family: 'Fraunces', Georgia, serif; font-style: italic; }

/* Mobile — tighter gaps, smaller dots but still legible */
@media (max-width: 520px) {
    .growth-chain { gap: 2px; padding: 4px 0; }
    .gc-line { flex: 0 0 10px; }
    .gc-dot { width: 26px; height: 26px; font-size: 10px; }
    .gc-stage.gc-cur .gc-dot { transform: scale(1.1); }
    .gc-name { font-size: 9.5px; letter-spacing: 0; }
}

/* Lucide icon glyph inside .home-card-icon — inherits 1.5rem font-size,
 * renders as currentColor, and centres vertically against the card text. */
.home-card-icon .icon {
    display: inline-grid;
    place-items: center;
    line-height: 1;
    color: var(--accent-cyan, #4FACFE);
}
.home-card-icon .icon svg {
    width: 1em;
    height: 1em;
    display: block;
}
/* Banner action buttons: align icon with label text */
.home-banner-action .icon {
    display: inline-flex;
    vertical-align: -2px;
    margin-right: 2px;
    color: var(--accent-cyan, #4FACFE);
}
.home-banner-action .icon svg { width: 14px; height: 14px; }

/* Cozy: warm ink icon tone */
[data-ux-mode="cozy"] .home-card-icon .icon,
[data-ux-mode="cozy"] .home-banner-action .icon {
    color: #C66B6B;
}


/* ── "While you were away" card (2026-08-03) ──────────────────────────────
   Leads the home panel: what the iSpirit DID, above the scoreboard of what the
   user still owes. Rows link straight to the artifact. */
/* `.home-card` is `display:flex` with the default row direction, so the label,
   lead and list laid out side-by-side and squeezed. Stack them. */
.overnight-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--accent-cyan, #4FACFE) 26%, transparent);
}
.overnight-lead {
  margin: .1rem 0 .6rem; font-size: .92rem; font-weight: 600;
  color: var(--fg, #e6edf3);
}
.overnight-empty {
  margin: .1rem 0 0; font-size: .85rem; line-height: 1.5;
  color: var(--fg-muted, rgba(255,255,255,.72));
}
.overnight-list { display: flex; flex-direction: column; gap: 8px; }
.overnight-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 11px; border-radius: 10px; text-decoration: none;
  background: color-mix(in srgb, var(--accent-cyan, #4FACFE) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-cyan, #4FACFE) 18%, transparent);
}
.overnight-item:hover { background: color-mix(in srgb, var(--accent-cyan, #4FACFE) 15%, transparent); }
.overnight-what {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent-cyan, #4FACFE); font-weight: 700;
}
.overnight-title { font-size: .86rem; line-height: 1.4; color: var(--fg, #e6edf3); }
[data-ux-mode="cozy"] .overnight-lead,
[data-ux-mode="cozy"] .overnight-title { color: var(--cozy-ink, #1A2438); }
[data-ux-mode="cozy"] .overnight-empty { color: var(--cozy-ink-muted, #5A5540); }
[data-ux-mode="cozy"] .overnight-what { color: var(--cozy-rose, #A8475F); }
