/* Fingertips / NHS Profiles (migration F2).
 *
 * The monolith's page used Bootstrap utility classes (shimmed in a <style> block) and inline style attributes. The Content Security
 * Policy admits neither, so every rule is a class here, in the shell's tokens. A gap is drawn in one neutral colour: no green, no red,
 * no colour that says better or worse (decision D2).
 */
.ft-wrap { max-width: none; margin: 0; padding: 0 0 24px; color: var(--hs-ink, #1a2a3b); }
.ft-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--hs-teal-deep, #0f6e57); margin: 0 0 3px; }
.ft-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.ft-lead { margin: 0 0 14px; color: var(--hs-ink-muted, #55657a); max-width: 70ch; }
.ft-attribution { font-size: 13px; color: var(--hs-ink-muted, #55657a); margin: 0 0 16px; max-width: 80ch; line-height: 1.5; }
.ft-muted { color: var(--hs-ink-muted, #55657a); font-size: 13px; }
.ft-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ft-selector, .ft-card { background: var(--hs-surface, #fff); border: 1px solid var(--hs-border, #e3e8ee); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.ft-selector-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.ft-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ft-label { font-weight: 600; font-size: 13px; }
.ft-chip-group { display: inline-flex; align-items: center; gap: 8px; }
.chip-clear { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--hs-border-strong, #c7d0da); color: var(--hs-ink-muted, #55657a); text-decoration: none; font-size: 12px; }
.chip-clear:hover, .chip-clear:focus-visible { background: var(--hs-ground, #f4f7f9); }
.ft-select { min-width: 12rem; max-width: 100%; padding: 8px 10px; border: 1px solid var(--hs-border-strong, #c7d0da); border-radius: 8px; background: var(--hs-surface, #fff); color: inherit; font: inherit; }
.ft-button { padding: 9px 16px; border: 0; border-radius: 8px; background: var(--hs-navy, #14304a); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.ft-button:hover, .ft-button:focus-visible { background: var(--hs-navy-2, #1d4466); }
.ft-selector-note { margin: 10px 0 0; }

.ft-alert { border-radius: 8px; padding: 9px 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.5; border: 1px solid var(--hs-border, #e3e8ee); }
.ft-alert-primary { background: var(--hs-info-bg, #eaf3ff); }
.ft-alert-info { background: var(--hs-ground, #f4f7f9); }
.ft-alert-warn { background: var(--hs-warn-bg, #fff6e0); border-color: var(--hs-warn-border, #f0d48a); color: var(--hs-warn-ink, #6b4b00); }

.ft-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--hs-border, #e3e8ee); margin: -2px 0 14px; padding-bottom: 12px; }
.ft-h2 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.ft-h3 { font-size: 14px; font-weight: 700; margin: 18px 0 4px; }
.ft-link-button { display: inline-block; padding: 6px 12px; border: 1px solid var(--hs-border-strong, #c7d0da); border-radius: 8px; color: var(--hs-ink, #1a2a3b); text-decoration: none; font-size: 13px; white-space: nowrap; }
.ft-link-button:hover, .ft-link-button:focus-visible { background: var(--hs-ground, #f4f7f9); }
.ft-empty, .ft-empty-cell { color: var(--hs-ink-muted, #55657a); padding: 14px 0; text-align: center; }

.ft-stats { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 12px; padding: 0; }
.ft-stat { background: var(--hs-ground, #f4f7f9); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.ft-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--hs-ink-muted, #55657a); }
.ft-stat-value { font-size: 24px; font-weight: 700; }
.ft-stat-sub { font-size: 12px; color: var(--hs-ink-muted, #55657a); }
.ft-periods { margin: 0 0 6px; }

.ft-tiles { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 8px 0 0; padding: 0; }
.ft-tile { border: 1px solid var(--hs-border, #e3e8ee); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ft-tile-name { font-size: 12px; color: var(--hs-ink-muted, #55657a); overflow-wrap: anywhere; }
.ft-tile-value { font-size: 22px; font-weight: 700; }
.ft-unit { font-size: 12px; font-weight: 400; color: var(--hs-ink-muted, #55657a); }
.ft-tile-sub { font-size: 12px; color: var(--hs-ink-muted, #55657a); }
.ft-points { margin: 6px 0 0; padding-left: 1.2em; font-size: 13px; line-height: 1.6; }

.ft-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 8px; }
.ft-chart-card { background: var(--hs-ground, #f4f7f9); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.ft-canvas { position: relative; height: 260px; margin-top: 8px; }
.ft-table-toggle { margin-top: 8px; font-size: 13px; }
.ft-table-toggle summary { cursor: pointer; color: var(--hs-teal-deep, #0f6e57); }

.ft-gaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ft-gap-list { margin: 6px 0 0; padding-left: 1.4em; font-size: 13px; line-height: 1.6; }
.ft-gap { font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-dir { font-size: 12px; color: var(--hs-ink-muted, #55657a); }
.ft-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--hs-border-strong, #c7d0da); border-radius: 20px; margin-left: 6px; }

.ft-scroll { overflow-x: auto; border: 1px solid var(--hs-border, #e3e8ee); border-radius: 8px; position: relative; }
.ft-scroll:focus-visible { outline: 2px solid var(--hs-aqua, #1aa6c2); outline-offset: 2px; }
.ft-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ft-table th, .ft-table td { padding: 8px 10px; border-bottom: 1px solid var(--hs-border, #e3e8ee); text-align: left; vertical-align: top; }
.ft-table thead th { background: var(--hs-ground, #f4f7f9); font-weight: 700; white-space: nowrap; }
.ft-table tbody th { font-weight: 600; min-width: 14rem; }
.ft-table .ft-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ft-table-small { width: auto; min-width: 16rem; margin-top: 6px; }
.ft-period-note { white-space: nowrap; }
.ft-plain { margin: 6px 0 0; padding-left: 1.2em; font-size: 13px; line-height: 1.6; columns: 1; }

.ft-tool-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; }
.ft-tool-card { border: 1px solid var(--hs-border, #e3e8ee); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ft-tool-card .ft-badge { margin-left: 0; }
.ft-tool-card .ft-link-button { margin-top: 6px; }
.ft-foot { margin-top: 8px; }

@media (max-width: 600px) {
  .ft-card, .ft-selector { padding: 12px; }
  .ft-selector-row { align-items: stretch; }
  .ft-field, .ft-select { width: 100%; }
  .ft-canvas { height: 220px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ft-stat, :root:not([data-theme="light"]) .ft-chart-card { background: var(--hs-ground, #16212d); }
}
