/* Attack-analytics dashboards and pattern lab (th-*, pt-*). Builds on base.css. */
.th-grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
.th-grid-3 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .th-grid-2, .th-grid-3 { grid-template-columns: 1fr; } }

.th-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 0.82rem; color: var(--text-secondary); }
.th-filters label { display: flex; gap: 6px; align-items: center; }
.th-filters select, .th-tools input { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); padding: 5px 8px; font: inherit; }
.th-filters .chk input { accent-color: var(--accent-cyan); }
.th-chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.th-chip i, .th-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; vertical-align: 0; }
.th-active { margin-top: 10px; font-size: 0.78rem; color: var(--text-secondary); min-height: 1em; }
.th-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 1100px) { .th-kpis { grid-template-columns: repeat(3, 1fr); } }
.th-spark { width: 100%; height: 28px; margin-top: 6px; display: block; }
.th-hit { cursor: pointer; }
.th-hit:hover { filter: brightness(1.15); }
.th-flow:hover { stroke-opacity: 0.7; }
.th-grad { display: inline-block; width: 120px; height: 10px; border-radius: 4px; margin-inline-end: 8px; vertical-align: -1px; }
.th-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.th-tools { display: flex; gap: 8px; align-items: center; }
.th-tools input { min-width: 240px; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-vend .c { height: 22px; }
.th-sevrow { display: grid; grid-template-columns: minmax(120px, 1fr) 2.4fr; gap: 12px; align-items: center; margin: 8px 0; font-size: 0.8rem; }
.th-sevrow .lbl { color: var(--text-secondary); }
.th-sevrow small { color: var(--text-muted); }
.th-stack { display: flex; height: 20px; gap: 2px; direction: ltr; }
.th-stack span { display: flex; align-items: center; justify-content: center; border-radius: 3px; color: #fff; font-size: 0.72rem; font-weight: 700; }
#thActors .ins-hbar, #thThemes .ins-hbar { grid-template-columns: minmax(120px, 1.4fr) 1.6fr 28px; }
#thActors .lbl, #thThemes .lbl { unicode-bidi: plaintext; text-align: start; }
#view-threats svg, #view-patterns svg { direction: ltr; }

/* Pattern lab */
.pt-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1200px) { .pt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .pt-cards { grid-template-columns: 1fr; } }
.pt-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt-head h5 { font-size: 0.95rem; color: var(--text-primary); }
.pt-big { font-size: 1.6rem; font-weight: 800; color: var(--accent-cyan); font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
.pt-d { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.7; }
.pt-i { font-size: 0.78rem; color: var(--text-primary); line-height: 1.7; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border-subtle); }
.pt-i b { color: var(--accent-cyan); margin-inline-end: 4px; }
.pt-lag { display: flex; gap: 14px; align-items: flex-end; height: 92px; direction: ltr; }
.pt-lag div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; color: var(--text-secondary); }
.pt-lag .bar { width: 26px; border-radius: 4px 4px 0 0; }
.pt-lag b { color: var(--text-primary); }
.pt-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-dots i { width: 14px; height: 14px; border-radius: 3px; }
.pt-lift { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pt-lift span { height: 8px; border-radius: 4px; background: var(--accent-cyan); }
.pt-lift b { font-variant-numeric: tabular-nums; }
.pt-k2 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 12px; }
.pt-stack { display: flex; height: 26px; gap: 2px; margin: 4px 0 14px; direction: ltr; }
.pt-stack span { display: flex; align-items: center; justify-content: center; border-radius: 4px; color: #fff; font-size: 0.74rem; font-weight: 700; white-space: nowrap; overflow: hidden; }
.pt-watch { display: grid; grid-template-columns: 24px minmax(130px, 1.2fr) 2fr 40px; gap: 10px; align-items: center; margin: 8px 0; font-size: 0.8rem; }
.pt-watch .rk { font-weight: 800; color: var(--text-muted); text-align: center; }
.pt-watch .lbl small { display: block; color: var(--text-muted); }
.pt-watch .track { height: 12px; background: var(--bg-card); border-radius: 4px; overflow: hidden; }
.pt-watch .fill { display: block; height: 100%; border-radius: 4px; }
.pt-watch .val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.pt-cal { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.82rem; }
.pt-cal small { color: var(--text-muted); }
.pt-stack span { unicode-bidi: plaintext; }

/* Strategic report tab (rp-*) */
#view-report svg { direction: ltr; }
.rp-story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .rp-story { grid-template-columns: 1fr; } }
.rp-span { grid-column: 1 / -1; margin-top: 0; }
.rp-q { text-align: start; font: inherit; color: inherit; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.rp-q:hover { border-color: var(--border-active); }
.rp-q.on { border-color: var(--accent-cyan); box-shadow: var(--shadow-glow); }
.rp-qh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-secondary); }
.rp-qh b { font-size: 1.1rem; color: var(--text-primary); }
.rp-qh em { font-style: normal; margin-inline-start: auto; font-weight: 800; color: var(--accent-cyan); }
.rp-q p { font-size: 0.78rem; line-height: 1.7; color: var(--text-secondary); }
.rp-off { opacity: 0.4; text-decoration: line-through; }
.rp-mixrow { padding: 2px 6px; border-radius: var(--radius-xs); }
.rp-mixrow.on { background: var(--bg-card); outline: 1px solid var(--accent-cyan); }
.rp-mixrow .pt-stack { margin: 0; }
.rp-h5 { font-size: 0.86rem; color: var(--text-primary); margin: 14px 0 8px; }
.rp-note { font-size: 0.76rem; color: var(--text-secondary) !important; line-height: 1.6; unicode-bidi: plaintext; }
.rp-dim { opacity: 0.4; }
.rp-scroll { max-height: 460px; }
.rp-scroll tfoot td { background: var(--bg-surface); border-top: 2px solid var(--border-subtle); }
.rp-reg { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .rp-reg { grid-template-columns: 1fr; } }
.rp-matrix td, .rp-matrix th { text-align: center; white-space: nowrap; }
.rp-matrix td:first-child { text-align: start; }
.rp-matrix th.rp-sel { color: var(--accent-cyan); box-shadow: inset 0 -2px 0 var(--accent-cyan); }
.rp-cell span { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; }
.rp-tac ol, .rp-recs { padding-inline-start: 20px; display: grid; gap: 8px; font-size: 0.82rem; line-height: 1.7; color: var(--text-primary); }
.rp-tac li, .rp-recs li span { unicode-bidi: plaintext; }
.rp-recs li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rp-recs li::marker { color: var(--text-muted); }
.rp-ok { margin-top: 12px; font-size: 0.8rem; color: var(--text-secondary); }
.rp-mat { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rp-donut { width: 150px; height: 150px; flex: none; }
.rp-gaps { flex: 1; min-width: 220px; display: grid; gap: 6px; font-size: 0.82rem; color: var(--text-secondary); }
.rp-gaps b { font-size: 1.3rem; }
.pt-src { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.th-banner { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--accent-cyan); background: var(--bg-card); font-size: 0.8rem; line-height: 1.7; color: var(--text-primary); }
#rpSec .ins-hbar, #rpVec .ins-hbar, #rpAct .ins-hbar { grid-template-columns: minmax(120px, 1.7fr) 1.3fr 64px; }
#rpRep .ins-hbar, #rpHyg .ins-hbar { grid-template-columns: minmax(150px, 1.6fr) 1.6fr 52px; }
#rpSec .val, #rpVec .val, #rpAct .val { white-space: nowrap; font-size: 0.76rem; }
