/* AI Systems Finder parts the scorecard page (ai-systems-score.html) never uses, kept out of finder.css, which it
   shares, and loaded last on the finder's own pages (scripts/library/shells.ts finderShell).
   Design pass, 14 Nov 2026: tokens from finder.css only; the wide layout and the phone stacking are in layout.css. */

/* The preview bar (preview builds only) and the holding page (no approved wording yet). */
.lib-preview-bar {
  position: relative; z-index: 1; max-width: var(--fd-shell-max); margin: 0 auto var(--fd-s3); text-align: center;
  color: var(--fd-ground); font-size: var(--fd-t1);
}
.fd-wait { display: block; min-height: 0; }
.fd-wait .fd-main { padding: 0; }
.fd-wait .fd-intro { padding: var(--fd-s7); gap: var(--fd-s4); }

/* The so-far box (rework, 22 Oct 2026): hours only, Charcoal, at the foot of the desktop rail. Each figure leads its
   line, the figures in one column and their words in the next. Phones never show it: the rail is hidden there. */
.fd-tally {
  margin: auto 0 0; padding: var(--fd-s4) var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-ink); color: var(--fd-surface);
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--fd-s2) var(--fd-s3); align-items: baseline;
}
.fd-tally[hidden] { display: none; }
.fd-tally > p { margin: 0; }
.fd-tally-h { grid-column: 1 / -1; font-weight: 600; font-size: var(--fd-t2); line-height: var(--fd-lh-head); }
.fd-tally-l { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; font-size: var(--fd-t1); line-height: var(--fd-lh-head); }
.fd-tally-l[hidden], .fd-tally-note[hidden] { display: none; }
.fd-tally-note { grid-column: 1 / -1; font-size: var(--fd-t1); line-height: var(--fd-lh-body); }
.fd-tally-n { justify-self: end; font-family: var(--font-mono); font-weight: 500; font-size: var(--fd-t4); line-height: var(--fd-lh-tight); font-variant-numeric: tabular-nums; }
.fd-tally :focus-visible { outline-color: var(--fd-surface); }

/* The estimate, step 6 (23 Oct 2026): the intro and the steps rail go and the results take the full width; the
   wordmark stays. The h1 stays for screen readers, hidden from view. The page by link keeps its own intro. */
.fd:not(.fd-wait)[data-fd-step="estimate"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "intro" "main"; }
.fd:not(.fd-wait)[data-fd-step="estimate"] .fd-rail, .fd[data-fd-step="estimate"] .fd-lede { display: none; }
.fd:not(.fd-wait)[data-fd-step="estimate"] .fd-intro { background: none; padding: var(--fd-s6) var(--fd-s7) 0; }
.fd:not(.fd-wait)[data-fd-step="estimate"] #fd-title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.fd[data-fd-step="estimate"] :is(.fd-slide, .fd-foot) { max-width: none; }
@media (max-width: 1020px) {
  .fd:not(.fd-wait)[data-fd-step="estimate"] .fd-intro { padding: var(--fd-s6) var(--fd-s6) 0; }
}

/* The results page by link (rework, 22 Oct 2026): the wait page's box with the estimate under the intro. */
.fd-link .fd-main { padding: 0 var(--fd-s7) var(--fd-s7); }
.fd-link .fd-est { padding-bottom: var(--fd-s7); }
/* Design pass: the intro sits on the page ground in line with the estimate, not in an inset Off-White slab. */
.fd-link .fd-intro { background: none; padding: var(--fd-s6) 0 var(--fd-s5); }
@media (max-width: 820px) {
  .fd-link .fd-main { padding: 0 var(--fd-s4) var(--fd-s5); }
  /* Step 6 on a phone: no page title above the results, which start under the top bar and its wordmark. */
  .fd:not(.fd-wait)[data-fd-step="estimate"] { grid-template-rows: auto auto 1fr; grid-template-areas: "top" "intro" "main"; }
  .fd:not(.fd-wait)[data-fd-step="estimate"] .fd-intro { padding: 0; }
}

/* The estimate's two charts (rework, 22 Oct 2026; moved from results.css, 14 Nov 2026): a label, a bar on one scale, the figure. Bars are drawn only; each row reads as text. */
.fd-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fd-s3); }
.fd-chart { display: grid; gap: var(--fd-s3); align-content: start; min-width: 0; padding: var(--fd-s4) var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-surface); box-shadow: var(--fd-shadow); }
.fd-chart h3 { margin: 0; font-family: var(--font-body); font-weight: 600; font-size: var(--fd-t3); line-height: var(--fd-lh-head); }
.fd-chart-pick { display: grid; gap: var(--fd-s2); }
.fd-chart-pick + .fd-chart-pick { padding-top: var(--fd-s3); border-top: 1px solid var(--fd-line); }
.fd-chart-k { margin: 0; font-size: var(--fd-t1); line-height: var(--fd-lh-head); }
.fd-bars { display: grid; gap: var(--fd-s2); }
.fd-bar-r { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr) auto; align-items: center; gap: var(--fd-s2) var(--fd-s3); font-size: var(--fd-t2); }
.fd-bar-l { line-height: var(--fd-lh-head); }
.fd-bar-t { display: block; height: var(--fd-s5); border-radius: var(--fd-r1); background: var(--fd-ground); overflow: hidden; }
.fd-bar-f { display: block; height: 100%; width: var(--w, 0%); border-radius: var(--fd-r1); background: var(--fd-ink); }
.fd-bar-after, .fd-bar-worth { background: var(--fd-accent); }
.fd-bar-v { font-family: var(--font-mono); font-weight: 500; font-size: var(--fd-t2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The pick's title as a plain heading over its questions (23 Oct 2026): Charcoal in the display serif, close to its
   "You get" box. */
h2.fd-counter { padding: 0; border-radius: 0; background: none; 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-slide > h2.fd-counter + [data-fd-about] { margin-top: calc(var(--fd-s3) - var(--fd-s7)); }

/* Thinner sliders (Kristian, 23 Oct 2026): Not sure, the 4P Not sure chip or the switch to the other figure top left,
   the figure top right on the same row, and the two ends tight under the bar. Finder pages only. */
.fd-slider { padding: var(--fd-s2) var(--fd-s4) var(--fd-s3); row-gap: 0; align-items: center; }
.fd-slider > :has(+ .fd-slider-v) { grid-column: 1; justify-self: start; }
/* A narrow box (phones): Not sure takes the top line and the figure sits under it on the right, so a growing figure
   never rewraps Not sure while the thumb moves. The slide is the container (Chrome, 23 Oct 2026). */
.fd-slide { container: fd-slide / inline-size; }
@container fd-slide (max-width: 560px) { .fd-slider > :has(+ .fd-slider-v) { grid-column: 1 / -1; } }
.fd-slider > .fd-plain:has(+ .fd-slider-v) { min-height: var(--fd-tap); }
.fd-slider > .fd-ends { margin-top: calc(-1 * var(--fd-s1)); }
/* Not sure ticked: the tick box says so, so the figure on its row stays blank rather than say it twice. */
.fd-slider:has(> .fd-unsure input:checked) > .fd-slider-v { visibility: hidden; }
.fd-slider > .fd-rate { margin-top: var(--fd-s2); }
.fd-slider > .fd-plain:not(:has(+ .fd-slider-v)) { margin-top: var(--fd-s1); }
.fd-slider .fd-chips { min-width: 0; }
.fd-slider .fd-chip { min-height: var(--fd-tap); padding: var(--fd-s1) var(--fd-s4); background: var(--fd-ground); box-shadow: none; }

/* The explainer (23 Oct 2026): a short pale box under a question a visitor could guess at, under the deposit
   button's lead line and under the estimate's tiles. A tone fill, no side rule. Its fold is styled in results.css. */
.fd-explain { margin: 0; max-width: var(--fd-measure); padding: var(--fd-s3) var(--fd-s4); border-radius: var(--fd-r2); background: var(--fd-tint); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
details.fd-explain { max-width: none; }
details.fd-explain > p { margin: var(--fd-s1) 0 0; max-width: var(--fd-measure); }
.fd-next p.fd-explain { max-width: none; background: var(--fd-surface); }

/* Sizes on the form and the estimate: one heading ladder (page 32, pick 32, question 24, section 20, card 20). */
.fd-legend { font-size: var(--fd-t4); }
[data-fd-systems] { display: grid; gap: var(--fd-s4); }
[data-fd-systems] > .fd-sys-sec ~ .fd-sys-sec { margin-top: var(--fd-s5); }
.fd-slide { gap: var(--fd-s7); }
.fd-est h2 { justify-self: start; font-size: var(--fd-t6); }
.fd-totals { padding: var(--fd-s5) var(--fd-s6); }
.fd-totals dd { font-size: var(--fd-t5); }
.fd-next :is(h3, .fd-next-t) { font-size: var(--fd-t5); }
@media (max-width: 820px) {
  .fd-slider { padding: var(--fd-s2) var(--fd-s3); }
  h2.fd-counter { font-size: var(--fd-t4); }
  .fd-legend { font-size: var(--fd-t3); }
  .fd-slide { gap: var(--fd-s6); }
  .fd-slide > h2.fd-counter + [data-fd-about] { margin-top: calc(var(--fd-s3) - var(--fd-s6)); }
  .fd-est h2 { font-size: var(--fd-t5); }
  .fd-totals { padding: var(--fd-s4); }
  .fd-totals dd { font-size: var(--fd-t4); }
  .fd-next :is(h3, .fd-next-t) { font-size: var(--fd-t4); }
}

/* Get it built: the call, then the study; side by side on a wide screen, a hairline between (23 Oct 2026). */
.fd-next-col { display: grid; gap: var(--fd-s3); justify-items: start; align-content: start; min-width: 0; }
@media (min-width: 821px) {
  .fd-next { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--fd-s6); }
  .fd-next-t { grid-column: 1 / -1; }
  .fd-next-study { padding-left: var(--fd-s6); border-left: 1px solid var(--fd-line); }
}

/* Impeccable review fixes (Kristian's go, 23 Oct 2026; finding numbers from the review page). */
/* 1. A system the picked package already holds: muted, no lift, and its line says why it cannot be ticked. */
.fd-sys:has(input[aria-disabled="true"]) { cursor: default; background: color-mix(in srgb, var(--fd-surface) 50%, transparent); box-shadow: none; }
.fd-sys-held { font-size: var(--fd-t1); font-weight: 600; color: var(--fd-accent); }
@media (hover: hover) and (pointer: fine) { .fd-sys:has(input[aria-disabled="true"]):hover { box-shadow: none; } }
/* 14. Slide 3's section names are real headings. */
.fd-sec-t { font-family: var(--font-body); letter-spacing: normal; }
/* 2. Book a call under the totals, and in the phone's fixed bar on the estimate. */
.fd-call-top { margin: 0; }
.fd-foot-call[hidden] { display: none; }
@media (min-width: 821px) { .fd-foot-call { display: none; } }
/* 8. Not sure is a chip everywhere: on a slider top left, under tiles in its own row. */
.fd-unsure.fd-chip { gap: 0; }
.fd-unsure-row { margin-top: var(--fd-s3); }
/* 11. The chosen day keeps a visible focus ring where the ring sits inside it (400px and under). */
@media (max-width: 400px) { .fd-day[aria-pressed="true"]:focus-visible { outline-color: var(--fd-surface); } }
@media (max-width: 820px) {
  /* 3. After step 1 the page title leaves the phone screen, so the question starts near the top. Screen readers keep it. */
  .fd:not(.fd-wait)[data-fd-step]:not([data-fd-step="company"]) #fd-title {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .fd:not(.fd-wait)[data-fd-step]:not([data-fd-step="company"]) .fd-intro { padding: 0; }
  /* 16. The wordmark link is 44px tall on the estimate page by link too. */
  .fd-mark { min-height: var(--fd-tap); align-items: center; }
}
/* 10. Windows high contrast: picked tiles, chips, cards and days, and the current step, still show. */
@media (forced-colors: active) {
  :is(.fd-tile, .fd-chip, .fd-sys) { border: 1px solid CanvasText; }
  :is(.fd-tile, .fd-chip, .fd-sys):has(input:checked) { outline: 3px solid Highlight; outline-offset: 2px; }
  :is(.fd-tile, .fd-chip, .fd-sys):has(input:focus-visible) { outline: 3px solid CanvasText; }
  .fd-day[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .fd-step[data-state="current"] .fd-dot { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
  .fd-step[data-state="current"] .fd-step-n { text-decoration: underline; text-underline-offset: 4px; }
  .fd-bar-f { forced-color-adjust: none; background: CanvasText; }
  .fd-bar { border: 1px solid CanvasText; }
  .fd-bar span { forced-color-adjust: none; background: Highlight; }
}
/* 18. The finder no longer loads site-taste.css: the two things it took from it. Buttons press with motion on, and on
   phones every button and button-like link is at least 44px tall. */
@media (prefers-reduced-motion: no-preference) {
  html body main :is(a[class*="btn"], a[class*="cta"], button) {
    transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
  }
  html body main :is(a[class*="btn"], a[class*="cta"], button):not(:disabled, [aria-disabled="true"]):active { transform: scale(0.97); }
}
@media (max-width: 767px) {
  html body main :is(a[class*="btn"], a[class*="cta"], a[class*="link"], button):not(p a):not(p button) { min-height: var(--fd-tap); }
  html body main a[class*="link"]:not(p a) { display: inline-flex; align-items: center; }
}
