:root {
    --sand: #EEF3FA;      /* cool page background */
    --sand-2: #E2EAF4;    /* subtle hover */
    --cream: #FFFFFF;     /* card background */
    --ink: #17263D;       /* deep cool slate */
    --ink-soft: #5A6B82;  /* muted slate */
    --terracotta: #2563EB;      /* PRIMARY (blue) - CTAs & brand */
    --terracotta-dark: #1D4ED8;
    --sage: #0EA5A9;      /* secondary (teal) */
    --sage-dark: #0C8A8D;
    --gold: #F59E0B;      /* amber */
    --line: #DCE5F1;      /* cool border */
    --danger: #DC2626;
    /* multi-colour accents */
    --c-blue: #2563EB;   --c-blue-bg: #EAF1FF;
    --c-teal: #0EA5A9;   --c-teal-bg: #E1FAF9;
    --c-green: #16A34A;  --c-green-bg: #E6F8EC;
    --c-purple: #7C3AED; --c-purple-bg: #F1EBFE;
    --c-amber: #F59E0B;  --c-amber-bg: #FFF5E1;
    --c-rose: #E11D74;   --c-rose-bg: #FCE7F1;
    --shadow: 0 18px 44px -22px rgba(23, 38, 61, .35);
    --radius: 18px;
}

* { box-sizing: border-box; }
img { max-width: 100%; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Figtree', system-ui, sans-serif;
    color: var(--ink);
    background: var(--sand);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand-name { font-family: 'Nunito', sans-serif; font-weight: 800; letter-spacing: -.01em; }
a { color: var(--terracotta-dark); text-decoration: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.empty { padding: 8px 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(253,250,245,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 70px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--terracotta); color: #fff; font-family: 'Nunito'; font-weight: 900; font-size: 1.2rem; }
.brand-name { font-size: 1.35rem; color: var(--ink); }
.main-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.main-nav > a { padding: 8px 14px; border-radius: 10px; color: var(--ink-soft); font-weight: 600; transition: background-color .2s, color .2s; }
.main-nav > a:hover { background: var(--sand-2); color: var(--ink); }
.main-nav > a.active { background: var(--terracotta); color: #fff; }
.header-user { display: flex; align-items: center; gap: 10px; }
.user-chip { font-weight: 700; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-family: 'Nunito'; font-weight: 700; border-radius: 999px; padding: 11px 22px; transition: transform .15s ease, background-color .2s, box-shadow .2s; font-size: 1rem; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--terracotta); color: #fff; box-shadow: 0 8px 20px -8px rgba(37,99,235,.6); }
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-outline { background: transparent; border: 2px solid var(--terracotta); color: var(--terracotta-dark); }
.btn-outline:hover { background: var(--terracotta); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--sand-2); color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-lg { padding: 14px 30px; font-size: 1.08rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 70px 0 40px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--sage-dark); background: rgba(14,165,169,.14); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.05; margin: 0 0 18px; }
.accent { color: var(--terracotta); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34ch; }
.hero-cta { display: flex; gap: 14px; margin: 28px 0 12px; flex-wrap: wrap; }
.hero-sub { font-size: .9rem; color: var(--ink-soft); }
.hero-art { position: relative; height: 400px; }
.orb { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .8; }
.orb-1 { width: 300px; height: 300px; background: radial-gradient(circle at 30% 30%, #F4C88E, var(--terracotta)); top: 30px; right: 20px; }
.orb-2 { width: 200px; height: 200px; background: radial-gradient(circle at 40% 40%, #A9C29E, var(--sage)); bottom: 10px; left: 0; }
.floating-card { position: absolute; display: flex; align-items: center; gap: 12px; background: #fff; padding: 14px 16px; border-radius: 16px; box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
.floating-card strong { display: block; font-family: 'Nunito'; font-size: .95rem; }
.floating-card small { color: var(--ink-soft); font-size: .82rem; }
.fc-icon { font-size: 1.5rem; }
.fc-1 { top: 20px; left: -10px; animation-delay: 0s; }
.fc-2 { top: 170px; right: -10px; animation-delay: 1.5s; }
.fc-3 { bottom: 30px; left: 40px; animation-delay: 3s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- Features ---------- */
.features { padding: 50px 0 80px; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 36px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-emoji { font-size: 2rem; }
.feature-card h3 { margin: 12px 0 6px; font-size: 1.2rem; }
.feature-card p { margin: 0; color: var(--ink-soft); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 74vh; display: grid; place-items: center; padding: 50px 0; }
.auth-card { background: var(--cream); border: 1px solid var(--line); border-radius: 24px; padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; margin: 0 0 6px; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--ink-soft); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; color: var(--ink); }
.form input, .form select, .form textarea { font-family: inherit; font-size: 1rem; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.alert { padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.alert-error { background: rgba(180,64,43,.1); color: var(--danger); border: 1px solid rgba(180,64,43,.25); }

/* ---------- Page layout ---------- */
.page { padding: 40px 0 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 2rem; margin: 0 0 4px; }
.panel { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { font-size: 1.15rem; margin: 0 0 16px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.dash-grid.two { grid-template-columns: .9fr 1.1fr; }
.link-more { display: inline-block; margin-top: 12px; font-weight: 700; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.stat-value { font-family: 'Nunito'; font-weight: 900; font-size: 2rem; color: var(--terracotta); }
.stat-sub { font-size: .8rem; color: var(--ink-soft); }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--sand); border-radius: 12px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--sand); border-radius: 14px; font-weight: 700; color: var(--ink); transition: background-color .2s, transform .15s; }
.qa span { font-size: 1.3rem; }
.qa:hover { background: var(--sand-2); transform: translateX(3px); }

/* ---------- Mood chart ---------- */
.mood-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.mood-bar { flex: 1; background: linear-gradient(var(--sage), var(--sage-dark)); border-radius: 8px 8px 0 0; min-height: 6px; position: relative; transition: height .4s ease; }
.mood-bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--ink-soft); white-space: nowrap; }

/* ---------- Chat ---------- */
.chat-page { max-width: 860px; }
.chat-modes { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.mode-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--cream); cursor: pointer; font-family: 'Nunito'; font-weight: 700; color: var(--ink-soft); transition: all .2s; }
.mode-tab span { font-size: 1.1rem; }
.mode-tab:hover { border-color: var(--terracotta); }
.mode-tab.active { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }
.crisis-banner { background: rgba(180,64,43,.08); border: 1.5px solid rgba(180,64,43,.4); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; color: var(--danger); }
.crisis-banner ul { margin: 10px 0 6px; padding-left: 18px; }
.crisis-banner a { color: var(--danger); font-weight: 700; }
.crisis-note { font-size: .85rem; }
.chat-window { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-height: 300px; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 78%; padding: 12px 16px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble.user { align-self: flex-end; background: var(--terracotta); color: #fff; border-bottom-right-radius: 6px; }
.bubble.assistant { align-self: flex-start; background: var(--sand); color: var(--ink); border-bottom-left-radius: 6px; }
.bubble.assistant.test { border: 1px dashed var(--gold); }
.bubble.typing { color: var(--ink-soft); font-style: italic; }
.chat-empty { text-align: center; color: var(--ink-soft); margin: auto; }
.chat-input { display: flex; gap: 12px; margin-top: 16px; }
.chat-input textarea { flex: 1; resize: none; font-family: inherit; font-size: 1rem; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; max-height: 140px; }
.chat-input textarea:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(200,107,74,.15); }

/* ---------- Visits ---------- */
.visit-list { display: flex; flex-direction: column; gap: 12px; }
.visit-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--sand); border-radius: 14px; }
.visit-item .v-main { flex: 1; }
.visit-item strong { font-family: 'Nunito'; }
.visit-item .v-date { font-size: .85rem; color: var(--ink-soft); }
.visit-item .v-notes { font-size: .9rem; margin-top: 4px; }
.status-pill { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status-scheduled { background: rgba(224,164,88,.2); color: #97671f; }
.status-completed { background: rgba(124,148,115,.25); color: var(--sage-dark); }
.status-missed { background: rgba(180,64,43,.15); color: var(--danger); }
.v-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-btn { border: 1px solid var(--line); background: #fff; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.chip-btn:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }

/* ---------- Mood picker ---------- */
.mood-picker { display: flex; gap: 10px; justify-content: space-between; }
.mood-opt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-size: 1.6rem; transition: all .2s; }
.mood-opt span { font-size: .72rem; font-family: 'Nunito'; font-weight: 700; color: var(--ink-soft); }
.mood-opt:hover { border-color: var(--sage); }
.mood-opt.selected { background: var(--sage); border-color: var(--sage); }
.mood-opt.selected span { color: #fff; }

/* ---------- Games ---------- */
.game-best-chip { font-size: .85rem; color: var(--ink-soft); }
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.game-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); cursor: pointer; text-align: left; transition: transform .2s, box-shadow .2s; }
.game-tile span { font-size: 2rem; }
.game-tile strong { font-family: 'Nunito'; font-size: 1.05rem; margin-top: 6px; }
.game-tile small { color: var(--ink-soft); }
.game-tile:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.game-stage { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.game-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.game-title { font-family: 'Nunito'; font-weight: 800; font-size: 1.2rem; }
.game-score { font-weight: 700; color: var(--terracotta); }
.game-area { min-height: 320px; }

/* memory */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 460px; margin: 0 auto; }
.mem-card { aspect-ratio: 1; border-radius: 14px; border: 0; background: var(--terracotta); color: transparent; font-size: 1.8rem; cursor: pointer; transition: transform .3s, background-color .2s; }
.mem-card.flipped { background: var(--sand); color: var(--ink); }
.mem-card.matched { background: var(--sage); color: #fff; cursor: default; }

/* generic game bits */
.q-box { max-width: 480px; margin: 0 auto; text-align: center; }
.q-prompt { font-family: 'Nunito'; font-weight: 800; font-size: 2rem; margin: 10px 0 20px; }
.q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.q-opt { padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-size: 1.1rem; font-weight: 700; font-family: 'Nunito'; transition: all .15s; }
.q-opt:hover { border-color: var(--terracotta); }
.q-opt.correct { background: var(--sage); color: #fff; border-color: var(--sage); }
.q-opt.wrong { background: rgba(180,64,43,.15); border-color: var(--danger); }
.g-input { font-size: 1.4rem; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; text-align: center; width: 200px; }
.g-msg { margin-top: 16px; font-weight: 700; }
.simon-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 320px; margin: 0 auto; }
.simon-btn { aspect-ratio: 1; border-radius: 18px; border: 0; cursor: pointer; opacity: .55; transition: opacity .15s; }
.simon-btn.lit { opacity: 1; }
.simon-0 { background: #C86B4A; } .simon-1 { background: #7C9473; } .simon-2 { background: #E0A458; } .simon-3 { background: #6B8CAE; }
.react-box { max-width: 480px; margin: 0 auto; height: 240px; border-radius: 16px; display: grid; place-items: center; cursor: pointer; font-family: 'Nunito'; font-weight: 800; font-size: 1.3rem; color: #fff; user-select: none; }
.odd-grid { display: grid; gap: 8px; max-width: 420px; margin: 0 auto; }
.odd-cell { aspect-ratio: 1; border-radius: 10px; border: 0; cursor: pointer; }
.slide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.slide-cell { aspect-ratio: 1; border: 0; border-radius: 12px; background: var(--terracotta); color: #fff; font-family: 'Nunito'; font-weight: 800; font-size: 1.6rem; cursor: pointer; }
.slide-cell.blank { background: transparent; cursor: default; }
.center { text-align: center; }
.mt { margin-top: 16px; }

/* elder-friendly game mode */
.elder-mode .game-area { font-size: 1.15rem; }
.elder-mode .q-prompt { font-size: 2.4rem; }
.elder-text { font-size: 1.2rem; line-height: 1.7; }
.q-options.one-col { grid-template-columns: 1fr; }
.elder-mode .q-opt { padding: 22px; font-size: 1.4rem; }
.mem-grid.elder-mem { grid-template-columns: repeat(4, 1fr); max-width: 520px; }
.elder-mem .mem-card { font-size: 3rem; border-radius: 18px; }

/* family circle */
.invite-box { margin-top: 14px; padding: 16px; background: var(--sand); border-radius: 14px; }
.invite-code { font-family: 'Nunito'; font-size: 1.6rem; letter-spacing: .12em; color: var(--terracotta-dark); }
.person-chip { font-size: .9rem; margin: 0 6px 6px 0; }
.pending-chip { font-size: .85rem; color: var(--ink-soft); background: var(--sand); display: inline-block; margin: 0 6px 6px 0; }
.link-actions { display: inline-flex; align-items: center; gap: 6px; }
.chip-btn.approve { border-color: var(--sage); color: var(--sage-dark); }
.chip-btn.revoke { border-color: rgba(180,64,43,.4); color: var(--danger); }

/* streak badge */
.head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.streak-badge { font-family: 'Nunito'; font-weight: 800; font-size: .95rem; color: var(--terracotta-dark); background: rgba(224,164,88,.2); border: 1px solid rgba(224,164,88,.5); padding: 8px 16px; border-radius: 999px; }
.streak-badge.streak-empty { color: var(--ink-soft); background: var(--sand-2); border-color: var(--line); }
.streak-badge.streak-milestone { color: #fff; background: linear-gradient(90deg, var(--gold), var(--terracotta)); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(200,107,74,.7); animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.streak-toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 16px 22px; border-radius: 16px; max-width: 90vw; width: 460px; box-shadow: var(--shadow); opacity: 0; transition: opacity .35s ease, transform .35s ease; z-index: 100; font-weight: 600; }
.streak-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* mic / voice input */
.mic-btn { flex: 0 0 auto; width: 52px; border: 1.5px solid var(--line); background: #fff; border-radius: 16px; cursor: pointer; font-size: 1.3rem; transition: background-color .2s, border-color .2s, transform .15s; }
.mic-btn:hover { border-color: var(--terracotta); }
.mic-btn.recording { background: var(--terracotta); border-color: var(--terracotta); animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(200,107,74,.5); } 50% { box-shadow: 0 0 0 10px rgba(200,107,74,0); } }
.med-inactive { opacity: .6; }

/* toolbar: language + comfort */
.toolbar { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 5px 12px; font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.lang-switch a.active { background: var(--terracotta); color: #fff; }
.comfort-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: 'Nunito'; font-weight: 800; color: var(--ink-soft); }
.comfort-toggle.on { background: var(--sage); color: #fff; border-color: var(--sage); }
.comfort-toggle.is-muted { background: var(--line); color: var(--ink-soft); opacity: .7; }
.voice-select { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: 'Figtree'; font-size: .85rem; color: var(--ink-soft); padding: 0 8px; max-width: 92px; }
.panel-title { margin: 0 0 6px; font-size: 1.2rem; }
.voice-options { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.voice-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.voice-pick { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.voice-pick input { width: 18px; height: 18px; accent-color: var(--terracotta); }
.voice-meta { display: flex; flex-direction: column; }
.voice-name { font-weight: 800; font-family: 'Nunito'; color: var(--ink); }
.preview-btn { flex: none; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; font-weight: 600; color: var(--ink); }
.setting-row input { width: 18px; height: 18px; accent-color: var(--sage); }
.legal .legal-body { max-width: 820px; line-height: 1.7; color: var(--ink); }
.legal .legal-body h2 { font-size: 1.15rem; margin: 22px 0 8px; }
.legal .legal-body ul, .legal .legal-body ol { padding-left: 22px; margin: 8px 0; }
.legal .legal-body li { margin: 6px 0; }
.legal .legal-body a { color: var(--terracotta-dark); text-decoration: underline; }
.btn-danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-danger:hover { filter: brightness(0.94); }
.btn-danger:disabled { opacity: .55; cursor: not-allowed; }
.footer-legal { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-legal a { color: var(--ink-soft); font-size: .85rem; }
.footer-legal a:hover { color: var(--terracotta-dark); }

/* ==================== LANDING PAGE ==================== */
.lp-inner { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.lp-section { padding: clamp(3rem, 7vw, 6rem) 0; }
.lp-tint { background: linear-gradient(180deg, #fff, var(--sand)); }
.lp-head { max-width: 760px; margin: 0 auto clamp(2rem, 5vw, 3.2rem); text-align: center; }
.lp-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; margin: 8px 0 12px; }
.lp-sub { font-size: 1.08rem; color: var(--ink-soft); }

/* Hero */
.lp-hero { background: linear-gradient(160deg, #EAF1FF 0%, #E1FAF9 55%, var(--sand) 100%); padding: clamp(2.5rem,6vw,5rem) 0; overflow: hidden; }
.lp-hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(2rem,5vw,4.5rem); align-items: center; }
.lp-hero-copy h1 { font-size: clamp(2.3rem,5vw,3.9rem); line-height: 1.05; margin: 0 0 18px; }
.lp-hero-copy .lead { max-width: 42ch; }
.lp-trust { list-style:none; margin: 26px 0 0; padding: 0; display:flex; flex-wrap:wrap; gap: 10px; }
.lp-trust li { background:#fff; border:1px solid var(--line); border-radius:999px; padding:8px 14px; font-weight:700; font-size:.85rem; color:var(--ink); }
.lp-hero-media { position: relative; }
.lp-hero-frame { position: relative; border-radius: 26px; overflow:hidden; border:1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(23,38,61,.5); aspect-ratio: 4/3.3; background: var(--sand-2); }
.lp-hero-frame img { width:100%; height:100%; object-fit:cover; display:block; }
.lp-hero-badge { position:absolute; display:flex; align-items:center; gap:10px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); padding:11px 14px; border-radius:14px; box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
.lp-hero-badge span { width:36px;height:36px;display:grid;place-items:center;border-radius:11px;font-size:1.15rem; }
.lp-hero-badge strong { display:block; font-family:'Nunito'; font-size:.9rem; }
.lp-hero-badge small { color: var(--ink-soft); font-size:.78rem; }
.lp-badge-1 { top:22px; left:-14px; } .lp-badge-1 span { background: var(--c-purple-bg); }
.lp-badge-2 { bottom:24px; right:-14px; animation-delay:2.5s; } .lp-badge-2 span { background: var(--c-amber-bg); }

/* Boxed cards (audience + features) */
.lp-audience, .lp-fgrid { display:grid; grid-template-columns: repeat(3,1fr); gap: clamp(1rem,2vw,1.5rem); }
.lp-aud-card, .lp-fcard { display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.lp-aud-card { border-top:4px solid var(--accent); }
.lp-aud-card:hover, .lp-fcard:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent); }
.lp-aud-card h3, .lp-fcard h3 { margin: 14px 0 8px; font-size: 1.2rem; }
.lp-aud-card p, .lp-fcard p { margin:0; color: var(--ink-soft); }
.lp-ico { width: 54px; height: 54px; display:grid; place-items:center; font-size: 1.5rem; border-radius: 14px; background: var(--accent-bg); color: var(--accent); }

/* Trust & safety band */
.lp-band { background: linear-gradient(135deg, #10233F, #123A5C); color:#fff; padding: clamp(3rem,7vw,5rem) 0; }
.lp-band-grid { display:grid; grid-template-columns: .8fr 1.2fr; gap: clamp(1.5rem,4vw,3rem); align-items:center; }
.lp-band h2 { color:#fff; font-size: clamp(1.8rem,3.5vw,2.5rem); margin: 6px 0 0; }
.lp-band-cols { display:grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem,3vw,1.8rem); }
.lp-band-box { background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 22px; }
.lp-band-box h4 { font-family:'Nunito'; font-size:1.1rem; margin:0 0 8px; color:#fff; }
.lp-band-box p { margin:0; color: rgba(255,255,255,.85); }
.eyebrow-light { color:#fff; background: rgba(255,255,255,.18); }

/* Steps */
.lp-steps { display:grid; grid-template-columns: repeat(3,1fr); gap: clamp(1rem,2vw,1.5rem); }
.lp-step { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.lp-step-n { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background: linear-gradient(135deg,var(--c-blue),var(--c-teal)); color:#fff; font-family:'Nunito'; font-weight:900; font-size:1.2rem; margin-bottom:14px; }
.lp-step h3 { font-size:1.2rem; margin:0 0 6px; } .lp-step p { margin:0; color:var(--ink-soft); }

/* Final CTA */
.lp-cta { background: linear-gradient(135deg, var(--c-blue), var(--c-teal)); color:#fff; border-radius: 28px; padding: clamp(2.5rem,6vw,4.5rem) clamp(1.5rem,5vw,4rem); text-align:center; }
.lp-cta h2 { color:#fff; font-size: clamp(1.9rem,4vw,2.9rem); margin:0 0 12px; }
.lp-cta p { color: rgba(255,255,255,.92); font-size:1.1rem; max-width:52ch; margin:0 auto 26px; }
.lp-cta-actions { justify-content:center; }
.lp-btn-cream { background:#fff; color: var(--c-blue); }
.lp-btn-cream:hover { background: #EAF1FF; }
.lp-btn-ghost-light { background:transparent; border:2px solid rgba(255,255,255,.7); color:#fff; }
.lp-btn-ghost-light:hover { background: rgba(255,255,255,.14); }

@media (max-width: 900px) {
    .lp-hero-grid, .lp-band-grid { grid-template-columns: 1fr; }
    .lp-audience, .lp-fgrid, .lp-steps, .lp-band-cols { grid-template-columns: 1fr; }
    .lp-hero-media { margin-top: 8px; }
    .lp-badge-1 { left: 6px; } .lp-badge-2 { right: 6px; }
}
@media (min-width: 560px) and (max-width: 900px) {
    .lp-fgrid, .lp-audience, .lp-steps, .lp-band-cols { grid-template-columns: repeat(2,1fr); }
}

/* comfort mode — bigger text + higher contrast, site-wide */
html.comfort body { font-size: 1.18rem; }
html.comfort { --ink: #14110d; --ink-soft: #3f382f; --line: #b9a789; }
html.comfort .btn { font-size: 1.12rem; padding: 13px 26px; }
html.comfort .main-nav > a { font-size: 1.05rem; }
html.comfort .page-head h1 { font-size: 2.4rem; }
html.comfort .bubble { font-size: 1.15rem; }
html.comfort .form input, html.comfort .form select, html.comfort .form textarea { font-size: 1.12rem; }
html.comfort .feature-card p, html.comfort .muted { color: var(--ink-soft); }

/* Devanagari-friendly font when Hindi is active */
html[lang="hi"] body, html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3, html[lang="hi"] .brand-name, html[lang="hi"] .btn { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; }

/* medicine adherence */
.adherence { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.dose-week { display: inline-flex; gap: 4px; }
.dose-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sand-2); border: 1px solid var(--line); }
.dose-dot.taken { background: var(--sage); border-color: var(--sage); }
.chip-btn.take.done { background: var(--sage); color: #fff; border-color: var(--sage); }

/* photo memories */
.memory-form .row { margin: 0; }
.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.memory-card { margin: 0; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.memory-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.memory-card figcaption { padding: 12px 14px; font-weight: 600; color: var(--ink); flex: 1; }
.memory-card form { padding: 0 14px 14px; }
.memory-del { width: 100%; }
.memory-actions { display: flex; gap: 8px; padding: 0 14px 14px; align-items: center; }
.memory-actions form { padding: 0; }
.listen-chip { font-size: .95rem; }

/* group discussions */
.thread-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.thread-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left; background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .2s; }
.thread-card:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.thread-main { display: flex; flex-direction: column; gap: 3px; }
.thread-main strong { font-family: 'Nunito'; font-size: 1.1rem; }
.thread-cat { display: inline-block; width: fit-content; font-size: .72rem; font-weight: 700; color: var(--sage-dark); background: rgba(124,148,115,.16); padding: 2px 10px; border-radius: 999px; }
.thread-count { font-weight: 700; color: var(--terracotta-dark); white-space: nowrap; }
.thread-head { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.thread-head h2 { margin: 0; }
.thread-head .thread-del { width: fit-content; margin-top: 6px; }
.thread-body { background: var(--sand); border-radius: 12px; padding: 14px 16px; }
.reply-list { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 18px; }
.reply-item { background: var(--sand); border-radius: 12px; padding: 12px 14px; }
.reply-item p { margin: 6px 0 0; white-space: pre-wrap; }
.reply-form { border-top: 1px solid var(--line); padding-top: 16px; }
.react-row { margin-top: 8px; }
.react-bar { display: inline-flex; gap: 8px; }
.react-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: .9rem; transition: all .15s; }
.react-btn:hover { border-color: var(--terracotta); }
.react-btn.on { background: rgba(200,107,74,.14); border-color: var(--terracotta); }
.reply-item { position: relative; }
.translate-wrap { display: inline-flex; flex-direction: column; gap: 4px; margin-left: 8px; vertical-align: middle; }
.translate-btn { font-size: .78rem; padding: 2px 10px; }
.translate-out { color: var(--ink-soft); font-style: italic; }
.thread-tools, .reply-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.reply-tools { position: absolute; top: 12px; right: 12px; margin: 0; }
.reply-item.best { border: 1.5px solid var(--sage); background: rgba(124,148,115,.1); border-radius: 12px; }
.best-badge { display: inline-block; font-size: .72rem; font-weight: 700; color: #fff; background: var(--sage); padding: 2px 10px; border-radius: 999px; margin-bottom: 6px; }
.report-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--sand); border-radius: 12px; margin-bottom: 10px; }
.report-actions { display: inline-flex; gap: 6px; white-space: nowrap; }

/* care timeline */
.timeline-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline-feed li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.timeline-feed li:last-child { border-bottom: 0; }
.tl-icon { font-size: 1.2rem; }
.tl-text { flex: 1; }

/* achievements */
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 8px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); transition: transform .2s; }
.badge-card.earned { border-color: var(--gold); box-shadow: 0 8px 24px -14px rgba(224,164,88,.8); }
.badge-card.earned:hover { transform: translateY(-5px); }
.badge-card.locked { opacity: .5; filter: grayscale(.6); }
.badge-icon { font-size: 2.4rem; }
.badge-card strong { font-family: 'Nunito'; }
@media (max-width: 900px) { .badge-grid { grid-template-columns: 1fr 1fr; } }

/* care tasks */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--sand); border-radius: 12px; }
.task-item.done .task-check span { text-decoration: line-through; color: var(--ink-soft); }
.task-check { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; font-weight: 600; }
.task-check input { width: 20px; height: 20px; accent-color: var(--sage); }
.task-meta { white-space: nowrap; }

/* journal */
.journal-question { font-family: 'Nunito'; font-weight: 800; font-size: 1.4rem; color: var(--terracotta-dark); background: var(--sand); padding: 16px 18px; border-radius: 14px; margin: 0 0 14px; }
.journal-list { display: flex; flex-direction: column; gap: 14px; }
.journal-entry { background: var(--sand); border-radius: 12px; padding: 14px 16px; }
.journal-entry p { margin: 6px 0 0; white-space: pre-wrap; }
.journal-entry strong { font-family: 'Nunito'; }
.journal-input { position: relative; }
.journal-input textarea { width: 100%; padding-right: 56px; }
.journal-input .mic-btn { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; }
@media (max-width: 900px) { .memory-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .memory-grid { grid-template-columns: 1fr; } .main-nav { flex-wrap: wrap; } }

/* read-aloud button in chat */
.bubble.assistant { position: relative; }
.listen-btn { background: transparent; border: 0; cursor: pointer; font-size: 1rem; margin-left: 8px; opacity: .55; transition: opacity .2s, transform .15s; vertical-align: middle; }
.listen-btn:hover { opacity: 1; transform: scale(1.15); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--cream); padding: 26px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .88rem; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1.35rem; color: var(--ink); margin-left: auto; }
.nav-collapse { display: contents; }

/* Tablet / small laptop: collapse the nav into a hamburger dropdown */
@media (max-width: 1024px) {
    .nav-toggle { display: inline-grid; place-items: center; }
    .nav-collapse { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 60; flex-direction: column; align-items: stretch; gap: 12px; background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px clamp(16px, 4vw, 24px); box-shadow: var(--shadow); max-height: calc(100vh - 70px); overflow-y: auto; }
    .nav-collapse.open { display: flex; }
    .main-nav { flex-direction: column; align-items: stretch; margin-left: 0; gap: 4px; }
    .main-nav > a { padding: 12px 14px; border-radius: 10px; }
    .header-user { flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
    .toolbar { flex-wrap: wrap; }
    .lp-hero-copy .lead { max-width: none; }
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid, .dash-grid.two { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .game-grid { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .page-head { align-items: flex-start; }
    .chat-window { max-height: 60vh; }
    .mood-picker { flex-wrap: wrap; }
    .mood-opt { flex: 1 1 28%; }
}

@media (max-width: 560px) {
    .container { padding: 0 16px; }
    .feature-grid, .q-options, .stat-grid, .game-grid, .memory-grid, .badge-grid { grid-template-columns: 1fr; }
    .mem-grid { grid-template-columns: repeat(4, 1fr); }
    .page { padding: 26px 0 50px; }
    .panel { padding: 18px; }
    .page-head h1 { font-size: 1.6rem; }
    .btn-lg { padding: 12px 22px; font-size: 1rem; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; }
    .chat-modes { gap: 8px; }
    .mode-tab { padding: 9px 14px; }
    .bubble { max-width: 88%; }
    .voice-select { max-width: 120px; }
    .footer-inner { flex-direction: column; gap: 10px; }
}
