/* AI Systems Finder: the page width, rows and columns (design pass, 14 Nov 2026). Finder pages only (shells.ts
   finderShell), so the scorecard and the AI opportunity assessment, which share finder.css, keep their width.
   Centred (Kristian, 14 Nov 2026: "everything's left-aligned", "loads of space around it"): the shell fills the
   window, each question's words sit in the middle, and words, sliders, the calendar and boxes share one centred
   column. Choices, packages and the estimate's blocks use the room. Every column change follows the slide's own
   width (container fd-slide), so the rail never squeezes a grid. */

/* The shell: up to 1760px with 24px gutters and the height of the window; the working area is 1120px at most. */
.fd-page:has([data-fd-root]) { --fd-shell-max: 1760px; --fd-rail-w: 304px; --fd-slide-max: 1120px; --fd-form: 640px; }
@media (min-width: 821px) {
  .fd-page:has([data-fd-root]) .fd { min-height: max(720px, calc(100svh - var(--fd-s8) - var(--fd-s6))); }
  .fd-slide { align-content: center; }
  .fd[data-fd-step="estimate"] .fd-slide { align-content: start; }
}

/* Centred words; one centred column for sliders, figures, boxes, the calendar and notes. */
.fd-slide :is(.fd-legend, .fd-help), .fd-slide > :is(h2, h3), .fd-sec-t { text-align: center; }
.fd-slide .fd-legend { max-width: none; }
.fd-slide .fd-q > .fd-help { justify-self: center; }
.fd-fields :is(.fd-legend, .fd-help), .fd-ej :is(.fd-legend, .fd-help) { text-align: left; justify-self: start; }
.fd-slide .fd-about { justify-items: center; text-align: center; }
.fd-slider > :is(.fd-rate, .fd-help, .fd-unsure, .fd-unsure-row, .fd-chips), .fd-slider > .fd-plain:not(:has(+ .fd-slider-v)) { justify-self: center; justify-content: center; text-align: center; }
.fd-slide > :is(.fd-about, .fd-checks, .fd-live, .fd-note, .fd-warn),
.fd-slide > .fd-q:has(> :is(.fd-slider, .fd-pick-q, .fd-fields, .fd-cal, .fd-live, .fd-field)) { max-width: var(--fd-form); width: 100%; justify-self: center; }
.fd-slide > .fd-q:has(> .fd-bk) > :not(.fd-sugs) { max-width: var(--fd-form); width: 100%; justify-self: center; }
.fd-slide .fd-q > :is(.fd-fields, .fd-cal, .fd-about, .fd-explain) { max-width: none; width: 100%; }
.fd-slide .fd-q > .fd-explain { text-align: center; }
.fd-slide .fd-chips:not(.fd-slider *) { justify-content: center; }
.fd-slide .fd-err:not(.fd-field *, .fd-fields *) { justify-content: center; justify-self: center; text-align: center; }
.fd-slide .fd-more { display: flex; justify-self: center; margin-inline: auto; }
.fd-slide > h2.fd-counter { justify-self: center; }
.fd-sugs > :not(.fd-sug) { justify-self: center; text-align: center; }
.fd-bk-total { justify-content: center; }
.fd-foot { justify-content: center; }
.fd-foot-err { flex: 0 0 100%; order: -1; margin: 0; justify-content: center; }
.fd-sys-other { text-align: center; justify-items: center; }
.fd-sys-get, .fd-ej p, .fd-next p, .fd-also { max-width: var(--fd-measure); }
/* The wordmark link is a 44px target on a wide screen too, without moving the title under it. */
@media (min-width: 821px) { .fd-intro .fd-mark { min-height: var(--fd-tap); align-items: center; margin-block: calc((22px - var(--fd-tap)) / 2); } }

/* ---------- Wide: the slide is 900px or more (a 1280px screen and up) ---------- */
@container fd-slide (min-width: 900px) {
  /* Choice tiles: as many to a row as fit, a short last row in the middle. */
  .fd-tiles, .fd-tiles[data-cols] { display: flex; flex-wrap: wrap; justify-content: center; }
  .fd-tiles > * { flex: 1 1 12rem; max-width: 16.5rem; }
  /* 3: packages two up; a package alone or open takes the full row and lists its parts in two columns. Systems on their own
     and the basket's suggestions three to a row. */
  .fd-sys-sec { display: flex; flex-wrap: wrap; justify-content: center; }
  .fd-sys-sec > .fd-sec-t { flex: 0 0 100%; }
  .fd-sys-sec > .fd-sys-cell { flex: 1 1 17.5rem; max-width: 22.5rem; }
  .fd-sys-sec[data-sec="package"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-sys-sec[data-sec="package"] > .fd-pk { grid-column: auto; }
  .fd-sys-sec[data-sec="package"] > .fd-pk:has(.fd-pk-in[data-open]),
  .fd-sys-sec[data-sec="package"]:not(:has(> .fd-pk ~ .fd-pk), :has(> .fd-oth)) > .fd-pk { grid-column: 1 / -1; }
  .fd-sys-sec[data-sec="package"]:not(:has(> .fd-pk ~ .fd-pk), :has(> .fd-oth)) > .fd-pk:not(:has(.fd-pk-in[data-open])) { max-width: 45rem; width: 100%; justify-self: center; }
  .fd-pk:has(.fd-pk-in[data-open]) .fd-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--fd-s6); }
  .fd-pk:has(.fd-pk-in[data-open]) .fd-parts > li:nth-child(2) { border-top: 0; }
  .fd-pk:has(.fd-pk-in[data-open]) .fd-parts > li:nth-child(n+3) { border-top: 1px solid var(--fd-line); }
  .fd-sugs { grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); }
  /* 6: the two charts side by side; the pick cards two up, one card alone takes the row. */
  .fd-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-est { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--fd-s4); }
  .fd-est > * { grid-column: 1 / -1; }
  .fd-est > .fd-ej { grid-column: auto; }
  .fd-est > .fd-ej:only-of-type { grid-column: 1 / -1; }
}
/* A card as wide as the page lays its offer blocks four across. */
.fd-ej { container: fd-card / inline-size; }
@container fd-card (min-width: 760px) { .fd-fold-b { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Tablet: 560px to 899px of slide, choice tiles two to a row ---------- */
@container fd-slide (min-width: 560px) and (max-width: 899px) {
  .fd-tiles, .fd-tiles[data-cols] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-sys-sec, .fd-sugs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Under 768px: every table-like grid becomes stacked blocks, nothing scrolls sideways ---------- */
@media (max-width: 767px) {
  /* The four totals: one block each, the figure over its words. */
  .fd-totals { grid-template-columns: minmax(0, 1fr); gap: var(--fd-s3); }
  .fd-totals > div + div { padding-top: var(--fd-s3); border-top: 1px solid color-mix(in srgb, var(--fd-surface) 16%, transparent); }
  /* Chart rows: the label and figure on one line, the bar under them at full width. */
  .fd-bar-r { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--fd-s1); font-size: var(--fd-t2); }
  .fd-bar-t { grid-column: 1 / -1; grid-row: 2; height: var(--fd-s3); }
  /* A card's figures: one per line. */
  .fd-figs { display: grid; grid-template-columns: minmax(0, 1fr); }
  /* The basket: each pick a block, its figure and actions under the name. */
  .fd-bk-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fd-bk-row > .fd-plain { justify-self: start; }
  .fd-part-links { flex-wrap: wrap; }
}
/* "Not sure" ticked: the figure goes, so the chip takes the row and sits in the middle. */
.fd-slider > .fd-unsure.fd-unsure:has(input:checked) { grid-column: 1 / -1; justify-self: center; }
.fd-slider:has(> .fd-unsure input:checked) > .fd-slider-v { display: none; }
/* "Which parts matter most": one tidy column of five, the rest behind Show more (Kristian, 14 Nov 2026: "overbearing"). */
.fd-q[data-fd-q="job.focus"] .fd-chips { flex-direction: column; align-items: stretch; max-width: var(--fd-form); width: 100%; margin-inline: auto; }
.fd-q[data-fd-q="job.focus"] .fd-chip { justify-content: center; text-align: center; }
.fd-q[data-fd-q="job.focus"] .fd-chips > [data-fd-act="more"] { align-self: center; }
