/* SteadySelf (steadyself.app)
   Palette taken from the stacked-stones logo: slate stone (accent), sage stone (soft fills), apricot stone (highlights).
   Layout: public site = centred 1120px column with a split hero; app = fixed sidebar on desktop, top bar + bottom tab bar on phones, 720px reading column. */
:root {
  --bg: #f6f7f5;
  --bg-tint: #e6efeb;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --ink: #1d3540;
  --muted: #586c73;
  --line: #d9e1de;
  --accent: #2f5a67;
  --accent-strong: #223f49;
  --on-accent: #ffffff;
  --accent-soft: #dfebe6;
  --sage: #7fa596;
  --glow: #fbb478;
  --glow-soft: #fdeedd;
  --help: #b5432a;
  --on-help: #ffffff;
  --help-soft: #f9e5de;
  --chart-line: #2f5a67;
  --chart-fill: rgba(127,165,150,.2);
  --scrim: rgba(12,24,29,.55);
  --shadow-sm: 0 1px 2px rgba(29,53,64,.06);
  --shadow: 0 1px 2px rgba(29,53,64,.05), 0 8px 24px rgba(29,53,64,.07);
  --shadow-lg: 0 2px 4px rgba(29,53,64,.06), 0 24px 60px rgba(29,53,64,.14);
  --f-display: "Lexend", "Atkinson Hyperlegible", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px;
  --r-sm: 10px;
  --tabbar-h: 64px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10181c; --bg-tint: #15221f; --surface: #172227; --surface-2: #1f2d33; --ink: #e5eded; --muted: #9cafb2;
    --line: #2b3b41; --accent: #94c3b4; --accent-strong: #bbdccf; --on-accent: #0f211d; --accent-soft: #1d3633;
    --sage: #94c3b4; --glow: #f6b07a; --glow-soft: #3b2c1f; --help: #f2907a; --on-help: #200d08; --help-soft: #3a2420;
    --chart-line: #94c3b4; --chart-fill: rgba(148,195,180,.14); --scrim: rgba(0,0,0,.6);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); --shadow-lg: 0 24px 60px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.7rem); }
h3, .h3 { font-size: 1.2rem; font-family: var(--f-display); font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.icon { width: 22px; height: 22px; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 8px; }
.wrap-text { overflow-wrap: anywhere; min-width: 0; }
.eyebrow { font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.logo-mark { display: block; flex: none; }
.logo-word { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.logo-word span { font-weight: 400; color: var(--sage); letter-spacing: -.01em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background-color .15s, transform .15s; }
.btn:hover { background: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--help); color: var(--on-help); }
.btn.sm { padding: 7px 16px; font-size: .92rem; }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; }
.btn .icon { width: 18px; height: 18px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; }
/* "Need help now?": always in the top bar, but quiet: outlined, with red text, filling in on hover or focus. */
.help-btn { display: inline-flex; align-items: center; gap: 5px; background: transparent; color: var(--help); border: 1.5px solid color-mix(in srgb, var(--help) 55%, transparent); border-radius: 999px; padding: 5px 12px 5px 8px; font-weight: 700; font-size: .84rem; white-space: nowrap; text-decoration: none; transition: background-color .15s, color .15s; }
.help-btn .icon { width: 16px; height: 16px; }
.help-btn:hover, .help-btn:focus-visible { background: var(--help-soft); border-color: var(--help); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); }
.icon-btn:hover, .icon-btn[aria-current="page"] { background: var(--surface-2); }

/* ---------- cards and forms ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; gap: 14px; min-width: 0; box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card.risk { border: 2px solid var(--help); }
.intro { display: grid; gap: 6px; }
.intro p { color: var(--muted); max-width: 60ch; }
label, .label { font-weight: 700; font-size: .95rem; }
textarea, input[type="text"], input[type="email"], input[type="password"], input[type="date"] { width: 100%; background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.field-error { color: var(--help); font-size: .9rem; font-weight: 700; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 19px; height: 19px; flex: none; }
fieldset.bare { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
fieldset.bare legend { padding: 0; margin-bottom: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .92rem; font-weight: 400; transition: background-color .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip:has(input:checked), button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.chip .icon { width: 16px; height: 16px; vertical-align: -3px; }
button.chip { text-align: left; }
.chip.static { cursor: default; background: var(--surface-2); border-color: transparent; font-size: .82rem; padding: 3px 11px; }

.slider { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.slider output { font-family: var(--f-display); font-size: 2rem; font-weight: 500; min-width: 3.2ch; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.scale-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: -8px; }

.banner { background: var(--glow-soft); border-radius: var(--r-sm); padding: 12px 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: .92rem; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; justify-self: start; box-shadow: var(--shadow); }
.toast .icon { width: 18px; height: 18px; }

.list { display: grid; }
.item { padding-block: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; min-width: 0; }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item .meta, .meta { font-size: .82rem; color: var(--muted); }
.mood-badge { display: inline-grid; place-items: center; width: 2.4em; height: 2.4em; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }

.week { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .72rem; color: var(--muted); }
.dot.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.steps i.done { background: var(--accent); }
.prompt { font-family: var(--f-display); font-size: 1.4rem; font-weight: 500; line-height: 1.25; }
.hint { color: var(--muted); font-size: .94rem; max-width: 60ch; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.compare { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; }
.compare b { font-family: var(--f-display); font-weight: 500; font-size: 2.1rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.tr-field { display: grid; gap: 2px; }
.tr-field dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.tr-field dd { margin: 0; overflow-wrap: anywhere; }
details.rec summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
details.rec summary::-webkit-details-marker { display: none; }
details.rec[open] summary { margin-bottom: 12px; }
.trap-tip { color: var(--muted); font-size: .88rem; min-height: 1.4em; }
details.inline-form > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > summary { margin-bottom: 10px; }
.subform { background: var(--surface-2); border-radius: 12px; padding: 16px; display: grid; gap: 10px; }

.ladder { display: grid; gap: 16px; }
.rung { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.rung-score { border-radius: 12px; padding: 9px 0; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.rung-score small { display: block; font-weight: 400; font-size: .7rem; color: var(--ink); opacity: .75; }
.rung-body { display: grid; gap: 8px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 2px; }
.stat b { font-family: var(--f-display); font-weight: 500; font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: .85rem; color: var(--muted); }
.chart-box { overflow-x: auto; }
.chart-box svg { display: block; width: 100%; min-width: 420px; height: auto; }
.chart-box .grid { stroke: var(--line); }
.chart-box .axis { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart-box .area { fill: var(--chart-fill); }
.chart-box .line { fill: none; stroke: var(--chart-line); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .pt { fill: var(--surface); stroke: var(--chart-line); stroke-width: 2; }
.chart-box .pt.last { fill: var(--chart-line); }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 2ch; gap: 10px; align-items: center; font-size: .92rem; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar em { font-style: normal; font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }

details.lesson { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; }
details.lesson summary { cursor: pointer; font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
details.lesson summary::-webkit-details-marker { display: none; }
details.lesson summary::after { content: "+"; font-family: var(--f-body); color: var(--accent); font-size: 1.4rem; line-height: 1; }
details.lesson[open] summary::after { content: "–"; }
details.lesson[open] summary { margin-bottom: 12px; }
details.lesson .body { display: grid; gap: 10px; max-width: 64ch; }
details.lesson ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- mindfulness ---------- */
.js .no-js { display: none; }
html:not(.js) .js-only { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; text-decoration: none; margin-bottom: 6px; }
.back-link .icon { width: 18px; height: 18px; transform: scaleX(-1); }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; justify-self: start; }
.seg a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .92rem; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.practice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.practice-tile { display: grid; gap: 6px; align-content: start; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.practice-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.practice-tile b { font-family: var(--f-display); font-weight: 500; font-size: 1.1rem; }
.tile-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tile-min { font-size: .8rem; font-weight: 700; color: var(--muted); }
.tile-orb, .suggest-orb { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--glow-soft), var(--glow) 75%); }
.practice-tile.later { opacity: .7; }
.practice-tile.later:hover { opacity: 1; }
.practice-tile.inward .tile-orb { background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--sage) 75%); }
.suggest { grid-template-columns: auto 1fr auto; align-items: center; background: var(--glow-soft); border-color: transparent; }
.suggest-orb { width: 44px; height: 44px; }
@media (max-width: 520px) { .suggest { grid-template-columns: auto 1fr; } .suggest > .row { grid-column: 1 / -1; } }
.caution { background: var(--glow-soft); border-radius: 10px; padding: 10px 14px; }

.practice { gap: 18px; }
.orb-wrap { position: relative; display: grid; place-items: center; height: 240px; }
.orb { width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, var(--glow-soft), var(--sage) 58%, var(--accent) 100%); transform: scale(.55); transition-property: transform; transition-timing-function: ease-in-out; box-shadow: 0 10px 40px color-mix(in srgb, var(--sage) 40%, transparent); }
.orb.full { transform: scale(1); }
.orb.slow { animation: orb-drift 8s ease-in-out infinite; }
@keyframes orb-drift { 0%, 100% { transform: scale(.6); } 50% { transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .orb.slow { animation: none; transform: scale(.65); } }
.orb-label { position: absolute; font-family: var(--f-display); font-size: 1.15rem; font-weight: 500; color: var(--ink); text-shadow: 0 0 12px var(--surface); }
.player { display: grid; gap: 16px; }
.player-step { display: grid; gap: 6px; text-align: center; max-width: 52ch; margin-inline: auto; min-height: 7.5em; }
.player-step b { font-family: var(--f-display); font-weight: 500; font-size: 1.3rem; }
.player-step p { color: var(--muted); }
.player-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.player-bar i { display: block; height: 100%; width: 0; background: var(--sage); transition: width 1s linear; }
.stop-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; color: var(--muted); }
.stop-note .icon { width: 18px; height: 18px; color: var(--help); margin-top: 3px; }
.stop-note b { color: var(--ink); }
.guide { margin: 0; padding-left: 1.3em; display: grid; gap: 12px; }
.guide p { color: var(--muted); }

/* ---------- re-rating and weekly review ---------- */
.rerate { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.belief-line { display: flex; flex-wrap: wrap; gap: 6px; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.wb { display: grid; justify-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.wb b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-track { position: relative; width: 100%; max-width: 36px; height: 110px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.wb-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, var(--accent), var(--sage)); border-radius: 8px; }

/* ---------- app lock ---------- */
.lock-card { justify-items: center; text-align: center; }
.lock-card form { width: 100%; max-width: 280px; }
.lock-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); }
.lock-icon .icon { width: 26px; height: 26px; }
.pin-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.privacy-blur .app-main, html.privacy-blur .tabbar { filter: blur(14px); }

/* ---------- summary to share ---------- */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: grid; gap: 18px; color: var(--ink); }
.report-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; padding-bottom: 14px; border-bottom: 2px solid var(--accent); }
.report-head h2 { font-size: 1.5rem; }
.report-note { font-size: .86rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.report-sec { display: grid; gap: 10px; break-inside: avoid-page; }
.report-sec h3 { font-size: 1.15rem; padding-top: 6px; border-top: 1px solid var(--line); }
.report-sec h4 { font-size: .95rem; margin: 4px 0 0; }
.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-table th, .report-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bar-cell { width: 45%; }
.bar-cell span { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.report-item { padding: 8px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.report-item dl, .report-sec dl { margin: 4px 0 0; display: grid; gap: 2px; }
.report dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-top: 4px; }
.report dd { margin: 0; overflow-wrap: anywhere; }
.report-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .92rem; }

@media print {
  @page { margin: 16mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f2f4f3; --ink: #111; --muted: #555; --line: #ccc; --accent: #2f5a67; color-scheme: light; }
  body, body.app { background: #fff; font-size: 11pt; }
  .sidebar, .app-top, .tabbar, .app-foot, .no-print, .toast, .skip, .overlay, .banner { display: none !important; }
  .shell { display: block; }
  .app-content { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; }
  .bar-cell span { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- course ---------- */
.course-card { grid-template-columns: 1fr auto; align-items: center; background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); }
.course-card b { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; }
.course-dots { display: flex; gap: 6px; }
.course-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.course-dots i.on { background: var(--accent); }
.course-dots i.now { background: var(--glow); }
.weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.week-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.week-row a { color: var(--ink); text-decoration: none; }
.week-row a:hover b { color: var(--accent); }
.week-row b { font-family: var(--f-display); font-weight: 500; }
.week-row.locked { opacity: .6; }
.week-row.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.week-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.week-row.done .week-num { background: var(--accent); color: var(--on-accent); }
.week-row.done .week-num .icon { width: 18px; height: 18px; }
.week-row.now .week-num { background: var(--glow-soft); color: var(--ink); }
@media (max-width: 520px) { .week-row { grid-template-columns: auto 1fr; } .week-state { grid-column: 2; } }
.lesson-body p { max-width: 64ch; }
.course-step { gap: 4px; text-decoration: none; color: var(--ink); transition: border-color .15s; }
.course-step:hover { border-color: var(--accent); }
.course-step b { font-family: var(--f-display); font-weight: 500; font-size: 1.1rem; }
.select { width: 100%; background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; }

/* ---------- crisis ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) var(--gutter-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--gutter-l); overflow-y: auto; }
.sheet { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 26px; max-width: 540px; width: 100%; display: grid; gap: 16px; box-shadow: var(--shadow-lg); }
.sheet.crisis, .crisis-page { border-top: 6px solid var(--help); }
.resources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.resource { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--help-soft); }
.resource > div { display: grid; gap: 2px; min-width: 0; }
.resource .desc { font-size: .86rem; color: var(--muted); }
.resource .num { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-display); font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; user-select: all; font-variant-numeric: tabular-nums; }
.resource .num .icon { width: 18px; height: 18px; color: var(--help); }

/* ---------- app shell ---------- */
body.app { min-height: 100dvh; }
.shell { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.sidebar { display: none; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter-r) 10px var(--gutter-l); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-top-logo { text-decoration: none; }
.app-top-actions { display: flex; align-items: center; gap: 4px; }
.app-content { width: 100%; max-width: 760px; margin: 0 auto; padding: 24px var(--gutter-r) calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); display: grid; gap: 20px; align-content: start; flex: 1; }
.app-foot { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px var(--gutter-r) calc(6px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: .7rem; min-width: 0; white-space: nowrap; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a[aria-current="page"] .icon { background: var(--accent-soft); border-radius: 999px; padding: 2px 12px; width: 24px; box-sizing: content-box; }
@media (max-width: 340px) { .help-btn span { display: none; } .help-btn { padding: 6px; } }
@media (max-width: 420px) { .app-top .logo-word span, .auth-top .logo-word span { display: none; } }
.logo-mark { filter: drop-shadow(0 1px 1px rgba(29,53,64,.12)); }

@media (min-width: 900px) {
  .shell { grid-template-columns: 248px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100dvh; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface); }
  .sidebar-logo { padding: 0 10px; text-decoration: none; }
  .side-nav { display: grid; gap: 18px; }
  .side-group { display: grid; gap: 2px; }
  .side-head { padding: 0 12px 4px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .side-nav a, .side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 700; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
  .side-nav a:hover, .side-link:hover { background: var(--surface-2); color: var(--ink); }
  .side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
  .side-foot { margin-top: auto; display: grid; gap: 2px; }
  .side-foot form { margin: 0; }
  .side-user { font-size: .8rem; color: var(--muted); padding: 8px 12px 0; }
  .app-top { justify-content: flex-end; background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: 18px; }
  .app-top-logo, .app-top-actions .icon-btn { display: none; }
  .app-content { padding-top: 0; padding-bottom: 48px; }
  .app-foot { display: block; max-width: 760px; margin: 0 auto; width: 100%; padding: 0 var(--gutter-r) 28px var(--gutter-l); font-size: .82rem; color: var(--muted); }
  .tabbar { display: none; }
}

/* "More" page links */
.menu-list { display: grid; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none; font-weight: 700; width: 100%; text-align: left; cursor: pointer; }
.menu-list > :first-child { border-top: 0; }
.menu-list .icon { color: var(--accent); }
.menu-list .go { margin-left: auto; color: var(--muted); }
.install-card { grid-template-columns: auto 1fr auto; align-items: center; background: var(--accent-soft); border-color: transparent; }
.install-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--on-accent); }
@media (max-width: 520px) { .install-card { grid-template-columns: auto 1fr; } .install-card .btn { grid-column: 1 / -1; } }

/* ---------- auth shell ---------- */
body.auth { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(120% 70% at 50% -10%, var(--bg-tint), var(--bg) 60%); }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter-r) 16px var(--gutter-l); }
.auth-logo { text-decoration: none; }
.auth-main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 24px var(--gutter-r) 40px var(--gutter-l); display: grid; gap: 20px; align-content: start; }
.auth-main .card { padding: 30px; box-shadow: var(--shadow); }
@media (max-width: 480px) { .auth-main .card { padding: 22px; } }
.auth-main.wide { max-width: 640px; }
.auth-foot { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; padding: 20px var(--gutter-r) calc(24px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); font-size: .85rem; }
.auth-foot a { color: var(--muted); }

/* ---------- public site ---------- */
body.site { background: var(--bg); }
.site-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.site-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; padding-top: env(safe-area-inset-top, 0px); }
.site-top-row { display: flex; align-items: center; gap: 28px; padding-block: 14px; }
.site-logo { text-decoration: none; }
.site-nav { display: flex; gap: 22px; margin-right: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.site-signin { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.site-actions .btn { white-space: nowrap; }
@media (max-width: 820px) { .site-nav { display: none; } }
@media (max-width: 400px) { .site-signin { display: none; } }

.hero { padding-block: 56px 72px; background: radial-gradient(90% 80% at 85% 10%, var(--bg-tint), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 3.9rem); font-weight: 500; line-height: 1.06; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--accent); background: linear-gradient(transparent 68%, var(--glow-soft) 68%, var(--glow-soft) 92%, transparent 92%); }
.hero-lead { font-size: 1.18rem; color: var(--muted); max-width: 34em; margin-top: 20px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-note { margin-top: 18px; font-size: .88rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.hero-note .icon { width: 18px; height: 18px; color: var(--accent); }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 32px; } }

/* Phone mockup showing a finished thought record */
.phone { justify-self: center; width: min(320px, 100%); aspect-ratio: 9 / 18.5; background: var(--ink); border-radius: 46px; padding: 10px; box-shadow: var(--shadow-lg); position: relative; }
.phone-screen { height: 100%; border-radius: 37px; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.phone-bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; font-size: .72rem; font-weight: 700; }
.phone-bar .notch { width: 84px; height: 24px; border-radius: 12px; background: var(--ink); }
.phone-body { padding: 8px 16px 16px; display: grid; gap: 10px; align-content: start; flex: 1; }
.phone-body .eyebrow { font-size: .62rem; }
.phone-title { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.15; }
.mock-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 6px; font-size: .78rem; }
.mock-card dt { font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.mock-card dd { margin: 0; line-height: 1.4; }
.mock-card s { color: var(--muted); }
.mock-rerate { display: flex; align-items: center; gap: 10px; }
.mock-rerate b { font-family: var(--f-display); font-weight: 500; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.mock-rerate .from { color: var(--muted); }
.mock-rerate .to { color: var(--accent); }
.mock-meter { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.mock-meter i { position: absolute; inset: 0 60% 0 0; background: var(--accent); border-radius: 4px; }
.mock-meter i::after { content: ""; position: absolute; inset: 0 -112% 0 100%; background: var(--glow); opacity: .55; }
.mock-tabs { display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.mock-tabs span { display: grid; justify-items: center; color: var(--muted); }
.mock-tabs span .icon { width: 20px; height: 20px; }
.mock-tabs span.on { color: var(--accent); }
.phone-float { position: absolute; left: -46px; bottom: 90px; background: var(--surface); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .8rem; display: flex; gap: 10px; align-items: center; max-width: 210px; }
.phone-float .mood-badge { width: 2.1em; height: 2.1em; }
@media (max-width: 480px) { .phone-float { left: -8px; } }

.section { padding-block: 84px; }
.section.tint { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; max-width: 640px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.section-head.center { text-align: center; margin-inline: auto; justify-items: center; }

.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .tools { grid-template-columns: 1fr; } }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; display: grid; gap: 16px; align-content: start; }
.section.tint .tool { background: var(--bg); }
.tool-head { display: flex; gap: 12px; align-items: center; }
.tool-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.tool h3 { font-size: 1.35rem; font-weight: 500; }
.tool p { color: var(--muted); }
.tool-demo { background: var(--surface-2); border-radius: 14px; padding: 16px; display: grid; gap: 10px; font-size: .88rem; }
.section.tint .tool-demo { background: var(--surface); }
.tool-wide { grid-column: 1 / -1; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 28px; }
@media (max-width: 760px) { .tool-wide { grid-template-columns: 1fr; } }
.breath-demo { grid-template-columns: auto 1fr; align-items: center; gap: 20px; padding: 22px; }
.orb-mini { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, var(--glow-soft), var(--sage) 58%, var(--accent) 100%); }
@media (prefers-reduced-motion: no-preference) { .orb-mini { animation: orb-breathe 10s ease-in-out infinite; } }
@keyframes orb-breathe { 0%, 100% { transform: scale(.7); } 40% { transform: scale(1); } }
.demo-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.demo-scale span { height: 26px; border-radius: 6px; background: var(--line); display: grid; place-items: center; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-scale span.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.demo-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.demo-ladder { display: grid; gap: 6px; }
.demo-ladder div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.demo-ladder b { font-variant-numeric: tabular-nums; border-radius: 8px; text-align: center; padding: 3px 0; font-size: .78rem; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; counter-reset: step; }
.flow li { counter-increment: step; display: grid; gap: 8px; align-content: start; padding-top: 18px; border-top: 2px solid var(--line); position: relative; }
.flow li::before { content: counter(step); position: absolute; top: -15px; left: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.flow li b { font-family: var(--f-display); font-size: 1.15rem; font-weight: 500; }
.flow li span { color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .flow { grid-template-columns: repeat(3, 1fr); row-gap: 34px; } }
@media (max-width: 540px) { .flow { grid-template-columns: 1fr 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.points li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.points li > .icon { color: var(--accent); margin-top: 2px; }
.points li > div > b { display: block; }
.points span { color: var(--muted); }
.safety-panel { background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--help); border-radius: 22px; padding: 26px; display: grid; gap: 14px; box-shadow: var(--shadow); }

.faq { display: grid; gap: 10px; max-width: 780px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--muted); max-width: 64ch; }

.cta-band { background: var(--accent); color: var(--on-accent); border-radius: 28px; padding: 56px 40px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 500; letter-spacing: -.03em; }
.cta-band p { opacity: .85; max-width: 44ch; }
.cta-band .btn { background: var(--on-accent); color: var(--accent-strong); }
.cta-band .btn:hover { background: var(--glow-soft); }
@media (max-width: 520px) { .cta-band { padding: 40px 22px; border-radius: 22px; } }

.prose { max-width: 70ch; display: grid; gap: 14px; padding-block: 48px 80px; }
.prose h1 { margin-bottom: 4px; }
.prose h2 { margin-top: 22px; font-size: 1.45rem; }
.prose ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .94rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.draft-note { background: var(--glow-soft); border-radius: 12px; padding: 12px 16px; font-size: .92rem; }

.site-foot { background: var(--surface); border-top: 1px solid var(--line); padding-block: 56px calc(32px + env(safe-area-inset-bottom, 0px)); margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 32px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand { display: grid; gap: 12px; align-content: start; }
.foot-brand p, .foot-crisis p { color: var(--muted); font-size: .92rem; }
.foot-col { display: grid; gap: 8px; align-content: start; }
.foot-col h2 { font-family: var(--f-body); font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.foot-col a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.foot-col a:hover { color: var(--accent); }
.foot-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); max-width: 90ch; }

@media (prefers-reduced-motion: no-preference) {
  .app-content > *, .auth-main > * { animation: rise .3s ease-out both; }
  .hero-copy > * { animation: rise .5s ease-out both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; } .hero-copy > :nth-child(3) { animation-delay: .12s; } .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .phone { animation: lift .7s ease-out .1s both; }
  /* Movement only: content stays fully visible even if animations are paused (background tabs, thumbnails). */
  @keyframes rise { from { transform: translateY(6px); } to { transform: none; } }
  @keyframes lift { from { transform: translateY(18px); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Installed app (standalone): no browser chrome, so trim the website footer links */
@media (display-mode: standalone) { .auth-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- evening: night mode, wind-down, three good things ---------- */
/* Night mode: a dim, warm, low-contrast palette for the wind-down pages, whatever the device theme. */
body.night {
  --bg: #0c0f12; --bg-tint: #12161a; --surface: #14191d; --surface-2: #1b2125; --ink: #c9c3b8; --muted: #8b8780;
  --line: #252b30; --accent: #c9a77e; --accent-strong: #ddbf98; --on-accent: #1a130b; --accent-soft: #241e17;
  --sage: #6f8a80; --glow: #b98a5e; --glow-soft: #2a2119; --help: #e3937e; --on-help: #200d08; --help-soft: #33211c;
  --chart-line: #c9a77e; --chart-fill: rgba(201,167,126,.12); --scrim: rgba(0,0,0,.7);
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  color-scheme: dark;
}
body.night .orb { box-shadow: none; filter: brightness(.75); }
body.night img, body.night .sidebar-logo svg, body.night .app-top-logo svg { filter: brightness(.8); }

.wind-step { grid-template-columns: auto 1fr; align-items: start; }
.step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--f-display); font-weight: 600; }
@media (max-width: 520px) { .wind-step { grid-template-columns: 1fr; } .step-num { width: 28px; height: 28px; font-size: .9rem; } }
.wind-step textarea { min-height: 120px; }
.worry p { margin: 0; flex: 1; min-width: 0; }
.worries-card { background: linear-gradient(120deg, var(--glow-soft), var(--surface) 70%); }

.good-form { gap: 12px; }
.good-field { display: grid; gap: 6px; }
.good-field label { display: flex; align-items: center; gap: 10px; }
.good-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--glow-soft); color: var(--ink); }
.good-card { background: linear-gradient(160deg, var(--glow-soft), var(--surface) 65%); }
.good-card .linkish .icon, .intro .eyebrow .icon { width: 1em; height: 1em; vertical-align: -.15em; }
.good-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

.today-step { grid-template-columns: 1fr auto; align-items: center; border-left: 4px solid var(--glow); }
.today-step .step-title { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 1.15rem; line-height: 1.4; }
.today-step p.small { margin: 0; }
.today-step.done { grid-template-columns: 1fr; border-left-color: var(--sage); }
.step-tick { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
@media (max-width: 520px) { .today-step { grid-template-columns: 1fr; } }

/* ---------- what do you need right now? (src/needs.php) ---------- */
.needs { gap: 14px; }
.need-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.need-list.two { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.need { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; transition: border-color .15s, background-color .15s; }
.need:hover { border-color: var(--accent); background: var(--accent-soft); }
.need .icon { width: 18px; height: 18px; color: var(--accent); }
.need-crisis { justify-content: flex-start; border-color: var(--help); background: var(--help-soft); color: var(--ink); }
.need-crisis:hover { border-color: var(--help); background: var(--help-soft); }
.need-crisis .icon { color: var(--help); }
.need-result { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: var(--glow-soft); border-radius: 12px; padding: 14px; }

/* ---------- first steps (src/first_steps.php) ---------- */
.first-steps { grid-template-columns: 1fr auto; align-items: center; }
@media (max-width: 520px) { .first-steps { grid-template-columns: 1fr; } }
.first-days { gap: 12px; }
.first-day.done h2 { color: var(--muted); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task-list li { display: flex; align-items: center; gap: 10px; }
.task-list a { font-weight: 700; }
.task-tick { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.task-list li.ticked .task-tick { background: var(--sage); border-color: var(--sage); color: var(--on-accent); }
.task-tick .icon { width: 16px; height: 16px; }

/* ---------- wellbeing check-in (src/wellbeing.php) ---------- */
.wellbeing-form { gap: 16px; }
.wb-item { border: 0; margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.wb-item legend { display: flex; gap: 10px; align-items: baseline; font-weight: 700; padding: 0; margin-bottom: 10px; }
.wb-item.missing legend { color: var(--help); }
.wb-num { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .8rem; }
.wb-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wb-opt { display: grid; place-items: center; text-align: center; gap: 4px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; line-height: 1.25; cursor: pointer; min-height: 48px; }
.wb-opt input { position: absolute; opacity: 0; pointer-events: none; }
.wb-opt:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.wb-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .wb-scale { grid-template-columns: 1fr; } .wb-opt { place-items: center start; text-align: left; padding: 10px 14px; } }
.wb-copy { font-size: .78rem; }
.wb-history { display: grid; gap: 4px; }

/* ---------- animated explainers (src/explainers.php) ---------- */
.explainer { margin: 4px 0; display: grid; gap: 8px; background: var(--surface-2); border-radius: var(--r); padding: 14px; position: relative; }
.ex-stage svg { display: block; width: 100%; max-width: 380px; height: auto; margin-inline: auto; overflow: visible; }
.explainer figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.ex-title { font-weight: 700; flex: 1 1 auto; }
.ex-pause { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ex-pause-label { color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ex-pause:focus-visible ~ figcaption .ex-pause-label { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ex-pause:checked ~ figcaption .ex-pause-label::after { content: " (paused: showing the whole picture)"; font-weight: 400; color: var(--muted); text-decoration: none; }
.ex-desc { flex-basis: 100%; }
.ex-desc summary, details.lesson .ex-desc summary { cursor: pointer; color: var(--accent); font-family: var(--f-body); font-size: inherit; font-weight: 700; display: list-item; list-style: none; margin: 0; text-decoration: underline; text-underline-offset: 3px; }
.ex-desc summary::-webkit-details-marker { display: none; }
details.lesson .ex-desc summary::after, details.lesson[open] .ex-desc summary::after { content: none; }
.ex-desc p { margin-top: 6px; color: var(--muted); }
.explainer text { font-family: var(--f-body); }
.ex-label { fill: var(--ink); font-size: 13px; font-weight: 700; }
.ex-example, .ex-note, .ex-axis-label { fill: var(--muted); font-size: 12px; }
.ex-cap { fill: var(--ink); font-size: 13px; opacity: 0; }
.ex-dot { fill: var(--glow); stroke: var(--surface); stroke-width: 2; }
.ex-ring, .ex-orbit-box { fill: none; }
.ex-ring { stroke: var(--line); stroke-width: 2; }
.ex-arc { fill: none; stroke: var(--sage); stroke-width: 2.5; }
.ex-arrowhead { fill: var(--sage); }
.ex-node circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.ex-trail { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 4 6; }
.ex-breath-ring { fill: var(--accent-soft); stroke: var(--sage); stroke-width: 2; }
.ex-bubble-c { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.ex-axis { stroke: var(--line); stroke-width: 2; }
.ex-wave-ghost { fill: none; stroke: var(--line); stroke-width: 3; stroke-dasharray: 3 6; }
.ex-wave-line { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.ex-surfer { offset-rotate: 0deg; }

/* Still picture (reduced motion or paused): everything labelled, nothing moving. */
.still-only { display: none; }
.explainer .ex-surfer { display: none; }
@media (prefers-reduced-motion: reduce) {
  .explainer .still-only { display: inline; }
  .explainer .motion-only, .explainer .ex-pause-label { display: none; }
  .explainer .ex-orbit, .explainer .ex-attention { display: none; }
}
.ex-pause:checked ~ .ex-stage .still-only { display: inline; }
.ex-pause:checked ~ .ex-stage .motion-only, .ex-pause:checked ~ .ex-stage .ex-orbit, .ex-pause:checked ~ .ex-stage .ex-attention { display: none; }

@media (prefers-reduced-motion: no-preference) {
  /* (a) cycle, 18s: the dot goes round; each node lights up and its example shows as the dot arrives. */
  .ex-orbit { transform-box: fill-box; transform-origin: 50% 50%; animation: ex-spin 18s linear infinite; }
  .ex-node circle { animation: ex-node 18s linear infinite; }
  .ex-node.n2 circle { animation-delay: -12s; }
  .ex-node.n3 circle { animation-delay: -6s; }
  .ex-cap.c1 { animation: ex-cap3 18s linear infinite; }
  .ex-cap.c2 { animation: ex-cap3 18s linear infinite -12s; }
  .ex-cap.c3 { animation: ex-cap3 18s linear infinite -6s; }

  /* (b) wander, 18s: rest on the breath, drift to a thought, notice, come back. */
  .ex-breath { transform-box: fill-box; transform-origin: 50% 50%; animation: ex-breathe 6s ease-in-out infinite; }
  .ex-attention { animation: ex-wander 18s ease-in-out infinite; }
  .ex-bubble { animation: ex-bubble 18s ease-in-out infinite; }
  .ex-cap.w1 { animation: ex-w1 18s linear infinite; }
  .ex-cap.w2 { animation: ex-w2 18s linear infinite; }
  .ex-cap.w3 { animation: ex-w3 18s linear infinite; }
  .ex-cap.w4 { animation: ex-w4 18s linear infinite; }

  /* (c) wave, 16s: the line draws itself with a dot riding it, labels appear in turn, then it fades and starts again. */
  .ex-wave-line { stroke-dasharray: 100; animation: ex-draw 16s ease-in-out infinite; }
  .explainer .ex-surfer { display: inline; animation: ex-surf 16s ease-in-out infinite; }
  .ex-t1 { animation: ex-t1 16s linear infinite; }
  .ex-t2 { animation: ex-t2 16s linear infinite; }
  .ex-t3 { animation: ex-t3 16s linear infinite; }
  .ex-pause:checked ~ .ex-stage .ex-surfer { display: none; }
  .ex-pause:checked ~ .ex-stage * { animation: none !important; }
}

@keyframes ex-spin { to { transform: rotate(360deg); } }
@keyframes ex-node { 0%, 26% { fill: var(--accent-soft); } 34%, 100% { fill: var(--surface); } }
@keyframes ex-cap3 { 0% { opacity: 0; } 4%, 28% { opacity: 1; } 33%, 100% { opacity: 0; } }
@keyframes ex-breathe { 0%, 100% { transform: scale(.88); } 50% { transform: scale(1); } }
@keyframes ex-wander {
  0%, 30% { transform: translate(0, 0); }
  42%, 62% { transform: translate(148px, -66px); }
  80%, 100% { transform: translate(0, 0); }
}
@keyframes ex-bubble { 0%, 28% { opacity: .25; } 40%, 64% { opacity: 1; } 78%, 100% { opacity: .25; } }
@keyframes ex-w1 { 0%, 2% { opacity: 0; } 5%, 28% { opacity: 1; } 31%, 97% { opacity: 0; } 100% { opacity: 0; } }
@keyframes ex-w2 { 0%, 30% { opacity: 0; } 33%, 48% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes ex-w3 { 0%, 50% { opacity: 0; } 53%, 63% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes ex-w4 { 0%, 65% { opacity: 0; } 68%, 95% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes ex-draw { 0% { stroke-dashoffset: 100; opacity: 1; } 75%, 90% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ex-surf { 0% { offset-distance: 0%; opacity: 1; } 75%, 90% { offset-distance: 100%; opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes ex-t1 { 0%, 18% { opacity: 0; } 24%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ex-t2 { 0%, 34% { opacity: 0; } 40%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ex-t3 { 0%, 54% { opacity: 0; } 60%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Phase 6: timer sounds and presets, length filter, "took a pause" count ---------- */
.tone-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tone { display: inline-flex; align-items: center; gap: 8px; }
.presets .preset { display: inline-flex; align-items: center; gap: 2px; }
.preset-del { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 6px 8px; border-radius: 999px; cursor: pointer; }
.preset-del:hover, .preset-del:focus-visible { color: var(--ink); background: var(--surface-2); }
.preset-save { flex-wrap: nowrap; }
.preset-save input { flex: 1; min-width: 0; padding: 8px 12px; }
.preset-save .btn { flex: none; }
a.chip { text-decoration: none; color: inherit; }
a.chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.pause-count { display: flex; align-items: center; gap: 12px; }
.pause-count p { margin: 0; }
.pause-count .suggest-orb { flex: none; }
.length-filter { gap: 6px; }
.length-filter .chip { padding: 6px 11px; font-size: .88rem; }

/* ---------- Phase 7: personal suggestions and your focus ---------- */
.why { margin-top: 4px; color: var(--muted); }
.why p { margin: 0; }
.why details { margin-top: 2px; }
.why summary { cursor: pointer; color: var(--accent); font-weight: 700; width: fit-content; }
.why details p { margin-top: 6px; }
.focus-card { display: grid; gap: 10px; }
.focus-card .need { font-weight: 600; }
.need-wind { justify-content: flex-start; background: var(--glow-soft); border-color: transparent; }
.need-wind > span { flex: 1; }
.focus-choice .chips { margin-top: 8px; }
.focus-choice p { margin: 4px 0 0; }
.focus-explain { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- UX pass: Today layout, More groups, plain-English bits ---------- */
.checked-in > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; font-weight: 700; }
.checked-in > summary::-webkit-details-marker { display: none; }
.checked-in[open] > summary .linkish { display: none; }
.checked-in[open] > form { margin-top: 14px; }
.more-fields > summary, .more-today > summary, .all-practices > summary { cursor: pointer; font-weight: 700; color: var(--accent); width: fit-content; }
.more-fields > .stack { margin-top: 12px; }
.more-today { border-top: 1px solid var(--line); padding-top: 14px; }
.more-today > summary { font-family: var(--f-display); font-size: 1.1rem; color: var(--ink); }
.more-today[open] > summary { margin-bottom: 14px; }
.all-practices > summary { font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); margin: 4px 0; }
.all-practices[open] > summary { margin-bottom: 14px; }
.all-practices > .stack { gap: 28px; }
.needs-compact { display: grid; gap: 8px; }
.needs-pick > summary { cursor: pointer; list-style: none; }
.needs-pick > summary::-webkit-details-marker { display: none; }
.needs-pick[open] > summary .icon { transform: rotate(90deg); }
.needs-pick > .need-list { margin-top: 8px; }
/* The picker is one full-width column now that "I'm not safe" sits inside the list. */
.more-group { display: grid; gap: 4px; }
.more-group > .eyebrow { margin: 0; font-size: .74rem; }
.menu-crisis .icon { color: var(--help) !important; }
.in-short { color: var(--ink); }
.welcome-step { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 1.1rem; }
.welcome-step .step-num { width: 28px; height: 28px; font-size: .9rem; flex: none; }

/* ---------- illustrations (src/illustrations.php) ---------- */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art-shadow { fill: var(--ink); opacity: .08; }
.art-ground { fill: var(--accent-soft); }
.art-ground.night { fill: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.art-water { fill: color-mix(in srgb, var(--sage) 26%, transparent); }
.art-line { fill: none; stroke: var(--sage); stroke-width: 1.5; stroke-linecap: round; }
.art-arc { fill: none; stroke: var(--glow); stroke-width: 4; stroke-linecap: round; }
.art-vein { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1; }
.intro:has(> .intro-art) { grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px; }
.intro > :not(.intro-art) { grid-column: 1; }
.intro:has(> .intro-art) > p { grid-column: 1 / -1; }
.intro-art { grid-column: 2; grid-row: 1 / span 3; width: 140px; align-self: center; }
@media (max-width: 600px) { .intro-art { width: 86px; align-self: start; margin-top: 4px; } }
.empty-state { display: grid; justify-items: center; text-align: center; gap: 6px; padding-block: 6px; }
.empty-state .art { width: 150px; }
.empty-state p { max-width: 36ch; }
.tile-art { width: 64px; margin: -6px 0 -4px -6px; }
.tool-art { width: 100%; max-width: 220px; justify-self: center; }
.auth-art { width: 150px; justify-self: center; margin-bottom: -6px; }
@media (prefers-reduced-motion: no-preference) {
  .intro-art .art, .auth-art .art { animation: art-settle .9s ease-out both; }
  @keyframes art-settle { from { transform: translateY(4px); } to { transform: none; } }
}
.tool-mini { width: 92px; flex: none; margin: -10px 0 -6px -8px; }
.panel-art { width: 150px; }
.cta-art { width: 170px; margin-bottom: -8px; }
.cta-band .art-ground { fill: color-mix(in srgb, var(--on-accent) 22%, transparent); }
.cta-band .art-shadow { fill: #000; opacity: .15; }

/* ---------- website feature sections ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .feature-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .feature-grid, .feature-grid.four { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: grid; gap: 10px; align-content: start; }
.section.tint .feature { background: var(--bg); }
.feature h3 { font-size: 1.25rem; font-weight: 500; }
.feature p { color: var(--muted); }
.feature-art { width: 100%; max-width: 220px; margin: -6px 0 2px; }
.start-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: start; }
@media (max-width: 760px) { .start-steps { grid-template-columns: 1fr; } }
.start-steps .feature { counter-increment: start; position: relative; }
.start-steps .feature::before { content: counter(start); position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.mini-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.mini-points li { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }
.mini-points .icon { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
.cta-note { opacity: .75; }

/* ---------- teen edition (html[data-edition="teen"]) ----------
   Same layout and components; a brighter palette from the teen logo: indigo (accent), mint (soft fills), coral (highlights). */
:root[data-edition="teen"] {
  --bg: #f7f6fc;
  --bg-tint: #ecebfa;
  --surface: #ffffff;
  --surface-2: #f0effa;
  --ink: #1f2140;
  --muted: #5b5e7c;
  --line: #dddcf0;
  --accent: #4b50b0;
  --accent-strong: #363a8c;
  --on-accent: #ffffff;
  --accent-soft: #e5e6fa;
  --sage: #5fbd9e;
  --glow: #ff9a7a;
  --glow-soft: #ffebe3;
  --chart-line: #4b50b0;
  --chart-fill: rgba(95,189,158,.2);
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root[data-edition="teen"] {
    --bg: #14152a; --bg-tint: #1b1c38; --surface: #1c1d36; --surface-2: #25264a; --ink: #ecebfb; --muted: #a6a8c9;
    --line: #313358; --accent: #a5a9ff; --accent-strong: #c9cbff; --on-accent: #15163a; --accent-soft: #2a2c5a;
    --sage: #7fd8bb; --glow: #ffa98c; --glow-soft: #3d2622; --chart-line: #a5a9ff; --chart-fill: rgba(127,216,187,.16);
  }
}

/* ---------- self-esteem tools ---------- */
.belief-pair { gap: 12px; }
.belief { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: 12px; }
.belief .eyebrow { grid-column: 1 / -1; }
.belief p { font-family: var(--f-display); font-size: 1.1rem; }
.belief b { font-family: var(--f-display); font-weight: 500; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.belief.old { background: var(--surface-2); }
.belief.old p, .belief.old b { color: var(--muted); }
.belief.new { background: var(--accent-soft); }
.esteem-chart .old-line { stroke: var(--muted); stroke-dasharray: 5 5; }
.key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 6px 0 12px; }
.key:first-child { margin-left: 0; }
.old-key { background: var(--muted); }
.new-key { background: var(--chart-line); }
button.chip[data-fill] { font-size: .86rem; padding: 5px 12px; }
.quality-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.quality-card { background: var(--glow-soft); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.quality-card b { font-family: var(--f-display); font-weight: 500; font-size: 1.15rem; }
.quality-card form { margin: 0; }
.esteem-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.esteem-tool { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.esteem-tool:hover { border-color: var(--accent); }
.esteem-tool b { font-family: var(--f-display); font-weight: 500; font-size: 1.08rem; display: block; }
.esteem-tool .count { font-size: .78rem; font-weight: 700; color: var(--accent); }
.esteem-chart svg { min-width: 0; }

/* ---------- articles ---------- */
.articles-head { padding-top: 48px; }
.articles-head h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.article-topics { margin-bottom: 26px; flex-wrap: wrap; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.article-card { display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-card b { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; line-height: 1.25; }
.article-card-art { width: 150px; margin: -6px 0 2px -6px; }
.article { padding-top: 32px; }
.article-hero-art { width: 200px; margin: 4px 0 -4px -8px; }
.article h1 { font-size: clamp(2rem, 4.5vw, 2.7rem); }
.article-lead { font-size: 1.15rem; color: var(--muted); }
.article p, .article li { line-height: 1.7; }
.article ol, .article ul { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.article-note { background: var(--glow-soft); border-radius: 12px; padding: 12px 16px; font-size: .95rem; }
.article-try { display: grid; grid-template-columns: 86px 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--accent-soft); margin-block: 6px; }
.article-try b { font-family: var(--f-display); font-weight: 500; font-size: 1.15rem; }
@media (max-width: 520px) { .article-try { grid-template-columns: 70px 1fr; } .article-try .btn { grid-column: 1 / -1; } }
.article-foot { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 10px; }
.read-next { display: grid; gap: 16px; padding-bottom: 40px; }
.article-cta { margin-bottom: 40px; }

/* Moved today? (Today page) */
.movement-form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }

/* Food and drink today (Today page) */
.food-card > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.food-card > summary::-webkit-details-marker { display: none; }
.food-card[open] > summary { margin-bottom: 14px; }
.food-card form { gap: 16px; }

/* AI weekly reflection (weekly review) */
.ai-reflection { border-left: 4px solid var(--accent); }
.ai-reflection .ai-text p { margin: 0 0 10px; line-height: 1.55; }
.ai-tool { display: grid; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.ai-tool:hover { border-color: var(--accent); }
.ai-sent { background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-height: 320px; }

/* Habits */
.habit-dots { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 2px; }
.habit-dots .hd { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); }
.habit-dots .hd.on { background: var(--accent); border-color: var(--accent); }
.habit-dots .hd.slip { border-color: var(--glow); background: transparent; border-style: dashed; }
.habit-dots .hd.today { outline: 2px solid var(--accent); outline-offset: 2px; }
.habit-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.habit-buttons { margin: 0; }
.habit-sign { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; }
.habit-sign p { margin: 4px 0 0; }

/* More: tools as small groups of illustrated tiles */
.tool-group { display: grid; gap: 10px; }
.tool-group + .tool-group { margin-top: 6px; }
.tool-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tool-tile { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.tool-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-tile b { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; line-height: 1.25; }
.tool-tile .small { line-height: 1.35; }
.tool-tile-art { display: block; height: 64px; margin: -4px -4px 4px; border-radius: calc(var(--r) - 4px); background: var(--surface-2); overflow: hidden; }
.tool-tile-art svg { width: 100%; height: 100%; display: block; }
.tool-group-evening .tool-tile-art { background: var(--glow-soft); }
.tool-group-learn .tool-tile-art { background: var(--accent-soft); }
/* Phones: an odd last tile becomes a wide card, picture beside the words, instead of sitting alone. */
@media (max-width: 520px) {
  .tool-tiles > .tool-tile:last-child:nth-child(odd) { grid-column: 1 / -1; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; align-items: center; }
  .tool-tiles > .tool-tile:last-child:nth-child(odd) .tool-tile-art { grid-row: 1 / 3; margin: 0; height: 72px; }
  .tool-tiles > .tool-tile:last-child:nth-child(odd) b { align-self: end; }
  .tool-tiles > .tool-tile:last-child:nth-child(odd) .small { align-self: start; }
}

/* Admin: on/off switches */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; }
.switch-row .wrap-text { display: grid; gap: 2px; }
.switch { position: relative; flex: none; width: 52px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background-color .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch-row .small { font-weight: 400; }

/* "What do you need right now?": hard and good choices in two groups */
.need-group { margin: 12px 2px 6px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.need-group.good { margin-top: 16px; }
.need.need-good { background: var(--glow-soft); border-color: transparent; }
.need.need-good:hover { border-color: var(--glow); background: var(--glow-soft); }
.need.need-good .icon { color: var(--ink); }

/* Thought record: "None of these fit" */
.trap-none { margin-top: 6px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: 12px; align-items: flex-start; }
.trap-none:has(input:checked) { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* Thought record step 1: "Something happened" or "A general thought" */
.tr-kind { margin: 2px 0 6px; }
/* Very narrow phones (under 360px): smaller tab labels so seven tabs don't run into each other. */
@media (max-width: 359px) {
  .tabbar { padding-left: 4px; padding-right: 4px; }
  .tabbar a { font-size: .6rem; letter-spacing: -.01em; }
  .tabbar a[aria-current="page"] .icon { padding: 2px 8px; }
}

/* Desktop menu: scroll rather than cut items off on shorter screens, and tighten up when height is limited. */
@media (min-width: 900px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (min-width: 900px) and (max-height: 860px) {
  .sidebar { gap: 18px; padding-top: 18px; padding-bottom: 16px; }
  .side-nav { gap: 12px; }
  .side-nav a, .side-link { padding-top: 7px; padding-bottom: 7px; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .sidebar { gap: 12px; padding-top: 14px; }
  .side-nav { gap: 8px; }
  .side-nav a, .side-link { padding-top: 5px; padding-bottom: 5px; }
  .side-head { margin-top: 0; }
}

/* ---------- top bar: desktop links, the ⋯ menu, and phone quick links ---------- */
.top-nav { display: none; }
.acct { position: relative; }
.acct > summary { list-style: none; cursor: pointer; }
.acct > summary::-webkit-details-marker { display: none; }
.acct[open] > summary { background: var(--surface-2); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 264px; max-width: calc(100vw - 24px); display: grid; gap: 2px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.acct-menu a, .acct-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a[aria-current="page"] { background: var(--surface-2); }
.acct-menu .icon { width: 20px; height: 20px; color: var(--muted); }
.acct-menu form { margin: 0; }
.acct-user { margin: 6px 12px 4px; font-size: .8rem; color: var(--muted); }
.quick-nav { display: flex; gap: 8px; padding: 10px var(--gutter-r) 0 var(--gutter-l); overflow-x: auto; scrollbar-width: none; }
.quick-nav::-webkit-scrollbar { display: none; }
.quick-nav a { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 14px 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .88rem; text-decoration: none; }
.quick-nav a .icon { width: 18px; height: 18px; color: var(--accent); }
.quick-nav a[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
@media (min-width: 900px) {
  .quick-nav { display: none; }
  .app-top { justify-content: space-between; }
  .app-top-actions .icon-btn { display: inline-grid; }
  .top-nav { display: flex; gap: 4px; }
  .top-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; text-decoration: none; }
  .top-nav a:hover { background: var(--surface-2); color: var(--ink); }
  .top-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
  .top-nav .icon { width: 18px; height: 18px; }
}
.acct-menu a span, .acct-menu button span { white-space: nowrap; }
/* Desktop top bar: solid while the page scrolls underneath (it used to be see-through when it only held the help button). */
@media (min-width: 900px) {
  .app-top { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: 12px; padding-bottom: 12px; }
}
