:root {
  color-scheme: dark;
  --bg: #05080d;
  --shell: #07111c;
  --panel: #091827;
  --panel-2: #0b2033;
  --line: #163047;
  --line-strong: #214968;
  --ink: #edf6ff;
  --muted: #8ea3b9;
  --soft: #c5d4e4;
  --accent: #2f93ff;
  --accent-2: #19c6b2;
  --success: #67d06a;
  --warning: #ffab38;
  --risk: #ef4444;
  --purple: #8b5cf6;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #05080d 0%, #08131f 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.35rem;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 10px;
  font-size: 0.94rem;
}

button,
.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(47, 147, 255, 0.52);
  border-radius: 6px;
  padding: 0 16px;
  background: linear-gradient(180deg, #1267cf, #0e4fa8);
  color: white;
  box-shadow: 0 0 0 1px rgba(47, 147, 255, 0.18) inset;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  border-color: rgba(86, 169, 255, 0.82);
  background: linear-gradient(180deg, #1878eb, #115bbd);
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.secondary,
.secondary-action {
  border-color: var(--line-strong);
  background: rgba(9, 24, 39, 0.92);
  color: var(--soft);
}

.secondary:hover,
.secondary-action:hover {
  background: rgba(20, 45, 68, 0.95);
}

.danger {
  border-color: rgba(239, 68, 68, 0.58);
  background: linear-gradient(180deg, rgba(185, 28, 28, 0.96), rgba(127, 29, 29, 0.92));
}

.danger:hover {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.98), rgba(153, 27, 27, 0.94));
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(3, 11, 20, 0.64);
  color: var(--ink);
  font: inherit;
  outline: none;
}

input {
  min-height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 220px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: rgba(47, 147, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(47, 147, 255, 0.14);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
  width: min(1868px, calc(100vw - 44px));
  min-height: calc(100vh - 48px);
  margin: 22px auto;
}

.sidebar {
  position: sticky;
  top: 22px;
  display: grid;
  min-height: calc(100vh - 48px);
  align-content: start;
  gap: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(12, 31, 50, 0.96), rgba(7, 17, 28, 0.96)),
    var(--shell);
  box-shadow: var(--shadow);
  padding: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.46rem;
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: #9bd0ff;
  font-size: 0.72rem;
  font-weight: 950;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.side-nav a {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 16px;
  color: var(--soft);
  font-size: 1.02rem;
  font-weight: 780;
  text-decoration: none;
}

.side-nav a::before {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(197, 212, 228, 0.62);
  border-radius: 6px;
  color: #9bd0ff;
  font-size: 0.72rem;
  font-weight: 900;
  content: "";
}

.side-nav a:nth-child(1)::before {
  content: "+";
}

.side-nav a:nth-child(2)::before {
  content: "□";
}

.side-nav a:nth-child(3)::before {
  content: "↗";
}

.side-nav a:nth-child(4)::before {
  content: "○";
}

.side-nav a:nth-child(5)::before {
  content: "!";
}

.side-nav a:nth-child(6)::before {
  content: "⚙";
}

.side-nav a:hover,
.side-nav a.active {
  border-color: rgba(47, 147, 255, 0.42);
  background: linear-gradient(90deg, rgba(47, 147, 255, 0.38), rgba(47, 147, 255, 0.09));
  color: var(--ink);
}

.side-status {
  display: grid;
  gap: 15px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: 22px;
}

.side-status span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--soft);
  font-size: 0.94rem;
  font-weight: 700;
}

.side-status span::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 18px rgba(103, 208, 106, 0.8);
  content: "";
}

.investigator-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 22px;
}

.investigator-card > span {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(142, 163, 185, 0.52);
  border-radius: 999px;
  background: rgba(47, 147, 255, 0.16);
}

.investigator-card > span::before {
  color: var(--soft);
  font-size: 1.2rem;
  content: "○";
}

.investigator-card strong {
  display: block;
  font-size: 0.96rem;
}

.investigator-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.workspace {
  min-width: 0;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.admin-shell,
.demo-shell {
  width: auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
}

.top-runtime {
  grid-column: 1 / -1;
  margin-top: -10px;
  font-size: 0.74rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.runtime-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-topbar .button-link,
.dashboard-topbar #run-async-demo {
  display: none;
}

.dashboard-topbar button {
  min-width: 160px;
  min-height: 54px;
  font-size: 1rem;
}

.case-strip {
  display: grid;
  grid-template-columns: 1.65fr repeat(4, minmax(108px, 0.55fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 14px;
}

.dashboard-case-header {
  grid-template-columns: 1.45fr 0.72fr 0.72fr 0.95fr 0;
  align-items: center;
  overflow: visible;
  border: 0;
  background: transparent;
  margin-bottom: 0;
}

.case-strip div {
  min-width: 0;
  padding: 14px 16px;
  background: rgba(7, 17, 28, 0.78);
}

.dashboard-case-header div {
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 0 28px;
}

.dashboard-case-header div:first-child {
  border-left: 0;
  padding-left: 0;
}

.dashboard-case-header .audit-header-cell {
  display: none;
}

.case-strip span,
.metric span,
.summary-item span,
.campaign-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.case-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.32rem;
  line-height: 1.15;
}

.dashboard-case-header #case-id {
  color: white;
  font-size: 2.32rem;
  font-weight: 820;
  letter-spacing: 0;
}

.dashboard-case-header #priority {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid rgba(239, 68, 68, 0.78);
  border-radius: 7px;
  padding: 0 18px;
  background: rgba(127, 29, 29, 0.24);
  color: white;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-case-header #priority::before {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 10px;
  background: var(--risk);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.85);
  content: "";
}

.dashboard-case-header #risk-score {
  display: inline;
  font-size: 2.42rem;
}

.dashboard-case-header strong em {
  color: var(--muted);
  font-size: 1.08rem;
  font-style: normal;
}

.dashboard-case-header #case-status {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-radius: 7px;
  padding: 0 14px;
  background: rgba(47, 147, 255, 0.2);
  color: #3fb7ff;
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
}

#risk-score {
  color: var(--risk);
}

#case-status {
  color: var(--accent);
}

#priority {
  color: var(--warning);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 29, 47, 0.92), rgba(7, 17, 28, 0.94)),
    var(--panel);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  padding: 18px;
}

.progress-panel {
  margin-bottom: 20px;
  padding: 22px 24px;
}

.progress-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 28px 2px;
}

.progress-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.progress-lines line {
  stroke: rgba(80, 169, 203, 0.66);
  stroke-linecap: round;
  stroke-width: 2;
}

.progress-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  min-width: 0;
  flex: 1 1 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
}

.progress-step span {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  margin-bottom: 12px;
  background: rgba(11, 32, 51, 0.9);
}

.progress-step span::after {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
}

.progress-step.completed span {
  border-color: rgba(103, 208, 106, 0.75);
  background: rgba(22, 101, 52, 0.48);
}

.progress-step.completed span::after {
  background: var(--success);
}

.progress-step.planned span {
  border-color: rgba(255, 171, 56, 0.64);
}

.progress-step.planned span::after {
  background: var(--warning);
}

.progress-step strong {
  display: block;
  overflow-wrap: anywhere;
  max-width: 140px;
  font-size: 0.96rem;
  line-height: 1.18;
}

.progress-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  gap: 28px;
  align-items: start;
}

.main-column,
.right-rail,
.stack {
  display: grid;
  gap: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wide {
  grid-column: span 2;
}

.right-rail {
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding-right: 2px;
}

.live-activity-panel {
  min-height: 610px;
  padding: 0;
}

.live-activity-panel h2,
.approval-panel h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 20px 24px;
}

.live-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(25, 198, 178, 0.14);
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: none;
}

.live-pill::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 7px;
  background: var(--accent-2);
  content: "";
}

.live-activity-panel .stack {
  position: relative;
  gap: 0;
  padding: 18px 24px 18px 82px;
}

.live-activity-panel .stack::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 54px;
  width: 2px;
  background: rgba(47, 147, 255, 0.14);
  content: "";
}

.live-activity-panel .item {
  position: relative;
  border-top: 1px solid rgba(22, 48, 71, 0.75);
  border-left: 0;
  padding: 18px 0 18px 0;
}

.live-activity-panel .item:first-child {
  border-top: 0;
}

.live-activity-panel .item::before {
  position: absolute;
  top: 20px;
  left: -46px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: rgba(47, 147, 255, 0.25);
  color: #9bd0ff;
  content: "•";
}

.live-activity-panel .item:nth-child(1)::before {
  background: rgba(103, 208, 106, 0.26);
  color: var(--success);
}

.live-activity-panel .item:nth-child(2)::before,
.live-activity-panel .item:nth-child(5)::before,
.live-activity-panel .item:nth-child(6)::before {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.live-activity-panel .item strong {
  font-size: 0.98rem;
}

.live-activity-panel .item p {
  font-size: 0.86rem;
}

.approval-panel {
  padding: 0;
}

.approval-panel h2 {
  color: var(--warning);
}

.approval-panel .approval {
  border: 0;
  border-radius: 0 0 8px 8px;
  background: transparent;
  padding: 22px 24px;
}

.item {
  border-left: 3px solid var(--accent-2);
  padding: 2px 0 2px 12px;
}

.item strong {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: normal;
}

.item p,
.muted-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: normal;
}

.timeline {
  display: grid;
  gap: 12px;
}

.event {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.event:first-child {
  border-top: 0;
  padding-top: 0;
}

.event time {
  color: var(--muted);
  font-size: 0.8rem;
}

.approval {
  border: 1px solid rgba(255, 171, 56, 0.36);
  border-radius: 8px;
  padding: 14px;
  background: rgba(94, 58, 16, 0.2);
}

.approval strong {
  color: var(--warning);
}

.federated,
.federated-section,
.campaign-detection,
.scenario-output {
  display: grid;
  gap: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.metric,
.summary-item,
.campaign-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(2, 8, 14, 0.28);
  padding: 12px;
}

.metric strong,
.summary-item strong,
.campaign-metrics strong {
  display: block;
  overflow-wrap: break-word;
  word-break: normal;
}

.privacy-metric {
  border-color: rgba(25, 198, 178, 0.4);
  background: rgba(20, 83, 78, 0.22);
}

.privacy-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.privacy-list div {
  min-width: 0;
  border-left: 3px solid var(--accent-2);
  padding-left: 10px;
}

.privacy-list strong {
  display: block;
  margin-bottom: 4px;
}

.privacy-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.local-evidence {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advanced-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-details summary {
  cursor: pointer;
  color: var(--soft);
  font-weight: 800;
}

.advanced-details .privacy-list {
  margin-top: 12px;
}

.armor-callout {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(2, 8, 14, 0.32);
}

.armor-callout.blocked {
  border-color: rgba(239, 68, 68, 0.44);
  background: rgba(127, 29, 29, 0.24);
}

.armor-callout strong {
  color: var(--risk);
}

.network-graph {
  min-height: 460px;
}

.network-graph-stage {
  position: relative;
  min-height: 520px;
}

.network-graph-viewport {
  position: relative;
  width: 100%;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(47, 147, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 147, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(47, 147, 255, 0.06) 1px, transparent 1px),
    #06101b;
  background-size: 42px 42px;
  cursor: grab;
  touch-action: none;
}

.network-graph-viewport:active {
  cursor: grabbing;
}

.network-graph-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.network-graph-viewport.loading::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  content: "Loading 3D graph";
  font-weight: 800;
}

.graph-selection {
  position: absolute;
  z-index: 4;
  left: 18px;
  bottom: 18px;
  display: grid;
  align-content: start;
  gap: 6px;
  width: min(280px, calc(100% - 220px));
  min-width: 0;
  border: 1px solid rgba(47, 147, 255, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(4, 15, 26, 0.78);
  backdrop-filter: blur(8px);
}

.graph-selection span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.graph-selection strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.graph-selection p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.graph-legend {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 28px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 12px 22px;
  align-items: center;
  margin-top: 0;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.graph-reset {
  min-height: 32px;
  padding: 0 10px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.trigger {
  background: var(--risk);
}

.legend-dot.related {
  background: var(--accent);
}

.legend-dot.entity {
  background: var(--purple);
}

.fraud-map {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid rgba(47, 147, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 147, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(47, 147, 255, 0.035) 1px, transparent 1px),
    #06101b;
  background-size: 44px 44px;
}

.fraud-map::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(47, 147, 255, 0.06) 48%, transparent 100%);
  pointer-events: none;
  content: "";
}

.fraud-map-legend {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 28px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 12px 22px;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.fraud-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot.account {
  background: #2f93ff;
}

.legend-dot.device {
  background: #67d06a;
}

.legend-dot.merchant {
  background: #ffab38;
}

.legend-dot.exchange {
  background: #8b5cf6;
}

.legend-line {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 2px solid rgba(197, 212, 228, 0.5);
}

.legend-line.shared {
  border-top-style: dashed;
}

.fraud-map-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.fraud-map-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.map-line {
  stroke: rgba(197, 212, 228, 0.42);
  stroke-linecap: round;
  stroke-width: 2.3;
}

.map-line.shared {
  stroke-dasharray: 5 7;
  stroke: rgba(142, 163, 185, 0.58);
}

.map-node {
  cursor: pointer;
  outline: none;
}

.map-node-glow {
  fill: rgba(47, 147, 255, 0.14);
}

.map-node-bubble {
  fill: rgba(14, 79, 168, 0.78);
  stroke: #2f93ff;
  stroke-width: 3;
}

.map-node.device .map-node-glow {
  fill: rgba(103, 208, 106, 0.13);
}

.map-node.device .map-node-bubble {
  fill: rgba(22, 101, 52, 0.78);
  stroke: #67d06a;
}

.map-node.merchant .map-node-glow {
  fill: rgba(255, 171, 56, 0.14);
}

.map-node.merchant .map-node-bubble {
  fill: rgba(146, 87, 13, 0.78);
  stroke: #ffab38;
}

.map-node.exchange .map-node-glow {
  fill: rgba(139, 92, 246, 0.15);
}

.map-node.exchange .map-node-bubble {
  fill: rgba(76, 29, 149, 0.78);
  stroke: #8b5cf6;
}

.map-icon {
  fill: none;
  stroke: #c8e2ff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.map-icon.filled {
  fill: #c8e2ff;
  stroke: none;
}

.map-node.device .map-icon {
  stroke: #b8f7b4;
}

.map-node.merchant .map-icon.filled {
  fill: #ffd08a;
}

.map-node.exchange .map-icon,
.map-node.exchange .map-icon.filled {
  fill: #c4b5fd;
  stroke: #c4b5fd;
}

.map-node-label,
.map-node-detail,
.map-node-risk {
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(6, 16, 27, 0.92);
  stroke-width: 5px;
}

.map-node-label {
  fill: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.map-node-detail {
  fill: var(--soft);
  font-size: 18px;
  font-weight: 800;
}

.map-node-risk {
  fill: #ff5d55;
  font-size: 19px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-node.medium-risk .map-node-risk,
.map-node.low-risk .map-node-risk,
.map-node.shared-signal .map-node-risk {
  fill: #3fb7ff;
  text-transform: none;
}

.fraud-node {
  position: absolute;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 126px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  text-align: center;
}

.fraud-node:hover {
  background: transparent;
  transform: translateY(-2px);
}

.node-bubble {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 2px solid rgba(47, 147, 255, 0.86);
  border-radius: 999px;
  background: rgba(14, 79, 168, 0.72);
  box-shadow:
    0 0 0 7px rgba(47, 147, 255, 0.13),
    0 0 32px rgba(47, 147, 255, 0.32);
}

.node-bubble::before {
  width: 25px;
  height: 25px;
  border-radius: 999px 999px 45% 45%;
  background: #9bd0ff;
  clip-path: polygon(50% 0, 68% 32%, 100% 32%, 76% 54%, 84% 100%, 50% 76%, 16% 100%, 24% 54%, 0 32%, 32% 32%);
  content: "";
}

.fraud-node.device .node-bubble {
  border-color: rgba(103, 208, 106, 0.9);
  background: rgba(22, 101, 52, 0.72);
  box-shadow:
    0 0 0 7px rgba(103, 208, 106, 0.13),
    0 0 32px rgba(103, 208, 106, 0.26);
}

.fraud-node.device .node-bubble::before {
  width: 20px;
  height: 34px;
  border-radius: 5px;
  background: transparent;
  border: 3px solid #a7f3a4;
  clip-path: none;
}

.fraud-node.merchant .node-bubble {
  border-color: rgba(255, 171, 56, 0.9);
  background: rgba(146, 87, 13, 0.72);
  box-shadow:
    0 0 0 7px rgba(255, 171, 56, 0.13),
    0 0 32px rgba(255, 171, 56, 0.22);
}

.fraud-node.merchant .node-bubble::before {
  width: 34px;
  height: 26px;
  border-radius: 4px 4px 10px 10px;
  background: #ffd08a;
  clip-path: polygon(0 0, 72% 0, 100% 38%, 82% 38%, 66% 100%, 12% 100%);
}

.fraud-node.exchange .node-bubble {
  border-color: rgba(139, 92, 246, 0.9);
  background: rgba(76, 29, 149, 0.72);
  box-shadow:
    0 0 0 7px rgba(139, 92, 246, 0.14),
    0 0 32px rgba(139, 92, 246, 0.27);
}

.fraud-node.exchange .node-bubble::before {
  width: 32px;
  height: 30px;
  border-radius: 3px;
  background: #c4b5fd;
  clip-path: polygon(0 100%, 0 66%, 18% 66%, 18% 100%, 34% 100%, 34% 45%, 52% 45%, 52% 100%, 68% 100%, 68% 22%, 86% 22%, 86% 100%);
}

.fraud-node strong {
  margin-top: 4px;
  font-size: 1.03rem;
  line-height: 1.1;
}

.fraud-node small {
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 650;
}

.fraud-node em {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 5px;
  padding: 0 8px;
  background: rgba(127, 29, 29, 0.74);
  color: #ff5d55;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.fraud-node em.medium {
  background: transparent;
  color: #3fb7ff;
  text-transform: none;
}

.account-a {
  left: 4%;
  top: 42%;
}

.device-x {
  left: 18%;
  top: 39%;
}

.account-b {
  left: 33%;
  top: 13%;
}

.account-d {
  left: 33%;
  top: 67%;
}

.account-c {
  left: 47%;
  top: 40%;
}

.merchant-y {
  left: 67%;
  top: 41%;
}

.exchange-z {
  left: 83%;
  top: 41%;
}

.fraud-map-controls {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  gap: 10px;
}

.fraud-map-controls button {
  width: 48px;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  color: var(--soft);
}

.campaign-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(2, 8, 14, 0.28);
}

.campaign-card.detected {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(127, 29, 29, 0.18);
}

.campaign-card strong {
  display: block;
  margin: 5px 0;
  font-size: 1.02rem;
}

.campaign-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.campaign-status {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.campaign-card.detected .campaign-status {
  color: var(--risk);
}

.campaign-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.dashboard-tabs {
  padding: 0;
}

.tab-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.tab-strip button {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 18px 16px;
  background: transparent;
  color: var(--soft);
  box-shadow: none;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.tab-strip button:hover,
.tab-strip button:focus-visible {
  background: rgba(47, 147, 255, 0.06);
  color: var(--ink);
  outline: none;
}

.tab-strip button.active {
  border-bottom: 2px solid var(--accent);
  background: rgba(47, 147, 255, 0.08);
  color: var(--ink);
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  padding: 16px;
}

.tab-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 14, 0.28);
  padding: 16px;
}

.tab-card h2 {
  margin-bottom: 2px;
}

.wide-tab-card {
  grid-column: 1 / -1;
  max-height: none;
}

.registry-grid {
  display: grid;
  gap: 12px;
}

.registry-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.registry-toolbar input {
  width: min(320px, 100%);
}

.registry-toolbar span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.registry-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.registry-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 14, 0.26);
  padding: 14px;
}

.registry-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.registry-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.registry-card code {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.registry-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.registry-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.registry-meta div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: rgba(2, 8, 14, 0.22);
}

.registry-meta dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.registry-meta dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(2, 8, 14, 0.25);
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 800;
}

.admin-controls {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.risk-policy-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.risk-policy-panel.saved {
  border-color: rgba(25, 198, 178, 0.55);
  background: rgba(20, 83, 78, 0.24);
}

.risk-policy-panel header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.risk-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.risk-policy-feedback {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.risk-policy-feedback.success {
  color: var(--success);
}

.risk-policy-feedback.error {
  color: var(--risk);
}

.approval-queue,
.approval-log,
.selected-case {
  display: grid;
  gap: 12px;
}

.approval-row,
.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.approval-row:first-child,
.log-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.approval-row-body,
.log-row-body {
  min-width: 0;
}

.approval-row-body p,
.log-row-body p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.log-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(2, 8, 14, 0.26);
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 900;
}

.status-pill.pending {
  border-color: rgba(255, 171, 56, 0.48);
  color: var(--warning);
}

.status-pill.approved {
  border-color: rgba(103, 208, 106, 0.48);
  color: var(--success);
}

.status-pill.denied {
  border-color: rgba(239, 68, 68, 0.48);
  color: var(--risk);
}

.status-pill.more_evidence {
  border-color: rgba(47, 147, 255, 0.48);
  color: #7abaff;
}

.case-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.approval-detail,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(2, 8, 14, 0.28);
}

.approval-detail p,
.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.selected-case h3 {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.error-state {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(127, 29, 29, 0.24);
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.demo-process-panel {
  margin-bottom: 16px;
}

.demo-process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.process-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 14, 0.26);
  padding: 12px;
}

.process-step span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(47, 147, 255, 0.18);
  color: var(--accent);
  font-weight: 900;
}

.process-step strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.process-step p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.process-step.completed {
  border-color: rgba(25, 198, 178, 0.34);
}

.demo-prompt-panel {
  display: grid;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.demo-case-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.demo-federated {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.demo-open-row {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.demo-result-grid {
  align-items: start;
}

.plan-step-item p {
  font-size: 0.86rem;
}

#demo-status[data-kind="success"] {
  color: var(--success);
}

#demo-status[data-kind="error"] {
  color: var(--risk);
}

#demo-status[data-kind="running"] {
  color: var(--accent);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100vw - 28px, 980px);
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-status {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .right-rail {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    width: min(100vw - 20px, 640px);
    margin: 10px auto 24px;
  }

  .sidebar,
  .panel {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .approval-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions button,
  .header-actions .button-link,
  .approval-actions button {
    width: 100%;
  }

  .side-nav,
  .side-status,
  .case-strip,
  .grid,
  .demo-layout,
  .admin-controls,
  .admin-layout,
  .risk-policy-grid,
  .metric-grid,
  .privacy-list,
  .campaign-metrics,
  .network-graph-stage,
  .case-summary-list,
  .demo-case-strip,
  .demo-process,
  .registry-list,
  .registry-meta,
  .approval-row,
  .log-row {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  .event {
    grid-template-columns: 1fr;
  }

  .network-graph-viewport {
    min-height: 330px;
  }

  .registry-grid {
    grid-template-columns: 1fr;
  }

  .risk-policy-panel header {
    align-items: stretch;
    flex-direction: column;
  }

  .log-meta {
    justify-items: start;
    text-align: left;
  }
}
