:root {
  --bg: #0b1020;
  --bg-elev: #121a30;
  --card: #141d35;
  --card-2: #1a2540;
  --line: #26324f;
  --line-soft: #1e2947;
  --text: #e8edf7;
  --text-dim: #9aa7c2;
  --text-faint: #6b7794;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --good: #22c55e;
  --good-dim: #16351f;
  --warn: #f59e0b;
  --warn-dim: #3a2a0a;
  --crit: #ef4444;
  --crit-dim: #3a1414;
  --med: #eab308;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,.14), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(34,211,238,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

#app { max-width: 1240px; margin: 0 auto; padding: 0 22px 60px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 0 18px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(59,130,246,.4);
}
.brand-text h1 { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.brand-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }
.brand-right { display: flex; align-items: center; gap: 10px; }

/* ---- Small legend-style status badges ---- */
.legend-badges { display: inline-flex; align-items: center; gap: 8px; }
.lg-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  padding: 3px 8px; border-radius: 999px; line-height: 1.4;
  background: var(--card-2); border: 1px solid var(--line-soft); color: var(--text-dim);
  white-space: nowrap;
}
.lg-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.lg-sq { width: 7px; height: 7px; border-radius: 2px; flex: none; }
#envTag { font-family: var(--mono); font-size: 10px; letter-spacing: .6px; }

/* audit readiness tones */
.lg-ok { color: #86efac; border-color: #1f5130; background: var(--good-dim); }
.lg-dot-ok { background: var(--good); box-shadow: 0 0 0 3px rgba(34,197,94,.22); }
.lg-warn { color: #fcd34d; border-color: #5a420f; background: var(--warn-dim); }
.lg-dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.22); }
.lg-crit { color: #fca5a5; border-color: #5a1a1a; background: var(--crit-dim); }
.lg-dot-crit { background: var(--crit); box-shadow: 0 0 0 3px rgba(239,68,68,.22); }

/* environment tones */
.lg-env-prod { color: var(--accent-2); border-color: rgba(34,211,238,.3); background: rgba(34,211,238,.08); }
.lg-sq-prod { background: var(--accent-2); }
.lg-env-nonprod { color: #c4b5fd; border-color: #3a2f6b; background: rgba(139,92,246,.1); }
.lg-sq-nonprod { background: var(--violet, #8b5cf6); }
.lg-env-other { color: var(--text-dim); border-color: var(--line-soft); }
.lg-sq-other { background: var(--text-faint); }

/* ---------- Facet ribbon ---------- */
.ribbon {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  padding: 14px; margin-bottom: 18px;
  background: linear-gradient(180deg, var(--bg-elev), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.facet-btn {
  text-align: left; cursor: pointer; appearance: none;
  background: var(--card-2); border: 1px solid var(--line-soft);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: .18s ease; display: flex; flex-direction: column; gap: 4px;
}
.facet-btn:hover { border-color: var(--accent); transform: translateY(-2px); background: #1d2a49; }
.facet-btn.active { border-color: var(--accent); background: #1d2a49; box-shadow: inset 0 0 0 1px var(--accent); }
.facet-btn .f-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-faint); font-weight: 600; }
.facet-btn .f-value { font-size: 13px; font-weight: 600; color: var(--text); }
.facet-btn .f-head { display: flex; align-items: center; gap: 8px; }
.facet-btn .f-ico { color: var(--accent-2); display: grid; place-items: center; }

/* ---------- Facet detail panel ---------- */
.facet-panel {
  margin: -6px 0 18px; border: 1px solid var(--accent);
  border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); overflow: hidden;
  animation: slideDown .22s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.facet-panel-inner { padding: 18px 20px; }
.facet-panel h3 { margin: 0 0 4px; font-size: 15px; }
.facet-panel .fp-summary { color: var(--accent-2); font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.fp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.fp-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.fp-row .k { color: var(--text-dim); }
.fp-row .v { color: var(--text); font-weight: 600; text-align: right; font-family: var(--mono); font-size: 12px; }
.fp-note { margin-top: 14px; font-size: 12.5px; color: var(--text-dim); background: var(--card-2); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 6px; }

/* ---------- KPI strip ---------- */
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 15px; position: relative; overflow: hidden;
}
.kpi::after { content:""; position:absolute; inset:0 0 auto 0; height:3px; background: var(--accent); opacity:.8; }
.kpi.good::after { background: var(--good); }
.kpi.warn::after { background: var(--warn); }
.kpi.neutral::after { background: var(--accent); }
.kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); font-weight: 600; }
.kpi .k-value { font-size: 30px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -1px; }
.kpi.good .k-value { color: #86efac; }
.kpi.warn .k-value { color: #fcd34d; }
.kpi .k-sub { font-size: 12px; color: var(--text-dim); }

/* ---------- Cards & grid ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.card-sub { font-size: 11.5px; color: var(--text-faint); }

/* ---------- Trend chart ---------- */
.trend { position: relative; }
.trend svg { width: 100%; height: 170px; display: block; }
.trend .axis-label { fill: var(--text-faint); font-size: 10px; font-family: var(--mono); }
.trend .pt-label { fill: var(--text); font-size: 10px; font-family: var(--mono); font-weight: 600; }

/* ---------- Domain list ---------- */
.domain-list { display: flex; flex-direction: column; gap: 11px; }
.domain-row .d-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.domain-row .d-name { color: var(--text); font-weight: 500; }
.domain-row .d-pct { font-family: var(--mono); font-weight: 600; color: var(--text); }
.bar { height: 8px; background: var(--card-2); border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar.warn > span { background: linear-gradient(90deg, var(--warn), #fbbf24); }

/* ---------- Risk list ---------- */
.risk-list { display: flex; flex-direction: column; gap: 10px; }
.risk-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; background: var(--card-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.risk-item .sev-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; flex: none; }
.sev-critical { background: var(--crit); box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.sev-high { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.sev-medium { background: var(--med); box-shadow: 0 0 0 3px rgba(234,179,8,.18); }
.risk-item .r-body { flex: 1; }
.risk-item .r-title { font-size: 13px; font-weight: 500; }
.risk-item .r-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.risk-item .r-meta .chip { font-family: var(--mono); color: var(--accent-2); }

/* ---------- Evidence ---------- */
.evidence-block { display: flex; flex-direction: column; gap: 16px; }
.evi-bar-wrap { }
.evi-bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.evi-bar-top .big { font-size: 22px; font-weight: 800; color: #86efac; }
.evi-bar { height: 16px; background: var(--card-2); border-radius: 8px; overflow: hidden; border: 1px solid var(--line-soft); }
.evi-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--good), #4ade80); border-radius: 8px; }
.evi-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.evi-stat { background: var(--card-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.evi-stat .n { font-size: 22px; font-weight: 800; font-family: var(--mono); }
.evi-stat .l { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ---------- Matrix ---------- */
.matrix-card { padding-bottom: 8px; }
.matrix-head { align-items: center; flex-wrap: wrap; gap: 12px; }
.matrix-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.m-tab {
  appearance: none; cursor: pointer; font-family: inherit;
  background: var(--card-2); border: 1px solid var(--line-soft); color: var(--text-dim);
  padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; transition: .15s;
}
.m-tab:hover { color: var(--text); border-color: var(--accent); }
.m-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.matrix-table-wrap { overflow-x: auto; margin-top: 6px; }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix-table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-faint); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.matrix-table tbody td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.matrix-table tbody tr { cursor: pointer; transition: background .12s; }
.matrix-table tbody tr:hover { background: var(--card-2); }
.ctrl-id { font-family: var(--mono); font-weight: 600; color: var(--accent-2); }
.cell-primary { font-weight: 500; color: var(--text); max-width: 430px; }
.cell-dim { color: var(--text-dim); max-width: 430px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.effective { background: var(--good-dim); color: #86efac; border: 1px solid #1f5130; }
.badge.exception { background: var(--warn-dim); color: #fcd34d; border: 1px solid #5a420f; }
.badge .bd { width: 7px; height: 7px; border-radius: 50%; }
.badge.effective .bd { background: var(--good); }
.badge.exception .bd { background: var(--warn); }
.exc-sev { font-size: 11px; font-family: var(--mono); font-weight: 600; }
.exc-critical { color: #fca5a5; }
.exc-high { color: #fcd34d; }
.exc-medium { color: #fde68a; }
.exc-none { color: var(--text-faint); }

/* ---------- Hidden attribute must always win over display rules ---------- */
[hidden] { display: none !important; }

/* ---------- Drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(5,8,16,.6); backdrop-filter: blur(2px); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 94vw);
  background: var(--bg-elev); border-left: 1px solid var(--line); z-index: 50;
  box-shadow: -20px 0 50px rgba(0,0,0,.5); display: flex; flex-direction: column;
  animation: slideIn .22s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent-2); font-weight: 700; }
.drawer-head h3 { margin: 6px 0 0; font-size: 17px; }
.drawer-close { background: var(--card-2); border: 1px solid var(--line); color: var(--text-dim); width: 34px; height: 34px; border-radius: 9px; font-size: 20px; cursor: pointer; line-height: 1; }
.drawer-close:hover { color: #fff; border-color: var(--crit); }
.drawer-body { padding: 20px 22px; overflow-y: auto; }
.d-section { margin-bottom: 20px; }
.d-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-faint); margin: 0 0 7px; }
.d-section p { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.55; }
.d-kv { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.d-kv .k { color: var(--text-dim); }
.d-kv .v { font-weight: 600; text-align: right; }
.evi-chips { display: flex; flex-direction: column; gap: 7px; }
.evi-chip { font-size: 12.5px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 8px; display: flex; gap: 9px; align-items: center; }
.evi-chip svg { color: var(--good); flex: none; }
.exc-box { padding: 14px; border-radius: 10px; border: 1px solid; }
.exc-box.critical { background: var(--crit-dim); border-color: #5a1a1a; }
.exc-box.high { background: var(--warn-dim); border-color: #5a420f; }
.exc-box.medium { background: #2a2708; border-color: #4a4310; }
.exc-box .exc-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; font-size: 13px; }
.exc-box p { font-size: 13px; margin: 6px 0 0; }
.exc-box .rem { color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-faint); }
.footer strong { color: var(--text-dim); }
.footer-meta { font-family: var(--mono); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .ribbon { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .fp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ribbon { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 16px; }
}

/* ============ VIEW SWITCHER ============ */
.view-switch { display: inline-flex; gap: 4px; background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 4px; }
.vs-btn { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-dim); background: transparent; border: 0; padding: 7px 13px; border-radius: 7px; transition: .15s; }
.vs-btn:hover { color: var(--text); }
.vs-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 12px rgba(59,130,246,.4); }
.vs-btn svg { opacity: .9; }

/* ============ OVERVIEW VIEW ============ */
.ov-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.ov-grid-2-1 { grid-template-columns: 2fr 1fr; }
.ov-grid-1-2-1 { grid-template-columns: 1fr 1.6fr 1fr; }
.ov-card { display: flex; flex-direction: column; }
.ov-legend { display: flex; align-items: center; gap: 14px; }
.ov-legend .lg { font-size: 11.5px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-blue { background: var(--accent); } .sw-amber { background: var(--warn); }
.ov-pill { font-size: 11px; font-weight: 600; color: var(--accent-2); background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3); padding: 4px 10px; border-radius: 999px; }

/* ---- stacked bar chart ---- */
.ov-bars { position: relative; padding-top: 28px; }
.ov-chart { display: flex; gap: 10px; height: 240px; }
.ov-axis { display: flex; flex-direction: column; justify-content: space-between; width: 34px; flex: none; }
.ov-grid-line { position: relative; height: 0; }
.ov-grid-val { position: absolute; right: 6px; top: -7px; font-size: 10px; font-family: var(--mono); color: var(--text-faint); }
.ov-plot { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 14px;
  background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--line-soft) calc(25% - 1px), var(--line-soft) 25%);
  background-position: bottom; border-bottom: 1px solid var(--line); }
.ov-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; cursor: pointer; outline: none; }
.ov-bar-stack { width: 100%; max-width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.ov-seg { width: 100%; transition: filter .15s, transform .15s; }
.ov-seg.seg-evi { background: linear-gradient(180deg, #60a5fa, var(--accent)); border-radius: 0 0 6px 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.ov-seg.seg-exc { background: linear-gradient(180deg, #fbbf24, var(--warn)); border-radius: 6px 6px 0 0; min-height: 4px; }
.ov-bar-total { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: var(--text); background: var(--card-2); border: 1px solid var(--line-soft); padding: 2px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.ov-bar-col:hover .ov-seg, .ov-bar-col:focus .ov-seg { filter: brightness(1.12); }
.ov-bar-col:hover .ov-bar-total, .ov-bar-col:focus .ov-bar-total { opacity: 1; }
.ov-bar-lab { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); }

/* tooltip */
.ov-tooltip { position: absolute; z-index: 20; transform: translate(-50%, calc(-100% - 12px)); min-width: 190px; background: #0d1424; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5); pointer-events: none; }
.ov-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background: #0d1424; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tip-month { font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 7px; }
.tip-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; font-size: 11.5px; padding: 3px 0; }
.tip-k { color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.tip-v { font-family: var(--mono); font-weight: 700; color: var(--text); }
.tip-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.tip-sw.sw-evi { background: var(--accent); } .tip-sw.sw-exc { background: var(--warn); }
.tip-total { border-top: 1px dashed var(--line-soft); margin-top: 4px; padding-top: 6px; }
.tip-total .tip-k { color: var(--text); font-weight: 600; }

/* donut */
.ov-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.ov-donut { width: 180px; } .ov-donut svg { width: 100%; height: auto; }
.ov-donut-c1 { fill: #fff; font-size: 26px; font-weight: 800; font-family: var(--mono); }
.ov-donut-c2 { fill: var(--text-faint); font-size: 11px; }
.ov-donut-legend, .ov-focus-legend, .ov-top { list-style: none; margin: 0; padding: 0; }
.ov-donut-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; width: 100%; }
.ov-donut-legend li { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.ov-donut-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ov-donut-legend .t { color: var(--text-dim); flex: 1; }
.ov-donut-legend .n { font-family: var(--mono); font-weight: 600; color: var(--text); white-space: nowrap; }
/* Exception-type legend: show % normally, reveal the exact control count on hover/focus */
.ov-threat-item { border-radius: 6px; padding: 2px 6px; margin: -2px -6px; cursor: default;
  transition: background .15s ease; outline: none; }
.ov-threat-item:hover, .ov-threat-item:focus-visible { background: rgba(255, 255, 255, 0.06); }
.ov-threat-item .ov-threat-count { display: none; margin-right: 6px; color: var(--text); }
.ov-threat-item .ov-threat-pct { color: var(--text-faint); }
.ov-threat-item:hover .ov-threat-count,
.ov-threat-item:focus-visible .ov-threat-count { display: inline; }
.ov-threat-item:hover .ov-threat-pct,
.ov-threat-item:focus-visible .ov-threat-pct { color: var(--text-dim); }

/* focus ring */
.ov-focus { display: flex; align-items: center; gap: 14px; }
.ov-focus-legend { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.ov-focus-legend li { display: flex; align-items: center; gap: 10px; }
.ov-focus-legend .sq { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.ov-focus-legend .t { font-size: 12px; color: var(--text-dim); }
.ov-focus-legend .n { font-size: 15px; font-weight: 800; font-family: var(--mono); color: var(--text); }
.ov-ring { width: 150px; flex: none; } .ov-ring svg { width: 100%; height: auto; }

/* coverage map */
.ov-map { position: relative; min-height: 230px; border-radius: 12px; overflow: hidden; background: radial-gradient(900px 400px at 50% 40%, rgba(59,130,246,.1), transparent 70%), var(--card-2); border: 1px solid var(--line-soft); }
.ov-map-bg { position: absolute; inset: 0; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; opacity: .35; }
.ov-map-grid { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 18px; }
.ov-map-node { display: flex; align-items: center; gap: 10px; background: rgba(20,29,53,.7); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.ov-map-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); flex: none; }
.ov-map-info { display: flex; flex-direction: column; }
.ov-map-info .n { font-size: 11.5px; color: var(--text); } .ov-map-info .p { font-size: 11px; font-family: var(--mono); color: var(--text-dim); }

/* top domains */
.ov-top { display: flex; flex-direction: column; gap: 10px; }
.ov-top li { display: flex; align-items: center; gap: 10px; background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.ov-top-badge { width: 34px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.ov-top-name { flex: 1; font-size: 12.5px; color: var(--text); } .ov-top-name small { color: var(--text-faint); margin-left: 4px; }
.ov-top-pct { font-family: var(--mono); font-weight: 700; color: var(--accent-2); }

/* active controls */
.ov-devices { margin-bottom: 16px; }
.ov-search { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); background: var(--card-2); border: 1px solid var(--line-soft); padding: 7px 12px; border-radius: 8px; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ov-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--text-dim); background: var(--card-2); border: 1px solid var(--line-soft); padding: 6px 11px; border-radius: 7px; }
.ov-chip i { width: 7px; height: 7px; border-radius: 50%; }
.ov-chip-ok i { background: var(--good); } .ov-chip-warn i { background: var(--warn); } .ov-chip-crit i { background: var(--crit); }
.ov-chip:hover { border-color: var(--accent); color: var(--text); }

@media (max-width: 1000px) {
  .ov-grid-2-1, .ov-grid-1-2-1 { grid-template-columns: 1fr; }
  .view-switch { display: none; }
}
