/* ═══════════════════════════════════════════════════════════════════════════
   DNS Panopticon — Domain Explorer
   Page-specific styles for the Domain Explorer tool (public/index.html).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── View states ──────────────────────────────────────────────────────────── */
.view { display: none; flex-direction: column; }
.view.active { display: flex; }

/* ════════════════════════════════════════════════════════════════════════════
   LANDING VIEW
   ════════════════════════════════════════════════════════════════════════════ */
/* Shared template classes now own landing geometry. */

/* The .view rule sets flex-direction: column for results/scanning views, but
   .landing-zone is designed for flex-direction: row (justify-content centers
   horizontally; align-items: flex-start pins content to the top under
   padding-top). Override here so the landing view matches recon/analyzer. */
#view-landing {
  flex-direction: row;
}

/* Panopticon eye */




/* Scan form */
.scan-form { width: 100%; }

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

#domain-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--txt);
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 15px;
  transition: border-color var(--t-fast);
  outline: none;
}

#domain-input::placeholder { color: var(--txt-4); }
#domain-input:focus { border-color: var(--primary); }
#btn-scan { flex-shrink: 0; font-size: 14px; padding: 11px 22px; }

/* Mode pills */
.mode-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-desc {
  font-size: 12px;
  color: var(--txt-4);
  margin: 0;
  min-height: 16px;
}

/* ════════════════════════════════════════════════════════════════════════════
   SCANNING VIEW
   ════════════════════════════════════════════════════════════════════════════ */
#view-scanning {
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.scanning-inner {
  /* Shared scanning presentation is defined in components.css. */
}

/* ════════════════════════════════════════════════════════════════════════════
   ERROR VIEW
   ════════════════════════════════════════════════════════════════════════════ */
#view-error {
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.error-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  max-width: 380px;
}

.error-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--red) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 22px;
}

.error-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 8px;
}

.error-msg {
  font-size: 14px;
  color: var(--txt-3);
  line-height: 1.5;
  margin-bottom: 24px;
}

.error-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.error-debug {
  margin-top: 20px;
  text-align: left;
  width: 100%;
}

.error-debug summary {
  font-size: 12px;
  color: var(--txt-3);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.error-debug summary::-webkit-details-marker { display: none; }
.error-debug summary::before {
  content: '▶';
  font-size: 9px;
  transition: transform 0.15s;
  display: inline-block;
}
.error-debug[open] summary::before { transform: rotate(90deg); }

.error-debug pre {
  margin-top: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--txt) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--txt) 10%, transparent);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--txt-3);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow-y: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESULTS VIEW
   ════════════════════════════════════════════════════════════════════════════ */
#view-results {
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
}

/* Score bar */
#score-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 52px;
}

#score-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.result-domain {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  color: var(--txt);
}

.cache-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 15%, transparent);
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#score-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.score-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.score-link:hover {
  background: var(--surface2);
}

.grade-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.score-number {
  font-size: 20px;
  font-weight: 800;
  color: var(--txt);
}

/* Score hover tooltip */
.score-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
  text-align: left;
}
.score-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.score-link:hover .score-tooltip,
.score-link.tooltip-open .score-tooltip {
  visibility: visible;
  opacity: 1;
}
.score-tooltip-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-2);
  margin: 0 0 8px;
  line-height: 1.4;
}
.score-tooltip-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score-tooltip-cats li {
  font-size: 12px;
  color: var(--txt-3);
}

#score-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.scan-meta { font-size: 11px; color: var(--txt-4); }

/* Results body */
#results-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Sankey panel */
#sankey-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#sankey-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

/* Groupby segmented control (sankey toolbar) */
.groupby-pills {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.groupby-pill {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  color: var(--txt-3);
  border: none;
  border-radius: 0;
  cursor: pointer;
  line-height: 1.4;
}
.groupby-pill + .groupby-pill {
  border-left: 1.5px solid var(--border);
}
.groupby-pill:hover { background: var(--surface2); color: var(--txt-2); }
.groupby-pill.active {
  background: var(--primary);
  color: #fff;
}

.variance-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}

#sankey-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#sankey-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Node tooltip */
.node-tooltip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 12px;
  color: var(--txt-2);
  pointer-events: none;
  max-width: 260px;
  box-shadow: 0 4px 16px color-mix(in srgb, #000 18%, transparent);
  z-index: 100;
  line-height: 1.5;
}

.node-tooltip strong { color: var(--txt); font-weight: 700; display: block; margin-bottom: 3px; }
.node-tooltip .tt-meta { color: var(--txt-4); font-size: 11px; }
.node-tooltip .tt-mono { font-family: ui-monospace, monospace; word-break: break-all; }
.node-tooltip .tt-meta--summary { margin-top: 3px; }
.node-tooltip .tt-meta--severity.is-critical { color: #dc2626; }
.node-tooltip .tt-meta--severity.is-high { color: #ea580c; }
.node-tooltip .tt-meta--severity.is-medium { color: #d97706; }
.node-tooltip .tt-meta--severity.is-low { color: #65a30d; }
.node-tooltip .tt-meta--severity.is-informational { color: #64748b; }

/* Findings panel */
#findings-panel {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

#findings-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
}

.findings-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-4);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 999px;
}

.severity-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sev-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--txt-4);
}
.sev-pill:hover { color: var(--txt-2); border-color: var(--txt-3); }
.sev-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sev-pill.sev-critical.active { background: #dc2626; border-color: #dc2626; }
.sev-pill.sev-high.active    { background: #ea580c; border-color: #ea580c; }
.sev-pill.sev-medium.active  { background: #d97706; border-color: #d97706; }
.sev-pill.sev-low.active     { background: #65a30d; border-color: #65a30d; }
.sev-pill.sev-info.active    { background: #64748b; border-color: #64748b; }

/* Findings list */
.findings-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.finding-card {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.finding-card:last-child { border-bottom: none; }
.finding-card:hover { background: var(--surface2); }
.finding-card.expanded { background: var(--surface2); }

.finding-top {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.finding-sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  background: #64748b;
}

.finding-sev-dot.is-critical { background: #dc2626; }
.finding-sev-dot.is-high { background: #ea580c; }
.finding-sev-dot.is-medium { background: #d97706; }
.finding-sev-dot.is-low { background: #65a30d; }
.finding-sev-dot.is-informational { background: #64748b; }

.finding-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.4;
  flex: 1;
}

.finding-help-link {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--txt-3);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.finding-help-link:hover {
  background: var(--surface2);
  border-color: var(--primary);
  color: var(--primary);
}

.finding-pass-icon {
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--txt-4);
}

.finding-pass-icon.is-pass { color: var(--green); }
.finding-pass-icon.is-fail { color: var(--red); }
.finding-pass-icon.is-unknown { color: var(--txt-4); }

.finding-summary {
  font-size: 11px;
  color: var(--txt-3);
  line-height: 1.5;
  margin-top: 4px;
  padding-left: 15px;
}

.finding-detail {
  display: none;
  font-size: 11px;
  color: var(--txt-3);
  line-height: 1.5;
  margin-top: 6px;
  padding: 7px 9px;
  background: var(--bg);
  border-radius: 5px;
  border: 1px solid var(--border);
}

.finding-card.expanded .finding-detail { display: block; }

.finding-affected {
  margin-top: 5px;
  font-size: 10px;
  color: var(--txt-4);
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
}

/* Tools section */
#tools-section {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  max-height: 220px;
  overflow-y: auto;
}

#tools-section .panel-title-row {
  padding: 8px 12px 4px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tools-list { padding: 4px 0; }

.tool-item {
  display: flex;
  flex-direction: column;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  gap: 2px;
}
.tool-item:last-child { border-bottom: none; }

.tool-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  flex: 1;
}
.tool-name:hover { text-decoration: underline; }

.tool-cat-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface2);
  color: var(--txt-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-desc {
  font-size: 11px;
  color: var(--txt-4);
  line-height: 1.4;
}

/* ── No-results message ───────────────────────────────────────────────────── */
.no-findings-msg {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--txt-4);
  text-align: center;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════════════
   HELP MODAL
   ════════════════════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay[hidden] { display: none; }

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #000 50%, transparent);
}

.overlay-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px color-mix(in srgb, #000 25%, transparent);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.overlay-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt);
}

.overlay-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--txt-3);
  padding: 0 4px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.overlay-close:hover { color: var(--txt); background: var(--surface2); }

.overlay-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--txt-2);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overlay-body h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--txt-4);
  margin-bottom: -6px;
}

.overlay-body dl { display: flex; flex-direction: column; gap: 6px; }
.overlay-body dt { font-weight: 700; color: var(--txt); }
.overlay-body dd { margin-left: 12px; color: var(--txt-3); }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #findings-panel {
    width: 100%;
    max-height: 45vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  #results-body { flex-direction: column; }
  #view-results {
    height: auto;
    min-height: calc(100vh - var(--nav-height));
    overflow: auto;
  }
  #sankey-container { min-height: 260px; }
  #score-center { gap: 6px; }
}

/* ── Sankey SVG styles ────────────────────────────────────────────────────── */
.sankey-node rect {
  cursor: pointer;
  rx: 3;
  transition: opacity 0.15s;
}
.sankey-node rect:hover { opacity: 0.85; }
.sankey-node.selected rect { stroke: var(--txt); stroke-width: 2; }

.sankey-link {
  fill: none;
  transition: opacity 0.15s;
}
.sankey-link:hover { opacity: 0.75 !important; }

.sankey-label {
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 10px;
  fill: var(--txt-3);
  pointer-events: none;
  dominant-baseline: middle;
}

.sankey-label.label-domain {
  font-size: 11px;
  font-weight: 700;
  fill: var(--txt);
}

.sankey-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 13px;
  color: var(--txt-4);
}

/* ── Explorer-specific footer override (compact for app pages) ────────────── */
#site-footer.explorer-footer {
  padding: 10px 16px;
}

.landing-feature-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.landing-feature-card {
  display: grid;
  gap: 6px;
  text-decoration: none;
  text-align: left;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}

.landing-feature-card:hover {
  border-color: var(--border-hi);
  background: var(--surface2);
  transform: translateY(-1px);
}

.landing-feature-card-primary {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.landing-feature-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 700;
}

.landing-feature-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
}

.landing-feature-copy {
  font-size: 13px;
  color: var(--txt-3);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .landing-feature-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════════
   DETAIL PANEL (Sankey node click-through)
   ════════════════════════════════════════════════════════════════════════════ */

/* Both sub-panels live inside #findings-panel and flex to fill it */
#findings-content,
#detail-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#findings-content[hidden],
#detail-content[hidden] { display: none; }

#detail-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-title-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.detail-section {
  margin-bottom: 14px;
}

.detail-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.detail-hostname-label {
  font-size: 11px;
  color: var(--txt-4);
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  margin-bottom: 8px;
  word-break: break-all;
}

/* Record type colour badges */
.detail-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: 0.03em;
}
.detail-type-badge.type-a     { background: #0d9488; }
.detail-type-badge.type-aaaa  { background: #0d9488; }
.detail-type-badge.type-txt   { background: #0891b2; }
.detail-type-badge.type-mx    { background: #7c3aed; }
.detail-type-badge.type-cname { background: #4338ca; }
.detail-type-badge.type-ns    { background: #1d4ed8; }
.detail-type-badge.type-soa   { background: #475569; }
.detail-type-badge.type-caa   { background: #b45309; }
.detail-type-badge.type-ds    { background: #0f766e; }
.detail-type-badge.type-dnskey { background: #0f766e; }

.detail-rawdata {
  font-size: 11px;
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  word-break: break-all;
  color: var(--txt-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 7px 9px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.detail-ttl {
  font-size: 10px;
  color: var(--txt-4);
  margin-top: 2px;
  margin-bottom: 8px;
}

/* Policy status badge (DMARC / SPF) */
.detail-policy-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.detail-policy-badge .policy-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.detail-policy-badge .policy-sub  { font-size: 10px; font-weight: 400; color: inherit; opacity: 0.8; display: block; margin-top: 2px; }

.detail-policy-badge.policy-none       { color: #d97706; border-color: #d97706; background: color-mix(in srgb, #d97706 8%, transparent); }
.detail-policy-badge.policy-quarantine { color: #0891b2; border-color: #0891b2; background: color-mix(in srgb, #0891b2 8%, transparent); }
.detail-policy-badge.policy-reject     { color: #16a34a; border-color: #16a34a; background: color-mix(in srgb, #16a34a 8%, transparent); }
.detail-policy-badge.policy-pass       { color: #16a34a; border-color: #16a34a; background: color-mix(in srgb, #16a34a 8%, transparent); }
.detail-policy-badge.policy-info       { color: #64748b; border-color: var(--border); background: var(--surface2); }

/* Tag key-value tables (DMARC, MX, etc.) */
.detail-tags-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 4px;
}

.detail-tags-table .tag-row + .tag-row .tag-key,
.detail-tags-table .tag-row + .tag-row .tag-val,
.detail-tags-table .tag-row + .tag-row .tag-name {
  border-top: 1px solid var(--border);
}

.tag-key {
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  color: var(--txt-3);
  white-space: nowrap;
  padding: 4px 6px 4px 0;
  vertical-align: top;
  font-size: 10px;
}
.tag-val {
  font-family: 'Inter', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  color: var(--txt);
  font-weight: 600;
  word-break: break-all;
  padding: 4px 6px;
  vertical-align: top;
  font-size: 10px;
}
.tag-name {
  color: var(--txt-3);
  padding: 4px 0 4px 4px;
  vertical-align: top;
  font-size: 10px;
}
.tag-desc-row td {
  padding: 0 0 5px 0;
  color: var(--txt-4);
  font-size: 10px;
  line-height: 1.4;
  border-top: none !important;
}

/* Tooltip "click to explore" hint */
.node-tooltip .tt-explore {
  color: var(--primary);
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
}

/* IP enrichment slot */
.ip-enrich-slot { margin-top: 10px; }

.ip-enrich-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--txt-4);
  font-size: 11px;
  padding: 6px 0;
}

.ip-enrich-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ip-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes ip-spin { to { transform: rotate(360deg); } }

.ip-enrich-error {
  color: var(--txt-4);
  font-size: 11px;
  padding: 6px 0;
  font-style: italic;
}

.ip-enrich-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.ip-enrich-card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt-4);
  padding: 5px 9px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* "Explore domain" button */
.btn-explore-domain {
  margin-top: 10px;
  background: var(--surface2);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--t-fast), border-color var(--t-fast);
  font-family: inherit;
}
.btn-explore-domain:hover {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface2));
  border-color: var(--primary);
}

/* Sankey node hover — smooth opacity transition */
.sankey-node rect { transition: opacity 0.12s ease; }
