/* IMB brand system, per CLAUDE_CODING.md — shared across index/assessment/admin. */
:root {
  --ink: #1B365D;
  --accent: #487A7B;
  --accent-light: rgba(72, 122, 123, 0.09);
  --muted: #707372;
  --prompt: #B2B4B2;
  --imb-red: #B83A4B;
  --imb-teal: #009681;
  --imb-orange: #E87722;
  --imb-yellow: #F3D54E;
  --ring-track: #E7E9EA;
  --bg: #FAFAF9;
  --card-bg: #FFFFFF;
  --border: #E2E4E3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: #222;
  font-family: 'Proform', 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, .brand-font {
  font-family: 'Azo Sans', 'Nunito Sans', sans-serif;
  color: var(--ink);
  margin: 0 0 0.5em;
}

a { color: var(--accent); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Wraps rather than overflows. Without this the header pushed every page 26-146px wider than
     a 390px phone, so the whole site scrolled sideways — on the device most of this audience
     will be holding. */
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

header.site-header img.logo { height: 32px; display: block; }

header.site-header .who {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

/* The signed-in name is the least load-bearing thing up here; let it give way first rather than
   push the controls off the screen. */
header.site-header .who > span {
  max-width: 38vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The picker and the back link travel together on the pages that have both. */
.header-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }

@media (max-width: 560px) {
  header.site-header { padding: 12px 16px; }
  header.site-header img.logo { height: 26px; }
  header.site-header .who { font-size: 13px; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { opacity: 0.9; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.google { background: #fff; color: #444; border: 1px solid var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input[type="text"], input[type="email"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
label { display: block; font-weight: 600; margin: 14px 0 6px; color: var(--ink); }

.progress-bar { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; background: var(--accent); transition: width .2s; }
.progress-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

.step-desc { color: var(--muted); margin-bottom: 20px; }

.question-block { margin-bottom: 28px; }
.question-text { font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
}
.option-btn:hover { border-color: var(--accent); }
.option-btn.selected { border-color: var(--accent); background: var(--accent-light); font-weight: 600; }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 24px; }

.score-ring-wrap { display: flex; justify-content: center; margin: 12px 0; }
.church-name { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: -8px; }
.level-tagline { text-align: center; color: var(--muted); margin-top: -8px; }

.level-strip { display: flex; gap: 6px; margin: 20px 0; }
.level-chip {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  background: var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.level-chip.active { background: var(--accent); color: #fff; }

.dim-bars { margin: 20px 0; }
.dim-bar { margin-bottom: 12px; }
.dim-bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.dim-bar-track { height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; position: relative; }
.dim-bar-fill { height: 100%; background: var(--accent); }
/* Spread of individual answers behind the church average, so a wide disagreement reads at a glance. */
.range-marker {
  position: absolute;
  top: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, rgba(27,54,93,.45) 0 3px, transparent 3px 6px);
  pointer-events: none;
}

.insight-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 560px) { .insight-cards { grid-template-columns: 1fr; } }
.insight-card { border-radius: 10px; padding: 16px; }
.insight-card.strength { background: rgba(0,150,129,0.08); }
.insight-card.priority { background: rgba(184,58,75,0.08); }
.insight-card ul { margin: 8px 0 0; padding-left: 20px; }

.ai-heading { margin-top: 28px; }
.ai-narrative h2 { font-size: 18px; margin-top: 18px; }
.ai-narrative h3 { font-size: 15px; }
.ai-narrative ul { padding-left: 20px; }
.ai-empty { color: var(--muted); font-style: italic; }
.spinner { color: var(--muted); font-size: 14px; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.admin-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.admin-table tr { cursor: pointer; }
table.admin-table tr:hover { background: var(--accent-light); }

/* Any class that sets `display` outranks the UA stylesheet's [hidden] rule, so el.hidden = true
   silently does nothing on, say, .saved-list-item. Everything here toggles visibility that way. */
[hidden] { display: none !important; }

/* Admin section tabs. The active one carries the accent underline, so which part you are in is
   readable at a glance rather than inferred from how far you have scrolled. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px; /* touch floor */
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--ink);
}
.tab-count {
  font-size: 12px;
  font-weight: 600;
  background: var(--border);
  color: var(--muted);
  border-radius: 10px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--ink); color: #fff; }

/* Sortable table headers */
.admin-table.sortable th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.admin-table.sortable th:hover { color: var(--ink); }
.sort-arrow { font-size: 10px; margin-left: 4px; }
.admin-table td { font-variant-numeric: tabular-nums; }

.saved-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.saved-list-item:last-child { border-bottom: none; }

.error-banner {
  background: rgba(184,58,75,0.1);
  color: var(--imb-red);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.back-link { display: inline-block; margin-bottom: 16px; }

.steps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
@media (max-width: 620px) { .steps-grid { grid-template-columns: 1fr; } }
.step-tile { display: flex; gap: 12px; padding: 14px; background: var(--accent-light); border-radius: 10px; }
.step-tile p { margin: 4px 0 0; font-size: 13.5px; }
.step-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.invite-code {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
  font-family: 'Azo Sans', 'Nunito Sans', sans-serif;
  margin: 8px 0 4px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.rank-row:last-child { border-bottom: none; }
.rank-row select { width: 72px; flex: 0 0 72px; }
.rank-row .rank-label { flex: 1; }
.rank-row.dupe select { border-color: var(--imb-red); background: rgba(184,58,75,.06); }

/* ── Action plan ── */
.plan-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 560px) { .plan-meta { grid-template-columns: 1fr; } }
.commit-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; font-weight: 600; color: var(--ink); }
.commit-toggle input { width: auto; }

@media (pointer: coarse) {
  /* Committing to a goal is the most consequential thing on the action plan, and it was a 13px
     checkbox. The whole label becomes the target, and the box itself grows to match. */
  .commit-toggle { min-height: 44px; padding: 4px 8px 4px 0; margin-left: 0; }
  .commit-toggle input[type='checkbox'] { width: 22px; height: 22px; min-height: 22px; }
  /* Header links are navigation, not prose — they need a thumb-sized target too. */
  .nav-link { display: inline-flex; align-items: center; min-height: 44px; }
}

.feedback-box { margin-top: 16px; padding: 16px; background: var(--accent-light); border-radius: 10px; }
.smart-chips { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.smart-chip { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.smart-letter {
  flex: 0 0 24px; height: 24px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 13px;
}
.smart-chip.met .smart-letter { background: var(--imb-teal); }
.smart-chip.partial .smart-letter { background: var(--imb-orange); }
.smart-chip.missing .smart-letter { background: var(--imb-red); }
.smart-note { padding-top: 3px; }

.faith-box { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.faith-safe { background: rgba(184,58,75,.1); }
.faith-stretching { background: rgba(232,119,34,.12); }
.faith-god-sized { background: rgba(0,150,129,.12); }

.rewrite-box {
  background: #fff; border-left: 3px solid var(--accent);
  padding: 10px 12px; border-radius: 6px; margin-top: 0;
}

/* ── Landing: explanation left, sign-in right ── */
.wrap-wide { max-width: 1140px; }

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}
.landing-explainer .card { margin-top: 20px; }
/* Sticky so the sign-in stays in reach while the reader scrolls all eight steps. */
.landing-cta { position: sticky; top: 20px; }

@media (max-width: 900px) {
  .landing-grid { grid-template-columns: 1fr; gap: 0; }
  .landing-cta { position: static; }
  /* Put the CTA above the explanation on narrow screens — otherwise signing in sits below
     eight step tiles' worth of scrolling. */
  .landing-cta { order: -1; }
}

/* ── Legal pages ── */
.legal { max-width: 760px; }
.legal h1 { margin-top: 32px; }
.legal h2 { margin-top: 32px; font-size: 20px; }
.legal .legal-lead { font-size: 17px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal-note { color: var(--muted); font-size: 13.5px; margin-top: 32px; font-style: italic; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 12px 0; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.legal-foot {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  background: #fff;
}
.legal-foot a { margin: 0 4px; }

/* ── Onboarding: join (left) and create (right) side by side ── */
.onboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.onboard-grid .card { margin: 20px 0; display: flex; flex-direction: column; }
/* Push the button to the bottom so the two cards' actions line up despite different copy lengths. */
.onboard-grid .onboard-action { margin-top: auto; padding-top: 12px; margin-bottom: 0; }
@media (max-width: 760px) {
  .onboard-grid { grid-template-columns: 1fr; gap: 0; }
  .onboard-grid .card { display: block; }
}

/* ── Landing hero ── */
.hero { margin: 20px 0 0; }
/* Capped and centred rather than full-bleed: at 2.7:1 the image would otherwise be ~420px tall
   across the full container and push the actual content below the fold. Side space is the
   cheaper trade. */
.hero img {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.nav-link { font-size: 14px; font-weight: 600; text-decoration: none; margin-right: 4px; }

.lang-picker { width: auto; padding: 6px 10px; font-size: 13px; max-width: 42vw; }

/* Touch devices get the 44px minimum the WCAG target-size guidance asks for. Scoped to coarse
   pointers so a mouse-driven desktop keeps its tighter, denser controls. */
@media (pointer: coarse) {
  .btn,
  .option-btn,
  .lang-picker,
  input[type='text'],
  select,
  textarea { min-height: 44px; }
  .btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Church dashboard ── */
.dash-head { margin: 20px 0 4px; }
.dash-head h1 { margin-bottom: 4px; }

/* Four things a leader arrives wanting: how ready are we, is this representative, what is
   working, what is next. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 16px 0 20px;
}
.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 0;
}
.stat-tile.strength { border-color: rgba(0, 150, 129, 0.35); background: rgba(0, 150, 129, 0.05); }
.stat-tile.focus { border-color: rgba(184, 58, 75, 0.35); background: rgba(184, 58, 75, 0.05); }
.stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-big { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.stat-num { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-num.strength { color: var(--imb-teal); }
.stat-num.focus { color: var(--imb-red); }
.stat-ring { display: flex; align-items: center; gap: 12px; }
.stat-ring svg { flex: none; }

/* The steps beside the reading of them, rather than stacked a screen apart. */
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 20px; }

.step-row { padding: 10px 0; }
.step-row + .step-row { border-top: 1px solid var(--border); }
.step-row-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 6px; }
.step-name { min-width: 0; }
.step-pct { flex: none; }
.step-row.focus .step-pct { color: var(--imb-red); }
.step-row.strength .step-pct { color: var(--imb-teal); }
.step-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }

.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }

.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag.strength { background: rgba(0, 150, 129, 0.12); color: #056e60; }
.tag.focus { background: rgba(184, 58, 75, 0.12); color: var(--imb-red); }
.tag.divided { background: rgba(232, 119, 34, 0.14); color: #8a4a10; }

/* Where individual answers actually fell, as two marks on the track rather than a hatched
   overlay competing with the bar it sits on. */
.tick {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 14px;
  background: rgba(27, 54, 93, 0.5);
  border-radius: 1px;
}

@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* Two up, and tighter. Four full-width tiles pushed the actual scores most of a screen down
     on a phone; the headline numbers should cost less than the thing they introduce. */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-tile { padding: 12px; }
  /* The two step names run long — they get the full width rather than wrapping to four lines. */
  .stat-tile.strength, .stat-tile.focus { grid-column: 1 / -1; }
  .stat-tile.strength, .stat-tile.focus { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .stat-tile.strength .stat-label, .stat-tile.focus .stat-label { width: 100%; margin-bottom: 4px; }
  .stat-num { font-size: 22px; margin-top: 0; }
  .stat-big { font-size: 15px; }
  .stat-ring { flex-direction: column; align-items: flex-start; gap: 6px; }
  .stat-ring svg { width: 84px; height: 84px; }
}

/* The analysis is shortened by hiding whole blocks (see clampToParagraphs), not by capping a
   height — so there is nothing to fade out and no half-sentence to hide. */
.ai-narrative .clamp-hidden { display: none; }

/* ── Action plan review: eight plans side by side, where the commitment is decided ── */
.review-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.review-row:last-child { border-bottom: none; }
.review-row.committed { background: var(--accent-light); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.review-body { min-width: 0; }
.review-text {
  font-size: 14px;
  color: var(--ink);
  margin: 4px 0 2px;
  /* Enough to recognise a plan by, not so much that eight of them stop fitting on one screen. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 560px) {
  .review-row { grid-template-columns: auto 1fr; }
  .review-row .btn { grid-column: 2; justify-self: start; }
}

/* Visually hidden but still read aloud — the checkbox needs a name even where the row supplies
   the visible context. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Assessment: telling someone where they are, and what is missing ── */
.answered-count { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.answered-count.complete { color: var(--accent); font-weight: 600; }
.answered-count.warn { color: var(--imb-red); font-weight: 600; }

/* Marks the question that is holding someone up, rather than leaving them to hunt for it. */
.question-block.needs-answer {
  border-left: 3px solid var(--imb-red);
  padding-left: 12px;
  margin-left: -15px;
}
[dir='rtl'] .question-block.needs-answer {
  border-left: none;
  border-right: 3px solid var(--imb-red);
  padding-left: 0;
  padding-right: 12px;
  margin-left: 0;
  margin-right: -15px;
}

/* Right-to-left: Arabic and Farsi. The layout is flex/grid throughout, which mirrors on its own;
   these are the places that had a hard-coded side. */
[dir='rtl'] .rank-row select { margin-left: 12px; margin-right: 0; }
[dir='rtl'] .smart-chip { flex-direction: row; }
[dir='rtl'] .rewrite-box { border-left: none; border-right: 3px solid var(--accent); }
[dir='rtl'] .nav-link { margin-right: 0; margin-left: 4px; }
[dir='rtl'] .legal ul, [dir='rtl'] .insight-card ul { padding-left: 0; padding-right: 22px; }

/* ── Charts ───────────────────────────────────────────────────────────────────
   HTML and CSS rather than SVG, so the type does not shrink with the container. Marks are the
   darkest thing in the frame; axis and track are recessive. */
.c-bars { margin-top: 4px; }
.c-bar-row { margin-bottom: 14px; }
.c-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 5px; }
.c-bar-label { font-size: 14px; color: var(--muted); }
.c-bar-label.strong { color: var(--ink); font-weight: 700; }
.c-bar-value { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.c-track { position: relative; height: 14px; background: var(--ring-track); border-radius: 3px; }
.c-fill {
  height: 100%;
  background: #487A7B;
  /* Square against the baseline, rounded at the growing end. */
  border-radius: 3px 4px 4px 3px;
  min-width: 3px;
}
/* Where the lowest and highest individual answers fell, so a flat average that hides a split
   opinion does not read as agreement. */
.c-tick {
  position: absolute; top: -3px; width: 2px; height: calc(100% + 6px);
  background: var(--ink); opacity: .45; border-radius: 1px;
}
.c-axis {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--prompt); margin-top: 2px; font-variant-numeric: tabular-nums;
}

.c-cols { display: flex; align-items: flex-end; gap: 8px; height: 190px; }
.c-col { flex: 1 1 0; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.c-col-value {
  text-align: center; font-size: 14px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; margin-bottom: 4px;
}
.c-col-plot { flex: 1 1 auto; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.c-col-fill { width: 100%; border-radius: 4px 4px 0 0; }
.c-col-label {
  text-align: center; font-size: 12px; color: var(--muted); margin-top: 7px;
  overflow-wrap: anywhere; line-height: 1.25;
}

.c-stack { display: flex; height: 26px; border-radius: 4px; overflow: hidden; gap: 2px; }
.c-stack-seg { flex-basis: 0; min-width: 3px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-item strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
@media (max-width: 720px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat-value {
  font-family: 'Azo Sans', 'Nunito Sans', sans-serif;
  font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-unit { font-size: 17px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--prompt); margin-top: 2px; }

.chart-card h3 { margin-bottom: 4px; }
.chart-note { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ── The person's own result, leading their dashboard ─────────────────────────
   Their score used to be a line of text below the account-deletion card. It is the thing they
   spent ten minutes producing, so it opens the page. */
.result-hero { padding-top: 20px; }
.result-context { text-align: center; margin-bottom: 4px; }
.result-context h1 { margin-bottom: 2px; }
.result-context p { margin: 0; font-size: 14px; }
.result-hero .score-ring-wrap { margin: 4px 0 0; }
.result-hero .level-tagline { margin-top: 4px; }
.welcome h1 { margin-bottom: 6px; }
.welcome p { max-width: 46ch; margin: 0 auto 18px; }

/* One card that answers "so what do I do now", instead of four buttons of equal weight
   scattered down the page with no guidance about which one matters. */
.next-card { border-color: var(--accent); }
.next-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Account admin and history: reachable, never competing with the task. Exporting your data and
   deleting your account are not peers of building an action plan. */
.quiet-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  padding: 0 18px;
  margin: 16px 0;
}
.quiet-block > summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.quiet-block > summary::-webkit-details-marker { display: none; }
.quiet-block > summary::before { content: '▸'; font-size: 11px; transition: transform .15s; }
.quiet-block[open] > summary::before { transform: rotate(90deg); }
.quiet-block > summary:hover { color: var(--ink); }
.quiet-block > *:last-child { margin-bottom: 16px; }

/* Search over a list — churches, people, anything. One component, so a search behaves the same
   way wherever it appears. */
.list-search { margin: 12px 0 4px; }
.list-search input[type="search"] {
  width: 100%;
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  min-height: 44px;
}
.list-search input[type="search"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.list-search-count { font-size: 13px; margin: 6px 0 0; min-height: 1em; font-variant-numeric: tabular-nums; }

/* Visible to screen readers only — the search fields are labelled without adding visual noise
   above an input whose placeholder already says what it does. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The shareable join link — the thing a leader actually sends to their church. */
.share-block { margin: 12px 0 4px; }
.share-block label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-row input {
  flex: 1 1 260px;
  min-width: 0;            /* a flex item will not shrink below its content without this */
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  min-height: 44px;
}
.share-row .btn { flex: 0 0 auto; }
.share-code { font-size: 13px; margin: 10px 0 0; }
.share-code strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; color: var(--ink); }

/* An inline copy affordance next to a code in a dense list. */
.link-btn {
  background: none; border: none; padding: 0 2px; font: inherit; font-size: 13px;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.link-btn:hover { color: var(--ink); }

/* Says which church a join link points at, before you sign in. */
.invited-badge {
  background: var(--accent-light);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  margin: 0 0 14px;
}

/* ── Follow-through on a commitment ──────────────────────────────────────────
   A date that slips gets amber and the word "open", never red and never "overdue". The point is
   to keep a church updating the plan honestly, not to grade it. */
.progress-row {
  margin-top: 12px; padding: 12px 14px;
  background: var(--accent-light); border-radius: 9px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
}
.progress-row.still-open { background: rgba(232,119,34,.10); }
.progress-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.progress-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.progress-choice {
  font-size: 13px; padding: 7px 12px; border-radius: 20px; cursor: pointer;
  background: var(--card-bg); border: 1px solid var(--border); color: var(--muted);
  display: inline-flex; align-items: center; min-height: 36px;
}
.progress-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.progress-choice.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.progress-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 1px; }
.progress-due { font-size: 12.5px; color: var(--muted); }
.progress-row.still-open .progress-due { color: var(--imb-orange); font-weight: 600; }
.progress-note {
  flex: 1 1 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-family: inherit; font-size: 14px; min-height: 40px;
}
.followthrough {
  background: var(--accent-light); border-radius: 9px; padding: 11px 15px;
  font-size: 14.5px; font-weight: 600; color: var(--ink); margin: 0 0 12px;
}

/* Then versus now: the only real evidence a consultation changed anything. */
.change-headline {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
  font-family: 'Azo Sans', 'Nunito Sans', sans-serif; font-size: 30px; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums; margin: 6px 0 2px;
}
.change-then { color: var(--muted); }
.change-arrow { color: var(--prompt); font-size: 22px; }
.change-delta { font-size: 17px; }
.change-headline.up .change-delta { color: var(--imb-teal); }
.change-headline.down .change-delta { color: var(--imb-orange); }
.change-headline.flat .change-delta { color: var(--muted); }
.change-steps { display: grid; gap: 6px; margin-top: 14px; }
.change-step {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  font-size: 14px; padding: 8px 12px; border-radius: 7px; background: var(--bg);
}
.change-step.up strong { color: var(--imb-teal); }
.change-step.down strong { color: var(--imb-orange); }
.change-step strong { font-variant-numeric: tabular-nums; }

/* Movement while the model is working. A static label during a ten-second wait reads as frozen. */
.thinking-line { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; min-height: 1.3em; }
.thinking-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 9px; vertical-align: 1px;
  animation: thinking-pulse 1.1s ease-in-out infinite;
}
@keyframes thinking-pulse {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
/* A long generation also gets a moving bar, so there is something to watch. */
.thinking-bar { height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 10px; }
.thinking-bar::after {
  content: ''; display: block; height: 100%; width: 35%; border-radius: 2px;
  background: var(--accent); animation: thinking-sweep 1.5s ease-in-out infinite;
}
@keyframes thinking-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}
@media (prefers-reduced-motion: reduce) {
  .thinking-dot, .thinking-bar::after { animation: none; }
  .thinking-dot { opacity: .8; }
  .thinking-bar::after { width: 100%; }
}

/* The model's suggested rewrite, editable in place. */
textarea.rewrite-box {
  width: 100%; padding: 10px 12px; border: 1px solid var(--accent);
  border-radius: 8px; font-family: inherit; font-size: 14.5px; line-height: 1.5;
  background: var(--card-bg); color: var(--ink); resize: vertical;
}
.rewrite-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 0; }

/* The needs ranking, shown on the consultation it was answered for. */
.need-list { display: grid; gap: 6px; margin-top: 10px; }
.need-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 12px; border-radius: 8px; background: var(--accent-light); font-size: 14.5px;
}
.need-rank {
  font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums;
  min-width: 1.2em; text-align: center;
}
