@import url("tokens.css");
/* AI Systems Finder shell (R4, 19 Oct 2026). Design pass, 14 Nov 2026: every size, gap and colour comes from
   tokens.css; the four control states are in states.css (finder pages only). */
*, *::before, *::after { box-sizing: border-box; }
[hidden]:not(.fd-sheet) { display: none !important; }
html { background: var(--fd-ink); -webkit-text-size-adjust: 100%; }
body.fd-page {
  margin: 0; min-height: 100svh; background: var(--fd-ink); color: var(--fd-ink);
  font-family: var(--font-body); font-size: var(--fd-t2); line-height: var(--fd-lh-body);
  padding: var(--fd-s4) max(var(--fd-s5), env(safe-area-inset-right, 0px)) var(--fd-s6) max(var(--fd-s5), env(safe-area-inset-left, 0px));
}
/* Zero-weight bases: every class and the cookie notice win over them. */
:where(.fd-page) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.fd-page) button { cursor: pointer; }
:where(.fd-page) a { color: var(--fd-accent); text-underline-offset: 3px; }
/* One focus ring: 2px Consulting Blue, 3px clear; Off-White on a dark block. */
.fd-page :focus-visible { outline: var(--fd-focus); outline-offset: var(--fd-focus-off); }
.fd-page img { max-width: 100%; }

.fd-page .skip-link {
  position: absolute; left: var(--fd-s3); top: calc(-1 * var(--fd-s8)); z-index: 50; display: inline-flex; align-items: center;
  min-height: var(--fd-tap); padding: 0 var(--fd-s4); border-radius: var(--fd-r2);
  background: var(--fd-surface); color: var(--fd-ink); font-weight: 600; text-decoration: none;
}
.fd-page .skip-link:focus { top: var(--fd-s3); outline: 2px solid var(--fd-surface); outline-offset: var(--fd-focus-off); }

/* Visually hidden, still read and still focusable. */
.fd-sr, .fd-vh {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* A choice's input covers its box, so focus scrolls the whole box clear of the phone footer. */
:is(.fd-tile, .fd-chip, .fd-sys) > .fd-vh {
  inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; clip: auto; clip-path: none; appearance: none; pointer-events: none;
}

/* The shell: rail left, questions right */
.fd {
  position: relative; z-index: 1; max-width: var(--fd-shell-max); margin: 0 auto; min-height: 720px;
  display: grid; grid-template-columns: var(--fd-rail-w) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "intro main" "rail main";
  background: var(--fd-ground); border-radius: var(--fd-r4); overflow: clip;
}
.fd-intro { grid-area: intro; background: var(--fd-surface); padding: var(--fd-s6) var(--fd-s6) var(--fd-s1); display: grid; gap: var(--fd-s3); align-content: start; }
.fd-mark { display: inline-flex; width: max-content; border-radius: var(--fd-r1); }
.fd-mark img { display: block; height: 22px; width: auto; } /* the wordmark's own size (design.md section 5) */
#fd-title {
  margin: var(--fd-s2) 0 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fd-t5); line-height: var(--fd-lh-tight);
  letter-spacing: -0.01em; text-wrap: balance;
}
.fd-lede { margin: 0; max-width: var(--fd-measure); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }

/* Rail: the six steps, each a 24px dot and a line to the next. */
.fd-rail { grid-area: rail; background: var(--fd-surface); padding: var(--fd-s5) var(--fd-s6) var(--fd-s6); display: flex; flex-direction: column; gap: var(--fd-s5); }
.fd-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.fd-step { position: relative; padding: 0 0 var(--fd-s5) calc(var(--fd-s5) + var(--fd-s4)); min-height: var(--fd-s7); }
.fd-step:last-child { padding-bottom: 0; }
.fd-step::before {
  content: ""; position: absolute; left: calc(var(--fd-s5) / 2 - 1px); top: calc(var(--fd-s5) + var(--fd-s1)); bottom: 2px; width: 2px;
  background: var(--fd-ground);
}
.fd-step:last-child::before { display: none; }
.fd-step[data-state="done"]::before { background: var(--fd-accent); }
.fd-dot {
  position: absolute; left: 0; top: 0; width: var(--fd-s5); height: var(--fd-s5); border-radius: 50%;
  border: 2px solid var(--fd-muted); background: var(--fd-surface); display: grid; place-items: center;
}
.fd-step[data-state="current"] .fd-dot { border-color: var(--fd-accent); }
.fd-step[data-state="current"] .fd-dot::after { content: ""; width: var(--fd-s2); height: var(--fd-s2); border-radius: 50%; background: var(--fd-accent); }
.fd-step[data-state="done"] .fd-dot { border-color: var(--fd-accent); background: var(--fd-accent); }
.fd-step[data-state="done"] .fd-dot::after {
  content: ""; width: var(--fd-s3); height: var(--fd-s3); background: var(--fd-surface);
  --fd-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask: var(--fd-tick) center / contain no-repeat; mask: var(--fd-tick) center / contain no-repeat;
}
.fd-step-b { display: grid; gap: var(--fd-s1); width: 100%; padding: 0; margin: 0; border: 0; background: none; text-align: left; border-radius: var(--fd-r1); }
button.fd-step-b { min-height: var(--fd-tap); align-content: start; }
div.fd-step-b { cursor: default; }
.fd-step-n { font-weight: 700; font-size: var(--fd-t2); line-height: var(--fd-s5); }
.fd-step-s { font-size: var(--fd-t1); line-height: var(--fd-lh-head); }
.fd-step-a { font-size: var(--fd-t1); color: var(--fd-accent); font-weight: 600; line-height: var(--fd-lh-head); overflow-wrap: anywhere; }

/* Questions column */
.fd-top { display: none; }
.fd-bar { height: 6px; border-radius: 3px; background: var(--fd-line); overflow: hidden; }
.fd-bar span { display: block; height: 100%; width: var(--fd-done, 0%); border-radius: inherit; background: var(--fd-accent); transition: width 300ms var(--ease-out); }
.fd-main > .fd-bar { width: 100%; max-width: var(--fd-form, 640px); margin: 0 auto var(--fd-s6); }
.fd[data-fd-step="estimate"] .fd-main > .fd-bar { display: none; }
.fd-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; padding: var(--fd-s7) var(--fd-s7) var(--fd-s6); }
.fd-main:focus { outline: none; }
.fd-main > form { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fd-slide {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--fd-s6);
  max-width: var(--fd-slide-max); width: 100%; margin: 0 auto; min-width: 0;
}
.fd-slide:focus { outline: none; }
.fd-slide:focus-visible { outline: var(--fd-focus); outline-offset: var(--fd-s2); border-radius: var(--fd-r1); }
.fd-slide.fd-enter { animation: fd-enter 150ms var(--ease-out); }
@keyframes fd-enter { from { opacity: 0; } to { opacity: 1; } }
.fd-noscript { margin: 0; max-width: 60ch; font-size: var(--fd-t2); }

/* Footer: one alert line, Back, Next */
.fd-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--fd-s4); flex-wrap: wrap;
  max-width: var(--fd-slide-max); width: 100%; margin: var(--fd-s6) auto 0;
}
/* An error line: an icon (states.css) and words, never colour alone. */
.fd-foot-err {
  margin: 0 auto 0 0; flex: 1 1 auto; min-width: 0; display: flex; gap: var(--fd-s2); align-items: flex-start;
  font-size: var(--fd-t2); font-weight: 600; line-height: var(--fd-lh-head); color: var(--fd-ink);
}
.fd-back {
  display: inline-flex; align-items: center; gap: var(--fd-s2); min-height: var(--fd-tap); padding: 0 var(--fd-s2); border: 0; background: none;
  font-weight: 600; border-radius: var(--fd-r2); white-space: nowrap;
}
.fd-go, .fd-back { flex: 0 0 auto; }
.fd-go::after, .fd-back::before {
  content: ""; width: var(--fd-t2); height: var(--fd-t2); flex: none; background: currentColor;
  -webkit-mask: var(--fd-arrow) center / contain no-repeat; mask: var(--fd-arrow) center / contain no-repeat;
}
.fd-go { --fd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.fd-back { --fd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* The main button (design.md section 7): Charcoal, Consulting Blue on hover. */
.fd-go {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--fd-s2); min-height: var(--fd-s7); padding: var(--fd-s2) var(--fd-s5);
  border: 0; border-radius: var(--fd-r2); background: var(--fd-ink); color: var(--fd-surface);
  font-weight: 600; font-size: var(--fd-t2); white-space: nowrap; text-decoration: none; box-shadow: var(--fd-lift);
  transition: background-color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.fd-go::after { transition: transform var(--dur-ui) var(--ease-out); }
.fd-go:active { transform: scale(0.97); }
.fd-plain {
  display: inline-flex; align-items: center; min-height: var(--fd-tap); padding: 0; border: 0; background: none;
  color: var(--fd-accent); font-weight: 600; font-size: var(--fd-t2); text-decoration: underline; text-underline-offset: 3px;
  border-radius: var(--fd-r1); text-align: left;
}
.fd-ghost, .fd-more {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--fd-s2); min-height: var(--fd-tap); padding: 0 var(--fd-s4);
  border: 2px solid var(--fd-ink); border-radius: var(--fd-r2); background: transparent; color: var(--fd-ink);
  font-weight: 600; justify-self: start; white-space: nowrap;
  transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
}

/* Answers sheet (phone) */
.fd-sheet { position: fixed; inset: 0; z-index: 30; display: grid; align-items: end; background: color-mix(in srgb, var(--fd-ink) 60%, transparent); }
.fd-sheet-in {
  background: var(--fd-surface); border-radius: var(--fd-r4) var(--fd-r4) 0 0; max-height: 82svh; overflow: auto; display: grid; gap: var(--fd-s4);
  padding: var(--fd-s5) max(var(--fd-s4), env(safe-area-inset-right, 0px)) calc(var(--fd-s5) + env(safe-area-inset-bottom, 0px)) max(var(--fd-s4), env(safe-area-inset-left, 0px));
}
.fd-sheet { transition: opacity 200ms var(--ease-out), display 300ms allow-discrete; }
.fd-sheet[hidden] { display: none; opacity: 0; }
.fd-sheet[hidden] .fd-sheet-in { transform: translateY(100%); }
.fd-sheet-in { transition: transform 300ms cubic-bezier(.32, .72, 0, 1); }
@starting-style { .fd-sheet { opacity: 0; } .fd-sheet .fd-sheet-in { transform: translateY(100%); } }
.fd-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: var(--fd-s3); }
#fd-sheet-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fd-t4); }
.fd-sheet .fd-plain { min-width: var(--fd-tap); justify-content: center; padding: 0 var(--fd-s2); }

/* Hover: pointer devices only */
@media (hover: hover) and (pointer: fine) {
  .fd-go:not(:disabled, [aria-disabled="true"]):hover { background: var(--fd-accent); transform: translateY(-2px); }
  .fd-go:not(:disabled, [aria-disabled="true"]):hover::after { transform: translateX(var(--fd-s1)); }
  .fd-go:not(:disabled, [aria-disabled="true"]):hover:active { transform: translateY(-2px) scale(0.97); }
  .fd-back:not(:disabled):hover { color: var(--fd-accent); }
  .fd-plain:hover, .fd-page a:hover { text-decoration-thickness: 2px; }
  button.fd-step-b:hover .fd-step-n { text-decoration: underline; text-underline-offset: 3px; }
  :is(.fd-ghost, .fd-more):not(:disabled, [aria-disabled="true"]):hover { background: var(--fd-ink); color: var(--fd-surface); }
}

/* Narrow desktop */
@media (max-width: 1020px) {
  .fd { --fd-rail-w: 272px; }
  .fd-intro { padding: var(--fd-s6) var(--fd-s5) var(--fd-s1); }
  .fd-rail { padding: var(--fd-s5) var(--fd-s5) var(--fd-s5); }
  .fd-main { padding: var(--fd-s6) var(--fd-s6) var(--fd-s5); }
}

/* Phone (architecture-a11y-phone.md section 10) */
@media (max-width: 820px) {
  :root { --fd-foot-h: 72px; }
  body.fd-page { padding: var(--fd-s2) max(var(--fd-s3), env(safe-area-inset-right, 0px)) 0 max(var(--fd-s3), env(safe-area-inset-left, 0px)); }
  .fd {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "top" "intro" "main";
    border-radius: var(--fd-r4) var(--fd-r4) 0 0; min-height: calc(100svh - var(--fd-s2));
  }
  .fd-wait { border-radius: var(--fd-r4); }
  .fd-rail { display: none; }
  .fd-top {
    grid-area: top; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--fd-s2) var(--fd-s3);
    background: var(--fd-surface); padding: var(--fd-s3) var(--fd-s4);
  }
  .fd-top .fd-mark { min-height: var(--fd-tap); align-items: center; }
  .fd-top .fd-mark img { height: 18px; } /* the wordmark's phone size */
  .fd-ans {
    min-height: var(--fd-tap); padding: 0 var(--fd-s4); border: 0; border-radius: var(--fd-r2);
    background: var(--fd-ground); font-weight: 600; font-size: var(--fd-t2); white-space: nowrap;
  }
  .fd-stepline { grid-column: 1 / -1; margin: 0; font-size: var(--fd-t1); }
  .fd-bar { grid-column: 1 / -1; }
  .fd-main > .fd-bar { display: none; }
  .fd-intro { background: none; padding: var(--fd-s5) var(--fd-s4) 0; gap: var(--fd-s2); }
  .fd-intro .fd-mark { display: none; }
  .fd-wait .fd-intro .fd-mark { display: inline-flex; }
  #fd-title { margin: 0; font-size: var(--fd-t4); }
  /* The lede hides once the visitor starts. */
  .fd:not([data-fd-step="company"]) .fd-lede, .fd[data-fd-started] .fd-lede { display: none; }
  /* The h1 stays above the questions (spec section 10), smaller after step 1. */
  .fd[data-fd-step]:not([data-fd-step="company"]) .fd-intro { padding-top: var(--fd-s4); }
  .fd-main { padding: var(--fd-s5) var(--fd-s4) 0; }
  .fd-slide { gap: var(--fd-s6); }
  .fd-foot {
    position: sticky; bottom: 0; z-index: 5; margin: var(--fd-s5) calc(-1 * var(--fd-s4)) 0; width: auto; max-width: none;
    padding: var(--fd-s3) var(--fd-s4) calc(var(--fd-s3) + env(safe-area-inset-bottom, 0px)); background: var(--fd-ground);
    border-top: 1px solid var(--fd-line); gap: var(--fd-s2) var(--fd-s3);
  }
  .fd-foot-err { flex-basis: 100%; order: -1; }
  /* Focus scrolls clear of the footer, taller while its alert shows (WCAG 2.4.11, C43); scroll padding, as older
     Chrome skips scroll-margin on a control partly on screen. The alert holds two lines until footError fills it. */
  :root:has(.fd-foot-err:not([hidden])) { --fd-foot-h: 140px; }
  html { scroll-padding-bottom: calc(var(--fd-foot-h) + var(--fd-s4) + env(safe-area-inset-bottom, 0px)); }
  .fd-foot-err:empty { min-height: 3em; }
}
/* Smallest phones: a 4px gutter, so seven 44px calendar days fit at 320px. */
@media (max-width: 359px) {
  body.fd-page { padding-left: max(var(--fd-s1), env(safe-area-inset-left, 0px)); padding-right: max(var(--fd-s1), env(safe-area-inset-right, 0px)); }
}

/* Reduced motion: every transition, animation and smooth scroll off, on every finder control and the sheet. */
@media (prefers-reduced-motion: reduce) {
  .fd-page *, .fd-page *::before, .fd-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html:has(.fd-page) { scroll-behavior: auto; }
  .fd-page :is(.fd-go, .fd-tile, .fd-chip, .fd-sys, button, a):is(:active){ transform: none !important; }@media (hover: hover) and (pointer: fine){.fd-page :is(.fd-go, .fd-tile, .fd-chip, .fd-sys, button, a):is(:hover),.fd-page .fd-go:hover::after{ transform: none !important; }}
}
