/* Monthly Check-in demo. Calm, mobile-first, no dependencies. */

:root {
  color-scheme: light;
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #F3F0E9;
  --border: #E6E1D6;
  --border-strong: #CEC7B8;
  --field-border: #8F8778; /* 3:1+ on surface and bg: form controls must be visible (WCAG 1.4.11) */
  --text: #1B211E;
  --muted: #5B645F;
  --accent: #1F6F5C;
  --accent-hover: #185C4C;
  --on-accent: #FFFFFF;
  --accent-soft: #E1EFE9;
  --ok: #2B6A3D;
  --ok-soft: #E2F0E4;
  --warn: #84550E;
  --warn-soft: #FAEDD4;
  --bad: #9A3445;
  --bad-soft: #F8E3E6;
  --info: #2C5684;
  --info-soft: #E3EBF5;
  --neutral: #5B645F;
  --neutral-soft: #EEEBE4;
  --bar-bg: rgba(255, 255, 255, 0.94);
  --demo-bg: #1E2824;
  --demo-text: #E3ECE8;
  --demo-tag: #A8D8C7;
  --toast-bg: #1B211E;
  --toast-text: #F7F5F0;
  --shadow: 0 1px 2px rgba(30, 35, 32, 0.04), 0 6px 20px -10px rgba(30, 35, 32, 0.10);
  --radius: 16px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;

  --tone-1-bg: #DCEDE6; --tone-1-fg: #1E5C4D;
  --tone-2-bg: #F4E7D3; --tone-2-fg: #77501C;
  --tone-3-bg: #DFE8F4; --tone-3-fg: #2C4F7E;
  --tone-4-bg: #F5E1E4; --tone-4-fg: #8A3343;
  --tone-5-bg: #EBE3F1; --tone-5-fg: #5C3E77;
  --tone-6-bg: #E5EBD6; --tone-6-fg: #4D5C24;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #131615;
    --surface: #1B1F1D;
    --surface-2: #232826;
    --border: #2D3330;
    --border-strong: #454D49;
    --field-border: #6E7772;
    --text: #E9EDEB;
    --muted: #A3ACA7;
    --accent: #5FBFA2;
    --accent-hover: #78CDB3;
    --on-accent: #0D1F19;
    --accent-soft: #1C3830;
    --ok: #8ACF9A;
    --ok-soft: #1D3324;
    --warn: #E6B865;
    --warn-soft: #382C16;
    --bad: #EF9DAA;
    --bad-soft: #3B2227;
    --info: #9BC1EA;
    --info-soft: #1D2B3B;
    --neutral: #A3ACA7;
    --neutral-soft: #272C2A;
    --bar-bg: rgba(27, 31, 29, 0.94);
    --demo-bg: #222B27;
    --demo-text: #D6E0DB;
    --demo-tag: #7FCDB4;
    --toast-bg: #E9EDEB;
    --toast-text: #131615;
    --shadow: none;

    --tone-1-bg: #1D3A32; --tone-1-fg: #8FD3BE;
    --tone-2-bg: #3A2F1E; --tone-2-fg: #E5C08A;
    --tone-3-bg: #1F2C3E; --tone-3-fg: #A9C6EC;
    --tone-4-bg: #3B2328; --tone-4-fg: #EFA9B5;
    --tone-5-bg: #2F2639; --tone-5-fg: #CDB3E6;
    --tone-6-bg: #2C3320; --tone-6-fg: #C3D394;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:has(body.has-bar) { scroll-padding-bottom: 150px; } /* keep focused fields above the sticky bar */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, ol, blockquote, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.u-text { overflow-wrap: anywhere; } /* user-entered text: never force horizontal scroll */

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.container.wide { max-width: 880px; }
.view { padding-top: 4px; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
body.has-bar .view { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---------- Demo bar ---------- */
.demo-bar { background: var(--demo-bg); color: var(--demo-text); font-size: 13px; }
.demo-inner { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.demo-tag {
  flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--demo-tag); border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; line-height: 18px;
}
.demo-note { flex: 1; min-width: 0; padding: 5px 0; line-height: 1.3; opacity: 0.92; }
.demo-link {
  position: relative; flex-shrink: 0; white-space: nowrap; color: var(--demo-text); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px;
}
.demo-x {
  position: relative; flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px;
  margin-right: -6px; border: 0; border-radius: 8px; background: transparent; color: var(--demo-text);
}
.demo-link::after, .demo-x::after { content: ""; position: absolute; inset: -8px; }
.demo-bar :focus-visible { outline-color: var(--demo-tag); }

/* ---------- Header ---------- */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; flex-shrink: 0;
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); text-decoration: none;
}
.hdr-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hdr-meta {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.demo-pill {
  position: relative; flex-shrink: 0; min-height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px dashed var(--border-strong); background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.demo-pill::after { content: ""; position: absolute; inset: -7px -4px; }

/* ---------- Type ---------- */
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
@media (min-width: 600px) { h1 { font-size: 32px; } }
.lead { margin-top: 8px; font-size: 17px; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
.section-title {
  margin: 32px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
}
.section-sub { margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.card-sub { margin-top: 2px; font-size: 14px; color: var(--muted); }
.sub-label { margin: 14px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sub-label:first-child { margin-top: 4px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
@media (min-width: 480px) { .card { padding: 20px 22px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 16px; font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary[aria-disabled="true"] { opacity: 0.5; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-danger { background: var(--bad); color: var(--surface); }
.btn-dashed { background: transparent; color: var(--accent); border: 1.5px dashed var(--border-strong); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 52px; font-size: 17px; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  border: 0; background: transparent; color: var(--accent); font-size: 15px; font-weight: 600; text-decoration: none;
}
.link-btn.danger { color: var(--bad); }
.link-btn.quiet { color: var(--muted); font-weight: 500; }
.icon-btn {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none;
}
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Chips, avatars, deltas ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 26px; padding: 2px 10px;
  border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-neutral .dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--tone-bg, var(--surface-2)); color: var(--tone-fg, var(--text));
}
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.tone-1 { --tone-bg: var(--tone-1-bg); --tone-fg: var(--tone-1-fg); }
.tone-2 { --tone-bg: var(--tone-2-bg); --tone-fg: var(--tone-2-fg); }
.tone-3 { --tone-bg: var(--tone-3-bg); --tone-fg: var(--tone-3-fg); }
.tone-4 { --tone-bg: var(--tone-4-bg); --tone-fg: var(--tone-4-fg); }
.tone-5 { --tone-bg: var(--tone-5-bg); --tone-fg: var(--tone-5-fg); }
.tone-6 { --tone-bg: var(--tone-6-bg); --tone-fg: var(--tone-6-fg); }
.tone-coach { --tone-bg: var(--accent); --tone-fg: var(--on-accent); }

.delta { font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down.strong { color: var(--bad); }
.delta-vs { font-weight: 500; color: var(--muted); }

/* ---------- Lists ---------- */
.list { padding: 0; overflow: hidden; }
.list > li + li { border-top: 1px solid var(--border); }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px;
  color: var(--text); text-decoration: none;
}
.list .row:focus-visible { outline-offset: -3px; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.row-sub { font-size: 14px; line-height: 1.35; color: var(--muted); }
.row-chev { display: none; color: var(--muted); }
@media (min-width: 400px) { .row-chev { display: block; } }
.coach-entry { padding: 12px 14px; }

.plain-list { padding: 4px 18px; }
@media (min-width: 480px) { .plain-list { padding: 4px 22px; } }
.plain-list > li { padding: 12px 0; }
.plain-list > li + li { border-top: 1px solid var(--border); }
.goal-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.goal-row-title { flex: 1 1 140px; min-width: 0; font-weight: 500; }
.bullet-li { display: flex; gap: 12px; align-items: baseline; }
.bullet-li::before {
  content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--accent); transform: translateY(-1px);
}

/* ---------- Start page ---------- */
.intro { padding-top: 12px; }
.tip {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font-size: 15px;
}
.tip svg { color: var(--accent); margin-top: 2px; }
.start-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.reset-area { margin-top: 28px; display: flex; justify-content: center; }
.confirm {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); text-align: center;
}
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }

/* ---------- Participant home ---------- */
.hello { padding-top: 8px; }
.hello h1 { font-size: 32px; }
.hello-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 15px; }
.hello-meta strong { color: var(--text); font-weight: 600; }
.checkin-card { margin-top: 20px; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-title { margin-top: 6px; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.checkin-card > p { margin-top: 6px; }
.checkin-card .btn { margin-top: 18px; }
.cc-meta { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px !important; font-size: 14px; color: var(--muted); }
.home-foot { display: flex; gap: 8px; align-items: flex-start; margin-top: 28px; font-size: 14px; color: var(--muted); }
.home-foot svg { margin-top: 3px; }
.mini-progress { margin-top: 12px; }
.mini-progress .progress { margin: 0 0 8px; }
.reply-card { margin-top: 12px; }
.reply-head { display: flex; align-items: center; gap: 10px; }
.reply-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.reply-date { font-size: 13px; color: var(--muted); }
.reply-text {
  margin-top: 12px; padding: 12px 14px; border-radius: 4px 14px 14px 14px;
  background: var(--accent-soft); white-space: pre-line;
}

/* ---------- Wizard ---------- */
.wiz-head { display: flex; align-items: center; gap: 8px; margin-left: -8px; }
.wiz-step { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; white-space: nowrap; }
.save-state.is-saved { color: var(--ok); }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 10px 0 14px; }
.progress span { height: 5px; border-radius: 3px; background: var(--border); transition: background-color 0.3s; }
.progress span.on { background: var(--accent); }
.wiz-body { margin-top: 18px; }
.wiz-body > * + * { margin-top: 12px; }

/* Rating scale */
.rate { position: relative; scroll-margin: 96px 0 160px; transition: box-shadow 0.2s; }
.rate legend { float: left; width: 100%; padding: 0 32px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.rate legend + * { clear: both; }
.rate-help { clear: both; padding-top: 2px; font-size: 14px; color: var(--muted); }
.rate-badge {
  position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.rate.needs { box-shadow: 0 0 0 2px var(--warn); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
@media (min-width: 600px) { .scale { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; } }
.scale-opt { position: relative; }
.scale label {
  position: relative; display: flex; align-items: center; justify-content: center; height: 48px;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; user-select: none;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.scale label.is-last::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--muted);
}
.scale input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.scale input:checked + label.is-last::after { background: var(--on-accent); }
.scale input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.rate-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.last-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }

/* Fields */
.field-label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.field-label.sm { margin: 14px 0 6px; font-size: 14px; }
.opt { font-weight: 500; color: var(--muted); }
.input {
  display: block; width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 16px; line-height: 1.45;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus { outline: 2px solid transparent; outline-offset: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
textarea.input { min-height: 96px; resize: none; overflow: hidden; }
textarea.input.oneline { min-height: 48px; } /* short answers that wrap instead of scrolling sideways */
.hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.hint.good { color: var(--ok); }

/* Segmented choices (goal status, outcomes) */
.seg { display: grid; gap: 6px; }
.seg-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 440px) { .seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-opt { position: relative; display: flex; }
.seg label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 48px; padding: 6px 8px;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; user-select: none;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.seg .ck { display: none; }
.seg input:checked + label { box-shadow: inset 0 0 0 1px currentColor; border-color: currentColor; }
.seg input:checked + label .ck { display: inline-flex; }
.seg input:checked + label.t-ok { background: var(--ok-soft); color: var(--ok); }
.seg input:checked + label.t-warn { background: var(--warn-soft); color: var(--warn); }
.seg input:checked + label.t-bad { background: var(--bad-soft); color: var(--bad); }
.seg input:checked + label.t-accent { background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Goals step */
.goal { scroll-margin: 96px 0 160px; }
.goal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: -6px 0 10px; }
.goal-title { padding-top: 9px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.goal-title.untitled { color: var(--muted); font-style: italic; }
.goal-head .link-btn { flex-shrink: 0; margin-right: -4px; }
.goal-edit { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.goal-last { margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.goal-edit .input { flex: 1; min-width: 0; }
.goal .link-btn.danger { margin: 8px 0 -10px -4px; }

/* Commitments step */
.commit-items { margin-top: 14px; }
.commit-item + .commit-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.commit-item legend { float: left; width: 100%; padding: 0; }
.commit-item legend + * { clear: both; }
.commit-text { margin-bottom: 10px; font-weight: 500; }
.commit-rows { margin-top: 14px; }
.commit-row { display: flex; align-items: flex-start; gap: 8px; }
.commit-row + .commit-row { margin-top: 10px; }
.commit-num { width: 20px; flex-shrink: 0; line-height: 48px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.commit-row .input { flex: 1; min-width: 0; }
.commit-row .icon-btn { margin: 2px -8px 0 0; color: var(--muted); }
.commit-add { margin: 8px 0 -8px 24px; }

/* Summary (review step, read-only view, coach) */
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -8px 0 6px; min-height: 44px; }
.sum-head .link-btn { margin-right: -4px; }
.kv > li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--border);
}
.kv > li:first-child { border-top: 0; }
.kv-val { display: inline-flex; align-items: baseline; gap: 10px; flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.of { font-weight: 500; color: var(--muted); font-size: 14px; }
.qa + .qa { margin-top: 16px; }
.q { font-size: 14px; font-weight: 600; color: var(--muted); }
.a { margin-top: 4px; white-space: pre-line; }
.a.is-blank { color: var(--muted); font-style: italic; }
blockquote.a { padding-left: 12px; border-left: 3px solid var(--accent-soft); }
.goal-list > li + li { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.goal-item-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.goal-item-title { flex: 1 1 140px; min-width: 0; font-weight: 500; }
.goal-item-note { margin-top: 4px; font-size: 14px; color: var(--muted); }
.outcome-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; }
.outcome-list > li + li { border-top: 1px solid var(--border); }
.outcome-list > li > span:first-child { flex: 1 1 140px; min-width: 0; }
.next-list { counter-reset: n; }
.next-list > li { counter-increment: n; display: flex; gap: 10px; padding: 6px 0; }
.next-list > li::before {
  content: counter(n); flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700;
}
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--info-soft); color: var(--info); font-size: 14px;
}
.note svg { margin-top: 1px; }

/* Bottom action bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bar-bg); border-top: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.bar-inner { max-width: 528px; margin: 0 auto; }
.bar-hint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; margin-bottom: 8px; font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; }
.bar-issue:not(:empty)::before { content: "·"; margin: 0 6px; }
body.typing .bar { display: none; } /* phone keyboard is up; see app.js */
.bar-actions { display: flex; gap: 10px; }
.bar-actions .btn-secondary { flex: 0 0 auto; min-width: 92px; }
.bar-actions .btn-primary { flex: 1; min-width: 0; }

/* Done screen */
.done { padding-top: 20px; text-align: center; }
.done-check {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 12px auto 20px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
}
.done .lead { margin-top: 6px; }
.done-facts { margin: 24px 0 14px; text-align: left; }
.done-facts .kv > li { padding: 10px 0; }
.done-note { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.demo-hint {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding: 12px 14px; text-align: left;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 14px; color: var(--muted);
}
.demo-hint strong { color: var(--text); }

/* ---------- Coach dashboard ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.month-arrows { display: flex; gap: 8px; }
.coach-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin-top: 10px; font-size: 15px; color: var(--muted); }
.coach-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.coach-summary > span { white-space: nowrap; }
.coach-summary .delta { margin-left: 2px; }
.section-title .count { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: 0.8; }
.pgrid { display: grid; gap: 10px; }
@media (min-width: 720px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pcard {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.pcard-link { flex: 1; display: block; padding: 14px 16px; color: var(--text); text-decoration: none; }
.pcard-link:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.pcard-top { display: flex; align-items: center; gap: 12px; }
.pcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; padding-left: 52px; font-size: 14px; color: var(--muted); }
.pcard-meta strong { color: var(--text); font-size: 16px; }
.pcard-actions { display: flex; gap: 8px; padding: 0 16px 14px; }
.pcard-actions .btn { flex: 1; }
@media (min-width: 400px) { .pcard-actions { padding-left: 68px; } .pcard-actions .btn { flex: 0 1 auto; } }
.flag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px;
  background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.empty { padding: 32px 20px; text-align: center; }
.empty-icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
}
.empty p { margin-top: 6px; }
.empty .btn, .empty .link-actions { margin-top: 18px; }

/* ---------- Coach review ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px; padding-right: 6px; font-weight: 600; text-decoration: none; }
.person-head { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.person-head h1 { font-size: 26px; }
.person-text { min-width: 0; }
.person-text p { font-size: 15px; }
.person-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 14px; font-size: 14px; }
.person-status .link-btn { margin-left: auto; }
.review-body { margin-top: 16px; }
.review-body > * + * { margin-top: 12px; }
.flag-banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); }
.flag-banner svg { margin-top: 2px; }
.flag-title { font-weight: 700; }
.flag-banner ul { margin-top: 2px; font-size: 14px; }
.flag-banner li::before { content: "· "; }
.rating-kv { margin-top: 8px; }
.rating-kv .nums { min-width: 4.2em; text-align: right; }
.rating-kv .was { font-weight: 500; color: var(--muted); }
.spark { display: block; width: 100%; max-width: 340px; height: auto; margin: 6px auto 0; overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark-base { stroke: var(--border); stroke-width: 1; }
.spark-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.spark-dot.is-current { fill: var(--accent); }
.spark-val { fill: var(--text); font: 700 13px var(--font); }
.spark-month { fill: var(--muted); font: 500 12px var(--font); }
.coach-action { scroll-margin: 24px; }
.coach-action .btn-primary { margin-top: 14px; }
.reviewed-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.reviewed-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; }
.coach-action .reply-text { margin-top: 10px; }
.link-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.prev-link { margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: var(--radius-sm); background: var(--toast-bg); color: var(--toast-text);
  font-size: 15px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-bar .toast { bottom: calc(136px + env(safe-area-inset-bottom)); }

/* ---------- Hover (mouse only, so taps don't leave sticky hover states) and press feedback ---------- */
@media (hover: hover) {
  .demo-x:hover { background: rgba(255, 255, 255, 0.1); }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-primary[aria-disabled="true"]:hover { background: var(--accent); }
  .btn-secondary:hover { border-color: var(--muted); }
  .btn-dashed:hover { border-color: var(--accent); }
  .link-btn:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .icon-btn:hover { border-color: var(--border-strong); }
  .icon-btn.ghost:hover { background: var(--surface-2); }
  .row:hover, .pcard-link:hover { background: var(--surface-2); }
  .scale label:hover { border-color: var(--accent); }
  .seg label:hover { border-color: var(--muted); }
}
.btn:active, .icon-btn:active, .link-btn:active { transform: translateY(1px); }
.btn-primary:active { background: var(--accent-hover); }
.btn-primary[aria-disabled="true"]:active { background: var(--accent); transform: none; }
.btn-secondary:active, .row:active, .pcard-link:active, .scale label:active, .seg label:active { background: var(--surface-2); }

/* ---------- Windows high contrast: selection must not rely on background color alone ---------- */
@media (forced-colors: active) {
  .scale input:checked + label, .seg input:checked + label {
    forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight;
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .view-enter { animation: enter 0.24s ease-out both; }
  .done-check { animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
}
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.noscript { padding: 24px 16px; text-align: center; }
