/* Brand layer over Bootstrap 5.3: brand colour, IBM Plex type pairing,
   and the severity palette Bootstrap has no equivalent for. */
:root{
  --bs-body-font-family:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --bs-body-font-size:.9rem;
  --bs-primary:#1f5d8c;
  --bs-primary-rgb:31,93,140;
  --bs-link-color:#1f5d8c;
  --bs-link-color-rgb:31,93,140;
  --bs-link-hover-color:#17496e;
  --font-display:"IBM Plex Sans Condensed","Helvetica Neue",Arial,sans-serif;
  --font-mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --brand:#1f5d8c;
  --sev-crit:#b5392c;   --sev-crit-bg:#fae0dd;
  --sev-high:#b3660d;   --sev-high-bg:#fbead3;
  --sev-medium:#8a7210; --sev-medium-bg:#f7f0d2;
  --sev-low:#476c8c;    --sev-low-bg:#e2eaf1;
  --direct:#1f5d8c;     --direct-bg:#dcebf6;
  --indirect:#6f4e9c;   --indirect-bg:#eae1f6;
}
[data-bs-theme="dark"]{
  --brand:#64a6dc;
  --bs-primary:#64a6dc; --bs-primary-rgb:100,166,220;
  --bs-link-color:#8cc0e8; --bs-link-color-rgb:140,192,232;
  --sev-crit:#ff7a6b;   --sev-crit-bg:#36201e;
  --sev-high:#f0a24e;   --sev-high-bg:#352717;
  --sev-medium:#d9bd52; --sev-medium-bg:#302b16;
  --sev-low:#8fb4d2;    --sev-low-bg:#1b2733;
  --direct:#64a6dc;     --direct-bg:#17293a;
  --indirect:#b094dd;   --indirect-bg:#241d33;
}

body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:1040;background:var(--bs-tertiary-bg)}
.gutter{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.navbar.sticky-top{top:env(safe-area-inset-top,0px)}

h1,h2,h3,h4,h5,h6,.display-num{font-family:var(--font-display);text-wrap:balance}
.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.label{font-size:.68rem;letter-spacing:.07em;text-transform:uppercase;font-weight:600;color:var(--bs-secondary-color)}
.section-label{display:flex;align-items:center;gap:.75rem;font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;font-weight:600;color:var(--bs-secondary-color)}
.section-label::after{content:"";flex:1;height:1px;background:var(--bs-border-color)}
.display-num{font-size:1.75rem;font-weight:600;line-height:1.05;font-variant-numeric:tabular-nums}
.display-num small{font-family:var(--font-mono);font-size:.7rem;font-weight:400;color:var(--bs-secondary-color)}

.btn-primary{--bs-btn-bg:var(--brand);--bs-btn-border-color:var(--brand);--bs-btn-hover-bg:var(--brand);--bs-btn-hover-border-color:var(--brand);--bs-btn-active-bg:var(--brand);--bs-btn-active-border-color:var(--brand);--bs-btn-color:#fff;--bs-btn-hover-color:#fff;--bs-btn-disabled-bg:var(--brand);filter:none}
.btn-primary:hover{filter:brightness(1.1)}
[data-bs-theme="dark"] .btn-primary{--bs-btn-color:#0e1118;--bs-btn-hover-color:#0e1118}
.nav-tabs .nav-link.active{color:var(--bs-emphasis-color);border-bottom-color:var(--bs-body-bg);box-shadow:inset 0 -2px 0 var(--brand)}
.nav-tabs .nav-link{color:var(--bs-secondary-color)}
.chip.active{background:var(--direct-bg);border-color:var(--brand);color:var(--brand)}
.swatch{width:9px;height:9px;border-radius:2px;display:inline-block;flex:none}

.badge-critical{background:var(--sev-crit-bg);color:var(--sev-crit)}
.badge-high{background:var(--sev-high-bg);color:var(--sev-high)}
.badge-medium{background:var(--sev-medium-bg);color:var(--sev-medium)}
.badge-low{background:var(--sev-low-bg);color:var(--sev-low)}
.badge-direct{background:var(--direct-bg);color:var(--direct)}
.badge-indirect{background:var(--indirect-bg);color:var(--indirect)}
.badge-ghost{background:var(--bs-secondary-bg);color:var(--bs-secondary-color);font-weight:500;text-transform:none;letter-spacing:0}
.badge{letter-spacing:.03em}

.stripe-critical{border-left:4px solid var(--sev-crit)!important}
.stripe-high{border-left:4px solid var(--sev-high)!important}
.stripe-medium{border-left:4px solid var(--sev-medium)!important}
.stripe-low{border-left:4px solid var(--sev-low)!important}

.threat-card{cursor:pointer;transition:border-color .12s ease}
.threat-card:hover{border-color:var(--bs-secondary-color)}
.threat-card.selected{box-shadow:0 0 0 2px var(--brand)}
.srcpill{font-family:var(--font-mono);font-size:.68rem;background:var(--bs-tertiary-bg);border:1px solid var(--bs-border-color);border-radius:.25rem;padding:.05rem .35rem;color:var(--bs-secondary-color)}
.evidence{font-family:var(--font-mono);font-size:.72rem;line-height:1.55;white-space:pre-wrap;background:var(--bs-tertiary-bg);border-left:3px solid var(--bs-border-color);border-radius:.25rem;padding:.6rem .75rem;color:var(--bs-secondary-color);overflow-x:auto;margin:0}

.chain-hop{display:grid;grid-template-columns:1.1rem minmax(0,1fr);gap:.65rem}
.chain-rail{display:flex;flex-direction:column;align-items:center}
.chain-node{width:11px;height:11px;border-radius:50%;border:2px solid var(--indirect);background:var(--bs-body-bg);margin-top:.3rem;flex:none}
.chain-hop.is-threat .chain-node{border-color:var(--sev-crit);background:var(--sev-crit)}
.chain-hop.is-you .chain-node{border-color:var(--brand);background:var(--brand)}
.chain-line{flex:1;width:2px;background:var(--bs-border-color);min-height:.9rem}
.chain-hop:last-child .chain-line{display:none}

.advisory-high{background:var(--sev-crit-bg);color:var(--sev-crit)}
.advisory-medium{background:var(--sev-high-bg);color:var(--sev-high)}
.advisory-low{background:var(--bs-tertiary-bg);color:var(--bs-secondary-color)}

.scroll-x{overflow-x:auto}
.scroll-x svg{display:block;min-width:820px;max-width:100%;height:auto}
.scroll-x table{min-width:620px}
.lede{color:var(--bs-secondary-color);max-width:68ch}
.note{font-size:.78rem;color:var(--bs-secondary-color);line-height:1.5;max-width:78ch}
.tid{font-family:var(--font-mono);font-size:.7rem;color:var(--bs-secondary-color)}
.confbar{width:46px;height:4px}
@media (min-width:992px){.dossier-sticky{position:sticky;top:calc(env(safe-area-inset-top,0px) + 4.2rem);max-height:calc(100vh - 6rem);overflow:auto}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
