:root {
  color-scheme: light;
  --brand: #008C73;
  --brand-ink: #fff;
  --ink: #111C22;
  --muted: #5A6B74;
  --line: #E3E8EB;
  --bg: #F5F7F6;
  --card: #fff;
  --gold: #C89741;
  --help: #B4233C;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 28, 34, .05), 0 6px 20px rgba(17, 28, 34, .06);
  --safe-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.fine { font-size: .82rem; color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* --- top bar ----------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; flex: 1 1 auto; overflow: hidden; }
.brand img { height: 34px; width: auto; max-width: 46%; object-fit: contain; object-position: left center; display: block; }
.brand img:only-child { max-width: 100%; }
.brand.solo img { height: 68px; } /* a partner's own logo alone: twice the size (Brian, 10/10, CCA) */
@media (max-width: 400px) { .brand img { height: 28px; } .brand.solo img { height: 56px; } .help-btn { padding: 8px 12px; font-size: .85rem; } }
.brand .plus { color: #9AA7AE; font-size: .9rem; }
.brand .with { font-size: .7rem; color: var(--muted); line-height: 1.1; }
.help-btn {
  flex: none; border: 0; border-radius: 999px; padding: 9px 14px; font: 600 .9rem Inter, sans-serif;
  background: var(--help); color: #fff; cursor: pointer;
}
.help-btn:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid #F2B84B; outline-offset: 2px; }

/* --- layout ------------------------------------------------------------ */
.view { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(96px + var(--safe-b)); outline: none; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.tint { background: color-mix(in srgb, var(--brand) 7%, #fff); box-shadow: none; border: 1px solid color-mix(in srgb, var(--brand) 18%, #fff); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, #fff); padding: 3px 10px; border-radius: 99px; margin-bottom: 10px;
}

/* --- buttons and forms --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px;
  border-radius: 12px; border: 1px solid transparent; font: 600 1rem Inter, sans-serif; text-decoration: none; cursor: pointer;
  background: #EEF2F1; color: var(--ink);
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-help { background: var(--help); color: #fff; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
label.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
label.field span.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], textarea, select {
  width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid #CBD5DA; border-radius: 12px;
  font: 400 1rem Inter, sans-serif; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235B6B73' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center; }
select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin-bottom: 10px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.error { color: var(--help); font-size: .9rem; margin: 6px 0 10px; }

/* --- welcome ------------------------------------------------------------ */
.hero { text-align: center; padding: 8px 0 4px; }
.hero .logos { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 6px 0 18px; }
.hero .logos img { height: 56px; width: auto; }
.hero h1 { font-size: 1.75rem; }
.hero .wheel { max-width: 360px; margin: 6px auto 4px; display: block; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 18px; }
.pills span { font-size: .8rem; padding: 4px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line); }

/* --- check-in ------------------------------------------------------------ */
.progress { height: 6px; background: #E4EAE8; border-radius: 99px; overflow: hidden; margin: 2px 0 18px; }
.progress > i { display: block; height: 100%; background: var(--brand); transition: width .25s; }
.q-area { font-weight: 600; font-size: .85rem; }
.q-text { font-size: 1.35rem; font-weight: 600; line-height: 1.3; margin: 8px 0 22px; min-height: 3.5em; }
.scale { display: grid; gap: 10px; }
.scale button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; min-height: 54px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; font: 500 1rem Inter, sans-serif; color: var(--ink); cursor: pointer;
}
.scale button .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B8C4C9; flex: none; }
.scale button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, #fff); }
.scale button.on .dot { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  flex: 1 1 0; min-width: 52px; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
  font: 600 .85rem Inter, sans-serif; color: var(--ink); cursor: pointer; padding: 6px 4px;
}
.chips button .e { display: block; font-size: 1.35rem; line-height: 1.2; }
.chips button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); }

/* --- wheel + scores ------------------------------------------------------ */
.wheel { width: 100%; height: auto; display: block; }
.wheel .wl { font: 600 14px Inter, sans-serif; fill: #3B4A52; }
.wheel .ws { font: 700 12px Inter, sans-serif; fill: var(--ink); }
.wheel .wc { font: 700 24px Inter, sans-serif; fill: var(--ink); }
.card > .wheel { max-width: 340px; margin: 0 auto 8px; }
.wheel a .wedge path, .wheel a path { cursor: pointer; }
.scores { list-style: none; padding: 0; margin: 0; }
.scores li { padding: 10px 0; border-top: 1px solid var(--line); }
.scores li:first-child { border-top: 0; }
.scores a { color: inherit; text-decoration: none; display: block; }
.scores .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.scores .top span:last-child { white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: #EDF1F0; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.tag { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag.t-thriving { background: #E3F4EC; color: #1C6E48; }
.tag.t-steady { background: #FFF4DC; color: #7A5300; }
.tag.t-needs { background: #FDE8EA; color: #9C1F33; }

/* --- action items + resources --------------------------------------------- */
.action { border-left: 4px solid var(--c, var(--brand)); }
.action .area { font-size: .78rem; font-weight: 600; color: var(--c, var(--brand)); text-transform: uppercase; letter-spacing: .04em; }
.res { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.res:first-of-type { border-top: 0; }
.res .ic {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 10%, #fff); font-size: 1.1rem; overflow: hidden;
}
.res .ic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.res b { display: block; font-size: .98rem; }
.res small { color: var(--muted); display: block; font-size: .85rem; line-height: 1.35; margin-top: 2px; }
.res .meta { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.article p, .article li { font-size: 1.02rem; line-height: 1.6; }
.article ul { padding-left: 1.2rem; }
.disclosure { font-size: .8rem; color: var(--muted); background: #F4F6F5; border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.back { display: block; margin-bottom: 12px; font-weight: 600; text-decoration: none; }

/* --- guide ---------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.45; }
.bubble.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: #fff; box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.bubble.typing { color: var(--muted); font-style: italic; }
.composer {
  position: sticky; bottom: calc(68px + var(--safe-b)); display: flex; gap: 8px; background: var(--bg); padding: 8px 0;
}
.composer textarea { min-height: 48px; max-height: 140px; margin: 0; }
.notice { font-size: .82rem; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }

/* --- help ----------------------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(17, 28, 34, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + var(--safe-b));
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.icon-btn { border: 0; background: #E7ECEA; width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.danger-line { background: #FDE8EA; color: #7A1426; border-radius: 12px; padding: 10px 12px; }
.danger-line a { color: #7A1426; font-weight: 700; }
.help-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.help-card.featured { border: 2px solid var(--help); }
.help-card h3 { margin-bottom: 4px; }
.help-card p { color: var(--muted); font-size: .92rem; }
.help-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.help-actions .btn { min-height: 42px; padding: 8px 14px; font-size: .95rem; }
.help-inline { background: #FFF6F7; border: 1px solid #F3C6CE; border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }

/* --- tabs ----------------------------------------------------------------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .72rem; font-weight: 600; color: #7A8890; text-decoration: none; padding: 4px 0; }
.tabs a .ti { font-size: 1.25rem; line-height: 1.2; }
.tabs a.on { color: var(--brand); }

/* --- misc ----------------------------------------------------------------- */
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 12px 0; border-top: 1px solid var(--line); }
.list-plain li:first-child { border-top: 0; }
.streak { font-weight: 700; color: var(--gold); }
/* Trend charts (History, area pages): one 0-10 axis, recessive grid, 2px line. */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .pt { cursor: pointer; }
.chart .tip { position: absolute; top: -6px; right: 0; background: var(--ink); color: #fff; font-size: .78rem; padding: 3px 8px; border-radius: 8px; pointer-events: none; }
.chart.mini svg { height: 64px; }
.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px; margin: 4px 0 14px; }
.seg a { flex: 1; text-align: center; padding: 6px 0; border-radius: 99px; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--brand); color: var(--brand-ink); }
.multiples { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.multiples .card { margin: 0; padding: 12px; color: inherit; text-decoration: none; border-top: 3px solid var(--c); min-width: 0; }
.multiples .card b { font-size: .82rem; line-height: 1.25; }
.day-row { color: inherit; text-decoration: none; gap: 8px; padding: 4px 0; }
.chip { font-size: .74rem; font-weight: 600; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; white-space: nowrap; }
.message { position: relative; border-left: 4px solid var(--brand); }
.message h3 { margin: 0 28px 4px 0; }
.message .dismiss { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.note-form textarea { min-height: 72px; margin-top: 6px; }
.tabs a { position: relative; }
.tabs a.due::after { content: ""; position: absolute; top: 2px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--help); box-shadow: 0 0 0 2px #fff; }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .92rem; max-width: 90vw;
}
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* Daily Wellness Wheel (wheel.js spinner) */
.spinner { max-width: 320px; margin: 4px auto 0; }
.spin-wheel { overflow: visible; }
.spin-wheel .spin-label { font-size: 12px; pointer-events: none; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3.5px; stroke-linejoin: round; }
.spin-wheel .band { fill-opacity: .16; cursor: pointer; outline: none; stroke: #fff; stroke-width: 1.2; transition: fill-opacity .2s; }
.spin-wheel .band:hover, .spin-wheel .wedge.on .band { fill-opacity: .3; }
.spin-wheel .band:focus-visible { fill-opacity: .45; stroke: var(--ink); stroke-width: 2; }
.spin-wheel .fill { cursor: pointer; }
.spin-wheel .pointer { fill: var(--ink); }
.spin-ask { text-align: center; margin: 10px 0 8px; }
.spin-ask h3 { margin: 0; }
.spin-ask .fine { margin: 2px 0 0; }
.ring-key { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 2px 0 0; }
.ring-key span { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.ring-key i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.guide-links { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.guide-links .btn { text-align: left; }
.wbi-card .wbi-logo { display: block; height: 40px; width: auto; margin: 8px 0 4px; }
.wbi-card h3 { margin: 6px 0 4px; }
.wbi-mark { height: 16px; width: auto; vertical-align: -3px; margin-right: 6px; }
#roleForm select { flex: 1; margin: 0; }
body.typing .tabs { display: none; }

/* Resources tab */
.res-filters { display: grid; gap: 8px; }
.res-filters input[type=search] { margin: 0; }
.res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.res-row select { margin: 0; min-width: 0; font-size: .92rem; }

/* Add to Home Screen sheet (app.js offerInstall). Opens just below the top bar, which stays on top so Get
   Help Now is one tap away, and scrolls inside itself. Safari's floating toolbar covers the bottom of the
   screen on iOS 26+, so the end of the sheet has room to scroll clear of it (Brian's iPhone, 10/26). */
.install-backdrop { z-index: 45; align-items: flex-start; padding-top: var(--topbar-h, 0px); }
@media (min-width: 640px) { .install-backdrop { align-items: flex-start; } }
.install-sheet { max-height: 100%; border-radius: 0 0 20px 20px; padding-bottom: calc(96px + var(--safe-b)); overscroll-behavior: contain; }
body.install-open .topbar { z-index: 46; }
.install-sheet h2 { margin: 0; padding-right: 8px; }
.install-sheet .sheet-head { align-items: flex-start; margin-bottom: 6px; }
.home-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 76px; }
.why { display: flex; gap: 14px; align-items: flex-start; margin: 6px 0 10px; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: .92rem; line-height: 1.3; }
.perks li { display: flex; gap: 8px; align-items: flex-start; }
.perks svg { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-tile img { width: 64px; height: 64px; border-radius: 15px; box-shadow: var(--shadow); }
.home-tile small { font-size: .72rem; color: var(--ink); max-width: 76px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--shadow); font-size: .95rem; line-height: 1.35; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
/* Safari's buttons drawn inline in the sentence, in grey, so they read as "look for this", not "tap here". */
.steps .glyph { display: inline-block; vertical-align: -4px; color: var(--muted); }
.steps svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-later { display: block; margin: 12px auto 0; color: var(--muted); }
