:root {
  color-scheme: light dark;
  --bg: #f7f7f3;
  --surface: #ffffff;
  --surface-soft: #efefe9;
  --text: #1d1e21;
  --muted: #62646a;
  --line: #d5d5ce;
  --accent: #1639d8;
  --accent-hover: #102db5;
  --accent-soft: #edf0ff;
  --danger: #b42318;
  --success: #176b45;
  --radius: 14px;
  --shadow: 0 18px 55px rgba(27, 31, 43, 0.08);
  font-family: "Geist", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181b;
    --surface: #202125;
    --surface-soft: #292a2f;
    --text: #f1f1ed;
    --muted: #b3b4b7;
    --line: #3c3d42;
    --accent: #6f86ff;
    --accent-hover: #8fa0ff;
    --accent-soft: #272d4e;
    --danger: #ff9c92;
    --success: #71d1a2;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 1000px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 28px 28px 120px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  margin-bottom: 54px;
}
.brand { font-weight: 650; letter-spacing: -0.03em; font-size: 19px; }
.step-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.survey-card {
  width: min(100%, 900px);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 58px);
}
.survey-card.is-bare { max-width: 800px; }
.chapter { color: var(--accent); font-size: 13px; font-weight: 650; margin: 0 0 12px; }
h1, h2 { margin: 0; max-width: 20ch; letter-spacing: -0.035em; line-height: 1.08; }
h1 { font-size: clamp(38px, 6vw, 60px); font-weight: 570; }
h2 { font-size: clamp(30px, 4.6vw, 44px); font-weight: 560; }
h3 { margin: 0; font-size: 17px; }
.lead { max-width: 64ch; margin: 24px 0 0; font-size: clamp(17px, 2vw, 20px); line-height: 1.55; }
.copy { max-width: 66ch; margin: 14px 0 0; color: var(--muted); }
.privacy-note { margin: 24px 0 0; color: var(--muted); font-size: 13px; }
.privacy-note strong { color: var(--text); }
.welcome { max-width: 680px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .55fr); gap: 46px; align-items: center; }
.hero-grid .asset { background: #f9fafc; }
.hero-grid .asset img { transform: none; padding: 14px; }

.asset {
  margin: 0;
  min-height: 170px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  position: relative;
}
.mt { margin-top: 14px; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr); gap: 42px; align-items: center; }
.asset-kicker { margin: 0 0 9px; color: var(--muted); font-size: 12px; font-weight: 620; }
.current-logo { background: #f9fafc; }
.current-logo img { transform: none !important; padding: 12px; }
.asset img { display: none; width: 100%; height: 100%; object-fit: contain; }
.asset.is-ready img { display: block; }
.asset.is-ready .asset-fallback { display: none; }
.asset-fallback { max-width: 24ch; padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }
.asset-fallback strong { display: block; color: var(--text); margin-bottom: 6px; }
.asset.logo { min-height: 126px; }
.asset.logo img { transform: scale(1.35); }
.asset.signet { min-height: 220px; }
.asset.signet img { transform: scale(1.6); }
.asset.mood { min-height: 190px; aspect-ratio: 2 / 1; }
.asset.mood img { object-fit: contain; }

.choices { display: grid; gap: 12px; margin-top: 28px; }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
  position: relative;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 17px 48px 17px 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 56%, var(--line)); }
.choice:active { transform: translateY(1px); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 19px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 4px solid var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--surface);
}
.choice.with-asset { padding: 12px 12px 48px; }
.choice.with-asset .choice-label { display: block; margin: 12px 6px 0; font-weight: 620; }
.choice.with-asset::after { top: auto; bottom: 18px; transform: none; }
.choice-meta { display: block; margin: 3px 6px 0; color: var(--muted); font-size: 13px; }

.concept-head { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 32px; align-items: center; }
.concept-head .asset { min-height: 150px; }
.concept-explainer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0 0; }
.concept-explainer div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.concept-explainer dt { color: var(--muted); font-size: 11px; font-weight: 650; }
.concept-explainer dd { margin: 3px 0 0; font-size: 14px; font-weight: 570; }
.rating-instruction { margin: 30px 0 0; padding: 14px 16px; border-left: 3px solid var(--accent); color: var(--muted); font-size: 14px; }
.ratings { margin-top: 34px; display: grid; gap: 25px; }
.confidence { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.confidence .rating-row { grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr); }
.rating-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 1fr); gap: 24px; align-items: center; }
.rating-label { font-weight: 570; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.scale button:hover { border-color: var(--accent); }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-poles { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; }

.field { margin-top: 28px; }
.field label { display: block; font-weight: 620; margin-bottom: 8px; }
.field .helper { color: var(--muted); font-size: 13px; margin: -2px 0 10px; }
textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 14px 16px;
}
textarea::placeholder { color: color-mix(in srgb, var(--muted) 82%, transparent); }

.footer-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}
.footer-nav-inner {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 15px 28px max(15px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.btn {
  min-height: 46px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 0 21px;
  font-weight: 630;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 140ms ease, background-color 140ms ease, opacity 140ms ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--line); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.full { width: 100%; margin-top: 32px; }
.error { color: var(--danger); font-size: 14px; margin-top: 16px; }
.save-state { min-height: 22px; color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; }
.save-state.ok { color: var(--success); }
.resume { border-left: 3px solid var(--accent); padding-left: 14px; margin-top: 22px; color: var(--muted); font-size: 14px; }
.done { text-align: center; max-width: 650px; margin: 0 auto; }
.done h2 { max-width: none; }
.done-mark { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 24px; background: var(--accent); color: #fff; font-size: 24px; font-weight: 700; }
.honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; }

@media (prefers-reduced-motion: no-preference) {
  .survey-card { animation: enter 340ms cubic-bezier(.16, 1, .3, 1); }
  @keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 720px) {
  .app-shell { padding: 18px 16px 112px; }
  .topbar { margin-bottom: 24px; }
  .survey-card { padding: 25px 20px; }
  .hero-grid, .story-grid, .concept-head { grid-template-columns: 1fr; gap: 24px; }
  .concept-explainer { grid-template-columns: 1fr; }
  .hero-grid .asset { order: -1; min-height: 100px; }
  .choices.two, .choices.four { grid-template-columns: 1fr; }
  .rating-row,
  .confidence .rating-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .rating-row > * { min-width: 0; }
  .scale { width: 100%; min-width: 0; gap: 6px; }
  .scale button { min-width: 0; padding-inline: 0; }
  .footer-nav-inner { width: 100%; max-width: 100vw; padding-inline: 16px; overflow: hidden; }
  .footer-nav-inner .btn { min-width: 0; }
}
@media (max-width: 420px) {
  .footer-nav-inner .btn { padding-inline: 16px; }
  .step-meta { font-size: 12px; }
}
