/* =============================================================================
   ⚡ ZOTH STUDIO — CYBERPUNK HUD EMBEDDED TOOL STYLESHEET (v5.0 SOVEREIGN)
   =============================================================================
   Automatically adapts any workstation or tool page when loaded inside the
   Master Cyberpunk HUD Stage iframe.
   ============================================================================= */

/* When loaded inside HUD Stage iframe */
html.hud-embedded-mode,
body.in-hud,
body.hud-embedded-view {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  height: 100vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
}

/* Suppress redundant global navigation, topbars, install banners, hero headers, marketing banners, and mega-footers */
html.hud-embedded-mode header,
html.hud-embedded-mode header.bar,
html.hud-embedded-mode header.nav,
html.hud-embedded-mode header.site-header,
html.hud-embedded-mode header.omni-header,
html.hud-embedded-mode header.main-header,
html.hud-embedded-mode header.global-header,
html.hud-embedded-mode header.poster-bar,
html.hud-embedded-mode header.app-header,
html.hud-embedded-mode #topbar,
html.hud-embedded-mode .topbar,
html.hud-embedded-mode .zoth-nav,
html.hud-embedded-mode .main-nav,
html.hud-embedded-mode .site-header,
html.hud-embedded-mode .site-nav,
html.hud-embedded-mode .top-nav,
html.hud-embedded-mode .global-header,
html.hud-embedded-mode .reg-bar,
html.hud-embedded-mode .hub-bar,
html.hud-embedded-mode .navbar,
html.hud-embedded-mode #navbar,
html.hud-embedded-mode nav.site-navigation,
html.hud-embedded-mode nav.drawer,
html.hud-embedded-mode #mobile-drawer,
html.hud-embedded-mode .drawer,
html.hud-embedded-mode .dock-wrap,
html.hud-embedded-mode .floating-dock,
html.hud-embedded-mode .bottom-dock,
html.hud-embedded-mode .zoth-footer,
html.hud-embedded-mode .zoth-unified-nav,
html.hud-embedded-mode footer,
html.hud-embedded-mode footer.site,
html.hud-embedded-mode footer.site-footer,
html.hud-embedded-mode footer.zoth-footer,
html.hud-embedded-mode footer.footer,
html.hud-embedded-mode footer.site-foot,
html.hud-embedded-mode .mega-footer,
html.hud-embedded-mode .hero-banner-redundant,
html.hud-embedded-mode .standalone-only,
html.hud-embedded-mode .omni-header,
html.hud-embedded-mode .omni-title-wrap,
html.hud-embedded-mode .omni-guided-steps,
html.hud-embedded-mode .omni-poster-hero,
html.hud-embedded-mode .omni-poster-grid,
html.hud-embedded-mode .recent-workstations-bar,
html.hud-embedded-mode .studio-poster-actions,
html.hud-embedded-mode .quick-nav,
html.hud-embedded-mode .zoth-scroll-progress,
html.hud-embedded-mode .floating-pet-hud,
html.hud-embedded-mode .pet-companion-bubble,
html.hud-embedded-mode .zoth-docs-deep-dive-btn,
html.hud-embedded-mode .install-stage,
html.hud-embedded-mode #install,
html.hud-embedded-mode .install-wrap,
html.hud-embedded-mode .home-install-shell,
html.hud-embedded-mode .install-support-bar,
html.hud-embedded-mode .install-support,
html.hud-embedded-mode .banner-install,
html.hud-embedded-mode .desktop-install,
html.hud-embedded-mode .pwa-banner,
html.hud-embedded-mode .install-banner,
html.hud-embedded-mode .install-cta,
html.hud-embedded-mode .install-bar,
html.hud-embedded-mode .install-os-deck,
html.hud-embedded-mode .install-terminal-deck,
html.hud-embedded-mode .install-3d-stage,
html.hud-embedded-mode .download-banner,
html.hud-embedded-mode .install-notes,
html.hud-embedded-mode .install-feature-chips,
html.hud-embedded-mode .install-footer-row,
html.hud-embedded-mode .install-copy,
html.hud-embedded-mode .install-copy-3d,
body.in-hud header,
body.in-hud header.bar,
body.in-hud header.nav,
body.in-hud header.site-header,
body.in-hud header.poster-bar,
body.in-hud #topbar,
body.in-hud .topbar,
body.in-hud .reg-bar,
body.in-hud .hub-bar,
body.in-hud .navbar,
body.in-hud #navbar,
body.in-hud .zoth-unified-nav,
body.in-hud footer,
body.in-hud footer.site,
body.in-hud footer.site-footer,
body.in-hud .dock-wrap,
body.in-hud .omni-header,
body.in-hud .omni-title-wrap,
body.in-hud .omni-guided-steps,
body.in-hud .recent-workstations-bar,
body.in-hud .floating-pet-hud,
body.in-hud .install-stage,
body.in-hud #install,
body.in-hud .install-banner,
body.in-hud .desktop-install,
body.in-hud .home-install-shell {
  display: none !important;
}

/* Ensure no blank cutoffs or phantom padding at top */
html.hud-embedded-mode,
html.hud-embedded-mode body,
html.hud-embedded-mode #app,
html.hud-embedded-mode #root,
html.hud-embedded-mode .app-root,
html.hud-embedded-mode .page-wrap,
body.in-hud,
body.in-hud #app,
body.in-hud #root,
body.in-hud .app-root,
body.in-hud .page-wrap {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Adapt main tool containers to fill viewport with generous breathing room */
html.hud-embedded-mode main,
html.hud-embedded-mode .workspace-container,
html.hud-embedded-mode .container,
html.hud-embedded-mode .omni-container,
html.hud-embedded-mode .omni-layout,
html.hud-embedded-mode .editor-root,
html.hud-embedded-mode .studio-container,
html.hud-embedded-mode .bus-deck,
html.hud-embedded-mode .recon-workspace,
html.hud-embedded-mode .mc-workspace,
html.hud-embedded-mode .forge-container,
html.hud-embedded-mode .arena-layout,
html.hud-embedded-mode .feed-box,
html.hud-embedded-mode .ide-workspace-grid,
html.hud-embedded-mode .connectors-grid,
html.hud-embedded-mode .nodes-grid,
html.hud-embedded-mode .tool-box,
html.hud-embedded-mode .subsweep-workspace,
html.hud-embedded-mode .consensus-poster,
html.hud-embedded-mode .noc-wrap,
html.hud-embedded-mode .pipeline-workspace,
html.hud-embedded-mode .tool-nexus-wrap,
html.hud-embedded-mode .models-workspace,
html.hud-embedded-mode .net-container,
html.hud-embedded-mode .chronicle-log,
html.hud-embedded-mode .chronicle-proof,
body.in-hud main,
body.in-hud .workspace-container,
body.in-hud .omni-container,
body.in-hud .bus-deck,
body.in-hud .recon-workspace,
body.in-hud .mc-workspace,
body.in-hud .forge-container,
body.in-hud .arena-layout,
body.in-hud .ide-workspace-grid,
body.in-hud .connectors-grid,
body.in-hud .noc-wrap {
  padding-top: 14px !important;
  padding-bottom: 42px !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Mobile viewport breathing room inside embedded tool stage */
@media (max-width: 768px) {
  html.hud-embedded-mode main,
  html.hud-embedded-mode .workspace-container,
  html.hud-embedded-mode .container,
  html.hud-embedded-mode .omni-container,
  html.hud-embedded-mode .omni-layout,
  html.hud-embedded-mode .editor-root,
  html.hud-embedded-mode .studio-container,
  html.hud-embedded-mode .bus-deck,
  html.hud-embedded-mode .recon-workspace,
  html.hud-embedded-mode .mc-workspace,
  html.hud-embedded-mode .forge-container,
  html.hud-embedded-mode .arena-layout,
  html.hud-embedded-mode .ide-workspace-grid,
  html.hud-embedded-mode .connectors-grid,
  html.hud-embedded-mode .nodes-grid,
  html.hud-embedded-mode .tool-box,
  html.hud-embedded-mode .subsweep-workspace,
  html.hud-embedded-mode .consensus-poster,
  html.hud-embedded-mode .noc-wrap,
  html.hud-embedded-mode .pipeline-workspace,
  html.hud-embedded-mode .tool-nexus-wrap,
  body.in-hud main,
  body.in-hud .workspace-container,
  body.in-hud .omni-container,
  body.in-hud .bus-deck,
  body.in-hud .recon-workspace,
  body.in-hud .mc-workspace,
  body.in-hud .forge-container,
  body.in-hud .arena-layout,
  body.in-hud .ide-workspace-grid,
  body.in-hud .connectors-grid,
  body.in-hud .noc-wrap {
    padding-top: 22px !important;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 16px)) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* High-contrast cyberpunk scrollbars inside embedded stage */
html.hud-embedded-mode::-webkit-scrollbar,
body.in-hud::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html.hud-embedded-mode::-webkit-scrollbar-track,
body.in-hud::-webkit-scrollbar-track {
  background: rgba(0, 5, 10, 0.6);
}

html.hud-embedded-mode::-webkit-scrollbar-thumb,
body.in-hud::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.4);
  border-radius: 3px;
}

html.hud-embedded-mode::-webkit-scrollbar-thumb:hover,
body.in-hud::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.8);
}

/* Standalone Floating HUD Launcher Chip */
.hud-standalone-launcher-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.hud-launch-cockpit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(3, 4, 8, 0.95), rgba(10, 16, 32, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 240, 255, 0.35);
  padding: 8px 16px;
  border-radius: 4px;
  clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
  color: #00f0ff;
  font-family: "IBM Plex Mono", "Share Tech Mono", monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-launch-cockpit-btn:hover {
  background: linear-gradient(135deg, #00f0ff, #0070f3);
  color: #030408;
  border-color: #ffffff;
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.6), 0 0 24px rgba(0, 240, 255, 0.8);
  transform: translateY(-2px) scale(1.02);
}

.hud-launch-icon {
  font-size: 1rem;
  animation: pulseIcon 1.5s infinite ease-in-out;
}

.hud-launch-tag {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fbbf24;
  font-size: 0.64rem;
  padding: 2px 6px;
  border-radius: 2px;
}

.hud-launch-cockpit-btn:hover .hud-launch-tag {
  background: #030408;
  color: #00f0ff;
  border-color: #030408;
}

@keyframes pulseIcon {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px #00f0ff); }
}

/* Hide launcher when embedded */
html.hud-embedded-mode .hud-standalone-launcher-banner,
body.in-hud .hud-standalone-launcher-banner {
  display: none !important;
}
