:root {
  --black: #000;
  --surface: #0b0b0b;
  --surface-raised: #111;
  --surface-soft: #171717;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --white: #fff;
  --text: #f5f5f5;
  --muted: #a5a5a5;
  --muted-strong: #c6c6c6;
  --subtle: #8a8a8a;
  --blue: #0055ff;
  --blue-hover: #1a66ff;
  --danger: #ff6b6b;
  --success: #4ed49b;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --page-gutter: clamp(16px, 2.2vw, 32px);
  --content: 1180px;
  --transition: 220ms cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--black);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open { overflow: hidden; }

button, input { font: inherit; }

button, a, input, summary { touch-action: manipulation; }

a { color: inherit; text-decoration: none; }

button { color: inherit; }

svg { display: block; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  min-height: 46px;
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .9);
  outline-offset: 3px;
}

.site-header {
  height: 76px;
  padding: 0 var(--page-gutter);
  background: var(--black);
}

.site-nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  max-width: var(--content);
  margin: 0 auto;
}

.nav-side { display: flex; align-items: center; gap: 28px; }
.nav-side-right { justify-content: flex-end; }

.nav-side a,
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-side a:hover,
.site-footer nav a:hover { color: var(--white); }

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.03em;
}

.brand svg { width: 23px; height: 23px; fill: currentColor; }

main {
  margin: 0 var(--page-gutter) 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: #000;
  overflow: hidden;
  position: relative;
}

.hero-video-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
  transition: opacity 400ms ease;
}

.hero-video-backdrop video {
  width: 100%;
  height: 100%;
  border-radius: 0;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  background-color: transparent;
}

.hero-video-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.1);
  overflow: clip;
  -webkit-mask: linear-gradient(#000 0%, #0000 17.8597%), linear-gradient(#0000 76.3179%, #000 100%);
  mask: linear-gradient(#000 0%, #0000 17.8597%), linear-gradient(#0000 76.3179%, #000 100%);
}

#results-view.is-active ~ .hero-video-backdrop,
main:has(#results-view.is-active) .hero-video-backdrop {
  opacity: 0.15;
}

@media (prefers-reduced-motion: reduce) {
  .hero-video-backdrop video {
    display: none;
  }
}

.view {
  position: relative;
  z-index: 2;
  display: none;
  width: 100%;
  max-width: var(--content);
  min-height: calc(100dvh - 108px);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 132px) clamp(22px, 5vw, 72px);
}

.view.is-active { display: block; animation: view-in 360ms ease-out both; }

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

.view-hero.is-active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy { max-width: 900px; margin: 0 auto; text-align: center; }

.eyebrow {
  margin: 0 0 20px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.eyebrow-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 9px 1px 0;
  border-radius: 999px;
  background: var(--blue);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 26px;
  font-size: clamp(50px, 7vw, 86px);
  font-weight: 300;
  letter-spacing: -.065em;
  line-height: .98;
}

.hero-description {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
  letter-spacing: -.02em;
}

.scan-form { max-width: 780px; margin: 44px auto 0; text-align: left; }
.scan-form > label { display: block; margin: 0 0 10px 4px; color: var(--muted-strong); font-size: 13px; font-weight: 500; }

.url-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.url-field:focus-within { border-color: #737373; box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .25); }

.url-field input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font-size: 17px;
}

.url-field input::placeholder { color: var(--subtle); opacity: 1; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}

.button:disabled { cursor: wait; opacity: .55; }
.button-primary { background: var(--white); color: var(--black); }
.button-primary:hover:not(:disabled) { background: #dedede; }
.button-secondary { border-color: var(--line-strong); background: transparent; color: var(--white); }
.button-secondary:hover:not(:disabled) { background: var(--surface-soft); }

.url-field .button { min-height: 52px; padding: 0 22px; }
.url-field .button svg { width: 18px; height: 18px; margin-left: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.field-error,
.qualification-error { min-height: 22px; margin: 8px 4px 0; color: var(--danger); font-size: 13px; }

.form-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

.form-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 920px;
  width: 100%;
  margin: clamp(56px, 9vh, 96px) auto 0;
  border-top: 1px solid var(--line);
}

.hero-proof div { display: flex; align-items: flex-start; gap: 14px; padding: 22px 26px 0; }
.hero-proof div + div { border-left: 1px solid var(--line); }
.hero-proof span { color: #656565; font-size: 11px; font-variant-numeric: tabular-nums; }
.hero-proof p { margin: 0; color: var(--muted-strong); font-size: 13px; line-height: 1.45; }

.view-loading.is-active { display: grid; place-items: center; }

.loading-layout {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  align-items: center;
  gap: clamp(64px, 10vw, 150px);
  width: 100%;
  max-width: 920px;
}

.scan-visual { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 320px; width: 100%; margin: 0 auto; }
.scan-orbit { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 50%; }
.scan-orbit::before, .scan-orbit::after { content: ""; position: absolute; border: 1px solid #202020; border-radius: 50%; }
.scan-orbit::before { inset: 18%; }
.scan-orbit::after { inset: 36%; }
.scan-orbit span { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 6px rgba(255, 255, 255, .08); transform: translateX(-50%); animation: orbit 2.4s linear infinite; transform-origin: 4px calc(160px + 4px); }

@keyframes orbit { to { transform: translateX(-50%) rotate(360deg); } }

.scan-mark { width: 52px; height: 52px; fill: var(--white); animation: mark-pulse 2s ease-in-out infinite; }
@keyframes mark-pulse { 50% { opacity: .55; transform: scale(.96); } }

.loading-content h2,
.error-panel h2,
.results-header h2,
.dialog-header h2 {
  margin-bottom: 28px;
  font-size: clamp(36px, 4.5vw, 58px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1.04;
}

.analysis-steps { margin: 36px 0 0; padding: 0; list-style: none; }
.analysis-steps li { display: flex; align-items: center; min-height: 42px; gap: 14px; color: var(--subtle); font-size: 14px; transition: color var(--transition), opacity var(--transition); }
.step-indicator { width: 9px; height: 9px; border: 1px solid #4d4d4d; border-radius: 50%; transition: all var(--transition); }
.analysis-steps li.is-current { color: var(--white); }
.analysis-steps li.is-current .step-indicator { border-color: var(--white); background: var(--white); box-shadow: 0 0 0 5px rgba(255, 255, 255, .08); }
.analysis-steps li.is-complete { color: #8f8f8f; }
.analysis-steps li.is-complete .step-indicator { border-color: #6e6e6e; background: #6e6e6e; }
.analysis-progress { width: min(360px, 100%); height: 2px; margin-top: 24px; overflow: hidden; background: #292929; }
.analysis-progress span { display: block; width: 8%; height: 100%; background: var(--white); transition: width 700ms cubic-bezier(.2, .7, .3, 1); }
.loading-note { margin: 28px 0 0; color: var(--subtle); font-size: 12px; }

.view-error.is-active { display: grid; place-items: center; }
.error-panel { max-width: 600px; text-align: center; }
.error-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 28px; border: 1px solid #402929; border-radius: 50%; color: var(--danger); }
.error-icon svg { width: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.5; }
.error-panel > p:not(.eyebrow) { max-width: 500px; margin: 0 auto; color: var(--muted); font-size: 17px; }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 32px; }

.view-results { padding-top: clamp(56px, 7vw, 92px); }

.results-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  align-items: end;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}

.results-header h2 { max-width: 760px; margin-bottom: 16px; }
.results-header h2:focus { outline: none; }
.company-summary { max-width: 700px; margin: 0; color: var(--muted); font-size: 16px; }
.scan-meta { padding-left: 30px; border-left: 1px solid var(--line); }
.scan-meta p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.scan-meta p span { display: inline-block; min-width: 24px; color: var(--white); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.text-button { min-height: 44px; margin: 6px 0 0 -10px; padding: 0 10px; border: 0; background: none; color: var(--muted-strong); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--white); }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin: 48px 0 12px; }
.section-heading .eyebrow { margin: 0; color: var(--white); }
.section-heading > p:last-child { margin: 0; color: var(--subtle); font-size: 12px; }

.opportunity { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #090909; transition: border-color var(--transition), background-color var(--transition); }
.view-results.is-active .opportunity { animation: opportunity-in 520ms cubic-bezier(.2,.7,.3,1) var(--card-delay) backwards; }
@keyframes opportunity-in { from { opacity: 0; transform: translateY(18px); } }
.opportunity:hover { border-color: var(--line-strong); background: #0c0c0c; }
.opportunity:first-child { border-color: #454545; }
.opportunity:last-child { border-bottom: 1px solid var(--line); }
.opportunity-main { display: grid; grid-template-columns: 54px minmax(0, 1fr) 116px; gap: 24px; padding: 32px 0; }
.opportunity-rank { color: #5d5d5d; font-size: 12px; font-variant-numeric: tabular-nums; }
.opportunity-category { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.opportunity h3 { margin: 0 0 10px; font-size: clamp(22px, 2.5vw, 31px); font-weight: 500; letter-spacing: -.035em; line-height: 1.15; }
.opportunity-label { margin: 18px 0 5px; color: var(--muted-strong); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.opportunity-reason { max-width: 700px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.priority { text-align: right; }
.priority strong { display: block; font-size: 30px; font-weight: 400; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.priority span { color: var(--subtle); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.opportunity-main { padding-right: 30px; padding-left: 28px; }
.opportunity-detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 34px; padding: 0 30px 30px 106px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { min-height: 76px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; }
.metric span { display: block; margin-bottom: 6px; color: var(--subtle); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { font-size: 13px; font-weight: 500; }
.evidence-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.evidence-block h4 { margin: 0 0 10px; color: var(--muted-strong); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.evidence-block ul, .ownership-grid ul, .human-led ul { margin: 0; padding: 0; list-style: none; }
.evidence-block li { position: relative; margin-top: 7px; padding-left: 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.evidence-block li::before { content: ""; position: absolute; top: 7px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #7a7a7a; }
.evidence-block.inferred li::before { border: 1px solid #696969; background: transparent; }
.opportunity-actions { display: flex; align-items: center; gap: 10px; padding: 0 30px 28px 106px; }
.implementation-note { max-width: 420px; margin: 0 auto 0 0; color: var(--subtle); font-size: 11px; line-height: 1.45; }
.opportunity-actions .button { min-height: 44px; }
.button-build { background: var(--blue); color: var(--white); }
.button-build:hover:not(:disabled) { background: var(--blue-hover); }

.implementation-bridge { display: grid; grid-template-columns: .72fr 1.28fr; gap: 48px; margin-top: 42px; padding: 32px 36px; border: 1px solid var(--line); border-radius: 16px; background: #101010; }
.implementation-bridge .eyebrow { margin: 2px 0 0; color: #b8b8b8; }
.implementation-bridge h3 { margin: 0 0 8px; font-size: clamp(20px, 2.2vw, 27px); font-weight: 400; letter-spacing: -.035em; line-height: 1.2; }
.implementation-bridge p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.all-opportunities { margin-top: 30px; border-bottom: 1px solid var(--line); }
.all-opportunities summary { display: flex; align-items: center; min-height: 68px; cursor: pointer; list-style: none; color: var(--muted-strong); font-size: 14px; }
.all-opportunities summary::-webkit-details-marker { display: none; }
.all-opportunities summary svg { width: 18px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform var(--transition); }
.all-opportunities[open] summary svg { transform: rotate(180deg); }
.summary-count { margin-left: 10px; color: var(--subtle); font-size: 12px; }
.compact-opportunity { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; min-height: 76px; border-top: 1px solid #202020; }
.compact-opportunity h3 { margin: 0 0 3px; font-size: 16px; font-weight: 500; }
.compact-opportunity p { margin: 0; color: var(--subtle); font-size: 12px; }
.compact-opportunity .button { min-height: 40px; padding: 0 14px; font-size: 12px; }

.human-led { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; margin-top: 64px; padding: 38px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #0e0e0e; }
.human-led .eyebrow { margin-bottom: 12px; }
.human-led h3 { margin: 0; font-size: 23px; font-weight: 400; letter-spacing: -.03em; }
.human-led li { position: relative; margin-bottom: 12px; padding-left: 20px; color: var(--muted); font-size: 13px; }
.human-led li::before { content: ""; position: absolute; top: 7px; left: 0; width: 7px; height: 7px; border: 1px solid #686868; border-radius: 50%; }

.evidence-note { display: flex; gap: 13px; margin-top: 24px; color: var(--subtle); font-size: 12px; }
.evidence-note > span { display: grid; place-items: center; flex: 0 0 20px; height: 20px; border: 1px solid #424242; border-radius: 50%; font-family: Georgia, serif; font-size: 11px; }
.evidence-note p { margin: 0; }
.evidence-note strong { color: #989898; font-weight: 500; }

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  max-width: var(--content);
  min-height: 116px;
  margin: 0 auto;
  padding: 24px var(--page-gutter);
}
.footer-brand { display: inline-flex; align-items: center; min-width: 46px; min-height: 46px; font-size: 16px; font-weight: 600; }
.site-footer > p { margin: 0; color: var(--subtle); font-size: 12px; }
.site-footer nav { display: flex; gap: 22px; }

dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

dialog::backdrop { background: rgba(0, 0, 0, .76); backdrop-filter: blur(8px); }
dialog[open] { display: grid; place-items: end; animation: backdrop-in 180ms ease-out; }

@keyframes backdrop-in { from { opacity: 0; } }

.dialog-frame {
  display: flex;
  flex-direction: column;
  width: min(780px, calc(100% - 20px));
  height: calc(100% - 20px);
  margin: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: #0d0d0d;
  box-shadow: -20px 0 80px rgba(0, 0, 0, .45);
  overflow: hidden;
  animation: dialog-in 280ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes dialog-in { from { opacity: 0; transform: translateX(24px); } }

.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 38px 42px 30px; border-bottom: 1px solid var(--line); }
.dialog-header > div:first-child { min-width: 0; }
.dialog-header .eyebrow { margin-bottom: 12px; }
.dialog-header h2 { margin: 0; font-size: clamp(30px, 4vw, 44px); }
.dialog-header h2 { overflow-wrap: anywhere; }
.workflow-reason { max-width: 610px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.icon-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.workflow-body { flex: 1; overflow-y: auto; padding: 34px 42px; }
.workflow-body section > h3, .integrations-section > h3 { margin: 0 0 16px; font-size: 14px; font-weight: 500; }
.workflow-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin: 0; padding: 0; list-style: none; counter-reset: workflow-step; }
.workflow-flow li { position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); color: var(--muted-strong); font-size: 12px; counter-increment: workflow-step; }
.workflow-flow li::before { content: counter(workflow-step, decimal-leading-zero); margin-right: 9px; color: #6f6f6f; font-size: 9px; }
.workflow-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -16px; color: #555; }

.ownership-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 38px; }
.ownership-grid section { padding: 24px; border: 1px solid var(--line); border-radius: 14px; }
.ownership-label { margin-bottom: 15px; color: var(--white); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.ownership-grid li { margin-top: 9px; color: var(--muted); font-size: 13px; }
.ownership-grid li::before { content: "—"; margin-right: 8px; color: #626262; }

.integrations-section { margin-top: 38px; }
.integrations-section > h3 { margin-bottom: 5px; }
.integrations-section > p { margin: 0 0 18px; color: var(--subtle); font-size: 12px; }
.integration-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.integration-flow > span, .integration-flow #integration-list span { display: inline-flex; min-height: 38px; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); font-size: 11px; }
.integration-flow .agent-node { border-color: #4d4d4d; background: var(--white); color: var(--black); font-weight: 600; }
.integration-flow .flow-arrow { border: 0; padding: 0; color: #555; }
#integration-list { display: flex; flex-wrap: wrap; gap: 7px; }

.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 42px; border-top: 1px solid var(--line); background: #0a0a0a; }

.qualification-frame { width: min(680px, calc(100% - 20px)); }
.qualification-progress-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: min(250px, 70vw); margin: 0 0 22px; }
.qualification-progress-track span { height: 2px; background: #303030; transition: background-color var(--transition); }
.qualification-progress-track span.is-complete { background: var(--white); }
.qualification-context { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.qualification-step { display: none; flex: 1; overflow-y: auto; padding: 30px 42px; }
.qualification-step.is-active { display: block; animation: view-in 220ms ease-out; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 14px; color: var(--muted-strong); font-size: 13px; font-weight: 500; }

.choice-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice-list legend { grid-column: 1 / -1; }
.choice-list label, .segmented-options label, .tool-options label { cursor: pointer; }
.choice-list input, .segmented-options input, .tool-options input { position: absolute; opacity: 0; pointer-events: none; }
.choice-list span { display: flex; align-items: center; min-height: 58px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 13px; transition: all var(--transition); }
.choice-list input:checked + span, .segmented-options input:checked + span, .tool-options input:checked + span { border-color: #777; background: var(--white); color: var(--black); }
.choice-list input:focus-visible + span, .segmented-options input:focus-visible + span, .tool-options input:focus-visible + span { outline: 3px solid rgba(255, 255, 255, .8); outline-offset: 2px; }

.volume-fieldset { margin-bottom: 30px; }
.segmented-options { display: grid; grid-template-columns: repeat(4, 1fr); }
.segmented-options span { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.segmented-options label:first-child span { border-radius: 10px 0 0 10px; }
.segmented-options label:last-child span { border-radius: 0 10px 10px 0; }
.segmented-options label + label span { border-left: 0; }
.tool-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-options span { display: inline-flex; align-items: center; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }

.contact-fields { display: grid; gap: 18px; }
.field-group label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted-strong); font-size: 12px; }
.field-group label span { color: var(--subtle); }
.field-group input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--surface-raised); color: var(--white); }
.field-group input:focus { border-color: #747474; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.contact-summary { margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.contact-summary span { display: block; color: var(--subtle); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.contact-summary strong { display: block; margin-top: 5px; font-size: 14px; font-weight: 500; }
.contact-summary p { margin: 10px 0 0; color: #8f8f8f; font-size: 11px; }

.qualification-error { padding: 0 42px; }
.qualification-footer { justify-content: space-between; }
#qualification-submit { display: none; margin-left: auto; background: var(--blue); color: var(--white); }
#qualification-back { visibility: hidden; }
.qualification-success { text-align: center; padding-top: 70px; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 25px; color: var(--success); }
.success-mark svg { width: 64px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.qualification-success h3 { margin-bottom: 10px; font-size: 28px; font-weight: 500; letter-spacing: -.035em; }
.qualification-success p { max-width: 410px; margin: 0 auto 28px; color: var(--muted); }

@media (max-width: 800px) {
  .site-header { height: 68px; }
  .site-nav { grid-template-columns: 1fr; }
  .nav-side { display: none; }
  .brand { justify-self: center; }
  main { margin: 0 10px 32px; border-radius: 22px; }
  .view { min-height: calc(100dvh - 88px); padding: 64px 20px; }
  h1 { font-size: clamp(46px, 13vw, 66px); }
  .hero-description { font-size: 17px; }
  .scan-form { margin-top: 34px; }
  .url-field { display: block; padding: 7px; }
  .url-field input { height: 50px; padding: 0 12px; font-size: 16px; }
  .url-field .button { width: 100%; }
  .hero-proof { grid-template-columns: 1fr; margin-top: 52px; }
  .hero-proof div { padding: 15px 4px; }
  .hero-proof div + div { border-top: 1px solid var(--line); border-left: 0; }
  .loading-layout { grid-template-columns: 1fr; gap: 48px; }
  .scan-visual { max-width: 190px; }
  .scan-orbit span { transform-origin: 4px calc(95px + 4px); }
  .loading-content { text-align: center; }
  .analysis-steps { display: inline-block; text-align: left; }
  .results-header { grid-template-columns: 1fr; gap: 28px; padding-bottom: 38px; }
  .scan-meta { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .section-heading { display: block; }
  .section-heading > p:last-child { margin-top: 8px; }
  .opportunity-main { grid-template-columns: 34px minmax(0, 1fr) 74px; gap: 12px; padding: 26px 20px; }
  .priority strong { font-size: 24px; }
  .opportunity-detail { grid-template-columns: 1fr; gap: 22px; padding: 0 20px 26px 66px; }
  .evidence-columns { grid-template-columns: 1fr; gap: 18px; }
  .opportunity-actions { flex-wrap: wrap; padding: 0 20px 24px 66px; }
  .implementation-note { flex-basis: 100%; margin-bottom: 6px; }
  .implementation-bridge { grid-template-columns: 1fr; gap: 14px; padding: 26px; }
  .compact-opportunity { grid-template-columns: 1fr auto; padding: 15px 0; }
  .compact-opportunity .button-secondary { display: none; }
  .human-led { grid-template-columns: 1fr; gap: 28px; padding: 26px; }
  .site-footer { grid-template-columns: 1fr; gap: 10px; padding-top: 34px; padding-bottom: 34px; }
  .site-footer nav { flex-wrap: wrap; margin-top: 10px; }
  .dialog-frame, .qualification-frame { width: 100%; height: calc(100% - 8px); margin: 8px 0 0; border-radius: 20px 20px 0 0; animation-name: dialog-up; }
  @keyframes dialog-up { from { opacity: 0; transform: translateY(28px); } }
  .dialog-header { padding: 24px 20px 20px; }
  .workflow-body, .qualification-step { padding: 26px 20px; }
  .dialog-footer { padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
  .ownership-grid { grid-template-columns: 1fr; }
  .qualification-error { padding: 0 20px; }
  .choice-list { grid-template-columns: 1fr; }
  .segmented-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  .segmented-options span { border: 1px solid var(--line) !important; border-radius: 10px !important; }
}

@media (max-width: 480px) {
  h1 br { display: none; }
  .opportunity-main { grid-template-columns: 28px minmax(0, 1fr); }
  .priority { grid-column: 2; display: flex; align-items: baseline; gap: 7px; text-align: left; }
  .opportunity-detail, .opportunity-actions { padding-left: 48px; }
  .opportunity-actions { flex-direction: column; }
  .opportunity-actions .button { width: 100%; }
  .compact-opportunity { grid-template-columns: 1fr; }
  .compact-opportunity .button { width: 100%; }
  .dialog-footer .button { flex: 1; padding: 0 12px; }
  .workflow-flow { display: grid; grid-template-columns: 1fr; gap: 20px; }
  .workflow-flow li { width: 100%; }
  .workflow-flow li:not(:last-child)::after { content: "↓"; right: auto; bottom: -18px; left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
