/* VulnOps Dashboard — dark "VulnOps console" theme. */
:root {
  --bg: #060b16;        /* darker plain blue */
  --bg-soft: #0e1218;
  --panel: #14181f;     /* darker gray boxes */
  --panel-2: #1c212a;
  --border: #2a2f3a;
  --border-strong: #39404d;
  --text: #e7eef0;
  --muted: #8198a0;
  --muted-2: #5f7783;

  --accent: #46c8af;
  --accent-deep: #2fa890;
  --accent-2: #e89b3c;

  --exploit: #e23d52;
  --exploit-soft: #ff7a88;
  --partial: #e89b3c;
  --notrepro: #2bbf9e;
  --filtered: #8497a0;
  --repo-node: #4fa3b5;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.3);

  --font-head: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

h1, h2, h3, h4, .brand-name { font-family: var(--font-head); letter-spacing: 0.2px; }
.hidden { display: none; }

.fig {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  padding: 30px;
  box-shadow: var(--shadow);
}
.login-fig { margin-bottom: 14px; }
.login-card .brand { margin-bottom: 8px; }
.login-tagline { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.8px; text-transform: uppercase; }
.login-form input { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 0; padding: 12px 13px; color: var(--text); font-size: 14px; font-family: var(--font-body); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70, 200, 175, 0.18); }
.login-error { background: rgba(226, 61, 82, 0.14); border: 1px solid rgba(226, 61, 82, 0.45); color: #ffb3bb; border-radius: 0; padding: 10px 12px; font-size: 13px; }
.login-hint { color: var(--muted-2); font-size: 12px; text-align: center; margin: 4px 0 0; font-family: var(--font-mono); }
.login-foot { text-align: center; color: var(--muted-2); font-size: 12px; margin-top: 18px; font-family: var(--font-mono); }

.btn-primary {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  color: #042019;
  border: none;
  border-radius: 0;
  padding: 13px 14px;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-head);
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 24px; color: var(--accent); filter: drop-shadow(0 0 10px rgba(70, 200, 175, 0.5)); }
.brand-logo { height: 34px; width: auto; display: block; flex: 0 0 auto; }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-name .accent { color: var(--accent); }
.vulnops { color: #86efac; }
.brand-sub { font-size: 10px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.9px; text-transform: uppercase; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 13, 21, 0.8);
  backdrop-filter: blur(9px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar > .brand { flex: 0 0 auto; }
.topbar-search { flex: 1 1 auto; max-width: 520px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 13px; color: var(--muted); font-size: 16px; pointer-events: none; }
.topbar-search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 9px 13px 9px 34px;
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70, 200, 175, 0.15); }
.topbar-right { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); width: 34px; height: 34px; border-radius: 0; cursor: pointer; font-size: 15px; transition: color 0.15s, border-color 0.15s; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.last-login { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: 4px; cursor: default; }
.last-login .ll-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); font-family: var(--font-mono); }
.last-login .ll-time { font-size: 12px; color: var(--text); }
@media (max-width: 900px) { .last-login { display: none; } }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #042019; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 0; padding: 7px 12px; font-size: 13px; font-family: var(--font-body); cursor: pointer; text-decoration: none; transition: border-color 0.15s, color 0.15s; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Layout ---------- */
.container { max-width: 1340px; margin: 0 auto; padding: 22px 24px 8px; display: flex; flex-direction: column; gap: 20px; }
.layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
.insights { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { font-size: 16px; margin: 0; font-weight: 700; }
.panel-head h3 { font-size: 14px; margin: 4px 0 0; font-weight: 700; }
.panel-sub { color: var(--muted); font-size: 12.5px; margin: 0; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 18px 20px;
  position: relative;
  min-height: 96px;
}
.stat-card.exploited { border-color: rgba(226, 61, 82, 0.55); box-shadow: inset 0 0 44px rgba(226, 61, 82, 0.12), 0 0 22px rgba(226, 61, 82, 0.10); }
.stat-card.sources { border-color: rgba(70, 200, 175, 0.55); box-shadow: inset 0 0 44px rgba(70, 200, 175, 0.10), 0 0 22px rgba(70, 200, 175, 0.08); }
.stat-num { font-family: var(--font-head); font-size: 42px; font-weight: 700; line-height: 1; }
.stat-card.exploited .stat-num { color: var(--exploit-soft); }
.stat-card.sources .stat-num { color: var(--accent); }
.stat-cap { color: var(--muted); margin-top: 9px; font-size: 14px; }
.stat-extra { position: absolute; top: 18px; right: 18px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

/* Skeleton loader (KPI numbers while refreshing) */
.skel { display: inline-block; border-radius: 0; background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 37%, rgba(255,255,255,0.05) 63%); background-size: 400% 100%; animation: skel-shimmer 1.3s ease-in-out infinite; }
.skel-num { width: 92px; height: 38px; vertical-align: middle; }
@keyframes skel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.hdot { width: 8px; height: 8px; border-radius: 50%; }
.hdot.amber { background: var(--accent-2); }
.hdot.green { background: var(--accent); }
.src-marks { gap: 5px; }
.src-marks .src-mark { width: 18px; height: 18px; font-size: 9px; }

.src-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; font-size: 14px; border: 1px solid var(--border); border-radius: 0; font-family: var(--font-mono); font-weight: 600; overflow: hidden; flex: 0 0 auto; }
.src-mark.small { width: 26px; height: 26px; font-size: 11px; }
.src-mark.big { width: 46px; height: 46px; font-size: 16px; }
.src-mark img { width: 100%; height: 100%; object-fit: contain; padding: 15%; display: block; }
.src-mark.has-img { background: rgba(255, 255, 255, 0.06); border-color: var(--border); }

/* ---------- Management sidebar ---------- */
.management { padding: 0; overflow: hidden; align-self: start; }
.mgmt-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.mgmt-head h2 { font-size: 15px; margin: 0; }
.kebab { color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.mgmt-section { padding: 14px 16px; }
.mgmt-section + .mgmt-section { border-top: 1px solid var(--border); }
.mgmt-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mgmt-title { font-size: 13px; color: var(--text); font-weight: 600; }
.gh-box img { filter: invert(1); mix-blend-mode: lighten; }
.mgmt-title b { color: var(--muted); font-weight: 400; margin-left: 2px; }
.pill-btn { background: rgba(70, 200, 175, 0.12); border: 1px solid rgba(70, 200, 175, 0.4); color: var(--accent); font-size: 11px; padding: 3px 10px; border-radius: 0; cursor: pointer; font-family: var(--font-mono); transition: background 0.15s; }
.pill-btn:hover { background: rgba(70, 200, 175, 0.2); }
.mgmt-list { display: flex; flex-direction: column; gap: 1px; max-height: 260px; overflow-y: auto; }
.mgmt-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 0; cursor: pointer; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); transition: background 0.12s; }
.mgmt-item:hover { background: var(--panel-2); }
.mgmt-item .mi-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.mi-dot2 { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; opacity: 0.75; }
.mi-go { margin-left: auto; color: var(--muted-2); font-weight: 700; transition: color 0.15s, transform 0.15s; flex: 0 0 auto; }
.mgmt-item:hover .mi-go { color: var(--accent); transform: translateX(2px); }
.mi-new { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.5px; color: #042019; background: var(--accent); border-radius: 0; padding: 1px 4px; font-weight: 700; }
.mgmt-item .src-mark { width: 22px; height: 22px; font-size: 10px; flex: 0 0 auto; }
.big-btn { width: 100%; margin-top: 12px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); color: #042019; border: none; border-radius: 0; padding: 9px; font-weight: 700; font-size: 13px; font-family: var(--font-head); cursor: pointer; transition: filter 0.15s; }
.big-btn:hover { filter: brightness(1.08); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-family: var(--font-head); font-size: 14px; font-weight: 600; padding: 9px 14px; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.tab-pane { display: flex; flex-direction: column; gap: 16px; }
.tab-pane.hidden { display: none; }

/* ---------- Funnel ---------- */
.funnel-bar { display: flex; align-items: center; justify-content: space-between; }
.check { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.sankey { width: 100%; height: 440px; }

/* ---------- Detailed findings ---------- */
.detailed-head { align-items: center; }
.table-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-controls select { background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); border-radius: 0; padding: 7px 10px; font-size: 13px; font-family: var(--font-body); }
.count-pill { background: var(--panel-2); border: 1px solid var(--border); border-radius: 0; padding: 4px 11px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.count-pill b { color: var(--text); }
.table-wrap { overflow-x: auto; }
.issues-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.issues-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; font-family: var(--font-mono); padding: 10px 12px; border-bottom: 1px solid var(--border-strong); position: sticky; top: 0; background: var(--panel); }
.issues-table th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.issues-table th[data-sort]:hover { color: var(--text); }
.issues-table th[data-sort]::after { content: " ↕"; opacity: 0.35; font-size: 9px; }
.issues-table th.sorted-asc::after { content: " ▲"; opacity: 1; color: var(--accent); }
.issues-table th.sorted-desc::after { content: " ▼"; opacity: 1; color: var(--accent); }
.issues-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.issues-table tbody tr[data-id] { cursor: pointer; transition: background 0.12s; }
.issues-table tbody tr[data-id]:hover { background: rgba(70, 200, 175, 0.06); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 0; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; font-family: var(--font-mono); }
.tag.exploited { background: rgba(226, 61, 82, 0.16); color: #ff8a97; border-color: rgba(226, 61, 82, 0.45); }
.tag.partial { background: rgba(232, 155, 60, 0.16); color: #f3bd7c; border-color: rgba(232, 155, 60, 0.42); }
.tag.notrepro { background: rgba(43, 191, 158, 0.16); color: #79dcc9; border-color: rgba(43, 191, 158, 0.42); }
.tag.filtered { background: rgba(132, 151, 160, 0.16); color: #aab6bd; border-color: rgba(132, 151, 160, 0.42); }

.sev { display: inline-block; padding: 2px 8px; border-radius: 0; font-size: 11px; font-weight: 600; text-transform: capitalize; border: 1px solid transparent; font-family: var(--font-mono); }
.sev-critical { background: rgba(226, 61, 82, 0.18); color: #ff8a97; border-color: rgba(226, 61, 82, 0.45); }
.sev-high { background: rgba(232, 120, 60, 0.16); color: #ffae86; border-color: rgba(232, 120, 60, 0.42); }
.sev-medium { background: rgba(232, 170, 60, 0.15); color: #f3cf85; border-color: rgba(232, 170, 60, 0.4); }
.sev-low { background: rgba(70, 200, 175, 0.14); color: #8fd9cc; border-color: rgba(70, 200, 175, 0.4); }

.title-cell { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-badge { display: inline-block; padding: 2px 8px; border-radius: 0; font-size: 11px; font-weight: 500; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); text-transform: capitalize; font-family: var(--font-mono); }
.empty-row td { text-align: center; color: var(--muted); padding: 24px; font-family: var(--font-mono); }

/* collapsible category groups */
.group-row { cursor: pointer; }
.group-row td { padding: 13px 12px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--filtered); background: var(--panel-2); transition: filter 0.12s; }
.group-row:hover td { filter: brightness(1.15); }
.group-row.exploited td { background: rgba(226, 61, 82, 0.12); border-left-color: var(--exploit); }
.group-row.partial td { background: rgba(232, 155, 60, 0.11); border-left-color: var(--partial); }
.group-row.notrepro td { background: rgba(43, 191, 158, 0.11); border-left-color: var(--notrepro); }
.group-row.filtered td { background: rgba(132, 151, 160, 0.10); border-left-color: var(--filtered); }
.group-chev { display: inline-block; width: 14px; color: var(--muted); font-size: 11px; }
.group-stat { color: var(--muted); font-size: 12.5px; margin-left: 10px; font-family: var(--font-mono); }
.group-stat b { color: var(--text); }
.more-row td { text-align: center; padding: 10px 12px; color: var(--accent); font-family: var(--font-mono); font-size: 12.5px; cursor: pointer; border-bottom: 1px solid var(--border); }
.more-row:hover td { background: var(--panel-2); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.pagination .page-info { color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); }

/* ---------- High-priority table ---------- */
#hp-panel { border-top: 3px solid rgba(226, 61, 82, 0.5); }
.hp-sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.ai-spark { color: var(--accent); font-size: 18px; filter: drop-shadow(0 0 8px rgba(70, 200, 175, 0.6)); }
.hp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hp-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; font-family: var(--font-mono); padding: 9px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.hp-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hp-table tbody tr[data-id] { cursor: pointer; }
.hp-table tbody tr:hover { background: rgba(70, 200, 175, 0.05); }
.sev-ico { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; font-size: 11px; }
.sev-ico.critical { background: rgba(226, 61, 82, 0.2); color: #ff8a97; }
.sev-ico.high { background: rgba(232, 120, 60, 0.2); color: #ffae86; }
.hp-name { color: var(--text); }
.hp-src { display: inline-flex; align-items: center; gap: 7px; }
.src-mini { width: 20px; height: 20px; font-size: 9px; }
.hp-date { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.hp-actions { display: flex; gap: 7px; }
.btn-remediate { background: rgba(70, 200, 175, 0.14); border: 1px solid rgba(70, 200, 175, 0.45); color: var(--accent); border-radius: 0; padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: var(--font-body); transition: background 0.15s; }
.btn-remediate:hover { background: rgba(70, 200, 175, 0.24); }
.btn-details { background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text); border-radius: 0; padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: var(--font-body); }
.btn-details:hover { border-color: var(--accent); color: var(--accent); }

/* Auto-remediation: status pill shown in place of the manual button when on */
.auto-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(70, 200, 175, 0.14); border: 1px solid rgba(70, 200, 175, 0.45); color: var(--accent); border-radius: 0; padding: 5px 11px; font-size: 12px; font-family: var(--font-mono); white-space: nowrap; }
.auto-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: auto-pulse 1.4s ease-in-out infinite; }
@keyframes auto-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 38px; height: 20px; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 999px; transition: background 0.18s, border-color 0.18s; flex: 0 0 auto; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--muted); border-radius: 50%; transition: transform 0.18s, background 0.18s; }
.switch input:checked + .switch-track { background: rgba(70, 200, 175, 0.3); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 12.5px; color: var(--text); font-weight: 500; }

/* ---------- Source insights (sub-panels) ---------- */
.sub-panel { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 0; padding: 16px 18px; }
.source-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.source-kpi { background: var(--panel-2); border: 1px solid var(--border); border-radius: 0; padding: 15px 16px; }
.sk-head { display: flex; align-items: center; gap: 9px; }
.sk-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.sk-noise { margin-left: auto; font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 0; border: 1px solid transparent; }
.sk-noise.good { color: #79dcc9; background: rgba(43, 191, 158, 0.14); border-color: rgba(43, 191, 158, 0.4); }
.sk-noise.warn { color: #f3bd7c; background: rgba(232, 155, 60, 0.14); border-color: rgba(232, 155, 60, 0.4); }
.sk-noise.bad { color: #ff8a97; background: rgba(226, 61, 82, 0.14); border-color: rgba(226, 61, 82, 0.4); }
.sk-total { font-family: var(--font-head); font-size: 25px; font-weight: 700; margin: 11px 0 9px; }
.sk-total span { font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--muted); }
.sk-bar { display: flex; height: 8px; border-radius: 0; overflow: hidden; background: var(--bg); }
.sk-bar span { display: block; height: 100%; }
.sk-meta { margin-top: 9px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.source-chart { width: 100%; height: 300px; }
.source-mark { width: 38px; height: 38px; font-size: 14px; }
.source-mark.small { width: 26px; height: 26px; font-size: 11px; }
.source-mark.big { width: 46px; height: 46px; font-size: 16px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.legend .item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.legend .dot { width: 11px; height: 11px; border-radius: 0; }

/* source ranking (merged with per-source stats) */
.rank-list { display: flex; flex-direction: column; gap: 12px; }
.src-rank { background: var(--panel-2); border: 1px solid var(--border); border-radius: 0; padding: 14px 16px; }
.src-rank.top { border-color: var(--accent); background: rgba(70, 200, 175, 0.06); }
.sr-head { display: flex; align-items: center; gap: 10px; }
.sr-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex: 0 1 auto; }
.sr-head .sk-noise { margin-left: auto; }
.sr-score { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.src-rank .rank-num { flex: 0 0 auto; }
.sr-statsrow { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 9px; }
.sr-total { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.sr-total span { font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--muted); }
.sr-meta { font-size: 12px; color: var(--muted); font-family: var(--font-mono); text-align: right; }
.see-warnings { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; background: rgba(70, 200, 175, 0.12); border: 1px solid rgba(70, 200, 175, 0.4); color: var(--accent); border-radius: 0; padding: 3px 10px; font-size: 12px; font-family: var(--font-body); cursor: pointer; transition: background 0.15s, gap 0.15s; }
.see-warnings:hover { background: rgba(70, 200, 175, 0.22); gap: 8px; }
.see-warnings .sw-arrow { font-size: 13px; line-height: 1; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 0; }
.rank-row.top { border-color: var(--accent); background: rgba(70, 200, 175, 0.07); }
.rank-num { flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 0; }
.rank-row.top .rank-num { color: #042019; background: var(--accent); border-color: var(--accent); }
.rank-name { flex: 0 0 140px; font-family: var(--font-head); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rank-badge { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.6px; color: #042019; background: var(--accent); border-radius: 0; padding: 1px 6px; font-weight: 700; }
.rank-bar { flex: 1 1 auto; height: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 0; min-width: 60px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--accent); }
.rank-metrics { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.rank-metrics .rank-uniq b { color: var(--text); }
.rank-score { color: var(--text); }
@media (max-width: 720px) { .rank-row { flex-wrap: wrap; } .rank-bar { order: 5; flex-basis: 100%; } }

/* Cross-source overlap (Euler/Venn) */
.dup-wrap { display: flex; flex-direction: column; }
.dup-venn { width: 100%; height: 420px; display: flex; align-items: center; justify-content: center; }
.dup-venn svg { max-width: 100%; overflow: visible; }
.dup-venn .venn-circle path { cursor: pointer; transition: fill-opacity .12s ease, stroke-width .12s ease; }
.dup-venn .venn-intersection path { cursor: pointer; }
.dup-empty { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }
.dup-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 4px 2px; border-top: 1px solid var(--border); margin-top: 6px; }
.dup-leg-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); }
.dup-leg-dot { width: 11px; height: 11px; border-radius: 0; display: inline-block; }
.dup-leg-meta { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.venn-tip {
  position: absolute; pointer-events: none; z-index: 999;
  background: #0b2536; border: 1px solid #1d3346; color: #e7eef0;
  padding: 8px 11px; font-size: 12.5px; font-family: var(--font-body);
  line-height: 1.45; max-width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.venn-tip b { font-weight: 600; }
.venn-tip .vt-row { color: #cfe0e6; margin-top: 2px; font-family: var(--font-mono); font-size: 12px; }
.venn-tip .vt-sub { color: #8fa3ad; margin-top: 1px; font-size: 11.5px; }

.seg { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 4px; }
.seg-btn { background: transparent; border: none; color: var(--muted); padding: 6px 14px; border-radius: 0; font-size: 12.5px; font-family: var(--font-body); cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg-btn.active { background: var(--accent); color: #042019; }

/* ---------- Drawer (centered detail modal) ---------- */
.drawer {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 95vw);
  max-height: 88vh;
  background: #161b24;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  box-shadow: var(--shadow);
  z-index: 40;
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop-in 0.18s ease;
}
.drawer.hidden { display: none; }
.drawer.sevbg-critical { background: linear-gradient(180deg, rgba(226, 61, 82, 0.18), transparent 45%), #161b24; border-top-color: #e23d52; }
.drawer.sevbg-high { background: linear-gradient(180deg, rgba(232, 120, 60, 0.18), transparent 45%), #161b24; border-top-color: #e8783c; }
.drawer.sevbg-medium { background: linear-gradient(180deg, rgba(232, 170, 60, 0.16), transparent 45%), #161b24; border-top-color: #e8aa3c; }
.drawer.sevbg-low { background: linear-gradient(180deg, rgba(43, 191, 158, 0.16), transparent 45%), #161b24; border-top-color: #2bbf9e; }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.drawer-body h4 { margin: 18px 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); font-family: var(--font-mono); }
.drawer-body p { margin: 0 0 6px; line-height: 1.55; font-size: 13.5px; color: var(--text); }
.drawer-body pre { background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 12px; overflow-x: auto; font-size: 12px; line-height: 1.5; white-space: pre-wrap; color: #cfe2de; font-family: var(--font-mono); }

/* Rendered markdown (issue description + triage verdict) */
.drawer-body .md { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.drawer-body .md-box { background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 14px 16px; margin: 2px 0 4px; }
.drawer-body .md-box > p:last-child { margin-bottom: 0; }
.drawer-body .md > *:first-child { margin-top: 0; }
.drawer-body .md > *:last-child { margin-bottom: 0; }
.drawer-body .md p { margin: 0 0 10px; line-height: 1.6; font-size: 13.5px; }
.drawer-body .md h1, .drawer-body .md h2, .drawer-body .md h3, .drawer-body .md h4, .drawer-body .md h5, .drawer-body .md h6 {
  margin: 14px 0 6px; font-family: var(--font-heading); text-transform: none; letter-spacing: 0;
  color: var(--text); font-weight: 700; line-height: 1.3;
}
.drawer-body .md h1 { font-size: 16px; } .drawer-body .md h2 { font-size: 15px; }
.drawer-body .md h3 { font-size: 14px; } .drawer-body .md h4 { font-size: 13.5px; color: var(--text); }
.drawer-body .md ul, .drawer-body .md ol { margin: 0 0 10px; padding-left: 22px; }
.drawer-body .md li { margin: 2px 0; line-height: 1.55; }
.drawer-body .md li > p { margin: 0; }
.drawer-body .md code { font-family: var(--font-mono); font-size: 12px; background: rgba(70, 200, 175, 0.12); border: 1px solid rgba(70, 200, 175, 0.22); border-radius: 0; padding: 1px 5px; color: #9be8d6; }
.drawer-body .md pre { margin: 0 0 10px; }
.drawer-body .md pre code { display: block; background: none; border: none; padding: 0; color: #cfe2de; font-size: 12px; }
.drawer-body .md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.drawer-body .md strong { color: #fff; font-weight: 700; }
.drawer-body .md em { font-style: italic; color: #dfe8ea; }
.drawer-body .md blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--accent); color: #c2d2d4; background: rgba(70, 200, 175, 0.06); }
.drawer-body .md table { border-collapse: collapse; margin: 0 0 10px; font-size: 12.5px; }
.drawer-body .md th, .drawer-body .md td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.drawer-body .md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.drawer-note { background: rgba(132, 151, 160, 0.14); border: 1px solid rgba(132, 151, 160, 0.4); color: #aab6bd; border-radius: 0; padding: 10px 12px; font-size: 13px; margin-bottom: 6px; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(2, 6, 11, 0.8); backdrop-filter: blur(3px); z-index: 30; }
.drawer-scrim.hidden { display: none; }
.repo-ico { color: var(--accent); }
.repo-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 14px 16px; margin: 14px 0 6px; }
.repo-meta .rm-wide { grid-column: 1 / -1; }
.repo-meta > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rm-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted-2); }
.rm-val { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.repo-av-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.repo-av-head h4 { margin: 0; }
.muted-note { color: var(--muted); font-size: 13px; }
.md { font-size: 13.5px; line-height: 1.6; color: var(--text); margin-top: 6px; }
.md .md-title { font-size: 16px; margin: 4px 0 10px; }
.md h4 { font-family: var(--font-head); text-transform: none; letter-spacing: normal; color: var(--text); font-size: 14px; margin: 16px 0 6px; }
.md h5 { font-family: var(--font-head); text-transform: none; letter-spacing: normal; color: var(--accent); font-size: 13px; margin: 12px 0 4px; }
.md p { margin: 0 0 10px; }
.md ul { margin: 0 0 12px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md code { font-family: var(--font-mono); font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 1px 5px; }
.md strong { color: var(--text); font-weight: 700; }

/* ---------- Modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(3, 8, 14, 0.7); backdrop-filter: blur(3px); z-index: 50; }
.modal-scrim.hidden, .modal.hidden { display: none; }
.modal { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 88vh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 0; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.modal-head h3 { margin: 0; font-size: 16px; display: flex; align-items: baseline; gap: 10px; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.6px; text-transform: uppercase; }
.field em { color: var(--muted-2); font-style: normal; text-transform: none; }
.field input, .field textarea { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 0; padding: 11px 13px; color: var(--text); font-size: 14px; font-family: var(--font-body); letter-spacing: normal; text-transform: none; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.field textarea { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 180px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70, 200, 175, 0.16); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-error { background: rgba(226, 61, 82, 0.14); border: 1px solid rgba(226, 61, 82, 0.4); color: #ffb3bb; border-radius: 0; padding: 9px 12px; font-size: 12.5px; margin-top: 4px; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .source-grid { grid-template-columns: repeat(2, 1fr); } }
.source-card { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; cursor: pointer; color: var(--text); transition: border-color 0.15s, background 0.15s; }
.source-card:hover { border-color: var(--accent); background: var(--panel-2); }
.source-name { font-size: 12.5px; font-family: var(--font-body); }
.back-link { background: none; border: none; color: var(--accent); font-family: var(--font-mono); font-size: 12px; cursor: pointer; padding: 0; margin-bottom: 14px; }
.connect-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.connect-name { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.seg.modal, .field { letter-spacing: 0.6px; }

/* segmented seg for modal provider toggle */
.seg-btn { font-family: var(--font-body); }

.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(4, 32, 25, 0.4); border-top-color: #042019; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chips (modal/source picker leftovers) */
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 4px 11px; font-size: 12px; color: var(--text); font-family: var(--font-mono); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-new { font-size: 9px; text-transform: uppercase; color: #042019; background: var(--accent); border-radius: 0; padding: 1px 5px; font-weight: 700; }

/* ---------- Toast ---------- */
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 60; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--accent); border-left: 3px solid var(--accent); border-radius: 0; padding: 13px 16px; font-size: 13.5px; color: var(--text); box-shadow: var(--shadow); max-width: 360px; animation: toast-in 0.22s ease; }
.toast.hidden { display: none; }
.toast-tick { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #042019; font-size: 12px; font-weight: 800; margin-right: 6px; vertical-align: -3px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 22px; background: radial-gradient(700px 240px at 90% -40%, rgba(70, 200, 175, 0.10), transparent 60%), linear-gradient(180deg, #0b1622, #060b12); border-top: 1px solid var(--border); }
.footer-inner { max-width: 1340px; margin: 0 auto; padding: 24px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.footer-logo { height: 54px; width: auto; opacity: 0.95; flex: 0 0 auto; }
.footer-text { display: flex; flex-direction: column; gap: 4px; }
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #ffffff; }
.footer-brand span { color: #8fb3ab; font-weight: 400; }
.footer-tagline { color: #8198a0; font-size: 13px; max-width: 460px; }
.footer-meta { margin-left: auto; }
.footer-copy { color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; }
@media (max-width: 720px) { .footer-meta { margin-left: 0; } }
