/* AI Systems Finder: basket (5A), offers, package check, suggestions, the estimate (6): totals, charts, gap and
   mistake lines, pick cards with folds, the next step, the video (rework, 22 Oct 2026), and the draft marker (R4).
   DOM: docs/finder/contracts-payload-and-dom.md section 6. Figures use IBM Plex Mono; every money figure comes from
   the server reply. Design pass, 14 Nov 2026: sizes, gaps and colours only from the tokens in finder.css. */

/* ---------- Basket (5A) ---------- */
.fd-bk { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fd-s2); }
.fd-bk-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: var(--fd-s1) var(--fd-s4);
  padding: var(--fd-s3) var(--fd-s4); border-radius: var(--fd-r3); background: var(--fd-surface); box-shadow: var(--fd-shadow);
}
.fd-bk-t { grid-column: 1 / 4; font-weight: 700; font-size: var(--fd-t2); line-height: var(--fd-lh-head); overflow-wrap: anywhere; }
.fd-bk-m { grid-column: 1 / 4; font-size: var(--fd-t1); }
/* Words in Source Sans 3 600; only the figure (in <b>) is Plex Mono. */
.fd-bk-h {
  grid-column: 4; grid-row: 1 / span 2; justify-self: end; text-align: right; white-space: nowrap;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fd-t2); font-variant-numeric: tabular-nums;
}
.fd-bk-h b { font-family: var(--font-mono); font-weight: 500; }
/* 44px tall on every screen, so Change answers and Remove are easy to hit. */
.fd-bk-row > .fd-plain { grid-row: 3; justify-self: start; min-height: var(--fd-tap); font-size: var(--fd-t1); }
.fd-bk-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--fd-s1) var(--fd-s3); margin: 0; padding: var(--fd-s1) var(--fd-s2) 0; font-weight: 700; }
.fd-bk-total :is(b, [data-value]) { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Notices: same-family check, package check, sense checks. A pale tone fill, no side rule. */
.fd-checks { display: grid; gap: var(--fd-s2); }
.fd-checks:empty { display: none; }
.fd-same, .fd-pkcheck, .fd-warn {
  display: grid; gap: var(--fd-s2); margin: 0; padding: var(--fd-s3) var(--fd-s4); border-radius: var(--fd-r3); background: var(--fd-tint);
  font-size: var(--fd-t2); max-width: none;
}
:is(.fd-same, .fd-pkcheck, .fd-offer, .fd-pkoffer, .fd-sug) p { margin: 0; }
:is(.fd-same, .fd-pkcheck) > div, .fd-acts { display: flex; flex-wrap: wrap; gap: var(--fd-s2) var(--fd-s4); }

/* The joined-up offer: a Charcoal box, the one dark moment before the estimate. */
.fd-offer { display: grid; gap: var(--fd-s2); padding: var(--fd-s4) var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-ink); color: var(--fd-surface); }
.fd-offer :focus-visible { outline-color: var(--fd-surface); }
.fd-offer a, .fd-offer .fd-plain { color: var(--fd-surface); }
.fd-pkoffer { display: grid; gap: var(--fd-s2); padding: var(--fd-s4) var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-tint); }
.fd-pkoffer > div { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fd-s2) var(--fd-s4); }
/* Buttons inside the basket blocks: outlined, Charcoal; on the dark offer, Off-White. */
:is(.fd-same, .fd-pkcheck, .fd-pkoffer, .fd-sug) button:not(.fd-plain):not(.fd-go),
.fd-offer button:not(.fd-plain) {
  justify-self: start; display: inline-flex; align-items: center; justify-content: center; 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; font-size: var(--fd-t2); white-space: nowrap;
  transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
}
.fd-offer button:not(.fd-plain) { border-color: var(--fd-surface); background: var(--fd-surface); color: var(--fd-ink); }

/* Suggestions */
.fd-sugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fd-s3); align-items: stretch; }
.fd-sugs > :not(.fd-sug) { grid-column: 1 / -1; }
.fd-sugs > p:first-child { margin: 0; font-weight: 700; font-size: var(--fd-t2); }
.fd-sug {
  display: grid; gap: var(--fd-s2); align-content: space-between; padding: var(--fd-s3) var(--fd-s4); border-radius: var(--fd-r3);
  background: var(--fd-surface); box-shadow: var(--fd-shadow); min-width: 0;
}
.fd-sug :is(b, strong, .fd-sug-t) { font-weight: 700; font-size: var(--fd-t2); line-height: var(--fd-lh-head); overflow-wrap: anywhere; }
.fd-sug :is(small, .fd-sug-why) { font-size: var(--fd-t1); }

/* ---------- The estimate (slide 6) ---------- */
.fd-est { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fd-s5); min-width: 0; }
.fd-est > * { margin: 0; }
.fd-est h2 { margin: 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-who { margin: 0; max-width: var(--fd-measure); font-size: var(--fd-t2); }
.fd-totals {
  margin: 0; padding: var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-ink); color: var(--fd-surface);
  display: flex; flex-wrap: wrap; gap: var(--fd-s4) var(--fd-s5);
}
/* Each total takes its natural width, so a long price stays on one line and the row wraps instead. */
.fd-totals > div { flex: 1 1 auto; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: var(--fd-s1); min-width: 0; }
.fd-totals dt { font-size: var(--fd-t2); line-height: var(--fd-lh-head); }
.fd-num, .fd-totals dd {
  margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: var(--fd-t4); line-height: var(--fd-lh-tight);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.fd-totals :focus-visible { outline-color: var(--fd-surface); }

/* A whole process among a package's parts, on 4Q (controls.ts) and the estimate, as the detail page marks it. */
.fd-part-tag {
  display: inline-block; 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); white-space: nowrap;
}
li > .fd-part-tag { margin-left: var(--fd-s2); }


/* The first build (13 Nov 2026): its lead line, the "next" heading, and the box when no pick pays. Sentence case. */
.fd-lead-k, .fd-next-h { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: var(--fd-t2); line-height: var(--fd-lh-head); }
.fd-next-h { margin-top: var(--fd-s2); }
.fd-nopay { display: grid; gap: var(--fd-s2); padding: var(--fd-s4) var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-surface); box-shadow: var(--fd-shadow); }
.fd-nopay h3 { margin: 0; font-family: var(--font-body); font-weight: 600; font-size: var(--fd-t3); line-height: var(--fd-lh-head); }
.fd-nopay p { margin: 0; max-width: var(--fd-measure); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
/* The gap line, the cost of a mistake and related systems. */
.fd-gap { display: grid; gap: var(--fd-s2); }
.fd-mistake { display: grid; gap: var(--fd-s1); padding: var(--fd-s3) var(--fd-s4); border-radius: var(--fd-r3); background: var(--fd-surface); }
.fd-mistake p { margin: 0; max-width: var(--fd-measure); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
.fd-gap-m .fd-mistake { box-shadow: var(--fd-shadow); }
.fd-mistake-n { font-family: var(--font-mono); font-weight: 500; color: var(--fd-accent); white-space: nowrap; }

/* One card per pick, in the server's order: the name, its figures, then two folds. */
.fd-ej {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fd-s2); align-content: start; padding: var(--fd-s4) var(--fd-s5);
  border-radius: var(--fd-r3); background: var(--fd-surface); box-shadow: var(--fd-shadow); min-width: 0;
}
.fd-ej h3 { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: var(--fd-t3); line-height: var(--fd-lh-head); overflow-wrap: anywhere; }
.fd-ej:has([data-fd-line="covered"]) { box-shadow: none; border: 2px dashed var(--fd-line); }
.fd-figs { display: flex; flex-wrap: wrap; gap: var(--fd-s1) var(--fd-s4); margin: 0; font-size: var(--fd-t1); }
.fd-figs b { margin-right: var(--fd-s1); font-family: var(--font-mono); font-weight: 500; font-size: var(--fd-t3); font-variant-numeric: tabular-nums; }
/* A price stays on one line, on the cards and in the totals, at every width. */
:is([data-fd-fig="price"], [data-fd-total="price"]) { white-space: nowrap; overflow-wrap: normal; }
/* Folds: a chevron that turns, as on slide 3's "What is inside". */
.fd-fold { border-top: 1px solid var(--fd-line); padding-top: var(--fd-s2); }
.fd-fold summary, details.fd-explain > summary {
  display: flex; align-items: center; gap: var(--fd-s2); min-height: var(--fd-tap); cursor: pointer; font-weight: 600; font-size: var(--fd-t2); list-style: none;
}
.fd-fold summary { margin-block: calc(-1 * var(--fd-s2)); color: var(--fd-accent); }
:is(.fd-fold, details.fd-explain) > summary::-webkit-details-marker { display: none; }
:is(.fd-fold, details.fd-explain) > summary::after {
  content: ""; width: var(--fd-s2); height: var(--fd-s2); margin-top: calc(-1 * var(--fd-s1)); border: solid var(--fd-accent); border-width: 0 2px 2px 0;
  transform: rotate(45deg); transition: transform var(--dur-ui) var(--ease-out);
}
:is(.fd-fold, details.fd-explain)[open] > summary::after { transform: translateY(var(--fd-s1)) rotate(225deg); }
.fd-fold-b { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fd-s3) var(--fd-s2); padding: var(--fd-s3) 0 var(--fd-s1); }
.fd-fold-b > :not(.fd-blk) { grid-column: 1 / -1; }

/* The offer: what we take off their hands, what they get, what it starts from, what their team checks. */
.fd-blk { display: grid; gap: var(--fd-s1); align-content: start; padding: var(--fd-s3); border-radius: var(--fd-r2); background: var(--fd-ground); font-size: var(--fd-t2); line-height: var(--fd-lh-body); min-width: 0; }
.fd-blk > * { margin: 0; }
.fd-blk > :first-child { font-size: var(--fd-t1); font-weight: 600; color: var(--fd-accent); font-family: var(--font-body); }
:is(ol, ul)[data-fd-block] { margin: 0; padding-left: var(--fd-s5); display: grid; gap: var(--fd-s1); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
:is(ol, ul)[data-fd-block] + p, .fd-ej > p:not([class]) { margin: 0; font-size: var(--fd-t2); }
.fd-ej > :is(h4, p:not([class])):has(+ :is(ol, ul)[data-fd-block]) { margin: 0; font-size: var(--fd-t2); font-weight: 600; }
.fd-line { margin: 0; padding-left: var(--fd-s3); border-left: 2px solid var(--fd-muted); font-size: var(--fd-t2); }
.fd-also { margin: 0; padding: var(--fd-s2) var(--fd-s3); border-radius: var(--fd-r2); background: var(--fd-tint); font-size: var(--fd-t2); line-height: var(--fd-lh-body); }
.fd-note, .fd-own, .fd-chose { margin: 0; max-width: var(--fd-measure); font-size: var(--fd-t1); }

/* The draft marker: preview only, wording not yet approved */
.fd-draft {
  justify-self: start; display: inline-block; padding: 0 var(--fd-s2); border: 1px dashed var(--fd-accent); border-radius: var(--fd-r1);
  color: var(--fd-accent); font-size: var(--fd-t1); font-weight: 600; line-height: var(--fd-lh-body);
}
html:not([data-fd-preview]) .fd-draft { display: none; }

/* ---------- Next step ---------- */
.fd-next { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fd-s3); justify-items: start; padding: var(--fd-s5); border-radius: var(--fd-r3); background: var(--fd-tint); }
.fd-next > *, .fd-next-col > * { margin: 0; }
.fd-next :is(h3, .fd-next-t) { font-family: var(--font-display); font-weight: 500; font-size: var(--fd-t4); line-height: var(--fd-lh-head); }
.fd-next p { max-width: var(--fd-measure); }
.fd-next .fd-alt + .fd-err { margin-top: calc(-1 * var(--fd-s1)); }
.fd-next .fd-go { margin-top: var(--fd-s1); max-width: 100%; white-space: normal; text-align: left; }
/* The lighter next step (design.md .bl-alt): a lead line, then a Consulting Blue underlined link-button. */
.fd-next-col > .fd-alt {
  display: inline-flex; align-items: center; gap: var(--fd-s2); min-height: var(--fd-tap); margin-top: calc(-1 * var(--fd-s2)); padding: 0; border: 0; background: none;
  color: var(--fd-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; border-radius: var(--fd-r1);
}
.fd-next-col > .fd-alt[aria-busy="true"] { text-decoration: none; }
.fd-next-col > .fd-alt[aria-disabled="true"]:not([aria-busy="true"]) { color: var(--fd-muted); cursor: not-allowed; }

/* Kristian's video: 4:5, its poster first, at most 400px wide. */
.fd-video { display: grid; gap: var(--fd-s2); }
.fd-video h3 { margin: 0; font-family: var(--font-body); font-weight: 600; font-size: var(--fd-t3); line-height: var(--fd-lh-head); }
.fd-video video { display: block; width: 100%; max-width: calc(var(--fd-s8) * 6.25); aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--fd-r3); background: var(--fd-ink); }

@media (hover: hover) and (pointer: fine) {
  :is(.fd-same, .fd-pkcheck, .fd-pkoffer, .fd-sug) button:not(.fd-plain):not(.fd-go):hover { background: var(--fd-ink); color: var(--fd-surface) !important; }
  .fd-next-col > .fd-alt:not([aria-disabled="true"]):hover { text-decoration-thickness: 2px; }
  .fd-offer button:not(.fd-plain):hover { background: var(--fd-ground); border-color: var(--fd-ground); color: var(--fd-ink); }
}

@media (max-width: 820px) {
  .fd-sugs { grid-template-columns: minmax(0, 1fr); }
  .fd-est h2 { font-size: var(--fd-t4); }
  .fd-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: var(--fd-s4); padding: var(--fd-s4); }
  /* The price takes a full row below the other three figures: a price has no top limit. */
  .fd-totals > div:has(> [data-fd-total="price"]) { grid-column: 1 / -1; }
  .fd-ej, .fd-chart { padding: var(--fd-s4); }
  .fd-fold-b { grid-template-columns: minmax(0, 1fr); }
  .fd-bar-r { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; gap: var(--fd-s2); font-size: var(--fd-t1); }
  .fd-next { padding: var(--fd-s4); }
  /* Phone: hours drop under the name, the two text buttons share the last row. */
  .fd-bk-row { grid-template-columns: auto auto minmax(0, 1fr); padding: var(--fd-s3); gap: var(--fd-s1) var(--fd-s4); }
  .fd-bk-t, .fd-bk-m, .fd-bk-h { grid-column: 1 / -1; }
  .fd-bk-h { grid-row: auto; justify-self: start; text-align: left; }
  .fd-bk-row > .fd-plain { grid-row: auto; white-space: nowrap; }
  .fd-pkoffer a { display: inline-flex; align-items: center; min-height: var(--fd-tap); }
}

/* At 320px a little less side padding keeps the deposit button on one line (labels never wrap). */
@media (max-width: 359px) {
  .fd-next { padding-inline: var(--fd-s3); }
}
