/* ── Sault Skill Survey — app styles (built on Agenvia foundations) ── */

body { min-height: 100vh; min-height: 100dvh; background: var(--bg-1); }

/* ── App shell ─────────────────────────────────────────────── */
.shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.topbar {
  height: 60px;
  flex: 0 0 60px;
  padding: 0 clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-1);
  background: rgb(246 245 240 / 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand-sub {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-3);
  border-left: 1px solid var(--border-1); padding-left: 10px; margin-left: 2px;
  white-space: nowrap;
}
.topbar-spacer { flex: 1; }

.view { flex: 1; display: none; }
.view.active { display: block; }

@media (max-width: 560px) { .brand-sub { display: none; } }

/* ── Home ──────────────────────────────────────────────────── */
.home {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: calc(100vh - 60px);
}
.home-left {
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px clamp(40px, 6vw, 96px);
  max-width: 760px;
  animation: rise 600ms var(--ease) both;
}
.home-left .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-2);
}
.home-left .eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: var(--r-full);
  background: var(--signal-green); box-shadow: 0 0 0 4px var(--signal-green-2);
}
.home-left h1 {
  font-size: clamp(40px, 5.2vw, 60px); line-height: 1.02;
  letter-spacing: -0.035em; font-weight: 600; margin: 18px 0 20px;
  text-wrap: balance;
}
.home-lede { font-size: 19px; line-height: 1.55; color: var(--fg-2); max-width: 500px; margin-bottom: 36px; }

.start-card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2xl);
  padding: 28px;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}
.start-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.start-card-head h5 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.start-meta { display: flex; flex-direction: column; gap: 0; margin-bottom: 24px; }
.start-meta-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--border-1);
  font-size: 13px; color: var(--fg-2);
}
.start-meta-row:last-child { border-bottom: 1px solid var(--border-1); }
.start-meta-row .k {
  color: var(--fg-3); width: 96px; flex: 0 0 96px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
}
.start-meta-row .v { color: var(--fg-1); font-weight: 500; }
.start-card .btn { width: 100%; padding: 14px 16px; font-size: 15px; }
.start-foot { font-size: 12.5px; color: var(--fg-3); margin: 14px 0 0; line-height: 1.5; }

/* hero panel */
.home-right { background: var(--bg-2); border-left: 1px solid var(--border-1); position: relative; overflow: hidden; }
.home-right svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-right::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgb(11 15 14 / 0.04));
  pointer-events: none;
}
.hero-caption {
  position: absolute; left: 22px; bottom: 22px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-1);
  background: rgb(246 245 240 / 0.82); backdrop-filter: blur(4px);
  border: 1px solid var(--border-1); border-radius: var(--r-full);
  padding: 7px 13px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; }
  .home-right { min-height: 240px; order: -1; }
  .home-left { padding: 44px 28px; }
}

/* ── Survey ────────────────────────────────────────────────── */
.survey-wrap { max-width: 680px; margin: 0 auto; padding: 28px 24px 100px; }

/* progress */
.progress-card {
  background: rgb(246 245 240 / 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  padding: 16px 18px 14px;
  margin-bottom: 36px;
  position: sticky; top: 76px; z-index: 5;
  box-shadow: var(--shadow-sm);
}
.progress-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.progress-section {
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg-1);
  display: inline-flex; align-items: center; gap: 8px;
}
.progress-section::before {
  content: ""; width: 7px; height: 7px; border-radius: var(--r-full); background: var(--signal-green);
}
.progress-count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

/* segmented section stepper */
.stepper { display: flex; gap: 6px; }
.step {
  flex: 1; height: 6px; border-radius: var(--r-full);
  background: var(--fog); overflow: hidden; position: relative;
}
.step .step-fill {
  position: absolute; inset: 0; width: 0;
  background: var(--signal-green); border-radius: var(--r-full);
  transition: width 420ms var(--ease);
}
.step.done .step-fill { width: 100%; }
.step.active .step-fill { width: 100%; background: linear-gradient(90deg, var(--signal-green), #3DD4A0); }
.step.active::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-full);
  box-shadow: 0 0 0 2px rgb(18 185 129 / 0.18);
}

/* question block */
.q-block { animation: qenter 360ms var(--ease) both; }
@keyframes qenter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--signal-green);
  letter-spacing: 0.04em; margin-bottom: 12px; font-weight: 500;
}
.q-text { font-size: clamp(24px, 3.4vw, 30px); line-height: 1.16; letter-spacing: -0.025em; font-weight: 600; margin-bottom: 10px; text-wrap: pretty; }
.q-help { font-size: 15px; color: var(--fg-2); line-height: 1.55; margin-bottom: 28px; max-width: 560px; }
.q-text .q-link { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; font-size: 0.8em; }
.q-text .q-link:hover { color: var(--signal-green); }

/* option rows */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border-2); border-radius: var(--r-xl);
  background: var(--bg-1); cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  font-size: 16px; color: var(--fg-1); text-align: left; width: 100%;
  font-family: var(--font-sans); line-height: 1.35;
}
.opt:hover { background: var(--bg-1); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.opt-mark {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: var(--r-full);
  border: 2px solid var(--border-2); display: grid; place-items: center;
  background: var(--bg-1);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.opt.multi .opt-mark { border-radius: var(--r-md); }
.opt-mark::after {
  content: ""; width: 10px; height: 10px; border-radius: inherit; background: var(--paper);
  transform: scale(0); transition: transform 160ms var(--ease);
}
.opt.multi .opt-mark::after {
  width: 12px; height: 12px; background: none; border-radius: 0;
  border-right: 2px solid var(--paper); border-bottom: 2px solid var(--paper);
  transform: rotate(45deg) scale(0); margin-top: -2px; width: 6px; height: 11px;
}
.opt.on {
  border-color: var(--signal-green); background: var(--signal-green-2);
  box-shadow: var(--shadow-sm);
}
.opt.on .opt-mark { border-color: var(--signal-green); background: var(--signal-green); }
.opt.on .opt-mark::after { transform: scale(1); }
.opt.multi.on .opt-mark::after { transform: rotate(45deg) scale(1); }
.opt-label { flex: 1; }
.opt-key {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3);
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-1); border-radius: var(--r-md);
  background: var(--bg-2);
  transition: all var(--dur) var(--ease);
}
.opt:hover .opt-key { border-color: var(--border-2); color: var(--fg-2); }
.opt.on .opt-key { background: var(--signal-green); color: var(--paper); border-color: var(--signal-green); }

/* Option definition helper ("?" with tooltip) */
.opt { position: relative; }
.opt-help {
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; cursor: help; outline: none;
}
.opt-help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: var(--r-full);
  border: 1.25px solid var(--border-2); background: var(--bg-2);
  color: var(--fg-3); font-size: 9.5px; font-weight: 700; line-height: 1;
  font-family: var(--font-sans);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.opt-help:hover .opt-help-icon,
.opt-help:focus-visible .opt-help-icon,
.opt-help.tip-open .opt-help-icon {
  border-color: var(--signal-green); color: var(--signal-green); background: var(--signal-green-2);
}
.opt-tip {
  position: absolute; bottom: calc(100% + 8px); left: 16px; right: auto;
  width: max-content; max-width: min(320px, calc(100% - 32px));
  padding: 9px 12px; z-index: 40;
  background: var(--green-deep); color: #fff;
  font-family: var(--font-sans); font-size: 13px; font-weight: 400; line-height: 1.45;
  text-align: left; border-radius: 9px;
  box-shadow: 0 12px 28px -10px rgb(20 32 28 / 0.45);
  opacity: 0; visibility: hidden; transform: translateY(4px); pointer-events: none;
  transition: opacity 130ms var(--ease), transform 130ms var(--ease);
}
.opt-help:hover .opt-tip,
.opt-help:focus-visible .opt-tip,
.opt-help.tip-open .opt-tip {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.opt-help.tip-open .opt-tip { pointer-events: auto; }

/* Text-to-speech ("Listen") buttons — one per question, one per option */
.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; cursor: pointer; outline: none;
  color: var(--fg-3); border-radius: var(--r-full);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.speak-btn svg { width: 100%; height: 100%; display: block; }
.speak-btn:hover, .speak-btn:focus-visible { color: var(--signal-green); background: var(--signal-green-2); }
.speak-btn.speaking { color: var(--signal-green); animation: speak-pulse 1.1s ease-in-out infinite; }
@keyframes speak-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
/* per-question: sits inline after the heading text */
.q-speak { width: 30px; height: 30px; padding: 5px; margin-left: 12px; vertical-align: middle; }
/* per-option: compact, before the letter key */
.opt-speak { width: 26px; height: 26px; padding: 4px; margin-left: 4px; }
.opt .opt-speak { margin-left: auto; } /* push to the right, next to the .opt-key */
.opt .opt-key { margin-left: 8px; }
.rate-name { position: relative; }
.rate-name .opt-speak { margin-left: 6px; vertical-align: middle; }

/* select / input / textarea */
.field { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.field-lbl { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2); }
/* The prize-draw note under the email field. It used to be --fg-3 (#89918d),
   which is 3.4:1 on the survey's near-white --nordik-bg backdrop — under the
   4.5:1 a line of body copy needs, and the one paragraph on the last page that
   a respondent must actually take in before typing an address. White alone
   would not help: white on that same backdrop is ~1.05:1, i.e. invisible. So the
   ink moves to white and the note carries its own solid --ink face, which is
   near-black: white on #14201c is 16.8:1, and the face keeps that contrast
   wherever the note lands no matter how bright the gradient behind it is.
   7px radius and 10px padding keep it in the survey's row metric, and the
   padding is what stops the long translations (Hindi, Tagalog) from touching
   the edge. */
.field-note {
  font-size: 13px;
  color: #fff;
  background: var(--ink);
  line-height: 1.5;
  margin-top: 2px;
  max-width: 460px;
  padding: 10px 12px;
  border-radius: 7px;
}

/* Motivation card (HP2 experiment) — bottom-right on desktop, top banner on mobile */
/* The motivation card takes the place of the (now hidden) progress strip: a
   small card fixed near the top, centred horizontally, sitting just above the
   question. No drift — a fixed spot. */
.motiv-card {
  position: fixed; z-index: 60;
  left: 50%; top: 66px;
  width: min(256px, calc(100vw - 32px));
  display: flex; gap: 9px; align-items: flex-start; pointer-events: none; /* informational — taps pass through */
  background: var(--bg-1); border: 3px solid var(--signal-green);
  border-radius: 12px; box-shadow: 0 12px 30px -12px rgb(20 32 28 / 0.35); padding: 9px 12px;
  opacity: 0; transform: translate(-50%, -8px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.motiv-card.in { opacity: 1; transform: translate(-50%, 0); }
.motiv-card p { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--fg-1); text-align: left; }
/* single star, sat on the first line of text (1px nudge lines its centre up with
   the cap height of the first row) */
.motiv-icon { flex: 0 0 auto; color: var(--signal-green); width: 15px; margin-top: 1px; display: flex; flex-direction: column; gap: 3px; }
.motiv-icon svg { width: 15px; height: 15px; display: block; }
@media (max-width: 640px) {
  .motiv-card { top: 62px; width: min(256px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .motiv-card { transition: opacity .3s var(--ease); }
  .motiv-card.in { transform: translate(-50%, 0); }
}
/* The progress strip (question number + bar + trophy) is hidden, but its box is
   kept (visibility, not display) so the question stays exactly where it was; the
   motivation card now occupies that top area. */
body[data-route="survey"] .progress-card { visibility: hidden; }
select.input { appearance: none; background-image: none; cursor: pointer; padding-right: 38px; }
.select-wrap { position: relative; max-width: 460px; }
.select-wrap::after { content: "▾"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--fg-2); pointer-events: none; }
textarea.input { font-family: var(--font-sans); font-size: 16px; line-height: 1.55; min-height: 140px; resize: vertical; max-width: 100%; }
input.input { max-width: 460px; }

/* rating grid */
/* Skill rows are separate cards, matching the .opt option rows for consistency. */
.grid-rate { display: flex; flex-direction: column; gap: 10px; }
.rate-row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  min-height: 58px; padding: 12px 18px;
  border: 1px solid var(--border-2); border-radius: var(--r-xl);
  background: var(--bg-1); box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.rate-row:hover { background: var(--bg-1); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.rate-name { position: relative; font-size: 15px; color: var(--fg-1); font-weight: 500; }
/* the small grey sub-description only — must not catch the tooltip spans
   (.opt-help / .opt-help-icon / .opt-tip), which also live inside .rate-name */
.rate-name > span:not(.opt-help):not(.speak-btn) { display: block; font-size: 12.5px; color: var(--fg-3); margin-top: 2px; font-weight: 400; }
.rate-scale { display: flex; gap: 6px; }
.rate-dot {
  width: 40px; height: 38px; border: 1px solid var(--border-2); background: var(--bg-1);
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-2);
  border-radius: var(--r-lg); cursor: pointer; display: grid; place-items: center;
  transition: all var(--dur) var(--ease);
}
.rate-dot:hover { border-color: var(--signal-green); color: var(--signal-green); }
.rate-dot.on { background: var(--signal-green); color: var(--paper); border-color: var(--signal-green); box-shadow: var(--shadow-accent); }
/* "0 = Not Sure" button — set slightly apart from the 1–5 scale, neutral when chosen */
.rate-dot.ns { margin-left: 10px; color: var(--fg-3); }
.rate-dot.ns.on { background: var(--fg-2); border-color: var(--fg-2); color: #fff; box-shadow: none; }

/* Progress trophy goal marker (grey → green when complete) */
.progress-bar-row { display: flex; align-items: center; gap: 8px; }
.progress-bar-row .progress-track { flex: 1; }
.progress-trophy { flex: 0 0 auto; width: 18px; height: 18px; color: var(--fg-3); display: inline-flex; transition: color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.progress-trophy svg { width: 100%; height: 100%; }
/* Trophy turns ink at 100%, matching the completed bar beside it. */
.progress-trophy.done { color: var(--ink); transform: scale(1.08); }

/* Completion screen trophy */
.champion-trophy { display: block; width: 86px; height: 86px; margin: 0 auto 18px; color: var(--signal-green); }
.champion-trophy svg { width: 100%; height: 100%; }
.state-card:has(.champion-trophy) { text-align: center; }
.state-card:has(.champion-trophy) p { margin-left: auto; margin-right: auto; }
.state-card:has(.champion-trophy) .actions { justify-content: center; }

@media (max-width: 560px) {
  .rate-row { grid-template-columns: 1fr; gap: 12px; }
  .rate-dot { width: 100%; height: 40px; }
  .rate-scale { display: grid; grid-template-columns: repeat(5, 1fr); }
}

/* opt-in toggle */
.optin { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border: 1px solid var(--border-2); border-radius: var(--r-xl); background: var(--bg-1); cursor: pointer; margin-bottom: 18px; box-shadow: var(--shadow-sm); transition: all var(--dur) var(--ease); }
.optin:hover { border-color: var(--border-strong); }
.optin .opt-mark { border-radius: var(--r-md); margin-top: 1px; }
.optin .opt-mark::after {
  width: 6px; height: 11px; background: none; border-radius: 0;
  border-right: 2px solid var(--paper); border-bottom: 2px solid var(--paper);
  transform: rotate(45deg) scale(0); margin-top: -2px;
}
.optin.on { border-color: var(--signal-green); background: var(--signal-green-2); }
.optin.on .opt-mark { border-color: var(--signal-green); background: var(--signal-green); }
.optin.on .opt-mark::after { transform: rotate(45deg) scale(1); }
.optin-text { font-size: 15px; line-height: 1.5; }
.optin-text b { font-weight: 600; }
.optin-text span { display: block; color: var(--fg-3); font-size: 13px; margin-top: 3px; }

/* nav row */
.q-nav { display: flex; align-items: center; gap: 12px; margin-top: 36px; }
.q-nav .btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.q-nav-spacer { flex: 1; }
.q-hint { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.kbd-hint { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-2);
  border: 1px solid var(--border-1); border-bottom-width: 2px; border-radius: var(--r-sm);
  padding: 2px 5px; background: var(--bg-1); line-height: 1;
}

/* terminal / ineligible / complete states */
.state-card { max-width: 580px; margin: 72px auto; text-align: left; animation: rise 500ms var(--ease) both; }
.state-card.card { box-shadow: var(--shadow-lg); border-radius: var(--r-2xl); padding: 36px; }
.state-card .pill { margin-bottom: 20px; }
.state-card h2 { font-size: 32px; letter-spacing: -0.025em; margin-bottom: 14px; }
.state-card p { font-size: 16px; line-height: 1.6; color: var(--fg-2); }
.state-card .actions { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.receipt { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-lg); padding: 14px 16px; margin-top: 26px; }
.receipt div { display: flex; justify-content: space-between; padding: 4px 0; }
.receipt .k { color: var(--fg-3); }

/* ── Admin ─────────────────────────────────────────────────── */
.admin-wrap { max-width: 940px; margin: 0 auto; padding: 48px 24px 80px; }
.admin-head { margin-bottom: 32px; }
.admin-head .eyebrow { margin-bottom: 10px; display: block; }
.admin-head h2 { font-size: 32px; letter-spacing: -0.025em; }

.gate { max-width: 400px; margin: 88px auto; }
.gate.card { box-shadow: var(--shadow-lg); border-radius: var(--r-2xl); padding: 32px; }
.gate .field { max-width: 100%; }
.gate h4 { margin-bottom: 8px; }
.gate p { font-size: 14px; color: var(--fg-2); margin-bottom: 22px; }
.gate .btn { width: 100%; margin-top: 14px; padding: 13px; }
.gate-err { font-family: var(--font-mono); font-size: 12px; color: var(--crimson); margin-top: 12px; min-height: 16px; }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.astat { border: 1px solid var(--border-1); border-radius: var(--r-xl); padding: 20px; background: var(--bg-1); box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.astat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.astat-lbl { font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.astat-val { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.astat-sub { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); margin-top: 8px; }
.astat-sub.g { color: var(--signal-green); }

.export-card { border: 1px solid var(--border-1); border-radius: var(--r-2xl); background: var(--bg-1); padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; box-shadow: var(--shadow-md); }
.export-card h4 { font-size: 19px; margin-bottom: 8px; }
.export-card p { font-size: 14px; color: var(--fg-2); margin: 0; max-width: 440px; line-height: 1.55; }
.export-meta { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); margin-top: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.export-card .btn { padding: 13px 20px; }
.export-card .btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.admin-foot { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border-1); display: flex; align-items: center; gap: 18px; }
.admin-foot .lnk { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.admin-foot .lnk:hover { color: var(--crimson); }

@media (max-width: 720px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .export-card { grid-template-columns: 1fr; }
}

/* ── shared motion ─────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 2026 product refresh */
:root {
  --ink: #14201c;
  --ink-2: #20332c;
  --paper: #f8f7f3;
  --paper-2: #f0eee7;
  --paper-3: #e7e4dc;
  --graphite: #58645f;
  --graphite-2: #89918d;
  --fog: #d8d9d3;
  --signal-green: #247a5a;     /* accent: selection, ratings, submit */
  --signal-green-2: #e6f1eb;
  --green-deep: var(--signal-green); /* actions match the indicator green */
  --green-deep-hover: #1c5e45;        /* darker shade, hover only */
  /* Survey navigation chrome is neutral and weightless: bare white arrows with
     no chip, no face and no border, and an ink progress fill. The row sits over
     two very different backdrops — the photo on desktop (median #7a672c, with
     bright patches near #f4e1cd) and plain --paper #f8f7f3 on mobile — so white
     alone is 5.5:1 over the photo's body but 1.1:1 over its bright patches and
     1.07:1 on the paper. A drop shadow, not a chip, is what carries the glyph
     across all three. The ink bar is 12.5:1 on the groove. Green stays reserved
     for meaning: a chosen answer and the Submit action. */
  --nav-arrow: #fff;           /* the arrow stroke, over photo or paper */
  --nav-arrow-shadow: rgb(0 0 0 / 0.55); /* soft depth shadow */
  --nav-arrow-shadow-hard: rgb(0 0 0 / 0.85); /* tight edge: the only contrast on light px */
  --nordik-blue: #0b4f9c;
  --nordik-red: #a41435;
  --nordik-bg:
    radial-gradient(circle at 10% 4%, rgb(11 79 156 / 0.16), transparent 32rem),
    radial-gradient(circle at 92% 0%, rgb(164 20 53 / 0.14), transparent 30rem),
    linear-gradient(135deg, rgb(11 79 156 / 0.08), rgb(164 20 53 / 0.06) 48%, #fff 82%);
  /* Home backdrop: a calm waterfront sky — warm cream light at the top drifting
     down into pale seafoam, with soft hill masses along the bottom edge. Colour
     stops are sampled from the approved reference artwork (591x167): #f8f3dc at
     the top through #e4ece1 mid-page to #d4dedd at the bottom. Built from
     gradients, not a bitmap, so it stays crisp on any viewport and adds no
     download weight. Hills sit first so they paint over the base wash. */
  --home-bg:
    radial-gradient(64% 26% at 6% 100%, rgb(232 226 211 / 0.55), transparent 72%),
    radial-gradient(52% 22% at 40% 100%, rgb(203 212 211 / 0.5), transparent 74%),
    radial-gradient(46% 20% at 74% 100%, rgb(199 214 216 / 0.45), transparent 72%),
    radial-gradient(120% 62% at 10% -6%, rgb(255 249 228 / 0.9), transparent 64%),
    linear-gradient(180deg,
      #f8f3dc 0%, #f1efdc 12%, #eeefde 24%, #e9eee0 36%, #e4ece1 48%,
      #e0ece4 60%, #deebe5 72%, #dbe7e3 84%, #d5e0de 96%, #d4dedd 100%);
  --dashboard-bg:
    #ebe7df;
  --dashboard-card:
    #fff;
  --dashboard-card-solid: #fff;
  --dashboard-border: rgb(0 0 0 / 0.14);
  --dashboard-border-strong: rgb(0 0 0 / 0.2);
  --dashboard-muted: #666;
  --dashboard-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  --dashboard-shadow-soft: 0 1px 2px rgb(0 0 0 / 0.06);
  --border-1: rgb(20 32 28 / 0.1);
  --border-2: rgb(20 32 28 / 0.18);
  --border-strong: var(--green-deep);
  --shadow-sm: 0 1px 2px rgb(20 32 28 / 0.05);
  --shadow-md: 0 10px 30px -18px rgb(20 32 28 / 0.32);
  --shadow-lg: 0 24px 60px -28px rgb(20 32 28 / 0.34);
  --shadow-accent: 0 10px 24px -12px rgb(36 122 90 / 0.55);
  --ring: 0 0 0 4px rgb(36 122 90 / 0.14);
}

body {
  background: var(--nordik-bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

.topbar {
  height: 56px;
  flex-basis: 56px;
  padding: 0 max(64px, calc((100vw - 1180px) / 2));
  background: #ffffff;
  border-color: var(--border-1);
  backdrop-filter: saturate(1.2) blur(18px);
}
.brand { gap: 10px; }
.brand-copy { display: flex; flex-direction: column; gap: 0; }
.brand-name { font-size: 14px; line-height: 17px; font-weight: 600; }
.brand-sub {
  margin: 0; padding: 0; border: 0;
  font-family: var(--font-sans); font-size: 10.5px; line-height: 13px;
  color: var(--fg-3); letter-spacing: 0.015em;
}

.home {
  display: block;
  min-height: auto;
}
.hero {
  width: min(1180px, calc(100% - 128px));
  min-height: auto;
  margin: 0 auto;
  padding: 24px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
  align-items: center;
  gap: clamp(48px, 7vw, 100px);
}
.hero-copy {
  width: 100%;
  animation: rise 600ms var(--ease) both;
}
.hero-art {
  pointer-events: none;
}
.hero-map {
  width: 100%;
  min-height: 500px;
  margin-top: -32px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: rise 700ms 80ms var(--ease) both;
}
/* The map artwork ships with a transparent background, so the hero backdrop
   shows through it: no card, no corner radius, no fill to clash with the sky. */
.hero-map img {
  display: block;
  width: 100%;
  height: auto;
}
.map-location-label {
  position: absolute;
  left: 63%;
  top: 70%;
  padding: 7px 10px;
  border: 1px solid rgb(23 61 50 / 0.12);
  border-radius: 999px;
  background: rgb(248 247 243 / 0.94);
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 20px -14px rgb(20 32 28 / 0.5);
  white-space: nowrap;
}
.hero-copy .eyebrow { color: #426257; }
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal-green);
  box-shadow: 0 0 0 5px rgb(36 122 90 / 0.1);
}
.hero h1 {
  max-width: 650px;
  margin: 0 0 24px;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.0;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}
.home-lede {
  max-width: 600px;
  margin: 0;
  font-size: 19px;
  line-height: 1.58;
  color: var(--fg-2);
}
/* A/B/C recruitment message body — leaning (parallelogram) cards, decreasing width.
   Green outline + faint light-green fill + rounded corners; the card shape is a
   skewed pseudo-element so the text stays upright while the panel leans. */
.home-body { display: flex; flex-direction: column; gap: 14px; max-width: 600px; align-items: flex-start; }
.home-body-p {
  position: relative; z-index: 0;
  margin: 0;
  padding: 16px 30px;
  font-size: 15.5px; line-height: 1.6; color: var(--fg-1);
}
.home-body-p::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--signal-green-2);
  border: 1.5px solid var(--signal-green);
  border-radius: 14px;
  transform: skewX(-6deg);
  box-shadow: 0 8px 18px -12px rgb(20 32 28 / 0.22);
}
.home-body-p:nth-child(1) { width: 100%; }
.home-body-p:nth-child(2) { width: 86%; }
.home-body-p:nth-child(3) { width: 72%; }
.hero-actions {
  display: flex; align-items: center; gap: 22px;
  margin-top: 34px;
}
.btn-hero { min-height: 42px; padding: 0 22px; background: var(--green-deep); border-color: var(--green-deep); }
.btn-hero:hover { background: var(--green-deep-hover); }
.hero-time {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-2); font-size: 14px; font-weight: 500;
}
.hero-time svg { width: 18px; height: 18px; }

.hero-reward {
  display: inline-flex; align-items: center; gap: 9px;
  width: fit-content; max-width: 100%;
  margin: 16px 0 0; padding: 9px 14px;
  background: var(--signal-green-2);
  border: 1px solid rgb(36 122 90 / 0.18);
  border-radius: var(--r-full);
  color: #1c5e45; font-size: 13.5px; font-weight: 500; line-height: 1.35;
}
.hero-reward svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--signal-green); }

.trust-row {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin-top: 28px;
}
.trust-row span {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--fg-2); font-size: 13px; font-weight: 500;
}
.trust-row svg { width: 18px; height: 18px; color: var(--signal-green); }

.hero-visual {
  min-height: 520px;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  animation: rise 700ms 80ms var(--ease) both;
}
.hero-visual::before {
  content: "";
  position: absolute; inset: 18px 8px 16px 48px; z-index: -3;
  border-radius: 42% 58% 48% 52% / 48% 42% 58% 52%;
  background:
    radial-gradient(circle at 70% 22%, rgb(255 255 255 / 0.7) 0 5%, transparent 5.5%),
    linear-gradient(145deg, #dce9df, #b9d7c5 56%, #93bba8);
  transform: rotate(-3deg);
}
.hero-visual::after {
  content: "";
  position: absolute; right: 7%; top: 9%; z-index: -2;
  width: 94px; height: 94px; border-radius: 50%;
  background: #f0b95d;
  box-shadow: 0 0 0 14px rgb(240 185 93 / 0.13);
}
.visual-orbit {
  position: absolute; z-index: -1;
  border: 1px solid rgb(23 61 50 / 0.16); border-radius: 50%;
}
.orbit-one { width: 400px; height: 400px; right: 5%; top: 11%; }
.orbit-two { width: 480px; height: 240px; left: 2%; bottom: 5%; transform: rotate(18deg); }
.preview-card {
  width: min(470px, calc(100% - 54px));
  margin: 4px 0 0 20px;
  background: rgb(255 255 255 / 0.94);
  border: 1px solid rgb(20 32 28 / 0.12);
  border-radius: 22px;
  box-shadow: 0 30px 70px -28px rgb(23 61 50 / 0.42);
  overflow: hidden;
  transform: rotate(1.4deg);
}
.preview-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 21px 13px;
  font-size: 11px; color: var(--fg-3);
}
.preview-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-1); font-weight: 600; }
.preview-brand span { width: 8px; height: 8px; border-radius: 3px; background: var(--signal-green); }
.preview-count { font-family: var(--font-mono); font-size: 10px; }
.preview-progress { height: 3px; margin: 0 21px; background: #e8ebe8; border-radius: 3px; overflow: hidden; }
.preview-progress span { display: block; width: 36%; height: 100%; background: var(--signal-green); }
.preview-body { padding: 31px 32px 28px; }
.preview-kicker {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--signal-green);
}
.preview-body h2 { max-width: 340px; margin: 9px 0 8px; font-size: 26px; line-height: 1.12; font-weight: 600; }
.preview-body p { margin: 0 0 20px; color: var(--fg-3); font-size: 13px; }
.preview-options { display: flex; flex-direction: column; gap: 8px; }
.preview-options span {
  min-height: 45px; padding: 0 13px;
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--fg-2); font-size: 13px; font-weight: 500;
}
.preview-options i {
  width: 17px; height: 17px; flex: 0 0 17px;
  display: grid; place-items: center;
  border: 1.5px solid #b7bfba; border-radius: 5px;
  font-style: normal; font-size: 11px;
}
.preview-options .selected { color: var(--green-deep); border-color: #79aa91; background: #eff7f2; }
.preview-options .selected i { color: white; background: var(--signal-green); border-color: var(--signal-green); }
.preview-footer {
  padding: 15px 21px; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border-1); background: #fbfbf9;
  font-size: 11px; color: var(--fg-3);
}
.preview-footer b {
  padding: 9px 12px; border-radius: 8px;
  background: var(--green-deep); color: white; font-size: 11px; font-weight: 600;
}
.reward-card, .location-chip {
  position: absolute;
  background: rgb(255 255 255 / 0.95);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-lg);
}
.reward-card {
  left: -5px; bottom: 38px;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px; border-radius: 14px;
  transform: rotate(-3deg);
}
.reward-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff4dc; color: #9c671c; font-weight: 600;
}
.reward-card b, .reward-card small { display: block; }
.reward-card b { font-size: 12px; }
.reward-card small { margin-top: 1px; color: var(--fg-3); font-size: 10px; }
.location-chip {
  right: -5px; top: 40px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 13px; border-radius: 999px;
  color: var(--fg-2); font-size: 11px; font-weight: 500;
}
.location-chip span { width: 7px; height: 7px; border-radius: 50%; background: #e6a63e; }

.home-details {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 98px 0 108px;
  border-top: 1px solid var(--border-1);
  display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 90px;
}
.detail-intro h2 {
  margin-top: 16px; max-width: 390px;
  font-size: clamp(32px, 3.5vw, 46px); line-height: 1.05; font-weight: 600;
}
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.detail-grid article { padding-top: 17px; border-top: 2px solid #b8e3c9; }
.detail-number { font-family: var(--font-mono); font-size: 11px; color: var(--signal-green); }
.detail-grid h3 { margin: 28px 0 10px; font-size: 19px; line-height: 1.2; font-weight: 600; }
.detail-grid p { margin: 0; color: var(--fg-2); font-size: 14px; line-height: 1.55; }
.home-cta {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 48px;
  padding: 52px 58px;
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
  color: white; background: var(--green-deep);
  border-radius: 26px;
  box-shadow: 0 24px 60px -34px var(--green-deep);
  overflow: hidden; position: relative;
}
.home-cta::after {
  content: ""; position: absolute; width: 280px; height: 280px; right: 14%; top: -180px;
  border: 1px solid rgb(255 255 255 / 0.13); border-radius: 50%;
  box-shadow: 0 0 0 45px rgb(255 255 255 / 0.025), 0 0 0 90px rgb(255 255 255 / 0.02);
}
.eyebrow-light { color: #b8e3c9; }
.home-cta h2 { max-width: 600px; margin-top: 10px; color: white; font-size: 34px; line-height: 1.08; font-weight: 500; }
.btn-light { z-index: 1; white-space: nowrap; color: var(--green-deep); background: #f7f5ef; border-color: #f7f5ef; }
.btn-light:hover { color: var(--green-deep); background: white; }

body[data-route="survey"] {
  background: var(--nordik-bg);
  background-attachment: fixed;
}
body[data-route="admin"] {
  background: var(--dashboard-bg);
  background-attachment: fixed;
}
/* Home base is the waterfront sky gradient below the map artwork. */
body[data-route="home"] {
  background: var(--home-bg);
  background-attachment: fixed;
}
.survey-wrap { max-width: 780px; padding: 42px 24px 110px; }
.progress-card {
  top: 88px; margin-bottom: 24px; padding: 17px 20px 16px;
  background: rgb(255 255 255 / 0.88);
  border-radius: 16px;
  box-shadow: 0 10px 32px -24px rgb(20 32 28 / 0.4);
}
.stepper { gap: 5px; }
.step { height: 5px; background: #e2e4df; }
.q-block {
  min-height: 420px;
  padding: 42px 46px 44px;
  background: rgb(255 255 255 / 0.78);
  border: 1px solid var(--border-1);
  border-radius: 22px;
  box-shadow: 0 24px 60px -42px rgb(20 32 28 / 0.42);
}
.q-num { color: var(--signal-green); font-size: 11px; }
.q-text { max-width: 630px; font-size: clamp(28px, 4vw, 38px); line-height: 1.08; letter-spacing: -0.035em; }
.q-help { margin-bottom: 30px; color: var(--fg-2); }
.options { gap: 9px; }
.opt {
  min-height: 58px; padding: 15px 17px;
  background: #fff; border-color: var(--border-1); border-radius: 12px;
  box-shadow: none;
}
.opt:hover { border-color: #76a58e; box-shadow: 0 8px 22px -18px rgb(20 32 28 / 0.5); transform: translateY(-1px); }
.opt.on { color: var(--green-deep); border-color: #72a88d; background: #edf6f0; }
.opt-mark { width: 21px; height: 21px; flex-basis: 21px; border-width: 1.5px; }
.q-nav { margin-top: 20px; padding: 0 10px; }
.q-nav .btn { min-height: 45px; border-radius: 10px; }
.grid-rate { gap: 9px; }
.rate-row { min-height: 58px; padding: 9px 17px; background: #fff; border-color: var(--border-1); border-radius: 12px; box-shadow: none; }
.rate-row:hover { border-color: #76a58e; box-shadow: 0 8px 22px -18px rgb(20 32 28 / 0.5); }
.rate-dot { width: 39px; border-radius: 9px; }
.rate-dot.on { background: var(--signal-green); box-shadow: 0 7px 16px -10px var(--signal-green); }
.optin { background: #fff; box-shadow: none; border-color: var(--border-1); }
.input { background: #fff; }

.admin-wrap { max-width: 1040px; padding: 24px 24px; }
.admin-head { margin-bottom: 18px; }
.admin-stats { margin-bottom: 16px; }
.admin-foot { margin-top: 18px; padding-top: 14px; }

/* Admin login: center the card in the viewport so the page never scrolls */
body[data-route="admin"] .admin-wrap:has(.gate) {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 24px;
}
.gate { margin: 0; width: 100%; }
.gate.card, .state-card.card {
  padding: 38px; border-radius: 16px;
  background: rgb(255 255 255 / 0.86);
  box-shadow: var(--shadow-lg);
}
.admin-head h2 { font-size: 40px; }
.astat {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  background: var(--dashboard-card);
  box-shadow: var(--dashboard-shadow-soft);
}
.astat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #050505;
}
.astat:nth-child(2)::before { background: linear-gradient(90deg, var(--signal-green), #63b58a); }
.astat:nth-child(3)::before { background: linear-gradient(90deg, var(--nordik-blue), #4b7fd0); }
.astat:nth-child(4)::before { background: linear-gradient(90deg, var(--signal-green), var(--nordik-red)); opacity: 0.72; }
.astat:hover {
  transform: translateY(-1px);
  border-color: var(--dashboard-border-strong);
  box-shadow: var(--dashboard-shadow);
}
.astat-lbl { color: var(--dashboard-muted); letter-spacing: 0.08em; }
.astat-val { color: #10201b; }
.astat-sub { color: #666; }
.export-card { border-radius: 20px; background: rgb(255 255 255 / 0.84); }

/* Primary admin actions use the brand action colour, not ink */
.gate .btn, .export-card .btn {
  background: var(--green-deep); border-color: var(--green-deep); color: #fff;
}
.gate .btn:hover, .export-card .btn:not([disabled]):hover {
  background: var(--green-deep-hover); border-color: var(--green-deep-hover);
}

/* ── Admin: full-height left rail + content (app-style) ─────── */
/* Dashboard is full-bleed so the rail sits flush to the edge;
   the login gate stays centered (rule above). */
body[data-route="admin"] .admin-wrap:has(.admin-shell) {
  max-width: none; padding: 0; margin: 0;
}
.admin-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.topbar .admin-header-actions {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-height: none;
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-right: 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.topbar .admin-header-actions::before { content: none; }
.topbar .admin-header-actions .export-menu { width: 132px; }
.topbar .admin-header-actions .export-menu .rail-btn-primary,
.topbar .admin-header-actions .rail-btn-ghost {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid rgb(0 0 0 / 0.16);
  box-shadow: none;
}
.topbar .admin-header-actions .export-menu .rail-btn-primary:not(:disabled):hover,
.topbar .admin-header-actions .rail-btn-ghost:hover {
  background: #f3f2ef;
  border-color: rgb(0 0 0 / 0.24);
  color: #1f1f1f;
}
.topbar .admin-header-actions .rail-spacer { display: none; }
.topbar .admin-header-actions .rail-foot {
  border: 0;
  margin: 0;
  padding: 0;
}
.topbar .admin-header-actions .rail-btn-ghost {
  min-width: 92px;
}

.admin-rail {
  flex: 0 0 280px;
  width: 280px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 28px 12px 16px;
  background: #fff;
  border-right: 1px solid var(--dashboard-border);
  box-shadow: none;
  overflow: visible;
}
.admin-rail::before { content: none; }
.rail-head { padding: 4px 8px 12px; }
.rail-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3);
}

.rail-btn {
  display: flex; align-items: center; gap: 9px;
  width: 100%; min-height: 42px; padding: 0 14px;
  border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.rail-btn-primary { background: var(--green-deep); color: #fff; border-color: var(--green-deep); justify-content: center; }
.rail-btn-primary:not(:disabled):hover { background: var(--green-deep-hover); border-color: var(--green-deep-hover); }
.rail-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.rail-meta { padding: 7px 12px 0; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

/* Export dropdown (format picker) */
.export-menu {
  position: relative;
  width: 100%;
  margin: 2px 0 0;
}
.export-menu .rail-btn-primary {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 18px;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  border-color: rgb(0 0 0 / 0.16);
  background: #fff;
  color: #1f1f1f;
  box-shadow: none;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.export-icon,
.export-caret {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.export-icon svg,
.export-caret svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.export-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(-0.5px);
}
.export-caret {
  margin-left: 0;
  opacity: 0.82;
}
.export-caret svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}
.export-menu .rail-btn-primary:not(:disabled):hover {
  background: #f3f2ef;
  border-color: rgb(0 0 0 / 0.24);
  color: #1f1f1f;
  box-shadow: none;
}
.export-menu-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: calc(50% + 24px);
  right: 0;
  z-index: 20;
  width: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: 9px;
  box-shadow: 0 12px 24px -18px rgb(20 32 28 / 0.45), 0 1px 3px rgb(20 32 28 / 0.06);
  transform: none;
}
.export-menu.open .export-menu-list { display: block; }
.export-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 32px;
  text-align: left;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-1);
  cursor: pointer;
}
.export-menu-item svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--fg-3); }
.export-menu-item:hover { background: var(--signal-green-2); color: var(--green-deep); }
.export-menu-item:hover svg { color: var(--green-deep); }
.rail-meta {
  padding-left: 6px;
}

.rail-section-label {
  margin-top: 16px; padding: 12px 12px 8px;
  border-top: 1px solid rgb(0 0 0 / 0.12);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: #7a8580;
}

/* collaborators — rail list, no card chrome */
.collab { display: flex; flex-direction: column; min-height: 0; }
.collab-form { display: flex; gap: 6px; padding: 0 4px; }
.collab-form .input { min-height: 36px; font-size: 13px; }
.collab-form .btn-add {
  width: auto; flex: 0 0 auto; min-height: 36px; padding: 0 14px;
  background: var(--green-deep); border-color: var(--green-deep); color: #fff; box-shadow: none;
}
.collab-form .btn-add:hover { background: var(--green-deep-hover); border-color: var(--green-deep-hover); }
.collab-err { min-height: 13px; padding: 3px 8px 0; font-family: var(--font-mono); font-size: 10.5px; color: var(--crimson); }
.collab-list { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; overflow-y: auto; }
.collab-empty { padding: 6px 10px; font-size: 12px; color: var(--fg-3); }
.collab-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; }
.collab-item:hover { background: var(--bg-2); }
.collab-avatar {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-deep); color: #fff; font-size: 11px; font-weight: 600;
}
.collab-email { flex: 1; min-width: 0; font-size: 12.5px; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collab-remove {
  flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 6px;
  background: transparent; color: var(--fg-3); font-size: 17px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.collab-item:hover .collab-remove { opacity: 1; }
.collab-remove:hover { background: var(--crimson-2); color: var(--crimson); }

.rail-spacer { flex: 1 1 auto; }

/* account + log out pinned to the bottom of the rail */
.rail-foot { border-top: 1px solid var(--dashboard-border); margin-top: 8px; padding-top: 8px; }
.role-badge {
  display: inline-block;
  margin: 0 0 8px 2px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #5f6b66;
  background: rgb(36 122 90 / 0.08);
  border: 1px solid rgb(36 122 90 / 0.16);
}
.rail-account { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.rail-avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--green-deep); color: #fff; font-size: 11px; font-weight: 600;
}
.rail-account-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rail-account-copy b { font-size: 13px; font-weight: 600; }
.rail-account-copy small { font-size: 11px; color: var(--fg-3); }
.rail-btn-ghost {
  justify-content: center;
  background: #fff;
  color: #404040;
  border-color: rgb(0 0 0 / 0.16);
  min-height: 42px;
  min-width: 140px;
  border-radius: 8px;
  font-weight: 500;
}
.rail-btn-ghost:hover {
  background: #f3f2ef;
  border-color: rgb(0 0 0 / 0.24);
  color: #1f1f1f;
}

/* content column */
.admin-content { flex: 1; min-width: 0; padding: 28px 32px; }
.admin-content {
  background:
    transparent;
}
.admin-content .admin-head { margin-bottom: 20px; }
.admin-content .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }

/* ── dashboard analytics ────────────────────────────────────── */
.admin-grid { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-analytics-split {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}
.admin-analytics-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: flex-start;
  min-height: 0;
}
/* Trimmed dashboard: only the Homepage-variant and Email-invitation cards remain,
   stacked and centred under the stat row. */
.admin-analytics-center {
  margin: 16px auto 0;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-card {
  position: relative;
  overflow: hidden;
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: var(--dashboard-shadow-soft);
}
.chart-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #050505;
}
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chart-head h4 { font-size: 15px; font-weight: 650; color: #10201b; }
.chart-sub { font-family: var(--font-mono); font-size: 11px; color: #666; white-space: nowrap; }
.chart-empty { display: grid; place-items: center; min-height: 110px; padding: 0 16px; text-align: center; color: #666; font-size: 13px; line-height: 1.5; }

/* Homepage variant funnel table */
.variant-table { display: flex; flex-direction: column; }
.variant-row { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); align-items: center; padding: 10px 4px; border-top: 1px solid rgb(0 0 0 / 0.08); }
.variant-row > span { font-size: 13.5px; color: #1f1f1f; text-align: right; font-family: var(--font-mono); }
.variant-row > span:first-child { text-align: left; font-family: var(--font-sans); }
.variant-id { font-weight: 600; }
.variant-head {
  border-top: 0;
  margin: 0 -6px;
  padding-inline: 10px;
  border-radius: 6px;
  background: #f3f2ef;
}
.variant-head > span { font-family: var(--font-mono); font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.06em; }
.chan-row { grid-template-columns: 1.6fr 1fr 1fr; }
.vc-row { grid-template-columns: 0.8fr 1.3fr 1fr 1fr 1fr; }
.vc-row > span:nth-child(2) { text-align: left; font-family: var(--font-sans); }

/* Channel-aware privacy note on the consent step */
.consent-privacy { margin: -4px 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--fg-3); max-width: 560px; }

/* Email invitations manager */
.invite-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.invite-emails { min-height: 76px; resize: vertical; }
.invite-card {
  height: 338px;
  min-height: 0;
  padding: 16px 20px 14px;
  display: flex;
  flex-direction: column;
}
.invite-admin-content {
  display: grid;
  place-items: center;
  padding: 0;
  min-height: calc(100vh - 112px);
}
.invite-admin-content .invite-card-focused {
  width: min(620px, 100%);
  height: 338px;
  min-height: 0;
  padding: 16px 20px 14px;
  border-radius: 8px;
  box-shadow: var(--dashboard-shadow-soft);
}
.invite-admin-content .invite-card-focused .chart-head {
  align-items: baseline;
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: 0;
}
.invite-admin-content .invite-card-focused .chart-head h4 {
  font-size: 15px;
  letter-spacing: -0.02em;
}
.invite-admin-content .invite-card-focused .chart-sub {
  padding-top: 0;
}
.invite-admin-content .invite-card-focused .invite-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 0;
}
.invite-admin-content .invite-card-focused .invite-emails {
  height: 42px;
  min-height: 42px;
  padding-inline: 11px;
  border-radius: 7px;
}
.invite-admin-content .invite-card-focused .btn-sm {
  align-self: flex-start;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 9px;
}
.invite-admin-content .invite-card-focused .invite-list-wrap {
  margin-top: 18px;
}
.invite-admin-content .invite-card-focused .invite-list-wrap:empty {
  display: block;
  min-height: 0;
  border: 0;
  margin-top: 0;
  padding: 0;
  background: transparent;
}
.invite-card .chart-head { margin-bottom: 10px; }
.invite-card .invite-form { gap: 8px; margin-bottom: 0; }
.invite-card .invite-emails {
  min-height: 42px;
  height: 42px;
  resize: none;
  overflow: hidden;
  color: #14201c;
  background: #fff;
  border-color: rgb(0 0 0 / 0.18);
}
.invite-card .invite-emails::placeholder { color: #8b948f; }
.invite-card .invite-emails:focus {
  border-color: rgb(36 122 90 / 0.46);
  box-shadow: 0 0 0 4px rgb(36 122 90 / 0.13);
}
.invite-card .btn-sm { min-height: 32px; padding: 0 14px; }
.invite-card .invite-list-wrap {
  min-height: 0;
  margin-top: 8px;
  background:
    #fff;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.22) transparent;
  border: 1px solid rgb(0 0 0 / 0.1);
  border-radius: 8px;
  padding: 0 12px;
}
.invite-card .invite-list-wrap:empty {
  display: none;
  margin-top: 0;
}
.invite-card .chart-empty {
  min-height: 0;
  padding: 2px 0 0;
  place-items: start;
  text-align: left;
}
.btn-sm { align-self: flex-start; min-height: 36px; padding: 0 16px; font-size: 13px; }
.invite-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; color: var(--fg-2); }
.invite-card .invite-summary { display: none; }
.invite-table { display: flex; flex-direction: column; min-height: 0; }
.invite-table-body {
  min-height: 0;
  max-height: 104px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(20 32 28 / 0.22) transparent;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.invite-table-body::-webkit-scrollbar { width: 8px; }
.invite-table-body::-webkit-scrollbar-track { background: transparent; }
.invite-table-body::-webkit-scrollbar-thumb {
  background: rgb(20 32 28 / 0.2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.invite-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(108px, 0.72fr) minmax(116px, auto); align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgb(0 0 0 / 0.08); }
.invite-head {
  border-top: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 -6px 2px;
  padding: 10px 10px;
  border-radius: 6px;
  background: #f3f2ef;
  box-shadow: none;
}
.invite-head > span { font-family: var(--font-mono); font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.06em; }
.invite-email { font-size: 13px; color: #172721; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #66726c; }
.invite-status-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-grid;
  place-items: center;
}
.invite-status-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.invite-status.is-not-started { color: #7a8580; }
.invite-status.is-started { color: #b87912; }
.invite-status.is-completed,
.invite-status.done { color: var(--signal-green); }
.invite-link { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.btn-copy {
  font-family: var(--font-sans); font-size: 12px; color: var(--green-deep);
  background: rgb(36 122 90 / 0.1); border: 1px solid rgb(36 122 90 / 0.28);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap;
  line-height: 1.1;
}
.btn-copy:hover { background: rgb(36 122 90 / 0.16); }
.btn-copy-ghost {
  color: #6c7772;
  background: transparent;
  border-color: rgb(20 32 28 / 0.14);
}
.btn-copy-ghost:hover {
  color: var(--green-deep);
  background: rgb(36 122 90 / 0.08);
  border-color: rgb(36 122 90 / 0.22);
}

.area-svg { width: 100%; height: 150px; display: block; }
.area-fill { fill: rgb(36 122 90 / 0.12); }
.area-line { fill: none; stroke: var(--signal-green); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.area-axis { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-3); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 152px 1fr 32px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--fog); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--signal-green); border-radius: 999px; transition: width 400ms var(--ease); }
.bar-val { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); text-align: right; }

@media (max-width: 900px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-analytics-split { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 30px; }
}

@media (max-width: 1024px) {
  .admin-content .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .admin-shell { flex-direction: column; min-height: 0; }
  .admin-rail {
    flex: none; width: 100%; height: auto; max-height: none; position: static;
    flex-direction: column;
    align-items: stretch;
    border-right: 0; border-bottom: 1px solid var(--dashboard-border);
  }
  .export-menu { width: 100%; }
  .rail-spacer { display: none; }
  .rail-btn-ghost { width: 100%; }
  .admin-content { padding: 22px 16px; }
  .invite-admin-content { min-height: auto; }
}
@media (max-width: 480px) {
  .admin-content .admin-stats { grid-template-columns: 1fr; }
}
.export-card .btn[disabled] { background: var(--green-deep); border-color: var(--green-deep); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-copy { max-width: 720px; }
  .hero-visual { width: min(650px, 100%); margin: 0 auto; }
  .hero-map { width: min(700px, 100%); min-height: auto; margin: 0 auto; }
  .home-details { grid-template-columns: 1fr; gap: 52px; }
}

@media (max-width: 720px) {
  .topbar { height: 64px; flex-basis: 64px; padding: 0 18px; }
  .brand-sub { display: block; }
  .hero { width: calc(100% - 36px); max-width: 620px; min-height: auto; padding: 24px 0 56px; gap: 50px; }
  .hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .home-lede { font-size: 17px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 15px; }
  .trust-row { gap: 14px 20px; margin-top: 28px; }
  .hero-visual { min-height: 470px; }
  .hero-map { min-height: auto; }
  .hero-map img { border-radius: 18px; }
  .map-location-label {
    padding: 6px 8px;
    font-size: 10px;
  }
  .preview-card { width: calc(100% - 24px); margin: 0; transform: none; }
  .preview-body { padding: 27px 22px 24px; }
  .preview-body h2 { font-size: 23px; }
  .reward-card { left: -4px; bottom: 9px; }
  .location-chip { right: -4px; top: 7px; }
  .hero-visual::before { inset: 14px 0 22px 20px; }
  .home-details { width: calc(100% - 36px); max-width: 620px; padding: 76px 0 82px; }
  .detail-grid { grid-template-columns: 1fr; gap: 34px; }
  .detail-grid h3 { margin-top: 20px; }
  .home-cta {
    width: calc(100% - 36px); margin-bottom: 18px; padding: 38px 28px;
    flex-direction: column; align-items: flex-start;
  }
  .home-cta h2 { font-size: 29px; }
  .survey-wrap { width: 100%; padding: 22px 14px 80px; overflow: hidden; }
  .progress-card { top: 76px; }
  .q-block { min-height: 0; padding: 30px 22px 32px; border-radius: 18px; }
  .q-text { font-size: 29px; }
  .q-nav { padding: 0 3px; flex-wrap: wrap; }
  .q-nav .q-hint, .q-nav .kbd-hint { display: none; }
  .admin-wrap { padding: 38px 16px 70px; }
}

@media (max-width: 480px) {
  .brand-sub { display: none; }
  .hero h1 { font-size: 36px; }
  .hero-copy, .home-lede, .q-text, .q-help { min-width: 0; overflow-wrap: anywhere; }
  .hero-visual { min-height: 445px; margin-top: -12px; }
  .preview-top { padding-inline: 16px; }
  .preview-progress { margin-inline: 16px; }
  .preview-footer { padding-inline: 16px; }
  .reward-card { transform: none; }
  .location-chip { font-size: 10px; }
  .home-cta .btn { width: 100%; white-space: normal; }
  .progress-card { position: relative; top: auto; }
  .q-nav { width: 100%; }
  .q-nav .btn { padding-inline: 15px; }
  .q-nav-spacer { min-width: 8px; }
}

/* Compact survey respondent experience */
body[data-route="survey"] {
  background: var(--nordik-bg);
  background-attachment: fixed;
}
body[data-route="survey"] .topbar {
  height: 58px; flex-basis: 58px;
  background: #ffffff;
}
body[data-route="survey"] .brand-name { font-size: 14px; }
body[data-route="survey"] .brand-sub { display: none; }

.survey-wrap {
  width: min(100%, 590px); max-width: 590px;
  margin: 0 auto; padding: 28px 20px 60px;
}
.progress-card {
  position: static;
  margin: 0 0 38px; padding: 0;
  background: transparent; border: 0; border-radius: 0;
  box-shadow: none; backdrop-filter: none;
}
.progress-top {
  justify-content: flex-end;
  margin-bottom: 8px;
}
.progress-section {
  gap: 7px; color: #34423d;
  font-size: 11px; font-weight: 600; letter-spacing: 0;
}
.progress-section::before { width: 5px; height: 5px; }
.progress-count {
  color: #89918d; font-family: var(--font-sans); font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  width: 100%; height: 6px; overflow: hidden;
  background: #dedfdb; border-radius: 999px;
}
.progress-track span {
  display: block; height: 100%;
  /* Ink on the #dedfdb groove is 12.5:1, so the fill needs no gradient or
     darkened tip to be seen: where progress stops is the fill's own edge. */
  background: var(--ink);
  border-radius: inherit;
  transition: width 300ms var(--ease);
}
.stepper { display: none; }

.q-block {
  min-height: 0; padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.q-num {
  margin-bottom: 9px; color: var(--signal-green);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
}
.q-text {
  max-width: 560px; margin-bottom: 7px;
  font-size: clamp(23px, 2.5vw, 30px); line-height: 1.14;
  letter-spacing: -0.03em; font-weight: 600;
}
.q-help {
  max-width: 520px; margin-bottom: 20px;
  font-size: 13px; line-height: 1.45;
}

.options { gap: 6px; }
.opt {
  min-height: 40px; padding: 6px 10px; gap: 9px;
  border-color: #d9ddd9; border-radius: 7px;
  font-size: 12.5px;
}
.opt:hover {
  border-color: #8aa799; box-shadow: none; transform: none;
}
.opt.on { border-color: #6e9f87; background: #edf4f0; }
.opt-mark { width: 16px; height: 16px; flex-basis: 16px; }
.opt-mark::after { width: 7px; height: 7px; }
.opt-key {
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 4px; font-size: 9px;
}

.field, .select-wrap, input.input { max-width: 100%; }
.field { gap: 6px; }
.field-lbl {
  color: #65716c; font-family: var(--font-sans);
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
}
.input {
  min-height: 42px; padding: 9px 11px;
  border-color: #d5d9d6; border-radius: 7px;
  background: #fff; box-shadow: none; font-size: 14px;
}
.input:hover { border-color: #9ba6a1; }
textarea.input { min-height: 100px; font-size: 14px; }
input.input[type="email"] {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
}
.contact-field,
.contact-field input.input[type="email"] {
  width: 100%;
  max-width: 100%;
}
.gift-card-email {
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
}
.gift-card-email[hidden] { display: none; }
.gift-card-email input.input[type="email"] {
  width: 100%;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
}
select.input {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 36px;
  height: 36px;
  padding: 6px 36px 6px 10px;
  border: 1px solid #d9ddd9;
  border-radius: 7px;
  background-color: #fff;
  box-shadow: none;
  font-size: 12.5px;
}
select.input:hover { border-color: #8aa799; }
select.input:focus {
  border-color: #6e9f87;
  box-shadow: 0 0 0 2px rgb(36 122 90 / 0.1);
}
.select-wrap::after {
  right: 12px;
  font-size: 11px;
}
.q-block > .field,
.q-block > .field .select-wrap,
.q-block > .field .custom-select {
  width: 100%;
  max-width: none;
}
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select-trigger {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
  border: 1px solid #d9ddd9;
  border-radius: 7px;
  background: #fff;
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.custom-select-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-trigger:hover { border-color: #8aa799; }
.custom-select-trigger:focus {
  outline: none;
  border-color: #6e9f87;
  box-shadow: 0 0 0 2px rgb(36 122 90 / 0.1);
}
.custom-select-caret {
  flex: 0 0 auto;
  color: #65716c;
  font-size: 10px;
}
.custom-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d9ddd9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px -18px rgb(20 32 28 / 0.45);
}
.custom-select.open .custom-select-menu { display: block; }
/* searchable picklist (reuses the dropdown look; just adds a filter box) */
.custom-select-menu.has-search { max-height: none; overflow: visible; }
.custom-select-search {
  width: 100%; box-sizing: border-box; margin: 0 0 6px;
  padding: 6px 9px; font-family: var(--font-sans); font-size: 12.5px;
  border: 1px solid #d9ddd9; border-radius: 6px; background: #fff; color: var(--fg-1);
}
.custom-select-search:focus { outline: none; border-color: #6e9f87; box-shadow: 0 0 0 2px rgb(36 122 90 / 0.1); }
.custom-select-list { max-height: 210px; overflow-y: auto; }
.custom-select-empty { padding: 8px 9px; color: #65716c; font-size: 12px; }

/* The question block has a transform (entrance animation) which forms a
   stacking context; keep it above the nav so an open dropdown covers the
   faded "next" arrow instead of showing it through like a watermark. */
.q-block { position: relative; z-index: 2; }
.q-nav { position: relative; z-index: 1; }

/* Final page: CAPTCHA gate + explicit Submit (no arrows) */
.submit-area {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 20px;
}
.btn-back-link {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; cursor: pointer;
  background: var(--green-deep);
  color: var(--paper);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  min-height: 36px; padding: 0 14px;
  border-radius: 7px;
  box-shadow: none;
}
.btn-back-link:hover { background: var(--green-deep-hover); color: var(--paper); }
.captcha-wrap { display: flex; justify-content: center; }
/* scale down the fixed-size Cloudflare widget so it sits neatly, roughly
   the width of the Submit button; negative margins collapse the leftover
   layout box so spacing stays tight */
.cf-turnstile-box {
  transform: scale(0.63, 0.58);
  transform-origin: center;
  margin: -14px -56px;
}
.btn-submit {
  min-width: 180px;
  padding: 10px 30px;
  font-size: 14px; font-weight: 600;
  background: var(--signal-green); color: #fff;
  border: 0; border-radius: 9px; cursor: pointer;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}
.btn-submit:hover:not(:disabled) { transform: none; background: var(--green-deep-hover); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Mobile (esp. iOS Safari): register taps immediately and don't let the
   double-tap-zoom gesture swallow the first tap on buttons/dropdowns. */
button, a, label, [role="button"],
.opt, .custom-select-trigger, .custom-select-option, .rate-dot,
.btn, .btn-nav-arrow, .btn-copy, .invite-eye, .opt-help {
  touch-action: manipulation;
}
.custom-select-option {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.custom-select-option { display: flex; align-items: center; gap: 8px; }
.cso-label { flex: 1 1 auto; min-width: 0; }
.custom-select-option .cso-speak { width: 24px; height: 24px; padding: 4px; }
.custom-select-option:hover { background: #f1f4f2; }
.custom-select-option.on {
  background: #e8f2ed;
  color: #176346;
  font-weight: 500;
}

.q-nav {
  width: 100%;
  /* The card is 40px tall and the arrow ink inside it is 14px, so 13px of the
     card is empty above the glyph. Measured from the last option's bottom edge
     to the arrow's visible ink, the old 46px margin read as a 61px hole; 18px
     brings the visible gap to ~31px without shrinking the tap target. */
  margin-top: 18px;
  margin-left: 0;
  padding: 0;
  transform: none;
  display: flex; align-items: center; gap: 12px;
}
.q-nav .btn {
  min-height: 35px; padding: 0 12px;
  border-radius: 7px; font-size: 12px; box-shadow: none;
}
.q-nav .btn-nav-arrow {
  /* One small green card per arrow. The glyph is white, and before this it had
     to be defended with a dark halo because its backing could be any brightness
     — photo, paper or panel. A solid green card gives it a known, darker
     backing (white on #247a5a is 5.3:1), so both arrows read at a glance.
     40px tall and 7px radius are the survey's own row metrics (the option and
     rating cards use exactly these), so the pair at the bottom sits in the same
     family of surfaces as the answers above instead of towering over them: a
     small 48x40 rectangle, not a slab. */
  width: 48px; height: 40px; min-width: 48px; min-height: 40px; padding: 0;
  box-sizing: border-box;
  border: 0; border-radius: 7px;
  background: var(--green-deep);
  color: var(--nav-arrow);
  box-shadow: none;
  /* .btn brings its own :hover / :active lifts; the arrow must not shift inside
     its card. The RTL mirror (an ID rule) still wins over this. */
  transform: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.q-nav .btn-nav-arrow svg {
  /* width fixed, height follows the 22:14 viewBox so the block arrow keeps its
     proportions at every size */
  width: 22px; height: auto; display: block;
  /* The white glyph sits on a known colour now: a soft dark shadow is enough
     depth, and the tight hard edge that existed only to separate white from
     white paper would read as dirt on the green. */
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.3));
}
/* "next": the same path flipped, so one shape serves both directions */
.q-nav .btn-nav-arrow.is-next svg { transform: scaleX(-1); }
/* Hover darkens the card, the way .btn-hero does — the card is a real surface
   now, so it can respond. The glyph itself must still not move: .btn lifts its
   :hover by translateY(-1px), which is what made the arrow creep as the pointer
   entered and left, so the transform is cancelled while the colour changes. */
.q-nav .btn-nav-arrow:not([disabled]):hover {
  background: var(--green-deep-hover); color: var(--nav-arrow);
  transform: none; box-shadow: none;
}
.q-nav .btn-nav-arrow:focus-visible {
  border-radius: 7px;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 0 0 4px rgb(20 32 28 / 0.55);
}
.q-nav .btn-nav-arrow[disabled] {
  /* Fading the whole card out is not an option: a faint white arrow on a washed
     green still reads as a smudge, and the pair would stop looking like a pair.
     So the card keeps its colour and only the glyph steps back to 60% white
     (~3:1 on the card) — it keeps a real shape while clearly losing to the
     full-white active arrow. .q-nav .btn[disabled] keeps not-allowed. */
  opacity: 1;
  background: var(--green-deep); border: 0;
  color: rgb(255 255 255 / 0.6);
  box-shadow: none;
}
.q-nav .btn-nav-arrow[disabled] svg {
  /* the white halo that separated a grey arrow from the photo's dark patches
     would be invisible on green; the card needs no halo at all */
  filter: none;
}
.kbd-hint, .q-hint { font-size: 10px; }

.grid-rate { gap: 6px; }
.rate-row { min-height: 40px; padding: 4px 10px; gap: 10px; background: #fff; border-color: #d9ddd9; border-radius: 7px; box-shadow: none; }
.rate-name { font-size: 12px; }
.rate-name span { font-size: 10px; }
.rate-scale { gap: 4px; }
.rate-dot {
  width: 27px; height: 27px;
  border-radius: 5px; font-size: 10.5px;
}
.optin {
  max-width: 420px; margin-bottom: 13px; padding: 11px;
  border-radius: 8px; box-shadow: none;
}
.optin-text { font-size: 13px; }
.optin-text span { font-size: 11px; }

.state-card { margin-top: 48px; }
.state-card.card {
  padding: 30px; border-radius: 14px; box-shadow: var(--shadow-md);
}
body[data-route="survey"] .state-card {
  max-width: 100%;
  margin: 42px 0 0;
}
body[data-route="survey"] .state-card.card {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body[data-route="survey"] .state-card .pill {
  margin-bottom: 16px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 10px;
}
body[data-route="survey"] .state-card h2 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 600;
}
body[data-route="survey"] .state-card p {
  max-width: 520px;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.5;
}
body[data-route="survey"] .receipt {
  margin-top: 24px;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid #d9ddd9;
  border-bottom: 1px solid #d9ddd9;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 12px;
}
body[data-route="survey"] .receipt div {
  padding: 6px 0;
}
body[data-route="survey"] .receipt .k {
  color: #75807b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body[data-route="survey"] .state-card .actions {
  margin-top: 24px;
}
body[data-route="survey"] .state-card .actions .btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  background: var(--green-deep);
  border-color: var(--green-deep);
  font-size: 12px;
  box-shadow: none;
}
body[data-route="survey"] .state-card .actions .btn:hover {
  background: var(--green-deep-hover);
  transform: none;
}
/* The Home button carries .btn-ghost (muted --fg-2 text); on the green fill
   that reads as faint, so force white text here, including on hover. */
body[data-route="survey"] .state-card .actions .btn.btn-ghost,
body[data-route="survey"] .state-card .actions .btn.btn-ghost:hover {
  color: var(--paper);
}

@media (max-width: 560px) {
  body[data-route="survey"] .topbar { height: 54px; flex-basis: 54px; }
  .survey-wrap { padding: 23px 18px 56px; }
  .progress-card { margin-bottom: 34px; }
  .q-text { font-size: 25px; line-height: 1.14; }
  .q-help { margin-bottom: 19px; }
  .opt { min-height: 40px; }
  .q-nav {
    width: 100%;
    /* same reason as the desktop rule: the margin is mostly eaten by the 40px
       card around a 14px arrow */
    margin-top: 14px;
    margin-left: 0;
    transform: none;
  }
  .q-nav .q-hint, .q-nav .kbd-hint { display: none; }
}

/* ── in-page information cards ──────────────────────────────────────────────
   Open from the "Survey Information Letter" / "Consent Information" labels in
   the consent step instead of sending the respondent to an external Google Doc.
   One shell serves both: header, scrolling body, footer with Close. Lives
   outside #view-survey, so it carries its own dir attribute; spacing uses
   logical properties and mirrors on its own in RTL. */
body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(20 32 28 / 0.45);
  animation: modal-fade 160ms var(--ease) both;
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(78vh, 680px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 30px 32px 22px;
  background: #fff;
  border-radius: var(--r-2xl);
  box-shadow: 0 32px 70px -28px rgb(20 32 28 / 0.5), 0 2px 8px rgb(20 32 28 / 0.08);
  text-align: start;
  animation: modal-rise 200ms var(--ease) both;
}

.modal-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--ink);
}

/* the only scrolling region: the header and the Close button stay put */
.modal-body {
  margin-top: 16px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  align-content: start;
  gap: 13px;
}

.modal-list li {
  position: relative;
  padding-inline-start: 20px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

.modal-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--signal-green);
}

/* the letter's headed sections */
.modal-h {
  margin: 20px 0 7px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.modal-h:first-child { margin-top: 0; }

.modal-p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-2);
  text-wrap: pretty;
}
.modal-p:last-child { margin-bottom: 0; }

/* researcher contact block */
.modal-contact {
  margin: 0 0 12px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid var(--border-1);
  display: grid;
  gap: 2px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
}
.modal-contact-name { font-weight: 600; color: var(--ink); }

.modal-note {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-1);
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
  color: var(--fg-3);
}

.modal-mail { color: var(--green-deep); text-decoration: none; }
.modal-mail:hover { text-decoration: underline; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-1);
}

.modal-close {
  min-height: 40px;
  padding: 0 20px;
  border-radius: var(--r-lg);
  font-size: 13px;
}

/* the label keeps its link look but is a button, so it never navigates away */
.q-text .q-link-btn {
  font: inherit;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--green-deep);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.q-text .q-link-btn:hover { color: var(--signal-green); }
.q-text .q-link-btn:focus-visible {
  outline: none;
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgb(47 122 92 / 0.25);
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .modal-overlay { padding: 14px; align-items: flex-end; }
  .modal-card { padding: 24px 22px 18px; max-height: 84vh; }
  .modal-actions { justify-content: stretch; }
  .modal-close { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-card { animation: none; }
}

/* ── Waterfront background (survey page; admin backdrop; never home) ────────
   Image only: no text, no type or colour rules touched. The photo is drawn as
   the page background at its own 1512x1040 framing — `cover` from the bottom
   edge — so every object stays in frame: the docks, the pavilion, the red-roof
   building and the ducks on the water. A viewport only taller than 1512/1040
   crops sky off the top, which the warm wash below covers anyway. */
body[data-route="survey"] { background: var(--paper) url("assets/waterfront-bg.png") 50% 100% / cover no-repeat fixed; }
/* Warm cream wash over the sky at the top edge. It holds full strength behind
   the question and the first rows (0–200px, where the text sits at y 172–207),
   then eases out over the next 240px in eight steps until it is fully gone by
   440px, several hundred pixels above the marina, pavilion and ducks — so the
   photo is untouched there and the transition has no visible edge. The stops
   are in px, not %, because the question's position does not move with the
   viewport height: a percentage hold would thin out on short screens and let
   the shoreline and cloud edges cut through the glyphs again. */
body[data-route="survey"]::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: clamp(440px, 46vh, 540px);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgb(253 247 221 / 0.92) 0,
    rgb(253 247 221 / 0.92) 200px,
    rgb(253 247 221 / 0.88) 244px,
    rgb(253 247 221 / 0.78) 286px,
    rgb(253 247 221 / 0.61) 328px,
    rgb(253 247 221 / 0.42) 368px,
    rgb(253 247 221 / 0.22) 404px,
    rgb(253 247 221 / 0.07) 428px,
    rgb(253 247 221 / 0) 440px);
}

/* Admin keeps the same photo as a fixed backdrop behind the console. */
body[data-route="admin"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--dashboard-bg) url("assets/waterfront-bg.png") 50% 100% / cover no-repeat;
}

/* Narrow screens would crop the sides (and the ducks) with `cover`, so fit the
   full width and sit the photo on the bottom edge instead: every object stays
   visible, at the cost of a shorter strip of photo. The wash follows the photo
   there: it starts at the strip's top edge (the image is width-proportional, so
   the strip is always 1512:1040 of the viewport width) and eases out over the
   sky, which also softens the paper-to-photo seam. */
@media (max-width: 640px) {
  /* On phones the photo and its fade are drawn as ONE layered background on this
     element, both anchored to the bottom, so they can never drift apart the way a
     separate fixed wash does (the earlier "two separated images" seam). The photo
     is 1512x1040 -> 0.6878 tall, so at full width it is 68.78vw high. The wash
     layer is sized and positioned identically, and its top colour is --paper
     (#F6F5F0) -- the exact page colour -- so where it is opaque it is
     indistinguishable from the paper above it: no seam, no colour step. It then
     fades to transparent over the sky so the marina, pavilion and ducks keep
     their detail. */
  body[data-route="survey"] {
    background:
      linear-gradient(to bottom,
        #F6F5F0 0%,
        #F6F5F0 16%,
        rgba(246, 245, 240, 0.94) 28%,
        rgba(246, 245, 240, 0.74) 40%,
        rgba(246, 245, 240, 0.50) 52%,
        rgba(246, 245, 240, 0.28) 64%,
        rgba(246, 245, 240, 0.12) 76%,
        rgba(246, 245, 240, 0) 88%)
        50% 100% / 100% 68.78vw no-repeat,
      url("assets/waterfront-bg.png") 50% 100% / 100% auto no-repeat,
      var(--paper);
  }
  /* The fade now lives in the background above; drop the separate fixed wash. */
  body[data-route="survey"]::before { display: none; }
}
/* Landscape phones: the viewport is wider than 640px, so the portrait rule above
   no longer applies and the device would fall back to the desktop `cover`/`fixed`
   background -- and `fixed` is the unreliable one on mobile. Catch the short-and-
   wide case here and use the same single-element merged background, but size the
   photo with `cover` (at this short height a full-width photo would be far taller
   than the screen). The wash fills the viewport, holding --paper over the top so
   the question sits on paper, then fading to reveal the waterfront along the
   bottom. One element, bottom-anchored: no separable layers, no seam. */
@media (orientation: landscape) and (max-height: 540px) {
  body[data-route="survey"] {
    background:
      linear-gradient(to bottom,
        #F6F5F0 0%,
        #F6F5F0 60%,
        rgba(246, 245, 240, 0.82) 72%,
        rgba(246, 245, 240, 0.46) 82%,
        rgba(246, 245, 240, 0.16) 91%,
        rgba(246, 245, 240, 0) 100%)
        50% 0 / 100% 100% no-repeat,
      url("assets/waterfront-bg.png") 50% 100% / cover no-repeat,
      var(--paper);
  }
  body[data-route="survey"]::before { display: none; }
}

/* ── Language picker ───────────────────────────────────────── */
/* The pill in the header is the whole control: it opens the list of nine
   languages in place, directly beneath itself. No overlay, no second card. */
.lang-picker { position: relative; flex: 0 0 auto; }
/* Hidden on the one question whose options it would cover ("moved_from"). */
.lang-picker[hidden] { display: none; }
.lang-btn {
  min-height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-deep);
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms var(--ease), border-color 140ms var(--ease);
}
.lang-btn:hover { background: var(--bg-2, #f3f1ea); border-color: var(--green-deep); }
.lang-btn:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.lang-btn[aria-expanded="true"] { background: var(--bg-2, #f3f1ea); border-color: var(--green-deep); }

/* The list itself: a small panel under the pill, aligned to the page's
   trailing edge so it stays on screen in both writing directions. */
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 60;
  min-width: 100%;
  max-height: min(60vh, 360px);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md, 10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.lang-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  text-align: start;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-item:hover { background: var(--bg-2, #f3f1ea); }
.lang-item:focus-visible { outline: 2px solid var(--green-deep); outline-offset: -2px; }
/* the language already in use */
.lang-item.is-current { font-weight: 700; color: var(--green-deep); }
.lang-item.is-current::after { content: " ✓"; }

/* ── Pinned question layout ────────────────────────────────── */
/* A question with a long answer list must not drag its heading or its progress
   bar off screen while the respondent scrolls to the last option.
   So the survey screen fills the space under the topbar and the page itself
   never scrolls: the progress card and the question heading stay put, and only
   the answer block (.q-scroll) scrolls, inside its own region.
   Every offset here is logical (no left/right), so it behaves the same in the
   right-to-left languages. */
body[data-route="survey"] .shell {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body[data-route="survey"] #view-survey.active {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}
body[data-route="survey"] .survey-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: min(100%, 590px);
  max-width: 590px;
  margin: 0 auto;
  padding: 22px 20px 16px;
  min-height: 0;
  /* a state card (thank you, error) can still be taller than a short phone
     screen; it then scrolls here instead of being cut off */
  overflow-y: auto;
}
body[data-route="survey"] .survey-wrap > .progress-card { flex: 0 0 auto; }
body[data-route="survey"] .survey-wrap > .q-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* the heading: never squeezed by the answer list, but capped so an unusually
   long question can never take the whole screen — past the cap it scrolls
   inside itself and the options keep the rest */
.q-head {
  flex: 0 0 auto;
  max-height: 45%;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* no bar here either: it appeared only on Windows, and only for a question
     long enough to hit the 45% cap (see "no scrollbar" below) */
  overflow-x: hidden;
  scrollbar-width: none;
}
/* the answers: the one scrolling region. A minimum keeps a few rows in sight
   even when the heading is at its longest. */
.q-scroll {
  flex: 1 1 auto;
  min-height: 132px;
  padding-bottom: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* ── No scrollbar, but the edge still says more is below ──────
     The option list used to end in a raw OS scrollbar: the one piece of default
     browser chrome left on this screen, in the Windows grey, next to the app's
     own hand-built controls. It also only existed once a list was long enough
     to scroll, and a classic bar steals 15-17px, so the cards (and the arrows
     inside this region) changed width at that moment. Both are gone:
       · scrollbar-width: none          Firefox, and Chrome/Edge 121+
       · ::-webkit-scrollbar: none      older Chrome/Edge, and Safari with
                                        "always show scrollbars" turned on
     Nothing reserves a gutter either, so the cards keep one width whatever the
     list length. overflow-x must be hidden: with overflow-y alone the computed
     overflow-x is `auto`, which makes this a two-axis scroll box where one long
     unbreakable label brings a sideways bar back.
     Hiding the bar alone would leave a desktop respondent looking at a full
     column with no sign that the Next arrow sits below it — measured 112px past
     the bottom of this region at 1280x800, with 11 of 12 options in view — so
     .has-more-below (set by app.js from the real scroll metrics) adds the soft
     shadow at the bottom edge, and it goes away when the end is reached.
     The shadow is painted inside the region over the cut option rather than
     fading the region out: the page behind these cards is the waterfront photo
     (body[data-route="survey"] background), so a fade would dissolve white
     cards into dark water. */
  overflow-x: hidden;
  scrollbar-width: none;
}
.q-head::-webkit-scrollbar,
.q-scroll::-webkit-scrollbar { display: none; }
/* The shadow rides the bottom edge while answers are still below the fold. It is
   a ::after rather than an overlay element so it adds nothing to the DOM the
   layout tests measure, and its negative margin keeps the region's scroll height
   exactly as long as the content — 16px of paint, 0px of layout.
   bottom: -6px matches the region's own padding-bottom: overflow clips this
   region at its padding box, so `bottom: 0` would leave the shadow 6px short of
   the visible cut, above an unshadowed strip of the photo behind the page. */
.q-scroll.has-more-below::after {
  content: "";
  position: sticky;
  bottom: -6px;
  display: block;
  height: 16px;
  margin-top: -16px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(20 32 28 / 0), rgb(20 32 28 / 0.12));
}
/* ── The arrows follow the last option ─────────────────────── */
/* .q-nav is the last child of .q-scroll (app.js renderSurvey). It used to be a
   sibling of the question block, and the block was `flex: 1 1 auto`, so the
   block stretched to the bottom of the screen and pushed the arrows there: with
   two options on a 390x640 phone the last option ended at y=385 and the arrows
   started at y=582, a 197px band of empty space (368px on a desktop window).
   Inside the scrolling region they sit one row under the answers at any list
   length. Nothing here may give the nav its own place in the column again. */
.q-scroll:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
body[data-route="survey"] .survey-wrap > .submit-area {
  flex: 0 0 auto;
  margin-top: 14px;
  padding-bottom: 2px;
}
/* The arrows travel with the answers (see "arrows follow the last option"
   below): they are the last child of .q-scroll, so this margin is all that
   separates them from the option above — no stretched block between them. */
.q-scroll > .q-nav {
  margin-top: 14px;
  padding-bottom: 2px;
}
/* the answer block is now one level down; keep the field widths it relied on */
.q-scroll > .field,
.q-scroll > .field .select-wrap,
.q-scroll > .field .custom-select { width: 100%; max-width: none; }

/* ── Right-to-left (Arabic) ────────────────────────────────── */
/* The whole page mirrors from documentElement[dir=rtl]: text alignment, flex
   order, paddings and the progress bar all follow the direction. Only the
   things CSS cannot infer are listed here. */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .lang-btn { direction: rtl; }
/* keep arrows pointing the way the survey moves, not the page direction */
[dir="rtl"] .btn-hero span[aria-hidden="true"],
[dir="rtl"] .q-speak { transform: scaleX(-1); }
/* the trophy and progress fill should fill from the right */
[dir="rtl"] .progress-track span { margin-left: auto; }
/* latin contact details and emails stay left-to-right inside RTL text */
[dir="rtl"] .modal-contact,
[dir="rtl"] .modal-mail { direction: ltr; text-align: left; }
[dir="rtl"] .modal-contact-name { text-align: left; }
