/* Scoped to the two matrix sections; native SVG, no image or font dependency. */
#tab-threat-matrix, #tab-ai-threat-matrix { --mx-cyan:#68e1e5; --mx-pink:#ff91bf; --mx-muted:#afc0d1; }
#tab-threat-matrix .section-header h2, #tab-ai-threat-matrix .section-header h2 { max-width:900px; letter-spacing:-.035em; }
.matrix-explorer { color:#edf6ff; margin:24px 0; border:1px solid #294256; border-radius:16px; background:#091322; overflow:hidden; box-shadow:0 20px 65px #0003; font-family:var(--font-body,system-ui,sans-serif); }
.matrix-explorer *, .matrix-explorer *::before, .matrix-explorer *::after { box-sizing:border-box; }
.matrix-explorer [hidden], #tm-heatmap-wrap[hidden], .ai-matrix-wrap[hidden] { display:none!important; }
.mx-toolbar { display:flex; align-items:end; justify-content:space-between; gap:20px; padding:20px 24px; border-bottom:1px solid #263b50; background:#101e30; }
.mx-filter-slot { display:flex; align-items:end; flex-wrap:wrap; gap:16px; }
.mx-filter-slot label { display:flex; flex-direction:column; gap:7px; color:#b9cddd; font-size:12px; }
.mx-filter-slot input, .mx-filter-slot select { font:inherit; font-size:14px; padding:10px 12px; border:1px solid #385169; border-radius:6px; background:#091322; color:#edf6ff; min-height:42px; max-width:100%; }
.mx-filter-slot input { width:180px; }
.mx-filter-slot input::placeholder { color:#91a7bb; }
.mx-view { display:flex; flex-shrink:0; gap:4px; padding:4px; border:1px solid #385169; border-radius:8px; }
.mx-view button { border:0; background:transparent; color:#b7cbde; padding:9px 14px; border-radius:5px; font:600 12px/1.3 system-ui,sans-serif; cursor:pointer; min-height:34px; }
.mx-view button[aria-pressed=true] { color:#07161d; background:#8ee9e8; }
.mx-context { padding:22px 24px 0; display:flex; align-items:start; justify-content:space-between; gap:24px; }
.mx-kicker { display:block; font:600 10px/1.6 var(--font-mono,monospace); letter-spacing:.14em; text-transform:uppercase; color:var(--mx-cyan); }
.mx-context h3 { font-size:21px; font-weight:600; margin:4px 0 0; color:#edf6ff; letter-spacing:-.025em; }
.mx-context p { margin:0; max-width:340px; text-align:right; font:12px/1.7 var(--font-mono,monospace); color:#afc0d1; }
.mx-stage { height:552px; position:relative; isolation:isolate; margin-top:10px; }
.mx-wiring { position:absolute; width:100%; height:100%; inset:0; z-index:-1; }
.mx-orbits { fill:none; stroke:#2b7380; stroke-width:1; opacity:.65; }
.mx-path { fill:none; stroke:#49a2b5; stroke-width:1.5; }
.mx-path.is-inferred { stroke-dasharray:5 5; }
.mx-path.is-selected { stroke:var(--mx-pink); stroke-width:2.5; filter:drop-shadow(0 0 5px #ff6aaf88); }
.mx-terminal { fill:#68e1e5; }
.mx-hub { position:absolute; left:36%; top:50%; transform:translateY(-50%); width:28%; padding:10px 16px; text-align:center; }
.mx-shield { display:grid; place-items:center; width:100px; height:112px; margin:14px auto 10px; background:linear-gradient(150deg,#2d7780,#0b2036); clip-path:polygon(50% 0,95% 18%,91% 64%,74% 85%,50% 100%,26% 85%,9% 64%,5% 18%); color:#9effff; }
.mx-shield svg { width:48px; height:48px; }
/* Explicit alignment prevents the global main-heading rule from shifting the hub title. */
.mx-hub h3 { text-align:center; width:100%; max-width:none; color:#f1fcff; font-size:clamp(17px,1.8vw,23px); font-weight:600; line-height:1.25; margin:0 0 9px; letter-spacing:-.025em; overflow-wrap:anywhere; }
.mx-hub-sub { color:#a5c2d3; font:11px/1.6 var(--font-mono,monospace); display:block; }
.mx-node { position:absolute; top:calc(44px + var(--row)*120px); left:var(--side); width:26%; height:104px; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; text-align:left; padding:14px 15px; gap:3px; background:linear-gradient(130deg,#15283d,#0c192b); border:1px solid #3d6175; border-radius:8px; color:#ebf5ff; cursor:pointer; box-shadow:0 6px 24px #0003; transition:border-color .15s,box-shadow .15s; }
.mx-node.is-inferred { border-style:dashed; }
.mx-node:hover { border-color:#83e7e8; box-shadow:0 0 18px #59cedd22; }
.mx-node[aria-pressed=true] { border-color:var(--mx-pink); background:linear-gradient(130deg,#302036,#151b30); box-shadow:0 0 24px #ff6aaf25; }
.mx-node-code { display:flex; justify-content:space-between; width:100%; font:9px/1.3 var(--font-mono,monospace); color:#89d9e1; letter-spacing:.06em; }
.mx-node[aria-pressed=true] .mx-node-code { color:var(--mx-pink); }
.mx-node strong { font-size:14px; line-height:1.25; font-weight:650; }
.mx-node-meta { font-size:11px; line-height:1.45; color:#cedce7; }
.mx-node-type { font-size:10px; line-height:1.4; color:#9bb4c8; }
.mx-bottom { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; padding:16px 24px; border-top:1px solid #263b50; }
.mx-legend { display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px; font-size:11px; color:#b9cddd; margin:0; }
.mx-legend-item { display:inline-flex; align-items:center; gap:8px; }
.mx-line-key { display:inline-block; flex:none; width:17px; border-top:2px solid #68e1e5; }
.mx-pink { border-color:var(--mx-pink); }.mx-dashed { border-top-style:dashed; }
.mx-paging { display:flex; align-items:center; gap:12px; font:11px/1.5 var(--font-mono,monospace); color:#c6d9e5; }
.mx-paging button { width:36px; height:36px; border:1px solid #385169; border-radius:5px; background:#13263a; color:#d3f7ff; cursor:pointer; font-size:18px; }
.mx-paging button:disabled { opacity:.35; cursor:default; }
.mx-selection { display:flex; gap:16px; flex-wrap:wrap; align-items:center; justify-content:space-between; background:#122236; padding:15px 24px; color:#c1d3e2; font-size:12px; line-height:1.6; }
.mx-selection a { color:#8be7e8; text-underline-offset:3px; }
.mx-selection button { background:transparent; border:0; padding:4px; color:#b8cadc; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.mx-no-results { position:absolute; left:6%; top:10%; max-width:26%; color:#c6d9e5; font-size:14px; }
.matrix-explorer :focus-visible { outline:3px solid #fff; outline-offset:4px; }
.mx-disclosure { padding:12px 16px; border-left:3px solid #688dac; color:var(--color-text-muted); font-size:13px; line-height:1.7; background:var(--color-surface); border-radius:4px; }
#tm-actor-profile, #ai-matrix-detail { scroll-margin-top:100px; }
#tm-controls { gap:16px!important; padding:16px!important; }
#tm-controls select { min-height:40px; max-width:100%; }
#tm-controls label { flex-wrap:wrap; }
#tab-threat-matrix .mx-methodology { margin:16px 0; border:1px solid var(--color-border); border-radius:8px; padding:12px 16px; }
#tab-threat-matrix .mx-methodology summary { cursor:pointer; font-size:13px; color:var(--color-text-muted); }
#tab-threat-matrix #tm-stats { gap:12px!important; }
#tab-threat-matrix #tm-stats .hero-stat { min-width:120px!important; padding:16px 14px; }
#tab-threat-matrix #tm-stats .hero-stat-num { font-size:28px; }
#tab-threat-matrix #tm-stat-updated { font-size:18px!important; }
#tab-threat-matrix #tm-stats .hero-stat, #tab-ai-threat-matrix .ai-matrix-metric { box-shadow:none; }
@media (min-width:1100px) { #tab-ai-threat-matrix .container { max-width:1280px; } }
@media (max-width:1100px) {
  .mx-toolbar { align-items:start; flex-wrap:wrap; padding:18px; }
  .mx-filter-slot { flex:1; }.mx-context { padding:20px 18px 0; flex-direction:column; align-items:start; gap:10px; }
  .mx-context p { text-align:left; max-width:none; }.mx-stage { height:auto; padding:10px 18px 24px; }
  .mx-wiring { display:none; }.mx-hub { position:relative; top:auto; left:auto; width:100%; transform:none; margin:12px auto 28px; padding:20px; border:1px solid #2c6677; border-radius:12px; background:radial-gradient(ellipse at center,#17384c,#0c192b 75%); }
  .mx-hub::after { content:''; position:absolute; width:2px; height:29px; background:#498d9b; top:100%; left:50%; }
  .mx-hub h3 { font-size:22px; }.mx-shield { width:65px; height:75px; margin:10px auto; }.mx-shield svg { width:34px; height:34px; }
  .mx-nodes { display:grid; grid-template-columns:1fr 1fr; gap:12px; position:relative; }
  .mx-node { position:relative; top:auto; left:auto; width:100%; height:auto; min-height:112px; padding:12px; }
  .mx-node strong { font-size:14px; }.mx-node-meta { font-size:11px; line-height:1.45; }.mx-node-type { font-size:10px; line-height:1.4; }
  .mx-bottom { padding:16px 18px; }.mx-selection { padding:16px 18px; }.mx-no-results { position:static; max-width:none; grid-column:1/-1; }
}
@media (max-width:440px) {
  .mx-nodes { grid-template-columns:1fr; }.mx-node { min-height:100px; }.mx-filter-slot input { width:100%; }
  .mx-filter-slot label { width:100%; }.mx-view { width:100%; }.mx-view button { flex:1; }
  #tm-controls label { width:100%; } #tm-controls select { width:100%; }
}
@media (prefers-reduced-motion:reduce) { .matrix-explorer * { transition:none!important; scroll-behavior:auto!important; } }
