/* From Here — calm adult design. V3 reskin (2026-11-02): warm cream,
   deep green, soft sage — matching the founder's concept boards.
   Our screens, flow and behaviour are unchanged from V2; only the
   visual style moved. Sensory-friendly by default: no flashing, no
   autoplay, gentle transitions that are removed entirely when the
   user turns on Reduce motion. Light theme only. */

:root {
  --green: #2E5B45;        /* primary: buttons, active states */
  --green-deep: #24503A;   /* overlays, links, darker accents */
  --green-darkest: #1F4A36;/* focus outlines, picked-state borders */
  --heading: #14312A;      /* near-black green-teal — 12.96:1 on cream */
  --ink: #33473C;          /* body text — 9.24:1 on cream, 9.97:1 on white */
  --paper: #FAF6ED;        /* warm cream app background */
  --card: #ffffff;
  --line: #DDD6C2;
  --line-soft: #E7E1CE;
  --muted: #4E6355;        /* 6.01:1 on cream, 6.48:1 on white */
  --good: #21603B;
  --danger: #8A4633;       /* muted clay — never bright red */
  --danger-bg: #F6DFDA;
  --over: #96600F;         /* warm brown for the over-budget note — 4.90:1 on cream */
  --sage: #DCE8DC;
  --sage-mid: #A9C6AE;
  --sage-deep: #7FA98C;
  --blue-pale: #DCE9F2;
  --peach: #F5E3CE;
  --lavender: #E6E2F2;
  --rose: #F6DFDA;
  --radius: 22px;
  --radius-small: 14px;
  --parchment: #F3EEDF;
  --shadow: 0 2px 10px rgba(31, 74, 54, .08), 0 1px 3px rgba(31, 74, 54, .05);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 1.05rem;
}
html.large-text body { font-size: 1.3rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--green); color: #fff;
  padding: .6rem 1rem; z-index: 200; border-radius: 0 0 var(--radius-small) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green-darkest); outline-offset: 2px; }

.app-header {
  background: var(--paper); color: var(--ink);
  padding: 1rem 1.25rem .6rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  max-width: 760px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark { flex: none; display: block; }
.brand-name { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; color: var(--heading); }
.brand-sub { margin: 0; color: var(--green); font-size: 1rem; font-weight: 600; }
.privacy-line { margin: 0; font-size: .95rem; color: var(--muted); }

.header-side { display: flex; align-items: center; gap: .8rem; }
.icon-btn {
  font: inherit; cursor: pointer; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line-soft); color: var(--green-deep);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--green); }

/* V4 primary navigation: exactly three tabs, fixed to the bottom. */
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; background: #fff; border-top: 1px solid var(--line-soft);
  box-shadow: 0 -4px 16px rgba(31, 74, 54, .08);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-btn {
  flex: 1; font: inherit; cursor: pointer; background: transparent; border: none;
  color: var(--muted); font-weight: 700; font-size: .95rem;
  padding: .55rem .25rem .65rem;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  min-height: 58px;
}
.tab-btn:hover { background: var(--parchment); }
.tab-btn.is-active { color: var(--green); box-shadow: inset 0 3px 0 var(--green); }

main { max-width: 760px; margin: 0 auto; padding: 1rem 1.25rem 8.5rem; }

.view { display: none; }
.view.is-active { display: block; }

/* (V5: the flat SVG hills band is gone — replaced by the real painted
   hero art; see the V5 section at the end of this file.) */

.plan-line { margin: 0 0 .4rem; font-size: 1.1rem; font-weight: 600; color: var(--green-deep); }

/* Change banner on Today: appears only when a repair really changed
   something today. Pale blue, plain words, taps to the Change Explainer. */
.change-banner {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: .7rem;
  background: #DCE9F5; color: #274A63; border: 2px solid #B9D2EA;
  border-radius: var(--radius-small); padding: .75rem 1rem; margin: .6rem 0 .2rem;
  font-size: 1.05rem; font-weight: 700;
}
.change-banner:hover { background: #CFE0F2; }
.change-banner .change-banner-arrow { margin-left: auto; font-size: 1.4rem; font-weight: 800; }

/* Hub link rows (Repair tab, Toolkit tab). */
.hub-links { display: grid; gap: .6rem; margin: .6rem 0 1rem; }
.hub-btn {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  background: #fff; border: 2px solid var(--line-soft); border-radius: var(--radius-small);
  color: var(--ink); padding: .8rem 1rem; font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; gap: .7rem;
}
.hub-btn:hover { border-color: var(--green); }
.hub-btn .hub-sub { display: block; font-weight: 500; color: var(--muted); font-size: .95rem; }

h1 { font-size: 1.9rem; font-weight: 800; margin: .4rem 0 .6rem; color: var(--heading); }
h2 { font-size: 1.3rem; font-weight: 800; margin: 1.8rem 0 .6rem; color: var(--heading); }
.muted { color: var(--muted); }
.success { color: var(--good); font-weight: 600; }

.notice {
  background: #F8EFDB; border: 2px solid var(--sage-deep); border-radius: var(--radius);
  padding: .9rem 1.1rem; margin: 1rem 0; box-shadow: var(--shadow);
}

.energy-box {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.energy-message { margin: .3rem 0 .6rem; }
.energy-message.over { font-weight: 700; color: var(--over); }
.energy-bar { height: 16px; background: #EFE9D6; border-radius: 999px; overflow: hidden; }
.energy-fill { height: 100%; width: 0; background: var(--green); transition: width .3s ease; }
.energy-fill.over { background: var(--over); }

/* V5 timeline: the boards' vertical line + circular nodes. Columns:
   muted time label | rail (node on the line) | white card with a pastel
   icon chip. Node meaning is time-based only — see itemHtml in app.js. */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 18px; bottom: 18px;
  left: calc(4.3rem + .55rem + 11px); width: 2px;
  background: var(--line); border-radius: 2px;
}
.timeline li.tl-item {
  display: grid; grid-template-columns: 4.3rem 24px minmax(0, 1fr);
  column-gap: .55rem; align-items: start; margin-bottom: .75rem;
}
.timeline li:not(.tl-item) { margin: 0 0 .75rem calc(4.3rem + .55rem + 24px + .55rem); color: var(--muted); }
.tl-time { padding-top: 1.05rem; text-align: right; font-weight: 700; color: var(--muted); font-size: .95rem; white-space: nowrap; }
/* V6 (P2): bucket labels ("Afternoon") are wider than a clock time —
   a step smaller so they sit in the rail column without crowding. */
.tl-time.is-bucket { font-size: .82rem; padding-top: 1.18rem; }
.tl-rail { display: flex; justify-content: center; }
.tl-node {
  margin-top: 1rem; width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid var(--sage-deep); background: var(--paper); color: #fff;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; flex: none;
}
.tl-node.is-passed { background: var(--green); border-color: var(--green); }
.tl-node.is-next { border-color: var(--green); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 8px var(--green); }
.tl-card {
  display: flex; gap: .75rem; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 22px; padding: .85rem 1rem; box-shadow: var(--shadow); min-width: 0;
}
.tl-main { flex: 1; min-width: 0; }
.tl-item.protected .tl-card { border-color: var(--sage-mid); }
.tl-item.is-changed .tl-card { background: #EAF2F9; border-color: #B9D2EA; }
.item-top { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: baseline; }
.item-time { font-weight: 700; color: var(--green-deep); white-space: nowrap; }
.item-title { font-weight: 700; font-size: 1.12rem; color: var(--heading); }
.tag {
  font-size: .85rem; border: 1.5px solid var(--muted); color: var(--muted);
  border-radius: 999px; padding: .05rem .55rem;
}
.tag.protected-tag { border-color: var(--green); color: var(--green-deep); font-weight: 700; background: var(--sage); }
.item-meta, .item-notes, .item-firststep { margin: .3rem 0 0; font-size: .98rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

.card-form {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; display: grid; gap: .8rem; margin: 1rem 0; box-shadow: var(--shadow);
}
label { display: grid; gap: .3rem; font-weight: 600; }
label.check-label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
label.check-label input { margin-top: .3rem; width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--green); }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); display: grid; gap: .5rem; padding: .8rem 1rem; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--heading); }
input[type="text"], input[type="time"], input[type="number"], select, textarea {
  font: inherit; padding: .55rem .7rem; border: 2px solid #8FA396; border-radius: 12px;
  background: #fff; color: var(--ink); width: 100%;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--green); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  font: inherit; cursor: pointer; border-radius: 16px; padding: .55rem 1.05rem;
  border: 2px solid var(--green); background: #fff; color: var(--green-deep); font-weight: 600;
  display: inline-block; text-decoration: none;
}
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
/* Formerly the gold highlight button; in the boards' palette the
   standout action colour IS the deep green. */
.btn-gold { background: var(--green); border-color: var(--green-deep); color: #fff; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-small { padding: .3rem .7rem; font-size: .95rem; }
.btn-huge { font-size: 1.35rem; padding: 1rem 1.6rem; width: 100%; margin: .5rem 0; border-radius: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .6rem 0; }
.file-btn { cursor: pointer; }
.del-confirm { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.plain-list { padding-left: 1.3rem; }
.plain-list li { margin-bottom: .35rem; }

/* V5 repair choice rows, the boards' way: icon chip + item title on the
   left, the choice itself as a tinted pill dropdown on the right. The
   control is a native <select> (same options/defaults/values as the old
   radio group) — fully keyboard- and screen-reader-accessible. */
.choice-card {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .7rem; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; gap: .7rem .9rem; align-items: center;
}
.choice-head { display: flex; gap: .7rem; align-items: center; flex: 1 1 11rem; min-width: 0; }
.choice-head p { margin: 0; font-weight: 700; color: var(--heading); }
.choice-select-wrap { flex: 1 1 10.5rem; }
.choice-select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-weight: 700; color: var(--green-deep);
  background-color: #EDF3E4; border: 2px solid var(--sage-mid); border-radius: 999px;
  padding: .6rem 2.5rem .6rem 1rem; width: 100%; min-height: 50px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232E5B45' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.smallest-essential { font-weight: 500; }

.focus-view .focus-step { font-size: 2.4rem; line-height: 1.3; margin: 1.2rem 0; }
html.large-text .focus-view .focus-step { font-size: 2.9rem; }
.timer-box { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; max-width: 420px; box-shadow: var(--shadow); }
.timer-display { font-size: 1.6rem; font-weight: 700; margin: 0 0 .5rem; color: var(--heading); }

.script-output {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1rem 1.1rem; white-space: pre-wrap; min-height: 4rem; margin: 1rem 0; font-size: 1.08rem; box-shadow: var(--shadow);
}
.script-output:empty::before { content: "Your script will appear here."; color: var(--muted); }

.readlive-text { font-size: 1.7rem; line-height: 1.6; white-space: pre-wrap; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.2rem; margin: 1rem 0; box-shadow: var(--shadow); }
html.large-text .readlive-text { font-size: 2rem; }

.checkin-question { font-size: 2rem; font-weight: 800; color: var(--heading); margin: 1.4rem 0 .6rem; }
.checkin-log-entry { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.checkin-log-entry p { margin: .15rem 0; }

.calm-now-btn {
  position: fixed; right: 1rem; bottom: 84px; z-index: 100;
  font: inherit; font-size: 1.25rem; font-weight: 800; cursor: pointer;
  background: var(--green); color: var(--paper); border: 3px solid var(--green-deep);
  border-radius: 999px; padding: 1rem 1.7rem;
  box-shadow: 0 6px 20px rgba(31, 74, 54, .35);
}
.calm-overlay {
  position: fixed; inset: 0; z-index: 120; overflow-y: auto;
  background: var(--green-deep); color: var(--paper); padding: 1.5rem 1.25rem 3rem;
}
.calm-overlay h1 { color: var(--paper); }
.calm-overlay .calm-block {
  background: #fff; color: var(--ink); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.calm-overlay .calm-block h2 { margin-top: 0; }
.calm-overlay .calm-block p, .calm-overlay .calm-block li { font-size: 1.2rem; }
/* Recalculating moment: one line, big, centred, nothing else competing.
   Deliberately NO animation property anywhere in these rules — the moment
   is a still pause. (The global reduce-motion rules strip animation and
   transition everywhere anyway, and app.js swaps the timer for a manual
   "Show my new day" tap when Reduce motion is on.) */
.recalc-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.recalc-overlay[hidden] { display: none; }
.recalc-text { font-size: 2.2rem; line-height: 1.3; margin: 0 0 1.5rem; }
html.large-text .recalc-text { font-size: 2.6rem; }
.words-overlay { background: var(--paper); color: var(--ink); }
.words-display { font-size: 2.6rem; font-weight: 700; line-height: 1.35; margin: 2rem 0; color: var(--heading); }
html.large-text .words-display { font-size: 3.1rem; }

.danger-zone { border: 2px solid var(--danger); background: #FFF9F5; border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.5rem 0; }

.app-footer { background: #E7EEE0; color: var(--green-deep); padding: 1rem 1.25rem; text-align: center; }
.app-footer p { margin: 0; }

a { color: var(--green-deep); }
a:hover { color: var(--green); }

/* ---------- V2 additions ---------- */

/* Display modes (phase 1): calm / direct / independent.
   Calm = fewer words (extra explanation hidden), bigger spacing.
   Direct = short labels (long explanations hidden, short headings shown).
   Independent = full planner view + home today-summary (JS shows it). */
html[data-mode="calm"] .mode-short { display: none; }
html[data-mode="calm"] main { line-height: 1.75; }
html[data-mode="calm"] .feeling-grid, html[data-mode="calm"] .choice-grid { gap: 1rem; }
html[data-mode="calm"] .btn-huge, html[data-mode="direct"] .btn-huge { margin: .7rem 0; }
html[data-mode="direct"] .mode-extra { display: none; }
html[data-mode="calm"] .mode-extra { display: none; }
html[data-mode="independent"] .mode-short { display: none; }

.feeling-grid, .choice-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1rem 0;
}
@media (max-width: 480px) { .feeling-grid, .choice-grid { grid-template-columns: 1fr; } }
.feeling-btn, .state-btn {
  font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer;
  color: var(--heading);
  border: 2.5px solid var(--sage-mid); border-radius: var(--radius);
  padding: 1rem .8rem; min-height: 3.6rem; text-align: center;
}
/* Pastel tile tints, cycling calmly through the boards' colours. */
.feeling-grid .feeling-btn:nth-child(5n+1), .choice-grid .state-btn:nth-child(5n+1) { background: var(--sage); }
.feeling-grid .feeling-btn:nth-child(5n+2), .choice-grid .state-btn:nth-child(5n+2) { background: var(--blue-pale); }
.feeling-grid .feeling-btn:nth-child(5n+3), .choice-grid .state-btn:nth-child(5n+3) { background: var(--peach); }
.feeling-grid .feeling-btn:nth-child(5n+4), .choice-grid .state-btn:nth-child(5n+4) { background: var(--lavender); }
.feeling-grid .feeling-btn:nth-child(5n+5), .choice-grid .state-btn:nth-child(5n+5) { background: var(--rose); }
/* Picked state. Selector carries the grid class on purpose: the pastel
   nth-child tint rules above are more specific than a bare two-class
   selector, so a plain .is-picked rule lost the background while still
   winning the text colour — white on pale blue, unreadable (founder
   screenshot 2026-11-02). This selector ties the tints and comes later,
   so the picked tile goes fully green with cream text. */
.feeling-grid .feeling-btn.is-picked, .choice-grid .state-btn.is-picked {
  background: var(--green); color: var(--paper); border-color: var(--green-darkest);
  box-shadow: inset 0 0 0 2px var(--paper);
}

.btn-mega {
  font-size: 1.5rem; font-weight: 800; width: 100%;
  padding: 1.3rem 1rem; margin: 1.2rem 0 .6rem; border-radius: var(--radius);
}
.home-secondary { display: grid; gap: .2rem; }
.btn-col { display: grid; gap: .5rem; margin: .6rem 0; }
.btn-col .btn { width: 100%; text-align: center; }
.btn-col a.btn { text-align: center; }
.btn-col label { margin-top: .4rem; }

.home-promise { font-size: 1.25rem; font-weight: 700; color: var(--heading); text-align: center; margin: 1.6rem 0 .2rem; }
.no-fail-footer {
  text-align: center; font-weight: 700; color: var(--green);
  font-size: 1.1rem; margin: .4rem 0 0; letter-spacing: .01em;
}

.repair-step { margin-bottom: 1rem; }

/* ---------- V6 (2026-11-02): review-package additions ---------- */

/* P6: the same escape footer at the foot of every repair step. */
.step-footer {
  display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem;
  padding-top: .9rem; border-top: 2px solid var(--line-soft);
}

/* P1: staged explainer — stage sections + the stage nav row. The
   text button is deliberately quiet: it is always there, never loud. */
.stage-nav { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0 .4rem; }
.btn-text {
  font: inherit; cursor: pointer; background: none; border: none;
  color: var(--green-deep); font-weight: 700; text-decoration: underline;
  padding: .55rem .4rem;
}
.explainer-stage h3 { font-size: 1.12rem; font-weight: 800; color: var(--heading); margin: 1.3rem 0 .5rem; }

/* Item form: the one inline note ("Give it a name first"). */
.form-note { color: var(--over); font-weight: 700; margin: 0; }

/* No-phone-number note (Help view + phrase view). */
.no-phone-note {
  background: #F8EFDB; border: 2px solid var(--sage-deep); border-radius: var(--radius-small);
  padding: .7rem .95rem; margin: .8rem 0; font-weight: 600;
}

/* P3: Repair Kit as cards. The form itself is no longer one big card;
   each category is its own white card with its own header. */
.kit-form { display: grid; gap: 0; margin: 0; }
.kit-card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1rem 1.15rem; margin: 1rem 0; box-shadow: var(--shadow);
  display: grid; gap: .8rem;
}
.kit-card h2 { margin: 0; }
.kit-card > form { display: grid; gap: .8rem; }
.kit-count { margin: 1rem 0 0; }
.kit-count p { margin: .25rem 0; }
#kit-count-line { font-weight: 700; color: var(--green-deep); font-size: 1.08rem; }

/* P4: Calm Now first screen. The one action reads big; "More of my
   calm plan" is a quiet disclosure on the deep-green overlay. */
.calm-first-action-text { font-size: 1.45rem; font-weight: 700; line-height: 1.35; }
.calm-quiet { color: var(--paper); opacity: .85; font-size: 1.05rem; margin: .4rem 0; }
#calm-more { margin-top: 1.4rem; }
#calm-more summary { color: var(--paper); font-size: 1.15rem; padding: .8rem 0; }
#calm-more .calm-block h2 { color: var(--heading); }
.regulate-option, .problem-option, .helped-option {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: 1.1rem; font-weight: 600; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--sage-mid); border-radius: var(--radius);
  padding: .9rem 1rem; margin-bottom: .55rem; box-shadow: var(--shadow);
}
.regulate-option .opt-source, .problem-option .opt-source {
  display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: .15rem;
}
.regulate-option.is-picked, .problem-option.is-picked, .helped-option.is-picked {
  background: var(--green); color: #fff;
}
.regulate-option.is-picked .opt-source, .problem-option.is-picked .opt-source { color: #EAF0E4; }
.finish-opt.is-picked { background: var(--green); color: #fff; }

.phrase-board { display: grid; gap: .6rem; margin: 1rem 0; }
.phrase-btn {
  font: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer;
  background: var(--card); color: var(--heading); text-align: left;
  border: 2.5px solid var(--sage-mid); border-radius: var(--radius);
  padding: 1.05rem 1.1rem; min-height: 3.8rem; width: 100%;
}
.phrase-board .phrase-btn:nth-child(5n+1) { background: var(--sage); }
.phrase-board .phrase-btn:nth-child(5n+2) { background: var(--blue-pale); }
.phrase-board .phrase-btn:nth-child(5n+3) { background: var(--peach); }
.phrase-board .phrase-btn:nth-child(5n+4) { background: var(--lavender); }
.phrase-board .phrase-btn:nth-child(5n+5) { background: var(--rose); }
.phrase-btn .pin-mark { color: var(--green-deep); font-size: .9rem; display: block; font-weight: 600; }
.phrase-custom-row {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: .6rem .9rem; margin-bottom: .5rem; box-shadow: var(--shadow);
}
.phrase-custom-row span { flex: 1 1 12rem; font-weight: 600; }

.focus-now-label { font-size: 1.1rem; font-weight: 700; color: var(--muted); margin: 1rem 0 0; }

details { margin: .8rem 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--green-deep); padding: .5rem 0; }

.person-row {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: .8rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
.person-row p { margin: .2rem 0; }

.pattern-row {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: .7rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
#patterns-log .pattern-row:nth-child(4n+2) { background: #F3F7FA; }
#patterns-log .pattern-row:nth-child(4n+3) { background: #FBF4E6; }
#patterns-log .pattern-row:nth-child(4n+4) { background: #F6F3FA; }
.pattern-row p { margin: .15rem 0; }
.count-line { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border-bottom: 1px solid var(--line-soft); }
.count-line:last-child { border-bottom: none; }

/* ---------- V4 additions ---------- */

/* Pale button ("Help me communicate" on Today, boards' pale style). */
.btn-pale { background: var(--sage); border-color: var(--sage-mid); color: var(--green-deep); }

.mode-btn-row { display: grid; gap: .2rem; margin: .4rem 0; }

/* The footer clears the fixed tab bar. */
.app-footer { margin-bottom: 72px; }

/* Phrase board tiles: icon chip + label (content unchanged from v2). */
.phrase-btn { display: flex; align-items: center; gap: .8rem; }
.phrase-icon {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .65); color: var(--green-deep);
  display: inline-flex; align-items: center; justify-content: center;
}
.phrase-label { flex: 1; }

/* Patterns as sentences: plain-language cards from the person's own data. */
.pattern-sentence {
  background: var(--card); border: 1px solid var(--line-soft);
  border-left: 8px solid var(--green);
  border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .6rem;
  font-size: 1.15rem; font-weight: 600; box-shadow: var(--shadow);
}
.pattern-sentence-empty { border-left-color: var(--sage-mid); font-weight: 500; color: var(--muted); }

/* Share Support: toggle rows. Settings only choose what a SEND includes. */
.share-support { margin-top: 1.2rem; }
.share-control-copy {
  background: var(--sage); border-radius: var(--radius-small);
  padding: .8rem 1rem; font-size: 1.05rem; color: var(--green-deep);
}
.toggle-row {
  display: flex; align-items: center; gap: 1rem; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: .8rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
.toggle-text { flex: 1; }
.toggle-text strong { display: block; font-size: 1.08rem; color: var(--heading); }
.toggle-text .toggle-sub { display: block; font-weight: 500; color: var(--muted); font-size: .95rem; }
.switch { position: relative; flex: none; width: 56px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #D8D2C4; transition: background .15s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(31, 74, 54, .3);
  transition: left .15s ease;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { left: 28px; }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--green); outline-offset: 2px; }

/* First-run set-up overlay. */
.onboarding-overlay {
  /* Fully opaque: --paper is solid cream. (This used to reference an
     undefined variable, which made the overlay transparent — founder
     screenshot 2026-11-02: page text ghosting through, unreadable.)
     z-index sits above the Calm Now button (100) and tab bar so
     nothing floats over the set-up flow. */
  position: fixed; inset: 0; z-index: 130; overflow-y: auto;
  background: var(--paper); padding: 1.2rem 1rem 6rem;
  overscroll-behavior: contain;
}
.ob-step { max-width: 560px; margin: 0 auto; }
.ob-progress { display: flex; gap: .5rem; justify-content: center; margin: .6rem 0 1.4rem; }
.ob-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--sage-mid); }
.ob-dot.is-on { background: var(--green); }
.ob-leaf { display: block; margin: .4rem auto .8rem; }
.ob-sub { font-size: 1.2rem; font-weight: 600; color: var(--green-deep); margin: .2rem 0 1rem; }
.ob-name-label { display: grid; gap: .4rem; font-weight: 700; color: var(--heading); font-size: 1.15rem; margin: 1rem 0 .4rem; }
#ob-mode-options { display: grid; gap: .7rem; margin: 1rem 0; }
.ob-mode-option {
  font: inherit; cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: .9rem;
  background: var(--card); border: 2.5px solid var(--sage-mid); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.ob-mode-option .ob-mode-label { flex: 1; font-size: 1.25rem; font-weight: 800; color: var(--heading); }
.ob-mode-option .ob-mode-arrow { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
.ob-mode-icon { color: var(--green-deep); display: inline-flex; }
.ob-mode-option.is-picked { border-color: var(--green); background: var(--sage); box-shadow: inset 0 0 0 2px var(--green); }
.ob-skip { background: #fff; }
.ob-reset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; }
.ob-reset-tile {
  font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  background: var(--card); color: var(--heading);
  border: 2.5px solid var(--sage-mid); border-radius: var(--radius);
  padding: 1rem .6rem; min-height: 6.2rem; box-shadow: var(--shadow);
}
.ob-reset-tile .ob-tile-icon { color: var(--green-deep); display: inline-flex; }
.ob-reset-tile.is-picked { background: var(--green); color: #fff; border-color: var(--green-darkest); }
.ob-reset-tile.is-picked .ob-tile-icon { color: #fff; }


/* Display style (V4): the onboarding choice, backed by the same settings.
   Words only  -> decorative icons and art hidden (short labels carry it).
   Pictures first -> icon-forward: bigger tiles and buttons, icons larger.
   Icons here are the app's own simple drawings — never a symbol set. */
html[data-style="words-only"] .decor-icon { display: none; }
html[data-style="words-only"] .hills-band { display: none; }
html[data-style="words-only"] .brand-mark { display: none; }
html[data-style="words-only"] .phrase-icon { display: none; }
html[data-style="words-only"] .ob-mode-icon, html[data-style="words-only"] .ob-tile-icon { display: none; }
html[data-style="words-only"] .tab-btn svg { display: none; }
html[data-style="words-only"] .change-banner svg { display: none; }

html[data-style="pictures-first"] .phrase-btn { min-height: 6rem; font-size: 1.3rem; padding: 1.3rem 1.1rem; }
html[data-style="pictures-first"] .phrase-icon { width: 62px; height: 62px; }
html[data-style="pictures-first"] .phrase-icon svg { width: 36px; height: 36px; }
html[data-style="pictures-first"] .feeling-btn, html[data-style="pictures-first"] .state-btn { min-height: 5rem; font-size: 1.25rem; }
html[data-style="pictures-first"] .ob-reset-tile { min-height: 7.5rem; }
html[data-style="pictures-first"] .btn { padding: 1rem 1.4rem; }
html[data-style="pictures-first"] .tab-btn { font-size: 1.02rem; }
html[data-style="pictures-first"] .tab-btn svg { width: 30px; height: 30px; }

/* ================================================================
   V5 PREMIUM FIDELITY (2026-11-02) — real art, real icons, board polish.
   Structure, flow, wording and behaviour are V4's; this layer is craft.
   Contrast rules held throughout: text never sits on the art (it sits
   on cards/cream, or on the deep-green overlays); pastel tints sit
   behind dark-green icon strokes only (icons are decorative).
   ================================================================ */

/* The one icon system: sprite glyphs drawn at a single stroke weight. */
svg.ic {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}

/* Pastel circular icon chips (the boards' signature element). */
.ic-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  color: var(--green-deep); flex: none;
}
.tint-0 { background: var(--sage); }
.tint-1 { background: var(--blue-pale); }
.tint-2 { background: var(--peach); }
.tint-3 { background: var(--lavender); }
.tint-4 { background: var(--rose); }
.h-ic { width: 42px; height: 42px; vertical-align: middle; margin-right: .35rem; }
.row-ic { width: 44px; height: 44px; }

/* --- Real art: home header + greeting card (board 1, screen 3) --- */
.hero-wrap {
  position: relative; border-radius: 24px; overflow: hidden;
  height: 172px; margin: .2rem 0 0;
}
.hero-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(to bottom, rgba(250, 246, 237, 0), var(--paper));
}
.hero-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.greeting-card {
  position: relative; z-index: 2;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 24px;
  box-shadow: var(--shadow); padding: 1rem 1.2rem .9rem; margin: -2.4rem .15rem .4rem;
}
.greeting-card h1 { margin: 0 0 .15rem; }
.greeting-card .muted { margin: 0; }

/* --- Real art: onboarding welcome band (board 1, screen 1) --- */
.ob-art {
  display: block; width: 100%; height: 150px; object-fit: cover;
  object-position: center 60%; border-radius: 20px; margin: .4rem 0 .9rem;
}

/* --- Real art: slim strip on the repaired-day view (board 2, screen 2) --- */
.art-strip {
  height: 96px; border-radius: 20px; margin: 0 0 1rem; box-shadow: var(--shadow);
  background: url('assets/hero-hills.webp') center 68% / cover no-repeat;
}

/* --- Recalculating: a whisper of the hills at the bottom of the deep
       green, masked so it fades in — text contrast untouched (the text
       sits far above it, on the solid green). Calm, or nothing. --- */
.recalc-overlay { overflow: hidden; }
.recalc-overlay::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: url('assets/hero-hills.webp') center bottom / cover no-repeat;
  opacity: .22; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 55%);
  mask-image: linear-gradient(to bottom, transparent, #000 55%);
}
.recalc-overlay > * { position: relative; z-index: 1; }

/* --- Buttons: the boards' feel — tall primaries, soft shadow --- */
.btn-primary, .btn-gold {
  min-height: 54px; display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; text-align: center;
  box-shadow: 0 6px 16px rgba(31, 74, 54, .16);
}
.btn-huge { border-radius: 18px; }

/* --- Hub rows (Repair / Toolkit tabs) as board-style cards --- */
.hub-links .btn {
  display: flex; align-items: center; gap: .7rem; text-align: left;
  background: #fff; border: 2px solid var(--line-soft); border-radius: var(--radius);
  padding: .85rem 1rem; color: var(--ink); box-shadow: var(--shadow); min-height: 54px;
}
.hub-links .btn .ic { color: var(--green); }
.hub-links .btn.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.hub-links .btn.btn-primary .ic { color: #fff; }

/* --- Repaired-day explainer: numbered rows, number in a tinted circle
       (board 2, screen 2). CSS counters — the line text is unchanged. --- */
#repair-result .plain-list { list-style: none; padding-left: 0; counter-reset: rr; }
#repair-result .plain-list li {
  counter-increment: rr; position: relative;
  padding-left: 3rem; margin-bottom: .6rem; min-height: 2.2rem;
}
#repair-result .plain-list li::before {
  content: counter(rr); position: absolute; left: 0; top: -.2rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--sage); color: var(--green-deep); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
#repair-result .plain-list li:nth-child(5n+2)::before { background: var(--blue-pale); }
#repair-result .plain-list li:nth-child(5n+3)::before { background: var(--peach); }
#repair-result .plain-list li:nth-child(5n+4)::before { background: var(--lavender); }
#repair-result .plain-list li:nth-child(5n)::before { background: var(--rose); }

/* --- Focus screen ("Right now"), board 2 screen 3 composition --- */
.focus-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-top: .2rem; }
.back-link {
  font: inherit; font-weight: 700; color: var(--green-deep);
  background: none; border: none; cursor: pointer; padding: .35rem 0;
  font-size: 1.05rem; text-align: left;
}
.focus-progress { color: var(--muted); font-weight: 600; margin: .45rem 0 0; text-align: right; max-width: 55%; }
.focus-now-big { font-size: 2.6rem; margin: .5rem 0 .2rem; }
.focus-art { display: flex; justify-content: center; margin: .4rem 0 .2rem; }
.focus-art img { width: min(320px, 80vw); height: auto; border-radius: 28px; display: block; }
.focus-view .focus-step { font-size: 1.9rem; margin: .5rem 0 1rem; }
#view-startfocus .btn-col .btn { min-height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
#focus-stuck-btn { background: var(--blue-pale); border-color: #A9C3D6; color: #274A63; }

/* --- Patterns: private line + sentence rows with icon circles --- */
.private-line { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--green-deep); margin: .2rem 0 .4rem; }
.pattern-sentence { display: flex; gap: .8rem; align-items: center; }
.ps-ic { width: 42px; height: 42px; }

/* --- Safe people rows: icon chip + content --- */
.person-row { display: flex; gap: .8rem; align-items: flex-start; }
.person-main { flex: 1; min-width: 0; }

/* --- Share rows: icon chip, text flexes --- */
.toggle-row .toggle-text { flex: 1; }

/* --- Check-labels (smallest good version): icon chip after checkbox --- */
label.check-label .ic-chip { width: 40px; height: 40px; align-self: center; }

/* --- Display styles: words-only hides ALL art and chips too --- */
html[data-style="words-only"] .hero-wrap,
html[data-style="words-only"] .ob-art,
html[data-style="words-only"] .art-strip,
html[data-style="words-only"] .focus-art,
html[data-style="words-only"] .ic-chip { display: none; }

/* --- Display styles: pictures-first enlarges the icon system --- */
html[data-style="pictures-first"] .ic-chip { width: 58px; height: 58px; }
html[data-style="pictures-first"] .ic-chip svg { width: 32px; height: 32px; }
html[data-style="pictures-first"] .hub-links .btn .ic { width: 28px; height: 28px; }
