/* AI Systems Finder (R4): questions and controls, slides 1 to 5B. DOM: contracts-payload-and-dom.md section 6.
   Each tile holds its real input (fd-vh), so state is :has(input:checked). R5 sets --fill on each .fd-range.
   Design pass, 14 Nov 2026: sizes, gaps and colours only from the tokens in finder.css. */

/* Pick counter, about line, prefill line */
.fd-counter {
  justify-self: start; max-width: 100%; margin: 0; padding: var(--fd-s1) var(--fd-s3); border-radius: var(--fd-r3);
  background: var(--fd-surface); font-size: var(--fd-t1); line-height: var(--fd-lh-head); overflow-wrap: anywhere;
}
.fd-counter b { font-weight: 600; }
.fd-about { display: grid; gap: var(--fd-s1); padding: var(--fd-s3) var(--fd-s4); border-radius: var(--fd-r3); background: var(--fd-tint); }
.fd-about p { margin: 0; max-width: var(--fd-measure); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
.fd-prefill { margin: 0; font-size: var(--fd-t2); padding-left: var(--fd-s3); border-left: 2px solid var(--fd-muted); }

/* A question */
.fd-q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--fd-s3); }
.fd-legend {
  display: block; float: left; width: 100%; max-width: var(--fd-measure); padding: 0; margin: 0 0 var(--fd-s1);
  font-weight: 700; font-size: var(--fd-t3); line-height: var(--fd-lh-head); text-wrap: balance;
}
.fd-legend + * { clear: both; }
/* A question in a group (job.roles) reads as one of its inputs. */
.fd-q .fd-q > .fd-legend { font-size: var(--fd-t2); font-weight: 600; }
.fd-help { margin: calc(-1 * var(--fd-s2)) 0 0; max-width: var(--fd-measure); font-size: var(--fd-t2); }
/* The error line: an icon (finder.css) and bold words that say what to do, tied to its question by aria-describedby. */
.fd-err {
  margin: 0; display: flex; gap: var(--fd-s2); align-items: flex-start; max-width: var(--fd-measure);
  font-size: var(--fd-t2); font-weight: 600; line-height: var(--fd-lh-head); color: var(--fd-ink);
}

.fd-q[aria-invalid="true"] :is(.fd-tile, .fd-chip, .fd-sys, .fd-slider) { border-color: var(--fd-muted); }
/* A locked question: out of keyboard reach, words still readable. */
.fd-q:disabled :is(.fd-legend, .fd-help) { color: var(--fd-muted); }
.fd-q:disabled :is(.fd-tile, .fd-chip, .fd-slider) {
  cursor: not-allowed; background: color-mix(in srgb, var(--fd-surface) 50%, transparent); box-shadow: none; border: 2px dashed var(--fd-line);
}
.fd-q:disabled .fd-ico { background: transparent; color: var(--fd-muted); }
.fd-q:disabled .fd-tile.fd-tile-ph { min-height: var(--fd-s7); border-style: solid; border-color: transparent; cursor: default; }

/* Tiles: radio or checkbox */
.fd-tiles { display: grid; gap: var(--fd-s3); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fd-tiles[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fd-tile, .fd-chip, .fd-sys {
  position: relative; background: var(--fd-surface); border: 2px solid transparent; box-shadow: var(--fd-shadow);
  cursor: pointer; min-width: 0;
  transition: border-color var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out), background-color var(--dur-press) var(--ease-out);
}
/* Press: the most-pressed control answers the finger (scale 0.97). */
:is(.fd-tile, .fd-chip, .fd-sys):not(:has(input:disabled)):active { transform: scale(0.97); }
.fd-tile {
  display: grid; justify-items: center; align-content: start; gap: var(--fd-s2); text-align: center;
  padding: var(--fd-s4) var(--fd-s3); border-radius: var(--fd-r3);
}
.fd-tile:not(:has(.fd-ico)) { padding: var(--fd-s3); align-content: center; min-height: var(--fd-s7); }
.fd-ico { width: var(--fd-tap); height: var(--fd-tap); border-radius: var(--fd-r2); background: var(--fd-ground); color: var(--fd-accent); display: grid; place-items: center; }
.fd-ico svg { width: var(--fd-s5); height: var(--fd-s5); display: block; }
.fd-tile-l { font-weight: 700; font-size: var(--fd-t2); line-height: var(--fd-lh-head); overflow-wrap: anywhere; }
.fd-tile-s { font-size: var(--fd-t1); line-height: var(--fd-lh-head); }
:is(.fd-tile, .fd-chip, .fd-sys):has(input:checked) { border-color: var(--fd-accent); }
:is(.fd-tile, .fd-chip, .fd-sys):has(input:focus-visible) { outline: var(--fd-focus); outline-offset: var(--fd-focus-off); }
.fd-tile:has(input:checked) .fd-ico { background: var(--fd-accent); color: var(--fd-surface); }
:is(.fd-tile, .fd-chip, .fd-sys):has(input:disabled) { cursor: not-allowed; background: color-mix(in srgb, var(--fd-surface) 50%, transparent); box-shadow: none; color: var(--fd-muted); }
/* Tick badge on a chosen tile, chip or system: a Consulting Blue square (before) with an Off-White tick (after). */
:is(.fd-tile, .fd-chip, .fd-sys)::before, :is(.fd-tile, .fd-chip, .fd-sys)::after {
  content: ""; position: absolute; top: calc(-1 * var(--fd-s2)); right: calc(-1 * var(--fd-s2)); width: var(--fd-s5); height: var(--fd-s5);
  opacity: 0; transform: scale(0.8); pointer-events: none; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
:is(.fd-tile, .fd-chip, .fd-sys)::before { border-radius: var(--fd-r1); background: var(--fd-accent); box-shadow: var(--fd-shadow); }
:is(.fd-tile, .fd-chip, .fd-sys)::after {
  background: var(--fd-surface);
  -webkit-mask: 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.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 58% no-repeat;
  mask: 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.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 58% no-repeat;
}
:is(.fd-tile, .fd-chip, .fd-sys):has(input:checked)::before, :is(.fd-tile, .fd-chip, .fd-sys):has(input:checked)::after { opacity: 1; transform: none; }
.fd-chip::before, .fd-chip::after { top: calc(-1 * var(--fd-s2)); right: calc(-1 * var(--fd-s2)); width: var(--fd-s4); height: var(--fd-s4); }

/* Chips */
.fd-group-t { margin: var(--fd-s1) 0 calc(-1 * var(--fd-s1)); font-size: var(--fd-t1); font-weight: 600; }
.fd-chips { display: flex; flex-wrap: wrap; gap: var(--fd-s2); }
.fd-chip {
  display: inline-flex; align-items: center; gap: var(--fd-s2); min-height: var(--fd-tap); max-width: 100%; padding: var(--fd-s2) var(--fd-s4);
  border-radius: var(--fd-r2); font-weight: 600; font-size: var(--fd-t2); line-height: var(--fd-lh-head);
}
.fd-chip .fd-ico { width: var(--fd-s6); height: var(--fd-s6); border-radius: var(--fd-r1); }
.fd-chip .fd-ico svg { width: var(--fd-t3); height: var(--fd-t3); }

/* Text boxes: Other, custom title, contact. Label above, one column, a solid Steel edge (design.md, 13 Nov 2026). */
.fd-other, .fd-field { display: grid; gap: var(--fd-s2); min-width: 0; align-content: start; }
:is(.fd-other, .fd-field) label { font-size: var(--fd-t2); font-weight: 600; line-height: var(--fd-lh-head); }
.fd-page :is(.fd-other, .fd-field, .fd-sys-other + div) :is(input, select, textarea) {
  width: 100%; min-height: var(--fd-s7); padding: var(--fd-s2) var(--fd-s4); border: 2px solid var(--fd-muted); border-radius: var(--fd-r2);
  background: var(--fd-surface); box-shadow: var(--fd-shadow); font-size: var(--fd-t2); font-weight: 400;
}
.fd-page :is(.fd-other, .fd-field, .fd-sys-other + div) :is(input, select, textarea):focus { border-color: var(--fd-accent); }
.fd-page ::placeholder { color: var(--fd-muted); opacity: 1; }
/* Error (design pass, 14 Nov 2026): an icon before the line and a heavy Charcoal edge on the field, never colour alone. */
.fd-page :is(.fd-other, .fd-field, .fd-sys-other + div) :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--fd-ink); box-shadow: 0 0 0 1px var(--fd-ink); }
.fd-page :is(.fd-other, .fd-field, .fd-sys-other + div) :is(input, select, textarea)[aria-invalid="true"]:focus { border-color: var(--fd-accent); box-shadow: 0 0 0 1px var(--fd-accent); }
.fd-foot-err:not(:empty)::before, .fd-err:not(:empty)::before {
  content: ""; flex: none; width: var(--fd-t3); height: var(--fd-t3); margin-top: 1px; background: currentColor;
  -webkit-mask: var(--fd-ico-alert) center / contain no-repeat; mask: var(--fd-ico-alert) center / contain no-repeat;
}
.fd-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fd-s5); max-width: calc(var(--fd-s8) * 8); }
.fd-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Slider with Not sure */
.fd-slider {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--fd-s2) var(--fd-s3);
  padding: var(--fd-s4) var(--fd-s5) var(--fd-s3); border-radius: var(--fd-r3); cursor: default;
  background: var(--fd-surface); border: 2px solid transparent; box-shadow: var(--fd-shadow);
}
.fd-slider-l { font-size: var(--fd-t2); font-weight: 600; }
.fd-slider-v { grid-column: -2 / -1; justify-self: end; font-weight: 600; font-size: var(--fd-t3); font-variant-numeric: tabular-nums; text-align: right; }
.fd-slider > :is(.fd-range, .fd-ends, .fd-unsure, .fd-rate, .fd-plain, .fd-help) { grid-column: 1 / -1; }
/* The bar: Soft Stone, filled in Consulting Blue up to the thumb. The fill is a flat block (an SVG rect in the accent's
   own value, #1B3A5B) sized by --fill, not a gradient; Firefox draws it with its progress part. */
.fd-range { -webkit-appearance: none; appearance: none; width: 100%; height: var(--fd-tap); margin: 0; background: transparent; cursor: pointer; }
.fd-range::-webkit-slider-runnable-track {
  height: var(--fd-s2); border-radius: var(--fd-r1); background-color: var(--fd-ground);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%231B3A5B'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: var(--fill, 0%) 100%;
}
.fd-range::-moz-range-track { height: var(--fd-s2); border-radius: var(--fd-r1); background: var(--fd-ground); }
.fd-range::-moz-range-progress { height: var(--fd-s2); border-radius: var(--fd-r1); background: var(--fd-accent); }
.fd-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--fd-s5); height: var(--fd-s5); margin-top: calc((var(--fd-s2) - var(--fd-s5)) / 2); border-radius: 50%;
  background: var(--fd-ink); border: 3px solid var(--fd-surface); box-shadow: 0 0 0 1px var(--fd-ink);
}
.fd-range::-moz-range-thumb { width: var(--fd-t2); height: var(--fd-t2); border-radius: 50%; background: var(--fd-ink); border: 3px solid var(--fd-surface); box-shadow: 0 0 0 1px var(--fd-ink); }
.fd-range:focus-visible { outline: var(--fd-focus); outline-offset: var(--fd-s1); border-radius: var(--fd-r2); }
.fd-slider:has(.fd-unsure input:checked) .fd-range::-webkit-slider-thumb { background: var(--fd-muted); box-shadow: 0 0 0 1px var(--fd-muted); }
.fd-slider:has(.fd-unsure input:checked) .fd-range::-moz-range-thumb { background: var(--fd-muted); }
.fd-slider:has(.fd-unsure input:checked) .fd-slider-v { color: var(--fd-muted); }
.fd-ends { display: flex; justify-content: space-between; gap: var(--fd-s3); font-size: var(--fd-t1); }
.fd-unsure {
  justify-self: start; display: inline-flex; align-items: center; gap: var(--fd-s2); min-height: var(--fd-tap); font-size: var(--fd-t2); font-weight: 600; cursor: pointer;
}
.fd-unsure input, .fd-q input[type="checkbox"]:not(.fd-vh) { width: var(--fd-t3); height: var(--fd-t3); margin: 0; accent-color: var(--fd-accent); }
.fd-rate { margin: 0; font-size: var(--fd-t2); }
.fd-rate b, .fd-rate [data-value] { font-family: var(--font-mono); font-weight: 500; }

/* Systems list (slide 3): a cell holds the card and its page link, inside the card's foot. */
.fd-sys-sec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fd-s4); align-items: stretch; }
.fd-sec-t { grid-column: 1 / -1; margin: 0; font-weight: 700; font-size: var(--fd-t3); line-height: var(--fd-lh-head); }
.fd-sys-cell { position: relative; display: grid; min-width: 0; }
.fd-sys {
  display: grid; gap: var(--fd-s2); align-content: start; padding: var(--fd-s4) var(--fd-s5) calc(var(--fd-tap) + var(--fd-s4));
  border-radius: var(--fd-r3); text-align: left;
}
.fd-sys-page {
  position: absolute; left: var(--fd-s5); bottom: var(--fd-s2); display: inline-flex; align-items: center; min-height: var(--fd-tap); font-size: var(--fd-t1); font-weight: 600;
}
.fd-sys-t { font-weight: 700; font-size: var(--fd-t2); line-height: var(--fd-lh-head); overflow-wrap: anywhere; padding-right: var(--fd-s2); }
.fd-sys-tag {
  justify-self: start; padding: 0 var(--fd-s2); border-radius: var(--fd-r1); background: var(--fd-tint); color: var(--fd-accent);
  font-size: var(--fd-t1); font-weight: 600; line-height: var(--fd-lh-body);
}
.fd-sys-get { font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
.fd-more { justify-self: start; }
.fd-sys-other { padding-bottom: var(--fd-s4); }


@media (hover: hover) and (pointer: fine) {
  .fd-tile:not(:has(input:disabled)):hover { transform: translateY(-2px); box-shadow: var(--fd-lift); }
  .fd-tile:not(:has(input:disabled)):hover:active { transform: translateY(-2px) scale(0.97); }
  :is(.fd-chip, .fd-sys):not(:has(input:disabled)):hover { box-shadow: var(--fd-lift); }
}

@media (max-width: 820px) {
  .fd-tiles, .fd-tiles[data-cols] { grid-template-columns: minmax(0, 1fr); gap: var(--fd-s2); }
  .fd-tiles:not(:has(.fd-ico)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-tile:has(.fd-ico) {
    grid-template-columns: var(--fd-tap) minmax(0, 1fr); justify-items: start; align-items: center; text-align: left;
    column-gap: var(--fd-s3); row-gap: 0; padding: var(--fd-s3);
  }
  .fd-tile:has(.fd-ico) .fd-ico { grid-row: 1 / span 2; }
  .fd-tile:has(.fd-ico) :is(.fd-tile-l, .fd-tile-s) { grid-column: 2; }
  .fd-tile:has(.fd-ico) .fd-tile-l:last-child { grid-row: 1 / span 2; }
  .fd-sys-sec { grid-template-columns: minmax(0, 1fr); }
  .fd-slider { padding: var(--fd-s4) var(--fd-s4) var(--fd-s3); }
}
