/* Echo — application styles. Every colour comes from tokens.css / tokens.dark.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-alt);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-6); }
.wrap--narrow { max-width: 780px; }

/* ---- Header and footer -------------------------------------------------- */
.app-header { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: var(--z-header); }
.app-header .wrap { display: flex; align-items: center; gap: var(--sp-4); min-height: 64px; }
.app-header .lockup { display: flex; color: var(--fg); text-decoration: none; }
.app-header .lockup svg { height: 30px; width: auto; display: block; }
.app-header .spacer { flex: 1; }
.app-header nav { display: flex; align-items: center; gap: var(--sp-2); }
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.lang-switch button { background: none; border: 0; padding: 6px 10px; font-size: var(--fs-xs); font-weight: var(--fw-demi); letter-spacing: 0.04em; cursor: pointer; color: var(--fg-muted); }
.lang-switch button[aria-pressed="true"] { background: var(--bg-inverse); color: var(--fg-inverse); }
.app-footer { margin-top: auto; padding: var(--sp-6) 0 var(--sp-7); font-size: var(--fs-xs); color: var(--fg-muted); }
main#view { flex: 1; padding: var(--sp-7) 0 var(--sp-8); }

/* ---- Type --------------------------------------------------------------- */
.rule { display: block; width: 64px; height: 3px; background: var(--accent); margin: 0 0 18px; border: 0; }
.eyebrow { font-size: var(--fs-eyebrow); font-weight: var(--fw-demi); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--fg-muted); margin: 0 0 var(--sp-3); }
h1, h2, h3, h4 { font-weight: var(--fw-demi); margin: 0; text-align: left; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-snug); max-width: 22ch; }
h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-snug); }
h3 { font-size: var(--fs-body-lg); line-height: 1.3; }
p { margin: 0 0 var(--sp-4); max-width: 65ch; }
.lead { font-size: var(--fs-body-lg); color: var(--fg-muted); margin-top: var(--sp-4); }
.muted { color: var(--fg-muted); }
.small { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--h-control); padding: 0 var(--sp-5);
  border: var(--border-w-base) solid var(--fg); border-radius: var(--radius-sm);
  background: transparent; color: var(--fg);
  font-size: var(--fs-sm); font-weight: var(--fw-demi); cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-press); border-color: var(--accent-press); color: var(--on-accent); }
.btn--ghost { border-color: transparent; color: var(--fg-muted); padding: 0 var(--sp-3); }
.btn--ghost:hover { background: var(--info-soft); color: var(--fg); }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--on-danger); }
.btn--sm { min-height: 34px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { min-height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-body); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn svg, .icon { width: 18px; height: 18px; flex: none; }
.icon-btn { background: none; border: 0; padding: 6px; color: var(--fg-muted); cursor: pointer; border-radius: var(--radius-sm); display: inline-flex; }
.icon-btn:hover { color: var(--fg); background: var(--info-soft); }
.icon-btn[disabled] { opacity: 0.3; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--fg); font-weight: var(--fw-demi); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.stack > * + * { margin-top: var(--sp-4); }

/* ---- Forms -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-xs); font-weight: var(--fw-demi); color: var(--fg-muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: var(--h-control); padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.field textarea, textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--fg); outline-offset: 0; border-color: var(--fg); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.check { display: flex; gap: var(--sp-2); align-items: flex-start; cursor: pointer; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--fg); }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { padding: 9px 14px; cursor: pointer; font-size: var(--fs-sm); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--bg-inverse); color: var(--fg-inverse); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: -2px; }
.form-error { color: var(--danger); font-size: var(--fs-sm); min-height: 1.4em; margin: 0; }

/* ---- Surfaces ----------------------------------------------------------- */
.card { background: var(--bg); padding: var(--sp-6); box-shadow: var(--shadow-sm); }
.card--featured { position: relative; }
.card--featured::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.card--flat { box-shadow: none; border: 1px solid var(--border); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-5); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-6); }
.section { margin-top: var(--sp-7); }
.section > h2 { margin-bottom: var(--sp-4); }
.empty { padding: var(--sp-7) var(--sp-6); text-align: left; color: var(--fg-muted); border: 1px dashed var(--border-strong); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: var(--fw-demi); padding: 2px 10px; border-radius: var(--radius-pill); white-space: nowrap; background: var(--info-soft); color: var(--fg); }
.badge--success { color: var(--success); background: var(--success-soft); }
.badge--warning { color: var(--warning); background: var(--warning-soft); }
.badge--danger { color: var(--danger); background: var(--danger-soft); }
.badge--inverse { color: var(--fg-inverse); background: var(--bg-inverse); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--fg-muted); }
.dot { width: 10px; height: 10px; display: inline-block; flex: none; }
.dot--client { background: var(--serie-3); }
.dot--agency { background: var(--serie-1); }

/* ---- Tabs --------------------------------------------------------------- */
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); margin: var(--sp-6) 0 var(--sp-6); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: var(--sp-3) 0; color: var(--fg-muted); text-decoration: none; font-weight: var(--fw-demi); font-size: var(--fs-sm); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a[aria-current="page"] { color: var(--fg); border-color: var(--fg); }
.tabs a[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* ---- Lists (facilitator) ------------------------------------------------ */
.retro-card { display: flex; flex-direction: column; gap: var(--sp-3); text-decoration: none; color: inherit; transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.retro-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.retro-card h3 { font-size: var(--fs-h4); line-height: 1.2; }
.meter { height: 6px; background: var(--info-soft); position: relative; }
.meter > i { position: absolute; inset: 0 auto 0 0; background: var(--fg); }
.meter--agency > i { background: var(--serie-1); }
.meter--client > i { background: var(--serie-3); }

.qlist { list-style: none; margin: 0; padding: 0; }
.qlist > li { display: grid; grid-template-columns: 32px 1fr auto; gap: var(--sp-3); align-items: start; padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.qlist > li.is-off { opacity: 0.5; }
.qlist .idx { font-size: var(--fs-xs); color: var(--fg-subtle); padding-top: 3px; font-variant-numeric: tabular-nums; }
.qlist .team { font-size: var(--fs-sm); color: var(--fg-muted); margin-top: 6px; }
.qlist .tools { display: flex; gap: 2px; align-items: center; }
.chapter-title { font-size: var(--fs-eyebrow); font-weight: var(--fw-demi); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--fg-muted); margin: var(--sp-6) 0 0; }

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-5); }
.person { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-3); padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.person .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.side-title { display: flex; align-items: center; gap: var(--sp-2); }

/* ---- Toast -------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); background: var(--bg-inverse); color: var(--fg-inverse); padding: 12px 18px; font-size: var(--fs-sm); z-index: var(--z-toast); box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }

/* ---- Echo sign ---------------------------------------------------------- */
.sign { display: block; color: var(--fg); }
.sign .frame { fill: currentColor; }
.sign .cell { transform-box: fill-box; transform-origin: center; transition: fill var(--dur-slow) var(--ease-out); }
.sign .cell.c-bg { fill: var(--bg); }
.sign .cell.c-mix { fill: color-mix(in srgb, var(--bg) 72%, currentColor); }
.sign .cell.c-red { fill: var(--pn-digital-red); }
.sign .cell.is-off { fill: currentColor; }

/* ---- Participant flow --------------------------------------------------- */
.flow { max-width: 780px; margin: 0 auto; padding: 0 var(--sp-6); }
.welcome { display: grid; grid-template-columns: 1fr; gap: var(--sp-6); }
.welcome .sign { width: 120px; height: 120px; }
.welcome h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.04; }
.promise { display: flex; gap: var(--sp-5); flex-wrap: wrap; margin: var(--sp-5) 0 0; padding: 0; list-style: none; color: var(--fg-muted); font-size: var(--fs-sm); }
.promise li { display: flex; gap: 8px; align-items: center; }

.topbar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.topbar .sign { width: 36px; height: 36px; }
.topbar .where { flex: 1; min-width: 0; }
.topbar .where b { display: block; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .where span { font-size: var(--fs-xs); color: var(--fg-muted); }
.progress { height: 3px; background: var(--border); margin-bottom: var(--sp-5); }
.progress > i { display: block; height: 100%; background: var(--fg); transition: width var(--dur-slow) var(--ease-out); }

.qcard { background: var(--bg); box-shadow: var(--shadow-sm); padding: var(--sp-7) var(--sp-7) var(--sp-6); min-height: 420px; display: flex; flex-direction: column; }
.qcard h2 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.16; max-width: 30ch; margin-bottom: var(--sp-6); }
.qcard .answer { flex: 1; }
.qnav { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.qnav .spacer { flex: 1; }
.kbd { font-size: 11px; color: var(--fg-subtle); }

.choices { display: grid; gap: var(--sp-2); }
.choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: var(--sp-4) var(--sp-2); min-height: 96px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.choice:hover { border-color: var(--fg); }
.choice[aria-pressed="true"] { background: var(--bg-inverse); color: var(--fg-inverse); border-color: var(--bg-inverse); }
.choice svg { width: 40px; height: 40px; stroke-width: 1.5; }
.choice .k { position: absolute; top: 6px; left: 8px; font-size: 11px; color: var(--fg-subtle); }
.choice[aria-pressed="true"] .k { color: var(--fg-inverse); opacity: 0.6; }
.faces { grid-template-columns: repeat(5, 1fr); }
.scale-ends { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: var(--fs-xs); color: var(--fg-muted); margin-top: var(--sp-2); }
.scale-ends span:last-child { text-align: right; }

.steps { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: var(--sp-5) 0; }
.steps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: var(--border-strong); }
.step { position: relative; justify-self: center; width: 44px; height: 44px; background: var(--bg); border: 2px solid var(--fg); border-radius: var(--radius-sm); cursor: pointer; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.step:hover { transform: scale(1.08); }
.step[aria-pressed="true"] { background: var(--bg-inverse); border-color: var(--bg-inverse); transform: scale(1.18); }
.slider-ends { display: flex; justify-content: space-between; gap: var(--sp-5); font-weight: var(--fw-demi); font-size: var(--fs-sm); }
.slider-ends span:last-child { text-align: right; }

.nps { grid-template-columns: repeat(11, 1fr); }
.nps .choice { min-height: 56px; padding: 0; font-weight: var(--fw-demi); font-size: var(--fs-body-lg); font-variant-numeric: tabular-nums; }

.tagset { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tag { padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg); cursor: pointer; font-size: var(--fs-sm); transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.tag:hover { border-color: var(--fg); }
.tag[aria-pressed="true"] { background: var(--bg-inverse); color: var(--fg-inverse); border-color: var(--bg-inverse); }
.tag[disabled] { opacity: 0.4; cursor: not-allowed; }

.comment-box { margin-top: var(--sp-5); }
.comment-box textarea { width: 100%; }

/* Square echo: a hairline square that expands and fades, from the clicked element. */
.echo-pulse { position: absolute; inset: -1px; border: 1.5px solid var(--fg); pointer-events: none; animation: echo-pulse 520ms var(--ease-out) forwards; }
@keyframes echo-pulse { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }

.recap { list-style: none; padding: 0; margin: 0; }
.recap li { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); align-items: center; }
.recap button.q { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: var(--fs-sm); color: var(--fg); }
.recap button.q:hover { text-decoration: underline; }
.recap .a { font-size: var(--fs-xs); color: var(--fg-muted); text-align: right; max-width: 220px; }

.done { display: grid; gap: var(--sp-5); }
.done .sign { width: 140px; height: 140px; }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.side-progress b { font-size: var(--fs-h4); font-variant-numeric: tabular-nums; }

/* ---- Echo view ---------------------------------------------------------- */
.echo-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--sp-6); align-items: stretch; }
.score-block { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 320px; }
.score { font-size: var(--fs-display-xl); line-height: 1; font-weight: var(--fw-demi); letter-spacing: var(--ls-tight); color: var(--accent); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.score small { font-size: var(--fs-h3); color: var(--fg-muted); letter-spacing: 0; }
.score-block .sign { width: 72px; height: 72px; position: relative; z-index: 1; }
.echo-field { position: absolute; left: var(--sp-6); top: var(--sp-6); width: 72px; height: 72px; pointer-events: none; }
.echo-field span { position: absolute; inset: 0; border: 1.5px solid var(--accent); opacity: 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.kpi { background: var(--bg); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
.kpi b { display: block; font-size: 36px; font-weight: var(--fw-demi); line-height: 1; letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi span { font-size: var(--fs-xs); color: var(--fg-muted); }
.kpi--wide { grid-column: 1 / -1; }
.legend { display: flex; gap: var(--sp-5); font-size: var(--fs-xs); color: var(--fg-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.hl-list { list-style: none; padding: 0; margin: 0; }
.hl-list li { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); display: grid; grid-template-columns: 1fr 120px; gap: var(--sp-3); align-items: center; }

.qrow { border-bottom: 1px solid var(--border); }
.qrow > button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 260px) 110px 20px; gap: var(--sp-4); align-items: center; padding: var(--sp-4) 0; background: none; border: 0; text-align: left; cursor: pointer; }
.qrow > button:hover .qt { text-decoration: underline; text-underline-offset: 3px; }
.qrow .qt { font-size: var(--fs-sm); }
.qrow .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.qrow .chev { transition: transform var(--dur-base) var(--ease-out); color: var(--fg-muted); }
.qrow.is-open .chev { transform: rotate(90deg); }
.qdetail { padding: 0 0 var(--sp-5); display: grid; gap: var(--sp-5); }
.qdetail .cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.team-text { font-size: var(--fs-sm); color: var(--fg-muted); border-left: 3px solid var(--border-strong); padding-left: var(--sp-3); }
.comments { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.comments li { padding: var(--sp-3) var(--sp-4); background: var(--bg-alt); font-size: var(--fs-sm); }
.comments li .who { display: flex; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--fg-muted); margin-bottom: 4px; }
.notes form { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.notes form input { flex: 1; }

.dumbbell { width: 100%; height: 28px; display: block; overflow: visible; }
.dumbbell .axis { stroke: var(--border-strong); stroke-width: 1; }
.dumbbell .tick { stroke: var(--border-strong); stroke-width: 1; }
.dumbbell .span { stroke: var(--fg-subtle); stroke-width: 2; }
.dumbbell .m-client { fill: var(--serie-3); }
.dumbbell .m-agency { fill: var(--serie-1); }
.dist { display: grid; gap: 4px; }
.dist .bar { display: grid; grid-template-columns: 26px 1fr 24px; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--fg-muted); }
.dist .bar i { display: block; height: 10px; background: var(--serie-3); }
.dist--agency .bar i { background: var(--serie-1); }
.dist .track { background: var(--info-soft); height: 10px; }

.actions-list { list-style: none; padding: 0; margin: 0; }
.actions-list li { display: grid; grid-template-columns: 24px 1fr auto auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.actions-list li.is-done .lbl { text-decoration: line-through; color: var(--fg-muted); }
.action-form { display: grid; grid-template-columns: 2fr 1fr 160px auto; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .echo-hero, .highlights { grid-template-columns: 1fr; }
  .qrow > button { grid-template-columns: minmax(0, 1fr) 96px 20px; }
  .qrow > button .chart { grid-column: 1 / -1; grid-row: 2; }
  .action-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap, .flow { padding: 0 var(--sp-4); }
  main#view { padding: var(--sp-5) 0 var(--sp-7); }
  h1 { font-size: 34px; }
  .qcard { padding: var(--sp-5) var(--sp-4); min-height: 0; }
  .choice { min-height: 72px; padding: var(--sp-3) 2px; }
  .choice svg { width: 32px; height: 32px; }
  .choice .k { display: none; }
  .nps { grid-template-columns: repeat(6, 1fr); }
  .step { width: 36px; height: 36px; }
  .qdetail .cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .score-block { min-height: 240px; }
  .hl-list li { grid-template-columns: 1fr; }
  .kbd, .qnav .kbd { display: none; }
  .app-header .lockup svg { height: 26px; }
}

/* ---- Print: the Echo as a deliverable ----------------------------------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: var(--pn-whitest-white); font-size: 10.5pt; }
  .app-header nav, .tabs, .no-print, .notes form, .action-form, .qrow .chev { display: none !important; }
  .app-header { position: static; border: 0; }
  .card, .kpi, .qcard { box-shadow: none; border: 1px solid var(--border); }
  .qdetail[hidden] { display: grid !important; }
  .qrow, .kpi, .hl-list li, .comments li { break-inside: avoid; }
  main#view { padding: 0; }
  .score { font-size: 64pt; }
}

/* ---- Auth --------------------------------------------------------------- */
.auth { display: grid; gap: var(--sp-4); }
.auth .sign { width: 88px; height: 88px; margin-bottom: var(--sp-3); }
.auth h1 { font-size: var(--fs-display-lg); line-height: 1; }
.auth-card { margin-top: var(--sp-5); }
.auth-card h2 { font-size: var(--fs-h4); margin-bottom: var(--sp-5); }
.dist .bar--tag { grid-template-columns: minmax(96px, 170px) 1fr 24px; }
.qlist > li.chapter-row { display: block; border-bottom: 0; padding: 0; }
.qlist > li.chapter-row .chapter-title { margin: var(--sp-5) 0 var(--sp-2); }
.qlist > li .row { margin-top: var(--sp-2); }
.welcome h1 { margin-bottom: 0; }
.retro-card .meter { margin-top: auto; }
@media (max-width: 640px) {
  .welcome { gap: var(--sp-4); }
  .welcome .sign, .done .sign { width: 64px; height: 64px; }
  .welcome h1 { font-size: 40px; }
  .lead { font-size: 17px; }
  .promise { gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); }
  .welcome .card { padding: var(--sp-5) var(--sp-4); }
}
.recap li { grid-template-columns: minmax(0, 1fr) minmax(90px, 38%); }
.sticky-cta { position: sticky; bottom: 0; padding: var(--sp-4) 0; background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: var(--sp-5); z-index: var(--z-sticky); }
@media (max-width: 640px) {
  .recap li { grid-template-columns: 1fr; gap: 4px; }
  .recap .a { text-align: left; max-width: none; }
  .sticky-cta .btn { width: 100%; }
}
.hl-list a { color: var(--fg); text-decoration: none; }
.hl-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.echo-sub h1 { font-size: var(--fs-h3); }
.h1-like { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.score-block .sign { margin-bottom: var(--sp-5); }
@media (max-width: 900px) {
  .qrow > button { grid-template-columns: minmax(0, 1fr) auto 20px; grid-template-areas: "t t c" "g b c"; row-gap: var(--sp-2); }
  .qrow .qtxt { grid-area: t; }
  .qrow > button .chart { grid-area: g; grid-column: auto; grid-row: auto; }
  .qrow .qbadge { grid-area: b; }
  .qrow .chev { grid-area: c; }
}
.hl-list li > .badge { justify-self: start; }

/* ---- Navigation, directory, admin ---------------------------------------- */
.nav-links { display: flex; gap: var(--sp-4); margin-right: var(--sp-3); }
.nav-link { color: var(--fg-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-demi); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--fg); }
.nav-link[aria-current="page"] { color: var(--fg); border-color: var(--accent); }
.input--grow { flex: 1; min-width: 200px; width: auto; }
.input--sm { min-height: 34px; padding: 4px 8px; width: auto; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.split h3 { margin-bottom: var(--sp-2); }
.split .qlist { max-height: 560px; overflow: auto; }
.icon-btn.is-on { color: var(--fg); }
.qlist > li.is-editing { display: block; }
.edit-slot { display: grid; gap: var(--sp-3); padding: var(--sp-3) 0; }
details.mid summary { cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-demi); padding: var(--sp-2) 0; }
details.mid[open] summary { margin-bottom: var(--sp-3); }
.people-list { list-style: none; margin: 0; padding: 0; }
.person-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.person-form { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 150px auto; gap: var(--sp-2); align-items: start; }
.person-form .form-error { grid-column: 1 / -1; }
.client-card .row svg { width: 20px; height: 20px; }
.client-card h2 { font-size: var(--fs-h4); }
.directory-block { padding: var(--sp-4); background: var(--bg-alt); margin: var(--sp-3) 0; display: grid; gap: var(--sp-3); }
.directory-block .eyebrow { margin: 0; }
.directory-block .tag { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; }
.directory-block .tag svg { width: 14px; height: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table td { padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.is-off td { opacity: 0.55; }
.link-code { font-family: var(--font-mono); font-size: var(--fs-xs); background: var(--bg-alt); padding: 8px 10px; word-break: break-all; flex: 1; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .person-form { grid-template-columns: 1fr 1fr; }
  .nav-user { display: none; }
}
@media (max-width: 640px) {
  .nav-links { gap: var(--sp-3); margin-right: 0; }
  .nav-link { font-size: var(--fs-xs); }
  .person-form { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-header .wrap { flex-wrap: wrap; row-gap: 0; }
  .app-header #nav { order: 3; flex-basis: 100%; justify-content: space-between; padding-bottom: var(--sp-2); }
  .app-header #nav:empty { display: none; }
}

/* ---- AI synthesis (charter "assist" role) -------------------------------- */
.badge--assist { color: var(--assist); background: var(--assist-soft); }
.ai-card { border-left: 3px solid var(--assist); }
.ai-card .overview { font-size: var(--fs-body-lg); line-height: 1.45; max-width: 70ch; }
.ai-card .cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.ai-card ul { margin: 0; padding-left: 1.1em; }
.ai-card li { margin: 4px 0; }
.ai-actions { list-style: none; padding: 0 !important; }
.ai-actions li { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.ai-reading { padding: var(--sp-3) var(--sp-4); background: var(--assist-soft); display: grid; gap: 6px; }
.ai-reading p { margin: 0; font-size: var(--fs-sm); }
@media (max-width: 640px) { .ai-card .cols { grid-template-columns: 1fr; } }
.ai-card .overview { margin-top: var(--sp-4); }

/* ---- Testimonials -------------------------------------------------------- */
.segmented--wrap { flex-wrap: wrap; }
.tm-quote { margin: 0; font-size: var(--fs-body-lg); line-height: 1.45; border-left: 3px solid var(--accent); padding-left: var(--sp-4); }
.tm-sig { margin: 0; font-weight: var(--fw-demi); font-size: var(--fs-sm); }
.testimonial { margin-top: var(--sp-6); }
