/* The Portolan survey demo. Portolan's deck palette, Open Sans, flat colour only (no gradients).
   Motion: CSS only; calm under prefers-reduced-motion. Nothing moves when something opens. */

@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/open-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/open-sans-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/open-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/open-sans-latin-700-normal.woff2) format("woff2"); }

:root {
  --slate: #3D3E5B; --grey: #595959; --blue: #0070C0; --navy: #003778; --bright: #0094FF; --cyan: #12E2E2;
  --mist: #F1F6FB; --ice: #DCEBFA; --hair: #D9E1EA; --hair2: #CBCBCB; --night: #100F18; --voice: #22233A;
  --voice-2: #2D2E4A; --voice-line: #4A4C6E; --ramp: #8DBFE8; --white: #FFFFFF; --warn: #8A4B00;
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* A steady gutter stops desktop pages shifting when a scrollbar appears; touch screens overlay theirs. */
@media (pointer: fine) { html { scrollbar-gutter: stable; } }
body { margin: 0; font: 400 16px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--grey); background: var(--mist); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[aria-disabled="true"], button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--bright); outline-offset: 2px; border-radius: 6px; }
h1:focus, h2:focus, [data-autofocus]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
code { font: 600 .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--ice); color: var(--navy); padding: 1px 5px; border-radius: 4px; }
.muted { color: #6B6B6B; }
.fine { font-size: 13px; color: #6B6B6B; margin: 10px 0 0; }

/* ---------- backdrop: the rhumb-line network ---------- */
.rhumbs { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.rh { stroke: #D9E1EA; stroke-width: .6; opacity: .7; }
.rh-main { stroke: #C9D7E6; stroke-width: 1; opacity: .8; fill: none; }

.app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; }
.accent-rule { display: flex; height: 5px; flex: none; }
.accent-rule i { flex: 1; }
.accent-rule i:nth-child(1) { background: var(--bright); }
.accent-rule i:nth-child(2) { background: var(--cyan); }
.accent-rule i:nth-child(3) { background: var(--navy); }

/* ---------- topbar + lockup ---------- */
.topbar { height: calc(64px + env(safe-area-inset-top)); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: env(safe-area-inset-top) max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left)); max-width: 1260px; width: 100%; margin: 0 auto; }
.lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lockup-text { display: flex; flex-direction: column; min-width: 0; }
.lockup-name { font: 700 12px/1.25 "Open Sans", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); white-space: nowrap; }
.lockup-sub { font-size: 13px; font-style: italic; color: var(--grey); white-space: nowrap; }
@media (max-width: 480px) { .in-survey .lockup-sub { display: none; } .in-survey .lockup-name { font-size: 0; letter-spacing: 0; } .in-survey .lockup-name::after { content: "Portolan"; font-size: 12px; letter-spacing: .14em; } }

/* ---------- Type / Talk switch ---------- */
.mode-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--white); border: 1.5px solid var(--hair); border-radius: 999px; padding: 3px; flex: none; }
.mode-switch button { position: relative; z-index: 1; border: 0; background: none; width: 72px; height: 34px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--slate); transition: color .2s var(--ease); }
.mode-switch button[aria-pressed="true"] { color: var(--white); }
.mode-switch button[aria-disabled="true"] { color: #9A9A9A; }
.ms-thumb { position: absolute; z-index: 0; top: 3px; left: 3px; width: 72px; height: 34px; border-radius: 999px; background: var(--navy); transition: transform .32s var(--ease-out), background .2s; }
.mode-switch.is-talk .ms-thumb { transform: translateX(72px); background: var(--voice); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .12s; }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-primary[aria-disabled="true"], .btn-primary:disabled { background: #9DB1C7; }
.btn-primary.is-skip { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn-primary.is-skip:hover { background: var(--ice); }
.btn-ghost { background: var(--white); color: var(--slate); border-color: var(--hair); }
.btn-ghost:hover { border-color: var(--ramp); }
.btn-ghost:disabled { color: #9A9A9A; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--ice); }
.btn-ghost-dark { background: transparent; color: #fff; border-color: var(--voice-line); }
.btn-ghost-dark:hover { border-color: var(--ramp); }
.link-btn { border: 0; background: none; padding: 6px 2px; color: var(--blue); font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.link-btn:hover { text-decoration-color: currentColor; }
.icon-btn { border: 0; background: var(--mist); width: 36px; height: 36px; border-radius: 999px; font-size: 22px; line-height: 1; color: var(--slate); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--slate); background: var(--ice); border-radius: 999px; padding: 3px 10px; letter-spacing: .01em; }
.badge-sample { background: #FFF3DC; color: var(--warn); }
.badge-sample::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-warn { background: #FFF3DC; color: var(--warn); }

/* ---------- type ---------- */
.kicker { font: 700 12px/1.3 "Open Sans", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.kicker-dark { color: var(--ramp); }
.title { font-weight: 400; font-size: clamp(26px, 3.6vw, 34px); line-height: 1.2; color: var(--slate); margin: 0 0 14px; letter-spacing: -.005em; text-wrap: balance; }
.title-xl { font-size: clamp(34px, 5.6vw, 54px); line-height: 1.1; letter-spacing: -.015em; }
.lede { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; margin: 0 0 18px; max-width: 54ch; text-wrap: pretty; }
.mini-label { font: 700 11px/1.3 "Open Sans", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0 0 10px; }

/* ---------- screens + transitions ---------- */
.stage { position: relative; flex: 1; width: 100%; max-width: 1260px; margin: 0 auto; padding: 8px max(var(--pad), env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left)); }
.stage-inner { min-width: 0; }
/* The screen-enter slide (28 px) mustn't widen the page: Android Chrome would zoom out to fit it and stay there. */
.stage { overflow-x: clip; overflow-clip-margin: 8px; }
.enter-fwd { animation: inFwd .26s var(--ease-out) both; }
.enter-back { animation: inBack .26s var(--ease-out) both; }
@keyframes inFwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes inBack { from { opacity: 0; transform: translateX(-28px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.screen { max-width: 760px; margin: 0 auto; padding: 18px 0 24px; }
.screen-narrow { max-width: 580px; }
.loading { height: 50vh; }

/* ---------- landing ---------- */
.screen-landing { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 5vw, 72px); align-items: center; min-height: calc(100dvh - 140px); padding-top: 0; }
.screen-landing .lockup { margin-bottom: 6px; }
.lf-line { margin: 0 0 clamp(18px, 4vh, 40px); font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--grey); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.facts li { font-size: 14px; font-weight: 600; color: var(--slate); background: var(--white); border: 1px solid var(--hair); border-radius: 999px; padding: 5px 12px; }
.actions-start { margin-top: 32px; gap: 18px; }
.landing-art { position: relative; min-height: 460px; }
.landing-rose { position: absolute; top: -10px; right: 0; }
.landing-card { position: absolute; left: 0; bottom: 30px; width: min(100%, 400px); background: var(--white); border: 1px solid var(--hair); border-radius: 18px; padding: 22px 24px; animation: rise .6s .55s var(--ease-out) both; }
.lc-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.lc-title { margin: 0 0 6px; font-size: 21px; line-height: 1.3; color: var(--slate); }
.lc-text { margin: 0; font-size: 14px; }
.resume-note { font-size: 14px; color: var(--slate); font-weight: 600; align-self: center; }
@media (max-width: 880px) {
  .screen-landing { grid-template-columns: 1fr; min-height: 0; padding-top: 12px; }
  .landing-art { min-height: 0; }
  .landing-rose { display: none; }
  .landing-card { position: relative; width: 100%; bottom: 0; }
  .lf-line { margin-bottom: 28px; }
}

/* ---------- compass rose ---------- */
.rose { display: block; flex: none; overflow: visible; }
.rose-draw .rose-ring { stroke-dasharray: 233; stroke-dashoffset: 233; animation: dash 1.1s .1s var(--ease) forwards; }
.rose-draw .rose-ticks { animation: fadeIn .6s .7s both; }
.rose-draw .rose-pt { transform-origin: 0 0; animation: rosePt .7s var(--ease-out) both; }
.rose-draw .rose-pt:nth-child(n+9) { animation-delay: .25s; }
.rose-draw .rose-pt:nth-child(-n+8) { animation-delay: .45s; }
@keyframes rosePt { from { opacity: 0; transform: scale(.2) rotate(-40deg); } }
@keyframes dash { to { stroke-dashoffset: 0; } }

/* ---------- forms ---------- */
.form { margin-top: 18px; }
.field { margin: 16px 0; }
.field-label { display: block; font-weight: 600; font-size: 14px; color: var(--slate); margin: 0 0 6px; }
input[type="email"], input[type="text"], input[type="password"], select, textarea { width: 100%; border: 1.5px solid var(--hair); background: var(--white); border-radius: 12px; padding: 11px 14px; font-size: 16px; color: var(--slate); transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid rgba(0, 148, 255, .35); outline-offset: 0; }
[aria-invalid="true"] { border-color: #B54708; }
.select { position: relative; }
.select select { appearance: none; padding-right: 40px; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--slate); border-bottom: 2px solid var(--slate); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.field-error { min-height: 1.4em; color: #B54708; font-size: 14px; margin: 8px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; font-weight: 600; color: var(--slate); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.terms { list-style: none; padding: 0; margin: 8px 0 22px; display: grid; gap: 12px; }
.terms li { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; color: var(--slate); }
.term-icon { color: var(--blue); flex: none; margin-top: 2px; }
.seg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; padding: 0; margin: 0 0 8px; }
.seg-opt, .size-opt { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; border: 1.5px solid var(--hair); background: var(--white); border-radius: 12px; font-weight: 600; color: var(--slate); cursor: pointer; transition: border-color .15s, background .15s, color .15s; padding: 6px 8px; }
.seg-opt input, .size-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt.is-on, .size-opt.is-on { border-color: var(--navy); background: var(--navy); color: #fff; }
.seg-opt:focus-within, .size-opt:focus-within { outline: 3px solid var(--bright); outline-offset: 2px; }
.sizes { border: 0; padding: 0; margin: 16px 0 0; }
.size-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.size-opt { font-size: 13px; min-height: 44px; }
.inline-row { display: flex; gap: 8px; }
.inline-row input { flex: 1; min-width: 0; }
@media (max-width: 480px) { .size-row { grid-template-columns: repeat(3, 1fr); } }

/* ---------- choose a way in ---------- */
.ways { display: grid; gap: 12px; margin: 18px 0 14px; }
.way { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; text-align: left; align-items: center; background: var(--white); border: 1.5px solid var(--hair); border-radius: 16px; padding: 18px 18px; transition: border-color .15s, transform .15s var(--ease); }
.way svg { grid-row: span 2; color: var(--navy); }
.way:hover { border-color: var(--navy); }
.way-title { font-weight: 600; font-size: 17px; color: var(--slate); }
.way-text { font-size: 14px; }
.way .badge { grid-column: 2; justify-self: start; margin-top: 8px; }
.way-talk svg { color: var(--bright); }

/* ---------- survey chrome: route + chart strip ---------- */
.survey-chrome { width: 100%; max-width: 1260px; margin: 0 auto; padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left)); flex: none; }
.route { position: relative; height: 56px; }
.route-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.route-base { fill: none; stroke: #B9C8D8; stroke-width: 2; stroke-dasharray: 1 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.route-done { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: butt; transition: stroke-dashoffset .7s var(--ease-out); }
.route-ports { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.route-ports li { position: absolute; transform: translate(-50%, -50%); }
.port { width: 30px; height: 30px; border: 0; background: none; padding: 0; display: grid; place-items: center; border-radius: 999px; }
.port:disabled { cursor: default; }
.port-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid #9FB3C8; transition: background .25s, border-color .25s, transform .3s var(--ease-out); }
.port.is-answered .port-dot { background: var(--navy); border-color: var(--navy); }
.port.is-skipped .port-dot { background: var(--mist); border-color: #9FB3C8; border-style: dashed; }
.port.is-draft .port-dot { background: var(--ramp); border-color: var(--blue); }
.port.is-current .port-dot { transform: scale(1.35); border-color: var(--bright); border-width: 3px; box-shadow: 0 0 0 4px rgba(0, 148, 255, .18); }
.port.is-current.is-answered .port-dot { background: var(--navy); }
.port:hover .port-dot { border-color: var(--bright); }
.is-talk .port.is-current .port-dot { animation: portPulse 1.6s var(--ease) infinite; }
@keyframes portPulse { 50% { box-shadow: 0 0 0 8px rgba(0, 148, 255, .12); } }
.answers-strip { display: none; }

/* ---------- survey layout ---------- */
.stage-survey { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; align-items: start; padding-top: 6px; }
.stage-survey .stage-inner { background: var(--white); border: 1px solid var(--hair); border-radius: 20px; min-height: clamp(520px, calc(100dvh - 200px), 700px); display: flex; flex-direction: column; overflow: hidden; }
.is-talk .stage-survey .stage-inner { background: var(--voice); border-color: var(--voice); }
.side { position: sticky; top: 16px; height: clamp(520px, calc(100dvh - 200px), 700px); }
.side-inner { height: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--white); border: 1px solid var(--hair); border-radius: 20px; padding: 20px; }
.dialog .side-inner { height: auto; border: 0; padding: 0; overflow: visible; }
.answer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.al-item button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; transition: background .15s; }
.al-item button:hover { background: var(--mist); }
.al-item.is-current button { background: var(--ice); }
.al-q { display: block; font-size: 12px; font-weight: 700; color: var(--slate); }
.al-a { display: block; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.al-item.is-skipped .al-a, .al-item.is-draft .al-a { color: #6B6B6B; font-style: italic; }
.al-item { animation: rise .3s var(--ease-out) both; }

@media (max-width: 959px) {
  .stage-survey { grid-template-columns: 1fr; padding-bottom: 0; }
  .side { display: none; }
  .answers-strip { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; background: var(--white); border: 1px solid var(--hair); border-radius: 12px; padding: 10px 14px; margin: 2px 0 10px; text-align: left; min-height: 44px; }
  .cs-title { font-weight: 700; font-size: 13px; color: var(--slate); }
  .cs-sub { font-size: 12px; }
  .stage-survey .stage-inner { min-height: calc(100dvh - 190px); border-radius: 18px 18px 0 0; border-bottom: 0; }
  .stage { padding-left: 10px; padding-right: 10px; }
  .survey-chrome { padding: 0 12px; }
}

/* ---------- a question (Type) ---------- */
.question { display: flex; flex-direction: column; flex: 1; }
.q-body { padding: clamp(22px, 4vw, 40px) clamp(18px, 4vw, 44px) 12px; flex: 1; }
.q-title { font-weight: 400; font-size: clamp(23px, 3vw, 30px); line-height: 1.25; color: var(--slate); margin: 0 0 8px; text-wrap: balance; }
.q-help { margin: 0 0 18px; font-size: 15px; }
.q-hint { min-height: 2.9em; font-size: 13px; color: #6B6B6B; margin: 12px 0 0; transition: color .2s; }
.q-hint.is-nudge { color: var(--navy); font-weight: 600; }
.q-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(18px, 4vw, 44px) calc(14px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--hair); }
.q-foot-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.q-foot-right { display: flex; gap: 8px; flex: none; }
.btn-next { min-width: 112px; }
.save-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #3A7A3A; width: 112px; white-space: nowrap; }
.save-badge.is-saving { color: #6B6B6B; }
.save-badge.is-queued, .save-badge.is-draft { color: var(--blue); }
.save-badge.is-error { color: #B54708; }
.save-badge .tick { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dash .35s var(--ease-out) forwards; }
@media (max-width: 520px) {
  .q-foot { flex-wrap: wrap; row-gap: 6px; }
  .q-foot-left { width: 100%; justify-content: space-between; order: 2; }
  .q-foot-right { width: 100%; order: 1; }
  .q-foot-right .btn { flex: 1; }
}

.choices { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.choice { position: relative; display: grid; grid-template-columns: 26px auto 1fr auto; align-items: center; column-gap: 12px; min-height: 54px; padding: 10px 14px; background: var(--white); border: 1.5px solid var(--hair); border-radius: 14px; cursor: pointer; color: var(--slate); font-weight: 600; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--ramp); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice:focus-within { outline: 3px solid var(--bright); outline-offset: 2px; }
.choice.is-on { border-color: var(--navy); background: #F5F9FE; }
.choice-mark { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #A9BACB; display: grid; place-items: center; color: transparent; transition: background .18s, border-color .18s, color .18s, transform .25s var(--ease-out); }
.choices input[type="checkbox"] ~ .choice-mark { border-radius: 7px; }
.choice.is-on .choice-mark { background: var(--navy); border-color: var(--navy); color: #fff; transform: scale(1.06); }
.choice.is-on .choice-mark path { stroke-dasharray: 20; stroke-dashoffset: 20; animation: dash .28s .05s var(--ease-out) forwards; }
.choice-stage { width: 6px; height: 30px; border-radius: 3px; background: var(--stage-fill, var(--ice)); }
.choices:not(.choices-stage) .choice { grid-template-columns: 26px 1fr auto; }
.choice-label { line-height: 1.35; }
.choice-key { font: 600 12px/1 "Open Sans", sans-serif; color: #7A7A7A; border: 1px solid var(--hair); border-radius: 6px; padding: 4px 7px; background: var(--mist); }
@media (hover: none) { .choice-key { display: none; } }

.sgrid { margin-top: 12px; display: grid; gap: 14px; }
.sgrid-head { display: none; }
.sgrid-row { border: 0; padding: 0; margin: 0; }
.sgrid-area { padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; }
.sgrid-name { font-weight: 700; color: var(--slate); font-size: 15px; }
.sgrid-prompt { font-size: 13px; color: #6B6B6B; line-height: 1.4; }
.sgrid-cells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sgrid-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; padding: 4px 3px; border-radius: 10px; background: var(--mist); border: 1.5px solid var(--hair); text-align: center; cursor: pointer; color: var(--slate); transition: background .22s var(--ease), color .22s, border-color .15s; }
.sgrid-cell:hover { border-color: var(--ramp); }
.sgrid-cell input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sgrid-cell:focus-within { outline: 3px solid var(--bright); outline-offset: 2px; }
.sgrid-cell.is-on { border-color: transparent; }
.sgrid-label { font-size: 12px; line-height: 1.15; font-weight: 600; }
.sgrid-label .s-short { display: none; }
@media (max-width: 560px) { .sgrid-label .s-long { display: none; } .sgrid-label .s-short { display: inline; } }
.sgrid-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; transform: scale(0); transition: transform .3s var(--ease-out); }
.sgrid-cell.is-on .sgrid-dot { transform: scale(1); }

.ta-wrap { margin-top: 14px; }
.ta-label { margin-top: 6px; }
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.q-single textarea, .q-multi textarea { min-height: 72px; }
/* Open answers: the Ctrl+Enter tip on keyboards, a quiet keyboard-mic tip on touch screens. Both sit in
   the same reserved hint line, so nothing moves. */
.hint-touch { display: none; }
.hint-touch svg { vertical-align: -2px; margin-right: 5px; color: var(--blue); }
@media (hover: none) and (pointer: coarse) { .hint-keys { display: none; } .hint-touch { display: inline; } }

/* ---------- the 5 × 5 chart ---------- */
.pchart { margin: 0; }
.pchart svg { display: block; width: 100%; height: auto; overflow: visible; }
.cell { fill: var(--mist); stroke: var(--hair); stroke-width: 1; transition: fill .35s var(--ease), fill-opacity .35s; }
.pc-row.is-hl .cell { stroke: var(--ramp); }
.pc-row.is-hl .pc-area { fill: var(--navy); }
.pc-stage { font: 600 13px "Open Sans", sans-serif; fill: #5E5E5E; }
.pc-area { font: 600 15px "Open Sans", sans-serif; fill: var(--slate); }
.pchart-heat .seg.you { stroke: var(--navy); stroke-width: 3; }
.pchart-heat .dot.you { fill: #fff; stroke: var(--navy); stroke-width: 2.5; }
.seg { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: segDraw .55s var(--ease-out) both; }
.seg.you { stroke: var(--blue); stroke-width: 2.5; }
.seg.med { stroke: var(--slate); stroke-width: 2; }
.dot { transform-box: fill-box; transform-origin: center; animation: pop .35s var(--ease-out) both; }
.dot.you { fill: var(--navy); stroke: #fff; stroke-width: 2; }
.dot.med { fill: #fff; stroke: var(--slate); stroke-width: 2; }
.pchart-compact .dot { stroke-width: 1.2; }
.pchart-compact .seg.you { stroke-width: 1.6; }
@keyframes segDraw { from { stroke-dashoffset: 1; } }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.25); } }
.pc-legend { display: flex; gap: 18px; font-size: 13px; color: var(--slate); margin-top: 10px; flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.lg::before { content: ""; width: 22px; height: 0; border-top: 2.5px solid; }
.lg-you::before { border-color: var(--blue); }
.lg-med::before { border-color: var(--slate); }

/* ---------- Talk ---------- */
.talk { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; padding: clamp(20px, 4vw, 36px) clamp(18px, 4vw, 44px) calc(20px + env(safe-area-inset-bottom)); gap: 14px; }
.talk .kicker { align-self: stretch; text-align: left; }
.ring { width: clamp(110px, 22vh, 210px); aspect-ratio: 1; flex: none; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring-halo { fill: var(--bright); opacity: .15; }
.ring-outer { fill: none; stroke: var(--cyan); stroke-width: 2; }
.ring-inner { fill: var(--blue); transition: fill .3s; }
.ring.is-speaking .ring-inner { fill: var(--bright); }
.ring-connecting svg, .ring-paused svg { animation: breathe 2.4s var(--ease) infinite; }
.ring-paused .ring-inner { fill: var(--voice-line); }
@keyframes breathe { 50% { transform: scale(.92); opacity: .75; } }
.talk-lines { width: 100%; max-width: 560px; min-height: 8.5em; display: flex; flex-direction: column; gap: 10px; }
.talk-agent { font-size: clamp(19px, 2.4vw, 23px); line-height: 1.4; margin: 0; color: #fff; text-wrap: balance; }
.talk-agent .w { animation: fadeIn .3s var(--ease) both; animation-delay: calc(var(--i) * 26ms); }
.talk-user { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ramp); font-style: italic; min-height: 3em; }
.talk-user.is-empty { color: #8C8FB0; }
.answer-card { width: 100%; max-width: 520px; min-height: 78px; text-align: left; background: var(--voice-2); border: 1.5px solid var(--voice-line); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; transition: border-color .3s; }
.answer-card.is-forming { border-color: var(--ramp); }
.answer-card.is-saved { border-color: var(--cyan); }
.ac-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ramp); }
.is-saved .ac-kicker { color: var(--cyan); }
.ac-muted { color: #8C8FB0; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; }
.ac-text { font-size: 15px; color: #fff; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.answer-card .tick { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dash .35s var(--ease-out) forwards; }
.talk-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 40px; align-content: flex-start; max-width: 560px; }
.chip { border: 1.5px solid var(--voice-line); background: transparent; color: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--ramp); background: var(--voice-2); }
.talk-controls { display: flex; gap: 10px; margin-top: auto; }
.ctl { min-width: 88px; height: 44px; border-radius: 999px; border: 1.5px solid var(--voice-line); background: var(--voice-2); color: #fff; font-weight: 600; }
.ctl[aria-pressed="true"] { background: #fff; color: var(--voice); }
.ctl:disabled { opacity: .45; }
.muted-dark { color: #B4B7D3; font-size: 14px; }

/* ---------- the end: thank-you, then the map preview (sample data) ---------- */
.screen-thanks { text-align: center; max-width: 620px; }
.screen-thanks .lede { margin-left: auto; margin-right: auto; }
.thanks-rose { display: flex; justify-content: center; margin: 8px 0 18px; }
.note-card { text-align: left; background: var(--white); border: 1px solid var(--hair); border-radius: 16px; padding: 18px 20px; margin-top: 18px; }
.note-title { font-weight: 700; color: var(--slate); margin: 0 0 6px; }
.email { white-space: nowrap; }
.screen-thanks .actions { justify-content: center; }
.screen-thanks .kicker { text-align: center; }
.thanks-stats { list-style: none; padding: 0; margin: 22px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.thanks-stats li { background: var(--white); border: 1px solid var(--hair); border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: rise .45s var(--ease-out) both; animation-delay: calc(.5s + var(--i) * .1s); }
.thanks-stats strong { font-size: 28px; font-weight: 400; line-height: 1.15; color: var(--navy); }
.thanks-stats strong.ts-word { font-size: 16px; font-weight: 700; line-height: 1.75; }
.thanks-stats span { font-size: 12px; color: #6B6B6B; }
.next-steps { list-style: none; padding: 0; margin: 22px auto 0; max-width: 520px; text-align: left; position: relative; }
.next-steps::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; border-left: 2px dashed #9FB3C8; }
.next-steps li { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; animation: rise .45s var(--ease-out) both; animation-delay: calc(.8s + var(--i, 0) * .1s); }
.next-steps li:nth-child(2) { --i: 1; } .next-steps li:nth-child(3) { --i: 2; }
.ns-dot { width: 16px; height: 16px; border-radius: 999px; background: var(--white); border: 2px solid #9FB3C8; z-index: 1; }
.next-steps li.is-done .ns-dot { background: var(--navy); border-color: var(--navy); }
.ns-title { color: var(--slate); font-weight: 600; font-size: 15px; }
.ns-sub { font-size: 13px; color: #6B6B6B; text-align: right; }
.link-back { margin: 14px 0 12px; padding-top: 12px; border-top: 1px solid var(--hair); }
.link-back .field-label { margin: 0 0 6px; }
.link-back input { flex: 1; min-width: 0; }
@media (max-width: 480px) { .next-steps li { grid-template-columns: 16px 1fr; } .ns-sub { grid-column: 2; text-align: left; margin-top: -6px; } .thanks-stats strong { font-size: 24px; } }
.screen-map { max-width: 680px; }
.map-card { background: var(--white); border: 1px solid var(--hair); border-radius: 20px; padding: clamp(18px, 3vw, 28px); margin-top: 16px; animation: rise .5s var(--ease-out) both; }
.map-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ---------- Back (same place and style on every step after the first) + home ---------- */
.back-bar { height: 40px; display: flex; align-items: center; flex: none; max-width: 760px; margin: 0 auto; }
.back-bar:has(+ .screen-narrow) { max-width: 580px; }
.back-bar:has(+ .screen-thanks) { max-width: 620px; }
.back-bar:has(+ .screen-map) { max-width: 680px; }
.stage-survey .back-bar { max-width: none; margin: 0; padding: 10px clamp(12px, 3.4vw, 38px) 0; height: 50px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 14px; padding: 8px 12px 8px 6px; min-height: 40px; border-radius: 10px; transition: background .15s; }
.back-btn:hover { background: var(--ice); }
.back-bar.is-dark .back-btn { color: #C9DDF2; }
.back-bar.is-dark .back-btn:hover { background: var(--voice-2); }
.back-bar + .screen { padding-top: 6px; }
.stage-survey .back-bar + .question .q-body { padding-top: 10px; }
.stage-survey .back-bar + .talk { padding-top: 8px; }
@media (max-width: 600px) { .stage-survey .back-bar { height: 42px; padding-top: 4px; } .stage-survey .back-bar + .question .q-body { padding-top: 4px; } }
.home-btn { border: 0; background: none; padding: 4px 8px 4px 0; margin-left: -2px; border-radius: 10px; text-align: left; min-width: 0; }
.home-btn:hover .lockup-name { color: var(--navy); }

/* ---------- Talk: the person cut in ---------- */
.talk-agent, .talk-user { transition: opacity .25s var(--ease), color .25s var(--ease); }
.talk.is-interrupted .talk-agent { opacity: .4; }
.talk.is-interrupted .talk-user { color: #fff; font-style: normal; }
.ring.is-interrupted .ring-inner { fill: var(--blue); }

/* ---------- dialogs: top layer, so nothing behind them moves ---------- */
.dialog { border: 0; padding: 0; border-radius: 20px; width: min(500px, calc(100% - 32px)); max-height: min(86dvh, 720px); background: var(--white); color: var(--grey); overflow: hidden; }
.dialog[open] { animation: dlgIn .26s var(--ease-out) both; }
.dialog::backdrop { background: rgba(16, 15, 24, .5); }
.dialog-body { padding: 24px; max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
.dialog-dark { background: var(--voice); color: #E6E7F2; }
.dialog-dark .dlg-title { color: #fff; }
.dlg-title { font-weight: 400; font-size: 24px; line-height: 1.25; color: var(--slate); margin: 0 0 10px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.later-email { margin-top: 18px; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 600px) {
  .dialog { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; }
  .dialog-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ---------- toast: fixed, so it never pushes content ---------- */
.toast-slot { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(600px, calc(100% - 24px)); z-index: 50; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--slate); color: #fff; border-radius: 14px; padding: 12px 12px 12px 16px; font-size: 14px; line-height: 1.45; animation: rise .28s var(--ease-out) both; }
.toast-warn { background: var(--navy); }
.toast > span { flex: 1; }
.toast-act { border: 1.5px solid #fff; background: none; color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.toast-x { border: 0; background: none; color: #fff; font-size: 20px; width: 32px; height: 32px; border-radius: 999px; flex: none; }
@media (max-width: 600px) { .talk { gap: 10px; } .talk-lines { min-height: 7.5em; } .talk-agent { font-size: 18px; } }
@media (max-width: 959px) { .in-survey .toast-slot { bottom: calc(150px + env(safe-area-inset-bottom)); } }

/* ---------- calm motion: same experience, nothing flies ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .enter-fwd, .enter-back { animation: fadeIn .16s linear both; }
  .rose-draw .rose-pt, .rose-draw .rose-ticks, .landing-card, .map-card, .thanks-stats li, .next-steps li, .al-item, .toast, .dialog[open] { animation: fadeIn .2s linear both; animation-delay: 0s; }
  .talk-agent, .talk-user, .back-btn { transition: none; }
  .rose-draw .rose-ring { animation: none; stroke-dashoffset: 0; }
  .seg { animation: fadeIn .25s linear both; stroke-dasharray: none; }
  .dot { animation: fadeIn .25s linear both; }
  .talk-agent .w { animation: none; }
  .ring-connecting svg, .ring-paused svg, .is-talk .port.is-current .port-dot { animation: none; }
  .ms-thumb, .route-done, .port-dot, .choice-mark, .sgrid-dot { transition-duration: .01ms; }
  .choice.is-on .choice-mark path, .save-badge .tick, .answer-card .tick { animation: none; stroke-dashoffset: 0; }
}

@media (forced-colors: active) {
  .port-dot, .choice-mark, .cell { forced-color-adjust: none; }
}

/* =====================================================================
   Admin
   ===================================================================== */
.admin-body { background: var(--mist); }
.admin { min-height: 100dvh; }
.admin-loading { min-height: 100dvh; }
.admin-top { display: flex; align-items: center; gap: 24px; padding: 12px var(--pad); max-width: 1320px; margin: 0 auto; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--slate); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { background: var(--white); }
.tab.is-on { background: var(--navy); color: #fff; }
.admin-main { max-width: 1320px; margin: 0 auto; padding: 4px var(--pad) 60px; }
.admin-view { animation: fadeIn .2s linear both; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 6px; }
.admin-h1 { font-weight: 400; font-size: clamp(20px, 2.4vw, 26px); color: var(--slate); margin: 0; }
.admin-h2 { font-weight: 400; font-size: 22px; color: var(--slate); margin: 14px 0 12px; }
.filter select { width: auto; min-width: 210px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.admin-note { background: #FFF3DC; color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 8px 0; }
.meta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; margin: 0 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.tile { background: var(--white); border: 1px solid var(--hair); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: 13px; font-weight: 600; color: var(--slate); }
.tile-value { font-size: 36px; line-height: 1.15; color: var(--navy); font-weight: 400; font-variant-numeric: tabular-nums; }
.tile-value.is-small { font-size: 26px; padding: 5px 0 3px; }
.tile-sub { font-size: 13px; color: #6B6B6B; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.panel { background: var(--white); border: 1px solid var(--hair); border-radius: 18px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.grid-2 .panel { margin-bottom: 0; }
.panel h2 { font-size: 16px; font-weight: 700; color: var(--slate); margin: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head .muted { font-size: 13px; }
.panel-foot { font-size: 13px; margin: 12px 0 0; color: var(--slate); }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 38%) 1fr 36px; align-items: center; gap: 10px; font-size: 13px; padding: 2px 0; }
.bar-label { color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 16px; }
.bar { display: block; height: 16px; background: var(--ramp); border-radius: 0 4px 4px 0; transition: width .6s var(--ease-out); }
.bar.is-drop { background: var(--blue); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--slate); }
.tag { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); background: var(--ice); border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
.panel-summary { display: flex; flex-direction: column; }
.summary-scroll { height: 360px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.md { color: var(--slate); font-size: 15px; line-height: 1.6; }
.md p { margin: 0 0 12px; }
.md h2 { font-weight: 400; font-size: 26px; line-height: 1.25; margin: 6px 0 12px; }
.md h3 { font-size: 17px; margin: 18px 0 6px; }
.md blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--bright); color: var(--grey); font-style: italic; }
.md ul { padding-left: 20px; margin: 0 0 12px; }
.key-needed { font-size: 13px; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--mist); }
.seg { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--slate); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 0 0 10px; font-size: 13px; color: var(--slate); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.table-scroll { overflow-x: auto; }
.bd-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.result .bd-table { min-width: 0; }
.bd-table th, .bd-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.bd-table thead th { font-size: 12px; font-weight: 700; color: var(--slate); white-space: nowrap; }
.bd-table tbody th { font-weight: 600; color: var(--slate); white-space: nowrap; }
.bd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stack { display: flex; gap: 2px; width: 100%; min-width: 160px; height: 16px; }
.stack span { display: block; height: 100%; }
.stack span:first-child { border-radius: 4px 0 0 4px; }
.stack span:last-child { border-radius: 0 4px 4px 0; }
.map-wrap { max-width: 540px; }
.skeleton { height: 420px; border-radius: 18px; background: var(--white); border: 1px solid var(--hair); }
.chat { display: flex; flex-direction: column; height: clamp(520px, calc(100dvh - 210px), 820px); }
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 12px; }
.chat-empty { color: var(--grey); max-width: 60ch; }
.msg { max-width: 78ch; border-radius: 14px; padding: 12px 14px; animation: rise .25s var(--ease-out) both; }
.msg p { margin: 0; }
.msg-user { align-self: flex-end; background: var(--navy); color: #fff; }
.msg-assistant { align-self: flex-start; background: var(--mist); }
.msg-busy { color: #6B6B6B; font-style: italic; }
.sql { margin-top: 8px; font-size: 13px; }
.sql summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.sql pre { white-space: pre-wrap; background: var(--white); border: 1px solid var(--hair); border-radius: 8px; padding: 10px; font-size: 12px; overflow-x: auto; }
.result { margin-top: 8px; background: var(--white); border-radius: 8px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; border-top: 1px solid var(--hair); }
.chip-light { border: 1.5px solid var(--hair); background: var(--white); color: var(--slate); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.chip-light:hover { border-color: var(--ramp); }
.chat-form { display: flex; gap: 8px; }
.grid-report { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.report { display: flex; flex-direction: column; }
.report-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-ok { background: #E3F4E3; color: #2B6A2B; }
.report-body { height: clamp(420px, calc(100dvh - 330px), 760px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--hair); border-radius: 12px; padding: 18px 22px; }
.report-article { max-width: 70ch; }
.report-editor { width: 100%; height: 100%; min-height: 100%; border: 0; padding: 0; resize: none; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.report-editor:focus { outline: none; }
.report-body:focus-within { border-color: var(--navy); }
.send h2 { margin-bottom: 8px; }
.send-list { list-style: none; padding: 0; margin: 10px 0 14px; font-size: 13px; display: grid; gap: 4px; }
.checklist { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.checklist li { padding-left: 26px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; }
.checklist .ok::before { background: #3A7A3A; }
.checklist .todo::before { border: 2px solid #B54708; box-sizing: border-box; }
.login-card { max-width: 420px; margin: 12vh auto 0; background: var(--white); border: 1px solid var(--hair); border-radius: 20px; padding: 28px; }
.login-card .title { margin-top: 22px; }
.login-card .btn { width: 100%; }
@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-report { grid-template-columns: 1fr; }
  .grid-2 .panel { margin-bottom: 16px; }
}
@media (max-width: 600px) {
  .tiles-3 { grid-template-columns: 1fr; }
  .tile-value { font-size: 30px; }
  .tile-value.is-small { font-size: 21px; }
  .admin-top { gap: 10px; }
  .tabs { order: 3; width: 100%; flex: none; }
  .bar-row { grid-template-columns: minmax(110px, 44%) 1fr 30px; }
}
@media (prefers-reduced-motion: reduce) { .msg, .admin-view { animation: none; } .bar { transition: none; } }

/* =====================================================================
   Admin: map preview (future track, fixed sample data only)
   ===================================================================== */
.filter.is-off { visibility: hidden; }
.map-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 28px; align-items: start; }
.map-preview-text { max-width: 54ch; }
.map-preview-title.map-preview-title { font-weight: 400; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; margin: 0 0 10px; }
.map-preview .report-badges { margin: 0 0 14px; }
.map-preview .lg-you { display: none; } /* no "you" on the preview: it's nobody's answers */
@media (max-width: 1000px) {
  .map-preview { grid-template-columns: 1fr; }
}

/* =====================================================================
   Phone-ready: 44 px tap targets on touch, safe areas, short landscape screens
   ===================================================================== */
.home-btn, .back-btn { min-height: 44px; }
.back-btn { padding-top: 10px; padding-bottom: 10px; }
.link-btn { min-height: 44px; display: inline-flex; align-items: center; }
.check { min-height: 44px; align-items: center; padding: 6px 0; }
.check input { margin: 0; }
.port.is-static { cursor: default; pointer-events: none; }
@media (pointer: coarse) {
  .mode-switch button, .ms-thumb { height: 44px; }
  .port.is-static { width: 24px; height: 24px; }
  .chip { min-height: 44px; }
  .port { width: 44px; height: 44px; }
  .toast-x { width: 44px; height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}
@media (max-width: 959px) {
  .stage { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .survey-chrome { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}
/* Short landscape (a phone on its side): slimmer header, route and "Your answers" on one row, and Talk in
   two columns (ring and controls left, words and answer card right), so the question starts on screen. */
@media (orientation: landscape) and (max-height: 520px) {
  .topbar { height: calc(52px + env(safe-area-inset-top)); }
  .in-survey .survey-chrome { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
  .in-survey .route { height: 44px; }
  .in-survey .answers-strip { width: auto; margin: 0; padding: 6px 14px; gap: 10px; }
  .stage-survey { padding-top: 4px; }
  .stage-survey .stage-inner { min-height: 0; }
  .stage-survey .back-bar { height: 44px; padding-top: 2px; }
  .stage-survey .back-bar + .question .q-body { padding-top: 0; }
  .q-title { font-size: 21px; }
  .talk {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 22px; row-gap: 10px; align-items: start; text-align: left;
    grid-template-areas: "kicker kicker" "ring lines" "ring chips" "controls card";
  }
  .talk .kicker { grid-area: kicker; }
  .talk .ring { grid-area: ring; width: 104px; justify-self: center; }
  .talk-lines { grid-area: lines; min-height: 0; max-width: none; }
  .talk-chips { grid-area: chips; justify-content: flex-start; min-height: 0; max-width: none; }
  .talk .answer-card { grid-area: card; max-width: none; }
  .talk-controls { grid-area: controls; margin-top: 0; flex-direction: column; gap: 8px; }
  .talk-agent { font-size: 18px; text-wrap: pretty; }
}
/* Two-panel phones (a hinge or fold down the middle, e.g. dual-screen devices): keep everything off the
   hinge. Questions use both panels (the question on one, "Your answers" on the other); other screens sit
   on the first panel. Uses the viewport-segments media feature and env() values where the browser has them. */
@media (horizontal-viewport-segments: 2) {
  .stage-survey {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px) + 2 * var(--pad));
  }
  .stage-survey .side { display: block; height: auto; max-height: calc(100dvh - 200px); }
  .in-survey .answers-strip { display: none; }
  .stage:not(.stage-survey) .stage-inner { max-width: calc(env(viewport-segment-right 0 0, 100vw) - 2 * var(--pad)); margin-right: auto; }
  .screen-landing { grid-template-columns: 1fr; }
  .landing-art { display: none; }
}

/* =====================================================================
   Admin: real responses by default, "Demo data" switch, empty state
   ===================================================================== */
.demo-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; border: 1.5px solid var(--hair); background: var(--white); border-radius: 999px; padding: 4px 14px 4px 6px; font-weight: 600; font-size: 14px; color: var(--slate); flex: none; }
.ds-track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: #C9D3DE; transition: background .2s var(--ease); }
.ds-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); transition: transform .25s var(--ease-out); }
.demo-switch.is-on { border-color: var(--warn); background: #FFF3DC; color: var(--warn); }
.demo-switch.is-on .ds-track { background: var(--warn); }
.demo-switch.is-on .ds-knob { transform: translateX(16px); }
.demo-slot { max-width: 1320px; margin: 0 auto; padding: 0 var(--pad); min-height: 46px; }
.demo-banner, .real-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; min-height: 46px; padding: 10px 16px; border-radius: 12px; font-size: 14px; }
.demo-banner { background: #FFF3DC; color: var(--warn); border: 1.5px solid #F2D7A6; }
.demo-banner strong { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; background: var(--warn); color: #fff; padding: 3px 9px; border-radius: 999px; }
.real-banner { background: var(--white); color: var(--slate); border: 1px solid var(--hair); }
.real-banner strong { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--navy); }
.empty-real { max-width: 640px; margin: 18px auto 0; padding: clamp(20px, 4vw, 34px); }
.empty-real .empty-title { font-weight: 400; font-size: clamp(24px, 3vw, 30px); color: var(--slate); margin: 0 0 8px; }
.empty-real .inline-row { display: flex; gap: 8px; }
.empty-real .inline-row input { flex: 1; min-width: 0; }
.empty-demo { margin: 18px 0 0; font-size: 14px; }
@media (max-width: 700px) { .demo-switch .ds-label { font-size: 13px; } .empty-real .inline-row { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .ds-track, .ds-knob { transition: none; } }
