:root {
  --void-navy: #0a0f15;
  --panel-steel: #111a27;
  --grid-line: #1f3148;
  --signal-cyan: #00f0ff;
  --beacon-amber: #ffb800;
  --alert-crimson: #ff2a2a;
  --ghost-white: #ffffff;
  --mist-grey: #8b9bbd;
  --glass-bg: rgba(15, 27, 43, 0.48);
  --glass-bg-strong: rgba(12, 22, 36, 0.66);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.4);
  --glow-red: 0 0 12px rgba(255, 42, 42, 0.36);
  --secure-state: #00f0ff;
  --chart-violet: #8b7cff;
  --font-display-cjk: "Source Han Sans CN Heavy", "Alibaba PuHuiTi Heavy", "Microsoft YaHei UI", "Microsoft YaHei", "SimHei", sans-serif;
  --font-display: Rajdhani, Orbitron, "Segoe UI", sans-serif;
  --font-body: Inter, "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ghost-white);
  background:
    linear-gradient(rgba(0, 240, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.085) 1px, transparent 1.2px),
    var(--void-navy);
  background-size: 28px 28px, 28px 28px, 18px 18px;
  font-family: var(--font-body);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px);
  opacity: 0.42;
}

.threat-flash {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  border: 0 solid rgba(255, 42, 42, 0);
}

body.alerting .threat-flash {
  animation: edgeAlert 0.9s ease-out;
}

button,
select,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.topbar,
.sidebar,
.stage,
.inspector,
.timeline {
  background: rgba(12, 22, 36, 0.82);
  border: 1px solid var(--grid-line);
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  animation: panelEnter 0.45s ease-out both;
}

.topbar {
  animation-delay: 0ms;
}

.sidebar {
  animation-delay: 80ms;
}

.stage {
  animation-delay: 140ms;
}

.inspector {
  animation-delay: 210ms;
}

.timeline {
  animation-delay: 280ms;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--grid-line);
  background: rgba(10, 15, 21, 0.52);
  box-shadow: none;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--signal-cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-hex {
  stroke-width: 1.8;
}

.brand-net {
  stroke: var(--grid-line);
  stroke-width: 1.2;
}

.brand-key {
  stroke-width: 1.9;
}

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

h1,
h2,
h3,
.nav-button,
.action-button {
  font-family: var(--font-display-cjk);
  letter-spacing: 0;
}

.eyebrow,
.status-item strong,
.scenario-select select,
.chart-axis-label {
  font-family: var(--font-display);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
}

.brand p,
.status-item span,
.eyebrow,
.timeline-header,
.proof-row span {
  color: var(--mist-grey);
}

.brand p {
  margin-top: 4px;
  font-size: 12px;
}

.status-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-item,
.scenario-select {
  min-width: 128px;
  padding: 8px 10px;
  border: 1px solid var(--grid-line);
  background: rgba(10, 15, 21, 0.58);
  display: grid;
  gap: 4px;
}

.status-item strong,
.scenario-select select,
.packet-value,
.proof-row strong {
  font-family: var(--font-mono);
}

.live-status strong {
  color: var(--alert-crimson);
  text-shadow: none;
  animation: none;
}

.scenario-select span {
  color: var(--mist-grey);
  font-size: 12px;
}

select {
  min-width: 142px;
  color: var(--ghost-white);
  background: rgba(10, 15, 21, 0.72);
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
}

.dashboard {
  min-height: 0;
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr) 332px;
  gap: 10px;
}

.sidebar {
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-button,
.action-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--glass-border);
  background: rgba(10, 15, 21, 0.38);
  cursor: pointer;
  border-radius: 3px;
}

.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 0 12px;
  color: var(--mist-grey);
  font-size: 14px;
}

.nav-button::before {
  width: 16px;
  color: var(--mist-grey);
  font-family: var(--font-mono);
  font-size: 13px;
}

.nav-button[data-view="domain"]::before {
  content: "◇";
}

.nav-button[data-view="cross"]::before {
  content: "⌁";
}

.nav-button[data-view="perf"]::before {
  content: "▱";
}

.nav-button[data-view="healing"]::before {
  content: "◫";
}

.nav-button[data-view="security"]::before {
  content: "▰";
}

.nav-button.active,
.action-button.primary {
  color: var(--signal-cyan);
  background: rgba(0, 240, 255, 0.085);
  border-color: var(--signal-cyan);
  box-shadow: inset 3px 0 0 var(--signal-cyan), inset 0 0 18px rgba(0, 240, 255, 0.055);
}

.nav-button.active::before {
  color: var(--signal-cyan);
}

.action-button {
  padding: 0 10px;
}

.action-button:hover,
.icon-button:hover {
  border-color: var(--signal-cyan);
}

.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(0, 240, 255, 0.045);
}

.icon-button.warn:hover:not(:disabled) {
  border-color: var(--alert-crimson);
  background: rgba(255, 42, 42, 0.045);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.46;
  filter: saturate(0.7);
}

.icon-button.action-running:disabled {
  opacity: 1;
  filter: none;
}

.nav-button:focus-visible,
.action-button:focus-visible,
.icon-button:focus-visible,
select:focus-visible,
input[type="range"]:focus-visible,
.drone-node:focus-visible {
  outline: 2px solid var(--signal-cyan);
  outline-offset: 2px;
}

.sidebar-divider {
  height: 1px;
  background: var(--grid-line);
  margin: 8px 0;
}

.stage {
  min-width: 0;
  display: grid;
  view-transition-name: main-stage;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.stage-header,
.panel-heading,
.timeline-header {
  padding: 12px;
  border-bottom: 1px solid var(--grid-line);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
}

.stage h2,
.inspector h2 {
  margin-top: 3px;
  font-size: 22px;
}

.control-cluster {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}

.interference-control {
  display: grid;
  grid-template-columns: auto 116px auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--glass-border);
  background: rgba(10, 15, 21, 0.38);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mist-grey);
  white-space: nowrap;
}

.interference-control strong {
  color: var(--beacon-amber);
}

.icon-button {
  min-width: 38px;
  min-height: 34px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.12s ease, opacity 0.16s ease;
}

.icon-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.icon-button.primary-action {
  border-color: rgba(0, 240, 255, 0.48);
  color: var(--signal-cyan);
  background: rgba(0, 240, 255, 0.025);
}

.target-chip {
  min-width: 104px;
  height: 34px;
  padding: 4px 9px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(91, 143, 170, 0.28);
  border-left: 2px solid var(--mist-grey);
  border-radius: 3px;
  background: rgba(10, 15, 21, 0.48);
}

.target-chip i {
  grid-row: 1 / 3;
  align-self: center;
  color: rgba(137, 161, 178, 0.62);
  font: 8px/1 var(--font-mono);
  font-style: normal;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.target-chip strong {
  color: var(--ghost-white);
  font: 11px/1.1 var(--font-mono);
}

.target-chip small {
  color: var(--mist-grey);
  font: 8px/1.1 var(--font-mono);
}

.target-chip.active { border-left-color: var(--signal-cyan); }
.target-chip.offline,
.target-chip.healing { border-left-color: var(--beacon-amber); }
.target-chip.revoked { border-left-color: var(--alert-crimson); }
.target-chip.empty { opacity: 0.68; }

.icon-button.action-running {
  position: relative;
  border-color: var(--signal-cyan);
  color: var(--signal-cyan);
  background: rgba(0, 240, 255, 0.075);
  animation: actionButtonPulse 1.2s ease-in-out infinite;
}

.rekey-button {
  width: 158px;
  min-height: 36px;
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 10px 2px 8px;
  overflow: hidden;
  text-align: left;
}

.rekey-step {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 240, 255, 0.52);
  border-radius: 50%;
  color: var(--signal-cyan);
  font-size: 9px;
  line-height: 1;
}

.rekey-label {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.rekey-button.action-running .rekey-label {
  animation: rekeyLabelIn 0.24s cubic-bezier(.22,.8,.3,1) both;
}

.rekey-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(0, 240, 255, 0.08);
}

.rekey-progress::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--rekey-progress, 0));
  transform-origin: left;
  background: var(--signal-cyan);
  animation: rekeyProgressIn 0.3s cubic-bezier(.22,.8,.3,1) both;
}

.rekey-button.phase-derive { --rekey-progress: 0.22; }
.rekey-button.phase-compose { --rekey-progress: 0.48; }
.rekey-button.phase-distribute { --rekey-progress: 0.78; }
.rekey-button.phase-verified { --rekey-progress: 1; }
.rekey-button.phase-error { --rekey-progress: 1; }

.rekey-button.action-running:not(.phase-verified):not(.phase-error) .rekey-step {
  border-style: dashed;
  animation: rekeyStepSpin 1.15s linear infinite;
}

.rekey-button.phase-verified {
  background: rgba(0, 240, 255, 0.11);
  animation: rekeyButtonVerified 0.42s ease-out both;
}

.rekey-button.phase-error,
.rekey-button.phase-error .rekey-step {
  border-color: var(--alert-crimson);
  color: var(--alert-crimson);
}

.isolation-button {
  width: 116px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.isolation-button.action-running {
  --isolation-progress: 0.28;
  border-color: var(--alert-crimson);
  background: rgba(255, 42, 42, 0.055);
  color: var(--alert-crimson);
  animation: none;
}

.isolation-button.action-running::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--alert-crimson);
  transform: scaleX(var(--isolation-progress));
  transform-origin: left;
  animation: isolationProgressIn 0.3s cubic-bezier(.22,.8,.3,1) both;
}

.isolation-button.phase-exclude { --isolation-progress: 0.64; }
.isolation-button.phase-confirm,
.isolation-button.phase-error { --isolation-progress: 1; }

.isolation-button.phase-confirm {
  background: rgba(255, 42, 42, 0.09);
}

.icon-button.warn {
  border-color: rgba(255, 42, 42, 0.55);
  color: var(--alert-crimson);
}

.stage-body {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: hidden;
}

.stage-body.performance-stage {
  align-content: start;
  justify-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 76px;
  scrollbar-width: thin;
  scrollbar-color: var(--grid-line) transparent;
}

.stage-body.security-stage {
  place-items: start center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 28px 26px;
  scrollbar-width: thin;
  scrollbar-color: var(--grid-line) transparent;
}

.performance-stage .real-cost-chart {
  flex: none;
  max-height: 320px;
  margin-top: 0;
}

.performance-stage .paper-performance-chart {
  max-height: 400px;
  margin-top: 0;
}

.paper-performance-workbench {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 14px;
  align-items: stretch;
}

.paper-performance-main {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto auto;
  gap: 9px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(91, 143, 170, 0.16);
  background: rgba(5, 15, 25, 0.3);
}

.performance-stage .paper-performance-main .paper-performance-chart {
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: 390px;
  aspect-ratio: 2 / 1;
}

.paper-performance-main .paper-legend,
.paper-performance-main .perf-controls {
  width: 100%;
}

.paper-performance-main .paper-legend {
  justify-content: flex-start;
  padding: 0 5px;
  font-size: 9px;
}

.paper-performance-main .paper-legend > strong {
  margin-left: auto;
}

.paper-performance-main .perf-controls {
  align-self: auto;
  padding-top: 7px;
  border-top: 1px solid rgba(91, 143, 170, 0.14);
}

.performance-insight-panel .healing-highlight strong {
  font-size: 23px;
}

.performance-insight-list article:last-child {
  border-bottom: 0;
}

.healing-workbench {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 14px;
  align-items: stretch;
}

.chapter9-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.chapter9-tab {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid rgba(91, 143, 170, 0.2);
  background: rgba(5, 15, 25, 0.52);
  color: var(--mist-grey);
  font: 10px/1.2 var(--font-mono);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.chapter9-tab i {
  color: rgba(137, 161, 178, 0.48);
  font-size: 8px;
  font-style: normal;
}

.chapter9-tab:hover:not(:disabled) { border-color: rgba(0, 240, 255, 0.48); color: var(--ghost-white); }
.chapter9-tab.active { border-color: var(--signal-cyan); background: rgba(0, 240, 255, 0.075); color: var(--signal-cyan); }
.chapter9-tab.active i { color: var(--signal-cyan); }

.healing-chart-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 9px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(91, 143, 170, 0.16);
  background: rgba(5, 15, 25, 0.3);
}

.chapter9-chart-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 18px;
  padding: 0 6px;
}

.chapter9-chart-title span { color: var(--signal-cyan); font: 8px/1 var(--font-mono); letter-spacing: 0.08em; }
.chapter9-chart-title strong { color: var(--ghost-white); font-size: 12px; }

.performance-stage .healing-chart {
  width: 100%;
  height: auto;
  min-height: 278px;
  max-height: 370px;
  aspect-ratio: 2 / 1;
}

.healing-metrics .metric {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-top-color: rgba(91, 143, 170, 0.34);
}

.healing-metrics .metric span,
.healing-metrics .metric strong {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.healing-metrics .metric span { font-size: 10px; }
.healing-metrics .metric strong { font-size: 14px; }
.healing-metrics .metric strong small { color: var(--mist-grey); font-size: 9px; font-weight: 500; }
.healing-metrics .status-pass { border-top-color: var(--signal-cyan); }
.healing-metrics .status-pass strong { color: var(--signal-cyan); }
.healing-metrics .status-check { border-top-color: var(--beacon-amber); }
.healing-metrics .status-check strong { color: var(--beacon-amber); }

.healing-legend {
  width: 100%;
  justify-content: flex-start;
  gap: 6px 13px;
  padding: 0 5px;
  font-size: 9px;
}

.healing-legend > strong {
  margin-left: auto;
  color: var(--mist-grey);
  letter-spacing: 0.04em;
}

.healing-slider {
  grid-template-columns: 76px 1fr 42px;
  padding: 8px 10px 0;
  border-top: 1px solid rgba(91, 143, 170, 0.14);
  font-size: 10px;
}

.healing-slider > strong {
  color: var(--signal-cyan);
  text-align: right;
}

.healing-insight-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(91, 143, 170, 0.22);
  border-top-color: rgba(0, 240, 255, 0.48);
  background: linear-gradient(180deg, rgba(9, 24, 37, 0.88), rgba(5, 15, 25, 0.7));
}

.healing-insight-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(91, 143, 170, 0.2);
}

.healing-insight-head > span {
  grid-column: 1 / -1;
  color: var(--mist-grey);
  font: 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.healing-insight-head > strong { color: var(--ghost-white); font-size: 18px; }
.healing-insight-head > small { align-self: end; color: var(--signal-cyan); font: 9px/1 var(--font-mono); }

.healing-highlight {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 10px;
  border-left: 2px solid var(--signal-cyan);
  background: rgba(0, 240, 255, 0.055);
}

.healing-highlight span { color: var(--mist-grey); font-size: 11px; }
.healing-highlight strong { color: var(--ghost-white); font: 25px/1 var(--font-mono); }
.healing-highlight small { grid-column: 1 / -1; margin-top: 6px; color: var(--mist-grey); font-size: 11px; line-height: 1.5; }

.healing-insight-list { display: grid; gap: 7px; }

.healing-insight-list article {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(91, 143, 170, 0.12);
}

.healing-insight-list i { color: rgba(0, 240, 255, 0.55); font: 10px/1.4 var(--font-mono); font-style: normal; }
.healing-insight-list div { display: grid; gap: 3px; }
.healing-insight-list strong { color: var(--ghost-white); font-size: 13px; }
.healing-insight-list span { color: var(--mist-grey); font-size: 12px; line-height: 1.55; }

.healing-insight-panel .paper-test-progress {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: auto;
  padding: 9px;
  border: 1px solid rgba(91, 143, 170, 0.16);
  background: rgba(5, 15, 25, 0.52);
}

.healing-progress-head { display: flex; justify-content: space-between; }
.healing-progress-head strong { color: var(--ghost-white); }
.healing-insight-panel .paper-test-progress p { margin: 0; color: var(--mist-grey); font-size: 10px; }
.healing-source-note { color: rgba(137, 161, 178, 0.66); font: 9px/1.55 var(--font-mono); }

@media (max-width: 620px) {
  .paper-performance-workbench { grid-template-columns: 1fr; }
  .performance-insight-panel { min-height: 360px; }
  .healing-workbench { grid-template-columns: 1fr; }
  .chapter9-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .healing-insight-panel { min-height: 360px; }
}

.paper-source-badge {
  width: min(720px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--signal-cyan);
  background: rgba(0, 240, 255, 0.055);
  color: var(--mist-grey);
  font: 10px/1.5 var(--font-mono);
}

.paper-source-badge strong {
  color: var(--signal-cyan);
  white-space: nowrap;
}

.map-meta {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.art-event-strip {
  position: absolute;
  z-index: 3;
  top: 72px;
  left: 24px;
  right: 24px;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 7px 11px;
  border-left: 2px solid var(--signal-cyan);
  border-bottom: 1px solid rgba(91, 143, 170, 0.18);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.07), rgba(8, 14, 22, 0.78) 42%, rgba(8, 14, 22, 0.4));
  pointer-events: none;
}

.art-event-strip > span {
  color: var(--signal-cyan);
  font: 9px/1.2 var(--font-mono);
  letter-spacing: 0.12em;
}

.art-event-strip > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ghost-white);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.art-event-strip > small {
  color: var(--mist-grey);
  font: 9px/1.2 var(--font-mono);
  white-space: nowrap;
}

.art-event-strip[data-event="migration"] {
  border-left-color: var(--beacon-amber);
  background: linear-gradient(90deg, rgba(255, 183, 77, 0.09), rgba(8, 14, 22, 0.78) 42%, rgba(8, 14, 22, 0.4));
}

.art-event-strip[data-event="migration"] > span {
  color: var(--beacon-amber);
}

.art-svg {
  box-sizing: border-box;
  padding-top: 64px;
}

.metric {
  padding: 8px 10px;
  border: 1px solid var(--grid-line);
  background: rgba(10, 15, 21, 0.62);
  box-shadow: none;
}

.metric span {
  display: block;
  color: var(--mist-grey);
  font-size: 11px;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  color: var(--ghost-white);
}

.metric-changing .metric strong {
  animation: metricValueSettle 0.52s cubic-bezier(.22,.8,.3,1);
}

svg {
  width: 100%;
  height: 100%;
  display: block;
}

.topology-svg,
.art-svg,
.chart-svg {
  min-height: 260px;
}

.link {
  stroke: color-mix(in srgb, var(--md-sys-color-secondary) 30%, var(--grid-line));
  stroke-width: 1.5;
}

.tree-edge.active {
  stroke: var(--mist-grey);
  filter: none;
}

.link.active {
  stroke: rgba(139, 155, 189, 0.24);
}

.isolation-target-link {
  transform-box: fill-box;
  transform-origin: left center;
}

body[data-revoke-phase="mark"] .isolation-target-link {
  stroke: rgba(255, 184, 0, 0.72);
  stroke-dasharray: 5 6;
  animation: isolationLinkScan 0.75s linear infinite;
}

body[data-revoke-phase="exclude"] .isolation-target-link {
  stroke: var(--alert-crimson);
  stroke-dasharray: 7 6;
  animation: isolationLinkWithdraw 0.42s cubic-bezier(.4,0,.6,1) both;
}

body[data-revoke-phase="confirm"] .isolation-target-link {
  stroke: rgba(255, 42, 42, 0.2);
  stroke-dasharray: 2 8;
}

.mutual-link {
  stroke: var(--beacon-amber);
  stroke-width: 2;
  stroke-dasharray: 8 7;
  filter: drop-shadow(0 0 8px rgba(255, 184, 0, 0.42));
  animation: pathFlow 0.9s linear infinite;
}

.gcs-core {
  fill: rgba(139, 155, 189, 0.07);
  stroke: var(--grid-line);
  stroke-width: 2;
  filter: none;
}

.gcs-radar {
  fill: none;
  stroke: var(--grid-line);
  stroke-width: 1.2;
  opacity: 0;
  animation: none;
}

.gcs-radar.delay {
  animation-delay: 1.15s;
}

.rekey-orbit {
  fill: none;
  stroke: var(--signal-cyan);
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
}

.rekey-orbit.outer {
  stroke-width: 1.2;
  stroke-dasharray: 7 8;
  opacity: 0.48;
  animation: rekeyOrbitSpin 2.4s linear infinite;
}

.rekey-orbit.inner {
  stroke-width: 2;
  stroke-dasharray: 58 275;
  opacity: 0.9;
  animation: rekeyOrbitSpin 1.35s linear infinite reverse;
}

.rekey-caption rect {
  fill: rgba(10, 15, 21, 0.92);
  stroke: rgba(0, 240, 255, 0.38);
}

.rekey-caption text {
  fill: var(--signal-cyan);
  font: 9px/1 var(--font-mono);
  letter-spacing: 0.045em;
  text-anchor: middle;
}

.rekey-visual.phase-distribute .rekey-orbit.outer {
  animation: rekeyDistributionWave 0.9s ease-out infinite;
}

.rekey-visual.phase-verified .rekey-orbit {
  stroke-dasharray: none;
  animation: rekeyVerifiedRing 0.5s ease-out both;
}

.rekey-visual.phase-error .rekey-orbit,
.rekey-visual.phase-error .rekey-caption rect {
  stroke: var(--alert-crimson);
}

.rekey-visual.phase-error .rekey-caption text {
  fill: var(--alert-crimson);
}

.gcs-mast {
  fill: rgba(139, 155, 189, 0.08);
  stroke: var(--mist-grey);
  stroke-width: 1.5;
}

.gcs-static-lines {
  fill: none;
  stroke: var(--mist-grey);
  stroke-width: 1.4;
}

.event-active .gcs-core {
  fill: rgba(0, 240, 255, 0.13);
  stroke: var(--signal-cyan);
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.42));
}

body[data-action="broadcast"] .gcs-core {
  fill: rgba(0, 240, 255, 0.11);
  stroke: var(--signal-cyan);
}

body[data-action="broadcast"] .gcs-mast,
body[data-action="broadcast"] .gcs-static-lines {
  stroke: var(--signal-cyan);
}

.event-active .gcs-mast,
.event-active .gcs-static-lines {
  stroke: var(--signal-cyan);
}

.event-active .gcs-radar {
  stroke: var(--signal-cyan);
  animation: radarWave 3.2s ease-out infinite;
}

.event-active .link.active,
.event-active .tree-edge.active {
  stroke: var(--signal-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

.gcs-label,
.node-label,
.tree-label,
.chart-axis-label {
  fill: var(--ghost-white);
  font-family: var(--font-mono);
  font-size: 12px;
  text-anchor: middle;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-anchor: middle;
}

.chart-label.ours {
  fill: var(--signal-cyan);
}

.chart-label.cphkd {
  fill: var(--beacon-amber);
}

.chart-label.tian {
  fill: var(--alert-crimson);
}

.chart-label.agrawal {
  fill: var(--chart-violet);
}

.node-label,
.tree-label {
  font-size: 11px;
}

.drone-node {
  cursor: pointer;
}

.selection-ring {
  fill: none;
  stroke: transparent;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
}

.drone-node.selected .selection-ring {
  stroke: var(--ghost-white);
  stroke-dasharray: 3 3;
}

.drone-node.isolation-target .selection-ring {
  stroke: var(--beacon-amber);
  stroke-dasharray: 5 4;
  animation: isolationTargetAcquire 0.9s linear infinite;
}

.drone-node.isolation-confirmed .selection-ring {
  stroke: var(--alert-crimson);
  stroke-dasharray: none;
  animation: isolationTargetConfirmed 0.65s ease-out both;
}

.drone-dot.active {
  fill: color-mix(
    in srgb,
    var(--md-sys-color-secondary) 58%,
    var(--md-sys-color-surface-container-highest)
  );
  stroke: var(--md-sys-color-secondary);
  stroke-width: 1.5;
  filter: none;
  animation: none;
}

.event-active .drone-dot.active {
  fill: var(--signal-cyan);
  stroke: var(--signal-cyan);
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.5));
}

.drone-node.mutual-candidate .drone-dot.active {
  fill: var(--beacon-amber);
  stroke: var(--beacon-amber);
  filter: drop-shadow(0 0 7px rgba(255, 184, 0, 0.48));
}

body[data-action="negotiate"] .tree-edge.active {
  stroke: var(--signal-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.42));
}

.drone-dot.joining {
  fill: var(--void-navy);
  stroke: var(--beacon-amber);
  stroke-width: 3;
  stroke-dasharray: 7 5;
  animation: pendingNode 0.8s linear infinite;
}

.drone-dot.revoking {
  fill: rgba(255, 184, 0, 0.055);
  stroke: var(--beacon-amber);
  stroke-width: 2.5;
  stroke-dasharray: 6 5;
  animation: pendingNode 0.85s linear infinite;
}

body[data-revoke-phase="exclude"] .drone-dot.revoking {
  fill: rgba(255, 42, 42, 0.055);
  stroke: var(--alert-crimson);
  transition: fill 0.25s ease, stroke 0.25s ease;
}

.drone-dot.healing {
  fill: rgba(255, 184, 0, 0.08);
  stroke: var(--beacon-amber);
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  animation: pendingNode 0.7s linear infinite;
  filter: drop-shadow(0 0 7px rgba(255, 184, 0, 0.38));
}

.drone-dot.offline {
  fill: var(--void-navy);
  stroke: var(--beacon-amber);
  stroke-dasharray: 4 4;
  filter: drop-shadow(0 0 7px rgba(255, 184, 0, 0.42));
}

.drone-dot.revoked {
  fill: rgba(255, 42, 42, 0.06);
  stroke: var(--alert-crimson);
  stroke-dasharray: 3 3;
}

.node-slash {
  stroke: var(--alert-crimson);
  stroke-width: 2;
  stroke-dasharray: 34;
  stroke-dashoffset: 0;
}

.isolation-confirmed .node-slash {
  animation: isolationSlashDraw 0.42s cubic-bezier(.22,.8,.3,1) both;
}

.broadcast-ring {
  fill: none;
  stroke: var(--signal-cyan);
  stroke-width: 3;
  opacity: 0;
}

.signal-dot {
  fill: var(--signal-cyan);
  filter: drop-shadow(0 0 7px var(--signal-cyan));
}

.signal-dot.blocked {
  fill: var(--alert-crimson);
  filter: drop-shadow(0 0 8px var(--alert-crimson));
}

.decrypt-failed {
  fill: var(--alert-crimson);
  font-family: var(--font-mono);
  font-size: 10px;
  text-anchor: middle;
  opacity: 0;
}

.decrypt-failed.show {
  animation: isolationEvidenceIn 0.5s cubic-bezier(.22,.8,.3,1) 0.18s both;
}

.uav-telemetry {
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}

.drone-node:hover .uav-telemetry,
.uav-telemetry.pinned {
  opacity: 1;
}

.uav-telemetry rect {
  fill: rgba(10, 15, 21, 0.78);
  stroke: var(--glass-border);
  filter: drop-shadow(0 0 9px rgba(0, 240, 255, 0.22));
}

.uav-telemetry text {
  fill: var(--ghost-white);
  font-family: var(--font-mono);
  font-size: 9px;
}

.node-arrival .drone-dot.active,
.node-arrival .drone-dot.joining {
  animation: nodeArrival 0.85s ease-out;
}

.broadcast-ring.pulse {
  animation: broadcastPulse 1.25s ease-out forwards;
}

.revoked-shock {
  animation: revokedPacketBlock 0.7s ease-out;
}

.tree-node {
  fill: rgba(10, 15, 21, 0.42);
  stroke: var(--grid-line);
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.14));
}

.tree-node.leaf {
  stroke: var(--signal-cyan);
}

.tree-node.leaf.vacant {
  fill: rgba(10, 15, 21, 0.18);
  stroke: rgba(137, 161, 178, 0.28);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  filter: none;
}

.tree-label.vacant,
.tree-sub-label.vacant {
  fill: rgba(137, 161, 178, 0.42);
}

.tree-node.root {
  stroke: var(--beacon-amber);
}

.tree-node.highlight {
  stroke: var(--signal-cyan);
  filter: drop-shadow(0 0 7px var(--signal-cyan));
}

.art-node-group.highlight {
  animation: artNodeSettle 0.5s cubic-bezier(.22, .8, .3, 1) both;
}

.tree-edge {
  stroke: var(--grid-line);
  stroke-width: 2;
}

.tree-edge.active {
  stroke-dasharray: 10 8;
  animation: pathFlow 1.4s linear infinite;
}

.art-orb {
  fill: var(--signal-cyan);
  filter: drop-shadow(0 0 10px var(--signal-cyan));
  opacity: 0;
}

.edge-note {
  fill: var(--mist-grey);
  font-family: var(--font-mono);
  font-size: 10px;
  text-anchor: middle;
}

.edge-note.active {
  fill: var(--signal-cyan);
  font-size: 9px;
}

.tree-sub-label {
  fill: rgba(166, 181, 201, 0.82);
  font-family: var(--font-mono);
  font-size: 8px;
  text-anchor: middle;
}

@keyframes artNodeSettle {
  0% { opacity: 0.42; transform: translateY(-5px); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); }
}

.chart-grid {
  stroke: rgba(30, 42, 61, 0.65);
  stroke-width: 1;
}

.line-ours {
  fill: none;
  stroke: var(--signal-cyan);
  stroke-width: 4;
  filter: none;
}

.line-cphkd {
  fill: none;
  stroke: var(--beacon-amber);
  stroke-width: 2;
}

.line-tian {
  fill: none;
  stroke: var(--alert-crimson);
  stroke-width: 2;
}

.line-agrawal {
  fill: none;
  stroke: var(--chart-violet);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.chart-point {
  stroke: #07131f;
  stroke-width: 1.5;
  transition: r 0.18s ease, filter 0.18s ease;
}

.chart-point.ours { fill: var(--signal-cyan); }
.chart-point.cphkd { fill: var(--beacon-amber); }
.chart-point.tian { fill: var(--alert-crimson); }
.chart-point.agrawal { fill: var(--chart-violet); }

.chart-point.selected {
  stroke: var(--ghost-white);
  filter: drop-shadow(0 0 7px currentColor);
}

.paper-test-line {
  fill: none;
  stroke-width: 2.4;
  stroke-dasharray: 2 6;
  stroke-linecap: round;
  opacity: 0.95;
}

.paper-test-line.ours { stroke: var(--signal-cyan); }
.paper-test-line.cphkd { stroke: var(--beacon-amber); }
.paper-test-line.tian { stroke: var(--alert-crimson); }
.paper-test-line.agrawal { stroke: var(--chart-violet); }

.paper-test-point {
  fill: var(--void-navy);
  stroke-width: 2;
}

.paper-test-point.ours { stroke: var(--signal-cyan); }
.paper-test-point.cphkd { stroke: var(--beacon-amber); }
.paper-test-point.tian { stroke: var(--alert-crimson); }
.paper-test-point.agrawal { stroke: var(--chart-violet); }

.paper-test-progress {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--mist-grey);
  font: 10px/1.5 var(--font-mono);
}

.paper-test-progress.running {
  color: var(--signal-cyan);
}

.selected-node-guide {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.selected-value-label {
  font: 9px/1 var(--font-mono);
  paint-order: stroke;
  stroke: rgba(5, 15, 25, 0.95);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.selected-value-label.ours { fill: var(--signal-cyan); }
.selected-value-label.cphkd { fill: var(--beacon-amber); }
.selected-value-label.tian { fill: var(--alert-crimson); }
.selected-value-label.agrawal { fill: var(--chart-violet); }

.chart-svg path {
  transition: d 0.35s ease;
}

.chart-hit {
  fill: transparent;
  cursor: crosshair;
}

.chart-tooltip {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.chart-tooltip-bg {
  fill: rgba(10, 15, 21, 0.74);
  stroke: var(--glass-border);
}

.chart-tooltip text {
  fill: var(--ghost-white);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-cursor {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-dasharray: 3 4;
}

.perf-controls {
  width: min(720px, 100%);
  display: grid;
  gap: 10px;
  align-self: end;
}

.real-cost-chart {
  width: min(760px, 100%);
  max-height: 390px;
  margin-top: 48px;
}

.real-chart-legend {
  width: min(720px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 18px;
  color: var(--mist-grey);
  font: 10px/1.4 var(--font-mono);
}

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

.real-chart-legend i {
  width: 17px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.real-chart-legend .ours { color: var(--signal-cyan); }
.real-chart-legend .cphkd { color: var(--beacon-amber); }
.real-chart-legend .tian { color: var(--alert-crimson); }
.real-chart-legend .agrawal { color: var(--chart-violet); }

.real-chart-legend > strong {
  color: var(--signal-cyan);
  letter-spacing: 0.1em;
}

.performance-analysis {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  font: 10px/1.5 var(--font-mono);
}

.load-overview {
  width: min(720px, 100%);
  display: grid;
  gap: 7px;
}

.scale-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mist-grey);
  font: 9px/1.2 var(--font-mono);
}

.scale-switch button {
  padding: 4px 8px;
  border: 1px solid rgba(91, 143, 170, 0.22);
  background: rgba(5, 15, 25, 0.7);
  color: var(--mist-grey);
  font: inherit;
  cursor: pointer;
}

.scale-switch button.active {
  border-color: var(--signal-cyan);
  color: var(--signal-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.scale-switch small {
  margin-left: auto;
  color: rgba(137, 161, 178, 0.62);
}

.load-progress {
  height: 3px;
  overflow: hidden;
  background: rgba(91, 143, 170, 0.14);
}

.load-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--signal-cyan), var(--beacon-amber));
  box-shadow: 0 0 8px var(--signal-cyan);
  transition: width 0.35s ease;
}

.load-progress.running span {
  animation: progressPulse 1.1s ease-in-out infinite;
}

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

.load-card {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(91, 143, 170, 0.18);
  background: rgba(5, 15, 25, 0.72);
  color: var(--mist-grey);
  text-align: left;
  font-family: var(--font-mono);
  cursor: pointer;
}

.load-card span,
.load-card small,
.load-card i {
  display: block;
}

.load-card span { font-size: 9px; letter-spacing: 0.12em; }
.load-card strong { display: block; margin: 2px 0; color: var(--ghost-white); font-size: 12px; }
.load-card small { overflow: hidden; color: var(--mist-grey); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.load-card i { margin-top: 3px; color: rgba(137, 161, 178, 0.58); font-size: 8px; font-style: normal; }
.load-card.medium { border-top-color: rgba(255, 184, 0, 0.5); }
.load-card.heavy { border-top-color: rgba(255, 126, 32, 0.65); }
.load-card.extreme { border-top-color: rgba(255, 42, 42, 0.7); }
.load-card.selected { border-color: var(--signal-cyan); background: rgba(0, 240, 255, 0.07); }
.load-card.completed i { color: var(--signal-cyan); }
.load-card.running { border-color: var(--beacon-amber); box-shadow: inset 0 0 12px rgba(255, 184, 0, 0.09); }

@keyframes progressPulse {
  0%, 100% { filter: brightness(0.9); }
  50% { filter: brightness(1.5); }
}

@keyframes metricValueSettle {
  0% { opacity: 0.72; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

.performance-analysis strong,
.performance-analysis span {
  padding: 7px 9px;
  border: 1px solid rgba(91, 143, 170, 0.18);
  background: rgba(5, 15, 25, 0.62);
}

.performance-analysis strong {
  color: var(--signal-cyan);
  display: grid;
  place-items: center;
  text-align: center;
}

.performance-analysis span {
  color: var(--mist-grey);
}

@media (max-width: 900px) {
  .performance-analysis { grid-template-columns: 1fr 1fr; }
  .load-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.y-unit {
  text-anchor: start;
}

.icon-button.active {
  border-color: rgba(0, 240, 255, 0.72);
  color: var(--signal-cyan);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.08);
}

.slider-row {
  display: grid;
  grid-template-columns: 120px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  color: var(--mist-grey);
}

input[type="range"] {
  accent-color: var(--signal-cyan);
}

.chain-panel {
  min-height: 90px;
  border-top: 1px solid var(--grid-line);
  padding: 9px 12px;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background:
    radial-gradient(circle at 50% 0, rgba(0, 240, 255, 0.05), transparent 40%),
    rgba(10, 15, 21, 0.14);
}

.chain-empty {
  align-self: center;
  color: var(--mist-grey);
  font: 10px/1.4 var(--font-mono);
}

.chain-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.chain-row.chain-updating .beads {
  animation: chainWindowForward 0.42s cubic-bezier(.22, .8, .3, 1) both;
}

.chain-row.backward.chain-updating .beads {
  animation-name: chainWindowBackward;
}

@keyframes chainWindowForward {
  0% { opacity: 0.55; transform: translateX(10px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes chainWindowBackward {
  0% { opacity: 0.55; transform: translateX(-10px); }
  100% { opacity: 1; transform: translateX(0); }
}

.chain-label {
  display: grid;
  gap: 2px;
  color: var(--mist-grey);
  font-family: var(--font-display);
}

.chain-label strong {
  color: var(--ghost-white);
  font-size: 12px;
}

.chain-label small {
  color: rgba(137, 161, 178, 0.68);
  font: 9px/1.2 var(--font-mono);
}

.beads {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 18px 3px 1px;
  scrollbar-width: thin;
  scrollbar-color: var(--grid-line) transparent;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent);
}

.bead {
  min-width: 52px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--grid-line);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--mist-grey);
  background: rgba(10, 15, 26, 0.76);
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  transition: border-color 0.24s ease, color 0.24s ease, background 0.24s ease, opacity 0.24s ease;
}

.bead.previous {
  border-color: rgba(0, 240, 255, 0.34);
  color: rgba(214, 225, 238, 0.76);
}

.bead.active {
  color: var(--void-navy);
  background: var(--signal-cyan);
  border-color: var(--signal-cyan);
  box-shadow: var(--glow-cyan);
  animation: chainStepIn 0.48s cubic-bezier(.22,.8,.3,1) both;
}

.bead.retrace {
  color: var(--void-navy);
  background: var(--beacon-amber);
  border-color: var(--beacon-amber);
  box-shadow: 0 0 6px rgba(255, 184, 0, 0.22);
}

.bead.retrace-head {
  position: relative;
  z-index: 2;
  animation: beadRetrace 0.58s cubic-bezier(.22, .8, .3, 1) both;
}

.dna-link {
  width: 14px;
  height: 1px;
  align-self: center;
  margin-left: -3px;
  margin-right: -3px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), transparent);
}

.dna-link.retrace-link {
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 184, 0, 0.16), var(--beacon-amber), rgba(255, 184, 0, 0.16));
  background-size: 200% 100%;
  box-shadow: 0 0 5px rgba(255, 184, 0, 0.42);
  animation: retraceLinkFlow 0.55s linear infinite;
}

@keyframes chainStepIn {
  0% { opacity: 0.45; transform: translateY(3px) scale(0.94); filter: none; }
  65% { opacity: 1; transform: translateY(0) scale(1.04); filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.55)); }
  100% { transform: translateY(0) scale(1); }
}

.inspector {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.packet-block {
  padding: 12px;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--grid-line);
}

.packet-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--glass-border);
  background: rgba(10, 15, 21, 0.42);
}

.packet-key {
  color: var(--mist-grey);
  font-family: var(--font-mono);
}

.packet-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.packet-row.flash {
  animation: packetDecode 0.34s cubic-bezier(.22,.8,.3,1), packetFlash 0.62s ease-out;
}

.proof-panel {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.proof-panel h3 {
  font-size: 15px;
  color: var(--ghost-white);
}

.proof-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(30, 42, 61, 0.75);
  padding-bottom: 7px;
}

.proof-row strong.pass {
  color: var(--signal-cyan);
}

.proof-row strong.warn {
  color: var(--beacon-amber);
}

.proof-row strong.fail {
  color: var(--alert-crimson);
}

pre {
  min-height: 150px;
  margin: 0;
  padding: 10px;
  color: var(--mist-grey);
  background: rgba(10, 15, 21, 0.42);
  border: 1px solid var(--glass-border);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
}

.formula-notes {
  border: 1px solid var(--glass-border);
  background: rgba(10, 15, 21, 0.34);
  padding: 8px 10px;
  color: var(--mist-grey);
  font-size: 11px;
}

.parameter-notes {
  margin-top: 12px;
  border: 1px solid rgba(68, 229, 255, 0.22);
  background: rgba(3, 12, 20, 0.72);
}

.parameter-notes summary {
  padding: 10px 12px;
  color: var(--cyan);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.parameter-grid {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.parameter-grid > div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(130, 173, 196, 0.12);
}

.parameter-grid span {
  color: var(--text-muted);
  font-size: 11px;
}

.parameter-grid strong {
  color: #d9f9ff;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.param-warning {
  color: var(--danger);
  line-height: 1.6;
}

.backend-status strong.pass { color: var(--cyan); }
.backend-status strong.fail { color: var(--danger); }

.benchmark-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--cyan);
  background: rgba(49, 210, 255, 0.07);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.measured-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px 0;
}

.measured-chart-card {
  min-width: 0;
  border: 1px solid rgba(91, 143, 170, 0.2);
  background: linear-gradient(180deg, rgba(11, 25, 39, 0.9), rgba(5, 15, 25, 0.82));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px 2px;
}

.chart-card-head span {
  color: var(--cyan);
  font: 10px/1.2 var(--mono);
  letter-spacing: 0.11em;
}

.chart-card-head h3 {
  margin: 4px 0 0;
  color: #eefcff;
  font-size: 14px;
}

.chart-card-head > strong {
  color: var(--text-muted);
  font: 11px/1.2 var(--mono);
}

.measured-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
}

.measure-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px currentColor);
}

.measure-point {
  stroke: #07131f;
  stroke-width: 1.5;
}

.measure-axis {
  fill: #7690a4;
  font: 9px var(--mono);
}

.measure-axis-title {
  fill: #a9c0d0;
  font: 10px var(--mono);
}

.measure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 14px 12px;
  color: #a9c0d0;
  font: 10px/1.4 var(--mono);
}

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

.measure-legend i {
  width: 14px;
  height: 2px;
  box-shadow: 0 0 5px currentColor;
}

.benchmark-empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--text-muted);
}

.benchmark-recovery {
  gap: 12px;
  text-align: center;
}

.benchmark-recovery strong {
  color: var(--signal-cyan);
  font-size: 15px;
}

.benchmark-recovery span {
  max-width: 560px;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .measured-chart-grid { grid-template-columns: 1fr; }
}

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

.formula-notes summary {
  cursor: pointer;
  color: var(--signal-cyan);
  font-family: var(--font-mono);
}

.formula-notes p {
  margin-top: 8px;
  line-height: 1.55;
}

.timeline {
  min-height: 120px;
  overflow: hidden;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  padding-bottom: 8px;
}

.log-stream {
  height: 82px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
  padding: 8px 12px;
}

.log-entry {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  padding: 7px 8px;
  background: rgba(10, 15, 21, 0.42);
}

.log-entry strong {
  display: block;
  font-family: var(--font-mono);
  color: var(--mist-grey);
  font-size: 11px;
}

.log-entry[data-type="ATTACK"],
.log-entry[data-type="ERROR"],
.log-entry[data-type="REVOKE"] {
  border-left-color: var(--alert-crimson);
}

.log-entry[data-type="ATTACK"] strong,
.log-entry[data-type="ERROR"] strong,
.log-entry[data-type="REVOKE"] strong {
  color: var(--alert-crimson);
}

.log-entry[data-type="SELF-HEAL"],
.log-entry[data-type="MUTUAL"],
.log-entry[data-type="OFFLINE"] {
  border-left-color: var(--beacon-amber);
}

.log-entry[data-type="SELF-HEAL"] strong,
.log-entry[data-type="MUTUAL"] strong,
.log-entry[data-type="OFFLINE"] strong {
  color: var(--beacon-amber);
}

.log-entry[data-type="BROADCAST"],
.log-entry[data-type="JOIN"],
.log-entry[data-type="CROSS"],
.log-entry[data-type="TEST"] {
  border-left-color: rgba(0, 240, 255, 0.6);
}

.log-entry[data-type="BROADCAST"] strong,
.log-entry[data-type="JOIN"] strong,
.log-entry[data-type="CROSS"] strong,
.log-entry[data-type="TEST"] strong {
  color: var(--signal-cyan);
}

.log-entry span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  color: var(--mist-grey);
  font-size: 12px;
  line-height: 1.35;
}

.security-list {
  width: min(920px, 100%);
  align-self: stretch;
  display: grid;
  gap: 10px;
}

.security-dashboard {
  width: min(1080px, 100%);
  display: grid;
  gap: 18px;
  color: var(--ghost-white);
}

.security-matrix-section,
.security-evidence-section {
  min-width: 0;
}

.security-section-head {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 5px;
}

.security-section-head > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.security-section-head span {
  color: var(--mist-grey);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.security-section-head strong {
  color: var(--ghost-white);
  font: 700 13px/1 var(--font-display-cjk);
}

.security-section-head small {
  color: rgba(139, 155, 189, 0.7);
  font: 10px/1.4 var(--font-body);
}

.security-matrix {
  min-width: 820px;
  border-bottom: 1px solid var(--grid-line);
}

.security-matrix-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: 150px repeat(7, minmax(64px, 1fr)) 80px;
  align-items: center;
  border-top: 1px solid rgba(31, 49, 72, 0.42);
  font: 11px/1 var(--font-mono);
}

.security-matrix-row.header {
  min-height: 34px;
  border-top: 0;
  border-bottom: 1px solid var(--grid-line);
  color: var(--mist-grey);
}

.security-matrix-row.header strong {
  text-align: center;
  font-weight: 600;
}

.security-matrix-row.header strong:first-child,
.scheme-name {
  padding-left: 10px;
  text-align: left;
}

.scheme-name {
  color: var(--ghost-white);
}

.capability,
.capability-score {
  text-align: center;
}

.capability.yes {
  color: var(--signal-cyan);
  font-size: 15px;
}

.capability.no {
  color: rgba(255, 42, 42, 0.72);
  font-size: 16px;
  font-weight: 300;
}

.capability-score {
  color: var(--mist-grey);
}

.security-matrix-row.featured {
  border-left: 3px solid var(--signal-cyan);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.11), rgba(0, 240, 255, 0.035));
}

.security-matrix-row.featured .scheme-name,
.security-matrix-row.featured .capability-score {
  color: var(--signal-cyan);
}

.security-matrix-row.featured .capability-score {
  font-size: 15px;
}

.security-evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.security-evidence-card {
  min-height: 202px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  padding: 14px 15px;
  border: 1px solid var(--grid-line);
  border-top: 2px solid var(--alert-crimson);
  background: rgba(12, 20, 32, 0.82);
  transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.security-evidence-card.pending {
  opacity: 0.56;
  border-top-color: var(--mist-grey);
}

.security-evidence-card.verified {
  animation: evidenceConfirm 0.34s ease-out;
}

.security-evidence-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.security-evidence-card h3 {
  color: var(--ghost-white);
  font: 700 14px/1.2 var(--font-display-cjk);
}

.security-evidence-card header strong {
  padding: 3px 7px;
  border: 1px solid var(--signal-cyan);
  color: var(--signal-cyan);
  font: 10px/1 var(--font-mono);
}

.security-evidence-card.pending header strong {
  border-color: var(--mist-grey);
  color: var(--mist-grey);
}

.security-evidence-card p,
.security-evidence-card li {
  color: var(--mist-grey);
  font: 11px/1.65 var(--font-body);
}

.security-evidence-card p {
  margin: 0;
}

.security-evidence-card ul {
  margin: 0;
  padding-left: 16px;
}

.security-evidence-card li::marker {
  color: var(--signal-cyan);
}

.security-retrigger {
  width: max-content;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 42, 42, 0.42);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 42, 42, 0.78);
  cursor: pointer;
  font: 11px/1 var(--font-body);
}

.security-retrigger:hover {
  border-color: var(--alert-crimson);
  color: var(--alert-crimson);
}

.security-retrigger:disabled {
  cursor: wait;
  opacity: 0.45;
}

@keyframes evidenceConfirm {
  0% { transform: translateY(3px); opacity: 0.55; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes pendingNode {
  to { stroke-dashoffset: -24; }
}

@keyframes actionButtonPulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(0, 240, 255, 0); }
  50% { box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.08); }
}

.chain-panel.hidden-for-view {
  display: none;
}

@media (max-width: 1440px) {
  .chain-row { grid-template-columns: 78px minmax(0, 1fr); }
  .bead { min-width: 48px; font-size: 9px; }
}

@media (max-height: 850px) {
  .chain-panel { min-height: 82px; padding-top: 6px; padding-bottom: 6px; gap: 5px; }
  .bead { height: 23px; }
  .stage-body.performance-stage { padding: 49px 14px 8px; }
  .healing-chart-panel { gap: 5px; padding: 6px 9px 8px; }
  .performance-stage .healing-chart { height: 230px; min-height: 220px; max-height: 230px; aspect-ratio: auto; }
  .healing-insight-panel { gap: 6px; padding: 9px 11px; }
  .healing-insight-head { padding-bottom: 6px; }
  .healing-highlight { padding: 7px 9px; }
  .healing-insight-list { gap: 3px; }
  .healing-insight-list article { padding: 4px 0; }
  .healing-insight-panel .paper-test-progress { padding: 6px 8px; }
  .healing-source-note { line-height: 1.35; }
}

@keyframes rekeyStepSpin {
  to { transform: rotate(360deg); }
}

@keyframes rekeyProgressIn {
  from { transform: scaleX(0); }
}

@keyframes rekeyLabelIn {
  from { opacity: 0; transform: translateX(4px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes isolationProgressIn {
  from { transform: scaleX(0); }
}

@keyframes isolationLinkScan {
  to { stroke-dashoffset: -22; }
}

@keyframes isolationLinkWithdraw {
  0% { opacity: 1; stroke-dashoffset: 0; }
  100% { opacity: 0.18; stroke-dashoffset: -34; }
}

@keyframes isolationTargetAcquire {
  to { stroke-dashoffset: -18; }
}

@keyframes isolationTargetConfirmed {
  0% { opacity: 0.3; transform: scale(1.28); }
  100% { opacity: 0.9; transform: scale(1); }
}

@keyframes isolationSlashDraw {
  from { stroke-dashoffset: 34; }
  to { stroke-dashoffset: 0; }
}

@keyframes isolationEvidenceIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes revokedPacketBlock {
  0% { opacity: 0.72; }
  45% { opacity: 1; }
  100% { opacity: 0.86; }
}

@keyframes rekeyButtonVerified {
  0% { transform: translateY(0); }
  45% { border-color: var(--ghost-white); }
  100% { transform: translateY(0); border-color: var(--signal-cyan); }
}

@keyframes rekeyOrbitSpin {
  to { transform: rotate(360deg); }
}

@keyframes rekeyDistributionWave {
  0% { opacity: 0.65; transform: scale(0.86); }
  100% { opacity: 0; transform: scale(1.42); }
}

@keyframes rekeyVerifiedRing {
  from { opacity: 0.25; transform: scale(1.12); }
  to { opacity: 0.76; transform: scale(1); }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-old(main-stage) {
  animation: stageLeave 0.14s ease-in both;
}

::view-transition-new(main-stage) {
  animation: stageEnter 0.2s ease-out both;
}

@keyframes stageLeave {
  to { opacity: 0; transform: translateY(-3px); }
}

@keyframes stageEnter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .security-dashboard { overflow-x: auto; }
  .security-evidence-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}

.security-item {
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--glass-border);
  padding: 14px;
  background: rgba(10, 15, 21, 0.44);
}

.tactical-tip {
  position: fixed;
  left: auto;
  right: 26px;
  top: auto;
  bottom: 92px;
  z-index: 25;
  width: min(420px, calc(100vw - 32px));
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border: 1px solid rgba(0, 240, 255, 0.26);
  background: rgba(8, 14, 22, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: var(--glow-cyan), 0 20px 44px rgba(0, 0, 0, 0.45);
  color: var(--ghost-white);
  font-family: var(--font-display-cjk);
  font-size: 14px;
}

.tactical-tip.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.tactical-tip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--signal-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
}

.threat-critical {
  color: var(--alert-crimson) !important;
  text-shadow: none;
  animation: none;
}

.security-item strong:first-child {
  font-family: var(--font-mono);
  color: var(--ghost-white);
}

.security-status {
  font-family: var(--font-mono);
  color: var(--secure-state);
  text-align: right;
}

.security-status.fail {
  color: var(--secure-state);
}

.security-status.alert {
  color: var(--alert-crimson);
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glassPulse {
  0%,
  100% {
    border-color: var(--glass-border);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 16px 38px rgba(0, 0, 0, 0.42);
  }
  50% {
    border-color: rgba(0, 240, 255, 0.18);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 16px 42px rgba(0, 0, 0, 0.46),
      0 0 14px rgba(0, 240, 255, 0.08);
  }
}

@keyframes edgeAlert {
  0% {
    opacity: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 42, 42, 0);
  }
  28% {
    opacity: 0.72;
    box-shadow: inset 0 0 0 1px rgba(255, 42, 42, 0.42);
  }
  100% {
    opacity: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 42, 42, 0);
  }
}

.threat-blocked {
  color: var(--signal-cyan) !important;
  text-shadow: none;
}

@keyframes threatBlink {
  50% {
    opacity: 0.35;
  }
}

@keyframes packetDecode {
  0% {
    opacity: 0.72;
    transform: translateX(3px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes broadcastPulse {
  0% {
    r: 42;
    opacity: 0.95;
  }
  100% {
    r: 250;
    opacity: 0;
  }
}

@keyframes radarWave {
  0% {
    r: 35;
    opacity: 0.5;
  }
  100% {
    r: 108;
    opacity: 0;
  }
}

@keyframes nodeBreath {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 13px rgba(0, 240, 255, 0.72));
  }
}

@keyframes failFlicker {
  0%,
  100% {
    opacity: 0;
  }
  18%,
  72% {
    opacity: 1;
  }
  36% {
    opacity: 0.25;
  }
}

@keyframes pathFlow {
  to {
    stroke-dashoffset: -36;
  }
}

@keyframes beadRetrace {
  0% {
    opacity: 0.32;
    transform: translateX(9px) scale(0.88);
    filter: drop-shadow(0 0 0 transparent);
  }
  62% {
    opacity: 1;
    transform: translateX(0) scale(1.09);
    filter: drop-shadow(0 0 12px var(--beacon-amber));
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: drop-shadow(0 0 5px rgba(255, 184, 0, 0.5));
  }
}

@keyframes retraceLinkFlow {
  to { background-position: -200% 0; }
}

@keyframes crimsonFlash {
  0%,
  100% {
    filter: none;
  }
  45% {
    filter: drop-shadow(0 0 10px var(--alert-crimson));
  }
}

@keyframes nodeArrival {
  0%,
  100% {
    transform: scale(1);
    filter: none;
  }
  46% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.36));
  }
}

@keyframes packetFlash {
  0% {
    border-color: rgba(0, 240, 255, 0.34);
    background: rgba(0, 240, 255, 0.035);
  }
  100% {
    border-color: rgba(30, 42, 61, 0.75);
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1160px) {
  .log-stream {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .log-entry:nth-child(n + 5) {
    display: none;
  }

  .dashboard {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto;
  }

  .panel-heading {
    border-right: 1px solid var(--grid-line);
    border-bottom: 0;
  }

  .packet-block {
    border-right: 1px solid var(--grid-line);
    border-bottom: 0;
  }
}

@media (max-width: 780px) {
  .stage-header,
  .stage-body,
  .chain-panel {
    width: 100%;
    min-width: 0;
  }

  .stage-header > div:first-child,
  .control-cluster {
    min-width: 0;
  }

  .performance-stage .healing-chart {
    width: 100%;
    height: auto;
    min-height: 190px;
    max-height: none;
    aspect-ratio: 2 / 1;
  }

  .control-cluster {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 3px;
  }

  .chain-row { grid-template-columns: 64px minmax(0, 1fr); }
  .beads { -webkit-mask-image: none; mask-image: none; }

  .log-stream {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-entry:nth-child(n + 3) {
    display: none;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    padding: 8px;
  }

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

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

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-button,
  .action-button {
    min-width: 104px;
    text-align: center;
  }

  .sidebar-divider {
    display: none;
  }

  .map-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .art-event-strip {
    top: 70px;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .art-event-strip > span,
  .art-event-strip > small {
    display: none;
  }

  .art-svg {
    padding-top: 72px;
  }

  .stage-body {
    min-height: 360px;
  }

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

  .panel-heading,
  .packet-block {
    border-right: 0;
    border-bottom: 1px solid var(--grid-line);
  }

  .security-item {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SecUAV-GKM presentation system · 2026-08
   Quiet surfaces by default; colour and light are reserved for live protocol
   state. These overrides intentionally leave all protocol renderers intact.
   ========================================================================== */

:root {
  /* Google-inspired Material 3 light roles from the supplied account UI. */
  --md-sys-color-primary: #0b57d0;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #c2e7ff;
  --md-sys-color-on-primary-container: #001d35;
  --md-sys-color-secondary: #00639b;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d3e3fd;
  --md-sys-color-on-secondary-container: #041e49;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-error: #b3261e;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-background: #f0f4f9;
  --md-sys-color-on-background: #1f1f1f;
  --md-sys-color-surface: #f0f4f9;
  --md-sys-color-on-surface: #1f1f1f;
  --md-sys-color-surface-variant: #e1e5eb;
  --md-sys-color-on-surface-variant: #444746;
  --md-sys-color-outline: #747775;
  --md-sys-color-outline-variant: #c4c7c5;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f8fafd;
  --md-sys-color-surface-container: #f0f4f9;
  --md-sys-color-surface-container-high: #e9eef6;
  --md-sys-color-surface-container-highest: #dde3ea;

  /* Compatibility aliases used by the protocol visualizers. */
  --void-navy: var(--md-sys-color-background);
  --panel-steel: var(--md-sys-color-surface-container-low);
  --surface-raised: var(--md-sys-color-surface-container);
  --surface-muted: var(--md-sys-color-surface-container-lowest);
  --surface-high: var(--md-sys-color-surface-container-high);
  --grid-line: var(--md-sys-color-outline-variant);
  --grid-line-soft: rgba(68, 71, 70, 0.16);
  --signal-cyan: var(--md-sys-color-primary);
  --signal-cyan-strong: var(--md-sys-color-on-primary-container);
  --primary-container: var(--md-sys-color-primary-container);
  --on-primary-container: var(--md-sys-color-on-primary-container);
  --beacon-amber: #8a4f00;
  --alert-crimson: var(--md-sys-color-error);
  --ghost-white: var(--md-sys-color-on-surface);
  --mist-grey: var(--md-sys-color-on-surface-variant);
  --text-tertiary: var(--md-sys-color-outline);
  --glass-bg: rgba(248, 250, 253, 0.96);
  --glass-bg-strong: rgba(255, 255, 255, 0.98);
  --glass-border: rgba(68, 71, 70, 0.16);
  --glow-cyan: 0 0 18px rgba(11, 87, 208, 0.14);
  --glow-red: 0 0 16px rgba(179, 38, 30, 0.12);
  --avatar-blue-fill: #d3e3fd;
  --avatar-blue-stroke: #0b57d0;
  --avatar-blue-label: #0842a0;
  --avatar-green-fill: #c4eed0;
  --avatar-green-stroke: #0f9d58;
  --avatar-green-label: #0d652d;
  --avatar-purple-fill: #e9ddff;
  --avatar-purple-stroke: #8430ce;
  --avatar-purple-label: #5e2a84;
  --avatar-orange-fill: #ffdcc2;
  --avatar-orange-stroke: #c26401;
  --avatar-orange-label: #7a4100;
  --google-amber: #f9ab00;
  --on-google-amber: #3c2f00;
  --font-display-cjk: "Noto Sans SC", Roboto, "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-display: Roboto, "Noto Sans SC", "Segoe UI", sans-serif;
  --font-body: Roboto, "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "Cascadia Mono", Consolas, monospace;

  /* Reduced Material 3 type scale used by this dense operations console. */
  --type-title-large-size: 22px;
  --type-title-large-line: 28px;
  --type-title-medium-size: 16px;
  --type-title-medium-line: 24px;
  --type-title-small-size: 14px;
  --type-title-small-line: 20px;
  --type-body-medium-size: 14px;
  --type-body-medium-line: 20px;
  --type-body-small-size: 12px;
  --type-body-small-line: 16px;
  --type-label-large-size: 14px;
  --type-label-large-line: 20px;
  --type-label-medium-size: 12px;
  --type-label-medium-line: 16px;
  --type-label-small-size: 11px;
  --type-label-small-line: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --motion-fast: 160ms;
  --motion-normal: 260ms;
  --ease-ui: cubic-bezier(.2, 0, 0, 1);
}

html {
  color-scheme: light;
  background: var(--void-navy);
}

body {
  color: var(--ghost-white);
  background:
    radial-gradient(circle at 50% -14%, rgba(11, 87, 208, 0.035), transparent 42%),
    var(--md-sys-color-background);
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line);
  font-weight: 400;
}

body::before {
  background: none;
  opacity: 0;
}

button,
select,
summary {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
summary:focus-visible,
.drone-group:focus-visible {
  outline: 2px solid var(--signal-cyan-strong);
  outline-offset: 2px;
}

.app-shell {
  height: 100vh;
  grid-template-rows: 76px minmax(0, 1fr) 108px;
  gap: 10px;
  padding: 10px;
}

.topbar,
.sidebar,
.stage,
.inspector,
.timeline {
  border-color: var(--grid-line-soft);
  border-radius: var(--radius-lg);
  background: var(--md-sys-color-surface-container-low);
  box-shadow: 0 1px 2px rgba(31, 31, 31, .08), 0 6px 20px rgba(31, 31, 31, .04);
  animation-duration: .28s;
}

.topbar { animation-delay: 0ms; }
.sidebar { animation-delay: 35ms; }
.stage { animation-delay: 65ms; }
.inspector { animation-delay: 90ms; }
.timeline { animation-delay: 110ms; }

.topbar {
  min-height: 74px;
  padding: 10px 14px;
  gap: 20px;
}

.brand {
  min-width: 360px;
  gap: 13px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-color: transparent;
  border-radius: 12px;
  background: var(--md-sys-color-primary-container);
}

.brand-mark svg {
  width: 33px;
  height: 33px;
  stroke: var(--signal-cyan-strong);
}

h1 {
  max-width: 620px;
  font-size: clamp(20px, 1.7vw, var(--type-title-large-size));
  font-weight: 500;
  line-height: var(--type-title-large-line);
  letter-spacing: 0;
}

.brand p {
  margin-top: 5px;
  color: var(--mist-grey);
  font: 400 var(--type-label-small-size)/var(--type-label-small-line) var(--font-body);
  letter-spacing: .1px;
}

.status-strip {
  flex: 1;
  flex-wrap: nowrap;
  gap: 6px;
}

.status-item,
.scenario-select {
  min-width: 108px;
  min-height: 52px;
  padding: 7px 9px;
  align-content: center;
  border-color: transparent;
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
}

.status-item span,
.scenario-select span {
  color: var(--text-tertiary);
  font-size: var(--type-label-small-size);
  line-height: var(--type-label-small-line);
}

.status-item strong,
.scenario-select select {
  color: var(--ghost-white);
  font-size: var(--type-label-medium-size);
  line-height: var(--type-label-medium-line);
  font-weight: 500;
}

.backend-status strong {
  color: var(--signal-cyan-strong);
}

.scenario-select {
  min-width: 136px;
}

.scenario-select select {
  min-width: 118px;
  padding: 3px 5px;
  border-color: transparent;
  background: transparent;
  border-radius: var(--radius-xs);
}

.dashboard {
  grid-template-columns: 172px minmax(640px, 1fr) 320px;
  gap: 10px;
}

.sidebar {
  padding: 12px 8px;
  gap: 6px;
}

.sidebar-label {
  display: block;
  margin: 3px 8px 5px;
  color: var(--md-sys-color-on-surface-variant);
  font: 500 var(--type-label-small-size)/var(--type-label-small-line) var(--font-body);
  letter-spacing: .5px;
  white-space: nowrap;
}

.nav-button,
.action-button,
.control-cluster button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 22px;
  transition:
    color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.nav-button,
.action-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  text-align: left;
  color: var(--mist-grey);
  background: transparent;
  font-size: var(--type-label-large-size);
  line-height: var(--type-label-large-line);
  font-weight: 500;
}

.nav-button::before,
.nav-button[data-view]::before {
  content: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button:hover,
.action-button:hover {
  color: var(--ghost-white);
  border-color: transparent;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.nav-button.active {
  color: var(--on-primary-container);
  border-color: transparent;
  background: var(--primary-container);
  box-shadow: none;
}

.action-button {
  min-height: 40px;
  font-weight: 500;
}

.action-button.primary {
  color: var(--md-sys-color-on-primary);
  border-color: transparent;
  background: var(--md-sys-color-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.24);
}

.action-button.primary .action-icon { color: var(--md-sys-color-on-primary); }

.action-icon {
  width: 18px;
  color: var(--signal-cyan);
  font: 600 12px/1 var(--font-mono);
  text-align: center;
}

.sidebar-divider {
  margin: 8px 4px 6px;
  border-color: rgba(192, 199, 208, .14);
}

.stage {
  view-transition-name: main-stage;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--md-sys-color-surface-container-lowest);
}

.stage-header {
  min-height: 64px;
  padding: 10px 14px;
  border-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
}

.stage-header > div:first-child {
  flex: 0 0 270px;
  min-width: 270px;
}

body[data-view="domain"] .stage-header > div:first-child {
  flex-basis: 190px;
  min-width: 190px;
}

body[data-view="domain"] .stage h2 {
  font-size: 20px;
}

.eyebrow {
  color: var(--md-sys-color-on-surface-variant);
  font: 500 var(--type-label-small-size)/var(--type-label-small-line) var(--font-body);
  letter-spacing: .5px;
}

.stage h2,
.inspector h2 {
  margin-top: 5px;
  color: var(--ghost-white);
  font-size: var(--type-title-large-size);
  font-weight: 500;
  line-height: var(--type-title-large-line);
  letter-spacing: 0;
}

.stage h2 {
  white-space: nowrap;
}

.control-cluster {
  min-width: 0;
  flex: 1;
  gap: 8px;
  padding-inline: 2px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: none;
}

.control-cluster::-webkit-scrollbar { display: none; }

body[data-view="domain"] .control-cluster {
  justify-content: flex-start;
}

body[data-view="domain"] .control-cluster button {
  padding-inline: 8px;
}

body[data-view="domain"] .target-chip {
  min-width: 90px;
}

body[data-view="domain"] .rekey-button {
  width: 138px;
}

.control-cluster button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  color: var(--md-sys-color-on-surface-variant);
  border-color: var(--md-sys-color-outline);
  border-radius: 18px;
  background: transparent;
  font-size: var(--type-label-medium-size);
  line-height: var(--type-label-medium-line);
  font-weight: 500;
}

.nav-button:active,
.action-button:active,
.control-cluster button:active {
  filter: brightness(1.12);
}

.control-cluster button:hover {
  color: var(--ghost-white);
  border-color: var(--md-sys-color-primary);
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

.control-cluster button.primary,
.control-cluster button.active {
  color: var(--on-primary-container);
  border-color: transparent;
  background: var(--primary-container);
  box-shadow: none;
}

.stage-body {
  padding: 12px 14px;
}

.metric,
.map-meta > div,
.packet-row,
.proof-row,
.parameter-grid > div,
.healing-highlight,
.paper-test-progress {
  border-color: transparent;
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
  box-shadow: none;
  backdrop-filter: none;
}

.metric strong,
.map-meta strong {
  color: var(--ghost-white);
  text-shadow: none;
}

.metric.changed strong,
.metric.is-updating strong {
  color: var(--signal-cyan-strong);
}

.chain-panel {
  border-color: var(--md-sys-color-outline-variant);
  background: var(--surface-muted);
}

.inspector {
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: var(--grid-line) transparent;
}

.panel-heading,
.packet-block,
.proof-panel {
  padding: 14px;
  border-color: var(--md-sys-color-outline-variant);
}

.proof-panel h3 {
  font-size: 14px;
}

.proof-row,
.packet-row {
  min-height: 36px;
}

#proofTrace {
  min-height: 88px;
  color: #b9c8dc;
  background: var(--surface-muted);
  border-color: var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-small-size);
  line-height: var(--type-body-small-line);
}

.formula-notes,
.parameter-notes {
  border-color: var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
}

.timeline {
  min-height: 106px;
  background: var(--md-sys-color-surface-container-low);
}

.timeline-header {
  min-height: 28px;
  padding: 6px 12px;
  border-color: var(--grid-line-soft);
}

.timeline-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.timeline-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal-cyan);
  box-shadow: 0 0 8px rgba(25, 215, 229, .5);
}

#timelineMode {
  color: var(--text-tertiary);
  font: 500 var(--type-label-small-size)/var(--type-label-small-line) var(--font-body);
}

.log-stream {
  height: 76px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
  padding: 6px 10px 8px;
}

.log-entry {
  padding: 6px 8px;
  border-color: transparent;
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
}

.log-entry strong {
  font-size: var(--type-label-small-size);
  line-height: var(--type-label-small-line);
}

.log-entry span {
  color: var(--mist-grey);
  font-size: var(--type-body-small-size);
  line-height: var(--type-body-small-line);
}

.security-dashboard,
.security-list {
  width: 100%;
}

.security-evidence-card,
.security-item,
.healing-chart-panel,
.healing-insight-panel,
.performance-chart-panel,
.performance-insight-panel {
  border-color: var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container);
  box-shadow: none;
}

.security-evidence-card {
  min-height: 190px;
}

.security-evidence-card p,
.security-evidence-card li,
.healing-insight-list p,
.performance-insight-list p {
  color: var(--mist-grey);
  font-size: var(--type-body-small-size);
  line-height: var(--type-body-small-line);
}

/* Google Account-inspired visual language: quiet canvas, white work surfaces,
   blue selection containers, and identity-bearing circular nodes. */
.app-shell {
  background: var(--md-sys-color-background);
}

.topbar,
.sidebar,
.timeline {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.stage,
.inspector {
  border-color: transparent;
  background: var(--md-sys-color-surface-container-lowest);
  box-shadow: 0 1px 2px rgba(31, 31, 31, .08);
}

.stage-header {
  background: var(--md-sys-color-surface-container-lowest);
}

.status-item,
.scenario-select,
.log-entry {
  background: var(--md-sys-color-surface-container-lowest);
}

.brand-mark {
  background: var(--md-sys-color-secondary-container);
}

.brand-mark svg {
  stroke: var(--md-sys-color-primary);
}

.backend-status strong,
.metric.changed strong,
.metric.is-updating strong {
  color: var(--md-sys-color-primary);
}

.nav-button {
  min-height: 48px;
  gap: 10px;
  padding-inline: 10px 14px;
}

.nav-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-primary);
}

.nav-button[data-view="cross"] .nav-icon {
  color: var(--avatar-purple-label);
  background: var(--avatar-purple-fill);
}

.nav-button[data-view="perf"] .nav-icon {
  color: var(--avatar-green-label);
  background: var(--avatar-green-fill);
}

.nav-button[data-view="healing"] .nav-icon {
  color: var(--avatar-orange-label);
  background: var(--avatar-orange-fill);
}

.nav-button[data-view="security"] .nav-icon {
  color: var(--md-sys-color-error);
  background: var(--md-sys-color-error-container);
}

.nav-button.active {
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}

.nav-button.active .nav-icon {
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
}

.nav-button.active:hover {
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}

.nav-button:hover,
.action-button:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-high);
}

.action-button.primary {
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
  box-shadow: none;
}

.control-cluster button {
  color: var(--md-sys-color-on-surface-variant);
  border-color: var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container-lowest);
}

.control-cluster button.primary,
.control-cluster button.active {
  color: var(--md-sys-color-on-primary-container);
  border-color: transparent;
  background: var(--md-sys-color-primary-container);
}

.icon-button.primary-action {
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container-lowest);
}

.rekey-step {
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.target-chip {
  border-color: transparent;
  border-left: 3px solid var(--md-sys-color-outline);
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container-high);
}

.target-chip.active {
  border-left-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
}

.target-chip.active strong,
.target-chip.active small,
.target-chip.active i {
  color: var(--md-sys-color-on-primary-container);
}

.nav-button:active,
.action-button:active,
.control-cluster button:active {
  filter: brightness(.96);
}

.metric,
.map-meta > div,
.packet-row,
.proof-row,
.parameter-grid > div,
.healing-highlight,
.paper-test-progress {
  background: var(--md-sys-color-surface-container);
}

.chain-panel {
  background: var(--md-sys-color-surface-container-lowest);
}

.drone-node .selection-ring {
  transition: fill var(--motion-fast) var(--ease-ui), stroke var(--motion-fast) var(--ease-ui);
}

.drone-node:hover .selection-ring,
.drone-node:focus-visible .selection-ring {
  stroke: var(--md-sys-color-outline);
}

.drone-node.selected .selection-ring {
  fill: color-mix(in srgb, var(--md-sys-color-primary-container) 58%, transparent);
  stroke: var(--md-sys-color-primary);
  stroke-width: 2;
  stroke-dasharray: none;
}

.drone-avatar-label {
  text-anchor: middle;
  pointer-events: none;
  font: 600 9px/1 var(--font-display);
  letter-spacing: .1px;
}

.avatar-tone-0 .drone-dot.active { fill: var(--avatar-blue-fill); stroke: var(--avatar-blue-stroke); }
.avatar-tone-0 .drone-avatar-label { fill: var(--avatar-blue-label); }
.avatar-tone-1 .drone-dot.active { fill: var(--avatar-green-fill); stroke: var(--avatar-green-stroke); }
.avatar-tone-1 .drone-avatar-label { fill: var(--avatar-green-label); }
.avatar-tone-2 .drone-dot.active { fill: var(--avatar-purple-fill); stroke: var(--avatar-purple-stroke); }
.avatar-tone-2 .drone-avatar-label { fill: var(--avatar-purple-label); }
.avatar-tone-3 .drone-dot.active { fill: var(--avatar-orange-fill); stroke: var(--avatar-orange-stroke); }
.avatar-tone-3 .drone-avatar-label { fill: var(--avatar-orange-label); }

.event-active .drone-node .drone-dot.active {
  stroke: var(--md-sys-color-primary);
  stroke-width: 2.25;
  filter: drop-shadow(0 2px 4px rgba(11, 87, 208, 0.18));
}

.event-active .avatar-tone-0 .drone-dot.active { fill: var(--avatar-blue-fill); }
.event-active .avatar-tone-0 .drone-avatar-label { fill: var(--avatar-blue-label); }
.event-active .avatar-tone-1 .drone-dot.active { fill: var(--avatar-green-fill); }
.event-active .avatar-tone-1 .drone-avatar-label { fill: var(--avatar-green-label); }
.event-active .avatar-tone-2 .drone-dot.active { fill: var(--avatar-purple-fill); }
.event-active .avatar-tone-2 .drone-avatar-label { fill: var(--avatar-purple-label); }
.event-active .avatar-tone-3 .drone-dot.active { fill: var(--avatar-orange-fill); }
.event-active .avatar-tone-3 .drone-avatar-label { fill: var(--avatar-orange-label); }

.drone-node.mutual-candidate .drone-dot.active {
  fill: var(--google-amber);
  stroke: var(--google-amber);
}

.drone-node.mutual-candidate .drone-avatar-label {
  fill: var(--on-google-amber);
}

.status-joining .drone-avatar-label,
.status-revoking .drone-avatar-label,
.status-healing .drone-avatar-label,
.status-offline .drone-avatar-label {
  fill: var(--beacon-amber);
}

.status-revoked .drone-avatar-label {
  fill: var(--md-sys-color-error);
}

.art-event-strip,
.art-event-strip[data-event="migration"] {
  border-bottom-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
}

.tree-node {
  fill: var(--md-sys-color-surface-container-highest);
  stroke: var(--md-sys-color-outline);
  filter: none;
}

.tree-node.leaf {
  fill: var(--md-sys-color-secondary-container);
  stroke: var(--md-sys-color-primary);
}

.tree-node.leaf.vacant {
  fill: var(--md-sys-color-surface-container);
  stroke: var(--md-sys-color-outline-variant);
}

.tree-label.vacant,
.tree-sub-label.vacant {
  fill: var(--md-sys-color-outline);
}

.tree-edge,
.chart-grid {
  stroke: var(--md-sys-color-outline-variant);
}

.bead {
  color: var(--md-sys-color-on-surface-variant);
  border-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-highest);
}

.bead.previous {
  color: var(--md-sys-color-on-surface-variant);
  border-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-highest);
  opacity: 1;
}

.bead.active {
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  box-shadow: 0 2px 7px rgba(11, 87, 208, 0.18);
  opacity: 1;
}

/* Keep semantic key states fully legible while the chain window moves. */
@keyframes chainWindowForward {
  0% { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

@keyframes chainWindowBackward {
  0% { transform: translateX(-8px); }
  100% { transform: translateX(0); }
}

@keyframes chainStepIn {
  0% { transform: translateY(2px) scale(0.96); filter: none; }
  70% { transform: translateY(0) scale(1.03); filter: drop-shadow(0 2px 5px rgba(11, 87, 208, 0.2)); }
  100% { transform: translateY(0) scale(1); filter: none; }
}

#proofTrace {
  color: var(--md-sys-color-on-surface-variant);
}

.security-evidence-card,
.security-item,
.healing-chart-panel,
.healing-insight-panel,
.paper-performance-main,
.performance-chart-panel,
.performance-insight-panel {
  border-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-lowest);
}

.chapter9-tab {
  color: var(--md-sys-color-on-surface-variant);
  border-color: transparent;
  background: var(--md-sys-color-surface-container-high);
}

.chapter9-tab:hover:not(:disabled) {
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-highest);
}

.chapter9-tab.active {
  color: var(--md-sys-color-on-primary-container);
  border-color: transparent;
  background: var(--md-sys-color-primary-container);
}

.chapter9-tab i,
.chapter9-tab.active i {
  color: currentColor;
}

.healing-insight-panel .paper-test-progress {
  border-color: var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
}

.chart-axis-label {
  fill: var(--md-sys-color-on-surface-variant);
}

.tactical-tip {
  right: 20px;
  bottom: 116px;
  border-color: var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container-high);
  backdrop-filter: none;
  box-shadow: 0 12px 30px rgba(31,31,31,.14);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--md-sys-color-surface-container-low);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--md-sys-color-surface-container-low);
  border-radius: 8px;
  background: var(--md-sys-color-outline-variant);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-outline);
}

::view-transition-old(main-stage) {
  animation: stageLeave 0.12s ease-in both;
}

::view-transition-new(main-stage) {
  animation: stageEnter 0.24s var(--ease-ui) both;
}

@media (max-width: 1500px) {
  .dashboard { grid-template-columns: 156px minmax(600px, 1fr) 300px; }
  .status-item { min-width: 96px; }
  .scenario-select { min-width: 126px; }
  .brand { min-width: 330px; }
  .brand p { display: none; }
}

@media (max-width: 1240px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; grid-template-rows: auto auto 106px; }
  .topbar { flex-wrap: wrap; }
  .brand { min-width: min(100%, 520px); }
  .status-strip { flex-basis: 100%; overflow-x: auto; justify-content: flex-start; }
  .status-item,
  .scenario-select { flex: 1 1 110px; }
  .dashboard { grid-template-columns: 144px minmax(0, 1fr); }
  .inspector {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: auto auto;
    overflow: visible;
  }
  .inspector > * { align-self: start; }
  .panel-heading { grid-column: 1; grid-row: 1; }
  .packet-block { grid-column: 1; grid-row: 2; }
  .proof-panel { grid-column: 2; grid-row: 1 / span 2; }
  .packet-block { align-content: start; }
  .panel-heading,
  .packet-block { border-right: 1px solid var(--grid-line-soft); border-bottom: 0; }
  .stage { min-height: 650px; }
}

@media (max-width: 900px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .topbar,
  .sidebar,
  .stage,
  .inspector,
  .timeline { min-width: 0; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 6px;
  }
  .sidebar-label,
  .sidebar-divider { display: none; }
  .nav-button,
  .action-button { width: auto; min-width: 128px; justify-content: center; }
  .nav-button.active { box-shadow: inset 0 -3px 0 var(--signal-cyan); }
  .inspector { grid-template-columns: 1fr 1fr; }
  .panel-heading,
  .packet-block { grid-column: auto; grid-row: auto; }
  .proof-panel { grid-column: 1 / -1; grid-row: auto; }
  .panel-heading { border-bottom: 1px solid var(--grid-line-soft); }
}

@media (max-width: 620px) {
  html,
  body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { font-size: var(--type-body-medium-size); }
  .app-shell { width: 100%; min-width: 0; padding: 4px; gap: 6px; }
  .topbar { width: 100%; min-width: 0; padding: 10px; }
  .brand { min-width: 0; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  h1 { font-size: 17px; }
  .status-strip {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: stretch;
    margin: 0;
  }
  .status-item,
  .scenario-select { flex: 0 0 124px; }
  .nav-button,
  .action-button { min-width: 116px; padding: 0 9px; }
  .stage { min-height: 600px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .stage-header { min-height: auto; align-items: stretch; }
  body[data-view] .stage-header > div:first-child { flex-basis: auto; min-width: 0; }
  .stage h2 { white-space: normal; }
  .control-cluster { width: 100%; min-width: 0; justify-content: flex-start; }
  .stage h2,
  .inspector h2 { font-size: 19px; }
  .control-cluster button { min-height: 40px; }
  .stage-body .topology-svg {
    height: calc(100% - 96px);
    min-height: 300px;
    margin-top: 96px;
  }
  .inspector { grid-template-columns: 1fr; }
  .proof-panel { grid-column: auto; }
  .panel-heading,
  .packet-block { border-right: 0; }
  .security-evidence-grid { grid-template-columns: 1fr; }
  .timeline { min-height: 112px; }
}

/* Material 3 label floor: keep supporting copy legible in a presentation. */
.target-chip small,
.chapter9-tab i,
.chapter9-chart-title span,
.healing-metrics .metric span,
.healing-metrics .metric strong small,
.healing-insight-head > span,
.healing-insight-head > small,
.healing-insight-list i,
.healing-source-note,
.art-event-strip > span,
.art-event-strip > small,
.selected-value-label,
.load-card span,
.load-card small,
.load-card i,
.chain-label small,
.security-section-head small,
.security-evidence-card header strong {
  font-size: var(--type-label-small-size);
  line-height: var(--type-label-small-line);
  letter-spacing: .1px;
}

.paper-performance-main .paper-legend,
.healing-legend,
.healing-scale-row,
.healing-insight-panel .paper-test-progress p,
.paper-constraint-note,
.performance-legend,
.chain-empty,
.measure-axis-title,
.measure-legend {
  font-size: var(--type-body-small-size);
  line-height: var(--type-body-small-line);
}

.measure-axis,
.bead,
.uav-telemetry text,
.tree-sub-label,
.edge-note,
.edge-note.active,
.rekey-caption text {
  font-size: 10px;
}
