@layer base, layout, components, screens, responsive;
@layer base {
  :root { color-scheme: light; --paper:#fafbf8; --surface:#fff; --ink:#243837; --muted:#56655f; --line:#dfe6de; --green:#365e4f; --green-dark:#244737; --sage:#edf3e8; --blue:#eaf1f6; --peach:#faeade; --lilac:#efebf5; --cream:#f7f1e2; --radius:22px; --shadow:0 8px 30px #233e2a05; font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
  * { box-sizing:border-box; }
  html { scroll-padding-block:var(--feedback-space,24px) var(--nav-space,110px); }
  :where(button,a,input,textarea,select,summary) { scroll-margin-block:24px; }
  button,a,span { overflow-wrap:anywhere; }
  input:not([type=checkbox]),textarea,select { font-size:max(16px,1rem); }
  body { margin:0; background:var(--paper); color:var(--ink); -webkit-font-smoothing:antialiased; }
  [hidden] { display:none !important; }
  button,input,textarea,select { font:inherit; color:inherit; }
  button,a,input,textarea,select { -webkit-tap-highlight-color:transparent; }
  button { cursor:pointer; }
  button:disabled { cursor:default; opacity:.55; }
  a { color:inherit; text-decoration:none; }
  h1,h2,h3,p { margin:0; overflow-wrap:anywhere; }
  h1 { font-size:clamp(1.9rem,3.3vw,2.65rem); line-height:1.18; letter-spacing:-.045em; font-weight:600; margin:12px 0 14px; }
  h2 { font-size:1.18rem; line-height:1.4; letter-spacing:-.025em; font-weight:600; }
  h3 { font-size:1rem; font-weight:600; line-height:1.4; }
  p { color:var(--muted); }
  strong { font-weight:600; }
  svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
  .icon-sprite { position:absolute; width:0; height:0; overflow:hidden; }
  :focus-visible { outline:3px solid #5076a7; outline-offset:4px; }
  h1:focus, #main:focus { outline:none; }
  ::selection { background:#dbe8d4; }
  input:not([type=checkbox]),textarea,select { width:100%; min-height:48px; border:1px solid #82907c; background:#fff; border-radius:12px; padding:12px 14px; line-height:1.5; min-width:0; }
  select { appearance:none; padding-right:40px; background-image:linear-gradient(45deg,transparent 50%,#365e4f 50%),linear-gradient(135deg,#365e4f 50%,transparent 50%); background-position:calc(100% - 19px) 50%,calc(100% - 14px) 50%; background-size:5px 5px; background-repeat:no-repeat; }
  .marker-title { display:block; font-size:1rem; line-height:1.4; }
  .question-title { font-size:1rem; }
  input::placeholder,textarea::placeholder { color:#56684f; }
  textarea { resize:vertical; min-height:88px; }
  /* WebKit lightens empty date segments after resolving their color. */
  input[type=date] { min-height:49px; -webkit-text-fill-color:var(--ink); }
  input[type=date]::-webkit-datetime-edit-day-field:focus,
  input[type=date]::-webkit-datetime-edit-month-field:focus,
  input[type=date]::-webkit-datetime-edit-year-field:focus { background:var(--green); color:#fff; -webkit-text-fill-color:#fff; }
  label,legend { font-size:.9rem; font-weight:600; display:block; margin:0 0 8px; }
  fieldset { border:0; padding:0; margin:20px 0; min-width:0; }
  input[type=search]::-webkit-search-cancel-button { cursor:pointer; }
  button { border:0; background:none; }
}
@layer layout {
  .app-shell { min-height:100svh; }
  .sidebar { overflow-y:auto; position:fixed; inset:0 auto 0 0; width:238px; background:#f1f5ee; border-right:1px solid var(--line); padding:34px 22px 24px; display:flex; flex-direction:column; z-index:20; }
  .brand { display:flex; align-items:center; gap:10px; font-size:1.12rem; font-weight:650; letter-spacing:-.04em; min-height:44px; }
  .brand-mark { display:grid; grid-template-columns:repeat(2,9px); gap:3px; transform:rotate(-8deg); }
  .brand-mark i { width:9px; height:9px; border-radius:50%; background:#75987b; }
  .brand-mark i:nth-child(2) { background:#c9d7ba; }
  .brand-mark i:nth-child(3) { background:#e7bf9c; }
  .brand-mark i:nth-child(4) { background:#aec5d3; }
  .sidebar-note { font-size:.74rem; line-height:1.65; padding:10px 0 0; color:#56684f; }
  .privacy-note { display:flex; align-items:center; gap:10px; }
  .privacy-note svg { width:16px; height:16px; }
  .sidebar-bottom .button { margin:6px 0; font-size:.78rem; justify-content:flex-start; min-height:44px; padding:10px 14px; }
  .settings-link { min-height:44px; display:flex; gap:9px; align-items:center; padding:15px 3px 0; font-size:.77rem; color:#56684f; }
  .settings-link svg { width:17px; height:17px; }
  .primary-nav { display:flex; flex-direction:column; gap:7px; margin-top:55px; }
  .primary-nav a { display:flex; gap:12px; align-items:center; min-height:49px; border-radius:12px; padding:12px 14px; font-size:.9rem; color:#506457; }
  .primary-nav a[aria-current=page] { background:#e0ead9; color:#304d3b; font-weight:600; }
  .primary-nav a:hover { background:#e7eee1; }
  .sidebar-bottom { margin-top:auto; padding-top:35px; }
  .sidebar-bottom p { font-size:.75rem; line-height:1.6; margin:10px 0 15px; max-width:170px; }
  .sidebar-bottom > svg { color:#71816f; width:18px; }
  .sidebar-bottom .text-button,.sidebar-bottom .text-link { display:flex; font-size:.8rem; padding:8px 0; min-height:44px; }
  .content-wrap { margin-left:238px; padding:52px 54px 20px; }
  #main { max-width:1040px; margin:0 auto; min-height:calc(100svh - 150px); }
  .page-footer { max-width:1040px; margin:35px auto 0; color:#56684f; font-size:.75rem; display:flex; gap:8px; align-items:center; justify-content:center; padding:12px; }
  .page-footer svg { width:15px; height:15px; }
  .mobile-header,.mobile-nav { display:none; }
  .narrow { max-width:650px; margin:0 auto; }
  .page-heading { display:flex; justify-content:space-between; align-items:center; gap:22px; margin-bottom:32px; }
  .page-heading > div { min-width:0; }
  .page-heading > button { flex-shrink:0; }
  .page-heading p { max-width:590px; }
  .page-heading .eyebrow { margin-bottom:6px; }
  .two-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:26px; align-items:start; }
  .stack { display:flex; flex-direction:column; gap:16px; }
  .action-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
  .action-row.compact { gap:8px; }
  .action-row.centered { justify-content:center; }
  .section-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:28px 0 16px; }
  .section-heading:first-child { margin-top:0; }
  .section-heading h2 { flex:1; }
  .centered { text-align:center; justify-content:center; }
  .full { width:100%; }
  .skip-link { position:fixed; top:-80px; left:250px; background:white; padding:12px; z-index:100; }
  .skip-link:not(:focus) { width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .skip-link:focus { top:8px; }
}
@layer components {
  .eyebrow { font-size:.68rem; letter-spacing:.15em; font-weight:650; color:#56684f; display:block; }
  .muted { color:var(--muted); }
  .small-copy { font-size:.8rem; }
  .lead { font-size:1.05rem; max-width:580px; line-height:1.7; }
  .optional { font-size:.75rem; color:var(--muted); font-weight:400; margin-left:4px; }
  .card { border:1px solid var(--line); background:var(--surface); border-radius:var(--radius); padding:26px; box-shadow:var(--shadow); }
  .card.soft { background:#f0f4ec; border-color:#e5ebdf; }
  .card p + p { margin-top:10px; }
  .form-card { display:flex; flex-direction:column; align-items:stretch; gap:0; }
  .form-card > h2 { margin-bottom:12px; }
  .form-card > .icon-disc { margin-bottom:18px; }
  .form-card > label:not(:first-child) { margin-top:22px; }
  .form-card > p { margin:0 0 18px; }
  .form-card > textarea + p { margin-top:14px; }
  .form-actions,.dialog-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:26px; }
  .button { max-width:100%; min-width:0; white-space:normal; display:inline-flex; justify-content:center; align-items:center; gap:10px; min-height:48px; padding:12px 20px; border-radius:12px; font-weight:600; font-size:.875rem; line-height:1.45; text-align:center; border:1px solid transparent; transition:background .15s,border-color .15s; }
  .button svg { width:18px; height:18px; }
  .primary { background:var(--green); color:white; }
  .primary:hover:not(:disabled) { background:var(--green-dark); }
  .secondary { background:white; border-color:#cddacc; color:#385540; }
  .secondary:hover:not(:disabled) { background:#f0f5eb; border-color:#a6bba2; }
  .subtle { background:#f0f4ec; color:#466043; }
  .danger-outline { color:#91452e; border-color:#d9b9ae; background:#fff; }
  .danger-text { color:#945440 !important; }
  .text-button,.text-link { min-width:44px; max-width:100%; display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:8px 2px; font-size:.82rem; font-weight:550; color:#496749; }
  .text-button:hover,.text-link:hover { text-decoration:underline; text-underline-offset:4px; }
  .text-button svg,.text-link svg { width:17px; height:17px; }
  .icon-button { width:44px; height:44px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; color:#607460; }
  .icon-button:hover { background:#e9efe4; }
  .icon-disc { display:inline-flex; width:48px; height:48px; align-items:center; justify-content:center; border-radius:50%; color:#60745e; flex-shrink:0; }
  .icon-disc.large { width:78px; height:78px; }
  .icon-disc.large svg { width:34px; height:34px; }
  .icon-disc.sage { background:#eaf1e2; }
  .icon-disc.blue { background:var(--blue); color:#5c7a8c; }
  .icon-disc.peach { background:var(--peach); color:#a4754f; }
  .icon-disc.lilac { background:var(--lilac); color:#7c7095; }
  .icon-disc.cream { background:var(--cream); color:#9a874f; }
  .icon-disc.white { background:#ffffffbd; }
  .badge { display:inline-flex; align-items:center; gap:6px; padding:5px 11px; background:#eef3e9; border-radius:99px; font-size:.74rem; color:#516648; white-space:nowrap; }
  .badge svg { width:15px; height:15px; }
  .emotion-badge { font-weight:550; font-size:.85rem; gap:8px; padding:7px 13px; }
  .badge-group { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 18px; min-width:0; }
  .card-bottom .badge-group { margin:0; }
  .emotion-badge { max-width:100%; white-space:normal; }
  .emotion-label { min-width:0; overflow-wrap:anywhere; }
  .emotion-badge svg { flex-shrink:0; }
  .tone-cloud { background:var(--blue); color:#4e6a7f; }
  .tone-flame { background:var(--peach); color:#915a38; }
  .tone-heart { background:#f5e9e9; color:#825252; }
  .tone-spark,.tone-sun { background:var(--cream); color:#756036; }
  .tone-question { background:var(--lilac); color:#766386; }
  .count-badge { background:#edf2e8; border-radius:50%; width:26px; height:26px; display:inline-flex; justify-content:center; align-items:center; font-size:.76rem; }
  .banner { border-radius:12px; padding:14px 17px; margin:16px 0; font-size:.86rem; }
  .banner.error { background:#fbf0e9; border:1px solid #e9c6b5; color:#814a34; }
  #global-message { position:sticky; top:12px; z-index:40; max-width:1040px; margin:0 auto 20px; box-shadow:0 4px 18px #233e2a20; }
  .toast { position:fixed; bottom:28px; left:calc(50% + 119px); transform:translateX(-50%); background:#2c4939; color:white; padding:13px 22px; border-radius:12px; font-size:.875rem; z-index:100; box-shadow:0 8px 24px #18362224; max-width:calc(100vw - 40px); }
  .modal { max-width:520px; width:calc(100% - 32px); border:1px solid var(--line); border-radius:24px; padding:28px; color:var(--ink); box-shadow:0 25px 80px #233e2a33; max-height:calc(100dvh - 32px); overflow:auto; }
  .modal::backdrop { background:#20352b55; backdrop-filter:blur(3px); }
  .modal p { margin-top:12px; white-space:pre-wrap; }
  .modal .dialog-actions { flex-wrap:wrap; }
  .modal .section-heading { margin:0 0 20px; }
  .modal label { margin-top:18px; }
  .search-field { display:flex; gap:10px; align-items:center; border:1px solid var(--line); background:white; border-radius:13px; padding:0 14px; font-weight:400; margin:0; }
  .search-field input[type=search] { border:0; padding:13px 0; background:transparent; outline-offset:0; }
  .search-field svg { color:#789078; width:19px; }
  .segmented { display:flex; flex-wrap:wrap; gap:4px; background:#edf2e9; border-radius:11px; padding:4px; }
  .segmented button { font-size:.78rem; padding:9px 12px; border-radius:8px; min-height:44px; flex:1; white-space:nowrap; }
  .segmented button[aria-pressed=true] { color:#344d37; background:white; box-shadow:0 2px 5px #253c2510; font-weight:600; }
  .segmented.small { width:min(100%,180px); margin:0 auto 12px; }
  .chip-grid { display:flex; flex-wrap:wrap; gap:9px; }
  .chip { border:1px solid var(--line); border-radius:99px; min-height:44px; padding:8px 15px; font-size:.8rem; display:inline-flex; align-items:center; gap:7px; background:white; }
  .chip svg { width:15px; height:15px; }
  .chip[aria-pressed=true] { background:#e9f0e1; border-color:#6e9062; color:#355536; }
  .chip:hover { border-color:#8ea285; }
  .empty-state { padding:30px 24px; border:1px dashed #cdd9c7; border-radius:18px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:9px; background:#ffffff55; }
  .empty-state .icon-disc { margin-bottom:6px; }
  .empty-state h2 { font-size:1rem; }
  .empty-state p { font-size:.85rem; max-width:400px; }
  .empty-state .button { margin-top:10px; }
  .pre-line { white-space:pre-wrap; overflow-wrap:anywhere; }
  .detail-label { font-size:.7rem; color:#56684f; text-transform:uppercase; letter-spacing:.08em; margin-bottom:7px; display:block; }
  .detail-section + .detail-section { border-top:1px solid var(--line); margin-top:20px; padding-top:20px; }
  .detail-section p { color:#44564a; }
  .detail-section .muted { color:var(--muted); }
  .notice-row { display:flex; gap:15px; align-items:center; padding:12px 0; }
  .privacy-inline,.gentle-note { display:flex; gap:8px; align-items:center; font-size:.8rem; color:#56684f; margin:20px 0; }
  .privacy-inline svg,.gentle-note svg { width:16px; height:16px; }
  .gentle-note { flex-wrap:wrap; justify-content:center; }
}
@layer screens {
  .today-grid { display:grid; grid-template-columns:1.1fr 1fr; gap:22px; }
  .capture-callout { background:#eaf0e3; border-color:#dce6d3; position:relative; overflow:hidden; padding:30px; }
  .capture-callout > :not(.landscape) { position:relative; z-index:1; }
  .capture-callout h2 { font-size:1.65rem; margin:20px 0 12px; letter-spacing:-.04em; line-height:1.2; }
  .capture-callout p { font-size:.88rem; color:#40534d; }
  .capture-callout .button { margin-top:26px; }
  .landscape { position:absolute; right:-60px; bottom:-130px; width:300px; height:310px; background:#dbe5d1; border-radius:52% 62% 0 0; transform:rotate(-24deg); }
  .landscape::before { content:""; position:absolute; inset:40px -25px -20px 110px; background:#ccdcbf; border-radius:50%; }
  .guide-callout { padding:30px; display:flex; flex-direction:column; align-items:flex-start; }
  .guide-callout .eyebrow { margin:22px 0 12px; }
  .guide-callout h2 { font-size:1.35rem; margin-bottom:12px; }
  .guide-callout p { font-size:.88rem; margin-bottom:28px; }
  .guide-callout .button { margin-top:auto; }
  .memory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
  .memory-grid .empty-state { grid-column:1/-1; }
  .memory-card { display:flex; flex-direction:column; text-align:left; min-height:170px; padding:22px; transition:border .15s,background .15s; min-width:0; }
  .memory-card:hover,.entry-card:hover { border-color:#a2b597; background:#fdfffa; }
  .memory-card .card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
  .memory-card .card-top > svg { color:#809478; }
  .memory-card .card-top span { font-size:.68rem; color:var(--muted); }
  .memory-card h2,.memory-card h3 { font-size:1rem; margin-bottom:6px; overflow-wrap:anywhere; }
  .memory-card p { font-size:.78rem; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  .memory-card .card-bottom { display:flex; gap:6px; align-items:center; flex-wrap:wrap; padding-top:17px; margin-top:auto; }
  .entry-card { display:flex; align-items:center; gap:14px; border:1px solid var(--line); border-radius:16px; background:white; padding:18px 20px; min-width:0; }
  .entry-card > div { flex:1; min-width:0; }
  .entry-card h3 { overflow-wrap:anywhere; }
  .entry-card p { font-size:.75rem; margin-top:5px; }
  .entry-card > svg:last-child { color:#84917e; width:18px; }
  .companion-callout { width:100%; margin-top:28px; display:flex; align-items:center; gap:18px; text-align:left; }
  .companion-callout > span:nth-child(2) { display:flex; flex:1; flex-direction:column; gap:4px; }
  .companion-callout strong { font-size:1rem; }
  .companion-callout .muted { font-size:.82rem; }
  .companion-callout:hover { border-color:#b6c4aa; }
  .local-note { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:25px; font-size:.74rem; }
  .local-note > svg { width:15px; }
  .local-note p { flex:1; }
  .local-note .text-button { font-size:.74rem; }
  .drafts:not(:empty) { display:grid; gap:12px; margin-top:24px; }
  .draft-card { display:flex; gap:14px; align-items:center; padding:18px 22px; background:#f8f3e8; border:1px solid #e7dfcc; border-radius:16px; }
  .draft-card > div { flex:1; }
  .draft-card p { font-size:.77rem; margin-top:3px; }
  .welcome { max-width:720px; margin:24px auto; }
  .welcome h1 { font-size:3rem; }
  .welcome-steps { margin:34px 0 20px; display:flex; flex-direction:column; gap:14px; }
  .welcome-steps .card { display:flex; gap:22px; align-items:center; padding:22px 25px; }
  .welcome-steps .card > div { flex:1; }
  .welcome-steps p { font-size:.84rem; margin-top:6px; }
  .step-number { font-size:.8rem; color:#56684f; }
  .welcome > .text-button { margin-top:18px; }
  .writing-prompts { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
  .writing-prompts .chip { min-height:44px; font-size:.7rem; padding:5px 12px; }
  .collection-controls { display:flex; align-items:center; gap:18px; margin-bottom:20px; }
  .collection-controls .search-field { flex:1; }
  .result-count { font-size:.75rem; margin:14px 0; }
  .memory-context h2 { margin-bottom:12px; }
  .flow-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:24px; min-height:44px; }
  .exercise { max-width:870px; margin:0 auto; }
  .step-track { display:flex; list-style:none; padding:0; margin:0 0 30px; gap:6px; }
  .step-track li { flex:1; padding-top:9px; border-top:3px solid #e0e7db; color:#56684f; font-size:.7rem; }
  .step-track li.active { border-color:#496c41; color:#3d5e36; font-weight:650; }
  .step-track li.complete { border-color:#a9bd9c; }
  .journey-rail { list-style:none; padding:20px 6px; margin:0; }
  .journey-rail li { display:flex; gap:12px; align-items:center; font-size:.8rem; color:#56684f; padding:12px 0; }
  .journey-rail li span { width:24px; height:24px; border-radius:50%; border:1px solid #cdd9c4; display:grid; place-items:center; font-size:.7rem; }
  .journey-rail li.active { color:#375535; font-weight:600; }
  .journey-rail li.active span { background:#45633e; border-color:#45633e; color:white; }
  .journey-rail li.complete span { background:#dce8d2; }
  .context-tag { border-radius:10px; display:inline-flex; gap:8px; align-items:center; background:#eef2e8; padding:8px 12px; margin:0 0 22px; color:#56684f; font-size:.76rem; }
  .context-tag svg { width:16px; }
  .context-tag { max-width:100%; overflow-wrap:anywhere; }
  .flow-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid var(--line); margin-top:32px; padding-top:24px; }
  .flow-footer > .primary { min-width:200px; }
  .selection-list { display:flex; flex-direction:column; gap:9px; margin:16px 0; max-height:300px; overflow:auto; padding:4px; }
  .choice-card { border:1px solid var(--line); border-radius:15px; padding:17px 20px; display:flex; align-items:center; gap:15px; background:white; text-align:left; width:100%; }
  .choice-card > span:has(strong) { flex:1; }
  .choice-card strong,.choice-card small { display:block; }
  .choice-card strong { font-size:.9rem; }
  .choice-card small { font-size:.75rem; color:var(--muted); margin-top:4px; }
  .choice-card[aria-pressed=true] { background:#f0f5e9; border-color:#8aa27a; }
  .choice-card:hover { border-color:#9aad8c; }
  .radio-mark { display:inline-block; width:18px; height:18px; border:1px solid #b7c3af; border-radius:50%; flex-shrink:0; }
  [aria-pressed=true] .radio-mark { border:5px solid #58774b; background:white; }
  .choice-card.compact { padding:13px 15px; font-size:.8rem; gap:11px; }
  .memory-options { display:grid; gap:12px; }
  .breathing-scene { height:292px; display:grid; place-items:center; margin:10px 0 16px; }
  .breathing-ring { width:208px; height:208px; border-radius:50%; background:#e7efdf; border:1px solid #c8d9bc; box-shadow:0 0 0 20px #edf3e7,0 0 0 39px #f3f6ee; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:14px; color:#516f46; transition:transform 4s linear; }
  .breathing-ring[data-phase=in] { transform:scale(1.12); }
  .breathing-ring[data-phase=out] { transform:scale(.92); }
  .breathing-ring[data-paused=true] { transition:none; transform:scale(1); }
  .breathing-ring span { font-size:.96rem; text-align:center; max-width:160px; }
  .breathing-ring svg { width:28px; height:28px; }
  .breath-status { text-align:center; margin-bottom:22px; }
  .breath-status strong { font-size:.85rem; }
  .breath-dots { display:flex; gap:8px; justify-content:center; margin:14px 0; }
  .breath-dots i { width:8px; height:8px; border-radius:50%; background:#d9e2d1; }
  .breath-dots i.done { background:#567449; }
  .breathing-alternative { display:flex; margin:14px auto; }
  .emotion-picker h2 { font-size:.9rem; margin-bottom:5px; }
  .emotion-picker .picker-help { font-size:.75rem; margin-bottom:18px; }
  .emotion-options { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
  .emotion-choice { display:flex; flex-direction:column; gap:12px; align-items:center; justify-content:center; min-height:137px; border:1px solid var(--line); border-radius:18px; background:white; padding:18px 8px; font-size:.8rem; }
  .emotion-choice:hover { border-color:#97ac88; }
  .emotion-choice[aria-pressed=true] { border-color:#6f8f5f; background:#f0f5e9; box-shadow:inset 0 0 0 1px #6f8f5f; }
  .emotion-choice .icon-disc { width:43px; height:43px; }
  .selected-emotions { margin-bottom:24px; padding:18px 20px; }
  .selected-emotion-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
  .selected-emotion { min-height:44px; max-width:100%; display:flex; gap:12px; align-items:center; background:var(--sage); }
  .selected-emotion span,.emotion-choice span { min-width:0; overflow-wrap:anywhere; }
  .selected-emotion svg { flex-shrink:0; }
  .custom-emotion-action { margin-bottom:16px; }
  .emotion-definitions { margin:0; }
  .emotion-definitions dt { font-weight:600; margin-top:12px; }
  .emotion-definitions dd { margin:4px 0 12px; color:var(--muted); font-size:.85rem; }
  .starter-heading { margin:16px 0 0; }
  .strength-options { display:flex; flex-wrap:wrap; gap:8px; }
  .strength-options .strength-option { display:flex; flex:1 1 125px; align-items:center; gap:9px; min-height:48px; margin:0; padding:12px; border:1px solid var(--line); border-radius:12px; cursor:pointer; font-size:.85rem; }
  .strength-option:has(input:checked) { border-color:var(--green); background:var(--sage); }
  .strength-option input[type=radio] { width:18px; height:18px; min-height:18px; min-width:18px; margin:0; padding:0; flex-shrink:0; accent-color:var(--green); }
  .required { font-size:.75rem; color:var(--green); font-weight:500; }
  .observation-preview { padding-left:25px; margin:18px 0 0; }
  .observation-preview li { padding:12px 0 12px 8px; }
  .observation-preview li+li { border-top:1px solid var(--line); }
  .observation-example { border-radius:16px; background:var(--lilac); padding:16px 20px; margin:20px 0; }
  .emotion-options { margin-bottom:18px; }
  .companion-page [data-slot=content] > .card { margin-block:20px; }
  .emotion-picker details { background:white; border:1px solid var(--line); border-radius:15px; padding:16px 20px; margin-bottom:16px; }
  .emotion-picker summary { min-height:44px; font-size:.85rem; font-weight:550; cursor:pointer; padding:4px 0; }
  .emotion-picker details[open] summary { margin-bottom:18px; }
  .catalog-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:16px; max-height:310px; overflow:auto; padding:3px; }
  .catalog-list button { min-height:48px; font-size:.84rem; border:1px solid var(--line); border-radius:11px; text-align:left; padding:10px 14px; }
  .catalog-list button[aria-pressed=true] { border-color:#799669; background:#edf4e6; }
  .body-workspace { display:grid; grid-template-columns:minmax(260px,.9fr) 1fr; gap:28px; align-items:start; }
  .body-card { text-align:center; padding:20px; }
  .body-wrap { position:relative; width:min(100%,240px); margin:0 auto; aspect-ratio:1 / 2; }
  .body-illustration { display:block; width:100%; height:100%; stroke:#65785d; stroke-width:1.5; fill:#e3ebdd; }
  .body-illustration [data-body-hit] { cursor:crosshair; }
  .body-detail { stroke:#65785d; fill:none; pointer-events:none; }
  .body-marker { position:absolute; transform:translate(-50%,-50%); width:35px; height:35px; border:1px solid #789860; border-radius:50%; background:#d9e7bfd9; box-shadow:0 0 0 7px #dce6b680; display:grid; place-items:center; font-size:.8rem; color:#354d30; font-weight:650; }
  button.body-marker { width:44px; height:44px; }
  button.body-marker:hover { background:#c7da9e; }
  .body-help { font-size:.75rem; margin:10px 0 16px; }
  .body-workspace .section-heading { margin-top:0; }
  .marker-card { display:flex; align-items:flex-start; gap:12px; border:1px solid var(--line); border-radius:14px; background:white; padding:17px; text-align:left; width:100%; }
  .marker-card > div { flex:1; min-width:0; }
  .marker-card .number { display:grid; place-items:center; width:26px; height:26px; background:#e6eedc; border-radius:50%; font-size:.75rem; flex-shrink:0; }
  .marker-card p { font-size:.8rem; margin-top:4px; overflow-wrap:anywhere; }
  .marker-card small { display:block; font-size:.75rem; color:#56684f; margin-top:5px; }
  .marker-card > svg { width:16px; color:#839277; }
  .body-alternatives { display:flex; flex-direction:column; gap:10px; margin:22px 0 12px; }
  .review-layout { display:grid; grid-template-columns:1.1fr 1fr; gap:24px; align-items:start; }
  .review-card .section-heading { margin:0 0 15px; }
  .review-card .text-button { padding:0; min-height:44px; font-size:.75rem; }
  .review-card .detail-section p { font-size:.86rem; }
  .review-card .emotion-badge { margin:6px 0 16px; }
  .review-card .stack { gap:10px; }
  .review-card .marker-card { padding:12px; }
  .saved-page { text-align:center; padding-top:30px; }
  .success-icon { width:76px; height:76px; border-radius:50%; background:#e6efdc; display:flex; align-items:center; justify-content:center; margin:0 auto 24px; color:#617e4f; }
  .success-icon svg { width:35px; height:35px; }
  .saved-page .lead { margin:0 auto 30px; }
  .saved-page .card { text-align:left; }
  .saved-page .saved-progress { margin:22px 0; color:#56684f; font-size:.85rem; }
  .stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
  .stat { padding:24px; border:1px solid var(--line); border-radius:18px; background:white; }
  .stat strong { display:block; font-size:2rem; font-weight:500; letter-spacing:-.04em; }
  .stat span { font-size:.8rem; color:var(--muted); }
  .reflection-dots { display:flex; flex-wrap:wrap; gap:4px; margin-top:12px; }
  .reflection-dot { width:44px; height:44px; display:grid; place-items:center; border-radius:50%; }
  .reflection-dot i { width:9px; height:9px; background:#75986a; border-radius:50%; }
  .reflection-dot:nth-child(3n) i { background:#b4c99d; }
  .reflection-dot:hover { background:#e6efdd; }
  .identity-content { margin:30px 0 35px; }
  .milestone { display:flex; align-items:center; gap:14px; border-radius:16px; padding:18px; background:#eef3e7; border:1px solid #e0e9d6; }
  .milestone p { font-size:.75rem; margin-top:4px; }
  .milestone.locked { background:#f5f6f2; }
  .pattern-card { display:grid; gap:20px; }
  .pattern-item { display:flex; align-items:center; gap:16px; }
  .pattern-item .pattern-label { flex:1; font-size:.88rem; }
  .pattern-item .bar { width:35%; height:8px; background:#edf2e8; border-radius:99px; overflow:hidden; }
  .pattern-item .bar i { display:block; height:100%; background:#adc49a; border-radius:99px; }
  .pattern-item small { font-size:.75rem; color:var(--muted); width:100px; text-align:right; }
  .compare-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
  .compare-column { display:flex; flex-direction:column; gap:15px; }
  .compare-column .body-wrap { max-width:180px; }
  .reflection-prompt { display:flex; gap:18px; align-items:flex-start; margin:26px 0; }
  .reflection-prompt h2 { margin-bottom:8px; }
  .reflection-prompt p { font-size:.86rem; }
  .perspective-card .section-heading { margin:0 0 14px; flex-wrap:wrap; }
  .perspective-card .section-heading .emotion-badge { flex-shrink:0; }
  .perspective-card .answer { margin-top:17px; }
  .perspective-card .answer p { color:#455b4a; font-size:.86rem; }
  .perspective-card .answer small { font-size:.75rem; display:block; color:var(--muted); margin-bottom:5px; }
  .perspective-card .answer + .detail-section { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
  .invitation-question { font-size:clamp(2rem,4vw,3rem); margin:24px 0 30px; }
  .companion-page > [data-slot=content] > .full { margin-top:22px; }
  .companion-page > [data-slot=content] > .text-button { display:flex; margin:12px auto; }
  .companion-page .stack { margin-top:20px; }
  .companion-page label { margin-top:25px; }
  .question-card { font-size:1.25rem; line-height:1.5; margin-bottom:20px; background:#f0edf6; border-color:#e4deed; }
  .role-label { font-size:.8rem; color:#786f89; }
  .handback { text-align:center; padding-top:38px; }
  .handback .large { margin:0 auto 28px; }
  .role-divider { display:flex; gap:12px; align-items:center; font-size:.72rem; color:#56684f; margin:35px 0 24px; }
  .role-divider::before,.role-divider::after { content:""; flex:1; height:1px; background:var(--line); }
  .partner-rail { padding:26px 12px; color:#665d77; font-size:.82rem; }
  .partner-rail p { margin-top:12px; font-size:.75rem; }
  body.partner-mode .primary-nav,body.partner-mode .sidebar-bottom,body.partner-mode .mobile-nav,body.partner-mode .mobile-settings,body.partner-mode .page-footer { display:none; }
  body.partner-mode .brand { pointer-events:none; }
  body.partner-mode .sidebar { background:#f3f1f6; }
  .toggle-row { display:flex; align-items:center; gap:18px; padding:16px 0; margin:0 !important; cursor:pointer; }
  .toggle-row + .toggle-row { border-top:1px solid var(--line); }
  .toggle-row span { flex:1; }
  .toggle-row strong { display:block; font-size:.86rem; }
  .toggle-row small { display:block; font-size:.76rem; font-weight:400; color:var(--muted); margin-top:5px; }
  input[role=switch] { appearance:none; width:44px; height:44px; background:transparent; border:0; flex-shrink:0; cursor:pointer; position:relative; }
  input[role=switch]::before { content:""; position:absolute; left:0; top:9px; width:42px; height:25px; background:#707f68; border-radius:99px; }
  input[role=switch]::after { content:""; position:absolute; left:3px; top:12px; width:19px; height:19px; border-radius:50%; background:white; transition:left .15s; }
  input[role=switch]:checked::before { background:#5c7a4d; }
  input[role=switch]:checked::after { left:20px; }
  .danger-card { background:#fdfbf7; border-color:#e8e0d7; }
  input[type=file] { font-size:1rem; padding:12px; }
  input[type=file]::file-selector-button { background:#edf3e7; border:0; border-radius:7px; padding:7px 10px; color:#4d6844; margin-right:10px; cursor:pointer; }
  .recovery-actions { margin-top:24px; }
  .import-summary { margin:18px 0; padding:0; list-style:none; }
  .import-summary li { display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--line); font-size:.8rem; }
  .import-choice { margin:20px 0 12px; }
  .import-warning { font-size:.8rem; margin:12px 0 !important; }
  .page-enter { animation:appear .18s ease-out; }
  @keyframes appear { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
}
@layer responsive {
  @media (min-width:1550px) { .content-wrap { padding-top:68px; } }
  @media (max-width:1150px) { .sidebar { width:212px; padding-inline:18px; } .content-wrap { margin-left:212px; padding:36px 32px 20px; } .brand { font-size:1.05rem; } .memory-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .memory-grid:not(.collection) .memory-card:last-child:nth-child(3) { display:none; } .collection-controls { align-items:stretch; flex-direction:column; } .local-note p { flex-basis:80%; } .toast { left:calc(50% + 106px); } }
  @media (max-width:850px) { .sidebar { width:190px; padding-inline:14px; } .brand { gap:8px; font-size:.97rem; } .primary-nav a { padding-inline:10px; font-size:.81rem; } .content-wrap { margin-left:190px; padding:30px 24px 20px; } .today-grid,.review-layout,.two-columns { grid-template-columns:1fr; } .guide-callout { padding:24px; } .guide-callout .icon-disc { display:none; } .guide-callout .eyebrow { margin-top:0; } .body-workspace { gap:20px; grid-template-columns:minmax(190px,.8fr) 1fr; } .emotion-options { gap:8px; } .emotion-choice { font-size:.71rem; min-height:120px; } .page-heading { flex-wrap:wrap; gap:16px; } .page-heading > button { min-height:44px; } .toast { left:calc(50% + 95px); } .pattern-item { flex-wrap:wrap; gap:8px; } }
  @media (max-width:650px) {
    :root { font-size:16px; }
    .sidebar { display:none; }
    .content-wrap { margin-left:0; padding:21px max(20px,env(safe-area-inset-right)) var(--nav-space,110px) max(20px,env(safe-area-inset-left)); }
    .mobile-header { display:flex; justify-content:space-between; align-items:center; padding:max(14px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) 14px max(20px,env(safe-area-inset-left)); min-height:72px; border-bottom:1px solid var(--line); background:#f3f6ee; }
    .mobile-header { margin:-21px -20px 24px; }
    .mobile-header > .icon-button { flex-shrink:0; }
    .mobile-header .brand { min-width:0; font-size:1.15rem; }
    .mobile-nav { display:flex; position:fixed; bottom:0; left:0; right:0; z-index:30; background:#fafcf7f5; backdrop-filter:blur(15px); border-top:1px solid #dee6d7; justify-content:space-around; padding:8px 8px max(8px,env(safe-area-inset-bottom)); }
    .mobile-nav a { min-height:48px; font-size:.75rem; display:flex; flex:1 0 auto; flex-direction:column; align-items:center; gap:5px; padding:4px; color:#56684f; }
    .mobile-nav a span { white-space:nowrap; }
    .mobile-nav a[aria-current=page] { color:#385c31; font-weight:600; }
    .mobile-nav svg { width:22px; height:22px; }
    .desktop-only { display:none; }
    .page-heading { margin-bottom:25px; }
    h1 { font-size:2rem; letter-spacing:-.045em; }
    .page-heading p { font-size:.9rem; }
    .eyebrow { font-size:.75rem; }
    .card { border-radius:19px; padding:22px; }
    .capture-callout { padding:25px; }
    .capture-callout h2 { font-size:1.7rem; }
    .today-grid { gap:16px; }
    .guide-callout .button,.capture-callout .button { width:100%; }
    .guide-callout p { margin-bottom:20px; }
    .memory-grid { gap:12px; }
    .memory-card { padding:16px; min-height:185px; }
    .memory-card h2,.memory-card h3 { font-size:.9rem; }
    .memory-card .card-top { margin-bottom:14px; gap:5px; }
    .memory-card .card-top span { font-size:.75rem; }
    .companion-callout { gap:12px; padding:20px 16px; }
    .companion-callout .icon-disc { width:40px; height:40px; }
    .companion-callout > svg { width:17px; }
    .local-note { gap:6px 10px; }
    .local-note .text-button { padding-left:24px; }
    .draft-card { padding:15px; flex-wrap:wrap; gap:10px; }
    .draft-card > .icon-disc { width:34px; height:34px; }
    .draft-card .button { min-height:44px; padding:8px 12px; }
    .welcome { margin-top:18px; }
    .welcome h1 { font-size:2.4rem; }
    .welcome-steps .card { padding:20px 17px; gap:15px; }
    .welcome-steps .icon-disc { width:40px; height:40px; }
    .welcome-steps h2 { font-size:1rem; }
    .welcome .action-row { flex-direction:column; align-items:stretch; }
    .welcome .step-number { display:none; }
    .flow-toolbar { margin-bottom:18px; flex-wrap:wrap; }
    .flow-toolbar .eyebrow { font-size:.75rem; }
    .flow-toolbar .action-row .text-button { font-size:.75rem; }
    .step-track { gap:8px; margin-bottom:26px; flex-wrap:wrap; }
    .step-track li { flex:1 1 25%; }
    .step-track li { font-size:.75rem; }
    .choice-card { padding:16px 13px; gap:12px; }
    .choice-card .icon-disc { width:37px; height:37px; }
    .choice-card strong { font-size:.84rem; }
    .selection-list { padding:4px 1px; }
    .flow-footer { flex-direction:column; align-items:stretch; gap:10px; padding-top:20px; }
    .flow-footer .primary { width:100%; }
    .breathing-scene { height:275px; }
    .breathing-ring { width:186px; height:186px; }
    .emotion-options { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
    .emotion-choice { min-height:112px; padding:15px 6px; gap:10px; font-size:.82rem; }
    .emotion-choice .icon-disc { width:37px; height:37px; }
    .selected-emotions { padding:15px; }
    .emotion-picker details { padding:14px 16px; }
    .body-workspace { grid-template-columns:1fr; }
    .body-wrap { max-width:210px; }
    .body-card { padding:18px; }
    .body-card .body-wrap { max-height:380px; width:min(100%,190px); }
    .body-workspace .section-heading { margin:5px 0 14px; }
    .body-workspace .body-card { width:100%; }
    .review-layout { gap:17px; }
    .stats-grid { gap:10px; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .stats-grid .stat:first-child { grid-column:1 / -1; }
    .stat { padding:17px 12px; }
    .stat strong { font-size:1.7rem; }
    .stat span { font-size:.69rem; }
    .identity-content { margin:26px 0; gap:26px; }
    .entry-card { padding:16px; }
    .entry-card .icon-disc { width:37px; height:37px; }
    .compare-grid { gap:24px; grid-template-columns:1fr; }
    .compare-column .card { padding:15px 12px; }
    .compare-column .body-wrap { max-width:180px; }
    .compare-column .marker-card { padding:12px; gap:8px; }
    .compare-column .marker-card .number { display:none; }
    .compare-column select { font-size:1rem; padding:10px 40px 10px 12px; }
    .compare-column .emotion-badge { font-size:.75rem; padding:7px 10px; }
    .compare-column .body-marker { width:25px; height:25px; box-shadow:0 0 0 4px #dce6b680; }
    .pattern-item .pattern-label { flex-basis:50%; }
    .pattern-item .bar { width:23%; }
    .pattern-item small { width:auto; }
    .saved-page { padding-top:18px; }
    .toast { left:50%; bottom:86px; width:max-content; text-align:center; }
    body.partner-mode .toast { bottom:25px; }
    body.partner-mode .content-wrap { padding-bottom:40px; }
    body.partner-mode .mobile-header { justify-content:center; background:#f3f1f6; }
    .invitation-question { font-size:2.25rem; }
    .skip-link { left:20px; }
    .form-actions { align-items:stretch; flex-direction:column; }
    .modal { padding:22px; }
    .page-footer { font-size:.7rem; margin-top:26px; }
    .exercise[data-step=breathe] .flow-toolbar { margin-bottom:8px; }
    .exercise[data-step=breathe] .step-track { margin-bottom:12px; }
    .exercise[data-step=breathe] .step-track li { flex:1; font-size:.68rem; }
    .exercise[data-step=breathe] .context-tag { margin-bottom:6px; }
    .exercise[data-step=breathe] .page-heading { margin-bottom:8px; }
    .exercise[data-step=breathe] h1 { font-size:1.6rem; margin:8px 0; }
    .exercise[data-step=breathe] .breathing-scene { height:190px; margin:8px 0; }
    .exercise[data-step=breathe] .breathing-ring { width:136px; height:136px; box-shadow:0 0 0 14px #edf3e7,0 0 0 25px #f3f6ee; }
    .exercise[data-step=breathe] .breathing-ring span { font-size:.85rem; }
    .exercise[data-step=breathe] .breath-status { margin-bottom:12px; }
    .exercise[data-step=breathe] .breath-dots { margin:8px 0; }
    .exercise[data-step=breathe] .breathing-alternative { margin:6px auto; }
    .exercise[data-step=breathe] .flow-footer { margin-top:12px; padding-top:12px; }
  }
  /* Leave the breathing action visible above phone navigation on shorter screens. */
  @media (max-width:650px) and (max-height:740px) {
    .exercise[data-step=breathe] .breathing-scene { height:156px; }
    .exercise[data-step=breathe] .breathing-ring { width:112px; height:112px; box-shadow:0 0 0 12px #edf3e7,0 0 0 20px #f3f6ee; }
    .exercise[data-step=breathe] .flow-footer { margin-top:4px; padding-top:4px; }
  }
  /* Keep narrow screens and enlarged text readable without horizontal scrolling. */
  @media (max-width:380px) {
    .memory-grid,.stats-grid { grid-template-columns:1fr; }
    .emotion-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .card { padding:18px; }
    .section-heading { flex-wrap:wrap; }
    .breathing-ring { width:160px; height:160px; }
    .breathing-scene { height:240px; }
  }
  @media (max-height:500px) and (min-width:651px) {
    .sidebar { padding-top:14px; }
    .primary-nav { margin-top:16px; }
  }
  @media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
  body.reduced-motion *,body.reduced-motion *::before,body.reduced-motion *::after { animation:none !important; transition:none !important; }
}

/* The locale choice is separate from the preferences/intro content below it. */
.locale-card{margin-bottom:24px}
