/* ==========================================================================
   DISPLAY OS · THẾ GIỚI LIVING (ĐỘI HÌNH ĐANG SỐNG)
   Thiết kế: Bảng điều khiển Terminal AI chất lượng cao (Apple / Antigravity HUD)
   Chuẩn mực: Sạch sẽ, chuyên nghiệp, có sức sống, nền trắng theo KV-041
   ========================================================================== */

:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #475569;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --paper: #ffffff;
  --canvas: #f8fafc;
  
  /* Brand & Tier Accents */
  --indigo: #4f46e5;
  --indigo-glow: rgba(79, 70, 229, 0.15);
  --indigo-soft: #eef2ff;
  --indigo-border: #c7d2fe;
  
  --green: #059669;
  --green-glow: rgba(5, 150, 105, 0.18);
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  
  --amber: #d97706;
  --amber-glow: rgba(217, 119, 6, 0.16);
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --rose-border: #fecdd3;
  
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 0 2px rgba(79, 70, 229, 0.2), 0 8px 24px -4px rgba(79, 70, 229, 0.16);
  
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-width: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overflow-x: hidden; }
button { font: inherit; }

/* 1. App Shell & Layout */
.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 32px);
  position: relative;
}

/* 2. Topbar */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
}
.brand-block {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 22px;
  line-height: 1;
}
.eyebrow, .section-kicker {
  margin: 0 0 4px;
  color: var(--indigo);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 4px;
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.live-pill, .refresh-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
  box-shadow: var(--shadow-xs);
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.live-pill[data-state="live"] {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.live-pill[data-state="stale"] {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}
.live-pill[data-state="stale"] .live-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}
.live-dot, .source-dot, .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.live-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  animation: live-pulse 2s infinite ease-in-out;
}
.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.refresh-button:hover, .refresh-button:focus-visible {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-soft);
  box-shadow: var(--shadow-sm);
  outline: none;
  transform: translateY(-1px);
}

/* 3. Telemetry Truth Strip */
.truth-strip {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 64px;
  margin-bottom: 20px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.truth-strip > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.truth-strip strong {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.truth-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.truth-source {
  margin-left: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
}
.source-dot {
  background: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-glow);
}

/* 4. World Layout & Main Deck */
.world-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 20px;
}
.world-card, .inspector {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
.world-card {
  padding: clamp(18px, 2.5vw, 26px);
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.section-heading h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 3px 9px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.legend-working {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-glow);
}
.legend-quiet { background: #64748b; }
.legend-unknown { background: #cbd5e1; }

/* 5. World Map & Zones */
.world-map {
  position: relative;
  display: grid;
  gap: 16px;
}
.world-zone {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.world-zone[data-tier="command"] {
  border-color: var(--indigo-border);
  background: linear-gradient(145deg, #ffffff 0%, #f6f5ff 100%);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.04);
}
.world-zone[data-tier="guard"] {
  border-color: var(--green-border);
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf7 100%);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.04);
}
.world-zone[data-tier="craft"] {
  border-color: var(--amber-border);
  background: linear-gradient(145deg, #ffffff 0%, #fffbf0 100%);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.04);
}

.zone-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.zone-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--indigo-soft);
  color: var(--indigo);
  border: 1px solid var(--indigo-border);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.world-zone[data-tier="guard"] .zone-marker {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-border);
}
.world-zone[data-tier="craft"] .zone-marker {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-border);
}
.zone-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.zone-copy {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.zone-count {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  color: var(--ink-secondary);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}
.world-zone[data-tier="command"] .zone-count {
  background: #eef2ff;
  color: var(--indigo);
  border-color: var(--indigo-border);
}
.world-zone[data-tier="guard"] .zone-count {
  background: #ecfdf5;
  color: var(--green);
  border-color: var(--green-border);
}
.world-zone[data-tier="craft"] .zone-count {
  background: #fffbeb;
  color: var(--amber);
  border-color: var(--amber-border);
}

/* 6. Character Grid & Cards (THE HERO) */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.character {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.16s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.16s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.16s ease;
}
.character:hover {
  border-color: #a5b4fc;
  box-shadow: 0 6px 20px -3px rgba(99, 102, 241, 0.14);
  transform: translateY(-2px);
}
.character:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}
.character[aria-current="true"] {
  border-color: var(--indigo) !important;
  background: #ffffff !important;
  box-shadow: var(--shadow-glow) !important;
  transform: translateY(-2px);
}

/* Avatar Squircle */
.character-avatar-wrap {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.character-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  filter: grayscale(0.15);
  transition: filter 0.2s ease, transform 0.2s ease;
}

/* Character Copy */
.character-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.character-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.character-role {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.character-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2.5px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  width: fit-content;
  max-width: 100%;
  line-height: 1.3;
}
.character-status .status-dot {
  width: 6px;
  height: 6px;
  background: var(--faint);
  flex-shrink: 0;
}
.character-status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card States: LIVING / WORKING */
.character[data-state="working"] {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}
.character[data-state="working"]:hover {
  border-color: #10b981;
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.22);
}
.character[data-state="working"] .character-avatar-wrap {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18), 0 0 12px rgba(16, 185, 129, 0.2);
}
.character[data-state="working"] .character-avatar {
  filter: none;
  animation: breathe 3.2s ease-in-out infinite;
}
.character[data-state="working"] .character-status {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}
.character[data-state="working"] .character-status .status-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.3);
  animation: live-beacon 1.8s ease-in-out infinite;
}

/* Card States: BLOCKED / KẸT */
.character[data-state="blocked"] {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}
.character[data-state="blocked"]:hover {
  border-color: #ef4444;
  box-shadow: 0 8px 24px -4px rgba(239, 68, 68, 0.25);
}
.character[data-state="blocked"] .character-avatar-wrap {
  border-color: #ef4444;
  background: #fee2e2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
.character[data-state="blocked"] .character-status {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.character[data-state="blocked"] .character-status .status-dot {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
  animation: live-beacon 1.2s ease-in-out infinite;
}

/* Character Task Badge */
.character-task {
  display: block;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 5px;
  padding: 2px 6px;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.25;
}
.character[data-state="blocked"] .character-task {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fca5a5;
}
.character[data-state="quiet"] .character-task {
  color: #64748b;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* Card States: QUIET / STANDBY */
.character[data-state="quiet"] {
  border-color: var(--line);
  background: var(--paper);
}
.character[data-state="quiet"] .character-avatar {
  filter: grayscale(0.85) opacity(0.75);
}
.character[data-state="quiet"] .character-status {
  background: #f8fafc;
  color: #64748b;
  border-color: var(--line);
}
.character[data-state="quiet"] .character-status .status-dot {
  background: #94a3b8;
}

/* Card States: UNKNOWN / UNASSIGNED */
.character[data-state="unknown"] {
  border-color: var(--line);
  background: #fafbfc;
  border-style: dashed;
}
.character[data-state="unknown"] .character-avatar-wrap {
  border-style: dashed;
  background: #f1f5f9;
}
.character[data-state="unknown"] .character-avatar {
  filter: grayscale(1) opacity(0.55);
}
.character[data-state="unknown"] .character-status {
  background: #f8fafc;
  color: var(--faint);
  border-color: var(--line);
  border-style: dashed;
}
.character[data-state="unknown"] .character-status .status-dot {
  background: var(--faint);
}

/* 7. Relation Lines & Telemetry */
.relation-svg {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  color: var(--indigo);
}
.relation-edge {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.75;
  stroke-dasharray: 4 2;
  animation: signal-flow 30s linear infinite;
}
.relation-missing-stub {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: 0.85;
}
.relation-status {
  display: grid;
  gap: 4px;
  margin: 14px 2px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.relation-status[data-state="missing"] {
  border-color: var(--amber-border);
  background: var(--amber-soft);
  color: #92400e;
}
.relation-status[data-state="complete"] {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: #065f46;
}
.relation-status span:first-child {
  color: var(--ink);
  font-weight: 800;
}
.map-note {
  margin: 14px 2px 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}

/* 8. Inspector (HỒ SƠ NHÂN VẬT) */
.inspector {
  position: sticky;
  top: 20px;
  padding: 22px;
}
.inspector-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.15s ease;
}
.icon-button:hover, .icon-button:focus-visible {
  border-color: var(--indigo);
  background: #ffffff;
  color: var(--indigo);
  outline: none;
}
.inspector-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 14px;
}
.inspector-avatar-wrap {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border: 1px solid var(--indigo-border);
  border-radius: 16px;
  background: var(--indigo-soft);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15);
}
.inspector-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.inspector h2 {
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.inspector-hero p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.inspector-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.inspector-status[data-state="working"] {
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green);
}
.inspector-status[data-state="working"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-glow);
}

.facts {
  display: grid;
  gap: 0;
  margin: 0;
}
.facts > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
  align-items: baseline;
}
.facts dt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.facts dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 4px 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* 9. Loading & Errors */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.loading-orb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--indigo-border);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.error-state {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--rose-soft);
  border: 1px solid var(--rose-border);
  color: var(--rose);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
}

/* 10. Animations */
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes live-beacon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.75; }
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes signal-flow {
  to { stroke-dashoffset: -100; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 11. Responsive */
@media (max-width: 900px) {
  .app-shell { padding: 16px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .topbar-actions { justify-content: flex-start; }
  .world-layout { grid-template-columns: 1fr; }
  .inspector { position: static; }
  .truth-strip { gap: 18px; }
}
@media (max-width: 460px) {
  .truth-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 12px 14px;
  }
  .truth-source {
    width: 100%;
    margin-left: 0;
    padding-top: 6px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .world-card { padding: 14px; }
  .world-zone { padding: 12px; }
  .character-grid { grid-template-columns: 1fr; }
  .footer-note { flex-direction: column; }
}

/* ==========================================================================
   12. SỐ HIỆU · NHỊP TIM SỐNG ĐỘNG · ĐẾM PHÚT HOẠT ĐỘNG · CHUÔNG BÁO (KV-HUD)
   ========================================================================== */

/* Huy hiệu đếm phút hoạt động trên thẻ nhân vật */
.character-minute-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 1px 6px !important;
  margin-top: 3px !important;
  margin-bottom: 2px !important;
  border-radius: 6px !important;
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  width: fit-content !important;
  line-height: 1.2 !important;
  box-shadow: 0 1px 2px rgba(3, 105, 161, 0.05) !important;
}
.dong-ho-icon {
  font-style: normal !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

/* Nhịp tim sống động (Heartbeat Animation) - override css-toi-uu-air-m1 */
@keyframes nhip-tim-dap {
  0% {
    transform: scale(1) !important;
    filter: drop-shadow(0 0 0 rgba(225, 29, 72, 0)) !important;
  }
  18% {
    transform: scale(1.28) !important;
    filter: drop-shadow(0 0 5px rgba(225, 29, 72, 0.6)) !important;
  }
  32% {
    transform: scale(1.04) !important;
    filter: drop-shadow(0 0 2px rgba(225, 29, 72, 0.3)) !important;
  }
  48% {
    transform: scale(1.2) !important;
    filter: drop-shadow(0 0 4px rgba(225, 29, 72, 0.5)) !important;
  }
  70% {
    transform: scale(1) !important;
    filter: drop-shadow(0 0 0 rgba(225, 29, 72, 0)) !important;
  }
  100% {
    transform: scale(1) !important;
    filter: drop-shadow(0 0 0 rgba(225, 29, 72, 0)) !important;
  }
}

html body .nhip-tim-song,
html body .nhip-tim-dap-thuc-thi {
  display: inline-block !important;
  animation: nhip-tim-dap 1.2s infinite ease-in-out !important;
  animation-duration: 1.2s !important;
  animation-iteration-count: infinite !important;
  transform-origin: center center !important;
}

.character-heartbeat-wrap {
  display: inline-flex !important;
  align-items: center !important;
  margin-left: 4px !important;
  line-height: 1 !important;
}
.nhip-tim-icon {
  font-style: normal !important;
  font-size: 11px !important;
  line-height: 1 !important;
  user-select: none !important;
}
.nhip-tim-nghi {
  opacity: 0.45 !important;
}

/* Nút điều khiển chuông và nhịp tim trên thanh Telemetry */
#cum-nhip-tim-he-thong strong {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.cum-chuong-xong-viec {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.nut-chuong-mini,
.nut-keu-thu-mini {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}
.nut-chuong-mini.dang-bat {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
.nut-chuong-mini.dang-bat:hover {
  background: #dcfce7 !important;
  border-color: #4ade80 !important;
}
.nut-chuong-mini.dang-tat {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}
.nut-chuong-mini.dang-tat:hover {
  background: #fee2e2 !important;
}
.nut-keu-thu-mini {
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.nut-keu-thu-mini:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Hiệu ứng trượt cho thông báo Toast */
@keyframes toast-drop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   DISPLAY OS · ÁNH XẠ 4 THEME OS CHO THẾ GIỚI LIVING (WO-DU-PHONG-OVERHAUL-ALL)
   ========================================================================== */
[data-theme="space"], body.theme-space {
  color-scheme: dark;
  --ink: #f1f5f9;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --line: rgba(99, 102, 241, 0.25);
  --line-strong: rgba(99, 102, 241, 0.45);
  --paper: #0e1424;
  --canvas: #070a12;
  --bg: #070a12;
  --card-bg: #0e1424;
  --text: #f1f5f9;
  --border: rgba(99, 102, 241, 0.3);
  --bubble-jack: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  --bubble-agent: #0e1424;
  background: radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.16), transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.14), transparent 50%),
              #070a12 !important;
  color: #f1f5f9 !important;
}

[data-theme="cyber"], body.theme-cyber {
  color-scheme: dark;
  --ink: #e0fbfc;
  --ink-secondary: #98c1d9;
  --muted: #64748b;
  --faint: #475569;
  --line: rgba(0, 240, 255, 0.22);
  --line-strong: rgba(0, 240, 255, 0.4);
  --paper: #091017;
  --canvas: #040608;
  --bg: #040608;
  --card-bg: #091017;
  --text: #e0fbfc;
  --border: rgba(0, 240, 255, 0.3);
  --bubble-jack: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  --bubble-agent: #091017;
  background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.12), transparent 45%),
              radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 45%),
              #040608 !important;
  color: #e0fbfc !important;
}

[data-theme="glass"], body.theme-glass {
  color-scheme: dark;
  --ink: #f8fafc;
  --ink-secondary: #e2e8f0;
  --muted: #cbd5e1;
  --faint: #94a3b8;
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.25);
  --paper: rgba(30, 41, 59, 0.75);
  --canvas: #0f172a;
  --bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.75);
  --text: #f8fafc;
  --border: rgba(255, 255, 255, 0.18);
  --bubble-jack: rgba(2, 132, 199, 0.35);
  --bubble-agent: rgba(30, 41, 59, 0.65);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  color: #f8fafc !important;
}

[data-theme="obsidian"], body.theme-obsidian {
  color-scheme: dark;
  --ink: #f4f4f5;
  --ink-secondary: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --line: #27272a;
  --line-strong: #3f3f46;
  --paper: #121215;
  --canvas: #09090b;
  --bg: #09090b;
  --card-bg: #121215;
  --text: #f4f4f5;
  --border: #27272a;
  --bubble-jack: #1c1917;
  --bubble-agent: #121215;
  background: #09090b !important;
  color: #f4f4f5 !important;
}

/* ==========================================================================
   13. BỨC TRANH DÒNG CHẢY TÁC CHIẾN ĐANG CHẠY (LIVE ACTIVE WORKFLOW STREAM)
   Thiết kế: Apple HUD / Linear Tactical Live Ops Dashboard
   ========================================================================== */

/* Bảo vệ tuyệt đối cho Bộ 4 Tab Chuyển Góc Nhìn khỏi các luật global *!important */
.thanh-chuyen-goc-nhin .tab-goc-nhin {
  background: transparent !important;
  color: #cbd5e1 !important;
  border-color: transparent !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin .tab-text {
  color: inherit !important;
  display: inline-block !important;
  font-weight: 700 !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin:not(.active) {
  color: #cbd5e1 !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin:not(.active) .tab-text {
  color: #cbd5e1 !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin:not(.active):hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin:not(.active):hover .tab-text {
  color: #ffffff !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3) !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin.active .tab-text {
  color: #ffffff !important;
}

/* Badge số lượng đang chạy trên Tab chuyển góc nhìn */
.thanh-chuyen-goc-nhin .tab-goc-nhin .badge-tab-active-count {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 7px !important;
  background: #10b981 !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  line-height: 1 !important;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.35) !important;
  animation: pulse-soft 2.5s infinite ease-in-out !important;
}
.thanh-chuyen-goc-nhin .tab-goc-nhin.active .badge-tab-active-count {
  background: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
}
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.88; }
}

/* Container chính của Dòng Chảy */
.view-container-dong-chay {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 4px 30px 4px;
}

/* 1. Header Card của Dòng Chảy */
.dong-chay-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}
.dc-header-trai {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent !important;
  border: none !important;
}
.dc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  width: fit-content;
}
.dc-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: live-beacon 1.5s infinite ease-in-out;
}
.dc-title {
  margin: 2px 0 0 0 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: #0f172a !important;
}
.dc-desc {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}
.dc-header-phai {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.dc-metric-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  min-width: 120px;
}
.dc-metric-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.06em;
}
.dc-metric-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
}
.dc-metric-value.text-accent {
  color: #0284c7;
}
.dc-metric-value.text-success {
  color: #059669;
}

/* 2. Thước đo tiến trình 5 chặng JOF v4 */
.dc-pipeline-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  overflow-x: auto;
  gap: 8px;
}
.dc-progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.step-circle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}
.dc-progress-step.da-xong .step-circle {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}
.dc-progress-step.dang-chay .step-circle {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
}
.pulse-spin {
  animation: pulse-spin 2s infinite ease-in-out;
}
@keyframes pulse-spin {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(15deg); }
}
.step-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}
.step-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.dc-progress-step.dang-chay .step-name {
  color: #0284c7;
}
.dc-progress-connector {
  flex: 1 1 20px;
  height: 2.5px;
  background: #e2e8f0;
  min-width: 16px;
  border-radius: 2px;
}
.dc-progress-connector.da-xong {
  background: #22c55e;
}
.dc-progress-connector.dang-chay {
  background: linear-gradient(90deg, #22c55e 0%, #0284c7 100%);
}

/* 3. Bức tranh Dòng chảy Stream Canvas */
.dc-stream-canvas {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 36px minmax(175px, 1.05fr) 36px minmax(215px, 1.25fr) 36px minmax(165px, 1fr);
  align-items: stretch;
  gap: 6px;
  padding: 18px 14px;
  min-height: calc(100vh - 66px) !important;
  min-height: calc(100dvh - 66px) !important;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow-x: auto;
  box-sizing: border-box;
}

/* Node Cards */
.dc-node-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  background: #fafbfc;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.dc-node-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

.dc-node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dc-avatar-wrap {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 18px;
  flex-shrink: 0;
}
.dc-node-meta {
  flex: 1 1 100px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dc-node-role {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  white-space: normal;
  line-height: 1.25;
}
.dc-node-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  white-space: normal;
}
.dc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: auto;
}
.pill-working {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.pill-crafting {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}
.pill-standby {
  background: #fefce8;
  color: #ca8a04;
  border: 1px solid #fef08a;
}

.dc-node-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dc-task-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.06em;
}
.dc-task-content {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.45;
  font-weight: 500;
  background: #ffffff;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}
.dc-node-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.dc-output-tag {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}

/* Specific Card Themes */
.node-jack {
  border-color: #fde68a;
  background: linear-gradient(145deg, #ffffff 0%, #fffdf5 100%);
}
.node-jack .dc-avatar-wrap {
  border-color: #fde68a;
  background: #fffbeb;
}
.node-planner {
  border-color: #c7d2fe;
  background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
}
.node-planner .dc-avatar-wrap {
  border-color: #c7d2fe;
  background: #eef2ff;
}

/* HERO ACTIVE NODE: Developer Fleet */
.hero-active-node {
  border: 2px solid #0284c7 !important;
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%) !important;
  box-shadow: 0 10px 30px -4px rgba(2, 132, 199, 0.22), 0 0 0 3px rgba(2, 132, 199, 0.12) !important;
  transform: scale(1.02);
  z-index: 5;
}
.hero-active-node:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 14px 36px -4px rgba(2, 132, 199, 0.3) !important;
}
.dc-node-badge-hero {
  position: absolute;
  top: -12px;
  left: 18px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.pulse-glow {
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 0 16px rgba(2, 132, 199, 0.3);
  animation: pulse-glow-anim 2s infinite ease-in-out;
}
@keyframes pulse-glow-anim {
  0%, 100% { box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 0 16px rgba(2, 132, 199, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.4), 0 0 24px rgba(2, 132, 199, 0.45); }
}

/* Files Owned Chips */
.dc-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.dc-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #0369a1;
  text-decoration: none;
  transition: all 0.15s ease;
}
.dc-file-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  transform: translateY(-1px);
}
.badge-mod {
  background: #fef08a;
  color: #854d0e;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}
.badge-ok {
  background: #bbf7d0;
  color: #166534;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}
.dc-live-runtime-status {
  margin-top: 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dc-live-runtime-status strong {
  color: #059669;
}
.btn-dc-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  width: 100%;
  justify-content: center;
}
.btn-dc-action:hover {
  background: #0369a1;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
}

/* Flow Connectors */
.dc-vector-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  width: 36px;
  min-width: 28px;
  flex-shrink: 0;
}
.dc-flow-line {
  position: relative;
  width: 100%;
  height: 2.5px;
  background: #cbd5e1;
  border-radius: 2px;
  overflow: hidden;
}
.dc-flow-line.active-line {
  background: #93c5fd;
}
.dc-flow-particle {
  position: absolute;
  top: -2px;
  left: 0;
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: #0284c7;
  box-shadow: 0 0 6px #0284c7;
  animation: particle-fly 2s infinite linear;
}
.dc-flow-particle.fast {
  animation-duration: 1.2s;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}
.dc-flow-particle.slow {
  animation-duration: 3s;
}
@keyframes particle-fly {
  0% { left: -12px; }
  100% { left: 100%; }
}
.dc-flow-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
  background: #f8fafc;
  padding: 1px 3px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* 4. Artifacts Strip */
.dc-artifacts-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}
.dc-artifacts-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dc-art-icon {
  font-size: 16px;
}
.dc-art-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #334155;
}
.dc-artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.dc-art-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dc-art-item:hover {
  background: #ffffff;
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
}
.art-badge-type {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  letter-spacing: 0.04em;
}
.art-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.art-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

/* 5. Standby Rack (Băng ghế dự bị) */
.dc-standby-rack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
  background: #fafbfc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
}
.dc-standby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dc-standby-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #475569;
}
.dc-standby-note {
  font-size: 11px;
  color: #94a3b8;
}
.dc-standby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.dc-standby-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dc-standby-chip:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  transform: translateY(-1px);
}
.standby-avatar {
  font-size: 15px;
  line-height: 1;
}
.standby-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.standby-role {
  font-size: 9.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* ==========================================================================
   THEME OS SUPPORT FOR DÒNG CHẢY LIVE (Space, Cyber, Glass, Obsidian)
   ========================================================================== */
[data-theme="space"] .dong-chay-header-card,
[data-theme="space"] .dc-pipeline-progress-bar,
[data-theme="space"] .dc-stream-canvas,
[data-theme="space"] .dc-artifacts-strip,
body.theme-space .dong-chay-header-card,
body.theme-space .dc-pipeline-progress-bar,
body.theme-space .dc-stream-canvas,
body.theme-space .dc-artifacts-strip {
  background: #0e1424 !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="space"] .dc-title,
body.theme-space .dc-title {
  color: #f1f5f9 !important;
}
[data-theme="space"] .dc-node-card,
body.theme-space .dc-node-card {
  background: #131b31 !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
}
[data-theme="space"] .dc-node-name,
[data-theme="space"] .art-name,
body.theme-space .dc-node-name,
body.theme-space .art-name {
  color: #f1f5f9 !important;
}
[data-theme="space"] .dc-task-content,
body.theme-space .dc-task-content {
  background: #0b101e !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
  color: #cbd5e1 !important;
}
[data-theme="space"] .dc-standby-rack,
body.theme-space .dc-standby-rack {
  background: #0b101e !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
}
[data-theme="space"] .dc-standby-chip,
[data-theme="space"] .dc-art-item,
body.theme-space .dc-standby-chip,
body.theme-space .dc-art-item {
  background: #131b31 !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
}
[data-theme="space"] .standby-name,
body.theme-space .standby-name {
  color: #e2e8f0 !important;
}

/* Cyber Theme */
[data-theme="cyber"] .dong-chay-header-card,
[data-theme="cyber"] .dc-pipeline-progress-bar,
[data-theme="cyber"] .dc-stream-canvas,
[data-theme="cyber"] .dc-artifacts-strip,
body.theme-cyber .dong-chay-header-card,
body.theme-cyber .dc-pipeline-progress-bar,
body.theme-cyber .dc-stream-canvas,
body.theme-cyber .dc-artifacts-strip {
  background: #091017 !important;
  border-color: rgba(0, 240, 255, 0.3) !important;
}
[data-theme="cyber"] .dc-title,
[data-theme="cyber"] .dc-node-name,
[data-theme="cyber"] .art-name,
body.theme-cyber .dc-title,
body.theme-cyber .dc-node-name,
body.theme-cyber .art-name {
  color: #e0fbfc !important;
}
[data-theme="cyber"] .dc-node-card,
body.theme-cyber .dc-node-card {
  background: #0e1822 !important;
  border-color: rgba(0, 240, 255, 0.25) !important;
}
[data-theme="cyber"] .dc-task-content,
[data-theme="cyber"] .dc-standby-chip,
[data-theme="cyber"] .dc-art-item,
body.theme-cyber .dc-task-content,
body.theme-cyber .dc-standby-chip,
body.theme-cyber .dc-art-item {
  background: #070d13 !important;
  border-color: rgba(0, 240, 255, 0.2) !important;
  color: #98c1d9 !important;
}

/* Obsidian Theme */
[data-theme="obsidian"] .dong-chay-header-card,
[data-theme="obsidian"] .dc-pipeline-progress-bar,
[data-theme="obsidian"] .dc-stream-canvas,
[data-theme="obsidian"] .dc-artifacts-strip,
body.theme-obsidian .dong-chay-header-card,
body.theme-obsidian .dc-pipeline-progress-bar,
body.theme-obsidian .dc-stream-canvas,
body.theme-obsidian .dc-artifacts-strip {
  background: #121215 !important;
  border-color: #27272a !important;
}
[data-theme="obsidian"] .dc-title,
[data-theme="obsidian"] .dc-node-name,
[data-theme="obsidian"] .art-name,
body.theme-obsidian .dc-title,
body.theme-obsidian .dc-node-name,
body.theme-obsidian .art-name {
  color: #f4f4f5 !important;
}
[data-theme="obsidian"] .dc-node-card,
body.theme-obsidian .dc-node-card {
  background: #18181b !important;
  border-color: #27272a !important;
}
[data-theme="obsidian"] .dc-task-content,
[data-theme="obsidian"] .dc-standby-chip,
[data-theme="obsidian"] .dc-art-item,
body.theme-obsidian .dc-task-content,
body.theme-obsidian .dc-standby-chip,
body.theme-obsidian .dc-art-item {
  background: #09090b !important;
  border-color: #27272a !important;
  color: #d4d4d8 !important;
}

/* Glass Theme */
[data-theme="glass"] .dong-chay-header-card,
[data-theme="glass"] .dc-pipeline-progress-bar,
[data-theme="glass"] .dc-stream-canvas,
[data-theme="glass"] .dc-artifacts-strip,
body.theme-glass .dong-chay-header-card,
body.theme-glass .dc-pipeline-progress-bar,
body.theme-glass .dc-stream-canvas,
body.theme-glass .dc-artifacts-strip {
  background: rgba(30, 41, 59, 0.75) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Responsive */
@media (max-width: 640px) {
  .dc-stream-canvas {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .dc-vector-flow,
  .dc-flow-connector-svg-wrap {
    transform: rotate(90deg) !important;
    margin: 8px auto !important;
  }
}

.dc-flow-connector-svg-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 36px;
  min-width: 30px;
  flex-shrink: 0;
  position: relative;
}

.dc-flow-svg {
  width: 100%;
  height: 14px;
  overflow: visible;
}

.flow-track {
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 3;
  stroke-linecap: round;
}

.flow-pulse {
  stroke: #0284c7;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 8 14;
  animation: flowPulseAnim 1.4s linear infinite;
}

@keyframes flowPulseAnim {
  0% { stroke-dashoffset: 22; }
  100% { stroke-dashoffset: 0; }
}

.dc-flow-badge-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Specific Badge Theme Overrides cho Dòng Chảy Thẻ Node */
.node-jack .dc-status-pill {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
  font-weight: 800 !important;
}

.node-planner .dc-status-pill {
  background: #e0e7ff !important;
  color: #3730a3 !important;
  border: 1px solid #c7d2fe !important;
  font-weight: 800 !important;
}

.hero-active-node .dc-status-pill {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
  font-weight: 800 !important;
}

.node-tester .dc-status-pill {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
  font-weight: 800 !important;
}

/* ==========================================================================
   FLEET COMMAND HUB (DRAWER / POPULAR ACCORDION HUBS)
   Thay thế nghĩa trang 46 nút đen sì bằng cấu trúc phân cấp tinh tế
   ========================================================================== */
.fleet-command-hub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.05);
  margin-top: 14px;
  box-sizing: border-box;
}

.fch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.fch-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fch-icon {
  font-size: 20px;
  line-height: 1;
}

.fch-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0f172a;
  margin: 0;
  text-transform: uppercase;
}

.fch-badge-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.fch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fch-search-input {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.15s ease;
  min-width: 180px;
}

.fch-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.fch-filter-tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.05);
  padding: 3px;
  border-radius: 10px;
}

.fch-filter-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.fch-filter-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Nhóm Đang Thực Thi (Active Fleet) */
.fch-section-active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fch-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #059669;
  text-transform: uppercase;
}

.fch-active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.fch-active-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.fch-active-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.2);
  border-color: #22c55e;
}

/* Nhóm Băng Ghế Dự Bị Theo 5 Tầng (Accordion Drawer) */
.fch-standby-tiers-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.fch-tier-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  transition: all 0.2s ease;
}

.fch-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: rgba(15, 23, 42, 0.02);
  transition: background 0.15s ease;
  min-height: 44px; /* Apple HIG Touch Target */
}

.fch-tier-header:hover {
  background: rgba(15, 23, 42, 0.04);
}

.fch-tier-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 750;
  color: #0f172a;
}

.fch-tier-badge {
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
}

.fch-tier-arrow {
  font-size: 12px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.fch-tier-card.open .fch-tier-arrow {
  transform: rotate(180deg);
}

.fch-tier-body {
  display: none;
  padding: 12px 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.fch-tier-card.open .fch-tier-body {
  display: grid;
}

/* Thẻ chip Standby */
.dc-standby-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px; /* Apple HIG Touch Target */
  box-sizing: border-box;
}

.dc-standby-chip:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.standby-avatar {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.standby-name {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 750;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.standby-role {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* Dark Theme Overrides cho Fleet Command Hub & Dòng chảy */
[data-theme="space"] .fleet-command-hub,
[data-theme="cyber"] .fleet-command-hub,
[data-theme="obsidian"] .fleet-command-hub,
[data-theme="synthwave"] .fleet-command-hub,
[data-theme="glass"] .fleet-command-hub,
body.theme-space .fleet-command-hub,
body.theme-cyber .fleet-command-hub,
body.theme-obsidian .fleet-command-hub,
body.theme-synthwave .fleet-command-hub,
body.theme-glass .fleet-command-hub {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="space"] .fch-title,
[data-theme="cyber"] .fch-title,
[data-theme="obsidian"] .fch-title,
[data-theme="synthwave"] .fch-title,
[data-theme="glass"] .fch-title,
body.theme-space .fch-title,
body.theme-cyber .fch-title,
body.theme-obsidian .fch-title,
body.theme-synthwave .fch-title,
body.theme-glass .fch-title {
  color: #f8fafc !important;
}

[data-theme="space"] .fch-tier-card,
[data-theme="cyber"] .fch-tier-card,
[data-theme="obsidian"] .fch-tier-card,
[data-theme="synthwave"] .fch-tier-card,
[data-theme="glass"] .fch-tier-card,
body.theme-space .fch-tier-card,
body.theme-cyber .fch-tier-card,
body.theme-obsidian .fch-tier-card,
body.theme-synthwave .fch-tier-card,
body.theme-glass .fch-tier-card {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
}

[data-theme="space"] .fch-tier-title-left,
[data-theme="cyber"] .fch-tier-title-left,
[data-theme="obsidian"] .fch-tier-title-left,
[data-theme="synthwave"] .fch-tier-title-left,
[data-theme="glass"] .fch-tier-title-left,
body.theme-space .fch-tier-title-left,
body.theme-cyber .fch-tier-title-left,
body.theme-obsidian .fch-tier-title-left,
body.theme-synthwave .fch-tier-title-left,
body.theme-glass .fch-tier-title-left {
  color: #f8fafc !important;
}

[data-theme="space"] .dc-standby-chip,
[data-theme="cyber"] .dc-standby-chip,
[data-theme="obsidian"] .dc-standby-chip,
[data-theme="synthwave"] .dc-standby-chip,
[data-theme="glass"] .dc-standby-chip,
body.theme-space .dc-standby-chip,
body.theme-cyber .dc-standby-chip,
body.theme-obsidian .dc-standby-chip,
body.theme-synthwave .dc-standby-chip,
body.theme-glass .dc-standby-chip {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
}

[data-theme="space"] .standby-name,
[data-theme="cyber"] .standby-name,
[data-theme="obsidian"] .standby-name,
[data-theme="synthwave"] .standby-name,
[data-theme="glass"] .standby-name,
body.theme-space .standby-name,
body.theme-cyber .standby-name,
body.theme-obsidian .standby-name,
body.theme-synthwave .standby-name,
body.theme-glass .standby-name {
  color: #e0fbfc !important;
}

[data-theme="space"] .fch-search-input,
[data-theme="cyber"] .fch-search-input,
[data-theme="obsidian"] .fch-search-input,
[data-theme="synthwave"] .fch-search-input,
[data-theme="glass"] .fch-search-input,
body.theme-space .fch-search-input,
body.theme-cyber .fch-search-input,
body.theme-obsidian .fch-search-input,
body.theme-synthwave .fch-search-input,
body.theme-glass .fch-search-input {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: #f8fafc !important;
}

[data-theme="space"] .dc-flow-badge-label,
[data-theme="cyber"] .dc-flow-badge-label,
[data-theme="obsidian"] .dc-flow-badge-label,
[data-theme="synthwave"] .dc-flow-badge-label,
[data-theme="glass"] .dc-flow-badge-label,
body.theme-space .dc-flow-badge-label,
body.theme-cyber .dc-flow-badge-label,
body.theme-obsidian .dc-flow-badge-label,
body.theme-synthwave .dc-flow-badge-label,
body.theme-glass .dc-flow-badge-label {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

/* Dark Theme Override cho Active Fleet Cards */
[data-theme="space"] .fch-active-chip,
[data-theme="cyber"] .fch-active-chip,
[data-theme="obsidian"] .fch-active-chip,
[data-theme="synthwave"] .fch-active-chip,
[data-theme="glass"] .fch-active-chip,
body.theme-space .fch-active-chip,
body.theme-cyber .fch-active-chip,
body.theme-obsidian .fch-active-chip,
body.theme-synthwave .fch-active-chip,
body.theme-glass .fch-active-chip {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25) !important;
}

[data-theme="space"] .fch-active-chip .standby-name,
[data-theme="cyber"] .fch-active-chip .standby-name,
[data-theme="obsidian"] .fch-active-chip .standby-name,
[data-theme="synthwave"] .fch-active-chip .standby-name,
[data-theme="glass"] .fch-active-chip .standby-name,
body.theme-space .fch-active-chip .standby-name,
body.theme-cyber .fch-active-chip .standby-name,
body.theme-obsidian .fch-active-chip .standby-name,
body.theme-synthwave .fch-active-chip .standby-name,
body.theme-glass .fch-active-chip .standby-name {
  color: #f8fafc !important;
}

/* Ẩn các Floating Buttons rác để giữ The Compass FAB duy nhất */
.gop-y-fab,
.snapshot-launcher,
.btn-ai-tuy-bien-floating,
.btn-ban-giao-floating,
#display-os-nut-noi-them,
#btn-snapshot-doc-lap,
.dos-ai-ban-do,
#dos-ban-giao-drawer {
  display: none !important;
}

/* Định vị dấu bản tự động lệch sang trái để không đè The Compass */
#dau-ban-tu-dong,
div#dau-ban-tu-dong,
.dau-ban-tu-dong {
  left: 16px !important;
  right: auto !important;
  bottom: 4px !important;
}

/* ==========================================================================
   WO-THE-GIOI-EXECUTIVE-STREAM-AND-WHITE-THEME
   1. HUD BAR THE GIOI · CHUẨN APPLE FROSTED GLASS & HIG
   ========================================================================== */
#hud-bar-the-gioi,
.hud-bar-the-gioi {
  position: fixed !important;
  top: 8px !important;
  left: 12px !important;
  right: 12px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06) !important;
  z-index: 100 !important;
  box-sizing: border-box !important;
  gap: 12px !important;
}

/* Dark Theme Overrides cho HUD Bar */
.theme-toi #hud-bar-the-gioi,
[data-theme="space"] #hud-bar-the-gioi,
[data-theme="cyber"] #hud-bar-the-gioi,
[data-theme="obsidian"] #hud-bar-the-gioi,
[data-theme="synthwave"] #hud-bar-the-gioi,
[data-theme="glass"] #hud-bar-the-gioi {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.5) !important;
}

/* Trái: Logo Brand & Capsule Theme Văn Hóa */
.hud-left-zone {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.hud-brand {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 6px !important;
  border-radius: 10px !important;
  background: transparent !important;
}

.hud-brand-mark {
  font-size: 16px !important;
  line-height: 1 !important;
}

.hud-brand-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: #0f172a !important;
  white-space: nowrap !important;
}
.theme-toi .hud-brand-title {
  color: #f8fafc !important;
}

.hud-capsule-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}
.hud-capsule-btn:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  transform: translateY(-1px) !important;
}
.theme-toi .hud-capsule-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f1f5f9 !important;
}
.theme-toi .hud-capsule-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: #38bdf8 !important;
}

/* Giữa: Segmented Tabs (Liquid Pill) */
.hud-center-zone {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 auto !important;
  max-width: 520px !important;
}

.hud-segmented-tabs {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px !important;
  gap: 3px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-radius: 12px !important;
  width: 100% !important;
  justify-content: space-between !important;
}
.theme-toi .hud-segmented-tabs {
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.hud-segmented-tabs .tab-goc-nhin {
  flex: 1 1 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 5px 8px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 9px !important;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  white-space: nowrap !important;
}
.hud-segmented-tabs .tab-goc-nhin:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.5) !important;
}
.theme-toi .hud-segmented-tabs .tab-goc-nhin {
  color: #94a3b8 !important;
}
.theme-toi .hud-segmented-tabs .tab-goc-nhin:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.hud-segmented-tabs .tab-goc-nhin.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.theme-toi .hud-segmented-tabs .tab-goc-nhin.active {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4) !important;
}

/* Phải: Status & Controls */
.hud-right-zone {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.hud-status-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 9px !important;
  height: 32px !important;
  border-radius: 9999px !important;
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
  color: #065f46 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
.theme-toi .hud-status-pill {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
  color: #34d399 !important;
}

.hud-btn-control {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}
.hud-btn-control:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
}
.theme-toi .hud-btn-control {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f1f5f9 !important;
}
.theme-toi .hud-btn-control:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: #38bdf8 !important;
}

.hud-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.hud-icon-btn:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  transform: scale(1.04) !important;
}
.theme-toi .hud-icon-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}
.theme-toi .hud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: #38bdf8 !important;
}

/* ==========================================================================
   2. TAB 2: ĐỘI HÌNH ĐANG SỐNG (ROSTER 5 TẦNG) · GỌN GÀNG KHÍT KHAO
   ========================================================================== */
.world-layout {
  position: relative !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 62px 12px 24px !important;
  box-sizing: border-box !important;
}

.world-card {
  position: relative !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 20px !important;
  padding: 16px !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
}
.theme-toi .world-card {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.5) !important;
}

.world-map {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

/* 5 Tầng World Zone: Khít khao, trang nhã */
.world-zone {
  position: relative !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.75) !important;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  transition: all 0.2s ease !important;
}
.theme-toi .world-zone {
  background: rgba(30, 41, 59, 0.65) !important;
  border-color: rgba(56, 189, 248, 0.15) !important;
}

.world-zone .zone-heading {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding-bottom: 8px !important;
  margin-bottom: 10px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}
.theme-toi .world-zone .zone-heading {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.world-zone .zone-title {
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.015em !important;
}
.theme-toi .world-zone .zone-title {
  color: #f8fafc !important;
}

.world-zone .zone-copy {
  font-size: 11px !important;
  color: #64748b !important;
  margin: 1px 0 0 !important;
}
.theme-toi .world-zone .zone-copy {
  color: #94a3b8 !important;
}

.world-zone .zone-badge {
  display: inline-flex !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 2px 7px !important;
  border-radius: 9999px !important;
  margin-left: 6px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
  vertical-align: middle !important;
}
.theme-toi .world-zone .zone-badge {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}

.world-zone .zone-count {
  margin-left: auto !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
  color: #475569 !important;
}
.theme-toi .world-zone .zone-count {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
  color: #94a3b8 !important;
}

/* Sắc màu viền nhẹ theo từng tầng */
.world-zone[data-tier="tier1"] {
  border-color: rgba(245, 158, 11, 0.25) !important;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.35) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
}
.world-zone[data-tier="tier2"] {
  border-color: rgba(99, 102, 241, 0.25) !important;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.35) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
}
.world-zone[data-tier="tier3"] {
  border-color: rgba(2, 132, 199, 0.25) !important;
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.35) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
}
.world-zone[data-tier="tier4"] {
  border-color: rgba(5, 150, 105, 0.25) !important;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.35) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
}
.world-zone[data-tier="tier5"] {
  border-color: rgba(225, 29, 72, 0.25) !important;
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.35) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
}

/* Character Grid: Tự động co giãn khít khao bằng repeat(auto-fit, minmax(180px, 1fr)) */
.world-zone .character-grid,
.character-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 8px !important;
  position: relative !important;
}

/* Thẻ nhân vật: z-index: 2 ĐÈ LÊN MŨI TÊN NỐI SVG */
.character {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  min-height: 56px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}
.character:hover {
  transform: translateY(-2px) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px -1px rgba(2, 132, 199, 0.15) !important;
}
.character[aria-current="true"] {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25) !important;
}
.theme-toi .character {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
  color: #f1f5f9 !important;
}
.theme-toi .character:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
}

/* Đường nối SVG: Chìm nhẹ dưới thẻ z-index: 1 */
.relation-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 1 !important;
  overflow: visible !important;
}

.relation-edge {
  fill: none !important;
  stroke-width: 1.2px !important;
  opacity: 0.18 !important;
  transition: opacity 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease !important;
}
.world-layout.is-tracing .relation-edge {
  opacity: 0.05 !important;
}
.world-layout.is-tracing .relation-edge.is-highlighted {
  opacity: 1 !important;
  stroke-width: 2.2px !important;
  stroke: #0284c7 !important;
  filter: drop-shadow(0 0 4px rgba(2, 132, 199, 0.6)) !important;
}

/* ==========================================================================
   3. TAB 4: BẢN ĐỒ SINH THÁI 5 TRỤ CỘT & SƠ ĐỒ LUỒNG TƯƠNG TÁC
   ========================================================================== */
.view-container-tinh-nang {
  padding: 24px !important;
  padding-bottom: 84px !important;
}

.tru-cot-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

.tru-cot-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 20px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}
.tru-cot-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px -4px rgba(2, 132, 199, 0.12) !important;
  border-color: #0284c7 !important;
}

.tru-cot-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  color: #0369a1 !important;
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  width: fit-content !important;
  margin-bottom: 10px !important;
}

.tru-cot-title {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.3 !important;
}

.tru-cot-desc {
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  color: #475569 !important;
  margin: 0 0 14px 0 !important;
  flex-grow: 1 !important;
}

.tru-cot-metrics {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-bottom: 14px !important;
  padding: 8px 10px !important;
  background: rgba(15, 23, 42, 0.03) !important;
  border-radius: 10px !important;
  border: 1px dashed rgba(15, 23, 42, 0.1) !important;
}
.tru-cot-metric-pill {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

.btn-launch-tru-cot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 14px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 10px !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  margin-top: auto !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}
.btn-launch-tru-cot:hover {
  background: #0369a1 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4) !important;
  transform: translateY(-1px) !important;
}

/* Sơ đồ Khối Trực Quan Luồng Tương Tác 5 Trụ Cột */
.eco-flow-container {
  margin-top: 16px !important;
  padding: 20px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.03) !important;
}
.theme-toi .eco-flow-container {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
}

.eco-flow-header {
  margin-bottom: 16px !important;
}
.eco-flow-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 0 4px 0 !important;
}
.theme-toi .eco-flow-title {
  color: #f8fafc !important;
}
.eco-flow-desc {
  font-size: 12px !important;
  color: #64748b !important;
  margin: 0 !important;
}

.eco-pipeline-track {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  position: relative !important;
  margin-bottom: 20px !important;
}

.eco-node-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
  transition: all 0.2s ease !important;
}
.eco-node-card:hover {
  border-color: #0284c7 !important;
  transform: translateY(-2px) !important;
}
.theme-toi .eco-node-card {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
}

.eco-node-step {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #0284c7 !important;
  text-transform: uppercase !important;
  margin-bottom: 4px !important;
}
.eco-node-name {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 4px !important;
}
.theme-toi .eco-node-name {
  color: #f8fafc !important;
}
.eco-node-role {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
}

.eco-values-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 12px !important;
  padding-top: 16px !important;
  border-top: 1px dashed rgba(15, 23, 42, 0.1) !important;
}
.eco-val-box {
  display: flex !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: rgba(15, 23, 42, 0.02) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
}
.theme-toi .eco-val-box {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
.eco-val-icon {
  font-size: 20px !important;
  flex-shrink: 0 !important;
}
.eco-val-text h4 {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 0 2px 0 !important;
}
.theme-toi .eco-val-text h4 {
  color: #f8fafc !important;
}
.eco-val-text p {
  font-size: 11px !important;
  color: #64748b !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

/* ==========================================================================
   WO-THE-GIOI-PROJECT-TREE-AND-LIVING-AVATARS
   1. MODAL TÙY BIẾN QUY TRÌNH (CENTER SCREEN & APPLE HIG)
   ========================================================================== */
#modal-process-customizer,
.modal-the-compass {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  box-sizing: border-box !important;
}

#modal-process-customizer .compass-hub-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: transparent !important;
  z-index: 1 !important;
}

#modal-process-customizer .pc-customizer-modal-card {
  position: relative !important;
  z-index: 2 !important;
  width: 92% !important;
  max-width: 620px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  margin: auto !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 20px !important;
  padding: 24px !important;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.3) !important;
  box-sizing: border-box !important;
}
.theme-toi #modal-process-customizer .pc-customizer-modal-card {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.8) !important;
}

#btn-open-process-customizer,
.btn-tuy-bien-quy-trinh {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 14px !important;
  height: 38px !important;
  min-height: 38px !important;
  min-width: 44px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  background: rgba(2, 132, 199, 0.08) !important;
  color: #0284c7 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.1) !important;
}
#btn-open-process-customizer:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3) !important;
}
.theme-toi #btn-open-process-customizer {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}
.theme-toi #btn-open-process-customizer:hover {
  background: #38bdf8 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   2. KHỬ NÚT RÁC "BÀN GIAO"
   ========================================================================== */
.dos-ban-giao-trigger,
.dos-ban-giao-drawer,
#dos-ban-giao-drawer,
#dos-ban-giao-trigger,
#btn-ban-giao {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   3. DROPDOWN CÂY DỰ ÁN & TELEMETRY POPOVER & PIN ACTIONS
   ========================================================================== */
.bang-chon-du-an-popover {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 14px !important;
  padding: 8px !important;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.2) !important;
  box-sizing: border-box !important;
}
.theme-toi .bang-chon-du-an-popover {
  background: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.8) !important;
}

.project-divider {
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
  padding: 6px 8px 2px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  margin-top: 4px !important;
}
.theme-toi .project-divider {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  color: #64748b !important;
}

.project-opt-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  text-align: left !important;
  width: 100% !important;
  transition: all 0.15s ease !important;
}
.project-opt-btn:hover {
  background: rgba(2, 132, 199, 0.08) !important;
}
.theme-toi .project-opt-btn:hover {
  background: rgba(56, 189, 248, 0.15) !important;
}

.project-opt-icon {
  font-size: 18px !important;
  flex-shrink: 0 !important;
}
.project-opt-info {
  flex-grow: 1 !important;
}
.project-opt-name {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.theme-toi .project-opt-name {
  color: #f8fafc !important;
}
.project-opt-badge {
  font-size: 9px !important;
  font-weight: 800 !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  background: #0284c7 !important;
  color: #ffffff !important;
}
.project-opt-desc {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.3 !important;
}
.theme-toi .project-opt-desc {
  color: #94a3b8 !important;
}

/* Popover Chi Tiết Telemetry */
.popover-telemetry-box {
  position: absolute !important;
  right: 0 !important;
  top: 40px !important;
  width: 320px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.2) !important;
  z-index: 1000 !important;
  box-sizing: border-box !important;
  text-align: left !important;
  cursor: default !important;
}
.theme-toi .popover-telemetry-box {
  background: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: #f8fafc !important;
}
.popover-telemetry-head {
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: #065f46 !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2) !important;
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
}
.theme-toi .popover-telemetry-head {
  color: #34d399 !important;
  border-bottom-color: rgba(52, 211, 153, 0.2) !important;
}
.popover-telemetry-row {
  font-size: 11.5px !important;
  color: #334155 !important;
  line-height: 1.4 !important;
  margin-bottom: 6px !important;
}
.theme-toi .popover-telemetry-row {
  color: #cbd5e1 !important;
}
.popover-telemetry-list {
  margin: 4px 0 0 0 !important;
  padding-left: 14px !important;
  font-size: 11px !important;
}
.popover-telemetry-list li {
  margin-bottom: 2px !important;
}

/* Global Pin Actions */
.hud-pin-actions {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.hud-pin-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 3px 8px !important;
  height: 28px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-family: var(--font-mono, monospace) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}
.hud-pin-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  transform: translateY(-1px) !important;
}
.theme-toi .hud-pin-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}
.theme-toi .hud-pin-btn:hover {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

/* ==========================================================================
   4. LIVING ANIMATED AGENTS (HOẠT HỌA THỞ & NEON LIVENESS)
   ========================================================================== */
@keyframes agentBreathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes neonLivenessPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4), 0 0 6px rgba(16, 185, 129, 0.2);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.8), 0 0 14px rgba(16, 185, 129, 0.5);
  }
}

.character[data-state="working"] .character-avatar,
.character[data-state="working"] .avatar-svg-wrap {
  animation: agentBreathe 3.2s ease-in-out infinite !important;
}

.character[data-state="working"] .status-dot {
  animation: neonLivenessPulse 1.6s ease-in-out infinite !important;
}

/* ==========================================================================
   5. FIX TRIỆT ĐỂ THEME SPACE & DC-FILE-CHIP
   ========================================================================== */
[data-theme="space"] .dc-file-chip,
body.theme-space .dc-file-chip,
[data-theme="cyber"] .dc-file-chip,
[data-theme="obsidian"] .dc-file-chip,
.theme-toi .dc-file-chip {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="space"] body,
body.theme-space {
  background: #070a12 !important;
  color: #e2e8f0 !important;
}

[data-theme="space"] .world-card,
[data-theme="space"] .view-container-jof,
[data-theme="space"] .view-container-tinh-nang,
[data-theme="space"] .dc-stream-canvas {
  background: rgba(7, 10, 18, 0.88) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.7) !important;
}



/* ==========================================================================
   THE COMPASS FAB & CLEAN WHITE SPACE REMOVAL (WO-THE-GIOI-PERFECTION)
   ========================================================================== */
#the-compass-mascot.the-compass-fab-dock {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 12px !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.compass-fab-main-btn {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  padding: 0 !important;
}

.compass-fab-main-btn:hover {
  transform: scale(1.08) translateY(-2px) !important;
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.6) !important;
}

.compass-fab-label {
  display: none !important;
}

.compass-mascot-needle {
  font-size: 26px !important;
  line-height: 1 !important;
  display: block !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)) !important;
}

.compass-mascot-living-avatar {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain !important;
  animation: nuance-breathing 0.833s infinite ease-in-out !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25)) !important;
  display: block !important;
}

@keyframes nuance-breathing {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.compass-speed-dial-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 16px !important;
  padding: 8px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4) !important;
  margin-bottom: 8px !important;
}

.speed-dial-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 14px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  color: #f8fafc !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.speed-dial-item:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  transform: translateX(-4px) !important;
}

/* Triệt tiêu hoàn toàn mảng trắng chết và các thẻ rác ở đáy */
#the-gioi-cac-phan-cu, 
.the-gioi-cac-phan-cu,
#the-gioi-doi-hinh-moi footer.footer-note,
.footer-note,
#san-khau-camera,
.khu-vuc-45-thuc-the,
#khu-vuc-45-thuc-the {
  display: none !important;
}

/* Roster Section: Bo gọn gàng khít khao, nền chìm trong suốt theo theme */
.world-layout {
  min-height: auto !important;
  padding-bottom: 32px !important;
}
.relation-status {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  color: #94a3b8 !important;
}
.relation-status span:first-child {
  color: #38bdf8 !important;
}

/* ==========================================================================
   INTERACTIVE PROCESS CUSTOMIZER (TÙY BIẾN QUY TRÌNH) — SOTA CONTRAST & APPLE HIG
   Khắc phục triệt để layout xộc xệch và thiếu tương phản trong ảnh báo cáo của Jack
   ========================================================================== */
#modal-process-customizer {
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
}

#modal-process-customizer .pc-customizer-modal-card {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.15) !important;
  width: 92% !important;
  max-width: 680px !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}

/* Header Modal */
.pc-customizer-modal-card .compass-hub-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding-bottom: 14px !important;
  margin-bottom: 4px !important;
}

.pc-customizer-modal-card .compass-hub-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.pc-customizer-modal-card .compass-hub-header-icon {
  font-size: 26px !important;
  line-height: 1 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  padding: 8px !important;
  border-radius: 12px !important;
}

.pc-customizer-modal-card #process-customizer-title {
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  letter-spacing: -0.01em !important;
}

.pc-customizer-modal-card .compass-hub-header-text p {
  margin: 3px 0 0 0 !important;
  font-size: 12px !important;
  color: #94a3b8 !important;
}

.pc-customizer-modal-card .compass-hub-btn-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.pc-customizer-modal-card .compass-hub-btn-close:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.06) !important;
}

/* Breadcrumb 5 Tầng Chuẩn Rõ Nét */
.pc-flow-breadcrumb {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  background: rgba(30, 41, 59, 0.7) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
}

.pc-flow-breadcrumb .pc-step {
  font-size: 11.5px !important;
  font-weight: 750 !important;
  color: #e2e8f0 !important;
}

.pc-flow-breadcrumb .pc-arrow {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

/* Form Config Grid & Select Controls */
.pc-config-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
}

@media (max-width: 600px) {
  .pc-config-grid {
    grid-template-columns: 1fr !important;
  }
}

.pc-form-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.pc-form-group label {
  font-size: 12px !important;
  font-weight: 750 !important;
  color: #38bdf8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.pc-select {
  width: 100% !important;
  height: 42px !important;
  padding: 0 12px !important;
  background: #1e293b !important;
  border: 1.5px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.pc-select:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

.pc-select option {
  background: #0f172a !important;
  color: #f8fafc !important;
  padding: 8px !important;
}

/* Action Buttons */
.pc-actions-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 6px !important;
}

.btn-pc-primary {
  flex: 1 1 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 44px !important;
  padding: 0 18px !important;
  border-radius: 12px !important;
  border: none !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 750 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
}

.btn-pc-primary:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5) !important;
}

.btn-pc-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 44px !important;
  padding: 0 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-pc-secondary:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

/* Danh Sách Chips Đường Nối Active */
.pc-active-edges-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding-top: 14px !important;
}

.pc-section-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #94a3b8 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.pc-edges-chips {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
}

.pc-edge-chip {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 12px !important;
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 10px !important;
  color: #f1f5f9 !important;
  font-size: 12.5px !important;
  transition: border-color 0.15s ease, background 0.15s ease !important;
}

.pc-edge-chip:hover {
  border-color: #38bdf8 !important;
  background: rgba(30, 41, 59, 1) !important;
}

.pc-edge-chip-del {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.pc-edge-chip-del:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.08) !important;
}

/* ==========================================================================
   TĂNG CƯỜNG TƯƠNG PHẢN TOÀN DIỆN CHO CÁC TẦNG & THẺ NHÂN VẬT (WCAG AAA >= 7:1)
   Khắc phục hiện tượng chữ trắng chìm trên nền xám/trắng và nhạt nhòa trong ảnh 1 & 2
   ========================================================================== */
.theme-sang .fch-tier-card,
.fch-tier-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.theme-sang .fch-tier-header,
.fch-tier-header {
  background: rgba(15, 23, 42, 0.03) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.theme-sang .fch-tier-title-left,
.fch-tier-title-left {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
}

.theme-toi .fch-tier-card {
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.theme-toi .fch-tier-header {
  background: rgba(30, 41, 59, 0.6) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.theme-toi .fch-tier-title-left {
  color: #f8fafc !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
}

.theme-sang .fch-tier-badge,
.fch-tier-badge {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

.theme-toi .fch-tier-badge {
  background: rgba(56, 189, 248, 0.25) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
}

/* Thẻ nhân vật trong Live Stream và Standby */
.character-name, .standby-name {
  color: #0f172a !important;
  font-weight: 800 !important;
}
.theme-toi .character-name, .theme-toi .standby-name {
  color: #f8fafc !important;
  font-weight: 800 !important;
}

.character-role, .standby-role {
  color: #334155 !important;
  font-weight: 600 !important;
}
.theme-toi .character-role, .theme-toi .standby-role {
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

.character-status {
  font-weight: 700 !important;
}

/* Đảm bảo khung bao các tầng không bị nhòe mờ */
.world-zone .zone-title {
  color: #0f172a !important;
  font-weight: 850 !important;
}
.theme-toi .world-zone .zone-title {
  color: #f8fafc !important;
  font-weight: 850 !important;
}

.world-zone .zone-copy {
  color: #475569 !important;
  font-weight: 550 !important;
}
.theme-toi .world-zone .zone-copy {
  color: #94a3b8 !important;
  font-weight: 550 !important;
}

/* ==========================================================================
   SỐNG ĐỘNG HÓA TÁC NHÂN (LIVING AGENT SPEECH BUBBLES & ACTIVE PULSE)
   ========================================================================== */

/* 1. Bong bóng hội thoại tương tác của Agent (.agent-speech-bubble) */
.agent-speech-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #0284c7;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.25);
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
  animation: bubble-float 3s ease-in-out infinite alternate;
}
.agent-speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #0284c7 transparent transparent transparent;
}
.theme-toi .agent-speech-bubble {
  background: rgba(15, 23, 42, 0.92);
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.theme-toi .agent-speech-bubble::after {
  border-color: #38bdf8 transparent transparent transparent;
}

@keyframes bubble-float {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-4px); }
}

/* 2. Hiệu ứng nhịp thở sống động (Living Breath Animation) */
.active-node .dc-avatar-wrap,
.thuc-the-nhan-vat.trang-thai-dang-lam .avatar-wrap {
  animation: agent-pulse-glow 2s infinite ease-in-out;
}

@keyframes agent-pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(2, 132, 199, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0);
  }
}

/* 3. Huy hiệu hoàn tất nhiệm vụ (Completion Badge / Milestone Ping) */
.agent-completed-ping {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #22c55e;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
  animation: ping-scale 1.5s infinite;
}

@keyframes ping-scale {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   THE COMPASS CONTROL HUB MODAL (APPLE HIG GLASSMORPHISM & SOTA MOBILE LAYOUT)
   Khắc phục triệt để lỗi vỡ khối đen/xám và mất tương phản trên điện thoại & tablet
   ========================================================================== */
#modal-the-compass-hub.modal-the-compass-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: transparent !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  display: none;
  box-sizing: border-box !important;
  padding: 0 !important;
}

#modal-the-compass-hub .modal-the-compass-card {
  pointer-events: auto !important;
  position: fixed !important;
  top: 68px !important;
  right: 20px !important;
  bottom: 20px !important;
  width: 440px !important;
  max-width: calc(100vw - 32px) !important;
  height: calc(100vh - 88px) !important;
  max-height: none !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 20px !important;
  box-shadow: -12px 20px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  z-index: 100000 !important;
}

#modal-the-compass-hub.expanded .modal-the-compass-card {
  width: 600px !important;
}

.theme-space #modal-the-compass-hub .modal-the-compass-card,
.theme-cyber #modal-the-compass-hub .modal-the-compass-card,
.theme-glass #modal-the-compass-hub .modal-the-compass-card,
.theme-obsidian #modal-the-compass-hub .modal-the-compass-card,
.theme-toi #modal-the-compass-hub .modal-the-compass-card,
[data-theme="space"] #modal-the-compass-hub .modal-the-compass-card,
[data-theme="dark"] #modal-the-compass-hub .modal-the-compass-card {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
  box-shadow: -12px 20px 50px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.12) !important;
}

/* Header */
#modal-the-compass-hub .compass-hub-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  flex-shrink: 0 !important;
}
.theme-toi #modal-the-compass-hub .compass-hub-header,
.theme-space #modal-the-compass-hub .compass-hub-header {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

#modal-the-compass-hub .compass-hub-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

#modal-the-compass-hub .compass-hub-header-icon {
  font-size: 24px !important;
  line-height: 1 !important;
  background: rgba(2, 132, 199, 0.1) !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  padding: 6px !important;
  border-radius: 10px !important;
}

#modal-the-compass-hub #compass-hub-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}
.theme-toi #modal-the-compass-hub #compass-hub-title,
.theme-space #modal-the-compass-hub #compass-hub-title {
  color: #f8fafc !important;
}

#modal-the-compass-hub .compass-hub-header-text p {
  margin: 2px 0 0 0 !important;
  font-size: 11.5px !important;
  color: #64748b !important;
}
.theme-toi #modal-the-compass-hub .compass-hub-header-text p,
.theme-space #modal-the-compass-hub .compass-hub-header-text p {
  color: #94a3b8 !important;
}

#modal-the-compass-hub .compass-hub-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#modal-the-compass-hub .compass-hub-btn-expand,
#modal-the-compass-hub .compass-hub-btn-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.05) !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

#modal-the-compass-hub .compass-hub-btn-expand:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

#modal-the-compass-hub .compass-hub-btn-close:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

.theme-toi #modal-the-compass-hub .compass-hub-btn-expand,
.theme-space #modal-the-compass-hub .compass-hub-btn-expand,
.theme-toi #modal-the-compass-hub .compass-hub-btn-close,
.theme-space #modal-the-compass-hub .compass-hub-btn-close {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

/* Body & Sections */
#modal-the-compass-hub .compass-hub-body {
  padding: 16px 20px !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

#modal-the-compass-hub .compass-section-title {
  font-size: 12px !important;
  font-weight: 750 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #0284c7 !important;
  margin-bottom: 8px !important;
}

/* Omnibar Box */
#modal-the-compass-hub .compass-omnibar-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: rgba(15, 23, 42, 0.03) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 12px !important;
  padding: 10px !important;
}
.theme-toi #modal-the-compass-hub .compass-omnibar-box,
.theme-space #modal-the-compass-hub .compass-omnibar-box {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#modal-the-compass-hub .compass-omnibar-input-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(2, 132, 199, 0.4) !important;
  border-radius: 8px !important;
  padding: 0 10px !important;
  height: 40px !important;
}
.theme-toi #modal-the-compass-hub .compass-omnibar-input-row,
.theme-space #modal-the-compass-hub .compass-omnibar-input-row {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

#modal-the-compass-hub .compass-omnibar-search-icon {
  font-size: 15px !important;
}

#modal-the-compass-hub .compass-omnibar-input {
  flex: 1 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 13px !important;
  color: #0f172a !important;
}
.theme-toi #modal-the-compass-hub .compass-omnibar-input,
.theme-space #modal-the-compass-hub .compass-omnibar-input {
  color: #f8fafc !important;
}

#modal-the-compass-hub .compass-omnibar-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}

#modal-the-compass-hub .compass-chip {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
#modal-the-compass-hub .compass-chip:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}
.theme-toi #modal-the-compass-hub .compass-chip,
.theme-space #modal-the-compass-hub .compass-chip {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
}

/* Workflow Grid */
#modal-the-compass-hub .compass-workflow-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
  gap: 8px !important;
}

#modal-the-compass-hub .compass-workflow-card {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 10px !important;
  color: #1e293b !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
#modal-the-compass-hub .compass-workflow-card:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  transform: translateY(-1px) !important;
}
.theme-toi #modal-the-compass-hub .compass-workflow-card,
.theme-space #modal-the-compass-hub .compass-workflow-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
}

/* SSH Station */
#modal-the-compass-hub .compass-ssh-station {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: rgba(15, 23, 42, 0.03) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 12px !important;
  padding: 12px !important;
}
.theme-toi #modal-the-compass-hub .compass-ssh-station,
.theme-space #modal-the-compass-hub .compass-ssh-station {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#modal-the-compass-hub .compass-ssh-inputs {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

#modal-the-compass-hub .compass-ssh-input {
  flex: 1 1 120px !important;
  height: 36px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 6px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  background: #ffffff !important;
  color: #0f172a !important;
}
.theme-toi #modal-the-compass-hub .compass-ssh-input,
.theme-space #modal-the-compass-hub .compass-ssh-input {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

#modal-the-compass-hub .compass-ssh-btn-connect {
  height: 38px !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

#modal-the-compass-hub .compass-ssh-status {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 11.5px !important;
  color: #64748b !important;
}

/* Agent Roster Grid */
#modal-the-compass-hub .compass-agents-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  gap: 8px !important;
}

#modal-the-compass-hub .compass-agent-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 8px 10px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
#modal-the-compass-hub .compass-agent-card:hover {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
}
.theme-toi #modal-the-compass-hub .compass-agent-card,
.theme-space #modal-the-compass-hub .compass-agent-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

#modal-the-compass-hub .compass-agent-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

#modal-the-compass-hub .compass-agent-en {
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #0284c7 !important;
}

#modal-the-compass-hub .compass-agent-role-tag {
  font-size: 9.5px !important;
  font-weight: 700 !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
}

#modal-the-compass-hub .compass-agent-vn {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.theme-toi #modal-the-compass-hub .compass-agent-vn,
.theme-space #modal-the-compass-hub .compass-agent-vn {
  color: #f8fafc !important;
}

#modal-the-compass-hub .compass-agent-duty {
  font-size: 10.5px !important;
  line-height: 1.3 !important;
  color: #64748b !important;
}
.theme-toi #modal-the-compass-hub .compass-agent-duty,
.theme-space #modal-the-compass-hub .compass-agent-duty {
  color: #94a3b8 !important;
}

/* 5 Themes Row */
#modal-the-compass-hub .compass-themes-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

#modal-the-compass-hub .compass-theme-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  color: #334155 !important;
  cursor: pointer !important;
}
.theme-toi #modal-the-compass-hub .compass-theme-pill,
.theme-space #modal-the-compass-hub .compass-theme-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
}

#modal-the-compass-hub .compass-theme-swatch {
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

/* Mobile Tối Ưu <= 640px */
@media (max-width: 640px) {
  #modal-the-compass-hub.modal-the-compass-backdrop {
    padding: 8px !important;
  }
  #modal-the-compass-hub .modal-the-compass-card {
    max-height: 94vh !important;
    border-radius: 16px !important;
  }
  #modal-the-compass-hub .compass-hub-header {
    padding: 12px 14px !important;
  }
  #modal-the-compass-hub .compass-hub-body {
    padding: 12px 14px !important;
    gap: 12px !important;
  }
  #modal-the-compass-hub .compass-workflow-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  #modal-the-compass-hub .compass-agents-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==========================================================================
   JACK SOTA FEEDBACK RESOLUTION (5 BỨC ẢNH BÚT TÍCH ĐỎ)
   ========================================================================== */

/* 1. ẢNH 1: KHUNG BẰNG CHỨNG APPLE GLASSMORPHISM MỊN MÀNG & TƯƠNG PHẢN CAO */
.dc-artifacts-strip {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.09) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.05) !important;
  padding: 20px 24px !important;
  margin-top: 14px !important;
}
.theme-toi .dc-artifacts-strip,
.theme-space .dc-artifacts-strip,
.theme-cyber .dc-artifacts-strip {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}
.dc-artifacts-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 14px !important;
}
.dc-art-title-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.dc-art-counter-badge {
  font-family: var(--font-mono, monospace) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.1) !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
}
.dc-artifacts-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 12px !important;
}
.dc-art-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 14px 16px !important;
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(14px) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}
.dc-art-item:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  transform: translateY(-2px) scale(1.01) !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.14) !important;
}
.theme-toi .dc-art-item,
.theme-space .dc-art-item {
  background: rgba(30, 41, 59, 0.75) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.theme-toi .dc-art-item:hover,
.theme-space .dc-art-item:hover {
  background: rgba(15, 23, 42, 0.95) !important;
  border-color: #38bdf8 !important;
}
.art-badge-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
}
.art-pill-status {
  font-family: var(--font-mono, monospace) !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #059669 !important;
  background: #ecfdf5 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
}
.art-name {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}
.theme-toi .art-name,
.theme-space .art-name {
  color: #f8fafc !important;
}
.art-desc {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
}

/* 2. ẢNH 2: TAB ĐỘI NGŨ - TĂNG TƯƠNG PHẢN 5 TẦNG CẤP BẬC & MASCOT NUANCE SỐNG */
.world-zone .zone-heading {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 14px !important;
  padding: 10px 16px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.world-zone .zone-title {
  color: #0f172a !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  letter-spacing: -0.015em !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}
.world-zone .zone-badge {
  font-family: var(--font-mono, monospace) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  letter-spacing: 0.04em !important;
}
/* Màu tương phản cao, sắc sảo cho từng tầng */
.world-zone[data-tier="tier1"] .zone-badge { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #f59e0b !important; }
.world-zone[data-tier="tier2"] .zone-badge { background: #e0e7ff !important; color: #3730a3 !important; border: 1px solid #6366f1 !important; }
.world-zone[data-tier="tier3"] .zone-badge { background: #e0f2fe !important; color: #075985 !important; border: 1px solid #0284c7 !important; }
.world-zone[data-tier="tier4"] .zone-badge { background: #dcfce7 !important; color: #14532d !important; border: 1px solid #16a34a !important; }
.world-zone[data-tier="tier5"] .zone-badge { background: #ffe4e6 !important; color: #881337 !important; border: 1px solid #e11d48 !important; }

/* Mascot Nuance Sống Động Với Nhịp Thở Breathing & Đèn LED */
.living-mascot {
  animation: agentBreathe 3.5s infinite ease-in-out !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12)) !important;
  transform-origin: center bottom !important;
  transition: transform 0.25s ease, filter 0.25s ease !important;
}
.character-avatar-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.character:hover .living-mascot {
  transform: scale(1.1) translateY(-4px) !important;
  filter: drop-shadow(0 8px 18px rgba(2, 132, 199, 0.3)) !important;
}
.mascot-liveness-led {
  position: absolute !important;
  bottom: 0px !important;
  right: 0px !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  border: 2px solid #ffffff !important;
  box-sizing: content-box !important;
}
.mascot-liveness-led.led-working {
  background: #10b981 !important;
  animation: neonLivenessPulse 1.6s infinite ease-in-out !important;
}
.mascot-liveness-led.led-idle {
  background: #94a3b8 !important;
}
.mascot-liveness-led.led-blocked {
  background: #ef4444 !important;
}

/* 3. ẢNH 3: CỤM ĐIỀU KHIỂN FLOATING CAPSULE 36PX & TOAST THÔNG BÁO DỰ ÁN */
.canvas-viewport-controls {
  height: 36px !important;
  padding: 2px 6px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  z-index: 50 !important;
}
.canvas-viewport-controls .btn-canvas-ctrl {
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border: none !important;
  background: transparent !important;
  color: #334155 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}
.canvas-viewport-controls .btn-canvas-ctrl:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0284c7 !important;
}
.dos-apple-toast {
  position: fixed !important;
  top: 56px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(-20px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 100000 !important;
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  color: #ffffff !important;
  padding: 8px 20px !important;
  border-radius: 999px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.dos-apple-toast.show {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}

/* 4. ẢNH 4: TAB QUY TRÌNH - SƠ ĐỒ HÌNH KHỐI TOPOLOGY SVG NỐI NHAU VỚI LUỒNG XUNG NHỊP */
.topology-pipeline-container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 16px 20px !important;
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(16px) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04) !important;
  overflow-x: auto !important;
  margin-bottom: 20px !important;
}
.topology-step-node {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 16px 14px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(15, 23, 42, 0.1) !important;
  min-width: 140px !important;
  max-width: 160px !important;
  flex: 1 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}
.topology-step-node:hover {
  transform: translateY(-3px) scale(1.02) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15) !important;
}
.topology-step-node.active {
  border-color: #0284c7 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2), 0 8px 24px rgba(2, 132, 199, 0.2) !important;
}
.topology-mascot-wrap {
  position: relative !important;
  width: 54px !important;
  height: 54px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 8px !important;
}
.topology-mascot-img {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain !important;
}
.topology-node-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
.topology-step-tag {
  font-family: var(--font-mono, monospace) !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #0284c7 !important;
  letter-spacing: 0.05em !important;
}
.topology-node-title {
  margin: 0 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.25 !important;
}
.topology-node-sub {
  margin: 0 !important;
  font-size: 10.5px !important;
  color: #64748b !important;
  line-height: 1.3 !important;
}
.topology-node-badge {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  background: #0284c7 !important;
  padding: 2px 6px !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3) !important;
}
.topology-svg-connector {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 54px !important;
  position: relative !important;
}
.topology-line-svg {
  width: 54px !important;
  height: 16px !important;
}
.top-flow-track {
  stroke: rgba(15, 23, 42, 0.15) !important;
  stroke-width: 2.5 !important;
  stroke-linecap: round !important;
}
.top-flow-pulse {
  stroke: #0284c7 !important;
  stroke-width: 3 !important;
  stroke-dasharray: 10 16 !important;
  stroke-linecap: round !important;
  animation: pulseLineAnimation 1.5s infinite linear !important;
}
@keyframes pulseLineAnimation {
  0% { stroke-dashoffset: 26; }
  100% { stroke-dashoffset: 0; }
}
.top-flow-badge {
  font-family: var(--font-mono, monospace) !important;
  font-size: 8px !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
  background: #e0f2fe !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  margin-top: 2px !important;
}

/* 5. ẢNH 5: TAB BẢN ĐỒ - BẢN ĐỒ MA TRẬN HỆ THỐNG (SYSTEM TOPOLOGY MATRIX) */
.matrix-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
  padding: 10px 16px !important;
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
}
.matrix-filter-group {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}
.matrix-filter-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  margin-right: 4px !important;
}
.btn-matrix-filter {
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: #ffffff !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.btn-matrix-filter:hover {
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}
.btn-matrix-filter.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}
.btn-ai-matrix-customizer {
  padding: 6px 14px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(2, 132, 199, 0.1) 100%) !important;
  color: #4f46e5 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
}
.btn-ai-matrix-customizer:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25) !important;
}
.system-topology-matrix {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}
.matrix-core-hub {
  padding: 20px 24px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 249, 255, 0.9) 100%) !important;
  border: 2px solid rgba(2, 132, 199, 0.25) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 32px rgba(2, 132, 199, 0.08) !important;
  position: relative !important;
  text-align: center !important;
}
.matrix-core-badge {
  position: absolute !important;
  top: -10px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%) !important;
  padding: 3px 12px !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
}
.matrix-core-title {
  margin: 6px 0 2px !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  letter-spacing: 0.02em !important;
}
.matrix-core-desc {
  margin: 0 !important;
  font-size: 12px !important;
  color: #64748b !important;
}
.matrix-core-status {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 8px !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #059669 !important;
}
.matrix-pulse-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8) !important;
  animation: neonLivenessPulse 1.5s infinite ease-in-out !important;
}
.matrix-pillars-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 16px !important;
}
.matrix-pillar-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 18px 20px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.09) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.matrix-pillar-card:hover {
  transform: translateY(-2px) scale(1.01) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.12) !important;
}
.pillar-guardian-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}
.pillar-mascot-badge {
  position: relative !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: rgba(2, 132, 199, 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.pillar-mascot-img {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain !important;
}
.pillar-guardian-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  flex: 1 !important;
}
.pillar-guardian-label {
  font-family: var(--font-mono, monospace) !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  color: #94a3b8 !important;
  letter-spacing: 0.06em !important;
}
.pillar-guardian-name {
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   WO-THE-GIOI-LIVING-MASCOTS-AND-WHITE-THEME:
   1. LIVING NUANCE MASCOTS TOÀN THÂN (72 BPM BREATHING & LIVENESS LED)
   2. AI VISUAL CUSTOMIZER ZOOM FOCUS GLOW
   3. APPLE GLASSMORPHISM ACTION SHEET MODAL
   ========================================================================== */

/* 1. Mascot toàn thân và nhịp thở liveness */
.dc-living-mascot {
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.12)) !important;
  transform-origin: bottom center !important;
}

.sl-living-mascot {
  width: 30px !important;
  height: 30px !important;
  object-fit: contain !important;
  display: block !important;
  filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.1)) !important;
  transform-origin: bottom center !important;
}

.sl-mascot-wrap {
  position: relative !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
  background: rgba(2, 132, 199, 0.08) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin-right: 6px !important;
}

.dc-avatar-wrap {
  position: relative !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 14px !important;
  background: rgba(2, 132, 199, 0.06) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.dc-avatar-wrap.pulse-glow {
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
  background: rgba(2, 132, 199, 0.1) !important;
}

.living-mascot {
  animation: nuanceLivingBreathe 0.833s infinite ease-in-out !important; /* 72 bpm */
  transform-origin: bottom center !important;
  will-change: transform !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

@keyframes nuanceLivingBreathe {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2.5px) scale(1.025);
  }
}

.living-mascot.state-working {
  animation-duration: 0.833s !important; /* 72 bpm chuẩn Apple Liveness */
}

.living-mascot.state-thinking {
  animation-duration: 1.4s !important;
}

.living-mascot.state-blocked {
  animation: nuanceMascotAlarm 0.6s infinite ease-in-out !important;
}

@keyframes nuanceMascotAlarm {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-3deg); }
  75% { transform: translateY(-2px) rotate(3deg); }
}

.living-mascot.state-idle,
.living-mascot.state-done {
  animation-duration: 1.66s !important; /* 36 bpm nhịp thư thái */
}

/* 2. Highlight AI Visual Customizer Zoom Focus */
@keyframes aiFocusPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7), 0 8px 24px -4px rgba(2, 132, 199, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(2, 132, 199, 0.25), 0 16px 36px -4px rgba(2, 132, 199, 0.45);
    transform: scale(1.03);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0), 0 8px 24px -4px rgba(2, 132, 199, 0.2);
    transform: scale(1);
  }
}

.ai-focused-node {
  animation: aiFocusPulseGlow 1.8s ease-in-out 3 !important;
  border-color: #0284c7 !important;
  outline: 2.5px solid #38bdf8 !important;
  outline-offset: 3px !important;
  z-index: 45 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 3. Modal Action Sheet Apple Glassmorphism (Zero prompt/alert) */
.modal-apple-action-sheet {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}
.modal-apple-action-sheet.mo,
.modal-apple-action-sheet.active {
  display: flex !important;
}

.modal-apple-action-sheet .modal-sheet-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  animation: sheetBackdropFade 0.25s ease-out !important;
}

@keyframes sheetBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-apple-action-sheet .modal-sheet-panel {
  position: relative !important;
  width: 100% !important;
  max-width: 540px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(30px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.25), 0 0 1px 1px rgba(255, 255, 255, 0.8) inset !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  z-index: 10000 !important;
}

@keyframes sheetSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-sheet-grabber {
  width: 36px !important;
  height: 4px !important;
  border-radius: 2px !important;
  background: rgba(148, 163, 184, 0.4) !important;
  margin: 0 auto -6px auto !important;
}

.btn-sheet-close {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: rgba(241, 245, 249, 0.92) !important;
  color: #0f172a !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 10005 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

.btn-sheet-close:hover,
.btn-sheet-close:active {
  background: #e2e8f0 !important;
  color: #000000 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15) !important;
}

[data-theme="space"] .btn-sheet-close,
[data-theme="cyber"] .btn-sheet-close,
[data-theme="obsidian"] .btn-sheet-close {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f8fafc !important;
}

.modal-sheet-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  margin-bottom: 6px !important;
  width: fit-content !important;
}

.modal-sheet-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
  margin: 0 0 4px 0 !important;
}

.modal-sheet-desc {
  font-size: 12.5px !important;
  color: #64748b !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}

.modal-sheet-textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  border: 1.5px solid rgba(203, 213, 225, 0.8) !important;
  background: rgba(248, 250, 252, 0.9) !important;
  padding: 10px 12px !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  font-family: inherit !important;
  outline: none !important;
  resize: vertical !important;
  transition: all 0.2s ease !important;
}

.modal-sheet-textarea:focus {
  border-color: #0284c7 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.modal-sheet-presets {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.sheet-presets-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.sheet-chips-flow {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.sheet-chip {
  padding: 5px 11px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  transition: all 0.15s ease !important;
}

.sheet-chip:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px) !important;
}

.modal-sheet-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 4px !important;
}

.btn-sheet-secondary {
  padding: 8px 16px !important;
  border-radius: 10px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  min-height: 40px !important;
  min-width: 44px !important;
  transition: background 0.15s ease !important;
}

.btn-sheet-secondary:hover {
  background: #f8fafc !important;
}

.btn-sheet-primary {
  padding: 8px 18px !important;
  border-radius: 10px !important;
  border: none !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  min-height: 40px !important;
  min-width: 44px !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
  transition: all 0.15s ease !important;
}

.btn-sheet-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4) !important;
}

/* ==========================================================================
   WO-THE-GIOI-OVERHAUL-PERFECTION:
   1. GỌT BỎ 5 TẦNG THANH CÔNG CỤ XẾP CHỒNG - NHƯỜNG >= 85% CHO SPATIAL CANVAS
   2. DỌN SẠCH RÁC DOM CHÂN TRANG: MODAL-SPEC-READER SLIDE-OVER & FIXED
   3. INTERACTIVE SVG TOPOLOGY CANVAS (4 TẦNG TỰ TRỊ CHUẨN SOTA)
   ========================================================================== */

/* 1. Khóa chết 5 tầng thanh công cụ xếp chồng */
#drawer-dieu-khien-the-gioi,
.drawer-dieu-khien-the-gioi,
.dong-chay-header-card,
.dc-pipeline-progress-bar,
.dc-flow-style-bar,
.truth-strip {
  display: none !important;
}

/* Chuẩn hóa độ cao Thanh HUD duy nhất 50px Apple HIG */
.thanh-dinh-the-gioi.hud-bar-the-gioi {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
}

.view-container-dong-chay {
  padding-top: 10px !important;
}

/* 2. Dọn sạch rác DOM chân trang: modal-spec-reader fixed / slide-over */
#modal-spec-reader,
#modal-subworld,
.modal-subworld-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

#modal-spec-reader.mo,
#modal-spec-reader.active,
#modal-subworld.mo,
#modal-subworld.active,
.modal-subworld-backdrop.mo,
.modal-subworld-backdrop.active {
  display: flex !important;
}

.modal-subworld-card {
  position: relative !important;
  width: 100% !important;
  max-width: 860px !important;
  max-height: 86vh !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.subworld-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 18px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(248, 250, 252, 0.8) !important;
}

.subworld-btn-close {
  min-width: 44px !important;
  min-height: 44px !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.subworld-btn-close:hover {
  background: #e2e8f0 !important;
  transform: scale(1.06) !important;
}

.subworld-body {
  padding: 18px !important;
  overflow-y: auto !important;
  flex: 1 !important;
}

.spec-reader-meta {
  font-family: var(--font-mono, monospace) !important;
  font-size: 11px !important;
  color: #0284c7 !important;
  margin-bottom: 12px !important;
  padding: 6px 10px !important;
  background: #e0f2fe !important;
  border-radius: 8px !important;
}

/* 3. INTERACTIVE SVG TOPOLOGY CANVAS (4 TẦNG TỰ TRỊ CHUẨN SOTA) */
.topology-canvas-wrapper {
  padding: 10px 4px 40px 4px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  display: block !important;
}

.topology-canvas-header {
  margin-bottom: 24px !important;
  text-align: center !important;
}

.topology-canvas-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  margin-bottom: 8px !important;
}

.topology-canvas-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 0 6px 0 !important;
}

.topology-canvas-desc {
  font-size: 13px !important;
  color: #64748b !important;
  margin: 0 !important;
  max-width: 720px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.topology-stations-flow {
  display: flex !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.topology-station-card {
  flex: 1 1 0 !important;
  min-width: 170px !important;
  max-width: 25% !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(18px) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 16px !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
  display: flex !important;
  flex-direction: column !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

.topology-station-card:hover {
  transform: translateY(-4px) scale(1.02) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.18) !important;
}

.topology-station-card.active-hero {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2), 0 10px 25px rgba(2, 132, 199, 0.15) !important;
}

.top-station-tier-tag {
  font-family: var(--font-mono, monospace) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  color: #0284c7 !important;
  background: #e0f2fe !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  width: fit-content !important;
  margin-bottom: 12px !important;
}

.top-station-main {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.top-station-mascot-box {
  position: relative !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  background: rgba(2, 132, 199, 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.top-mascot-img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain !important;
}

.top-station-info {
  flex: 1 !important;
}

.top-station-role {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

.top-station-name {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 1px 0 3px 0 !important;
}

.top-station-status {
  font-size: 9.5px !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  display: inline-block !important;
}

.top-station-body {
  flex: 1 !important;
  padding: 10px !important;
  background: rgba(248, 250, 252, 0.8) !important;
  border-radius: 10px !important;
  margin-bottom: 10px !important;
}

.top-station-task-label {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  margin-bottom: 4px !important;
}

.top-station-task-desc {
  font-size: 11.5px !important;
  color: #334155 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

.top-files-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin-bottom: 6px !important;
}

.top-file-pill {
  font-family: var(--font-mono, monospace) !important;
  font-size: 10px !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
}

.top-runtime-stat {
  font-size: 10px !important;
  color: #15803d !important;
}

.top-station-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  padding-top: 8px !important;
  display: flex !important;
  justify-content: flex-end !important;
}

.top-station-action-hint {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
}

.topology-pulse-connector {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  min-width: 36px !important;
  flex-shrink: 0 !important;
  gap: 4px !important;
  box-sizing: border-box !important;
}

.topology-pulse-svg {
  width: 100% !important;
  height: 14px !important;
}

.top-pulse-track {
  stroke: rgba(15, 23, 42, 0.15) !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
}

.top-pulse-flow {
  stroke: #0284c7 !important;
  stroke-width: 2.5 !important;
  stroke-dasharray: 6 8 !important;
  stroke-linecap: round !important;
  animation: pulseLineAnimation 1.2s infinite linear !important;
}

@keyframes pulseLineAnimation {
  from { stroke-dashoffset: 28; }
  to { stroke-dashoffset: 0; }
}

.top-pulse-label {
  font-family: var(--font-mono, monospace) !important;
  font-size: 8px !important;
  font-weight: 800 !important;
  color: #0284c7 !important;
  background: #e0f2fe !important;
  padding: 2px 4px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
}

/* Thích ứng Dark Themes & Cultural Themes cho Topology */
body.theme-space .topology-station-card,
body.theme-cyber .topology-station-card,
body.theme-obsidian .topology-station-card {
  background: rgba(15, 23, 42, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
}
body.theme-space .top-station-name,
body.theme-cyber .top-station-name,
body.theme-obsidian .top-station-name {
  color: #f8fafc !important;
}
body.theme-space .top-station-body,
body.theme-cyber .top-station-body,
body.theme-obsidian .top-station-body {
  background: rgba(30, 41, 59, 0.7) !important;
}
body.theme-space .top-station-task-desc,
body.theme-cyber .top-station-task-desc,
body.theme-obsidian .top-station-task-desc {
  color: #cbd5e1 !important;
}
body.theme-space .top-pulse-track,
body.theme-cyber .top-pulse-track,
body.theme-obsidian .top-pulse-track {
  stroke: rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 820px) {
  .topology-stations-flow {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .topology-pulse-connector {
    height: 36px !important;
    width: 100% !important;
  }
  .topology-pulse-svg {
    width: 24px !important;
    height: 36px !important;
    transform: rotate(90deg) !important;
  }
  .topology-station-card {
    max-width: 100% !important;
    width: 100% !important;
    min-width: unset !important;
  }
}

/* Thích ứng Dark Theme cho Feedback Loop Quy Trình */
body.theme-space .feedback-loop-container,
body.theme-cyber .feedback-loop-container,
body.theme-obsidian .feedback-loop-container {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}
body.theme-space .feedback-loop-container h3,
body.theme-cyber .feedback-loop-container h3,
body.theme-obsidian .feedback-loop-container h3 {
  color: #f8fafc !important;
}
body.theme-space .fl-node,
body.theme-cyber .fl-node,
body.theme-obsidian .fl-node {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
body.theme-space .fl-node div,
body.theme-cyber .fl-node div,
body.theme-obsidian .fl-node div {
  color: #f1f5f9 !important;
}

/* ==========================================================================
   A11. HỆ THỐNG LIVING MASCOTS ANIMATION (49 GHẾ ĐỘI NGŨ)
   Thay thế emoji phẳng bằng linh vật sống động có hơi thở và đèn pulse.
   ========================================================================== */
.living-mascot-chip-box {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.dc-standby-chip:hover .living-mascot-chip-box,
.fch-active-chip:hover .living-mascot-chip-box {
  transform: scale(1.18) translateY(-2px) !important;
}
.living-mascot-chip-img {
  animation: mascot-chip-breathe 3s ease-in-out infinite !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)) !important;
}
@keyframes mascot-chip-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06) translateY(-1px); }
}

/* ĐIỀU KHIỂN SƠ ĐỒ KIẾN TRÚC TOÀN CẢNH (HÌNH 1 JACK CHỈ ĐẠO) */
.top-arch-cluster {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.top-arch-cluster:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.16) !important;
}
.top-arch-diamond {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.top-arch-diamond:hover {
  transform: scale(1.02) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35) !important;
}

/* ==========================================================================
   TOPOLOGY INTERACTIVE SVG CIRCUIT WIRING & DATA BINDING
   Chỉ đạo cốt lõi từ Jack: Sơ đồ kết nối có ràng buộc mạch điện & thông số
   ========================================================================== */

.topology-root-view {
  position: relative;
  overflow: visible !important;
}

.topology-wiring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}

/* Cổng kết nối (Circuit Ports/Anchors) */
.circuit-port {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0284c7;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
  position: absolute;
  z-index: 8;
  pointer-events: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.circuit-port.port-bottom {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.circuit-port.port-top {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.circuit-port.port-left {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.circuit-port.port-right {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

/* Các đường dây nối SVG (Circuit Paths) */
.top-circuit-wire {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s ease, stroke-width 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.top-circuit-wire.wire-quota {
  stroke: #0284c7;
}

.top-circuit-wire.wire-git {
  stroke: #64748b;
  stroke-dasharray: 6 4;
}

.top-circuit-wire.wire-artifact {
  stroke: #16a34a;
}

.top-circuit-wire.wire-directive {
  stroke: #f59e0b;
}

.top-circuit-wire.wire-report {
  stroke: #9333ea;
}

.top-circuit-wire.wire-active {
  stroke: #0284c7 !important;
  stroke-width: 4px !important;
  filter: drop-shadow(0 0 6px #38bdf8) !important;
}

.top-circuit-wire.wire-dimmed {
  opacity: 0.18 !important;
}

/* Animated Pulse Flowing Along Wire */
.circuit-pulse-circle {
  fill: #38bdf8;
  filter: drop-shadow(0 0 6px #38bdf8);
}

/* Interactive Pill Badges on Wires */
.topology-pills-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.top-circuit-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 12;
}

.top-circuit-pill:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.25);
  border-color: #0284c7;
}

.pill-quota {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.pill-git {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.pill-artifact {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.pill-directive {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.pill-report {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #d8b4fe;
}

/* Dimmed node state when another node is active */
.topology-node-dimmed {
  opacity: 0.32 !important;
  filter: grayscale(40%) !important;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.topology-node-highlight {
  box-shadow: 0 0 0 3px #38bdf8, 0 12px 36px rgba(2, 132, 199, 0.3) !important;
  transform: translateY(-3px) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Popover Card for Real-Time Telemetry Binding */
.top-node-telemetry-popover {
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 18px;
  box-shadow: 0 16px 48px -8px rgba(15, 23, 42, 0.25);
  padding: 18px 20px;
  box-sizing: border-box;
  animation: popoverSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverSlideIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.telemetry-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.telemetry-node-title {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-btn-close {
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
}

.telemetry-btn-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.telemetry-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.telemetry-metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.metric-kicker {
  color: #64748b;
  font-weight: 600;
}

.metric-val {
  color: #0f172a;
  font-weight: 800;
  font-family: ui-monospace, monospace;
}

/* Dark Theme Adaptations */
.theme-cyber .top-node-telemetry-popover,
.theme-space .top-node-telemetry-popover,
.theme-obsidian .top-node-telemetry-popover {
  background: #0f172a !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
}

.theme-cyber .telemetry-metric-item,
.theme-space .telemetry-metric-item,
.theme-obsidian .telemetry-metric-item {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.theme-cyber .telemetry-node-title,
.theme-space .telemetry-node-title,
.theme-obsidian .telemetry-node-title,
.theme-cyber .metric-val,
.theme-space .metric-val,
.theme-obsidian .metric-val {
  color: #f8fafc !important;
}

/* ==========================================================================
   SPATIAL 2D ARCHITECTURAL DAG CANVAS (MEDIA_1790074900568.PNG)
   ========================================================================== */
.top-spatial-layout {
  position: relative;
  width: 100%;
  min-height: 640px;
  padding: 16px 0;
  box-sizing: border-box;
}

.top-spatial-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 28px;
  align-items: stretch;
  position: relative;
  z-index: 6;
}

@media (max-width: 960px) {
  .top-spatial-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.top-col-left,
.top-col-center,
.top-col-right {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
}

.top-subgraph-container {
  background: rgba(248, 250, 252, 0.9);
  border: 2px dashed #94a3b8;
  border-radius: 20px;
  padding: 18px 16px;
  backdrop-filter: blur(10px);
  position: relative;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: all 0.25s ease;
}

.top-subgraph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1.5px dashed #cbd5e1;
  padding-bottom: 10px;
}

.top-subgraph-title {
  font-size: 11px;
  font-weight: 900;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-guard-node {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.top-guard-node:last-child {
  margin-bottom: 0;
}

.top-guard-node:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.15);
}

.top-guard-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

.top-circuit-wire.wire-blocked {
  stroke: #ef4444;
  stroke-dasharray: 6 3;
}

.pill-blocked {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* ==========================================================================
   HORIZONTAL 2.5D SPATIAL PIPELINE FLOW & EXECUTIVE FLEET BAR (WO-THE-GIOI-HORIZONTAL-25D-SPATIAL-FLOW)
   ========================================================================== */
.top-spatial-pipeline-grid,
.top-spatial-grid-2x2,
#top-spatial-pipeline-grid {
  display: flex !important;
  flex-direction: row !important;
  gap: 24px !important;
  overflow-x: auto !important;
  padding: 24px 16px 54px 16px !important;
  align-items: stretch !important;
  scroll-snap-type: x mandatory !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  position: relative !important;
  z-index: 6 !important;
  box-sizing: border-box !important;
}

.top-spatial-pipeline-grid::-webkit-scrollbar,
.top-spatial-grid-2x2::-webkit-scrollbar,
#top-spatial-pipeline-grid::-webkit-scrollbar {
  height: 6px;
}

.top-spatial-pipeline-grid::-webkit-scrollbar-thumb,
.top-spatial-grid-2x2::-webkit-scrollbar-thumb,
#top-spatial-pipeline-grid::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.top-frame-card {
  flex: 0 0 324px !important;
  min-width: 300px !important;
  max-width: 344px !important;
  scroll-snap-align: start !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border-radius: 20px !important;
  padding: 18px 16px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px -4px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  position: relative !important;
  border: 2px solid #e2e8f0 !important;
  cursor: pointer !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.top-frame-card:hover {
  transform: translateY(-4px) scale(1.01) !important;
  box-shadow: 0 20px 40px -6px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

.top-frame-card.frame-jack {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.45) 0%, rgba(255, 255, 255, 0.95) 45%) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px -4px rgba(245, 158, 11, 0.15), 0 0 0 1px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.top-frame-card.frame-strategy {
  border-color: #9333ea !important;
  background: linear-gradient(180deg, rgba(243, 232, 255, 0.45) 0%, rgba(255, 255, 255, 0.95) 45%) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px -4px rgba(147, 51, 234, 0.15), 0 0 0 1px rgba(147, 51, 234, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.top-frame-card.frame-dev {
  border-color: #0284c7 !important;
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.45) 0%, rgba(255, 255, 255, 0.95) 45%) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px -4px rgba(2, 132, 199, 0.15), 0 0 0 1px rgba(2, 132, 199, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.top-frame-card.frame-audit {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(209, 250, 229, 0.45) 0%, rgba(255, 255, 255, 0.95) 45%) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px -4px rgba(16, 185, 129, 0.15), 0 0 0 1px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.top-frame-card.topology-node-highlight {
  border-width: 2.5px !important;
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 24px 48px -4px rgba(2, 132, 199, 0.25), 0 0 0 2px #0284c7, inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

.top-frame-card.topology-node-dimmed {
  opacity: 0.45 !important;
  filter: grayscale(30%) !important;
  transform: scale(0.98) !important;
}

/* EXECUTIVE ACTIVE FLEET BAR (HEIGHT 42PX, APPLE HIG FROSTED GLASS) */
.executive-active-fleet-bar {
  height: 42px !important;
  min-height: 42px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(14px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
  border: 1px solid rgba(226, 232, 240, 0.85) !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 12px !important;
  margin: 8px 0 12px 0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
  box-sizing: border-box !important;
  gap: 8px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

.executive-active-fleet-bar::-webkit-scrollbar {
  display: none !important;
}

.efb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.efb-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.efb-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-led 0.833s infinite alternate;
}

.efb-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.efb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.efb-chip:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.efb-avatar {
  font-size: 13px;
  line-height: 1;
}

.efb-name {
  font-weight: 800;
}

.efb-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
}

.efb-chip-jack .efb-badge { background: #fef3c7; color: #92400e; }
.efb-chip-planner .efb-badge { background: #faf5ff; color: #6b21a8; }
.efb-chip-dev .efb-badge { background: #e0f2fe; color: #0369a1; }
.efb-chip-tester .efb-badge { background: #dcfce7; color: #15803d; }

.efb-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 4px #10b981;
}

.efb-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-open-fleet-drawer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: #0284c7;
  border: 1px solid #0284c7;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-open-fleet-drawer:hover {
  background: #0369a1;
  border-color: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-count-pill {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

/* DRAWER MODAL OVERLAY FOR 45 ASSISTANTS */
.fleet-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fleet-drawer-backdrop.active {
  opacity: 1 !important;
  display: flex !important;
}

.fleet-drawer-panel {
  width: 90%;
  max-width: 860px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fleet-drawer-backdrop.active .fleet-drawer-panel {
  transform: scale(1) translateY(0);
}

.fleet-drawer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.fdt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.fdt-close-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 16px;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fdt-close-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.fleet-drawer-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(85vh - 66px);
}

.fleet-drawer-body .fleet-command-hub {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.top-circuit-wire.wire-feedback {
  stroke: #10b981 !important;
  stroke-dasharray: 6 4 !important;
  stroke-width: 2.5px !important;
}

/* 🦉 LIVING MOBILE AGENTS & PINNED NODES (JACK DIRECTIVE) */
.living-mobile-agent {
  cursor: pointer !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease !important;
}
.living-mobile-agent:hover {
  transform: scale(1.18) translateY(-3px) !important;
  filter: drop-shadow(0 8px 16px rgba(2, 132, 199, 0.35)) !important;
}
.living-mobile-agent:active {
  transform: scale(0.95) !important;
}

.frame-pinned-agent {
  animation: floatAgentPulse 3s ease-in-out infinite alternate !important;
}
@keyframes floatAgentPulse {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* ⚡ SNAPSHOT TIME-TRAVEL & SHIMMER WAVE (JACK DIRECTIVE) */
.stt-pulse-neon-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981, 0 0 4px #10b981;
  margin-right: 5px;
  animation: neonBlink 1.4s infinite ease-in-out;
}
@keyframes neonBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.btn-stt-latest.active {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4) !important;
}

.btn-stt-mgmt-action {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-stt-mgmt-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}
.btn-stt-mgmt-action:active {
  transform: scale(0.96);
}

@keyframes shimmerWaveAnimation {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  50% {
    filter: brightness(1.22) drop-shadow(0 0 16px rgba(56, 189, 248, 0.55));
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
  }
  100% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
}

.shimmer-wave-active {
  animation: shimmerWaveAnimation 0.4s ease-in-out !important;
}

/* ==========================================================================
   PROCESS VIEW SWITCHER & NETWORK MINDMAP GRAPH (JACK DIRECTIVE)
   ========================================================================== */

/* Process View Switcher Bar */
.process-view-mode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(241, 245, 249, 0.9);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  min-height: 48px;
}

.pvm-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.pvm-tab-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #0f172a;
}

.pvm-tab-btn.active {
  background: #ffffff;
  color: #0284c7;
  border-color: #bae6fd;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.pvm-tab-icon {
  font-size: 16px;
}

/* Network Mindmap Container */
.network-mindmap-container {
  background: radial-gradient(circle at 50% 0%, rgba(240, 249, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.nm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.nm-header-title {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nm-badge-live {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 4-Cluster Mindmap Layout */
.nm-clusters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .nm-clusters-grid {
    grid-template-columns: 1fr;
  }
}

.nm-cluster-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s ease;
  position: relative;
}

.nm-cluster-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

.nm-cluster-nuance {
  border-top: 4px solid #0284c7;
}

.nm-cluster-infra {
  border-top: 4px solid #7c3aed;
}

.nm-cluster-sandbox {
  border-top: 4px solid #059669;
}

.nm-cluster-screenwatch {
  border-top: 4px solid #d97706;
}

.nm-cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

.nm-cluster-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nm-cluster-icon {
  font-size: 22px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.nm-cluster-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.nm-cluster-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.nm-tag-nuance { background: #e0f2fe; color: #0284c7; }
.nm-tag-infra { background: #f3e8ff; color: #7c3aed; }
.nm-tag-sandbox { background: #dcfce7; color: #15803d; }
.nm-tag-screenwatch { background: #fef3c7; color: #b45309; }

/* Nodes inside Cluster */
.nm-nodes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nm-node-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 48px;
}

.nm-node-item:hover {
  background: #ffffff;
  border-color: #0284c7;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

.nm-node-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nm-node-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.nm-node-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nm-node-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nm-node-desc {
  font-size: 10.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nm-node-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nm-tech-pill {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.nm-btn-interact {
  background: #0284c7;
  color: #ffffff;
  border: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nm-btn-interact:hover {
  background: #0369a1;
  transform: scale(1.04);
}

/* Inter-Cluster Pulse Lines SVG Overlay */
.nm-pulse-svg-overlay {
  width: 100%;
  height: 36px;
  margin: 10px 0;
}

@keyframes pulseDash {
  to {
    stroke-dashoffset: -32;
  }
}

.nm-pulse-line {
  stroke: #0284c7;
  stroke-width: 2.5;
  stroke-dasharray: 6 6;
  animation: pulseDash 1s linear infinite;
}

/* Infra & Hooks Special View */
.infra-hooks-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.infra-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.infra-spec-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.infra-spec-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

.infra-spec-icon {
  font-size: 24px;
}

.infra-spec-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.infra-code-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.5;
  margin-top: 8px;
}

/* Modal Node Details */
#modal-network-node-detail .compass-hub-card {
  max-width: 580px;
}

.nm-modal-grid-spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.nm-modal-spec-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.nm-modal-spec-label {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.nm-modal-spec-value {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

/* ==========================================================================
   FIX AVATAR & TEXT SPACING ON 4 STATIONS (JACK P0 DIRECTIVE)
   ========================================================================== */
#top-node-jack,
#top-node-planner,
#top-node-architect,
#top-node-tester,
#top-node-sentinel,
.top-node-card-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.top-node-card-inner > div:first-child {
  min-width: 44px !important;
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}

.top-node-card-inner > div:nth-child(2) {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  text-align: left !important;
  margin: 0 !important;
}

.top-node-card-inner > span:last-child {
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

/* ==========================================================================
   AGENT CONVERSATION & ACTION HUB (JACK P0 DIRECTIVE)
   ========================================================================== */
.agent-chat-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
}

.agent-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 90%;
  word-break: break-word;
}

.agent-msg-bot {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.agent-msg-user {
  background: #0284c7;
  color: #ffffff;
  align-self: flex-end;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.quick-prompts-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.btn-quick-prompt {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-prompt:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* ==========================================================================
   LA BÀN ARCHITECTURAL CONVERSATION HUB (JACK P0 DIRECTIVE)
   ========================================================================== */
.laban-state-card {
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.8) 0%, rgba(245, 243, 255, 0.8) 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.laban-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.laban-state-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
}

.laban-state-key {
  font-size: 9.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.laban-state-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 1px;
}

/* ==========================================================================
   LA BÀN DRAGGABLE 3.5D SPATIAL CONSOLE (WO-THE-GIOI-PAN-FIT-AND-COMPASS-35D)
   Apple Glassmorphism siêu thực, Viền Neon Cyan phát sáng nhẹ, Kéo thả tự do
   ========================================================================== */
#modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console {
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  box-shadow: 0 20px 60px -10px rgba(15, 23, 42, 0.28), 0 0 24px -4px rgba(56, 189, 248, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
  border-radius: 24px !important;
  user-select: none;
}

.theme-space #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console,
.theme-cyber #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console,
.theme-glass #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console,
.theme-obsidian #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console,
.theme-toi #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console,
[data-theme="space"] #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console,
[data-theme="dark"] #modal-the-compass-hub .modal-the-compass-card.la-ban-spatial-console {
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1px solid rgba(56, 189, 248, 0.55) !important;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.75), 0 0 30px rgba(56, 189, 248, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

.compass-console-drag-handle {
  cursor: grab !important;
  touch-action: none;
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.75) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
  padding: 12px 18px !important;
}
.compass-console-drag-handle:active,
.la-ban-spatial-console.is-dragging .compass-console-drag-handle {
  cursor: grabbing !important;
}

.hud-console-badge {
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px !important;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%) !important;
  color: #ffffff !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
  text-transform: uppercase !important;
}

.compass-hub-btn-reset {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.05) !important;
  color: #475569 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.compass-hub-btn-reset:hover {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}

/* 3 Phím Tác Chiến 1-Chạm (Apple HIG Touch Target >= 44px) */
.la-ban-tactical-trio-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 18px 6px 18px;
  flex-shrink: 0;
}

.btn-tactical-one-touch {
  min-height: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.btn-tactical-one-touch:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.15);
}

.btn-tact-lint {
  border-color: rgba(2, 132, 199, 0.35);
}
.btn-tact-lint:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

.btn-tact-locate {
  border-color: rgba(16, 185, 129, 0.35);
}
.btn-tact-locate:hover {
  background: #ecfdf5;
  border-color: #10b981;
}

.btn-tact-specs {
  border-color: rgba(147, 51, 234, 0.35);
}
.btn-tact-specs:hover {
  background: #faf5ff;
  border-color: #9333ea;
}

.btn-tact-icon {
  font-size: 15px;
}
.btn-tact-title {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}
.btn-tact-badge {
  font-size: 8.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.btn-tact-lint .btn-tact-badge { background: #e0f2fe; color: #0369a1; }
.btn-tact-locate .btn-tact-badge { background: #d1fae5; color: #065f46; }
.btn-tact-specs .btn-tact-badge { background: #f3e8ff; color: #6b21a8; }

/* Mini Topology Orbital 3.5D Visualizer */
.la-ban-mini-topology-card {
  margin: 6px 18px 2px 18px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  flex-shrink: 0;
}
.mini-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mini-top-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 8px #0284c7;
  animation: pulseNeonDot 1.6s infinite ease-in-out;
}
.mini-top-title {
  font-size: 10px;
  font-weight: 800;
  color: #0369a1;
  letter-spacing: 0.4px;
}
.mini-top-status {
  font-size: 8.5px;
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  padding: 1px 6px;
  border-radius: 4px;
}
.mini-topology-viewport {
  position: relative;
  width: 100%;
  height: 90px;
  background: radial-gradient(circle at center, rgba(2, 132, 199, 0.08) 0%, rgba(241, 245, 249, 0.4) 70%);
  border-radius: 10px;
  overflow: hidden;
  border: 1px dashed rgba(203, 213, 225, 0.7);
}

.mini-orbital-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mini-agent-node {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.mini-agent-node:hover {
  transform: scale(1.18);
  filter: drop-shadow(0 0 6px #0284c7);
}

/* ==========================================================================
   LA BÀN FLOATING SIDE DRAWER & 3-TAB SEGMENTED ARCHITECTURE (JACK P0)
   ========================================================================== */
.laban-segmented-control {
  display: flex;
  background: rgba(241, 245, 249, 0.9);
  padding: 3px;
  border-radius: 12px;
  margin: 8px 18px 8px 18px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  flex-shrink: 0;
  gap: 3px;
}

.theme-space .laban-segmented-control,
.theme-cyber .laban-segmented-control,
.theme-glass .laban-segmented-control,
.theme-obsidian .laban-segmented-control,
.theme-toi .laban-segmented-control,
[data-theme="space"] .laban-segmented-control,
[data-theme="dark"] .laban-segmented-control {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(56, 189, 248, 0.25);
}

.laban-segment-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
}

.laban-segment-btn:hover {
  color: #0f172a;
}

.laban-segment-btn.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-space .laban-segment-btn.active,
.theme-cyber .laban-segment-btn.active,
.theme-glass .laban-segment-btn.active,
.theme-obsidian .laban-segment-btn.active,
.theme-toi .laban-segment-btn.active,
[data-theme="space"] .laban-segment-btn.active,
[data-theme="dark"] .laban-segment-btn.active {
  background: #0284c7;
  color: #ffffff;
}

.laban-tab-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  box-sizing: border-box;
}

.laban-tab-pane.active {
  display: flex;
}

/* Rich Conversation Input Bar with Apple Glassmorphism */
.laban-rich-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(2, 132, 199, 0.28);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-top: 10px;
  flex-shrink: 0;
}

.theme-space .laban-rich-input-bar,
.theme-cyber .laban-rich-input-bar,
.theme-glass .laban-rich-input-bar,
.theme-obsidian .laban-rich-input-bar,
.theme-toi .laban-rich-input-bar,
[data-theme="space"] .laban-rich-input-bar,
[data-theme="dark"] .laban-rich-input-bar {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.35);
}

.laban-tool-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
  color: #334155;
}

.laban-tool-btn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.laban-tool-btn.active-pulse {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.laban-rich-input {
  flex: 1;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  padding: 0 6px;
}

.theme-space .laban-rich-input,
.theme-cyber .laban-rich-input,
.theme-glass .laban-rich-input,
.theme-obsidian .laban-rich-input,
.theme-toi .laban-rich-input,
[data-theme="space"] .laban-rich-input,
[data-theme="dark"] .laban-rich-input {
  color: #f1f5f9;
}

.laban-send-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  white-space: nowrap;
}

.laban-send-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   AGENT ACTION SHEET - RIGHT SLIDE-OVER DRAWER (APPLE HIG SPEC BY JACK)
   Không focus che toàn màn hình, giữ trọn tầm nhìn 4 Trạm Dòng Chảy bên trái
   ========================================================================== */
#modal-agent-action-sheet.agent-action-sheet-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.18) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 100050 !important;
  display: none;
  align-items: stretch !important;
  justify-content: flex-end !important;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#modal-agent-action-sheet.agent-action-sheet-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
}

#modal-agent-action-sheet .agent-action-sheet-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 460px !important;
  max-width: 92vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 20px 0 0 20px !important;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(32px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(190%) !important;
  border-left: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.22) !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease !important;
  padding: 18px 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#modal-agent-action-sheet.active .agent-action-sheet-panel {
  transform: translateX(0) !important;
}

#modal-agent-action-sheet.expanded .agent-action-sheet-panel {
  width: 620px !important;
}

#modal-agent-action-sheet #action-sheet-chat-stream {
  flex: 1 1 0% !important;
  min-height: 220px !important;
  max-height: calc(100vh - 310px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding: 8px 4px !important;
  margin-bottom: 8px !important;
}

.theme-dark #modal-agent-action-sheet .agent-action-sheet-panel,
.theme-space #modal-agent-action-sheet .agent-action-sheet-panel,
.theme-cyber #modal-agent-action-sheet .agent-action-sheet-panel,
.theme-obsidian #modal-agent-action-sheet .agent-action-sheet-panel,
[data-theme="dark"] #modal-agent-action-sheet .agent-action-sheet-panel {
  background: rgba(15, 23, 42, 0.95) !important;
  border-left: 1px solid rgba(56, 189, 248, 0.28) !important;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.65) !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   CARTOGRAPHER AI & SUB-WORLD INFINITE CANVAS STYLES (JACK P0)
   ========================================================================== */
.cartographer-preset-card:hover {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.15) !important;
}

.sub-station-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease !important;
}

.sub-station-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.18) !important;
  border-color: #0284c7 !important;
}

.btn-cartographer-trigger:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
  filter: brightness(1.08) !important;
}

.subworld-dag-container::-webkit-scrollbar {
  height: 8px !important;
}

.subworld-dag-container::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 199, 0.3) !important;
  border-radius: 999px !important;
}

#modal-cartographer-ai,
#modal-them-tram-con {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 99999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 16px !important;
}

