/* Nest v2 — design system from design/app-design-system (nest-design-system-v2).
   Tokens, then shell, then per-surface components, then compat styles for the
   retained auth/security views. v1 sheet preserved at styles-v1-backup.css.bak. */

:root {
  color-scheme: light; /* light-only palette — keep Android force-dark off it */
  --sage: #6E7F63; --sage-deep: #455239; --sage-link: #5E6E54;
  --sage-tint: #DDE4D3; --sage-select: #EBF0E4; --sage-dash: #A8B29B;
  --clay: #BE7C63; --clay-deep: #A45E43; --clay-tint: #F1E4DC; --clay-line: #E6C9BA;
  --ochre: #C6A24C; --ochre-deep: #8A6B1F; --ochre-tint: #F4EAC9;
  --paper: #FBF8F1; --oat: #F4EFE6; --line: #E6DFD2; --hairline: #EFE8DA;
  --ink: #2C2823; --ink-head: #3F3A32; --ink-mid: #4A4438; --ink-soft: #6E665A;
  --meta: #786E5C; --hint: #786E5C; --tab-off: #6E6553; --chev: #9A8F7D;
  --disabled-bg: #EAE2D2; --disabled-fg: #8B8069;
  --caution: #B4685A; --caution-deep: #96473A; --caution-tint: #F3DCD6;
  --vvh: 100vh; --vvt: 0px;
  --font-serif: 'Newsreader', serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@keyframes nestFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

html, body { height: 100%; overflow: hidden; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #F4EFE6 0%, #E9E1D2 100%) fixed;
  color: var(--ink);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.serif { font-family: 'Newsreader', serif; font-weight: 400; }
/* color:inherit matters: iOS Safari paints button text blue otherwise, and
   most cards/rows in this UI are buttons. */
button { font-family: 'Nunito Sans', sans-serif; color: inherit; }
input, textarea { font-family: 'Nunito Sans', sans-serif; }
input:focus, textarea:focus { outline: none; }
a { color: var(--sage-link); text-decoration: none; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 200; background: var(--sage-deep); color: var(--paper); font-weight: 700; padding: 10px 16px; border-radius: 0 0 12px 12px; transition: top .15s; }
.skip-link:focus { top: 0; outline: none; }
.topbar-title:focus { outline: none; }
.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; }
/* A real <button> that looks like the inline text links it replaced —
   href-less anchors aren't focusable, so actions must be buttons. */
.linklike { background: none; border: none; padding: 0; cursor: pointer; color: var(--sage-link); font-family: inherit; font-size: inherit; font-weight: 700; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--sage); outline-offset: 2px;
}

/* ---------- shell ----------
   Fixed app shell: the shell is exactly the visual viewport tall (--vvh
   tracks the keyboard via visualViewport) and only .view scrolls inside it.
   This keeps the compose bar above the keyboard, the tab bar at the true
   bottom, and stops iOS from scrolling the page under the status bar. */
#app { max-width: 560px; margin: 0 auto; height: var(--vvh); transform: translateY(var(--vvt)); display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 12px;
  min-height: 62px;
  flex-shrink: 0;
}
.topbar .brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--sage);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topbar-title { font-family: 'Newsreader', serif; font-weight: 400; font-size: 21px; color: var(--ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backbtn {
  border: 1px solid var(--line); background: var(--paper); width: 44px; height: 44px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.backbtn i { font-size: 18px; color: #5E5647; }

.view { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 8px; display: flex; flex-direction: column; }
.screen { animation: nestFade .35s ease both; padding: 2px 20px 24px; }

.tabbar {
  flex-shrink: 0; z-index: 10;
  display: flex; background: var(--paper); border-top: 1px solid var(--hairline);
  padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--tab-off); padding: 8px 0; min-height: 48px; font-size: 10.5px; font-weight: 600;
}
.tabbar a i { font-size: 22px; }
.tabbar a.active { color: var(--sage-link); font-weight: 700; }
body.kb-open .tabbar { display: none; }

/* ---------- primitives ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.btn {
  display: block; width: 100%; border: none; cursor: pointer; text-align: center;
  font-weight: 700; font-size: 16px; padding: 16px; border-radius: 100px;
  background: var(--sage); color: var(--paper);
  box-shadow: 0 8px 22px rgba(110, 127, 99, .28);
  transition: background .2s;
}
.btn:hover { background: #63745A; }
.btn:disabled { background: var(--disabled-bg); color: var(--disabled-fg); box-shadow: none; cursor: not-allowed; }
.btn.secondary { background: var(--paper); color: var(--sage-deep); border: 1.5px solid #C4CDB8; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--sage-link); box-shadow: none; }
.btn.terra { background: var(--caution-deep); box-shadow: none; }
.btn.small { font-size: 13.5px; padding: 11px 18px; width: auto; display: inline-block; }
.btn.dashed {
  background: transparent; color: var(--sage-link); box-shadow: none;
  border: 1.5px dashed var(--sage-dash); font-size: 14.5px; padding: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
}
.chip-btn {
  cursor: pointer; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-mid);
  border-radius: 100px; padding: 8px 13px; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px;
}
.chip-btn.on { background: var(--sage-select); border-color: var(--sage); color: var(--sage-deep); }
.chip-btn i { font-size: 13px; }
.avatar { border-radius: 50%; background: var(--sage); color: var(--paper); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--meta); }
.section-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--meta); }
.meta { font-size: 12.5px; color: var(--meta); }
.muted { color: var(--ink-soft); }
.faint { color: var(--meta); font-size: 13px; }
.tagpill { font-size: 11px; font-weight: 700; border-radius: 100px; padding: 4px 10px; display: inline-block; }
.field { width: 100%; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 15px 16px; font-size: 16px; color: var(--ink); min-height: 44px; }
.field:focus { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(110, 127, 99, .14); }

/* ---------- toast + modal ---------- */
#toast-root { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--sage-deep); color: var(--paper); font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 100px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 26px rgba(44, 40, 35, .2); white-space: nowrap; animation: toastIn .25s ease both;
}
.toast-act { border: none; cursor: pointer; background: var(--sage-link); color: var(--paper); font-weight: 700; font-size: 12.5px; padding: 6px 12px; border-radius: 100px; }
.modal-back { position: fixed; inset: 0; background: rgba(44, 40, 35, .38); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal { background: var(--paper); border-radius: 22px; padding: 24px; width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto; }
.modal h2 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 22px; margin-bottom: 8px; }
.modal .sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-actions .btn { width: auto; padding: 12px 20px; font-size: 14px; }

/* ---------- Today ---------- */
.today-greet h1 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 27px; }
.today-card { text-align: left; cursor: pointer; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 8px 22px rgba(44, 40, 35, .05); }
.today-card .t-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.t-badge { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.today-card .t-q { font-family: 'Newsreader', serif; font-size: 19px; line-height: 1.4; margin-bottom: 10px; }
.t-link { font-weight: 700; font-size: 14px; color: var(--sage-link); }
.gen-tag { margin-left: auto; background: var(--oat); border: 1px solid var(--line); color: #5E5647; font-size: 11px; font-weight: 700; border-radius: 100px; padding: 3px 9px; }
.row-card { text-align: left; cursor: pointer; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; align-items: center; gap: 12px; }
.row-card .rc-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--sage-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row-card .rc-icon i { color: var(--sage-deep); font-size: 19px; }
.row-card .rc-main { flex: 1; min-width: 0; }
.row-card .rc-title { font-weight: 700; font-size: 14px; }
.row-card .rc-sub { font-size: 13px; color: var(--meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-head { display: flex; align-items: center; margin: 6px 0 10px; }
.sec-head a { margin-left: auto; font-size: 13px; font-weight: 700; padding: 8px 0; cursor: pointer; }

/* ---------- Coach ---------- */
.chat-screen { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; height: 100%; }
.ctx-zone { flex-shrink: 0; padding: 0 20px 8px; }
.ctx-pill {
  cursor: pointer; border: 1px solid var(--line); background: var(--paper); border-radius: 100px;
  padding: 9px 14px; display: inline-flex; align-items: center; gap: 7px; min-height: 38px;
  font-size: 13px; font-weight: 700; color: var(--ink-head);
}
.ctx-pill i.lead { font-size: 15px; color: var(--sage); }
.ctx-pill i.chev { font-size: 13px; color: var(--meta); }
.ctx-picker { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-top: 8px; }
.ctx-picker .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ctx-picker .using { font-size: 12px; color: var(--meta); margin-top: 10px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 4px 20px 12px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 84%; padding: 13px 15px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; }
.bubble.user { align-self: flex-end; background: #5E6E54; color: var(--paper); border-radius: 18px 18px 5px 18px; } /* darker sage: AA at 14.5px */
.bubble.coach { align-self: flex-start; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; }
.typing-status { align-self: flex-start; font-size: 12.5px; color: var(--meta); padding: 2px 4px; }
.suggest-card { align-self: flex-start; max-width: 84%; background: var(--clay-tint); border: 1px solid var(--clay-line); border-radius: 16px; padding: 14px; }
.suggest-card .s-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--clay-deep); letter-spacing: .04em; text-transform: uppercase; }
.suggest-card .s-text { font-family: 'Newsreader', serif; font-size: 15.5px; line-height: 1.4; margin-bottom: 10px; }
.suggest-card .s-btn { border: none; cursor: pointer; font-weight: 700; font-size: 13.5px; background: var(--clay-deep); color: var(--paper); padding: 11px 16px; border-radius: 100px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.suggest-card .s-btn.added { background: #EDE5D6; color: var(--ink-soft); }
.safety-card { align-self: flex-start; max-width: 92%; background: var(--paper); border: 1.5px solid var(--caution); border-radius: 16px; padding: 16px; }
.safety-card .sf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; font-weight: 700; color: var(--caution-deep); letter-spacing: .04em; text-transform: uppercase; }
.safety-card p.sf-lede { font-size: 14px; line-height: 1.55; color: var(--ink-head); margin-bottom: 12px; }
.safety-card .sf-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sf-primary, .sf-secondary {
  cursor: pointer; border-radius: 12px; padding: 13px 14px; font-weight: 700; font-size: 14px;
  text-align: left; display: flex; align-items: center; gap: 9px; min-height: 44px; width: 100%;
}
.sf-primary { border: 1.5px solid var(--caution); background: var(--caution-tint); color: var(--caution-deep); }
.sf-secondary { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-head); }
.sf-links { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.sf-links button { cursor: pointer; border: none; background: transparent; color: var(--meta); font-weight: 700; font-size: 13px; padding: 8px 4px; min-height: 44px; }
.safety-card .sf-note { font-size: 10.5px; color: var(--hint); margin-top: 8px; line-height: 1.45; }
.chat-compose-zone { padding: 8px 16px 2px; flex-shrink: 0; }
.verify-banner { background: var(--ochre-tint); border: 1px solid var(--ochre); border-radius: 12px; padding: 9px 14px; font-size: 12.5px; color: var(--ink-mid); margin-bottom: 8px; text-align: center; }
.chat-compose { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 100px; padding: 6px 6px 6px 18px; }
.chat-compose:focus-within { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(110, 127, 99, .14); }
.chat-compose input { flex: 1; border: none; background: transparent; font-size: 16px; color: var(--ink); min-height: 32px; min-width: 0; }
.sendbtn { border: none; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sendbtn:disabled { background: #C7BCA6; cursor: default; }
.sendbtn i { color: var(--paper); font-size: 18px; }
.scope-line { font-size: 11px; color: var(--meta); text-align: center; margin: 7px 0 2px; line-height: 1.4; }
.chat-screen { position: relative; }
.chat-newmsg { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); border: none; cursor: pointer; background: var(--sage-deep); color: var(--paper); font-weight: 700; font-size: 12.5px; padding: 9px 15px; border-radius: 100px; box-shadow: 0 8px 20px rgba(44,40,35,.25); z-index: 5; }
.convo-row { cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 15px; display: flex; align-items: center; gap: 12px; min-height: 48px; }
.convo-row .cv-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--sage-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.convo-row .cv-icon i { color: var(--sage-deep); font-size: 19px; }
.convo-row .cv-main { flex: 1; min-width: 0; }
.convo-row .cv-title { font-weight: 700; font-size: 15px; }
.convo-row .cv-prev { font-size: 12.5px; color: var(--meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-row .cv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.convo-row .cv-time { font-size: 11.5px; color: var(--meta); }
.convo-row .cv-tag { background: var(--oat); border: 1px solid var(--line); color: #5E5647; font-size: 10.5px; font-weight: 700; border-radius: 100px; padding: 2px 8px; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-del { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: none; background: transparent; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cv-del i { font-size: 15px; color: var(--chev); }
.cv-del:hover i { color: var(--caution-deep); }

/* ---------- Reflect ---------- */
.composer-pill { cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1.5px solid var(--line); border-radius: 100px; padding: 14px 20px; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.composer-pill i { color: var(--clay); font-size: 17px; }
.composer-pill span { font-size: 15px; color: var(--meta); }
.composer { background: var(--paper); border: 1.5px solid var(--sage-dash); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 22px rgba(44, 40, 35, .06); }
.composer:focus-within { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(110, 127, 99, .14); }
.composer textarea { width: 100%; background: transparent; border: none; font-family: 'Newsreader', serif; font-size: 17px; line-height: 1.5; color: var(--ink); min-height: 64px; resize: none; }
.composer .c-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--meta); margin-bottom: 8px; }
.composer .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.audience-line { display: flex; align-items: center; gap: 7px; background: var(--oat); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--ink-head); }
.audience-line i { font-size: 15px; color: var(--meta); }
.eye-line { font-size: 12px; color: var(--meta); margin-top: 8px; display: flex; align-items: flex-start; gap: 5px; }
/* Sticky action row: on short viewports Cancel/Save stay visible while the
   composer body scrolls (same pattern as onboarding's pinned Continue). */
.composer .c-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--hairline); padding-top: 12px; position: sticky; bottom: 0; background: var(--paper); }
.composer .c-hint { font-size: 12px; color: var(--hint); flex: 1; }
.composer .c-cancel { border: none; cursor: pointer; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 13.5px; padding: 11px 8px; min-height: 44px; }
.composer .c-save { border: none; cursor: pointer; font-weight: 700; font-size: 13.5px; background: var(--sage); color: var(--paper); padding: 11px 18px; border-radius: 100px; min-height: 44px; }
.composer .c-save:disabled { background: var(--disabled-bg); color: var(--disabled-fg); cursor: not-allowed; }
.refl-card { cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
.refl-card .r-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.refl-card .r-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--meta); }
.refl-card .r-date { font-size: 11.5px; color: var(--meta); margin-left: auto; }
.refl-card .r-text { font-family: 'Newsreader', serif; font-size: 17px; line-height: 1.45; }
.detail-text { font-family: 'Newsreader', serif; font-size: 22px; line-height: 1.48; margin-bottom: 24px; white-space: pre-wrap; }
.audience-banner { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-mid); }
.audience-banner i { color: var(--meta); font-size: 18px; }
.share-picker { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.share-row { cursor: pointer; text-align: left; display: flex; align-items: center; gap: 11px; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px 13px; min-height: 44px; font-weight: 700; font-size: 14px; width: 100%; }
.share-row.on { border-color: var(--sage); background: var(--sage-select); }
.share-row .check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #B4A891; background: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.share-row.on .check { border-color: var(--sage); background: var(--sage); }
.share-row .check i { font-size: 12px; color: var(--paper); visibility: hidden; }
.share-row.on .check i { visibility: visible; }

/* ---------- Circles ---------- */
.circle-card { cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.circle-card .g-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.circle-card .g-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--sage-tint); }
.circle-card .g-icon i { font-size: 20px; color: var(--sage); }
.circle-card .g-prev { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }
.post-card { cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
.post-card .p-head, .post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.post-card .p-text { font-family: 'Newsreader', serif; font-size: 16.5px; line-height: 1.45; margin-bottom: 12px; }
.post-actions { display: flex; gap: 14px; align-items: center; }
.withyou-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; padding: 8px 10px; margin: -8px -10px; border-radius: 100px; min-height: 40px; border: none; background: transparent; }
.withyou-inline:hover { background: var(--oat); }
.withyou-inline.on { color: var(--caution-deep); }
.withyou-inline i { font-size: 16px; color: var(--meta); }
.withyou-inline.on i { color: var(--caution); }
.withyou-btn { cursor: pointer; border: 1.5px solid var(--line); background: var(--paper); color: #5E5647; border-radius: 100px; padding: 11px 16px; font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
.withyou-btn.on { border-color: var(--caution); background: var(--caution-tint); color: var(--caution-deep); }
.comment-row { display: flex; gap: 10px; }
.comment-row .c-bubble { flex: 1; background: var(--paper); border: 1px solid var(--hairline); border-radius: 14px; padding: 11px 13px; }
.comment-row .c-author { font-weight: 700; font-size: 12.5px; margin-bottom: 3px; }
.comment-row .c-text { font-size: 13.5px; line-height: 1.5; color: var(--ink-head); }

/* ---------- You ---------- */
.you-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.you-head .name { font-family: 'Newsreader', serif; font-size: 22px; }
.you-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 16px; }
.you-card .yc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 700; font-size: 14.5px; }
.you-card .yc-head i { font-size: 19px; color: var(--sage); }
.kid-row { cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 4px 0; min-height: 48px; }
.kid-row .k-name { font-weight: 700; font-size: 14.5px; }
.kid-row .k-sub { font-size: 12px; color: var(--meta); }
.settings-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 16px; }
.settings-row { cursor: pointer; width: 100%; text-align: left; border: none; background: transparent; display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 52px; font-weight: 600; font-size: 15px; }
.settings-row + .settings-row { border-top: 1px solid var(--hairline); }
.settings-row i.lead { color: var(--meta); font-size: 19px; }
.settings-row .grow { flex: 1; }
.settings-row i.chev { color: var(--chev); font-size: 16px; }
.panel-note { background: var(--oat); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.panel-note p { font-size: 13px; line-height: 1.6; color: var(--ink-mid); }

/* ---------- native Compass quiz ---------- */
.cq-opt { position: relative; cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 14.5px; line-height: 1.45; color: var(--ink); font-weight: 500; display: flex; gap: 12px; align-items: flex-start; }
.cq-opt.on { background: var(--sage-select); border-color: var(--sage); }
.cq-opt.second { border-style: dashed; }
.cq-opt .cq-dot { width: 8px; height: 8px; border-radius: 50%; background: #D8CFBD; margin-top: 7px; flex-shrink: 0; }
.cq-opt.on .cq-dot { background: var(--sage); }
.cq-rank { position: absolute; top: -10px; right: 14px; font-size: 11px; font-weight: 700; color: var(--sage-deep); background: var(--paper); border: 1px solid var(--sage); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* ---------- onboarding ---------- */
.ob-screen { animation: nestFade .4s ease both; min-height: calc(var(--vvh) - 40px); display: flex; flex-direction: column; padding: 14px 28px calc(40px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; }
.ob-top { display: flex; align-items: center; gap: 14px; padding: 8px 0 14px; }
/* On short viewports the primary action stays in view while the step scrolls. */
.ob-screen > .btn:not(.ghost) { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
.ob-track { flex: 1; height: 6px; background: #E4DCCB; border-radius: 100px; overflow: hidden; }
.ob-fill { height: 100%; background: var(--sage); border-radius: 100px; transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.ob-screen h1 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 30px; line-height: 1.18; margin-bottom: 12px; }
.ob-screen h1 em { font-style: italic; color: var(--sage); }
.ob-screen .lede { font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.ob-icon { width: 52px; height: 52px; border-radius: 15px; background: var(--sage-tint); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.ob-icon i { color: var(--sage-deep); font-size: 26px; }
.ob-icon.clay { background: var(--clay-tint); }
.ob-icon.clay i { color: var(--clay); }
.age-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.age-card { cursor: pointer; text-align: left; background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.age-card.on { background: var(--sage-select); border-color: var(--sage); }
.age-card i { font-size: 26px; color: var(--hint); }
.age-card.on i { color: var(--sage-deep); }
.age-card .a-label { font-weight: 700; font-size: 15.5px; }
.age-card .a-range { font-size: 12.5px; color: var(--hint); }
.ob-point { display: flex; gap: 13px; align-items: flex-start; }
.ob-point .op-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--sage-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ob-point .op-icon i { color: var(--sage-deep); font-size: 18px; }
.ob-point p { font-size: 14.5px; line-height: 1.5; color: var(--ink-mid); margin-top: 5px; }
.door { cursor: pointer; text-align: left; width: 100%; background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 13px; }
.door .d-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sage-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.door .d-icon i { font-size: 20px; color: var(--sage-deep); }
.door .d-title { font-weight: 700; font-size: 15px; }
.door .d-sub { font-size: 12.5px; color: var(--meta); }

/* ---------- auth compat (retained view) ---------- */
body.auth-mode .topbar, body.auth-mode .tabbar { display: none; }
.auth-wrap { min-height: calc(100vh - 40px); display: flex; align-items: center; justify-content: center; padding: 22px; position: relative; }
.auth-back { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 26px; border-radius: 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-card h1 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 26px; }
/* auth.js structures fields as <label class="field"><span>…</span><input></label> —
   the label is the block wrapper, the inner input gets the field skin. */
#auth-form { display: flex; flex-direction: column; gap: 14px; }
label.field { display: block; background: transparent; border: none; padding: 0; min-height: 0; }
label.field > span { display: block; font-weight: 600; font-size: 14px; color: var(--ink-head); margin-bottom: 8px; }
label.field input { width: 100%; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 15px 16px; font-size: 16px; color: var(--ink); min-height: 44px; }
label.field input:focus { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(110, 127, 99, .14); }
label.field .faint { display: block; margin-top: 6px; font-weight: 400; }
.seg { display: flex; background: var(--oat); border-radius: 100px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: none; background: transparent; border-radius: 100px; padding: 10px; font-weight: 700; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(44, 40, 35, .12); }

/* ---------- legacy compat (security card etc.) ---------- */
.page-head h1 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 24px; margin-bottom: 4px; }
.page-head p { color: var(--ink-soft); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill-btn { cursor: pointer; border: 1px solid var(--line); background: var(--paper); border-radius: 100px; padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--ink-mid); }
.pill-btn.on { background: var(--sage-select); border-color: var(--sage); }
.chip { display: inline-block; border-radius: 100px; padding: 5px 12px; font-size: 12px; font-weight: 700; background: var(--oat); color: var(--ink-soft); }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 20px; font-size: 14.5px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }
code { background: var(--oat); border-radius: 6px; padding: 2px 6px; font-size: .92em; }

/* Header "All …" links on Today: keep the small look, grow the hit area. */
.sec-head a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }

/* Short viewports (landscape phones / open keyboard): reclaim chat height. */
@media (max-height: 480px) {
  .scope-line { display: none; }
  .topbar { min-height: 46px; padding-top: 8px; padding-bottom: 6px; }
  .ctx-zone { display: none; }
}
