/* Free calculator, hub and compliance-tool polish (visual audit, batch 2). Linked AFTER each page's own inline CSS (hub shell, tool template,
   directory layout, pilot cars), so equal specificity wins here. Layout, colour and wording only. Site tokens only. */
:root { --calc-line: color-mix(in srgb, var(--muted) 70%, var(--surface)); }

/* ── Hub header chips (F11): dates never break at a hyphen, rows share a height, an odd last chip spans the row (no filler chip repeats the eyebrow). */
.qh-prov { grid-auto-rows: 1fr; }
.qh-prov span.qh-nw { display: inline; padding: 0; border: 0; border-radius: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
@media (max-width: 640px) {
  .qh-prov > span:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ── Hub sections (F23): the heading never sits tight on its first card, table or fold bar; a lone last card spans the row; the report button is flush. */
.qh-sec > h2 + .qh-cards, .qh-sec > h2 + .qh-tablewrap, .qh-sec > h2 + .qh-foldbar, .qh-sec > h2 + .qh-folds { margin-top: 12px; }
.qh-cards > .qh-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.qtt-report { padding: 0; margin: 12px auto 32px; }
.qtt-faq { max-width: 100%; }

/* ── Scrolling tables (F18, F10): a fade on the edge that has more to scroll to (the classic local/scroll background pair, so no script). ─────── */
.qh-tablewrap, .pc-tablewrap { --calc-fade: var(--surface);
  background:
    linear-gradient(to right, var(--calc-fade), var(--calc-fade)) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--calc-fade), var(--calc-fade)) right center / 24px 100% no-repeat local,
    linear-gradient(to right, color-mix(in srgb, var(--ink) 16%, transparent), transparent) left center / 16px 100% no-repeat scroll,
    linear-gradient(to left, color-mix(in srgb, var(--ink) 16%, transparent), transparent) right center / 16px 100% no-repeat scroll,
    var(--calc-fade);
}
.pc-tablewrap { --calc-fade: var(--bg); }
@media (max-width: 720px) {
  .qh-table td:not(.qh-st) { min-width: 160px; }
  /* Tap targets (F24): links in the first column and in cells are at least 40px tall without growing the row. */
  .qh-table a, .pc-table a { display: inline-block; padding-block: 8px; margin-block: -8px; }
  .qh-crumbs a, .qtt-crumbs a { display: inline-block; padding: 12px 4px; margin-block: -12px; }
  .qh-table .qh-v a { display: inline; padding: 0; margin: 0; position: relative; }
  .qh-table .qh-v a::after { content: ""; position: absolute; inset: -8px -4px; }
  .qh-tier { font-size: 11px; }
}

/* ── Pilot cars (F10, F20, F21) ──────────────────────────────────────────────────────────────────────────────────────────────────────────── */
.pc-table th:first-child, .pc-table td:first-child { min-width: 112px; white-space: nowrap; }
.pc-table td:nth-child(4) { white-space: nowrap; }
.pc-empty ul.pc-chosen { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; }
.pc-field select, .pc-field input, .pc-field--list { background: var(--surface); border-color: var(--calc-line); }
.pc-statebox { border-color: var(--calc-line); }
.pc-field--list select { background: transparent; }
/* The 55-state lists are scroll boxes: a shade at the bottom edge says there are more rows below. */
.pc-statebox {
  background:
    linear-gradient(var(--surface), var(--surface)) bottom / 100% 24px no-repeat local,
    linear-gradient(to top, color-mix(in srgb, var(--ink) 18%, transparent), transparent) bottom / 100% 24px no-repeat scroll,
    var(--surface);
}
@media (min-width: 1100px) {
  .pc-filters .pc-fset--wide { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* ── Tool-page title band (F12): the title sits at the left of the band, the Embed chip never touches it. ───────────────────────────────────── */
.qtt-band-copy { flex: 1 1 auto; text-align: left; min-width: 0; }
.qtt-band.qtt-band .qtt-band-row { gap: 16px; }

/* ── Compliance lookup (F22) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
.qtt .qtt-tool > .lookup-box { padding: 0; border: 0; border-radius: 0; background: none; }
.lookup-result .row .v.bad { color: var(--error); font-weight: 600; }
.lookup-result .row .k { flex: none; }
.lookup-result .row .v { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .lookup-result .row { flex-direction: column; gap: 4px; }
  .lookup-result .row .v { text-align: left; }
}
.qtt-head h2 { text-wrap: balance; }
/* The FAQ folds use the hub's disclosure idiom (the directory shell does not load the hub stylesheet). */
.qtt .dir-shell .qh-faq { display: grid; gap: 12px; }
.qtt .dir-shell .qh-fold { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.qtt .dir-shell .qh-fold > summary { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 12px 16px; min-height: 54px; box-sizing: border-box; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); cursor: pointer; list-style: none; }
.qtt .dir-shell .qh-fold > summary::-webkit-details-marker { display: none; }
.qtt .dir-shell .qh-fold > summary::marker { content: ''; }
.qtt .dir-shell .qh-fold > summary:hover, .qtt .dir-shell .qh-fold[open] > summary { background: var(--surface-2); }
.qtt .dir-shell .qh-fold .chv { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); transition: transform 0.2s; }
.qtt .dir-shell .qh-fold[open] > summary .chv { transform: rotate(180deg); }
.qtt .dir-shell .qh-fold-b { border-top: 1px solid var(--border); margin: 0 16px; padding: 12px 0 16px; }
.qtt .dir-shell .qh-fold-b p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); max-width: 820px; }
@media (prefers-reduced-motion: reduce) { .qtt .dir-shell .qh-fold .chv { transition: none; } }
