/* Color system and analysis components. Loaded last so it can refine the base stylesheets.
 *
 * 1. Palette: hue tokens for light and dark themes.
 * 2. Section identity: each top-level section (status, checks, my network, tools, watch) has its own color,
 *    used for the active navigation pill, primary actions, eyebrows and card heading marks.
 * 3. Network categories: one color per network type (residential, mobile, relay, VPN, cloud, …).
 * 4. Components: network verdict, confidence meter, fact labels with source tags, factor pills, list summary.
 */

/* 1. Palette
 *    Light: cool off-white page, white panels, saturated hues (dark enough for 4.5:1 text on white).
 *    Dark: deep navy page and panels, the same hues lightened. */
:root {
  --page:#f3f6fc; --panel:#ffffff; --line:#e2e8f3; --soft:#eef2fa; --ink:#0f172a; --muted:#56607a; --nav:#ffffff; --mapdim:#b7c0d2;
  --red:#dc2626; --green:#15803d; --amber:#b45309; --info:#0369a1;
  --blue:#2563eb; --indigo:#4f46e5; --violet:#7c3aed; --teal:#0f766e; --cyan:#0e7490; --rose:#e11d48; --orange:#c2410c;
  --accent:#4f46e5; --brand-2:#7c3aed;
  --card-shadow:0 1px 2px rgb(15 23 42 / .05), 0 10px 28px -16px rgb(30 41 82 / .22);
}
:root[data-theme="dark"] {
  --page:#0a0f1e; --panel:#111a2e; --line:#243150; --soft:#1a2440; --ink:#e6ebf5; --muted:#9aa6c0; --nav:#0d1426; --mapdim:#334061;
  --red:#f87171; --green:#4ade80; --amber:#fbbf24; --info:#7dd3fc;
  --blue:#60a5fa; --indigo:#a5b4fc; --violet:#c4b5fd; --teal:#2dd4bf; --cyan:#67e8f9; --rose:#fb7185; --orange:#fdba74;
  --accent:#a5b4fc; --brand-2:#c4b5fd;
  --card-shadow:0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -18px rgb(0 0 0 / .6);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --page:#0a0f1e; --panel:#111a2e; --line:#243150; --soft:#1a2440; --ink:#e6ebf5; --muted:#9aa6c0; --nav:#0d1426; --mapdim:#334061;
    --red:#f87171; --green:#4ade80; --amber:#fbbf24; --info:#7dd3fc;
    --blue:#60a5fa; --indigo:#a5b4fc; --violet:#c4b5fd; --teal:#2dd4bf; --cyan:#67e8f9; --rose:#fb7185; --orange:#fdba74;
    --accent:#a5b4fc; --brand-2:#c4b5fd;
    --card-shadow:0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -18px rgb(0 0 0 / .6);
  }
}

/* 2. Section identity */
:root { --section:var(--accent); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E"); }
:root[data-section="status"] { --section:var(--blue); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E"); }
:root[data-section="checks"] { --section:var(--teal); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-4 9.2 2.8 2.8L16.2 9.6'/%3E%3C/svg%3E"); }
:root[data-section="mine"] { --section:var(--violet); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a15 15 0 0 1 20 0M5.5 12.5a10 10 0 0 1 13 0M9 16a5 5 0 0 1 6 0M12 20h.01'/%3E%3C/svg%3E"); }
:root[data-section="tools"] { --section:var(--indigo); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18v3h3l6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4Z'/%3E%3C/svg%3E"); }
:root[data-section="about"] { --section:var(--cyan); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM12 11v6M12 7.5h.01'/%3E%3C/svg%3E"); }
:root[data-section="watch"] { --section:var(--orange); --section-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.8 5.7 6.2.9-4.5 4.4 1 6.2L12 17.3 6.5 20.2l1-6.2L3 9.6l6.2-.9Z'/%3E%3C/svg%3E"); }

body {
  background:
    radial-gradient(ellipse 1100px 460px at 12% -12%, color-mix(in srgb,var(--section) 13%,transparent), transparent 62%),
    radial-gradient(ellipse 900px 480px at 96% -6%, color-mix(in srgb,var(--teal) 9%,transparent), transparent 60%),
    var(--page);
}
.nav-group:has([aria-current]) {
  background:linear-gradient(135deg,var(--section),color-mix(in srgb,var(--section) 70%,var(--violet)));
  color:#fff;
  box-shadow:0 2px 10px color-mix(in srgb,var(--section) 30%,transparent);
}
.shell-sub a[aria-current] { background:color-mix(in srgb,var(--section) 13%,var(--panel)); color:var(--section); font-weight:650; }
#bottomNav a[aria-current] { color:var(--section); }
.eyebrow { color:var(--section); letter-spacing:.01em; }
.primary, #networkView .primary {
  background:linear-gradient(135deg,var(--section),color-mix(in srgb,var(--section) 72%,var(--violet)));
  color:#fff; border-color:transparent; box-shadow:0 1px 2px color-mix(in srgb,var(--section) 30%,transparent);
}
.primary:hover:enabled, #networkView .primary:hover:enabled {
  background:linear-gradient(135deg,color-mix(in srgb,var(--section) 85%,#000),color-mix(in srgb,var(--section) 60%,var(--violet)));
  color:#fff;
}
:root[data-theme="dark"] .primary, :root[data-theme="dark"] #networkView .primary { color:#0b1020; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] :is(.primary, #networkView .primary) { color:#0b1020; } }
/* Card headings across every view get a colored mark (the status view already varies it per card). */
main :is(.reading-head h2, .reading-head h3) { display:flex; align-items:center; gap:7px; }
main :not(#cloudView) :is(.reading-head h2, .reading-head h3)::before {
  content:""; flex:none; width:3px; height:12px; border-radius:2px; background:var(--card-color,var(--section));
}
.reading { border-top:2px solid color-mix(in srgb,var(--card-color,var(--section)) 22%,var(--line)); }
#cloudView .reading { border-top-color:color-mix(in srgb,var(--cloud-section-color,var(--section)) 30%,var(--line)); }
.score-card { --card-color:var(--green); }
.assessment-grid .reading:nth-child(2) { --card-color:var(--blue); }
.assessment-grid .reading:nth-child(3) { --card-color:var(--rose); }
.connection-card { --card-color:var(--cyan); }

/* 3. Network categories */
[data-category] { --cat:var(--muted); }
[data-category="residential"] { --cat:var(--green); }
[data-category="isp"] { --cat:var(--teal); }
[data-category="mobile"] { --cat:var(--cyan); }
[data-category="cdn"] { --cat:var(--blue); }
[data-category="relay"] { --cat:var(--indigo); }
[data-category="vpn"] { --cat:var(--violet); }
[data-category="tor"] { --cat:var(--rose); }
[data-category="cloud"] { --cat:var(--orange); }
[data-category="hosting"] { --cat:var(--amber); }
[data-category="crawler"] { --cat:var(--orange); }
[data-category="education"], [data-category="enterprise"] { --cat:var(--blue); }

/* 4a. Network verdict */
.network-verdict {
  grid-column:1 / -1; margin:6px 0 10px; padding:11px 13px 10px; border-radius:10px;
  border:1px solid color-mix(in srgb,var(--cat) 28%,var(--line)); border-inline-start:4px solid var(--cat);
  background:color-mix(in srgb,var(--cat) 7%,var(--panel));
}
.verdict-pending { color:var(--muted); font-size:.82rem; }
.network-verdict[data-category="pending"] { --cat:var(--line); }
.network-verdict[data-category="pending"] .verdict-pending::before {
  content:""; display:inline-block; width:8px; height:8px; margin-inline-end:7px; border-radius:50%;
  background:var(--muted); animation:pending-pulse 1s ease-in-out infinite alternate;
}
.verdict-head { display:flex; flex-wrap:wrap; align-items:center; gap:6px 9px; }
.category-chip {
  display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:999px; font-size:.76rem; font-weight:700;
  color:var(--cat); background:color-mix(in srgb,var(--cat) 15%,var(--panel)); border:1px solid color-mix(in srgb,var(--cat) 30%,transparent);
}
.category-chip::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--cat); }
.verdict-name { font-size:.95rem; color:var(--ink); }
.confidence { display:inline-flex; align-items:center; gap:3px; margin-inline-start:auto; color:var(--muted); }
.confidence i { width:6px; height:6px; border-radius:50%; background:color-mix(in srgb,var(--cat) 22%,var(--line)); }
.confidence i.on { background:var(--cat); }
.confidence small { margin-inline-start:4px; font-size:.72rem; font-weight:600; }
.verdict-analysis { margin:7px 0 0; color:var(--ink); font-size:.86rem; line-height:1.55; }
.verdict-impact { margin:5px 0 0; color:var(--muted); font-size:.8rem; line-height:1.5; }
.verdict-impact::before { content:"→ "; color:var(--cat); font-weight:700; }
.verdict-evidence { margin-top:6px; font-size:.78rem; color:var(--muted); }
.verdict-evidence summary { cursor:pointer; color:var(--cat); font-weight:600; width:fit-content; }
.verdict-evidence ul { margin:5px 0 0; padding-inline-start:18px; }
.verdict-evidence li { margin:2px 0; overflow-wrap:anywhere; }

/* 4b. Facts: quiet labels with the source as a tag; strong values */
:is(.detail-metrics, .egress-metadata) dt { color:var(--muted); font-size:.74rem; font-weight:500; display:flex; flex-wrap:wrap; align-items:center; gap:3px 6px; }
.source-tag {
  font-size:.66rem; font-weight:600; line-height:1.5; padding:0 5px; border-radius:4px; letter-spacing:.01em;
  color:color-mix(in srgb,var(--muted) 85%,var(--ink)); background:var(--soft); border:1px solid var(--line);
}
:is(.detail-metrics, .egress-metadata) dd { color:var(--ink); font-weight:600; font-size:.9rem; }
:is(.detail-metrics, .egress-metadata) dd.mono, :is(.detail-metrics, .egress-metadata) dd .mono { font-family:var(--mono); font-weight:560; font-size:.84rem; }
:is(.detail-metrics, .egress-metadata) dd.fact-missing { color:var(--muted); font-weight:400; }
.egress-profile { grid-column:1 / -1; }
.egress-metadata > div { padding:6px 0; border-top:1px dashed color-mix(in srgb,var(--line) 80%,transparent); }

/* 4c. Score factors */
.factor-pill { display:inline-block; padding:1px 8px; border-radius:999px; font-size:.76rem; font-weight:650; white-space:nowrap; }
.factor-pill.pass { color:var(--green); background:color-mix(in srgb,var(--green) 12%,var(--panel)); }
.factor-pill.fail { color:var(--red); background:color-mix(in srgb,var(--red) 12%,var(--panel)); }
.factor-pill.skip { color:var(--muted); background:var(--soft); font-weight:500; }
.score-card .detail-metrics > div { align-items:center; padding:5px 0; border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent); }
.score-card .detail-metrics > div:last-child { border-bottom:0; }

/* 4d. Public list summary */
.list-summary { margin-top:10px; display:grid; gap:7px; }
.list-summary-line { margin:0; padding:9px 11px; border-radius:9px; font-weight:650; font-size:.86rem; }
.list-summary-line.pass { color:var(--green); background:color-mix(in srgb,var(--green) 10%,var(--panel)); }
.list-summary-line.fail { color:var(--red); background:color-mix(in srgb,var(--red) 10%,var(--panel)); }
.list-summary-line.skip { color:var(--muted); background:var(--soft); font-weight:500; }
.list-summary details summary { cursor:pointer; color:var(--muted); font-size:.8rem; width:fit-content; }
.list-summary details .detail-metrics { margin-top:6px; }
.list-summary-note { margin:0; color:var(--muted); font-size:.78rem; }

/* Metric tiles pick up the section color instead of plain gray. */
#overviewPane .egress-metrics > div, .probe-stats > div {
  background:color-mix(in srgb,var(--section) 6%,var(--panel)); border-color:color-mix(in srgb,var(--section) 20%,var(--line));
}
#overviewPane .egress-metrics dd, .probe-stats strong { color:color-mix(in srgb,var(--section) 70%,var(--ink)); }

/* Incidents: resolved incidents are compact rows until opened; long-running incidents use amber. */
.service-status.long-running { color:var(--amber); background:color-mix(in srgb,var(--amber) 14%,var(--panel)); }
.service-status.long-running::before { background:var(--amber); }
.incident-item[data-compact] :is(.incident-card-facts, .incident-card-excerpt, .incident-expand) { display:none; }
.incident-item[data-compact] .incident-card-actions { display:none; }
.incident-item[data-compact] summary { padding-block:10px; }
.incident-item[data-compact] .incident-card-title { font-size:.92rem; font-weight:600; }
.incident-item[data-compact]:hover { border-color:color-mix(in srgb,var(--section) 35%,var(--line)); }
.incident-more { display:block; margin:14px auto 4px; min-width:220px; }

/* Maintenance: long notices live in their own strip; calendar text stays readable. */
.maint-long { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; padding:10px 12px; border:1px dashed var(--line);
  border-radius:12px; background:color-mix(in srgb,var(--panel) 70%,transparent); }
.maint-long-title { font-size:.8rem; color:var(--muted); margin-inline-end:4px; }
.maint-long-item { display:inline-flex; align-items:baseline; gap:6px; max-width:100%; padding:5px 10px; border-radius:999px; text-decoration:none;
  color:var(--ink); font-size:.8rem; background:var(--soft); border:1px solid var(--line); }
.maint-long-item span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:340px; }
.maint-long-item small { color:var(--muted); white-space:nowrap; }
.maint-calendar-item { font-size:.8rem; }
.maint-calendar-item small, .maint-day-head small { font-size:.74rem; }

/* AI status: cards keep their natural height; one column on phones. */
#aiStatusGrid { align-items:start; }
@media (max-width:640px) { #aiStatusGrid { grid-template-columns:minmax(0,1fr); } }

/* Leak page: one action for all three self-checks. */
.probe-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:4px 0 12px; }
.probe-toolbar p { margin:0; color:var(--muted); font-size:.84rem; }
/* Device details: on wide screens two columns keep labels and values close together. */
@media (min-width:900px) {
  .device-card .detail-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:36px; }
  .device-card .detail-metrics > div:nth-last-child(2):nth-child(odd) { border-bottom:0; }
}

/* 5. Surfaces: cards lift off the page with a soft shadow and a clear colored top edge. */
.reading, #networkView .card, #networkView .probe-card { box-shadow:var(--card-shadow); border-color:var(--line); }
.reading { border-top:3px solid color-mix(in srgb,var(--card-color,var(--section)) 65%,var(--panel)); }
#cloudView .reading { border-top-color:color-mix(in srgb,var(--cloud-section-color,var(--section)) 70%,var(--panel)); }
main :not(#cloudView) :is(.reading-head h2, .reading-head h3)::before,
#cloudView :is(.reading-head h2, #mapTitle)::before { width:8px; height:8px; border-radius:3px; }

/* 6. Section header: icon tile in the section color, title, and a tinted band behind the intro. */
main .section-intro { position:relative; }
/* Every page title (by id; the region title has its own region dot). */
:is(#cloudTitle,#incidentsTitle,#maintTitle,#aiTitle,#observeTitle,#watchTitle,#aboutTitle,#mineTitle,#networkTitle,#splitTitle,#toolsTitle,#notfoundTitle,#sharedTitle) { display:flex; align-items:center; gap:12px; }
:is(#cloudTitle,#incidentsTitle,#maintTitle,#aiTitle,#observeTitle,#watchTitle,#aboutTitle,#mineTitle,#networkTitle,#splitTitle,#toolsTitle,#notfoundTitle,#sharedTitle)::before {
  content:""; flex:none; width:40px; height:40px; border-radius:12px;
  background:var(--section-icon) center/22px no-repeat, linear-gradient(135deg,var(--section),color-mix(in srgb,var(--section) 60%,var(--brand-2)));
  box-shadow:0 6px 16px -6px color-mix(in srgb,var(--section) 60%,transparent);
}
.eyebrow { text-transform:none; font-weight:700; }

/* 7. Colored icons */
/* Main navigation and bottom tab bar: each section keeps its own color. */
.nav-group:not(:has([aria-current])) a[data-nav="status"] { color:var(--blue); }
.nav-group:not(:has([aria-current])) a[data-nav="checks"] { color:var(--teal); }
.nav-group:not(:has([aria-current])) a[data-nav="mine"] { color:var(--violet); }
.nav-group:not(:has([aria-current])) a[data-nav="tools"] { color:var(--indigo); }
#bottomNav a[href="#cloud"] svg { color:var(--blue); }
#bottomNav a[href="#network"] svg { color:var(--teal); }
#bottomNav a[href="#mine/exit"] svg { color:var(--violet); }
#bottomNav a[href="#tools"] svg { color:var(--indigo); }
#bottomNav a[href="#watch"] svg { color:var(--orange); }
#bottomNav a:not([aria-current]) svg { opacity:.75; }
#bottomNav a[aria-current] { font-weight:750; }
/* Header buttons. */
#openSearch svg { color:var(--indigo); }
.shell-button svg[class], .shell-button use { color:inherit; }
button:has(> svg use[href="#shell-watch"]) svg { color:var(--amber); }
#openSettings svg { color:var(--muted); }
.site-header .brand svg { color:var(--indigo); }
/* Tools menu: a colored icon tile per tool (replaces the monochrome images). */
:is(.tool-menu, .shell-sub) a[href^="#tools/"] { display:inline-flex; align-items:center; gap:7px; }
.tool-menu a img { display:none; }
:is(.tool-menu, .shell-sub) a[href^="#tools/"]::before {
  content:""; flex:none; width:16px; height:16px; background:var(--tool-color,var(--section));
  -webkit-mask:var(--tool-icon) center/contain no-repeat; mask:var(--tool-icon) center/contain no-repeat;
}
.tool-menu a[aria-current] { color:var(--tool-color,var(--section)); background:color-mix(in srgb,var(--tool-color,var(--section)) 10%,var(--panel));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tool-color,var(--section)) 30%,transparent); }
:is(.tool-menu, .shell-sub) a[href="#tools/ip"] { --tool-color:var(--blue); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.3-6-11a6 6 0 0 1 12 0c0 5.7-6 11-6 11Zm0-8.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/dns"] { --tool-color:var(--indigo); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5 9-5ZM3 12l9 5 9-5M3 16l9 5 9-5'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/gdns"] { --tool-color:var(--cyan); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM3 12h18M12 3a14 14 0 0 1 0 18 14 14 0 0 1 0-18'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/whois"] { --tool-color:var(--violet); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6ZM14 3v5h5M9 12h7M9 16h7'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/bgp"] { --tool-color:var(--rose); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM18 9a9 9 0 0 1-9 9'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/gping"] { --tool-color:var(--teal); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M4.9 4.9a10 10 0 0 0 0 14.2M19.1 19.1a10 10 0 0 0 0-14.2'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/trace"] { --tool-color:var(--green); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 15V9a4 4 0 0 1 4-4h6M18 9v6a4 4 0 0 1-4 4H8'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/mtr"] { --tool-color:var(--teal); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-8M21 20H3'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/gtrace"] { --tool-color:var(--green); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM5 22a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM19 22a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 5v6l-6 8M12 11l6 8'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/port"] { --tool-color:var(--orange); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2v6M15 2v6M6 8h12v4a6 6 0 0 1-12 0V8ZM12 18v4'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/scan"] { --tool-color:var(--amber); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7V3h4M17 3h4v4M21 17v4h-4M7 21H3v-4M7 12h10'/%3E%3C/svg%3E"); }
:is(.tool-menu, .shell-sub) a[href="#tools/http"] { --tool-color:var(--violet); --tool-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 9-4 3 4 3M16 9l4 3-4 3M13.5 6l-3 12'/%3E%3C/svg%3E"); }

/* 8. Status colors: one vivid, consistent set in both modes. */
.service-status.operational { color:var(--green); background:color-mix(in srgb,var(--green) 13%,var(--panel)); }
.service-status.degraded { color:var(--red); background:color-mix(in srgb,var(--red) 12%,var(--panel)); }
.service-status.unknown { color:var(--muted); background:var(--soft); }
.active-total strong, .live-stats dd, .region-stats strong { font-variant-numeric:tabular-nums; }
.live-stats dd { color:var(--section); }

/* 9. Compact incident rows keep the key facts on one line (duration, region, services). */
.incident-compact-meta { display:none; color:var(--muted); font-size:.8rem; margin-top:3px; }
.incident-item[data-compact] .incident-compact-meta { display:block; }
/* Sub-navigation tool links carry an icon; keep the row on one line on desktop. */
.shell-sub a[href^="#tools/"] { gap:5px; padding-inline:7px; }
.shell-sub a[href^="#tools/"]::before { width:14px; height:14px; }
.shell-sub .nav-group-label { padding-inline:4px 2px; }

/* Selected toggles and segments use the section color instead of black. */
.settings-segments input:checked + span, #badgeStyles [aria-pressed=true], #serviceCategories [aria-pressed=true] {
  background:var(--section); color:#fff; border-color:transparent;
}
:root[data-theme="dark"] :is(.settings-segments input:checked + span, #badgeStyles [aria-pressed=true], #serviceCategories [aria-pressed=true]) { color:#0b1020; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] :is(.settings-segments input:checked + span, #badgeStyles [aria-pressed=true], #serviceCategories [aria-pressed=true]) { color:#0b1020; }
}

/* High-risk netblocks (Spamhaus DROP) and stated locations in verdicts. */
[data-category="blocklisted"] { --cat:var(--red); }
.verdict-location { margin:6px 0 0; font-size:.82rem; font-weight:650; color:color-mix(in srgb,var(--cat) 75%,var(--ink)); }
.verdict-location::before { content:"⌖ "; }
