/**
 * VANTIX Enterprise Org Chart Platform — Visual Inspector & Tool Rail
 * File: public_html_thevantix/apps/enterprise-org-chart-platform/assets/css/visual-inspector.css
 *
 * Provides:
 *  1. Floating Left Tool Rail (Vertically Centered, Zero Collision with Top Dock)
 *  2. Visual Presets Fly-out Drawer
 *  3. Contextual Inspector Fly-out Drawer
 *  4. Diagnostics & Metrics Health Drawer
 *  5. Complete Light / Dark Mode Theme Adaptation
 *  6. Responsive Breakpoints (Mobile Bottom Docking)
 */

/* ==========================================================================
   1. Narrow Left Tool Rail (Centered to prevent dropdown collisions)
   ========================================================================== */
.org-workspace-wrap {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#org-chart-mount {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100%;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.svg-chart-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.vantix-org-platform-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

/* Ensure the 2-panel grid layout strictly respects 1fr without expanding */
@media (min-width: 1024px) {
  .vantix-2panel-grid {
    grid-template-columns: 340px minmax(0, 1fr) !important;
  }
}

.product-app-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.dock-row-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.dock-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 6px 11px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border: 1px solid var(--org-border-dock) !important;
  background: var(--org-bg-card) !important;
  color: var(--org-text-main) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  height: 34px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.dock-btn:hover {
  background: var(--org-ctrl-hover) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.dock-btn.active {
  border-color: #F7B733 !important;
  color: #F7B733 !important;
}

.dock-row-secondary {
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid var(--org-border-dock);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  transition: all 0.2s ease-in-out;
}

.org-left-tool-rail {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s ease;
  max-height: calc(100% - 28px);
  overflow-y: auto;
  scrollbar-width: none;
  pointer-events: auto;
}

.org-left-tool-rail::-webkit-scrollbar {
  display: none;
}

/* Light Theme Rail */
html:not(.dark) .org-left-tool-rail,
:root:not(.dark) .org-left-tool-rail {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  position: relative;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.15);
}

html:not(.dark) .rail-btn,
:root:not(.dark) .rail-btn {
  color: #475569;
}

html:not(.dark) .rail-btn:hover,
:root:not(.dark) .rail-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.12);
}

.rail-btn.active {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

html:not(.dark) .rail-btn.active,
:root:not(.dark) .rail-btn.active {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.5);
}

.rail-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.rail-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

html:not(.dark) .rail-divider,
:root:not(.dark) .rail-divider {
  background: rgba(0, 0, 0, 0.08);
}

/* Tooltip on hover */
.rail-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
}

.rail-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   2. Contextual Inspector Fly-Out Drawer
   ========================================================================== */
.inspector-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(380px, 92vw);
  max-width: 92vw;
  background: rgba(11, 15, 26, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  color: #f8fafc;
}

html:not(.dark) .inspector-drawer,
:root:not(.dark) .inspector-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

.inspector-drawer.open {
  transform: translateX(0);
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

html:not(.dark) .inspector-header,
:root:not(.dark) .inspector-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.inspector-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

html:not(.dark) .inspector-title,
:root:not(.dark) .inspector-title {
  color: #0f172a;
}

.inspector-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.inspector-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

html:not(.dark) .inspector-close-btn {
  color: #64748b;
}

html:not(.dark) .inspector-close-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
}

.inspector-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inspector-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fbbf24;
  margin-bottom: 8px;
}

html:not(.dark) .inspector-section-title,
:root:not(.dark) .inspector-section-title {
  color: #b45309;
}

.inspector-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inspector-pill-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.inspector-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

html:not(.dark) .inspector-pill-btn,
:root:not(.dark) .inspector-pill-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #334155;
}

html:not(.dark) .inspector-pill-btn:hover,
:root:not(.dark) .inspector-pill-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.inspector-pill-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
}

html:not(.dark) .inspector-pill-btn.active,
:root:not(.dark) .inspector-pill-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #b45309;
}

/* Color Swatches */
.swatch-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 8px currentColor;
}

html:not(.dark) .color-swatch.active,
:root:not(.dark) .color-swatch.active {
  border-color: #0f172a;
}

/* ==========================================================================
   3. Visual Presets Gallery Drawer (Centered with Left Rail)
   ========================================================================== */
.presets-drawer {
  position: absolute;
  left: 74px;
  top: 110px;
  width: 380px;
  max-width: calc(100vw - 94px);
  max-height: min(580px, calc(100% - 124px));
  background: rgba(11, 15, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

html:not(.dark) .presets-drawer,
:root:not(.dark) .presets-drawer {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.presets-drawer.open {
  display: flex;
}

.presets-grid {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.preset-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

html:not(.dark) .preset-card,
:root:not(.dark) .preset-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

html:not(.dark) .preset-card:hover,
:root:not(.dark) .preset-card:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.16);
}

.preset-card.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

html:not(.dark) .preset-card.active,
:root:not(.dark) .preset-card.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.preset-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preset-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

html:not(.dark) .preset-card-title,
:root:not(.dark) .preset-card-title {
  color: #0f172a;
}

.preset-card-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  text-transform: uppercase;
}

html:not(.dark) .preset-card-tag,
:root:not(.dark) .preset-card-tag {
  background: rgba(0, 0, 0, 0.06);
  color: #475569;
}

.preset-card-desc {
  font-size: 11px;
  color: #94a3b8;
}

html:not(.dark) .preset-card-desc,
:root:not(.dark) .preset-card-desc {
  color: #64748b;
}

/* ==========================================================================
   4. Diagnostic Health Drawer
   ========================================================================== */
.health-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: rgba(11, 15, 26, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  color: #f8fafc;
}

html:not(.dark) .health-drawer,
:root:not(.dark) .health-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

.health-drawer.open {
  transform: translateX(0);
}

.health-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

html:not(.dark) .health-stat-row,
:root:not(.dark) .health-stat-row {
  background: rgba(0, 0, 0, 0.04);
}

.health-stat-label {
  color: #94a3b8;
}

html:not(.dark) .health-stat-label,
:root:not(.dark) .health-stat-label {
  color: #64748b;
}

.health-stat-val {
  font-family: monospace;
  font-weight: 700;
  color: #f8fafc;
}

html:not(.dark) .health-stat-val,
:root:not(.dark) .health-stat-val {
  color: #0f172a;
}

/* ==========================================================================
   5. Mobile & Tablet Responsiveness (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .org-top-dock {
    left: 10px !important;
    right: 10px !important;
    top: 10px !important;
    padding: 8px 10px !important;
  }

  .org-left-tool-rail {
    top: auto !important;
    bottom: 12px !important;
    left: 12px !important;
    right: auto !important;
    transform: none !important;
    flex-direction: row !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    z-index: 40 !important;
    max-width: calc(100% - 70px) !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .rail-btn {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }

  .rail-divider {
    width: 1px !important;
    height: 20px !important;
    margin: 0 4px !important;
    flex-shrink: 0 !important;
  }

  .rail-btn::after {
    left: 50% !important;
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    transform: translateX(-50%) !important;
  }

  .canvas-controls-island {
    bottom: 60px !important;
    right: 12px !important;
  }

  .presets-drawer {
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: 60px !important;
    transform: none !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 60vh !important;
    z-index: 50 !important;
  }

  .inspector-drawer,
  .health-drawer {
    width: 100% !important;
    max-width: 100vw !important;
    z-index: 50 !important;
  }
}

/* ==========================================================================
   6. Fullscreen Interactive Workspace
   ========================================================================== */
.org-workspace-wrap.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.org-workspace-wrap.is-fullscreen .org-top-dock {
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(74px, calc(env(safe-area-inset-left, 0px) + 74px));
  right: max(14px, env(safe-area-inset-right, 14px));
}

.org-workspace-wrap.is-fullscreen .canvas-controls-island {
  bottom: max(18px, env(safe-area-inset-bottom, 18px));
  right: max(18px, env(safe-area-inset-right, 18px));
}

.org-workspace-wrap.is-fullscreen .org-left-tool-rail {
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(14px, env(safe-area-inset-left, 14px));
  max-height: calc(100vh - 28px);
}

.org-workspace-wrap.is-fullscreen .presets-drawer {
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(74px, calc(env(safe-area-inset-left, 0px) + 74px));
  max-height: calc(100vh - 28px);
}

/* ==========================================================================
   7. Interactive "ℹ️" Guidance Popups (Hover & Smooth Collapse)
   ========================================================================== */
.vantix-guide-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.vantix-guide-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: rgba(6, 78, 59, 0.35) !important;
  border: 1.5px solid #F7B733 !important;
  color: #F7B733 !important;
  font-size: 13px;
  font-weight: 800;
  cursor: help;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 10px rgba(247, 183, 51, 0.15);
  flex-shrink: 0;
  margin-left: 4px;
}

html:not(.dark) .vantix-guide-trigger,
:root:not(.dark) .vantix-guide-trigger {
  background: rgba(6, 78, 59, 0.1) !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}

.vantix-guide-trigger:hover,
.vantix-guide-trigger:focus {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  transform: scale(1.1);
  outline: none;
}

.vantix-guide-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 150;
}

html:not(.dark) .vantix-guide-popup,
:root:not(.dark) .vantix-guide-popup {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

.vantix-guide-wrap:hover .vantix-guide-popup,
.vantix-guide-wrap:focus-within .vantix-guide-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.vantix-guide-popup-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
}

html:not(.dark) .vantix-guide-popup-title,
:root:not(.dark) .vantix-guide-popup-title {
  color: #b45309;
}

.vantix-guide-popup-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-bottom: 6px;
}

html:not(.dark) .vantix-guide-popup-desc,
:root:not(.dark) .vantix-guide-popup-desc {
  color: #475569;
}

.vantix-guide-popup-tip {
  font-size: 10.5px;
  font-weight: 600;
  color: #38bdf8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
  margin-top: 6px;
}

html:not(.dark) .vantix-guide-popup-tip,
:root:not(.dark) .vantix-guide-popup-tip {
  border-color: rgba(0, 0, 0, 0.06);
  color: #0284c7;
}

/* Floating Action Dock for Fullscreen Mode (Bottom-center floating glass HUD - zero overlap) */
.fullscreen-action-dock {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  right: auto;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.3);
}

.fs-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fs-dock-btn-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.12);
}
.fs-dock-btn-neutral:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateY(-1px);
}

.fs-dock-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border-color: rgba(129, 140, 248, 0.4);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}
.fs-dock-btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.5);
}

.fs-dock-btn-danger {
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.fs-dock-btn-danger:hover {
  background: rgba(185, 28, 28, 1);
  transform: translateY(-1px);
}

/* Floating Exit Button for Fullscreen Mode (Legacy compatibility) */
.fullscreen-exit-float {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(20px, env(safe-area-inset-right, 20px));
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  transition: all 0.2s ease;
}

.fullscreen-exit-float:hover {
  background: rgba(185, 28, 28, 1);
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.5);
}

/* Fullscreen Scroll Lock */
body.org-fullscreen-locked,
html.org-fullscreen-locked {
  overflow: hidden !important;
}

/* Drag & Drop Reparenting Feedback */
.vantix-drag-handle {
  cursor: grab !important;
  opacity: 0.65;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.vantix-drag-handle:hover {
  opacity: 1 !important;
  transform: scale(1.2);
}
.vantix-drag-handle:active {
  cursor: grabbing !important;
}

.vantix-node-card.is-drag-source {
  opacity: 0.45 !important;
  transform: scale(0.96) !important;
  filter: grayscale(0.5);
}

.vantix-node-card.is-drop-target {
  box-shadow: 0 0 0 3px #10b981, 0 0 22px rgba(16, 185, 129, 0.55) !important;
  border-color: #10b981 !important;
  transform: scale(1.04) !important;
  transition: all 0.15s ease !important;
}

/* ==========================================================================
   VANTIX Comet Button & Interactive Micro-Animations
   ========================================================================== */
@keyframes cometSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.comet-spin-ring {
  animation: cometSpin 2.5s linear infinite !important;
  background: conic-gradient(from 90deg at 50% 50%, #AA7C11 0%, #F7B733 50%, #FFE066 100%) !important;
  pointer-events: none;
}

.group:hover .comet-spin-ring,
.group:focus-within .comet-spin-ring {
  opacity: 1 !important;
}

/* Micro-interaction hover lift & active press on comet buttons */
.group button,
.group a {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.group:hover button,
.group:hover a {
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 20px rgba(247, 183, 51, 0.25) !important;
}

.group:active button,
.group:active a {
  transform: translateY(0.5px) scale(0.99) !important;
}

/* Secondary comet ring variant (Silver/Platinum) */
.group:has([style*="#262626"]) .comet-spin-ring {
  background: conic-gradient(from 90deg at 50% 50%, #525252 0%, #94a3b8 50%, #f8fafc 100%) !important;
}

.group:has([style*="#262626"]):hover button {
  box-shadow: 0 6px 20px rgba(148, 163, 184, 0.2) !important;
}

#fs-export-comet-slot {
  display: inline-flex;
  align-items: center;
}
#fs-export-comet-slot .group {
  margin: 0;
}

/* ==========================================================================
   VANTIX 9-Page Corporate Deck & Multi-Filter Console Drawers
   ========================================================================== */

/* Rail Badge (Active Page or Mode Indicator) */
.rail-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  background: #F7B733;
  color: #000000;
  box-shadow: 0 2px 6px rgba(247, 183, 51, 0.4);
  pointer-events: none;
  text-transform: uppercase;
}

/* Pages Drawer */
.pages-drawer {
  position: absolute;
  left: 74px;
  top: 110px;
  width: 380px;
  max-width: calc(100% - 88px);
  max-height: min(650px, calc(100% - 124px));
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.pages-drawer.open {
  display: flex !important;
}

html:not(.dark) .pages-drawer,
:root:not(.dark) .pages-drawer {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.pages-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
html:not(.dark) .pages-drawer-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.pages-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}
html:not(.dark) .pages-drawer-title {
  color: #0f172a;
}

.pages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 520px;
  padding-right: 2px;
}

.page-card-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-align: left;
}

html:not(.dark) .page-card-item {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.page-card-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(247, 183, 51, 0.4);
  transform: translateX(2px);
}
html:not(.dark) .page-card-item:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(247, 183, 51, 0.6);
}

.page-card-item.active {
  background: rgba(247, 183, 51, 0.12);
  border-color: #F7B733;
  box-shadow: 0 0 14px rgba(247, 183, 51, 0.25);
}

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

.page-num-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
.page-card-item.active .page-num-chip {
  background: #F7B733;
  color: #000000;
}

.page-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}
html:not(.dark) .page-card-title {
  color: #0f172a;
}
.page-card-item.active .page-card-title {
  color: #F7B733;
}

.page-card-desc {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0;
}
html:not(.dark) .page-card-desc {
  color: #64748b;
}

.page-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: #64748b;
}
html:not(.dark) .page-card-footer {
  color: #94a3b8;
}

.page-card-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Multi-Filter Console Drawer */
.multi-filter-drawer {
  position: absolute;
  left: 74px;
  top: 110px;
  width: 420px;
  max-width: calc(100% - 88px);
  max-height: min(650px, calc(100% - 124px));
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.multi-filter-drawer.open {
  display: flex !important;
}

html:not(.dark) .multi-filter-drawer {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.filter-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}
html:not(.dark) .filter-section-title {
  color: #64748b;
}

.filter-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
html:not(.dark) .filter-chip {
  background: rgba(0, 0, 0, 0.04);
  color: #334155;
  border-color: rgba(0, 0, 0, 0.1);
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
html:not(.dark) .filter-chip:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.filter-chip.active {
  background: #F7B733 !important;
  color: #000000 !important;
  border-color: #F7B733 !important;
  font-weight: 700 !important;
}

/* Page Quick Bar in Top Dock */
.page-quick-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--org-border-dock);
}
html:not(.dark) .page-quick-bar {
  background: rgba(0, 0, 0, 0.04);
}

.page-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--org-text-main);
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  transition: all 0.15s ease;
}
.page-nav-btn:hover {
  background: var(--org-ctrl-hover);
  border-color: rgba(255, 255, 255, 0.15);
}
.page-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-indicator-pill {
  font-size: 11px;
  font-weight: 700;
  color: #F7B733;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(247, 183, 51, 0.12);
  border: 1px solid rgba(247, 183, 51, 0.3);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .pages-drawer,
  .multi-filter-drawer {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    bottom: 65px !important;
    top: auto !important;
  }
}

/* ==========================================================================
   8. True Vector Native Print & Save as PDF Pipeline (Zero Shift, True Colors)
   ========================================================================== */
@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Hide all UI Chrome */
  .org-top-dock,
  .org-left-tool-rail,
  .canvas-controls-island,
  .fullscreen-action-dock,
  .presets-drawer,
  .inspector-drawer,
  .health-drawer,
  .pages-drawer,
  .multi-filter-drawer,
  .org-modal-overlay,
  .vantix-guide-popup-tip,
  header,
  nav,
  footer,
  #header,
  #footer,
  #wrap-export-btn,
  #canvas-empty-state,
  #empty-state-overlay {
    display: none !important;
  }

  .org-workspace-wrap {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  #org-chart-mount,
  #chart-container,
  #svg-stage,
  #svg-viewport,
  #svg-viewport-group {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .vantix-node-card {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-shadow: none !important;
  }

  .connection-path,
  .link-secondary,
  .radial-connector-path {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Light Theme Contrast Overrides for Inspector and Autocomplete */
html:not(.dark) .inspector-drawer {
  color: #0f172a !important;
}
html:not(.dark) .inspector-drawer .text-white,
html:not(.dark) #insp-node-name {
  color: #0f172a !important;
}
html:not(.dark) .inspector-drawer .bg-white\/5 {
  background: rgba(0, 0, 0, 0.04) !important;
}
html:not(.dark) .inspector-drawer .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.1) !important;
}
html:not(.dark) .inspector-drawer .text-neutral-300,
html:not(.dark) .inspector-drawer .text-neutral-400 {
  color: #475569 !important;
}
html:not(.dark) .inspector-drawer .text-amber-300 {
  color: #b45309 !important;
}
html:not(.dark) .search-autocomplete-dropdown {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}
html:not(.dark) .search-result-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}
html:not(.dark) .search-result-item:hover {
  background: rgba(245, 158, 11, 0.08) !important;
}
html:not(.dark) .search-result-item .text-white {
  color: #0f172a !important;
}

