/* ============================================================================
   fsi.css — canonical FSI design system, generated from the Fleet UI Kit.
   Source of truth: the "Fleet UI Kit" Claude Design project (tokens + components).
   Shared verbatim across FSI apps. Namespaced .fleet-* components for standalone
   apps; .fsi-* aliases for Bootstrap-layered apps. Dark mode via dual selectors.
   ============================================================================ */

:root {
  /* Neutrals — FSI light standard */
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-alt: #e8e8e8;
  --border: #d8d8d8;
  --text: #111111;
  --text-muted: #555555;

  /* Brand accent — FSI blue ramp */
  --accent: #426ab3;
  --accent-hover: #001c54;
  --accent-subtle: #eef3fb;
  --accent-muted: #bfd0eb;

  /* Link colour. Separate from --accent because the dark accent (#001c54) only
     reaches 2.2:1 on the dark surface — well under the 4.5:1 WCAG AA needs for
     body text. In light the brand blue already passes at 5.2:1 on white. */
  --link: var(--accent);

  /* Operational status (semantic — never rebrand) */
  --success: #16a34a;
  --warning: #d97706;
  --danger:  #dc2626;
  --info:    #0891b2;

  /* Status chips (fg / bg / border) — status-tint pattern.
     The fills were opaque pastels (#f0fdf4 / #fffbeb / #fef2f2 / #ecfeff) that
     floated on the dark surface, which is why the dark block had to restate
     them. They are now translucent tints identical in both themes, so only the
     foreground flips: a dark, high-contrast hue in light, a bright tint in
     dark. Dark therefore only overrides the *-fg values. */
  --ok-fg: #166534;   --ok-bg: rgba(22,163,74,.12);   --ok-bd: rgba(22,163,74,.35);
  --warn-fg: #92400e; --warn-bg: rgba(217,119,6,.12); --warn-bd: rgba(217,119,6,.35);
  --bad-fg: #991b1b;  --bad-bg: rgba(220,38,38,.12);  --bad-bd: rgba(220,38,38,.35);
  --info-fg: #155e75; --info-bg: rgba(8,145,178,.12); --info-bd: rgba(8,145,178,.35);

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-pill: 9999px;

  /* Spacing scale */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;

  /* Layout — page container width (fleet-ui-kit v1.6.0). Fluid ceiling
     for .app-main / .app-nav__inner so the shared wrapper tracks wide
     monitors instead of a hardcoded per-app max-width. */
  --container-max: clamp(1240px, 92vw, 1800px);

  /* Density — table cell / list row padding (fleet-ui-kit v1.7.0). One pair for
     every table and list row in the suite; 11x14 is the former 12x16 at ~90%.
     Reference these from th / td / row rules, never a literal padding. */
  --cell-py: 11px;
  --cell-px: 14px;

  /* Type scale */
  --text-xs: 12px; --text-sm: 14px; --text-base: 16px;
  --text-lg: 18px; --text-xl: 24px; --text-2xl: 32px;

  /* Type — FSI: Lato for body/UI, Bebas Neue for display headings */
  --font: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Bebas Neue', 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Elevation (neutral-black based, matching FSI #111) */
  --shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 1px 3px rgba(17, 17, 17, .1);
  --shadow-lg: 0 4px 6px -1px rgba(17, 17, 17, .08), 0 10px 15px -3px rgba(17, 17, 17, .1);

  /* --- Legacy FSI token aliases (so .fsi-* consumers keep resolving) --- */
  --color-bg: var(--bg);
  --color-surface: var(--surface);
  --color-text: var(--text);
  --color-muted: var(--text-muted);
  --color-border: var(--border);
  --color-primary: var(--accent);
  --color-primary-hover: var(--accent-hover);
  --brand-primary: var(--accent);
  --font-family-body: var(--font);
  --font-family-display: var(--font-display);
}

/* Dark mode — navy; blues taken from the site's darkest.
   Applies via dual explicit selectors (Bootstrap 5 data-bs-theme and custom
   data-theme) AND by OS preference, so the app is correct before the theme
   script runs and for anyone on "auto". Keep the two blocks in sync. */
:root[data-bs-theme='dark'],
:root[data-theme='dark'] {
  --bg: #030f26;
  --surface: #0a1c3d;
  --surface-alt: #172b47;
  --border: #16305e;
  --text: #eaf1fa;
  --text-muted: #9fb6d8;

  --accent: #426ab3;
  --accent-hover: #4586c6;
  --accent-subtle: #0f2247;
  --accent-muted: #bfd0eb;
  --link: #6ea8e6;   /* 6.5:1 on --surface, 7.3:1 on --bg */

  /* Only the chip foregrounds flip — the tints above already track the page. */
  --ok-fg: #86efac;
  --warn-fg: #fcd34d;
  --bad-fg: #fca5a5;
  --info-fg: #67e8f9;

  --shadow: 0 1px 2px rgba(0, 0, 0, .40), 0 1px 3px rgba(0, 0, 0, .50);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, .50), 0 10px 15px -3px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-bs-theme='light']) {
    --bg: #030f26;
    --surface: #0a1c3d;
    --surface-alt: #172b47;
    --border: #16305e;
    --text: #eaf1fa;
    --text-muted: #9fb6d8;

    --accent: #426ab3;
    --accent-hover: #4586c6;
    --accent-subtle: #0f2247;
    --accent-muted: #bfd0eb;
    --link: #6ea8e6;   /* 6.5:1 on --surface, 7.3:1 on --bg */

    --ok-fg: #86efac;
    --warn-fg: #fcd34d;
    --bad-fg: #fca5a5;
    --info-fg: #67e8f9;

    --shadow: 0 1px 2px rgba(0, 0, 0, .40), 0 1px 3px rgba(0, 0, 0, .50);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, .50), 0 10px 15px -3px rgba(0, 0, 0, .55);
  }
}

/* ---------------------------------------------------------------- Base ---- */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); line-height: 1.2; margin: 0 0 var(--space-3); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.eyebrow {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}

.app-main { max-width: var(--container-max); margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-12); }

/* ------------------------------------------------------------- Top nav ---- */
.app-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 40;
}
.app-nav__inner {
  max-width: var(--container-max); margin: 0 auto;
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
}
/* The brand wordmark is display type — Bebas Neue uppercase, matching the
   navbar brand in the Bootstrap-based FSI apps (FSI EXPENSE REPORTING,
   FSI LIFECYCLE). Bebas is condensed, so it needs a size bump and tracking to
   carry the same weight as the Lato it replaces. */
.app-nav__brand {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 400; font-size: var(--text-xl); color: var(--text);
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.app-nav__brand:hover { text-decoration: none; }
.app-nav__brand .mark {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; font-size: var(--text-xs); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.app-nav__links { display: flex; align-items: center; gap: var(--space-1); }
.app-nav__spacer { flex: 1; }
.app-nav__link {
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
}
.app-nav__link:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.app-nav__link.is-active { color: var(--accent); background: var(--accent-subtle); font-weight: 600; }

/* Mobile nav: below 640px the links row won't fit next to the brand and
   theme toggle. Drop the spacer (nothing left to push apart once links wrap
   to their own row) and let .app-nav__links force a line break via
   width:100% — order:3 puts it after brand+button in source order too, so
   the wrap always lands brand+button on row one, links on row two, even if
   a very narrow viewport (~320px) pushes the button down to a third row.
   NOTE: this file is a byte-identical copy of FSI-welcome-landing-'s fsi.css
   (see CLAUDE.md) — keep both in sync, or the two will drift. */
@media (max-width: 640px) {
  .app-nav__inner {
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }
  .app-nav__brand { font-size: var(--text-lg); }
  .app-nav__spacer { display: none; }
  .app-nav__links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-nav__link { padding: 10px var(--space-2); white-space: nowrap; }
}

/* ---------------------------------------------------------- Page header --- */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6);
}
.page-title { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -.01em; margin: 0 0 var(--space-1); }
.page-subtitle { color: var(--text-muted); margin: 0; }
/* Section headings are display type, matching .fsi-section-title in the
   Bootstrap-based FSI apps (uppercase Bebas Neue at --text-xl). */
.section-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: var(--text-xl); font-weight: 400; margin: 0 0 var(--space-3);
}

/* ------------------------------------------------------------- Buttons ---- */
.fleet-btn {
  font-family: inherit; font-weight: 600; font-size: var(--text-sm);
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2);
  line-height: 1; transition: background .12s, border-color .12s, filter .12s;
}
.fleet-btn:hover { text-decoration: none; }
.fleet-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fleet-btn--sm { font-size: var(--text-xs); padding: 7px 12px; }
.fleet-btn--lg { font-size: 15px; padding: 12px 20px; }
.fleet-btn--primary { background: var(--accent); color: #fff; }
.fleet-btn--primary:hover { background: var(--accent-hover); }
.fleet-btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.fleet-btn--secondary:hover { background: var(--surface-alt); }
.fleet-btn--ghost { background: transparent; color: var(--accent); }
.fleet-btn--ghost:hover { background: var(--accent-subtle); }
.fleet-btn--danger { background: var(--danger); color: #fff; }
.fleet-btn--danger:hover { filter: brightness(.94); }
.fleet-btn:disabled, .fleet-btn.is-disabled { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------- Cards ----- */
.fleet-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.fleet-card__header {
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  font-weight: 600;
}
.fleet-card__body { padding: var(--space-4); }

/* --------------------------------------------------------- Stat cards ----- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; position: relative; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.stat-card.is-ok::before { background: var(--success); }
.stat-card.is-warn::before { background: var(--warning); }
.stat-card.is-bad::before { background: var(--danger); }
.stat-card__label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.stat-card__value { font-size: var(--text-2xl); font-weight: 700; margin: var(--space-2) 0 var(--space-1); letter-spacing: -.01em; }
.stat-card__trend { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat-card__trend.up { color: var(--success); }
.stat-card__trend.down { color: var(--danger); }
.stat-card__trend.flat { color: var(--text-muted); }

/* -------------------------------------------------------- Data table ------ */
.fleet-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.fleet-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.fleet-table thead th {
  text-align: left; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; color: var(--text-muted); padding: var(--cell-py) var(--cell-px);
  background: var(--surface-alt); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.fleet-table tbody td, .fleet-table tbody th { padding: var(--cell-py) var(--cell-px); border-bottom: 1px solid var(--border); text-align: left; }
.fleet-table tbody tr:last-child td, .fleet-table tbody tr:last-child th { border-bottom: none; }
.fleet-table tbody tr:hover td, .fleet-table tbody tr:hover th { background: var(--surface-alt); }
.fleet-table .num { text-align: right; font-family: var(--font-mono); color: var(--text-muted); }
.fleet-table .unit { font-family: var(--font-mono); font-weight: 600; }

/* Grid variant: dense, sticky first column, status-tinted cells */
.fleet-table--grid { white-space: nowrap; }
.fleet-table--grid thead th { position: sticky; top: 0; z-index: 2; }
.fleet-table--grid .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: normal; min-width: 17rem; max-width: 22rem; }
.fleet-table--grid thead .sticky-col { z-index: 3; background: var(--surface-alt); }
.fleet-table--grid td { text-align: center; font-variant-numeric: tabular-nums; }
.cell--low { background: var(--bad-bg) !important; color: var(--bad-fg); font-weight: 600; }
.cell--missing { background: var(--warn-bg) !important; color: var(--warn-fg); font-weight: 600; }
.cell--untracked { color: var(--text-muted); opacity: .65; }
.row--low > * { background: var(--bad-bg); }
.row--missing > * { background: var(--warn-bg); }

/* ------------------------------------------------------- Badges / pills --- */
.fleet-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid transparent;
}
.fleet-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.fleet-badge.is-ok { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-bd); }
.fleet-badge.is-ok .dot { background: var(--success); }
.fleet-badge.is-missing { color: var(--warn-fg); background: var(--warn-bg); border-color: var(--warn-bd); }
.fleet-badge.is-missing .dot { background: var(--warning); }
.fleet-badge.is-low { color: var(--bad-fg); background: var(--bad-bg); border-color: var(--bad-bd); }
.fleet-badge.is-low .dot { background: var(--danger); }
.fleet-badge.is-info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.fleet-badge.is-info .dot { background: var(--info); }
.fleet-badge.is-muted { color: var(--text-muted); background: var(--surface-alt); border-color: var(--border); }
.fleet-badge.is-muted .dot { background: var(--text-muted); }

/* --------------------------------------------------------------- Alerts --- */
.fleet-alert {
  display: flex; gap: var(--space-3); padding: 13px 16px; border-radius: var(--radius);
  border: 1px solid; font-size: var(--text-sm); line-height: 1.45; margin-bottom: var(--space-3);
}
.fleet-alert__icon { flex: 0 0 20px; font-weight: 700; }
.fleet-alert__body strong { display: block; margin-bottom: 2px; }
.fleet-alert.is-info { background: var(--info-bg); border-color: var(--info-bd); color: var(--text); }
.fleet-alert.is-info .fleet-alert__icon { color: var(--info); }
.fleet-alert.is-ok, .fleet-alert.is-success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--text); }
.fleet-alert.is-ok .fleet-alert__icon, .fleet-alert.is-success .fleet-alert__icon { color: var(--success); }
.fleet-alert.is-warn, .fleet-alert.is-warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--text); }
.fleet-alert.is-warn .fleet-alert__icon, .fleet-alert.is-warning .fleet-alert__icon { color: var(--warning); }
.fleet-alert.is-bad, .fleet-alert.is-danger { background: var(--bad-bg); border-color: var(--bad-bd); color: var(--text); }
.fleet-alert.is-bad .fleet-alert__icon, .fleet-alert.is-danger .fleet-alert__icon { color: var(--danger); }

/* ----------------------------------------------------------- Form fields -- */
.fleet-field { margin-bottom: var(--space-4); }
.fleet-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fleet-field .hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 6px; }
.fleet-field .err { font-size: var(--text-xs); color: var(--danger); margin-top: 6px; }
.fleet-input, .fleet-field input, .fleet-field select, .fleet-field textarea {
  width: 100%; font-family: inherit; font-size: var(--text-sm); padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none;
}
.fleet-field input:focus, .fleet-field select:focus, .fleet-field textarea:focus, .fleet-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle);
}
.fleet-field input::placeholder { color: var(--text-muted); }
.fleet-field.is-invalid input { border-color: var(--danger); }
.fleet-field input:disabled { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }

/* --------------------------------------------------------------- Legend --- */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--text-xs); color: var(--text-muted); margin: var(--space-2) 0 var(--space-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 14px; height: 14px; border: 1px solid var(--border); border-radius: 3px; }
.legend .swatch.low { background: var(--bad-bg); }
.legend .swatch.missing { background: var(--warn-bg); }
.legend .swatch.untracked { background: var(--surface-alt); }

/* --------------------------------------------- Legacy .fsi-* compat aliases -
   Consumed by Bootstrap-layered FSI apps (e.g. fsi_STRUCTURE_EXAMPLE). Styled
   with Fleet tokens so those apps inherit the Fleet look without template edits. */
.fsi-navbar { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.fsi-navbar__container { display: flex; align-items: center; gap: var(--space-4); }
.fsi-navbar__brand { font-weight: 700; color: var(--text); }
.fsi-navbar__menu .nav-link { color: var(--text-muted); }
.fsi-navbar__menu .nav-link:hover { color: var(--text); }
.fsi-display { font-weight: 700; letter-spacing: -.01em; }

.fsi-button-primary, .fsi-primary-btn { background: var(--accent); border: 1px solid var(--accent); color: #fff; font-weight: 600; border-radius: var(--radius-sm); }
.fsi-button-primary:hover, .fsi-button-primary:focus, .fsi-primary-btn:hover, .fsi-primary-btn:focus { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.fsi-button-secondary, .fsi-secondary-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; border-radius: var(--radius-sm); }
.fsi-button-secondary:hover, .fsi-button-secondary:focus, .fsi-secondary-btn:hover, .fsi-secondary-btn:focus { background: var(--surface-alt); color: var(--text); }
.fsi-nav-action { background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: var(--radius-sm); }
.fsi-nav-action:hover { background: var(--surface-alt); color: var(--text); }
/* Keyboard focus indicator (WCAG 2.4.7) on the legacy button classes. */
.fsi-button-primary:focus-visible, .fsi-primary-btn:focus-visible,
.fsi-button-secondary:focus-visible, .fsi-secondary-btn:focus-visible,
.fsi-nav-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fsi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.fsi-badge, .fsi-badge-success, .fsi-badge-primary {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid transparent;
}
.fsi-badge { color: var(--text-muted); background: var(--surface-alt); border-color: var(--border); }
.fsi-badge-success { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-bd); }
.fsi-badge-primary { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.fsi-section-title { font-size: var(--text-lg); font-weight: 600; }
.fsi-text-success { color: var(--success); }
.fsi-text-danger { color: var(--danger); }

/* Map Bootstrap contextual alerts onto Fleet status chips for .fsi-* apps. */
.alert.alert-success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.alert.alert-danger { background: var(--bad-bg); border-color: var(--bad-bd); color: var(--bad-fg); }
.alert.alert-warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }
.alert.alert-info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }

/* Map Bootstrap form controls onto Fleet tokens so inputs stay consistent
   (notably in dark mode) in .fsi-* apps that use standard Bootstrap fields. */
.form-control, .form-select, .form-check-input {
  background-color: var(--surface); color: var(--text); border-color: var(--border);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  background-color: var(--surface); color: var(--text);
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-control::placeholder { color: var(--text-muted); opacity: .7; }


/* ============================================================
   Error badge — shared error-state illustration ("Mongo")

   Source of truth: Fleet UI Kit, components/17-error-badge.html.
   Rendered by the Jinja macro in templates/partials/error_badge.html.

   Deliberately NOT `.badge` — that is Bootstrap's / the kit's status pill and a
   different component.

   No colour is declared here, on purpose. The artwork's ink is `currentColor`,
   so it inherits whatever --text resolved to for the active theme and one asset
   serves both light and dark. Declaring a colour here would break that.

   The SVG must be INLINED (the macro does this). Through <img src> or
   background-image an external SVG cannot see this page's CSS, `currentColor`
   falls back to black, and it stops adapting. Use the --mask variant if an
   external image is ever unavoidable.
   ============================================================ */
.fsi-error-badge {
  display: block;
  width: 100%;
  max-width: var(--fsi-error-badge-w, 22rem);
  margin: 0 auto var(--space-4);
}

.fsi-error-badge svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Same adaptivity without inlining: paints a currentColor block through the
   artwork's alpha channel. Requires mongo-error-mask.png in theme static. */
.fsi-error-badge--mask {
  aspect-ratio: 1037 / 684;
  background-color: currentColor;
  -webkit-mask: var(--fsi-error-badge-mask) center / contain no-repeat;
          mask: var(--fsi-error-badge-mask) center / contain no-repeat;
}

/* ---------------------------------------------------------------------------
   Help flyovers and the help centre.
   The flyover copy is defined once in app/blueprints/help/routes.py::FIELD_HELP
   and rendered both here and as the glossary, so the two cannot drift.
   --------------------------------------------------------------------------- */

.fsi-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  margin-left: .25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-alt, var(--bg));
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  flex: none;
}

.fsi-help-tip:hover,
.fsi-help-tip:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  outline: none;
}

/* A tip inside a list row sits above the row's stretched link, exactly like
   the severity chip — otherwise the row navigates instead of explaining. */
.comms-row__flags .fsi-help-tip {
  position: relative;
  z-index: 2;
}

.fsi-help-popover { --bs-popover-max-width: 22rem; }
.fsi-help-popover .popover-header { font-weight: 700; }
.fsi-help-popover .popover-body { font-size: .82rem; line-height: 1.5; }

/* ---- Help centre ---- */
.fsi-help { width: min(100%, 62rem); margin-inline: auto; padding: 1.5rem 1rem 3rem; }
.fsi-help__head { margin-bottom: 1.75rem; }
.fsi-help__lead { color: var(--text-muted); max-width: 46rem; line-height: 1.6; }

.fsi-help__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.fsi-help__card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, box-shadow .12s;
}

.fsi-help__card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.fsi-help__card-title { margin: 0 0 .35rem; font-size: 1rem; font-weight: 700; }
.fsi-help__card-summary { margin: 0 0 .5rem; font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
.fsi-help__card-count { font-size: .72rem; color: var(--text-muted); }

.fsi-help__breadcrumb {
  display: flex;
  gap: .4rem;
  align-items: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.fsi-help__breadcrumb a { color: var(--accent); text-decoration: none; }

.fsi-help__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  gap: 2rem;
  align-items: start;
}

.fsi-help__points { margin: 1.25rem 0; padding-left: 1.1rem; display: grid; gap: .7rem; }
.fsi-help__points li { line-height: 1.6; }

.fsi-help__glossary { display: grid; gap: .9rem; margin: 1.5rem 0; }
.fsi-help__glossary dt { font-weight: 700; }
.fsi-help__glossary dd { margin: .2rem 0 0; color: var(--text-muted); line-height: 1.55; }

.fsi-help__figure { margin: 1.75rem 0; }
.fsi-help__shot {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: .6rem;
  box-shadow: var(--shadow);
  display: block;
}
.fsi-help__figure figcaption {
  margin-top: .55rem;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.fsi-help__aside {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .9rem;
  background: var(--surface);
}
.fsi-help__aside-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.fsi-help__nav { display: grid; gap: .15rem; }
.fsi-help__nav-item {
  padding: .35rem .5rem;
  border-radius: .4rem;
  font-size: .85rem;
  text-decoration: none;
  color: inherit;
}
.fsi-help__nav-item:hover { background: var(--bg); }
.fsi-help__nav-item.is-active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }

.fsi-help__section-title { font-size: 1.05rem; margin: 0 0 .75rem; }
.fsi-help__faq { display: grid; gap: .85rem; }
.fsi-help__faq dt { font-weight: 700; }
.fsi-help__faq dd { margin: .2rem 0 0; color: var(--text-muted); line-height: 1.55; }

@media (max-width: 760px) {
  .fsi-help__layout { grid-template-columns: 1fr; }
  .fsi-help__aside { position: static; }
}

/* A labeled tip (help_tip(key, label=...)) is a readable pill, not the round
   "?" icon. Used where the tip IS the visible text, e.g. the queue legend. */
.fsi-help-tip.fsi-help-tip--label {
  width: auto;
  height: auto;
  min-height: 1.4rem;
  margin-left: 0;
  padding: .1rem .6rem;
  border-radius: 9999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
}
