:root {
  color-scheme: dark;
  --bg: #050816;
  --bg-2: #0b1230;
  --panel: rgba(8, 12, 28, 0.82);
  --panel-strong: rgba(10, 16, 38, 0.96);
  --border: rgba(143, 168, 255, 0.18);
  --text: #eef4ff;
  --muted: #97a6ce;
  --accent: #88f6ff;
  --accent-2: #8f7cff;
  --accent-3: #ffc66f;
  --shadow: 0 28px 80px rgba(2, 6, 20, 0.48);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(103, 232, 249, 0.6) rgba(2, 8, 22, 0.78);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(2, 8, 22, 0.78);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(2, 8, 22, 0.92);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(165, 243, 252, 0.82), rgba(56, 189, 248, 0.42)),
    rgba(34, 211, 238, 0.38);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.24);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(224, 251, 255, 0.94), rgba(56, 189, 248, 0.62)),
    rgba(34, 211, 238, 0.5);
}

*::-webkit-scrollbar-corner {
  background: rgba(2, 8, 22, 0.78);
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "SF Pro Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(136, 246, 255, 0.1), transparent 18rem),
    radial-gradient(circle at 85% 20%, rgba(143, 124, 255, 0.12), transparent 22rem),
    radial-gradient(circle at 50% 85%, rgba(255, 198, 111, 0.08), transparent 18rem),
    linear-gradient(180deg, #030511 0%, #060a18 36%, #04060f 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1px),
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px),
    radial-gradient(circle at 48% 62%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1px),
    radial-gradient(circle at 32% 80%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1px),
    radial-gradient(circle at 88% 70%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1px);
  background-size: 360px 360px, 420px 420px, 340px 340px, 440px 440px, 380px 380px;
  opacity: 0.55;
}

.app-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.topbar,
.workspace {
  width: 100%;
}

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

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 0 22px rgba(136, 246, 255, 0.24);
}

.brand-wordmark {
  width: clamp(118px, 16vw, 270px);
  height: 32px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 10px rgba(136, 246, 255, 0.2));
}

.brand-wordmark-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.header-workflow {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.has-tooltip {
  position: relative;
}

.has-tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 200;
  width: max-content;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid rgba(143, 168, 255, 0.24);
  border-radius: 7px;
  color: var(--text);
  background: rgba(5, 8, 22, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  font-size: 11px;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.has-tooltip:hover::before,
.has-tooltip:focus-within::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.js-hud-tooltips .has-tooltip::before {
  display: none;
}

.hud-tooltip {
  position: fixed;
  z-index: 500;
  width: max-content;
  max-width: min(280px, calc(100vw - 20px));
  padding: 7px 9px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 3px;
  color: var(--text);
  background: rgba(2, 8, 22, 0.95);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36), 0 0 18px rgba(34, 211, 238, 0.18);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
  pointer-events: none;
  text-transform: none;
}

.hud-tooltip[hidden] {
  display: none;
}

body.modal-open > .app-shell .has-tooltip::before,
body.modal-open > .hud-tooltip {
  display: none !important;
}

.eyeline,
.panel-label,
.metric-label,
.search-wrap span,
.toggle-wrap span {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-wrap span,
.top-toggle span,
.top-interval span {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.3rem);
  line-height: 1;
}

h2 {
  margin-top: 2px;
  font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  line-height: 1.08;
  max-width: none;
}

.metrics,
.graph-panel,
.detail-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(8, 12, 28, 0.92), rgba(8, 12, 28, 0.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.metrics,
.detail-panel {
  border-radius: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.metric-card {
  display: flex;
  min-height: 52px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background:
    radial-gradient(circle at top, rgba(136, 246, 255, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(136, 246, 255, 0.08);
}

.metric-card strong {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.metric-card.compact {
  min-height: 52px;
}

.graph-stats-overlay {
  gap: 5px;
  padding: 5px;
  background: rgba(4, 8, 22, 0.64);
  box-shadow: 0 18px 42px rgba(2, 6, 20, 0.26);
}

.graph-metrics-corner {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 18;
  width: auto;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(74px, auto));
  opacity: 0.82;
  backdrop-filter: blur(16px);
}

.graph-stats-overlay .metric-card {
  min-height: 34px;
  padding: 6px 8px;
  gap: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.graph-stats-overlay .metric-label {
  font-size: 10px;
}

.graph-stats-overlay .metric-card strong {
  font-size: 1rem;
}

.stat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(136, 246, 255, 0.06);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.stat-toggle input {
  inline-size: 14px;
  block-size: 14px;
}

.ghost-button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(136, 246, 255, 0.24);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(136, 246, 255, 0.12), rgba(136, 246, 255, 0.06));
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ghost-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.ghost-button.primary {
  background: linear-gradient(180deg, rgba(136, 246, 255, 0.2), rgba(136, 246, 255, 0.1));
  color: var(--text);
}

.ghost-button.danger {
  border-color: rgba(255, 154, 169, 0.36);
  background: rgba(255, 154, 169, 0.12);
  color: #ffb5c0;
}

.source-badge.subtle {
  font-size: 12px;
}

.refresh-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ghost-button:hover {
  background: rgba(136, 246, 255, 0.16);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.top-toggle,
.top-interval {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-toggle input {
  inline-size: 16px;
  block-size: 16px;
}

.top-interval input {
  width: 54px;
  height: 28px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.88);
  color: var(--text);
  text-align: center;
}

.search-group {
  display: flex;
  flex: 1 1 300px;
  align-items: center;
  gap: 6px;
  min-width: 220px;
}

.search-wrap {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.search-wrap input {
  height: 34px;
  width: 100%;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.88);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
}

.search-wrap input:focus {
  outline: 2px solid rgba(136, 246, 255, 0.28);
  outline-offset: 1px;
}

.search-wrap input:disabled {
  opacity: 0.58;
  cursor: wait;
}

.search-button {
  flex: 0 0 auto;
  height: 34px;
  min-width: 34px;
  width: 34px;
  padding: 0;
}

.search-icon-button {
  display: inline-grid;
  place-items: center;
}

.search-icon,
.autopilot-launch-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.toggle-wrap input {
  inline-size: 14px;
  block-size: 14px;
}

.interval-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-wrap {
  display: inline-flex;
  flex: 1 1 128px;
  min-width: 118px;
  align-items: center;
  gap: 6px;
}

.filter-wrap.short {
  flex: 0 0 auto;
  min-width: 86px;
}

.filter-wrap input {
  height: 34px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.88);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}

.filter-wrap.short span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.filter-wrap.short input {
  width: 48px;
  text-align: center;
}

.compact-button {
  height: 34px;
  min-width: 84px;
  border-radius: 8px;
}

.interval-wrap span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interval-wrap input {
  width: 64px;
  height: 30px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.88);
  color: var(--text);
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.36fr);
  gap: 14px;
}

.graph-panel {
  position: relative;
  min-height: 0;
  border-radius: 8px;
}

.graph-canvas-wrap {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  border-radius: 8px;
}

.graph-canvas-layer {
  display: block;
  width: 100%;
  height: 760px;
}

.graph-canvas-underlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#graphCanvas {
  position: relative;
  z-index: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#graphFlowCanvas {
  z-index: 2;
}

#graphNodeCanvas {
  z-index: 3;
}

.canvas-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: block;
  max-width: none;
  padding: 0;
  color: rgba(205, 218, 255, 0.78);
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-overlay p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-overlay:has(#hoverLabel[data-mode]) {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

#hoverLabel[data-mode] {
  overflow: visible;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

#hoverLabel[data-mode="partial"] {
  color: #b8f7d4;
}

#hoverLabel[data-mode="warning"] {
  color: #ffc66f;
}

#hoverLabel[data-mode="success"] {
  color: #86efac;
}

.graph-tooltip {
  position: absolute;
  z-index: 30;
  max-width: min(320px, calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 198, 111, 0.45);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.75);
  color: var(--text);
  opacity: 0.75;
  pointer-events: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.busy-indicator {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(136, 246, 255, 0.24);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.84);
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 12px 34px rgba(2, 6, 20, 0.28);
  backdrop-filter: blur(16px);
}

.busy-indicator[hidden] {
  display: none;
}

.busy-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(136, 246, 255, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}

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

.graph-tooltip strong,
.graph-tooltip span,
.graph-tooltip small {
  display: block;
}

.graph-tooltip strong {
  font-size: 13px;
  line-height: 1.25;
}

.graph-tooltip span {
  margin-top: 5px;
  color: rgba(238, 244, 255, 0.88);
  font-size: 12px;
  line-height: 1.35;
}

.graph-tooltip small {
  margin-top: 7px;
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 800;
}

.graph-floating-controls {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 20;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  opacity: 0.24;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: auto;
}

.graph-floating-controls:hover,
.graph-floating-controls:focus-within {
  opacity: 1;
}

.filter-sidebar-drawer {
  position: absolute;
  right: 0;
  top: 33.333%;
  width: 36px;
  height: 34%;
  min-height: 220px;
  z-index: 34;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.filter-sidebar-drawer::before {
  content: "";
  position: absolute;
  right: 0;
  top: 24%;
  width: 2px;
  height: 52%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(224, 251, 255, 0.3), rgba(34, 211, 238, 0.95), rgba(143, 124, 255, 0.5));
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.78), 0 0 22px rgba(34, 211, 238, 0.36);
  opacity: 0.82;
  transition: opacity 0.16s ease, box-shadow 0.16s ease;
}

.filter-sidebar-drawer::after {
  content: "<<";
  position: absolute;
  right: 4px;
  top: 50%;
  color: rgba(224, 251, 255, 0.94);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.12em;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
  transform: translateY(-50%);
}

.filter-sidebar-drawer:hover::before,
.filter-sidebar-drawer:focus-visible::before {
  opacity: 1;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.95), 0 0 32px rgba(34, 211, 238, 0.58);
}

.filter-sidebar-drawer.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.filter-sidebar-drawer:focus-visible {
  outline: 2px solid rgba(136, 246, 255, 0.72);
  outline-offset: -2px;
}

.js-hud-tooltips .filter-sidebar-drawer::before {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  clip-path: none;
}

.filter-sidebar {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 29;
  display: grid;
  gap: 10px;
  width: min(240px, calc(100% - 28px));
  max-height: min(76%, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: rgba(2, 8, 22, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36), 0 0 28px rgba(34, 211, 238, 0.16);
  backdrop-filter: blur(16px);
}

.filter-sidebar.is-visible {
  display: grid;
}

.filter-sidebar-section {
  display: grid;
  gap: 8px;
}

.new-node-floating {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 20;
  pointer-events: auto;
  opacity: 0.24;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.new-node-floating:hover,
.new-node-floating:focus-within {
  opacity: 1;
}

.map-yoda-button {
  background: rgba(5, 8, 22, 0.42);
}

.map-yoda-button:disabled,
.map-yoda-button.is-disabled,
.map-view-button:disabled,
.map-view-button.is-disabled {
  cursor: default;
  opacity: 0.36;
  filter: grayscale(0.5);
}

.map-yoda-button .yoda-avatar,
.selection-yoda-button .yoda-avatar {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.new-node-icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(136, 246, 255, 0.3);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.82);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32), 0 0 18px rgba(136, 246, 255, 0.1);
}

.new-node-icon-button:hover,
.new-node-icon-button:focus-visible {
  background: rgba(136, 246, 255, 0.18);
  transform: translateY(-1px);
}

.new-node-icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.zoom-floating {
  display: inline-grid;
  grid-template-columns: 34px 52px 34px 34px 34px;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px 6px;
  border: 1px solid rgba(136, 246, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.cluster-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(136, 246, 255, 0.28);
  border-radius: 999px;
  background: rgba(136, 246, 255, 0.18);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 0 18px rgba(136, 246, 255, 0.12);
}

.cluster-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cluster-icon-button.is-off {
  border-color: rgba(151, 166, 206, 0.24);
  background: rgba(5, 8, 22, 0.66);
  color: var(--muted);
  opacity: 0.62;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.cluster-icon-button:hover,
.cluster-icon-button:focus-visible {
  background: rgba(136, 246, 255, 0.24);
  transform: translateY(-1px);
}

.zoom-icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(136, 246, 255, 0.28);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.76);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.zoom-icon-button:hover {
  background: rgba(136, 246, 255, 0.14);
}

.zoom-icon-button:disabled,
.icon-button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.history-nav-button {
  transition: opacity 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.zoom-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoom-level {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  border-radius: 999px;
  padding: 5px 4px;
}

.zoom-level:hover,
.zoom-level:focus-visible {
  color: #67e8f9;
  background: rgba(136, 246, 255, 0.12);
  outline: none;
}

.timeline-strip {
  display: inline-flex;
  flex: 0 1 284px;
  align-items: center;
  gap: 6px;
  min-width: 252px;
  padding: 3px 5px 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.timeline-strip.tour-active {
  border-color: rgba(255, 198, 111, 0.58);
  background: rgba(255, 198, 111, 0.1);
  box-shadow: 0 0 26px rgba(255, 198, 111, 0.16);
}

.timeline-strip .ghost-button,
.timeline-strip .icon-button {
  height: 28px;
}

.timeline-strip .icon-button {
  width: 28px;
}

.timeline-strip .ghost-button.is-active {
  border-color: rgba(255, 198, 111, 0.72);
  background: linear-gradient(180deg, rgba(255, 198, 111, 0.28), rgba(255, 198, 111, 0.14));
  color: #ffdf9e;
}

#tourButton {
  width: 34px;
  min-width: 34px;
  white-space: nowrap;
}

.tour-counter {
  min-width: 38px;
  color: #ffc66f;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.tour-counter[hidden] {
  display: none;
}

.timeline-days-wrap {
  display: inline-grid;
  grid-template-columns: 42px auto;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.timeline-days-wrap input {
  width: 42px;
  height: 28px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 7px;
  background: rgba(5, 8, 22, 0.86);
  color: var(--text);
  text-align: center;
  font-size: 12px;
}

.detail-panel {
  padding: 18px;
}

.detail-heading,
.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-heading h3 {
  min-width: 0;
}

.detail-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.selection-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  margin-left: auto;
  padding: 1px;
  flex-shrink: 0;
}

.timeline-badge {
  border: 1px solid rgba(255, 198, 111, 0.38);
  border-radius: 999px;
  background: rgba(255, 198, 111, 0.13);
  color: #ffd391;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.timeline-badge:hover {
  background: rgba(255, 198, 111, 0.22);
}

.selection-yoda-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #dffcff;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.selection-yoda-button:hover {
  background: transparent;
}

.selection-view-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selection-slug-always {
  margin: 8px 0 0;
  min-width: 0;
  overflow: hidden;
  color: #67e8f9;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copyable-slug {
  position: relative;
  cursor: copy;
  user-select: text;
  -webkit-user-select: text;
}

.copyable-slug.is-copy-confirmed::after,
.copyable-slug.is-copy-failed::after {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.copyable-slug.is-copy-confirmed::after {
  content: "Copied";
  color: #b8f7d4;
  background: rgba(111, 232, 168, 0.14);
}

.copyable-slug.is-copy-failed::after {
  content: "Copy failed";
  color: #ffb5c0;
  background: rgba(255, 154, 169, 0.14);
}

.ui-version {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-decoration: none;
}

.ui-version:hover {
  color: var(--accent);
  text-decoration: underline;
}

.ui-version-link {
  border: 0;
  background: transparent;
}

.runtime-version-group {
  display: inline-flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 9px;
  min-width: 0;
  margin-right: clamp(14px, 2vw, 28px);
  white-space: nowrap;
}

.runtime-version-group .ui-version {
  grid-column: auto;
  margin: 0;
}

.gbrain-version {
  color: rgba(184, 247, 212, 0.82);
  font-size: 11px;
  font-weight: 750;
}

.selection-context-toggle {
  display: none;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(136, 246, 255, 0.2);
  border-radius: 999px;
  background: rgba(136, 246, 255, 0.08);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(136, 246, 255, 0.16);
}

.icon-button:disabled:hover,
.zoom-icon-button:disabled:hover {
  background: rgba(5, 8, 22, 0.76);
}

.source-control-stack {
  display: grid;
  align-items: stretch;
  gap: 5px;
  margin-top: 8px;
}

.source-control-stack .ghost-button {
  flex: 1 1 100%;
}

.source-control-stack .top-toggle,
.source-control-stack .top-interval,
.source-control-stack .source-badge {
  min-height: 30px;
}

.source-control-stack #sourceBadge {
  flex: 1 1 100%;
  justify-content: center;
}

.cache-action-row,
.refresh-inline-controls,
.settings-yoda-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-yoda-row {
  flex-wrap: wrap;
}

.settings-yoda-row .compact-button {
  flex: 0 0 auto;
  min-width: 72px;
}

.yoda-model-status,
.gbrain-backend-status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.gbrain-authority-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.35;
}

.yoda-prompt-editor {
  min-height: min(420px, 52vh);
  font-family: "SF Mono", "Cascadia Code", monospace;
  line-height: 1.45;
}

.cache-action-row .cache-usage-label {
  flex: 1 1 auto;
  min-width: 92px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.cache-action-row .ghost-button,
.settings-yoda-row .ghost-button {
  flex: 0 0 auto;
  min-height: 30px;
}

.refresh-inline-controls .top-toggle,
.refresh-inline-controls .top-interval {
  flex: 1 1 0;
}

.settings-section {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(136, 246, 255, 0.14);
  background: rgba(2, 8, 22, 0.42);
}

.settings-section h3 {
  margin: 0;
  color: #dffcff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.settings-review-section {
  gap: 8px;
}

.settings-evidence-cards {
  display: grid;
  gap: 10px;
  max-height: min(50vh, 520px);
  overflow: auto;
  padding-right: 2px;
}

.settings-evidence-toolbar {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.settings-evidence-toolbar .ghost-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 9px;
}

.settings-evidence-cards .verified-outcomes-card,
.settings-evidence-cards .customer-readiness-card {
  margin-bottom: 0;
  padding: 10px;
}

.settings-evidence-cards .verified-outcomes-grid,
.settings-evidence-cards .customer-readiness-grid {
  grid-template-columns: 1fr;
}

.settings-evidence-loading,
.settings-evidence-error {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-evidence-error {
  color: #ff9ca8;
}

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

.panel-section + .panel-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.limit-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.limit-control input {
  width: 46px;
  height: 26px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 7px;
  background: rgba(5, 8, 22, 0.82);
  color: var(--text);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgba(136, 246, 255, 0.06);
  font-size: 13px;
  font-weight: 700;
}

.panel-toggle input {
  inline-size: 16px;
  block-size: 16px;
}

.panel-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.detail-type,
.detail-summary,
.source-message,
.warning-list {
  color: var(--muted);
}

.context-menu {
  position: fixed;
  z-index: 40;
  width: 190px;
  padding: 8px;
  border: 1px solid rgba(143, 168, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 12, 28, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.context-menu button {
  display: block;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(136, 246, 255, 0.12);
}

.context-menu button.danger {
  color: #ff9aa9;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 5, 16, 0.68);
  backdrop-filter: blur(12px);
}

.modal-panel {
  width: min(760px, 100%);
  min-width: 0;
  max-width: 100%;
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(143, 168, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 12, 28, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header > div {
  min-width: 0;
}

#modalTitle {
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-backdrop.compact-modal .modal-panel {
  width: min(380px, 100%);
}

.modal-backdrop.ask-yoda-modal .modal-panel {
  height: min(860px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.modal-backdrop.ask-yoda-modal .modal-actions {
  padding-top: 4px;
}

.modal-panel:has(.take-review-list) {
  width: min(1080px, 100%);
  overflow: hidden;
}

.resolver-review-panel {
  width: min(980px, 100%);
}

.modal-panel:has(.take-review-list) .operation-form {
  overflow-y: auto;
  padding-right: 4px;
}

.modal-message {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.modal-message.is-error {
  color: #ff9ca8;
}

.modal-loading-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.verified-outcomes-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  background: rgba(7, 12, 28, 0.82);
}

.verified-outcomes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.verified-outcomes-header h3,
.verified-outcome-item h4 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.verified-outcomes-header h3 {
  font-size: 15px;
}

.verified-outcomes-header p,
.verified-outcome-item p,
.verified-outcomes-distinction,
.verified-outcomes-privacy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.verified-outcomes-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(136, 246, 255, 0.24);
  border-radius: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.verified-outcomes-status.is-degraded,
.verified-outcomes-status.is-partial {
  border-color: rgba(255, 198, 111, 0.34);
  color: var(--accent-3);
}

.verified-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.verified-outcome-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(143, 168, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.verified-outcome-item h4 {
  font-size: 13px;
}

.verified-outcomes-privacy {
  padding-top: 2px;
}

.verified-outcomes-distinction {
  padding: 8px 10px;
  border: 1px solid rgba(112, 221, 156, 0.18);
  border-radius: 8px;
  background: rgba(112, 221, 156, 0.06);
  color: var(--text);
}

.customer-readiness-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(112, 221, 156, 0.2);
  border-radius: 8px;
  background: rgba(8, 14, 24, 0.84);
}

.customer-readiness-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-readiness-header h3,
.customer-readiness-item h4 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.customer-readiness-header h3 {
  font-size: 15px;
}

.customer-readiness-header p,
.customer-readiness-item p,
.customer-readiness-next-step,
.customer-readiness-privacy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customer-readiness-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(112, 221, 156, 0.28);
  border-radius: 8px;
  color: #70dd9c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-readiness-status.is-degraded,
.customer-readiness-status.is-partial {
  border-color: rgba(255, 198, 111, 0.34);
  color: var(--accent-3);
}

.customer-readiness-status.is-blocked,
.customer-readiness-status.is-missing {
  border-color: rgba(255, 156, 168, 0.34);
  color: #ff9ca8;
}

.customer-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.customer-readiness-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(143, 168, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.customer-readiness-item h4 {
  font-size: 13px;
}

.customer-readiness-next-step {
  padding: 8px 10px;
  border: 1px solid rgba(255, 198, 111, 0.22);
  border-radius: 8px;
  background: rgba(255, 198, 111, 0.07);
  color: var(--text);
}

.customer-readiness-privacy {
  padding-top: 2px;
}

.modal-slug-inline {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.take-review-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 118px minmax(132px, 1fr) minmax(132px, 1fr) minmax(150px, 1.2fr) repeat(5, auto);
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
  background: rgba(8, 12, 28, 0.98);
}

.take-review-filter-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.take-review-toolbar input,
.take-review-toolbar select {
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(143, 168, 255, 0.22);
  border-radius: 7px;
  background: rgba(5, 8, 22, 0.88);
  color: var(--text);
  padding: 0 10px;
}

.take-review-status-line,
.take-review-empty,
.take-review-preview {
  color: var(--muted);
}

.take-review-list,
.take-review-existing {
  display: grid;
  gap: 8px;
}

.take-review-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  background: rgba(6, 12, 28, 0.72);
}

.take-review-row.relationship-wiki-row {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  min-height: 0;
}

.take-review-row-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.take-review-row-body strong,
.take-review-row-body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.take-review-status-badge {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid rgba(136, 246, 255, 0.24);
  border-radius: 999px;
  color: #bff8ff;
  background: rgba(34, 211, 238, 0.1);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.take-review-status-badge.is-accepted {
  border-color: rgba(134, 239, 172, 0.34);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
}

.take-review-status-badge.is-rejected {
  border-color: rgba(255, 156, 168, 0.34);
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.12);
}

.take-review-row-body p {
  font-size: 12px;
}

.take-review-row-actions,
.take-review-pager {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.take-review-page-position {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.autopilot-findings-button {
  position: relative;
}

.autopilot-findings-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 1px solid rgba(255, 198, 111, 0.62);
  border-radius: 999px;
  background: #9b4d18;
  color: #fff4d6;
  font-size: 9px;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 12px rgba(255, 198, 111, 0.28);
}

.autopilot-findings-toolbar,
.autopilot-finding-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.autopilot-findings-toolbar {
  justify-content: space-between;
}

.autopilot-findings-toolbar select {
  min-width: 180px;
  height: 32px;
  border: 1px solid rgba(143, 168, 255, 0.22);
  border-radius: 7px;
  background: rgba(5, 8, 22, 0.88);
  color: var(--text);
  padding: 0 10px;
}

.autopilot-findings-notice {
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(255, 198, 111, 0.7);
  color: #ffe4b0;
  background: rgba(255, 198, 111, 0.07);
  font-size: 11px;
  line-height: 1.45;
}

.autopilot-findings-list {
  display: grid;
  gap: 8px;
}

.autopilot-finding-row {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  background: rgba(6, 12, 28, 0.72);
}

.autopilot-finding-heading {
  justify-content: space-between;
}

.autopilot-finding-heading strong,
.autopilot-finding-row p {
  margin: 0;
  overflow-wrap: anywhere;
}

.autopilot-finding-state {
  width: fit-content;
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid rgba(136, 246, 255, 0.24);
  border-radius: 999px;
  color: #bff8ff;
  background: rgba(34, 211, 238, 0.1);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.autopilot-finding-state.is-blocked,
.autopilot-finding-state.is-awaiting_approval {
  border-color: rgba(255, 198, 111, 0.4);
  color: #ffe4b0;
  background: rgba(255, 198, 111, 0.12);
}

.autopilot-finding-state.is-escalated {
  border-color: rgba(255, 156, 168, 0.42);
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.14);
}

.autopilot-finding-state.is-resolved {
  border-color: rgba(134, 239, 172, 0.34);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
}

.autopilot-finding-rationale,
.autopilot-finding-action {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.autopilot-finding-meta,
.autopilot-finding-acknowledged {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
}

.resolver-review-actions,
.resolver-proposal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.resolver-proposal-list {
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.resolver-health-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  background: rgba(2, 8, 22, 0.6);
}

.resolver-health-item {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.resolver-health-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.resolver-health-item strong {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.resolver-proposal-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  background: rgba(6, 12, 28, 0.72);
}

.resolver-proposal-card strong,
.resolver-proposal-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.resolver-proposal-meta,
.resolver-proposal-evidence {
  color: var(--muted);
  font-size: 12px;
}

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

.resolver-impact-grid span {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid rgba(143, 168, 255, 0.16);
  border-radius: 6px;
  color: var(--accent);
  background: rgba(2, 8, 22, 0.52);
  font-size: 11px;
  font-weight: 800;
}

.take-review-existing h4 {
  margin: 8px 0 0;
  color: var(--text);
}

.take-review-proposed-heading h4 {
  margin: 10px 0 0;
  color: var(--text);
}

.take-review-existing-heading,
.take-review-existing-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.take-review-existing-range {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.take-review-existing-toggle {
  margin-left: auto;
}

.take-review-existing-list {
  gap: 7px;
}

.take-review-take {
  margin: 0;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.75fr) auto;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.take-review-take-claim {
  color: #dbeafe;
  white-space: normal;
  overflow-wrap: anywhere;
}

.take-review-take-source {
  min-width: 0;
  overflow: hidden;
  color: #67e8f9;
  text-overflow: ellipsis;
}

.take-review-take-meta {
  color: rgba(205, 218, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.take-review-existing-page-total {
  min-width: 42px;
}

.inline-action-button {
  min-height: 28px;
  padding: 0 10px;
}

#modalEditor {
  min-height: 340px;
  resize: vertical;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 14px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-view {
  min-width: 0;
  max-width: 100%;
  min-height: 340px;
  max-height: min(58vh, 620px);
  overflow: auto;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.72);
  color: var(--text);
  padding: 18px;
  font-size: 14px;
  line-height: 1.58;
}

.markdown-view h1,
.markdown-view h2,
.markdown-view h3 {
  margin: 14px 0 8px;
  color: var(--text);
  letter-spacing: 0;
}

.markdown-view h1 {
  font-size: 24px;
}

.markdown-view h2 {
  font-size: 19px;
}

.markdown-view h3 {
  font-size: 16px;
}

.markdown-view p,
.markdown-view ul,
.markdown-view ol,
.markdown-view pre,
.markdown-view blockquote,
.markdown-view table {
  margin: 0 0 12px;
}

.markdown-view ul,
.markdown-view ol {
  padding-left: 20px;
}

.markdown-view code,
.markdown-view pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-view code {
  color: var(--accent);
}

.markdown-view pre {
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
  padding: 12px;
}

.markdown-view a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.markdown-view a[data-entity-query] {
  border-bottom: 1px dashed rgba(136, 246, 255, 0.5);
  text-decoration: none;
}

.markdown-view blockquote {
  border-left: 3px solid rgba(136, 246, 255, 0.42);
  padding: 8px 12px;
  background: rgba(136, 246, 255, 0.06);
  color: var(--muted);
}

.markdown-view hr {
  width: 100%;
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: rgba(143, 168, 255, 0.2);
}

.markdown-view table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 13px;
}

.markdown-view th,
.markdown-view td {
  border: 1px solid rgba(143, 168, 255, 0.16);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.markdown-view th {
  background: rgba(136, 246, 255, 0.08);
  color: var(--text);
}

.markdown-view img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 8px 0 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-height: min(58vh, 620px);
  overflow: auto;
}

.media-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(136, 246, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.media-card img,
.media-card video,
.media-card audio {
  width: 100%;
  max-height: 260px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  object-fit: contain;
}

.media-card a {
  color: var(--accent);
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.media-card span {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.attach-panel {
  display: grid;
  gap: 10px;
}

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

.attach-description-wrap {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attach-description-wrap input {
  width: 100%;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 12px;
  font: 14px/1.45 Inter, "SF Pro Text", "Segoe UI", sans-serif;
}

.attach-description-wrap input:focus {
  outline: 2px solid rgba(136, 246, 255, 0.32);
  outline-offset: 2px;
}

.attach-status {
  margin: 0;
  border: 1px solid rgba(136, 246, 255, 0.14);
  border-radius: 8px;
  background: rgba(136, 246, 255, 0.06);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

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

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

.chat-log {
  min-height: 300px;
  max-height: min(50vh, 520px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.72);
}

.modal-backdrop.ask-yoda-modal .chat-log {
  min-height: 260px;
  max-height: none;
  flex: 1 1 auto;
}

.modal-backdrop.ask-yoda-modal .chat-panel {
  min-height: 0;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-depth-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-depth-control input {
  width: 54px;
  height: 30px;
  border: 1px solid rgba(143, 168, 255, 0.22);
  border-radius: 6px;
  background: rgba(5, 8, 22, 0.82);
  color: var(--text);
  padding: 0 8px;
}

.chat-empty {
  align-self: center;
  justify-self: center;
  max-width: 420px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.chat-message {
  display: grid;
  gap: 5px;
  max-width: 88%;
}

.chat-message.user {
  justify-self: end;
}

.chat-message.assistant,
.chat-message.system {
  justify-self: start;
}

.chat-speaker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-timestamp {
  color: rgba(151, 166, 206, 0.82);
  font-size: 11px;
}

.chat-bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(143, 168, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  line-height: 1.5;
}

.chat-slug-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-fallback-reveal {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.chat-fallback-output {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 198, 111, 0.24);
  border-radius: 8px;
  background: rgba(2, 8, 22, 0.62);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.thinking-dots {
  display: inline-block;
  width: 1.4em;
  vertical-align: bottom;
  animation: thinking-dots 1.1s ease-in-out infinite;
}

@keyframes thinking-dots {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 1; }
}

.chat-message.user .chat-bubble {
  border-color: rgba(136, 246, 255, 0.28);
  background: rgba(136, 246, 255, 0.12);
}

.chat-message.assistant .chat-bubble {
  border-color: rgba(255, 198, 111, 0.22);
  background: rgba(255, 198, 111, 0.08);
}

.yoda-feedback-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
}

.yoda-feedback-button {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid rgba(143, 168, 255, 0.2);
  border-radius: 6px;
  background: rgba(5, 8, 22, 0.68);
  color: var(--text);
  cursor: pointer;
}

.yoda-feedback-button[aria-pressed="true"] {
  border-color: rgba(136, 246, 255, 0.72);
  background: rgba(136, 246, 255, 0.16);
}

.yoda-feedback-button:focus-visible,
.yoda-feedback-editor textarea:focus-visible {
  outline: 2px solid rgba(136, 246, 255, 0.72);
  outline-offset: 2px;
}

.yoda-feedback-status {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.yoda-feedback-editor {
  display: grid;
  gap: 7px;
  width: min(100%, 460px);
}

.yoda-feedback-editor[hidden] {
  display: none;
}

.yoda-feedback-editor textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(143, 168, 255, 0.22);
  border-radius: 7px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 9px 10px;
  font: 13px/1.4 Inter, "SF Pro Text", "Segoe UI", sans-serif;
}

.yoda-feedback-editor-actions {
  display: flex;
  gap: 7px;
}

.chat-message.system .chat-bubble {
  color: var(--muted);
  font-style: italic;
}

.chat-input-wrap {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chat-input-wrap textarea {
  resize: vertical;
  min-height: 88px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 12px;
  font: 14px/1.45 Inter, "SF Pro Text", "Segoe UI", sans-serif;
}

.modal-backdrop.ask-yoda-modal .chat-input-wrap textarea {
  min-height: 68px;
}

.chat-input-wrap textarea:focus {
  outline: 2px solid rgba(136, 246, 255, 0.32);
  outline-offset: 2px;
}

.modal-confirm-input {
  width: 100%;
  border: 1px solid rgba(255, 143, 179, 0.35);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 12px 14px;
  font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.modal-confirm-input:focus {
  outline: 2px solid rgba(255, 143, 179, 0.35);
  outline-offset: 2px;
}

.modal-file-input {
  width: 100%;
  border: 1px dashed rgba(136, 246, 255, 0.34);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 14px;
  font: 14px/1.4 Inter, "SF Pro Text", "Segoe UI", sans-serif;
}

.modal-file-input::file-selector-button {
  margin-right: 12px;
  border: 1px solid rgba(136, 246, 255, 0.38);
  border-radius: 6px;
  background: rgba(136, 246, 255, 0.12);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 700;
}

.operation-form {
  display: grid;
  gap: 12px;
  max-height: min(56vh, 560px);
  overflow: auto;
}

.operation-form[hidden] {
  display: none;
}

.operation-field,
.operation-group {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.operation-field input,
.operation-field select,
.operation-field textarea {
  width: 100%;
  border: 1px solid rgba(143, 168, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.9);
  color: var(--text);
  padding: 11px 12px;
  font: 14px/1.45 Inter, "SF Pro Text", "Segoe UI", sans-serif;
}

.operation-field textarea {
  min-height: 76px;
  resize: vertical;
}

.plan-controls,
.plan-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.plan-controls {
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  align-items: center;
}

.plan-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.plan-tab-label {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-timing-row {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 8px;
}

.plan-number-field {
  grid-template-columns: auto 44px;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.plan-number-field input {
  width: 44px;
  min-width: 44px;
  padding-inline: 6px;
  text-align: center;
}

.plan-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-list {
  display: grid;
  gap: 8px;
}

.slug-selector-popup {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 5px;
  max-height: min(220px, calc(100vh - 32px));
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(103, 232, 249, 0.48);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), transparent 46%),
    rgba(2, 8, 22, 0.96);
  backdrop-filter: blur(14px);
  clip-path: var(--chamfer);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 14px 34px rgba(0, 0, 0, 0.48),
    inset 0 0 22px rgba(34, 211, 238, 0.1);
}

.slug-selector-popup[hidden] {
  display: none;
}

.slug-selector-option {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(136, 246, 255, 0.16);
  background: rgba(5, 8, 22, 0.58);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.slug-selector-option:hover,
.slug-selector-option:focus-visible {
  border-color: rgba(136, 246, 255, 0.44);
  background: rgba(34, 211, 238, 0.12);
  outline: none;
}

.slug-selector-slug,
.slug-selector-meta,
.slug-selector-empty {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slug-selector-slug {
  color: #67e8f9;
  font-size: 11px;
  font-weight: 900;
}

.slug-selector-meta,
.slug-selector-empty {
  color: var(--muted);
  font-size: 10px;
}

.plan-row .operation-field {
  min-width: 0;
}

.plan-drag-handle {
  align-self: center;
  color: rgba(136, 246, 255, 0.7);
  cursor: grab;
  font-size: 12px;
  letter-spacing: -0.08em;
}

.plan-row.is-invalid {
  border: 1px solid rgba(255, 105, 135, 0.54);
  background: rgba(127, 29, 29, 0.18);
  box-shadow: 0 0 18px rgba(255, 105, 135, 0.18);
}

.plan-row.is-invalid input {
  color: #fecdd3;
  border-color: rgba(255, 105, 135, 0.7);
}

.plan-row-readonly {
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
}

.plan-index {
  color: rgba(103, 232, 249, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.plan-list-readonly .relationship-source-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-confirm-dialog {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.1), transparent 42%),
    rgba(2, 8, 22, 0.82);
  clip-path: var(--chamfer);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.12), inset 0 0 18px rgba(250, 204, 21, 0.06);
}

.plan-confirm-dialog h4 {
  margin: 0;
  color: #fef9c3;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plan-confirm-dialog p {
  margin: 0;
  color: rgba(238, 244, 255, 0.86);
  font-size: 12px;
  line-height: 1.35;
}

.plan-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.operation-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.operation-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(143, 168, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 650;
}

.operation-choice input {
  flex: 0 0 auto;
}

.operation-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.operation-summary {
  margin: 0;
  border: 1px solid rgba(136, 246, 255, 0.16);
  border-radius: 8px;
  background: rgba(136, 246, 255, 0.06);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.detail-type {
  margin-top: 8px;
  text-transform: capitalize;
}

.detail-summary,
.source-message {
  margin-top: 12px;
  line-height: 1.65;
  font-size: 14px;
}

.detail-summary {
  min-height: calc(1.65em * 5);
  max-height: calc(1.65em * 5);
  overflow: auto;
  resize: vertical;
  padding-right: 4px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chip-grid button,
.chip-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(143, 168, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
}

.chip-grid button {
  cursor: pointer;
}

.chip-grid button:hover {
  background: rgba(136, 246, 255, 0.12);
}

.chip-grid .direct-link-chip {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
  min-height: 38px;
  padding-block: 7px;
  border-radius: 12px;
}

.direct-link-label {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.direct-link-relationship {
  display: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-3);
  font-size: 12px;
}

.direct-link-chip:hover .direct-link-relationship,
.direct-link-chip:focus .direct-link-relationship,
.direct-link-chip:focus-visible .direct-link-relationship {
  display: inline;
}

.chip-grid.muted span {
  color: var(--muted);
}

.category-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 12px;
}

.category-legend button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(143, 168, 255, 0.13);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028));
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: capitalize;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.category-legend button.is-active {
  color: var(--text);
  border-color: rgba(136, 246, 255, 0.28);
  background: rgba(136, 246, 255, 0.1);
}

.category-legend button.is-dimmed {
  opacity: 0.42;
}

.cluster-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-legend i {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 16px currentColor;
}

.hidden-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.hidden-empty,
.hidden-item {
  color: var(--muted);
  font-size: 13px;
}

.hidden-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(143, 168, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.hidden-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.hidden-item small {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.hidden-item button {
  min-height: 30px;
  border: 1px solid rgba(136, 246, 255, 0.24);
  border-radius: 999px;
  background: rgba(136, 246, 255, 0.08);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
}

.hidden-item button:hover {
  background: rgba(136, 246, 255, 0.16);
}

.warning-list {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.55;
  font-size: 13px;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .header-workflow {
    flex-wrap: nowrap;
  }

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

  .graph-canvas-wrap {
    min-height: 620px;
  }

  .graph-canvas-layer {
    height: 620px;
  }

  .graph-metrics-corner {
    grid-template-columns: repeat(3, minmax(70px, auto));
  }

  .timeline-strip {
    flex: 0 1 284px;
  }
}

@media (max-width: 720px) {
  .runtime-version-group {
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    margin-right: 10px;
  }

  .gbrain-version {
    font-size: 9px;
  }

  .app-shell {
    width: min(100vw, calc(100vw - 20px));
    padding-top: 18px;
  }

  .topbar {
    align-items: stretch;
  }

  .brand-wordmark {
    width: min(250px, 62vw);
  }

  .header-workflow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .search-group {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .timeline-strip {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .graph-panel {
    min-height: 0;
  }

  .graph-canvas-wrap {
    min-height: 540px;
  }

  .graph-canvas-layer {
    height: 540px;
  }

  .graph-metrics-corner {
    right: 10px;
    bottom: 10px;
    grid-template-columns: repeat(3, minmax(58px, auto));
    transform: scale(0.92);
    transform-origin: right bottom;
  }

}

/* Spaceship console theme: layered over the existing functional UI. */
:root {
  --bg: #020816;
  --bg-2: #07111f;
  --bg-3: #0b1628;
  --panel: rgba(7, 17, 31, 0.72);
  --panel-strong: rgba(7, 17, 31, 0.92);
  --border: rgba(34, 211, 238, 0.24);
  --accent: #22d3ee;
  --accent-bright: #38bdf8;
  --accent-2: #a855f7;
  --accent-3: #facc15;
  --pink: #ec4899;
  --orange: #fb923c;
  --hud-border: rgba(56, 189, 248, 0.34);
  --hud-stroke: linear-gradient(135deg, rgba(224, 251, 255, 1), rgba(103, 232, 249, 0.96) 28%, rgba(56, 189, 248, 0.82) 50%, rgba(103, 232, 249, 0.96) 72%, rgba(224, 251, 255, 1));
  --hud-glow: 0 0 22px rgba(34, 211, 238, 0.22), 0 0 54px rgba(59, 130, 246, 0.13);
  --chamfer: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}

html,
body {
  font-family: "Rajdhani", Inter, "SF Pro Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 38%, rgba(168, 85, 247, 0.16), transparent 22rem),
    radial-gradient(circle at 78% 22%, rgba(34, 211, 238, 0.12), transparent 20rem),
    radial-gradient(circle at 64% 75%, rgba(59, 130, 246, 0.12), transparent 18rem),
    linear-gradient(180deg, #020816 0%, #07111f 48%, #01040d 100%);
  overflow-x: hidden;
}

body::before {
  opacity: 0.5;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 45%, black 0 42%, transparent 76%);
  opacity: 0.5;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100vw - 24px));
  padding: 12px 0 26px;
}

.topbar {
  position: relative;
  grid-template-columns: minmax(260px, auto) minmax(0, 1fr);
  min-height: 86px;
  margin-bottom: 10px;
  padding: 12px 18px;
  border: 1px solid var(--hud-border);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.1), transparent 18%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.88), rgba(2, 8, 22, 0.72));
  clip-path: var(--chamfer);
  box-shadow: var(--hud-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}

.topbar::before,
.graph-panel::before,
.detail-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border: 1px solid rgba(56, 189, 248, 0.12);
  clip-path: var(--chamfer);
}

.brand-lockup {
  position: relative;
  gap: 12px;
  min-width: 250px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.36), 0 0 62px rgba(59, 130, 246, 0.18);
}

.brand-wordmark {
  width: clamp(150px, 16vw, 250px);
  height: 44px;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.42));
}

.brand-subtitle {
  position: absolute;
  left: 70px;
  bottom: -4px;
  color: rgba(238, 244, 255, 0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-workflow {
  gap: 9px;
}

.has-tooltip::before {
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 3px;
  background: rgba(2, 8, 22, 0.94);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36), 0 0 18px rgba(34, 211, 238, 0.18);
}

.eyeline,
.panel-label,
.metric-label,
.search-wrap span,
.toggle-wrap span,
.filter-wrap span,
.top-toggle span,
.top-interval span {
  color: #67e8f9;
}

.metrics,
.graph-panel,
.detail-panel,
.modal-panel,
.context-menu {
  border-color: var(--hud-border);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.86), rgba(2, 8, 22, 0.72));
  clip-path: var(--chamfer);
  box-shadow: var(--hud-glow), var(--shadow);
}

.metric-card,
.source-badge,
.top-toggle,
.top-interval,
.toggle-wrap,
.filter-wrap input,
.top-interval input,
.search-wrap input,
.timeline-strip,
.canvas-overlay,
.graph-tooltip,
.operation-field input,
.operation-field select,
.operation-field textarea,
#modalEditor,
.markdown-view,
.chat-log,
.chat-bubble,
.modal-confirm-input,
.modal-file-input,
.attach-status,
.operation-summary,
.category-legend button,
.hidden-item,
.media-card {
  border-radius: 0;
}

.media-card-preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  background: rgba(2, 8, 22, 0.36);
  overflow: hidden;
}

.media-card-preview img,
.media-card-preview video {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.media-card-preview audio {
  width: 100%;
}

.metric-card,
.category-legend button,
.hidden-item,
.media-card {
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.ghost-button,
.icon-button,
.zoom-icon-button,
.new-node-icon-button,
.cluster-icon-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(34, 211, 238, 0.34);
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ghost-button {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.08));
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 14px rgba(34, 211, 238, 0.1);
}

.ghost-button.primary {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.28), rgba(59, 130, 246, 0.12));
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18), inset 0 0 16px rgba(34, 211, 238, 0.08);
}

.ghost-button::after,
.icon-button::after,
.zoom-icon-button::after,
.new-node-icon-button::after,
.cluster-icon-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255,255,255,0.18) 45%, transparent 58% 100%);
  transform: translateX(-140%);
  transition: transform 0.35s ease;
  pointer-events: none;
}

.ghost-button:hover::after,
.icon-button:hover::after,
.zoom-icon-button:hover::after,
.new-node-icon-button:hover::after,
.cluster-icon-button:hover::after {
  transform: translateX(140%);
}

.search-wrap input {
  height: 42px;
  border-color: rgba(34, 211, 238, 0.32);
  background: rgba(2, 8, 22, 0.78);
  padding: 0 16px;
  font-size: 15px;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  box-shadow: inset 0 0 18px rgba(34, 211, 238, 0.06);
}

.search-wrap input:focus {
  outline-color: rgba(34, 211, 238, 0.36);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.2), inset 0 0 22px rgba(34, 211, 238, 0.08);
}

.search-button {
  height: 42px;
  min-width: 110px;
  padding-inline: 20px;
  color: #dffbff;
}

.toggle-wrap,
.timeline-strip {
  background: rgba(2, 8, 22, 0.46);
  border-color: rgba(34, 211, 238, 0.22);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
}

.toggle-wrap {
  height: 38px;
  padding: 0 15px;
}

.system-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: #86efac;
  border: 1px solid rgba(34, 211, 238, 0.14);
  background: rgba(2, 8, 22, 0.48);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  white-space: nowrap;
}

.system-status span,
.nav-rail-button span,
.nav-status span,
.nav-status strong {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.system-status i,
.nav-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
}

.workspace {
  grid-template-columns: 82px minmax(0, 1fr) minmax(270px, 0.34fr);
  gap: 12px;
}

.nav-rail {
  min-height: 760px;
  padding: 14px 9px;
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--hud-border);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.12), transparent 18%),
    rgba(7, 17, 31, 0.72);
  clip-path: var(--chamfer);
  box-shadow: var(--hud-glow), inset 0 0 28px rgba(34, 211, 238, 0.04);
  backdrop-filter: blur(16px);
}

.nav-rail-button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 76px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  background: rgba(2, 8, 22, 0.38);
  color: rgba(238, 244, 255, 0.74);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 12px), 0 12px);
  cursor: pointer;
}

.nav-rail-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-rail-button.is-active {
  color: #bff8ff;
  border-color: rgba(34, 211, 238, 0.58);
  background: radial-gradient(circle at 50% 18%, rgba(34, 211, 238, 0.24), rgba(2, 8, 22, 0.5));
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.22), inset 0 0 22px rgba(34, 211, 238, 0.1);
}

.nav-status {
  margin-top: 6px;
  min-height: 104px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 3px;
  color: var(--muted);
  border: 1px solid rgba(34, 211, 238, 0.16);
  background: rgba(2, 8, 22, 0.42);
  clip-path: var(--chamfer);
}

.nav-status strong {
  color: #86efac;
}

.graph-panel {
  border-radius: 0;
}

.graph-canvas-wrap {
  border-radius: 0;
}

.graph-canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border: 1px solid rgba(56, 189, 248, 0.42);
  clip-path: var(--chamfer);
  box-shadow: inset 0 0 44px rgba(34, 211, 238, 0.11), 0 0 32px rgba(34, 211, 238, 0.16);
}

.graph-canvas-wrap {
  background:
    radial-gradient(circle at 28% 48%, rgba(168, 85, 247, 0.18), transparent 19rem),
    radial-gradient(circle at 70% 32%, rgba(34, 211, 238, 0.11), transparent 15rem),
    radial-gradient(circle at 72% 68%, rgba(250, 204, 21, 0.07), transparent 16rem),
    linear-gradient(180deg, rgba(2, 8, 22, 0.98), rgba(1, 4, 13, 0.98));
}

.graph-floating-controls,
.new-node-floating,
.graph-metrics-corner,
.canvas-overlay,
.graph-tooltip,
.busy-indicator,
.radar-widget {
  z-index: 20;
}

.zoom-floating {
  border-radius: 0;
  background: rgba(2, 8, 22, 0.82);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
}

.canvas-overlay {
  left: auto;
  right: 24px;
  bottom: 9px;
  display: block;
  width: min(360px, calc(100% - 48px));
  max-width: 360px;
  padding: 0;
  color: rgba(205, 218, 255, 0.78);
  background: transparent;
  border: 0;
  border-radius: 0;
  clip-path: none;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 10px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-tooltip {
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.radar-widget {
  position: absolute;
  right: 28px;
  top: 24px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.14) 0 2px, transparent 3px),
    conic-gradient(from 0deg, rgba(34, 211, 238, 0.24), transparent 28%, rgba(59, 130, 246, 0.18), transparent 56%, rgba(34, 211, 238, 0.22), transparent);
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.2), inset 0 0 18px rgba(34, 211, 238, 0.12);
  opacity: 0.86;
}

.radar-widget::before,
.radar-widget::after {
  content: "";
  position: absolute;
  background: rgba(56, 189, 248, 0.62);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.radar-widget::before {
  left: 50%;
  top: 11px;
  bottom: 11px;
  width: 1px;
}

.radar-widget::after {
  top: 50%;
  left: 11px;
  right: 11px;
  height: 1px;
}

.radar-widget > span {
  position: absolute;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  color: #67e8f9;
  font-size: 10px;
  font-weight: 900;
}

.radar-widget i {
  position: absolute;
  inset: 17px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 50%;
}

.detail-panel {
  position: relative;
  overflow: hidden;
}

.selection-blueprint {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin-top: 14px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    rgba(2, 8, 22, 0.34);
  background-size: 22px 22px;
  clip-path: var(--chamfer);
  overflow: hidden;
}

.selection-blueprint svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: rgba(125, 211, 252, 0.72);
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.3));
}

.selection-media-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(2, 8, 22, 0.52);
}

.selection-media-preview.is-loading {
  color: rgba(232, 249, 255, 0.86);
  font-size: 12px;
  font-weight: 900;
  text-transform: lowercase;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), transparent 48%),
    rgba(2, 8, 22, 0.58);
}

.selection-media-preview[hidden] {
  display: none;
}

.selection-media-preview img,
.selection-media-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
}

.selection-media-preview audio {
  width: 92%;
}

.selection-media-preview a {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.selection-blueprint.has-media svg,
.selection-blueprint.has-media > span {
  visibility: hidden;
}

.selection-blueprint span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  min-width: 0;
  overflow: hidden;
  color: #67e8f9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-wiki-list,
.backlink-list {
  display: grid;
  gap: 8px;
}

.relationship-wiki-row,
.backlink-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(2, 8, 22, 0.48);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.relationship-source-link,
.backlink-from-link {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-type,
.backlink-relation {
  color: #facc15;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.backlink-meta,
.backlink-target {
  grid-column: 1 / -1;
}

.relationship-icon-button,
.backlink-link-back {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(103, 232, 249, 0.3);
  background: rgba(15, 23, 42, 0.82);
  color: #dffcff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.relationship-icon-button:hover,
.backlink-link-back:hover {
  background: rgba(34, 211, 238, 0.16);
}

.relationship-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.relationship-page-number {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(15, 23, 42, 0.64);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.relationship-page-number[aria-current="page"] {
  color: #67e8f9;
  font-weight: 950;
  border-color: rgba(103, 232, 249, 0.56);
  background: rgba(34, 211, 238, 0.16);
  cursor: default;
}

.relationship-page-total {
  color: rgba(205, 218, 255, 0.76);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .graph-canvas-wrap {
    min-height: clamp(520px, 58dvh, 660px);
  }

  .graph-canvas-layer {
    height: clamp(520px, 58dvh, 660px);
  }

  .graph-brand-row {
    grid-template-columns: minmax(20px, 1fr) auto minmax(76px, 1fr);
    gap: 8px;
  }

  .graph-wordmark-link {
    width: min(230px, 44vw);
    aspect-ratio: 760 / 253;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }

  .graph-wordmark {
    width: 100%;
    height: 100%;
  }

  .graph-brand-row .ui-version {
    margin-right: 18px;
  }

  .radar-widget {
    width: 108px;
    height: 108px;
    right: 18px;
    bottom: 54px;
  }

  .radar-stats {
    width: 94px;
    font-size: 8px;
  }

  .graph-canvas-wrap > .canvas-overlay,
  .canvas-overlay {
    left: auto;
    right: 18px;
    bottom: 12px;
    width: min(300px, calc(100% - 36px));
    max-width: 300px;
    text-align: right;
  }

  .detail-panel {
    grid-column: 1 / -1;
  }

  .nav-rail {
    min-height: 620px;
  }

  .system-status {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .brand-lockup {
    min-width: 0;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-subtitle {
    left: 60px;
  }

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

  .nav-rail {
    min-height: 72px;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 5px;
    overflow-x: auto;
  }

  .nav-rail-button {
    min-height: 52px;
  }

  .nav-rail-button span,
  .nav-status {
    display: none;
  }

  .radar-widget {
    width: 72px;
    height: 72px;
    right: 10px;
    bottom: 44px;
  }

  .radar-stats {
    width: 70px;
    font-size: 6.5px;
  }

  .graph-canvas-wrap {
    min-height: clamp(440px, 62dvh, 560px);
  }

  .graph-canvas-layer {
    height: clamp(440px, 62dvh, 560px);
  }

  .graph-brand-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(62px, 1fr);
    gap: 6px;
  }

  .graph-wordmark-link {
    width: min(185px, 50vw);
    aspect-ratio: 760 / 253;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }

  .graph-wordmark {
    width: 100%;
    height: 100%;
  }

  .graph-brand-row .ui-version {
    margin-right: 10px;
    font-size: 13px;
  }

  .graph-canvas-wrap > .canvas-overlay,
  .canvas-overlay {
    left: auto;
    right: 10px;
    bottom: 8px;
    width: min(210px, calc(100% - 20px));
    max-width: 210px;
    text-align: right;
  }
}

/* Command-console v2 compaction */
.app-shell {
  padding-top: 10px;
}

.workspace {
  align-items: stretch;
}

.graph-panel,
.detail-panel,
.nav-rail,
.floating-tool-panel {
  position: relative;
  filter: drop-shadow(0 0 9px rgba(34, 211, 238, 0.2)) drop-shadow(0 0 22px rgba(59, 130, 246, 0.12));
}

.topbar::after,
.graph-panel::after,
.detail-panel::after,
.nav-rail::after,
.floating-tool-panel::after,
.modal-panel::after,
.map-filter-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  z-index: 2;
  padding: 2px;
  clip-path: var(--chamfer);
  background: var(--hud-stroke);
  opacity: 1;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow:
    inset 0 0 20px rgba(34, 211, 238, 0.16),
    inset 16px -16px 28px rgba(34, 211, 238, 0.14),
    inset -16px -16px 28px rgba(34, 211, 238, 0.14),
    0 0 26px rgba(34, 211, 238, 0.22);
}

.nav-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.46));
}

.nav-rail-button.is-flashing {
  color: #ffffff;
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.38), inset 0 0 18px rgba(34, 211, 238, 0.14);
}

.floating-tool-panel {
  position: absolute;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), transparent 30%),
    rgba(2, 8, 22, 0.86);
  clip-path: var(--chamfer);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34), 0 0 28px rgba(34, 211, 238, 0.16), inset 0 0 22px rgba(34, 211, 238, 0.07);
}

.graph-canvas-wrap > .busy-indicator,
.busy-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  z-index: 38;
  max-width: min(320px, calc(100% - 36px));
  transform: translate(-50%, -50%);
}

.search-flyout {
  left: 18px;
  top: 16px;
  width: min(720px, calc(100% - 260px));
}

.search-flyout .search-group {
  flex: 1 1 auto;
  min-width: 260px;
}

.search-flyout .search-wrap {
  flex: 1 1 auto;
}

.search-flyout .search-wrap input {
  width: 100%;
}

.autopilot-flyout {
  left: 96px;
  top: 108px;
}

.autopilot-flyout.tour-docked {
  left: 50%;
  top: 18px;
  min-height: 36px;
  padding: 2px 6px;
  gap: 4px;
  transform: translateX(-50%);
  opacity: 0.34;
  transition: opacity 0.18s ease;
}

.autopilot-flyout.tour-docked:hover,
.autopilot-flyout.tour-docked:focus-within {
  opacity: 1;
}

.settings-flyout {
  left: 22px;
  right: auto;
  top: 52px;
  width: min(380px, calc(100% - 44px));
  max-height: calc(100% - 70px);
  overflow: auto;
  display: grid;
  align-items: stretch;
  gap: 6px;
}

.settings-flyout .source-control-stack {
  align-items: center;
}

.settings-title {
  margin: 0;
  color: #dffbff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.graph-wordmark-link {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: min(260px, 36vw);
  aspect-ratio: 760 / 253;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  grid-column: 2;
  justify-self: center;
  border: 1px solid transparent;
  background: rgba(2, 8, 22, 0.28);
  clip-path: var(--chamfer);
  box-shadow: none;
}

.graph-wordmark-link::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  padding: 2px;
  background: var(--hud-stroke);
  clip-path: var(--chamfer);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.12;
}

.graph-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
}

.graph-brand-row .ui-version {
  grid-column: 3;
  justify-self: end;
  margin-right: clamp(14px, 2vw, 28px);
}

.graph-brand-row .runtime-version-group .ui-version {
  grid-column: auto;
  margin-right: 0;
}

.graph-wordmark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.44)) drop-shadow(0 0 34px rgba(59, 130, 246, 0.2));
  opacity: 0.94;
}

.graph-canvas-wrap {
  min-height: 760px;
  box-shadow: inset 0 0 62px rgba(34, 211, 238, 0.12), inset 0 0 160px rgba(59, 130, 246, 0.08);
}

.graph-canvas-wrap::after {
  border: 0;
  padding: 2px;
  background:
    linear-gradient(135deg, rgba(165, 243, 252, 1), rgba(56, 189, 248, 0.86) 24%, rgba(56, 189, 248, 0.34) 44%, rgba(56, 189, 248, 0.72) 72%, rgba(165, 243, 252, 1)),
    linear-gradient(45deg, transparent 0 calc(100% - 24px), rgba(165, 243, 252, 0.95) calc(100% - 22px) calc(100% - 20px), transparent calc(100% - 18px)),
    linear-gradient(135deg, transparent 0 calc(100% - 24px), rgba(165, 243, 252, 0.95) calc(100% - 22px) calc(100% - 20px), transparent calc(100% - 18px));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 1;
  box-shadow:
    inset 0 0 48px rgba(34, 211, 238, 0.16),
    inset 0 0 2px rgba(255, 255, 255, 0.18),
    0 0 34px rgba(34, 211, 238, 0.2);
}

.radar-widget {
  right: 26px;
  top: auto;
  bottom: 30px;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  border-color: rgba(125, 211, 252, 0.2);
  background:
    radial-gradient(circle, rgba(125, 211, 252, 0.08) 0 2px, transparent 3px),
    conic-gradient(from 0deg, rgba(125, 211, 252, 0.12), transparent 28%, rgba(147, 197, 253, 0.09), transparent 56%, rgba(125, 211, 252, 0.11), transparent);
  box-shadow: 0 0 18px rgba(125, 211, 252, 0.12), inset 0 0 14px rgba(125, 211, 252, 0.08);
  z-index: 36;
  opacity: 0.72;
}

.radar-widget::before,
.radar-widget::after {
  background: rgba(125, 211, 252, 0.34);
  box-shadow: 0 0 8px rgba(125, 211, 252, 0.22);
}

.radar-widget i {
  border-color: rgba(125, 211, 252, 0.13);
}

.radar-stats {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 2px;
  width: 122px;
  transform: translate(-50%, -44%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(238, 244, 255, 0.66);
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: none;
}

.radar-stats span {
  display: block;
  min-height: 11px;
}

.radar-stats strong,
#metricMode {
  color: rgba(103, 232, 249, 0.76);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.22);
}

.graph-floating-controls {
  left: 16px;
  top: 18px;
  gap: 8px;
  opacity: 0.28;
  transition: opacity 0.18s ease;
}

.graph-floating-controls:hover,
.graph-floating-controls:focus-within {
  opacity: 1;
}

.zoom-floating {
  gap: 4px;
  padding: 3px 6px;
  border: 0;
  background: rgba(2, 8, 22, 0.18);
  clip-path: none;
  box-shadow: none;
}

.icon-button,
.zoom-icon-button,
.new-node-icon-button,
.cluster-icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
  clip-path: none;
  box-shadow: none;
}

.icon-button:hover,
.zoom-icon-button:hover,
.new-node-icon-button:hover,
.cluster-icon-button:hover,
.icon-button:focus-visible,
.zoom-icon-button:focus-visible,
.new-node-icon-button:focus-visible,
.cluster-icon-button:focus-visible {
  border-color: transparent;
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

.cluster-icon-button.is-on {
  color: #bff8ff;
  background: rgba(34, 211, 238, 0.14);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.28);
}

.cluster-icon-button.is-off {
  opacity: 0.52;
}

.zoom-level {
  min-width: 42px;
  padding-inline: 4px;
  font-size: 12px;
}

.graph-canvas-wrap > .new-node-floating {
  right: 18px;
  top: 18px;
  z-index: 18;
}

.new-node-floating {
  right: 18px;
  top: 18px;
  display: grid;
  gap: 8px;
  opacity: 0.28;
  transition: opacity 0.18s ease;
}

.new-node-floating:hover,
.new-node-floating:focus-within {
  opacity: 1;
}

.new-node-icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
}

.graph-canvas-wrap > .map-filter-panel,
.map-filter-panel {
  position: absolute;
  left: auto;
  right: 18px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 30;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  width: min(238px, calc(100% - 34px));
  max-height: min(76%, 560px);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(2, 8, 22, 0.76);
  clip-path: var(--chamfer);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24), inset 0 0 18px rgba(34, 211, 238, 0.08);
}

.map-filter-close-button {
  justify-self: end;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(143, 168, 255, 0.22);
  border-radius: 7px;
  background: rgba(5, 8, 22, 0.82);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.map-filter-close-button:focus-visible {
  outline: 2px solid rgba(136, 246, 255, 0.72);
  outline-offset: 2px;
}

.yoda-log-window {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(2, 8, 22, 0.62);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  white-space: pre-wrap;
}

.yoda-log-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(2, 8, 22, 0.96);
}

.yoda-log-filter {
  display: grid;
  gap: 4px;
  min-width: 130px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.yoda-log-filter select {
  min-height: 34px;
  border: 1px solid rgba(143, 168, 255, 0.24);
  border-radius: 6px;
  background: rgba(5, 8, 22, 0.96);
  color: var(--text);
  padding: 0 9px;
}

.map-filter-panel.is-hidden {
  display: none;
}

.map-filter-panel .panel-label-row {
  display: grid;
  gap: 5px;
}

.map-filter-panel .panel-label,
.map-filter-panel .limit-control {
  font-size: 9px;
}

.map-filter-panel .category-legend {
  gap: 4px;
}

.map-filter-panel .category-item {
  font-size: 9px;
  line-height: 1.15;
}

.autopilot-start-button.is-active {
  color: #fef9c3;
  background: rgba(250, 204, 21, 0.14);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.28);
}

.autopilot-mode-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #67e8f9;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.46));
}

.autopilot-icon,
.autopilot-launch-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-icon {
  fill: currentColor;
  stroke: none;
}

.selection-actions .icon-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
}

.selection-yoda-button .yoda-avatar {
  width: 20px;
  height: 20px;
  object-fit: contain;
  fill: rgba(190, 242, 100, 0.18);
  stroke: #bef264;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selection-yoda-button {
  color: #ecfccb;
  width: 28px;
  min-width: 28px;
  height: 28px;
}

@media (max-width: 1080px) {
  .search-flyout {
    width: calc(100% - 42px);
  }

  .radar-widget {
    width: 126px;
    height: 126px;
  }

  .radar-stats {
    width: 92px;
    font-size: 8px;
  }
}

@media (max-width: 720px) {
  .nav-rail {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }

  .search-flyout,
  .autopilot-flyout,
  .settings-flyout {
    left: 10px;
    right: 10px;
    top: 82px;
    width: auto;
    flex-wrap: wrap;
  }

  .radar-widget {
    width: 78px;
    height: 78px;
    right: 12px;
    bottom: 44px;
  }

  .radar-stats {
    width: 78px;
    font-size: 7px;
  }

  .graph-canvas-wrap > .new-node-floating,
  .new-node-floating {
    top: 12px;
    right: 12px;
  }

  .map-filter-panel {
    left: 12px;
    right: auto;
    top: 50%;
    width: min(240px, calc(100% - 28px));
    max-height: min(72%, 520px);
  }

  .graph-canvas-wrap > .canvas-overlay,
  .canvas-overlay {
    left: auto;
    right: 12px;
    bottom: 8px;
    width: min(220px, calc(100% - 24px));
    max-width: 220px;
    text-align: right;
  }
}

@media (max-width: 1080px) {
  .graph-canvas-wrap,
  .graph-canvas-layer {
    min-height: clamp(520px, 58dvh, 660px);
    height: clamp(520px, 58dvh, 660px);
  }
}

@media (max-width: 720px) {
  .modal-backdrop.ask-yoda-modal {
    padding: 12px;
  }

  .modal-backdrop.ask-yoda-modal .modal-panel {
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    gap: 10px;
    padding: 14px;
  }

  .modal-backdrop.ask-yoda-modal .chat-depth-control {
    width: 100%;
    flex-wrap: wrap;
  }

  .modal-backdrop.ask-yoda-modal .chat-log {
    min-height: 160px;
    max-height: none;
  }

  .modal-backdrop.ask-yoda-modal .chat-input-wrap textarea {
    min-height: 58px;
  }

  .modal-backdrop.ask-yoda-modal .modal-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .workspace > .detail-panel:not(.is-map-overlay) {
    display: none;
  }

  .graph-canvas-wrap,
  .graph-canvas-layer {
    min-height: clamp(440px, 62dvh, 560px);
    height: clamp(440px, 62dvh, 560px);
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay {
    position: absolute;
    left: 12px;
    right: auto;
    bottom: 48px;
    z-index: 8;
    width: min(340px, calc(100% - 24px));
    max-width: calc(100% - 24px);
    max-height: min(220px, 38%);
    min-width: 0;
    padding: 8px 10px;
    overflow: auto;
    border-color: rgba(56, 189, 248, 0.34);
    background: rgba(2, 8, 22, 0.94);
    clip-path: var(--chamfer);
    opacity: 1;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(2, 5, 16, 0.42);
  }

  .graph-canvas-wrap:has(#hoverLabel[data-mode]) > .detail-panel.is-map-overlay:not(.is-context-expanded) {
    bottom: 112px;
    max-height: min(130px, 24%);
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay.is-context-expanded {
    max-height: calc(100% - 88px);
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay::before,
  .graph-canvas-wrap > .detail-panel.is-map-overlay::after {
    opacity: 0;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .panel-section:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "heading"
      "type"
      "slug"
      "summary";
    gap: 3px 10px;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .panel-section:first-child:has(.selection-blueprint.has-media) {
    grid-template-columns: minmax(0, 1fr) 82px;
    grid-template-areas:
      "heading heading"
      "type type"
      "slug slug"
      "summary media";
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .panel-label {
    display: none;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-heading {
    grid-area: heading;
    gap: 4px;
    flex-wrap: wrap;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-title-wrap {
    flex: 1 1 100%;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-heading h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay.is-context-expanded .detail-heading h3 {
    display: block;
    overflow: visible;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .selection-actions {
    gap: 0;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    transform: none;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .selection-context-toggle {
    display: inline-flex;
    width: 32px;
    height: 32px;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-type {
    grid-area: type;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .selection-slug-always {
    grid-area: slug;
    margin: 0;
    font-size: 11px;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-summary {
    grid-area: summary;
    display: -webkit-box;
    min-height: 0;
    max-height: none;
    margin: 2px 0 0;
    overflow: hidden;
    resize: none;
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay.is-context-expanded .detail-summary {
    display: block;
    overflow: visible;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .selection-blueprint {
    display: none;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .selection-blueprint.has-media {
    grid-area: media;
    display: block;
    width: 82px;
    height: 82px;
    margin: 2px 0 0;
    aspect-ratio: 1 / 1;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .selection-media-preview {
    padding: 5px;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .panel-section + .panel-section {
    display: none;
  }

  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-links,
  .graph-canvas-wrap > .detail-panel.is-map-overlay .detail-second-ring {
    display: none;
  }
}
