/* ============================================================
   IslaIntel — Creative Direction Session
   Brand: #00ace4 · Charcoal #1F2224 · Cream #E9E6DD
   Type: Inter · JetBrains Mono
   ============================================================ */

:root,
:root[data-theme="light"] {
  /* ===== Brand tokens (constant across themes) ===== */
  --blue: #00ace4;
  --blue-deep: #008fc0;
  --blue-soft: rgba(0, 172, 228, 0.12);
  --blue-hairline: rgba(0, 172, 228, 0.28);

  /* ===== Role tokens (swap between light/dark) ===== */
  --bg: #E9E6DD;
  --bg-raised: rgba(31, 34, 36, 0.03);
  --surface: #ffffff;
  --surface-2: #f6f3ea;
  --ink: #1F2224;
  --ink-2: #2a2e31;
  --ink-3: #3d4347;
  --ink-4: #5c6368;
  --ink-on-accent: #ffffff;
  --border: rgba(31, 34, 36, 0.11);
  --border-2: rgba(31, 34, 36, 0.18);
  --scrim: rgba(31, 34, 36, 0.1);
  --noise-opacity: 0.22;

  --shadow-sm: 0 1px 0 rgba(0,0,0,0.05), 0 2px 10px rgba(31,34,36,0.06);
  --shadow-md: 0 12px 40px -12px rgba(31,34,36,0.2);
  /* Soft cyan halo only — no ring/outline layers */
  --glow-dispersion: 0 0 8px rgba(0, 172, 228, 0.06);
  --shadow-glow: var(--glow-dispersion);

  /* Legacy aliases (so existing rules keep working — will resolve through role tokens) */
  --charcoal: var(--ink);
  --charcoal-2: var(--ink-2);
  --charcoal-3: var(--ink-3);
  --cream: var(--bg);
  --cream-dim: var(--bg-raised);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-base: 320ms;
  --t-slow: 520ms;

  --safe-bot: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  /* Mobile Safari: area covered by the bottom toolbar/address bar (not in safe-area env on web). */
  --browser-ui-h: 0px;
}

:root[data-theme="dark"] {
  --bg: #141617;
  --bg-raised: rgba(255, 255, 255, 0.03);
  --surface: #1f2224;
  --surface-2: #25282a;
  --ink: #E9E6DD;
  --ink-2: rgba(233, 230, 221, 0.85);
  --ink-3: rgba(233, 230, 221, 0.62);
  --ink-4: rgba(233, 230, 221, 0.42);
  --ink-on-accent: #0b0d0e;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --scrim: rgba(255, 255, 255, 0.04);
  --noise-opacity: 0.12;

  --shadow-sm: 0 1px 0 rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 14px 40px -14px rgba(0,0,0,0.55);
  --glow-dispersion: 0 0 10px rgba(0, 172, 228, 0.09);
  --shadow-glow: var(--glow-dispersion);
}

/* Smooth cross-fade when theme changes */
html { transition: background-color 260ms var(--ease); }
body { transition: background-color 260ms var(--ease), color 260ms var(--ease); }

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

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Soft grain / noise overlay for texture */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: var(--noise-opacity);
  mix-blend-mode: multiply;
  background-image: radial-gradient(rgba(31,34,36,0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  transition: opacity 260ms var(--ease);
}

[data-theme="dark"] .noise {
  mix-blend-mode: screen;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: linear-gradient(180deg, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 260ms var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  outline: none;
}

.brand-logo {
  width: 44px;
  height: auto;
  display: block;
  filter: var(--logo-filter, none);
}

[data-theme="dark"] .brand-logo {
  /* The logo is a blue signature on transparent; it already works on dark.
     A subtle brightness lift keeps it crisp over the darker backdrop. */
  filter: brightness(1.05);
}

.brand-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-size: 17px;
  color: var(--ink);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Theme toggle — sun/moon icon button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  background: var(--bg-raised);
  border-color: var(--border-2);
  color: var(--ink);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 420ms var(--ease), opacity 260ms var(--ease);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
}

.theme-toggle {
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="dark"]  .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="dark"]  .theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* Autosave indicator */
.autosave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 240ms var(--ease);
}

.autosave.show {
  opacity: 1;
}

.autosave-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: savePulse 1.4s ease-out;
}

@keyframes savePulse {
  0%   { transform: scale(0.6); }
  40%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-3);
}

.lang-toggle button {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink-3);
  cursor: pointer;
  padding: 6px 8px;
  min-height: 32px;
  letter-spacing: 0.04em;
  transition: color var(--t-fast), background var(--t-fast);
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.lang-toggle button.active {
  color: var(--blue);
  font-weight: 600;
}

.lang-toggle button:hover {
  color: var(--ink);
  background: var(--bg-raised);
}

.lang-toggle button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.lang-toggle .sep {
  opacity: 0.4;
}

/* ===== Resume banner ===== */
.resume-banner {
  position: relative;
  z-index: 40;
  margin: 0 auto;
  max-width: 760px;
  padding: 0 28px;
  animation: slideDown 420ms var(--ease);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.resume-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1F2224;
  color: #E9E6DD;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .resume-inner {
  background: #25282a;
  border: 1px solid var(--border-2);
}

.resume-icon {
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.resume-text {
  flex: 1;
  min-width: 160px;
  line-height: 1.4;
}

.resume-btn,
.resume-btn-ghost {
  appearance: none;
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast);
  min-height: 36px;
}

.resume-btn:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
}

.resume-btn-ghost {
  background: transparent;
  color: rgba(233,230,221,0.65);
  font-weight: 500;
}

.resume-btn-ghost:hover {
  color: var(--cream);
}

/* ===== App layout ===== */
.app {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px 80px;
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* ===== Progress — segmented pills ===== */
.progress {
  margin: 4px 0 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--charcoal-3);
}

.progress-cheer {
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 0.08em;
  animation: cheerIn 500ms var(--ease);
}

@keyframes cheerIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-label {
  color: var(--charcoal-3);
}

.progress-segments {
  display: flex;
  gap: 6px;
  width: 100%;
  height: 8px;
}

.segment {
  flex: 1;
  border-radius: 100px;
  background: var(--scrim);
  position: relative;
  overflow: hidden;
  transition: background-color 220ms var(--ease);
}

/* Inner fill — scales from left to right when a segment becomes "done".
   Single animation, no glow, no flicker. */
.segment::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 620ms cubic-bezier(0.32, 0.72, 0.24, 1);
  border-radius: inherit;
}

.segment.done::before {
  transform: scaleX(1);
}

/* Current: soft blue wash — static, no shimmer, no glow */
.segment.current {
  background: var(--blue-soft);
}

[data-theme="dark"] .segment.current {
  background: rgba(0, 172, 228, 0.22);
}

/* ===== Steps (screens) =====
   Smooth, GPU-accelerated slide-in from the right. Using only transform +
   opacity keeps the paint cheap. No paint containment here — it would clip
   box-shadow halos on primary buttons sitting near the step's edges. */
.step {
  display: none;
}

.step.active {
  display: block;
  animation: stepIn 460ms cubic-bezier(0.32, 0.72, 0.24, 1);
  will-change: transform, opacity;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translate3d(24px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* When returning via "Back", slide in from the left instead — feels natural */
.step.active.back-in {
  animation: stepInBack 440ms cubic-bezier(0.32, 0.72, 0.24, 1);
}

@keyframes stepInBack {
  from {
    opacity: 0;
    transform: translate3d(-24px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ===== Hero (language picker) ===== */
.hero {
  padding-top: 24px;
}

.hero-logo {
  width: 96px;
  height: auto;
  margin: 0 0 28px -8px;
  display: block;
  animation: logoIn 900ms var(--ease) both;
}

@keyframes logoIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.trust-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1;
}

.trust-item svg {
  color: var(--blue);
  flex-shrink: 0;
}

.trust-divider {
  width: 1px;
  height: 14px;
  background: var(--border-2);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 24px;
  display: inline-block;
}

.display {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  color: var(--charcoal);
}

.display .accent {
  color: var(--blue);
  font-style: italic;
  font-weight: 500;
}

.display-sm {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  color: var(--charcoal);
}

.lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--charcoal-2);
  margin: 0 0 40px;
  max-width: 540px;
}

.muted-es {
  color: var(--charcoal-3);
  font-style: italic;
}

.lang-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 48px;
  max-width: 520px;
}

.lang-card {
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
  cursor: pointer;
  transition: transform var(--t-base) var(--ease), border-color var(--t-base), box-shadow var(--t-base);
  font-family: inherit;
  color: var(--ink);
  position: relative;
  overflow: visible;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.lang-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base);
  box-shadow: var(--glow-dispersion);
}

.lang-card::after {
  content: '';
  position: absolute;
  top: 20px;
  right: 20px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-3);
  border-top: 2px solid var(--ink-3);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
}

.lang-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: none;
}

.lang-card:hover::before {
  opacity: 1;
}

.lang-card:hover::after {
  opacity: 1;
  transform: rotate(45deg) translate(4px, -4px);
  border-color: var(--blue);
}

.lang-code {
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.14em;
  margin-bottom: 12px;
}

.lang-name {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}

.lang-meta {
  font-size: 13px;
  color: var(--charcoal-3);
}

.microcopy {
  font-size: 11px;
  color: var(--charcoal-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 16px;
}

/* ===== Intro ===== */
.intro {
  padding-top: 8px;
  max-width: 640px;
}

.intro-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal-2);
  margin: 0 0 28px;
  white-space: pre-line;
}

.reward {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(0,172,228,0.04) 0%, rgba(0,172,228,0.08) 100%);
  border: 1px solid var(--blue-hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 36px;
}

[data-theme="dark"] .reward {
  background: linear-gradient(135deg, rgba(0,172,228,0.08) 0%, rgba(0,172,228,0.16) 100%);
}

.reward-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
}

.reward-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--blue);
  margin-bottom: 4px;
}

.reward-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--charcoal);
}

.legal {
  margin-top: 20px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--charcoal-3);
  text-transform: uppercase;
}

/* "What to expect" pre-commitment list */
.expect {
  margin: 0 0 32px;
  padding: 20px 22px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.expect-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--charcoal-3);
  margin-bottom: 14px;
}

.expect-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.expect-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--charcoal-2);
}

.expect-num {
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  width: 24px;
}

/* Commit banner on email step (sunk-cost reinforcement) */
.commit-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(0,172,228,0.06) 0%, rgba(0,172,228,0.11) 100%);
  border: 1px solid var(--blue-hairline);
  border-radius: var(--radius-md);
  animation: commitIn 600ms var(--ease) both;
}

[data-theme="dark"] .commit-banner {
  background: linear-gradient(135deg, rgba(0,172,228,0.1) 0%, rgba(0,172,228,0.18) 100%);
}

@keyframes commitIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.commit-check {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
}

.commit-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.3;
}

.commit-sub {
  font-size: 13px;
  color: var(--charcoal-2);
  line-height: 1.4;
  margin-top: 2px;
}

/* XL button for primary CTAs that need extra pull */
.btn-xl {
  padding: 17px 34px;
  font-size: 15.5px;
  font-weight: 600;
}

/* ===== Questions ===== */
.question {
  padding-top: 8px;
}

.q-meta {
  font-size: 11px;
  color: var(--charcoal-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.q-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 30px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--charcoal);
}

.q-help {
  font-size: 14.5px;
  color: var(--charcoal-3);
  line-height: 1.5;
  margin: 0 0 28px;
  max-width: 560px;
}

.q-title + .options,
.q-title + .options-grid {
  margin-top: 28px;
}

/* Radio "opt" rows */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast);
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

.opt::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  box-shadow: var(--glow-dispersion);
}

.opt:hover {
  border-color: var(--blue-hairline);
  transform: translateX(2px);
}

/* Instant press feedback on mobile tap */
.opt:active {
  transform: scale(0.995);
}

.opt input[type="radio"],
.opt input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ink-4);
  flex-shrink: 0;
  position: relative;
}

.opt-marker::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--blue);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 120ms var(--ease);
}

.opt input[type="radio"]:checked + .opt-marker {
  border-color: var(--blue);
}

.opt input[type="radio"]:checked + .opt-marker::after {
  transform: scale(1);
}

.opt:has(input[type="radio"]:checked),
.opt:has(input[type="checkbox"]:checked) {
  border-color: var(--blue);
  background: var(--surface);
  animation: selectPulse 180ms var(--ease);
}

.opt:has(input[type="radio"]:checked)::before,
.opt:has(input[type="checkbox"]:checked)::before {
  opacity: 1;
}

@keyframes selectPulse {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.opt-chip:has(input[type="radio"]:checked) {
  animation: selectPulse 180ms var(--ease);
}

/* Checkbox variant — rounded square marker with checkmark */
.opt-check .opt-marker {
  border-radius: 5px;
}

.opt-check .opt-marker::after {
  inset: 0;
  background: var(--blue);
  border-radius: 3px;
  transform: scale(0);
  transition: transform 120ms var(--ease);
}

.opt-check input[type="checkbox"]:checked + .opt-marker {
  border-color: var(--blue);
  background: var(--blue);
}

.opt-check input[type="checkbox"]:checked + .opt-marker::after {
  transform: scale(1);
  background: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3,8 7,12 13,4'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.opt-label {
  font-size: 15.5px;
  line-height: 1.35;
  color: var(--charcoal);
  flex: 1;
}

.opt-other {
  flex-wrap: wrap;
}

.opt-input {
  flex: 1 1 100%;
  min-width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}

.opt-input::placeholder { color: var(--ink-4); }

.opt-input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
}

/* Chip-style options (for short answers like firm size, leads) */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.opt-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  transition: transform var(--t-fast), border-color var(--t-fast);
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

.opt-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  box-shadow: var(--glow-dispersion);
}

.opt-chip:active {
  transform: scale(0.97);
}

.opt-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt-chip:hover {
  border-color: var(--blue-hairline);
  transform: translateY(-1px);
}

.opt-chip:has(input[type="radio"]:checked) {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.opt-chip:has(input[type="radio"]:checked)::before {
  opacity: 1;
}

/* ===== Text inputs ===== */
.text-area,
.text-input {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  resize: vertical;
}

.text-area::placeholder,
.text-input::placeholder {
  color: var(--ink-4);
  opacity: 1;
}

:root[data-theme="light"] .text-input,
:root[data-theme="light"] .text-area {
  background: var(--surface);
  border-color: rgba(31, 34, 36, 0.2);
  box-shadow: inset 0 1px 2px rgba(31, 34, 36, 0.04);
}

:root[data-theme="light"] .q-help,
:root[data-theme="light"] .q-hint,
:root[data-theme="light"] .intro-body {
  color: var(--ink-3);
}

:root[data-theme="light"] .card-btn,
:root[data-theme="light"] .chip-btn {
  border-color: rgba(31, 34, 36, 0.16);
}

:root[data-theme="light"] .q-meta,
:root[data-theme="light"] .progress-label {
  color: var(--ink-4);
}

.text-area {
  line-height: 1.5;
  min-height: 120px;
  margin-bottom: 24px;
}

.text-input:focus,
.text-area:focus {
  outline: none;
  border-color: var(--blue);
}

.field {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 11px;
  color: var(--charcoal-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ===== Buttons ===== */
.btn-primary {
  appearance: none;
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: 14px 28px;
  border-radius: 100px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 180ms var(--ease);
  position: relative;
  isolation: isolate;
  z-index: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms var(--ease);
  box-shadow: var(--glow-dispersion);
}

[data-theme="dark"] .btn-primary {
  background: var(--blue);
  color: var(--ink-on-accent);
}

/* Hover glow on dark mode: slightly brighter halo so it reads against the dark bg */
[data-theme="dark"] .btn-primary:hover::before {
  opacity: 1;
}

.btn-primary::after {
  content: '→';
  font-family: 'JetBrains Mono', monospace;
  transition: transform var(--t-fast);
}

/* Hover: keep the button color, add a soft uniform halo (0-offset box-shadow
   layered = radial glow, not a directional drop shadow) */
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover::after {
  transform: translateX(3px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:active::before {
  opacity: 0.85;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled::before {
  opacity: 0;
}

.btn-ghost {
  appearance: none;
  background: transparent;
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 10px 4px;
  letter-spacing: 0.04em;
  transition: color var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost::before {
  content: '←';
}

.btn-ghost:hover {
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

/* ===== Thank-you ===== */
.thanks {
  text-align: center;
  padding: 40px 0 20px;
  max-width: 560px;
  margin: 0 auto;
}

.check-mark {
  width: 72px;
  height: 72px;
  color: var(--blue);
  margin: 0 auto 28px;
}

.check-mark svg {
  width: 100%;
  height: 100%;
}

.summary {
  margin: 32px auto 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

.summary:empty {
  display: none;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-key {
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.summary-value {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.credits {
  margin-top: 40px;
  font-size: 11px;
  color: var(--charcoal-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.credits .divider {
  margin: 0 12px;
  opacity: 0.5;
}

/* ===== Privacy note ===== */
.privacy {
  margin-top: 16px;
  font-size: 10.5px;
  color: var(--charcoal-3);
  letter-spacing: 0.06em;
  line-height: 1.55;
}

.submit-error {
  margin-top: 12px;
  font-size: 12px;
  color: #c53d3d;
  letter-spacing: 0.04em;
  line-height: 1.45;
  max-width: 36ch;
}
[data-theme="dark"] .submit-error {
  color: #f08080;
}

/* ===== Footer ===== */
.foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.foot-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot-loc {
  opacity: 0.7;
}

/* ===== Responsive — mobile polish =====
   Mobile layout is a strict 3-section chrome:
   ┌─ topbar (pinned top)
   ├─ progress + question header (pinned below topbar)
   ├─ options / textarea (scrollable middle)
   └─ nav: back + hint/continue (pinned bottom)

   The whole viewport is a flex column with overflow: hidden on body, so only
   the middle scroll region moves. Fixes "answers cut off by nav" and makes
   the user always see the question and the footer while scrolling choices.
*/
@media (max-width: 720px) {
  :root {
    /* iOS/Safari & Android Chrome: bottom bar overlays the page; not covered by safe-area-inset alone. */
    --browser-ui-h: 52px;
  }

  html {
    height: 100%;
  }
  body {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior-y: contain;
  }

  .step.active {
    animation-duration: 340ms;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .topbar {
    padding: 14px 18px;
  }
  .brand-logo {
    width: 38px;
  }
  .brand-name {
    font-size: 16px;
  }
  .topbar-right {
    gap: 10px;
  }
  .autosave {
    display: none;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .resume-banner {
    padding: 0 18px;
  }
  .resume-inner {
    padding: 12px 14px;
    font-size: 13px;
  }
  .resume-text {
    min-width: 100%;
  }

  .topbar {
    flex-shrink: 0;
    position: static; /* no longer need sticky — body doesn't scroll */
  }

  .resume-banner {
    flex-shrink: 0;
  }

  .app {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 18px;
    overflow: hidden;
  }

  /* Active step fills remaining space; its child wrapper is a flex column.
     If a long screen (e.g. multi-select checkboxes) breaks inner flex scrolling in Safari,
     the step itself can scroll so Back/Continue are never stuck off-screen. */
  .step.active,
  .step.active > .question,
  .step.active > .intro,
  .step.active > .hero,
  .step.active > .thanks {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Multi-select: extra scroll context if the checklist flex region fails to clip in WebKit */
  .step.active:has(.options[data-type="checkbox"]) {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .progress {
    flex-shrink: 0;
  }

  /* Question steps: every direct child except the options/textarea is a
     non-shrinking header/footer row. The options list becomes the scrollable
     middle. */
  .question > * {
    flex-shrink: 0;
  }

  .question > .options,
  .question > .text-area {
    /* flex-basis: 0 helps WebKit allow the middle pane to shrink vs. long content */
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* Breathing room; last row must scroll clear of fixed .nav + browser bottom UI. */
    padding: 8px 2px;
    margin: 0 -2px 0;
    padding-bottom: calc(16px + 72px + var(--browser-ui-h) + var(--safe-bot));
  }

  /* Email step: whole block scrolls; leave room for fixed back/submit bar. */
  .step[data-step="email"] > .question {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(20px + 72px + var(--browser-ui-h) + var(--safe-bot));
  }

  /* Non-question wrappers (hero/intro/thanks) scroll as a whole if they
     overflow — simpler UX since they don't have a clear "answers" section. */
  .hero, .intro, .thanks {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .hero {
    padding-top: 12px;
  }
  .hero-logo {
    width: 76px;
    margin: 0 0 20px -4px;
  }
  .lang-picker {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 24px;
  }
  .lang-card {
    padding: 18px 20px;
  }
  .lang-name {
    font-size: 20px;
  }

  .trust-bar {
    display: flex;
    padding: 10px 16px;
    gap: 10px;
    border-radius: 14px;
  }
  .trust-item {
    font-size: 12px;
  }

  .display {
    font-size: 36px;
    line-height: 1.05;
  }
  .display-sm {
    font-size: 24px;
  }
  .lede {
    font-size: 16px;
    margin-bottom: 28px;
  }

  .intro-body,
  .q-help,
  .opt-label {
    font-size: 15px;
  }

  .q-title {
    font-size: 22px;
    line-height: 1.25;
  }

  .reward {
    padding: 16px;
    gap: 12px;
  }
  .reward-icon {
    width: 34px;
    height: 34px;
  }
  .reward-text {
    font-size: 14px;
  }

  .expect {
    padding: 16px 18px;
  }

  .commit-banner {
    padding: 12px 14px;
  }

  .opt {
    padding: 14px 16px;
    gap: 12px;
    min-height: 52px;
  }

  .opt-chip {
    padding: 14px 12px;
    font-size: 13px;
    min-height: 52px;
  }

  .options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .text-input,
  .text-area {
    font-size: 16px; /* prevent iOS auto-zoom on focus */
    padding: 14px 14px;
  }

  /* Back / Continue: fixed so iOS Safari's bottom bar doesn't cover the buttons.
     Lift by --browser-ui-h; add safe area inside the bar for home indicator. */
  .app .step .question > .nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: var(--browser-ui-h);
    margin: 0;
    padding: 12px 18px;
    padding-bottom: calc(12px + var(--safe-bot));
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  [data-theme="dark"] .app .step .question > .nav {
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.45);
  }

  /* On mobile, hide Continue on single-select radio steps — tapping auto-advances.
     Multi-select (checkbox) and "Other" text fields keep Continue visible. */
  .step[data-step^="q"]:has(.options[data-required="true"]:not([data-type="checkbox"])):not(:has(input[type="radio"][value="other"]:checked)) .nav [data-next] {
    display: none;
  }

  /* Subtle hint in place of Continue on auto-advance steps */
  .step[data-step^="q"]:has(.options[data-required="true"]:not([data-type="checkbox"])):not(:has(input[type="radio"][value="other"]:checked)) .nav::after {
    content: attr(data-hint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    opacity: 0.8;
  }

  .foot {
    display: none;
  }

  .btn-primary {
    padding: 14px 24px;
    font-size: 15px;
    min-height: 48px;
    justify-content: center;
    align-self: flex-start; /* never stretch vertically in flex-column parents */
  }

  /* Only nav buttons should flex to fill width — they sit in a row with Back */
  .nav .btn-primary {
    flex: 1;
    max-width: 240px;
    align-self: auto;
  }

  .btn-xl {
    padding: 15px 26px;
    font-size: 15px;
  }

  .btn-ghost {
    font-size: 13px;
    padding: 10px 8px;
    min-height: 44px;
  }

  .progress {
    margin: 2px 0 22px;
    gap: 8px;
  }
  .progress-cheer {
    font-size: 10.5px;
  }
  .progress-label {
    font-size: 10.5px;
  }
  .progress-segments {
    gap: 4px;
    height: 7px;
  }

  .foot-inner {
    padding: 12px 18px;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 10px;
  }

  .thanks {
    padding: 20px 0;
  }
  .check-mark {
    width: 56px;
    height: 56px;
  }
  .summary {
    padding: 16px 18px;
    font-size: 11.5px;
  }
  .summary-row {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
  }
  .summary-value {
    text-align: left;
  }
}

/* Extra-small screens */
@media (max-width: 380px) {
  .display {
    font-size: 32px;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .trust-item span:not(:first-child) {
    max-width: 120px;
  }
}

/* Tablet / desktop sizing */
@media (min-width: 721px) {
  .app {
    padding-bottom: 100px;
  }

  /* Long multi-select: keep Continue reachable while scrolling the checklist */
  .step:has(.options[data-type="checkbox"]) .nav {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 12px;
    padding-top: 12px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -12px 24px -8px rgba(31, 34, 36, 0.08);
  }

  [data-theme="dark"] .step:has(.options[data-type="checkbox"]) .nav {
    box-shadow: 0 -12px 32px -10px rgba(0, 0, 0, 0.45);
  }
}

/* ===== Error state ===== */
.step.shake {
  animation: shake 420ms var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.field-error .text-input,
.field-error .text-area {
  border-color: #d64545;
  background: rgba(214,69,69,0.04);
}

/* ===== Creative Direction Session — form components ===== */
.topbar .timechip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 100px;
}

.intro-points {
  list-style: none;
  margin: 28px 0 32px;
  padding: 0;
  display: grid;
  gap: 14px;
}

.intro-points li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--ink-3);
  font-size: 0.97rem;
  line-height: 1.55;
}

.intro-points .n {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--blue);
  font-size: 0.85rem;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1.5px solid var(--blue-hairline);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
}

.intro-sig {
  font-size: 0.92rem;
  color: var(--ink-3);
  font-style: italic;
}

.q-block {
  margin-bottom: 26px;
}

.q-label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--ink);
}

.q-hint {
  font-size: 0.88rem;
  color: var(--ink-3);
  margin-bottom: 12px;
  line-height: 1.45;
}

.q-optional {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  margin-left: 6px;
}

.q-required {
  color: var(--blue);
}

.q-error {
  font-size: 0.85rem;
  color: #d64545;
  margin-top: 8px;
  display: none;
}

.q-block.invalid .q-error {
  display: block;
}

.q-block.invalid .text-input,
.q-block.invalid .text-area,
.q-block.invalid .chip-group,
.q-block.invalid .card-group,
.q-block.invalid .dgrid {
  outline: 2px solid rgba(214, 69, 69, 0.35);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.prefill-wrap {
  position: relative;
}

.prefill-wrap .text-input {
  padding-right: 118px;
}

.fromfile-tag {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-deep);
  background: var(--blue-soft);
  padding: 4px 9px;
  border-radius: 100px;
  pointer-events: none;
}

.fromfile-tag[hidden] {
  display: none !important;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip-btn {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: 100px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.chip-btn.tone::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  box-shadow: var(--glow-dispersion);
}

.chip-btn:hover {
  border-color: var(--blue-hairline);
}

.chip-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ink-on-accent);
  border-color: var(--ink);
}

.chip-btn.tone[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--ink-on-accent);
  box-shadow: none;
}

.chip-btn.tone[aria-pressed="true"]::before {
  opacity: 1;
}

.card-group {
  display: grid;
  gap: 10px;
}

.card-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast);
  position: relative;
  isolation: isolate;
  z-index: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.card-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  box-shadow: var(--glow-dispersion);
}

.card-btn:hover {
  border-color: var(--blue-hairline);
  box-shadow: none;
}

.card-btn:hover::before,
.card-btn[aria-pressed="true"]::before {
  opacity: 1;
}

.card-btn[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: none;
}

.card-btn .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.card-btn[aria-pressed="true"] .dot {
  border-color: var(--blue);
  background: radial-gradient(circle, var(--blue) 45%, transparent 50%);
}

.card-btn b {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.card-btn small {
  display: block;
  color: var(--ink-3);
  font-size: 0.83rem;
  line-height: 1.4;
}

.path-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-deep);
  background: var(--blue-soft);
  padding: 5px 11px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.dgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .dgrid { grid-template-columns: 1fr; }
}

.dcell {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dcell .dname {
  font-size: 0.92rem;
  font-weight: 600;
}

.dcell .dsub {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-3);
  font-weight: 400;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--bg);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
  transition: border-color var(--t-fast), color var(--t-fast);
  font-family: inherit;
}

.stepper button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.stepper .val {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.callout-note {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--ink-3);
  margin-bottom: 12px;
  line-height: 1.5;
}

.callout-note b {
  color: var(--ink);
}

.done-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--ink-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 24px;
  position: relative;
  isolation: isolate;
  box-shadow: none;
}

.done-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 1;
  box-shadow: var(--glow-dispersion);
}

.submit-error {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(214, 69, 69, 0.08);
  border: 1px solid rgba(214, 69, 69, 0.25);
  color: var(--ink);
  font-size: 0.92rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.intro .nav-split {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

/* Supporting points — numbered single-line fields */
.creative-section {
  margin-bottom: 0;
  padding-bottom: 28px;
  margin-top: 8px;
}

.creative-section + .creative-section {
  margin-top: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.q-block.q-block-spaced {
  margin-top: 36px;
  padding-top: 8px;
}

.chip-def-panel {
  margin-top: 14px;
  padding: 14px 16px;
  min-height: 4.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}

.chip-def-panel.is-active {
  border-color: var(--blue-hairline);
  background: var(--bg-raised);
}

.chip-def-panel .def-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.chip-def-panel .def-body {
  margin: 0;
}

.chip-def-placeholder {
  margin: 0;
  color: var(--ink-4);
  font-size: 0.88rem;
}

.chip-limit-notice {
  margin: 10px 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--blue-deep);
  line-height: 1.4;
}

.chip-limit-notice:not([hidden]) {
  animation: chipLimitIn 320ms var(--ease);
}

@keyframes chipLimitIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.q-block.creative-section-disabled .chip-def-panel,
.q-block.creative-section-disabled .chip-limit-notice {
  display: none;
}

.creative-skip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}

.creative-skip input {
  margin-top: 2px;
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.q-block.creative-section-disabled .chip-group {
  opacity: 0.45;
  pointer-events: none;
}

.support-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-points li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid var(--blue-hairline);
  border-radius: 50%;
  background: var(--blue-soft);
}

.support-points .text-input {
  flex: 1;
  margin: 0;
}

/* Phased deliverables & weekly volume mode */
.deliverables-mode {
  margin: 14px 0 18px;
}

.deliverables-mode-toggle {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border-2);
  border-radius: 100px;
}

.deliverables-mode-toggle .mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 10px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.deliverables-mode-toggle .mode-btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.deliverables-mode-toggle .mode-btn:hover:not([aria-pressed="true"]) {
  color: var(--ink-2);
}

.deliverables-mode-caption {
  margin: 12px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 520px;
}

.deliverables-panel {
  margin-top: 4px;
}

.phase-weeks label .text-input {
  max-width: 120px;
  margin: 0;
  font-size: 1rem;
  padding: 12px 14px;
}

.phase-block {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 16px 16px 14px;
  margin-bottom: 12px;
}

.phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.phase-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.phase-remove {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--ink-4);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--t-fast), background var(--t-fast);
}

.phase-remove:hover {
  color: var(--ink);
  background: var(--bg-raised);
}

.phase-weeks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
  align-items: flex-end;
}

.phase-weeks label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-3);
  min-width: 140px;
}

.btn-add-phase {
  appearance: none;
  border: 1px dashed var(--border-2);
  background: var(--bg-raised);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--t-fast), color var(--t-fast);
}

.btn-add-phase:hover {
  border-color: var(--blue-hairline);
  color: var(--blue-deep);
}

.q-block[data-field="deliverables_per_week"] .q-error[data-field="phased_deliverables"],
.q-block[data-field="deliverables_per_week"] .q-error[data-field="deliverables_baseline"] {
  display: none;
}

.q-block[data-field="deliverables_per_week"].invalid-deliverables-baseline .q-error[data-field="deliverables_baseline"],
.q-block[data-field="deliverables_per_week"].invalid-deliverables-phased .q-error[data-field="phased_deliverables"] {
  display: block;
}
