/* ============================================================
   TIER 1B — Forensic Intelligence premium polish (CSS only).
   Scoped to #page-flow-explorer. Layers on forensic-intelligence-page.css.
   No JS, listeners, observers, timers, rAF, or runtime changes.
   ============================================================ */

#page-flow-explorer.is-active {
  gap: 16px;
}

/* —— Page header: institutional command band —— */
#page-flow-explorer .page-head {
  padding: 14px 16px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 168, 157, 0.14);
  background:
    linear-gradient(135deg, rgba(11, 23, 26, 0.92) 0%, rgba(7, 17, 20, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 32px -20px rgba(0, 0, 0, 0.78);
}

#page-flow-explorer .page-title {
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(15, 168, 157, 0.1);
}

#page-flow-explorer .page-sub {
  color: rgba(94, 234, 212, 0.72);
  letter-spacing: 0.14em;
}

/* —— Investigation command strip —— */
#page-flow-explorer #fintel-command-strip,
#page-flow-explorer .fintel-command-strip.fe-toolbar {
  border: 1px solid rgba(15, 168, 157, 0.22) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(11, 23, 26, 0.94) 0%, rgba(6, 13, 16, 0.9) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 28px -14px rgba(124, 58, 237, 0.18),
    0 0 32px -16px rgba(15, 168, 157, 0.14) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#page-flow-explorer .fi-trace-trust-strip {
  border-radius: 12px;
  border: 1px solid rgba(15, 168, 157, 0.16);
  background: rgba(7, 17, 20, 0.72);
  padding: 8px 12px;
}

#page-flow-explorer .fi-executive-context,
#page-flow-explorer .fi-panel-layout-tools {
  border-radius: 12px;
  border: 1px solid rgba(15, 168, 157, 0.1);
  background: rgba(7, 17, 20, 0.45);
}

/* —— Glass investigation panels —— */
#page-flow-explorer .panel.flow-explorer-subpanel.forensic-panel,
#page-flow-explorer .flow-explorer-subpanel.forensic-panel {
  background:
    linear-gradient(180deg, rgba(11, 23, 26, 0.9) 0%, rgba(7, 17, 20, 0.84) 100%) !important;
  border: 1px solid rgba(15, 168, 157, 0.14) !important;
  border-radius: 16px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 36px -22px rgba(0, 0, 0, 0.8),
    0 0 22px -14px rgba(15, 168, 157, 0.08) !important;
}

#page-flow-explorer .fi-panel-primary.flow-explorer-subpanel {
  border-color: rgba(15, 168, 157, 0.22) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 40px -20px rgba(0, 0, 0, 0.82),
    0 0 30px -12px rgba(15, 168, 157, 0.14) !important;
}

#page-flow-explorer .panel.flow-explorer-subpanel > .panel-head,
#page-flow-explorer .fi-priority-strip-head.header-row,
#page-flow-explorer .fi-panel-head-strong {
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(15, 168, 157, 0.1);
}

#page-flow-explorer .panel.flow-explorer-subpanel .panel-title,
#page-flow-explorer .advanced-panel-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

#page-flow-explorer .panel.flow-explorer-subpanel .fi-panel-sub,
#page-flow-explorer .advanced-panel-subtitle {
  color: rgba(156, 172, 192, 0.78);
  line-height: 1.45;
}

/* —— Trace graph command center —— */
#page-flow-explorer .flow-explorer-card {
  border-radius: 16px !important;
  border: 1px solid rgba(15, 168, 157, 0.16) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 44px -24px rgba(0, 0, 0, 0.85) !important;
}

#page-flow-explorer .flow-graph-loading {
  border-radius: 12px;
  border: 1px dashed rgba(15, 168, 157, 0.22);
  background: rgba(7, 17, 20, 0.55);
  color: rgba(156, 172, 192, 0.85);
  padding: 14px;
}

/* —— Priority / threat hierarchy cards —— */
#page-flow-explorer .fi-priority-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 168, 157, 0.14);
  background:
    linear-gradient(165deg, rgba(10, 22, 26, 0.88) 0%, rgba(7, 17, 20, 0.8) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#page-flow-explorer .fi-priority-card.fi-priority-sev-high {
  border-color: rgba(248, 113, 113, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 20px -10px rgba(248, 113, 113, 0.2);
}

#page-flow-explorer .fi-priority-card.fi-priority-sev-watch {
  border-color: rgba(245, 158, 11, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 18px -10px rgba(245, 158, 11, 0.14);
}

#page-flow-explorer .fi-priority-card.fi-priority-sev-info {
  border-color: rgba(96, 165, 250, 0.28);
}

#page-flow-explorer .fi-priority-card-head {
  gap: 8px;
}

/* —— Signal / intelligence accent cards —— */
#page-flow-explorer .fi-signal-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 168, 157, 0.12);
  background: rgba(7, 17, 20, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#page-flow-explorer .fi-signal-pill {
  font-weight: 650;
  letter-spacing: 0.06em;
}

/* —— Risk badges: restrained institutional hierarchy —— */
#page-flow-explorer .fi-risk-badge {
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(15, 168, 157, 0.35);
  background: rgba(8, 28, 28, 0.75);
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#page-flow-explorer .fi-risk-badge.fi-risk-critical {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.35) 0%, rgba(8, 20, 20, 0.8) 100%);
  box-shadow: 0 0 14px -8px rgba(248, 113, 113, 0.35);
}

#page-flow-explorer .fi-exp-risk {
  font-weight: 650;
}

/* —— Route / path investigation cards —— */
#page-flow-explorer .fi-path-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 168, 157, 0.14);
  background: rgba(8, 22, 26, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* —— Empty / loading / guidance states (visual only) —— */
#page-flow-explorer .fi-empty-state-card {
  border-radius: 14px;
  border: 1px dashed rgba(15, 168, 157, 0.2);
  background:
    linear-gradient(180deg, rgba(7, 17, 20, 0.55) 0%, rgba(5, 10, 12, 0.45) 100%);
  padding: 16px 18px;
}

#page-flow-explorer .fi-empty-state-card .fi-empty-state,
#page-flow-explorer .forensic-empty-state {
  color: rgba(203, 213, 225, 0.88);
  line-height: 1.55;
}

#page-flow-explorer .fi-empty-state-hint,
#page-flow-explorer .forensic-empty-state--hint {
  color: rgba(148, 163, 184, 0.78);
}

#page-flow-explorer td.forensic-empty-state,
#page-flow-explorer td.fi-panel-empty-msg {
  background: rgba(7, 17, 20, 0.4);
  border-radius: 10px;
}

/* —— Exposure / forensic tables —— */
#page-flow-explorer .flow-explorer-subpanel table thead th {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(156, 172, 192, 0.8);
  background: rgba(15, 168, 157, 0.06);
  border-bottom: 1px solid rgba(15, 168, 157, 0.12);
}

#page-flow-explorer .flow-explorer-subpanel table tbody tr:hover td {
  background: rgba(15, 168, 157, 0.04);
}

/* —— Side rail stack —— */
#page-flow-explorer .flow-explorer-side-stack .flow-explorer-subpanel {
  margin-bottom: 0;
}

#page-flow-explorer .fi-rail-tab--active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px -8px rgba(15, 168, 157, 0.2);
}

/* —— Workflow continuity accent —— */
#page-flow-explorer .fi-workflow-stack {
  border-left-color: rgba(15, 168, 157, 0.22);
}

/* —— Subject detail risk list (visual hierarchy) —— */
#page-flow-explorer #fintel-panel-entity-intelligence .fi-ei-risk-item {
  border-radius: 10px;
  border: 1px solid rgba(15, 168, 157, 0.1);
  background: rgba(7, 17, 20, 0.45);
  padding: 8px 10px;
  margin-bottom: 6px;
}

#page-flow-explorer #fintel-panel-entity-intelligence .fi-ei-risk-sev {
  font-weight: 650;
  letter-spacing: 0.04em;
}

/* Hover polish (desktop, motion-safe) */
@media (hover: hover) and (pointer: fine) {
  #page-flow-explorer .fi-priority-card:hover {
    border-color: rgba(15, 168, 157, 0.28);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 22px -10px rgba(15, 168, 157, 0.12);
  }

  #page-flow-explorer .fi-priority-card.fi-priority-sev-high:hover {
    border-color: rgba(248, 113, 113, 0.48);
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-flow-explorer .fi-priority-card {
    transition: none;
  }
}

/* Mobile: preserve layout, tighten padding only */
@media (max-width: 768px) {
  #page-flow-explorer .page-head {
    padding: 12px 12px 10px;
  }

  #page-flow-explorer #fintel-command-strip,
  #page-flow-explorer .fintel-command-strip.fe-toolbar {
    padding: 12px 12px !important;
  }

  #page-flow-explorer .panel.flow-explorer-subpanel.forensic-panel {
    border-radius: 14px !important;
  }
}
