/* Apex Digital Precision — client app (intake form + portal) */
:root {
  color-scheme: dark;
  --bg: #0E1217;
  --surface: #13181E;
  --card: #171D24;
  --card-hover: #1D252E;
  --accent: #2F64E0;
  --accent-light: #79A6FF;
  --link: #6E9EFF;
  --accent-2: #D6408F; /* the logo's magenta: small touches only */
  --glow: rgba(62, 123, 250, 0.15);
  --glow-strong: rgba(62, 123, 250, 0.3);
  --text: #EEF2F6;
  --text-2: #A9B3BF;
  --muted: #8D98A5;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-accent: rgba(62, 123, 250, 0.35);
  --on-accent: #FFFFFF;
  --ok: #4ADE80;
  --warn: #FBBF24;
  --bad: #F87171;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-body: "Red Hat Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  width: 720px;
  height: 720px;
  top: -320px;
  right: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 123, 250, 0.18), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent-light); }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px;
  min-height: 84px; /* same height signed in or out, so the header doesn't jump (P3) */
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 44px; height: 37px; flex: none; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name strong { font: 800 17px/1 var(--font-display); letter-spacing: 0.16em; }
.brand-name span { font: 500 9.5px/1.4 var(--font-mono); letter-spacing: 0.28em; color: var(--text-2); text-transform: uppercase; margin-top: 3px; }
.topbar-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.topbar-link:hover { color: var(--text); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Layout ---------- */
.shell { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 8px 16px 96px; }
.hero-head { max-width: 720px; margin: 24px 0 36px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--link);
  padding: 8px 12px;
  border: 1px solid var(--line-accent);
  background: var(--glow);
  border-radius: 999px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--glow-strong); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(214, 64, 143, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(214, 64, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(214, 64, 143, 0); } }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.08; margin-top: 18px; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); line-height: 1.2; }
h3 { font-size: 1.1rem; line-height: 1.3; }
.gradient-text { background: linear-gradient(135deg, #79A6FF, #6E9EFF 40%, #D6408F); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.125rem; color: var(--text-2); margin: 16px 0 0; max-width: 60ch; }
p { margin: 0 0 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(23, 29, 36, 0.96), rgba(19, 24, 30, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.card + .card { margin-top: 20px; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Wizard ---------- */
.wizard { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.steps-rail { position: sticky; top: 24px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps-rail li { counter-increment: step; }
.steps-rail button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: 500 15px/1.3 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.steps-rail button::before {
  content: counter(step, decimal-leading-zero);
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font: 500 12px/1 var(--font-mono);
}
.steps-rail button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.03); color: var(--text-2); }
.steps-rail button:disabled { cursor: default; opacity: 0.55; }
.steps-rail [aria-current="step"] { color: var(--text); background: var(--glow); }
.steps-rail [aria-current="step"]::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps-rail .done::before { content: "✓"; color: var(--ok); border-color: rgba(74, 222, 128, 0.4); font-family: var(--font-body); font-size: 15px; }

.progress { display: none; }
.progress-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-light) 70%, var(--accent-2)); border-radius: inherit; transition: width 0.4s var(--ease); }
.progress-label { display: flex; justify-content: space-between; font: 500 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; animation: fadeUp 0.5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.step-head { margin-bottom: 28px; }
.step-head p { color: var(--text-2); margin: 8px 0 0; }
.step legend { padding: 0; }

/* ---------- Fields ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.field { margin-bottom: 22px; }
.field > label, .field-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.optional { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.hint { display: block; font-size: 13.5px; color: var(--muted); margin: -2px 0 8px; }
.input, .textarea, .select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: rgba(14, 18, 23, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.textarea { min-height: 132px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A9B3BF' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.select option { background: var(--card); color: var(--text); }
.input::placeholder, .textarea::placeholder { color: #66717E; }
.input:hover, .textarea:hover, .select:hover { border-color: rgba(255, 255, 255, 0.24); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow-strong); background-color: rgba(14, 18, 23, 0.9); }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--bad); }
.field-error { display: none; color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.field.invalid .field-error { display: flex; gap: 6px; }
.counter { display: block; text-align: right; font: 400 12px/1 var(--font-mono); color: var(--muted); margin-top: 6px; }

/* Choice cards (radio/checkbox) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(14, 18, 23, 0.5);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.choice-card strong { font-weight: 600; font-size: 15px; }
.choice-card small { color: var(--muted); font-size: 13px; }
.choice input:hover + .choice-card { border-color: rgba(255, 255, 255, 0.28); }
.choice input:checked + .choice-card { border-color: var(--accent); background: var(--glow); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + .choice-card { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.swatches { display: flex; gap: 6px; }
.swatches i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.12); }
/* Style swatches: order matches VISUAL_STYLES in brief.ts */
.swatches[data-style="0"] i:nth-child(1) { background: #FFFFFF; }
.swatches[data-style="0"] i:nth-child(2) { background: #E5E7EB; }
.swatches[data-style="0"] i:nth-child(3) { background: #111827; }
.swatches[data-style="1"] i:nth-child(1) { background: #0B0F19; }
.swatches[data-style="1"] i:nth-child(2) { background: #1F2937; }
.swatches[data-style="1"] i:nth-child(3) { background: #F59E0B; }
.swatches[data-style="2"] i:nth-child(1) { background: #FFF7ED; }
.swatches[data-style="2"] i:nth-child(2) { background: #FDBA74; }
.swatches[data-style="2"] i:nth-child(3) { background: #9A3412; }
.swatches[data-style="3"] i:nth-child(1) { background: #1C1917; }
.swatches[data-style="3"] i:nth-child(2) { background: #D6C7A1; }
.swatches[data-style="3"] i:nth-child(3) { background: #FAFAF9; }
.swatches[data-style="4"] i:nth-child(1) { background: #FDE047; }
.swatches[data-style="4"] i:nth-child(2) { background: #F472B6; }
.swatches[data-style="4"] i:nth-child(3) { background: #38BDF8; }
.choices.inline { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(14, 18, 23, 0.4); cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.toggle span { font-size: 15px; }
.toggle small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-accent); background: var(--glow); color: var(--text-2); font-size: 14.5px; margin: 4px 0 22px; }
.callout svg { flex: none; margin-top: 2px; color: var(--accent-light); }
.subpanel { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 22px; }

/* ---------- Uploads ---------- */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(14, 18, 23, 0.4);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--glow); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.dropzone svg { color: var(--accent-light); }
.dropzone strong { font-weight: 600; }
.dropzone small { color: var(--muted); font-size: 13px; }
.dropzone.full { opacity: 0.5; pointer-events: none; }
.thumbs { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.thumb-img { aspect-ratio: 4 / 3; background: var(--bg); display: grid; grid-template-rows: 100%; place-items: center; overflow: hidden; }
.thumb-img.light { background: #F0F4F8; }
.thumb-img.mid { background: #6B7385; }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.thumb.logo .thumb-img img { object-fit: contain; padding: 16px; }
.thumb-body { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.thumb-name { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; margin-bottom: 8px; }
.thumb .input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.thumb-body .input { margin-top: auto; }
.thumb-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(14, 18, 23, 0.8);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.thumb-remove:hover { background: rgba(248, 113, 113, 0.2); border-color: var(--bad); }
.thumb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.08); }
.thumb-progress span { display: block; height: 100%; width: 0; background: var(--accent-light); transition: width 0.2s; }
.thumb-status { font-size: 13px; color: var(--muted); }
.thumb.error { border-color: rgba(248, 113, 113, 0.5); }
.thumb.error .thumb-status { color: var(--bad); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: 600 15.5px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #3A6FEA; box-shadow: 0 0 0 6px var(--glow), 0 8px 24px rgba(62, 123, 250, 0.35); transform: translateY(-1px); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }
.btn-danger { background: transparent; color: #FCA5A5; border-color: rgba(248, 113, 113, 0.4); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); color: #FECACA; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; transform: none; box-shadow: none; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: var(--on-accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.wizard-nav .spacer { flex: 1; }
.form-alert { display: none; margin-top: 20px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); color: #FECACA; font-size: 14.5px; }
.form-alert.show { display: block; }

/* Review summary */
.summary { display: grid; gap: 14px; margin-bottom: 24px; }
.summary-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; background: rgba(14, 18, 23, 0.4); }
.summary-group header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.summary-group h3 { font-size: 1rem; }
.summary-group dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 16px; margin: 0; font-size: 14.5px; }
.summary-group dt { color: var(--muted); }
.summary-group dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.link-btn { background: none; border: 0; color: var(--link); font: 500 14px/1 var(--font-body); cursor: pointer; padding: 10px 4px; }
.turnstile-wrap { margin: 20px 0 4px; min-height: 65px; }

/* Success */
.success { text-align: center; padding: clamp(32px, 6vw, 64px) clamp(20px, 4vw, 40px); }
.success-icon { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.4); color: var(--ok); }
.success ol { text-align: left; max-width: 420px; margin: 24px auto 0; padding-left: 20px; color: var(--text-2); }
.success li { margin-bottom: 8px; }
#success-title { text-wrap: balance; }
.success li, .success p { text-wrap: pretty; }
#success-card:focus { outline: none; } /* focus lands on the card for screen readers; its buttons keep their own ring */
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.signin-note { margin-top: 16px; text-wrap: pretty; } /* D11-9: set apart from the paragraph above */

/* ---------- Portal ---------- */
.portal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 16px 0 28px; }
.site-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; } /* D11-15: a long stat value can't widen the card */
.site-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.site-url { font: 500 14px/1.4 var(--font-mono); color: var(--link); word-break: break-all; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: rgba(14, 18, 23, 0.4); }
.stat-label { font: 500 11px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stat-value { font: 700 1.35rem/1.2 var(--font-display); margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--font-body); background: rgba(152, 163, 175, 0.14); color: var(--text-2); white-space: nowrap; }
.pill.live { background: rgba(74, 222, 128, 0.14); color: #86EFAC; }
.pill.info { background: var(--glow-strong); color: #D6E4FF; }
.pill.warn { background: rgba(251, 191, 36, 0.14); color: #FDE68A; }
.versions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.versions li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.versions li:first-child { border-top: 0; }
.version-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.version-date { color: var(--muted); font-size: 13.5px; font-weight: 400; }
.version-actions { display: flex; gap: 8px; align-items: center; }
.version-actions form { margin: 0; }
.status-line { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--glow); border: 1px solid var(--line-accent); color: var(--text-2); font-size: 14.5px; }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 15px; }
.notice.ok { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.35); color: #BBF7D0; }
.notice.err { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.4); color: #FECACA; }
.mt-lg { margin-top: 40px; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.footer-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .wizard { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .steps-rail { display: none; }
  .progress { display: block; }
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .hero-head { margin: 8px 0 24px; }
  .wizard-nav { position: sticky; bottom: 0; margin: 24px calc(-1 * clamp(20px, 4vw, 40px)) calc(-1 * clamp(20px, 4vw, 40px)); padding: 14px clamp(20px, 4vw, 40px); background: rgba(19, 24, 30, 0.96); backdrop-filter: blur(12px); border-radius: 0 0 var(--radius) var(--radius); }
  .wizard-nav .btn { flex: 1; padding: 0 16px; }
  .wizard-nav .spacer { display: none; }
  .summary-group dl { grid-template-columns: 1fr; gap: 0; }
  .summary-group dd { margin-bottom: 8px; }
  .versions li { align-items: flex-start; }
  .version-actions { width: 100%; }
  .version-actions .btn, .version-actions form { flex: 1; }
  .version-actions form .btn { width: 100%; }
}

/* ---------- Design review fixes (v1.0.0, 03-designer-review.md) ---------- */
/* #1, #2: consent and other toggles: real flex layout and a custom dark checkbox */
.field > label.toggle { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 15px; margin-bottom: 0; }
.field.invalid .toggle { border-color: var(--bad); }
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(14, 18, 23, 0.7);
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.toggle input:hover { border-color: rgba(255, 255, 255, 0.35); }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.toggle input:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* #3: buttons never wrap in the sticky nav */
.wizard-nav .btn { white-space: nowrap; }

/* #7: no big ring around the step heading when focus moves there for screen readers */
.step h2[tabindex="-1"]:focus { outline: none; }

/* #8: readable upcoming steps */
.steps-rail button:disabled { opacity: 1; color: var(--muted); cursor: default; }
.steps-rail button:disabled::before { border-color: var(--line); color: #737E8B; }

/* #9: placeholder and disabled primary contrast */
.input::placeholder, .textarea::placeholder { color: #85909D; }
.btn-primary:disabled { opacity: 1; background: var(--card-hover); color: var(--muted); border-color: var(--line-strong); box-shadow: none; transform: none; }

/* #10: informational notice */
.notice.info { background: var(--glow); border: 1px solid var(--line-accent); color: #D6E4FF; }
.action-hint { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); text-align: right; }

/* #11, #12: portal address and stat tiles */
.site-url { word-break: normal; overflow-wrap: anywhere; }
.stat-value { font: 600 1.25rem/1.2 var(--font-body); font-variant-numeric: tabular-nums; }

/* #13, #14: style cards — descriptions, visible swatches, check indicator */
.choice-card { position: relative; padding-right: 40px; }
.choice-card::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.choice input:checked + .choice-card::after { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 9px var(--on-accent); }
.swatches i { border-color: rgba(255, 255, 255, 0.28); }
.swatches.sparkle { color: var(--accent-light); }

/* #18: summary empty values */
.summary-group dd.empty { color: var(--muted); }

/* #20: no empty gap where the invisible spam check sits */
.turnstile-wrap { min-height: 0; margin: 12px 0 0; }

/* #21: a focused invalid field stays red */
.field.invalid .input:focus, .field.invalid .textarea:focus, .field.invalid .select:focus { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.22); }
.field-error svg { flex: none; margin-top: 3px; }

/* #23: counter sits inside the textarea's corner */
.textarea-wrap { position: relative; }
.textarea-wrap .textarea { padding-bottom: 30px; }
.textarea-wrap .counter { position: absolute; right: 12px; bottom: 10px; margin: 0; pointer-events: none; }

/* #25, #26: success and check-email screens */
.success-shell { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(14, 18, 23, 0.78); backdrop-filter: blur(6px); }
.success-shell[hidden] { display: none; }
body.modal-open { overflow: hidden; }
body.modal-open .shell { z-index: 3; } /* the popup lives in .shell, which otherwise sits under the top bar */
@media (max-width: 480px) { .success .actions .btn { flex: 1 1 100%; } }
.timeline { list-style: none; text-align: left; max-width: 420px; margin: 28px auto 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: flex; gap: 14px; align-items: baseline; color: var(--text-2); }
.timeline span { font: 500 12px/1 var(--font-mono); color: var(--link); letter-spacing: 0.1em; }
.success-icon.info { background: var(--glow); border-color: var(--line-accent); color: var(--accent-light); }
.success .actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* #27: full-width primary in narrow cards */
.narrow .btn-primary.block { width: 100%; }

/* #30: pointer vs touch wording */
.touch-only { display: none; }
@media (hover: none) { .touch-only { display: inline; } .pointer-only { display: none; } }

/* #31: upload states */
.dropzone.full { display: none; }
.dropzone-note { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }
.thumb-placeholder { display: grid; place-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; text-align: center; padding: 12px; }
.thumb .input:disabled { opacity: 0.5; }
.thumb-status .link-btn { padding: 0 0 0 6px; font-size: 13px; }

@media (max-width: 600px) {
  /* #3 */
  .wizard-nav #back { flex: 0 0 auto; padding: 0 18px; }
  /* #5: get to the first field sooner */
  h1 { font-size: 1.85rem; }
  .lead { font-size: 1rem; }
  .hero-head { margin: 4px 0 20px; }
  .hero-head .eyebrow { display: none; }
  /* #6 */
  .progress { margin-bottom: 24px; }
  /* #11 */
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 1.05rem; }
  .stat-label { font-size: 10px; letter-spacing: 0.1em; }
  /* #13 */
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-card small { display: none; }
  /* #18 */
  .summary-group h3 { font: 700 15px/1.3 var(--font-body); }
  .action-hint { text-align: left; }
}

/* #22: error icon */
.field.invalid .field-error::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23F87171%27 stroke-width=%272%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2710%27/%3E%3Cpath d=%27M12 7v6M12 16.5v.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") no-repeat center / contain;
}

.actions-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Lead Designer fixes (04-lead-designer-signoff.md) ---------- */
/* N1: long emails and names never cause sideways scrolling */
body { overflow-wrap: break-word; }
#success-email, .narrow strong, .portal-head .muted, .summary-group dd, h1, h2 { overflow-wrap: anywhere; }
.portal-head > div { min-width: 0; }
/* N2: portal action buttons never break inside */
.version-actions .btn { white-space: nowrap; }
/* N7: the pulse dot settles after a few beats */
.eyebrow .dot { animation-iteration-count: 3; }
/* N10: stat tiles stay on one line */
.stat-value, .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* N11 */
.summary-group dd.empty { color: var(--muted); }
@media (max-width: 600px) {
  /* N2 */
  .site-top .version-actions { width: 100%; flex-wrap: wrap; }
  .site-top .version-actions .btn { flex: 1 1 100%; }
  /* N3 */
  .progress-label { font-size: 10.5px; letter-spacing: 0.08em; gap: 12px; }
  .progress-label span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* N10 */
  .stat-value { font-size: 0.95rem; }
  .stat-label { letter-spacing: 0.06em; }
}
@media (max-width: 360px) {
  /* N8: one column so titles and swatches have room */
  .choices { grid-template-columns: 1fr; }
  /* Restart 3, N2: the longest "Next:" label fits without an ellipsis */
  .progress-label { letter-spacing: 0.06em; }
}

/* ---------- Lead Designer round 2 (R1–R4) ---------- */
#progress-step { white-space: nowrap; flex-shrink: 0; }
.topbar-link, .brand-name strong, .brand-name span { white-space: nowrap; }
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; gap: 6px; }
  .stat { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
  .stat-value { margin-top: 0; overflow: visible; }
  .stat-label { overflow: visible; }
}

/* PM-1: on the narrowest phones the header link may wrap rather than push the page sideways. */
@media (max-width: 360px) {
  .topbar { gap: 10px; }
  .topbar-link { white-space: normal; text-align: right; font-size: 13px; line-height: 1.3; flex-shrink: 1; min-width: 0; }
  .brand-name span { letter-spacing: 0.2em; }
}
