/* ═══════════════════════════════════════════════════════════════════ */
/* ULAMORA ROBOTICS STUDIO — Engineering Stylesheet                   */
/* Aesthetic: "Scientific + Technical + Dark + Calm + Premium"        */
/* ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg-void: #05060a;
  --bg-surface: #090c14;
  --bg-panel: rgba(11, 15, 25, 0.82);
  --bg-card: rgba(16, 22, 36, 0.75);
  --bg-card-hover: rgba(22, 30, 48, 0.9);
  
  --text-primary: #f0f3fa;
  --text-secondary: #94a3b8;
  --text-muted: #4b5568;

  --accent-cyan: #00e8ff;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 232, 255, 0.4);
  --border-card: rgba(255, 255, 255, 0.05);

  --glow-cyan: 0 0 24px rgba(0, 232, 255, 0.25);
  --glow-purple: 0 0 24px rgba(168, 85, 247, 0.25);
  
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.robotics-app {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* ───────────────────────────────────────────────────────────────── */
/* TOP HUD NAVIGATION BAR (Tactile Studio Style)                    */
/* ───────────────────────────────────────────────────────────────── */
.robotics-navbar {
  height: 52px;
  background: linear-gradient(180deg, rgba(16, 21, 33, 0.96) 0%, rgba(9, 12, 19, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.13),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.8),
    0 6px 24px rgba(0, 0, 0, 0.6);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  user-select: none;
  flex-shrink: 0;
}

.brand-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-lockup:hover .brand-img {
  transform: scale(1.08) rotate(2deg);
}

.brand-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.95);
}

.brand-divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  text-transform: uppercase;
}

/* Smoked glass HUD status pills */
.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

.hud-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.hud-pill-dot.bg-emerald {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}
.hud-pill-dot.bg-cyan {
  background: #00e8ff;
  box-shadow: 0 0 8px rgba(0, 232, 255, 0.7);
}
.hud-pill-dot.pulse {
  animation: pulseLed 2s infinite ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* 4-STUDIO HYBRID SWITCHER (TABS ON WIDESCREEN, SELECT ON COMPACT)    */
/* ═══════════════════════════════════════════════════════════════════ */

/* 1. Desktop Segmented Tabs (≥1240px) */
.hud-tabs-desktop {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(4, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 2px 3px;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 255, 255, 0.05);
}

.hud-tabs-desktop .hud-nav-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}

.hud-tabs-desktop .hud-nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.hud-tabs-desktop .hud-nav-tab.active {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 12px rgba(16, 185, 129, 0.15);
}

.hud-tabs-desktop .tab-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* 2. Compact Premium Studios Select Dropdown (<1240px) */
.hud-studios-dropdown-wrap {
  display: none;
  position: relative;
}

.btn-studios-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #131724 0%, #0a0e17 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.8),
    0 4px 12px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

.btn-studios-select:hover {
  background: linear-gradient(180deg, #1a2233 0%, #0e1420 100%);
  border-color: rgba(16, 185, 129, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
    0 6px 18px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(16, 185, 129, 0.18);
}

.btn-studios-select.open {
  border-color: rgba(16, 185, 129, 0.6);
  background: linear-gradient(180deg, #101926 0%, #080d14 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 16px rgba(16, 185, 129, 0.2);
}

.studio-select-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.studio-select-arrow {
  color: #94a3b8;
  transition: transform 0.2s ease, color 0.15s ease;
}

.btn-studios-select.open .studio-select-arrow {
  transform: rotate(180deg);
  color: #34d399;
}

/* Glassmorphic Cyber Dropdown Menu */
.studios-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 295px;
  max-width: min(340px, calc(100vw - 24px));
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(13, 18, 30, 0.98) 0%, rgba(6, 9, 16, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.92),
    0 0 30px rgba(0, 232, 255, 0.08),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(24px);
  padding: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: studioDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.studios-dropdown-menu.hidden {
  display: none !important;
}

@keyframes studioDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header {
  padding: 6px 8px 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 2px;
}

.dropdown-header-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.dropdown-item.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.dropdown-item-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.dropdown-item-icon-box.cyan-glow {
  background: rgba(0, 232, 255, 0.12);
  border-color: rgba(0, 232, 255, 0.3);
}
.dropdown-item-icon-box.emerald-glow {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}
.dropdown-item-icon-box.violet-glow {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.35);
}
.dropdown-item-icon-box.amber-glow {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
}
.dropdown-item-icon-box.slate-glow {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
}

.dropdown-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.dropdown-item-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.dropdown-item.active .dropdown-item-title {
  color: #34d399;
}

.dropdown-item-desc {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ext-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}

.active-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.dropdown-item-home {
  margin-top: 2px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dropdown-item-home:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(148, 163, 184, 0.35);
  transform: translateX(2px);
}

.dropdown-item-home:hover .dropdown-item-title {
  color: #ffffff;
}

.dropdown-item-home:hover .ext-arrow {
  color: #00e8ff;
}

/* Nav Camera Button Group */
.nav-cam-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.nav-cam-group .cam-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-cam-group .cam-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}
.nav-cam-group .cam-btn.active {
  background: rgba(0, 232, 255, 0.15);
  color: #00e8ff;
  border-color: rgba(0, 232, 255, 0.3);
}

/* Machined Segmented Dock Trays (1:1 with studio.html) */
.nav-segmented-dock {
  display: inline-flex;
  align-items: center;
  background: rgba(4, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 2px 3px;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 255, 255, 0.05);
  gap: 2px;
}
.nav-segmented-dock .dock-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.nav-segmented-dock .dock-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
.nav-segmented-dock .dock-btn:active {
  background: rgba(0, 0, 0, 0.4);
  transform: translateY(1px) scale(0.98);
}
.nav-segmented-dock .dock-btn svg {
  color: #94a3b8;
  transition: color 0.15s ease;
}
.nav-segmented-dock .dock-btn:hover svg {
  color: #f1f5f9;
}
.nav-segmented-dock .dock-btn.btn-math-trigger svg {
  color: #00e8ff;
}
.nav-segmented-dock .dock-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
}

/* Recessed KBD badges (1:1 with studio.html) */
kbd, .kbd-badge {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-left: 2px;
  line-height: 1.2;
}

/* Tactile Matte 3D buttons (1:1 with studio.html) */
.btn-matte-tactile {
  background: linear-gradient(180deg, #161e2c 0%, #0c1018 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.45);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.btn-matte-tactile:hover {
  background: linear-gradient(180deg, #1e283b 0%, #121724 100%);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.55);
}
.btn-matte-tactile:active {
  background: linear-gradient(180deg, #090d14 0%, #111520 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.75);
  transform: translateY(1px) scale(0.99);
}

/* Ultra-Premium Matte 3D Tactile Run Button (1:1 with studio.html) */
.btn-premium-run {
  background: linear-gradient(180deg, #1f283c 0%, #101522 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.6),
    0 2px 7px rgba(0, 0, 0, 0.55);
  color: #f1f5f9;
  border-radius: 8px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.btn-premium-run:hover {
  background: linear-gradient(180deg, #27344e 0%, #151b2a 100%);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.6),
    0 4px 14px rgba(0, 0, 0, 0.65),
    0 0 14px rgba(56, 189, 248, 0.18);
  color: #ffffff;
}
.btn-premium-run:active {
  background: linear-gradient(180deg, #0d111a 0%, #141926 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.75);
  transform: translateY(1px) scale(0.99);
}
.btn-run-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: pulseLed 1.5s infinite ease-in-out;
}
.btn-premium-run.paused .btn-run-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: none;
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  background: rgba(4, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.6);
}
.lang-switcher button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-switcher button:hover {
  color: #ffffff;
}
.lang-switcher button.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%);
  color: #00e8ff;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (max-width: 900px) {
  .hidden-sm {
    display: none !important;
  }
}

@keyframes pulseLed {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ───────────────────────────────────────────────────────────────── */
/* MAIN WORKSPACE LAYOUT                                             */
/* ───────────────────────────────────────────────────────────────── */
.robotics-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* ───────────────────────────────────────────────────────────────── */
/* LEFT ENVIRONMENT & PRESET TOOLBAR (Frosted Glass HUD)             */
/* ───────────────────────────────────────────────────────────────── */
.robotics-sidebar-left {
  width: 310px;
  min-width: 310px;
  max-width: 310px;
  background: linear-gradient(180deg, rgba(10, 14, 25, 0.88) 0%, rgba(6, 9, 16, 0.94) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 
    inset -1px 0 0 rgba(255, 255, 255, 0.04),
    12px 0 35px rgba(0, 0, 0, 0.5);
  transition: width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              min-width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              max-width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.25s ease,
              border-color 0.25s ease;
  will-change: width, min-width, max-width;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.robotics-sidebar-left.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  border-right-color: transparent !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.robotics-sidebar-left::-webkit-scrollbar {
  width: 4px;
}
.robotics-sidebar-left::-webkit-scrollbar-track {
  background: transparent;
}
.robotics-sidebar-left::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.robotics-sidebar-left::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 232, 255, 0.4);
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

.title-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.title-led.cyan {
  background: #00e8ff;
  box-shadow: 0 0 8px rgba(0, 232, 255, 0.85);
}
.title-led.purple {
  background: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.85);
}

.sidebar-count-chip {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.06em;
}

.env-card-list {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Glassmorphic Environment Card Tile (Tactile Aerospace Grade) */
.env-card-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(12, 17, 30, 0.75) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Vertical Active Status LED Bar */
.env-card-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3.5px;
  background: #00e8ff;
  box-shadow: 0 0 10px #00e8ff, 0 0 20px #00e8ff;
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.env-card-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(18, 25, 42, 0.85) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateX(3px) translateY(-1px);
  box-shadow: 
    0 10px 28px -4px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.env-card-btn.active {
  background: linear-gradient(135deg, rgba(0, 232, 255, 0.12) 0%, rgba(10, 16, 28, 0.95) 100%);
  border-color: rgba(0, 232, 255, 0.55);
  color: #fff;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(0, 232, 255, 0.14),
    inset 0 1px 0 rgba(0, 232, 255, 0.4);
}

.env-card-btn.active::before {
  opacity: 1;
  transform: scaleY(1);
}

/* Custom Glass Vector Icon Container */
.env-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.env-card-btn:hover .env-icon-box {
  transform: scale(1.1);
}

.env-icon-cyan {
  color: #00e8ff;
  background: rgba(0, 232, 255, 0.09);
  border-color: rgba(0, 232, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(0, 232, 255, 0.35), 0 0 16px rgba(0, 232, 255, 0.2);
}

.env-icon-amber {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: inset 0 1px 0 rgba(245, 158, 11, 0.35), 0 0 16px rgba(245, 158, 11, 0.2);
}

.env-icon-blue {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.09);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.35), 0 0 16px rgba(59, 130, 246, 0.2);
}

.env-icon-rose {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.09);
  border-color: rgba(244, 63, 94, 0.3);
  box-shadow: inset 0 1px 0 rgba(244, 63, 94, 0.35), 0 0 16px rgba(244, 63, 94, 0.2);
}

.env-icon-emerald {
  color: #34d399;
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.35), 0 0 16px rgba(16, 185, 129, 0.2);
}

.env-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.env-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.env-info-name {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.env-badge-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tag-cyan {
  background: rgba(0, 232, 255, 0.1);
  color: #00e8ff;
  border: 1px solid rgba(0, 232, 255, 0.28);
}

.tag-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.tag-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.tag-rose {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.28);
}

.tag-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.env-info-sub {
  font-size: 10.5px;
  color: #718096;
  font-family: var(--font-mono);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pose Presets Grid */
.preset-pose-grid {
  padding: 0 12px 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-pose-btn {
  position: relative;
  overflow: hidden;
  padding: 10px 11px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0%, rgba(13, 17, 30, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active LED bar on presets */
.preset-pose-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #c084fc;
  box-shadow: 0 0 10px #c084fc;
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.preset-pose-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(20, 26, 44, 0.8) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 
    0 8px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.preset-pose-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(24, 18, 38, 0.9) 100%);
  border-color: rgba(168, 85, 247, 0.6);
  color: #ffffff;
  box-shadow: 
    0 6px 20px rgba(168, 85, 247, 0.25),
    inset 0 1px 0 rgba(168, 85, 247, 0.4);
}

.preset-pose-btn.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.preset-pose-btn:active {
  transform: translateY(0);
}

.pose-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.preset-pose-btn:hover .pose-btn-icon {
  transform: scale(1.1);
}

.pose-btn-icon.text-cyan {
  color: #00e8ff;
  border-color: rgba(0, 232, 255, 0.25);
  background: rgba(0, 232, 255, 0.08);
}

.pose-btn-icon.text-purple {
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.08);
}

.pose-btn-icon.text-blue {
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.08);
}

.pose-btn-icon.text-amber {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
}

.pose-btn-icon.text-rose {
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.08);
}

.pose-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pose-btn-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.pose-btn-coord {
  font-size: 9.5px;
  color: #718096;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Full Span Singularity Test Tile */
.preset-pose-btn.pose-btn-warning {
  grid-column: span 2;
  border-color: rgba(244, 63, 94, 0.22);
}

.preset-pose-btn.pose-btn-warning:hover {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.badge-singularity {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
  letter-spacing: 0.04em;
}


/* ───────────────────────────────────────────────────────────────── */
/* CENTER 3D VIEWPORT & HUD OVERLAYS                                 */
/* ───────────────────────────────────────────────────────────────── */
.robotics-viewport-container {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
  background: #06080d;
  overflow: hidden;
}

.robotics-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  touch-action: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.robotics-canvas:active {
  cursor: grabbing;
}

/* Floating Sidebar Reopen Controls (Tactile Studio Style Flex Child) */
.floating-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  background: linear-gradient(180deg, #151b2a 0%, #0d121c 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
  pointer-events: auto;
}
.floating-sidebar-toggle:hover {
  background: linear-gradient(180deg, #1e273c 0%, #121826 100%);
  border-color: rgba(0, 232, 255, 0.5);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 232, 255, 0.25);
}
.floating-sidebar-toggle.hidden { display: none !important; }

/* ───────────────────────────────────────────────────────────────── */
/* VIEWPORT TOP HUD CONTAINER (GUARANTEED ZERO OVERLAP FLEXBOX)      */
/* ───────────────────────────────────────────────────────────────── */
.viewport-top-hud-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  z-index: 25;
  pointer-events: none;
}

.viewport-hud-left-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  pointer-events: auto;
}

.viewport-hud-right-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  pointer-events: auto;
}

/* Top-Left Control Strip (Camera Presets & Display Modes) */
.viewport-hud-top-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.viewport-hud-cam, .viewport-hud-modes {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(10, 14, 23, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 3px 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hud-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.cam-btn {
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cam-btn:hover, .cam-btn.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.cam-btn.active {
  color: var(--accent-cyan);
  box-shadow: inset 0 0 0 1px rgba(0, 232, 255, 0.3);
}

.mode-hud-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-hud-btn svg {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.mode-hud-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.mode-hud-btn:hover svg {
  color: #fff;
}

.mode-hud-btn.active {
  background: rgba(0, 232, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 232, 255, 0.35);
}

.mode-hud-btn.active svg {
  color: var(--accent-cyan);
}

/* Top-Right Telemetry HUD (Interactive Math Proof Affordance) */
.viewport-hud-telemetry {
  position: relative;
  background: rgba(10, 14, 25, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 5px 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  flex-shrink: 0;
  min-width: max-content;
  white-space: nowrap;
}

.hud-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  min-width: max-content;
  white-space: nowrap;
}

.hud-stat-item.interactive {
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.hud-stat-item.interactive:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 232, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 232, 255, 0.18);
}

.hud-stat-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  white-space: nowrap;
}

.hud-stat-hint {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: #00e8ff;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(0, 232, 255, 0.12);
  line-height: 1.1;
  opacity: 0.85;
  flex-shrink: 0;
}

.hud-stat-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-stat-label .label-full {
  display: inline;
}

.hud-stat-label .label-short {
  display: none;
}

.hud-stat-value {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.hud-stat-value.accent-cyan { color: var(--accent-cyan); }
.hud-stat-value.accent-purple { color: var(--accent-purple); }
.hud-stat-value.accent-emerald { color: var(--accent-emerald); }

/* Bottom Simulation Controller */
.viewport-hud-timeline {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 18px;
  backdrop-filter: blur(16px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ctrl-btn:hover {
  background: rgba(0, 232, 255, 0.15);
  border-color: rgba(0, 232, 255, 0.4);
  color: var(--accent-cyan);
}

.ctrl-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 232, 255, 0.5);
}

.timeline-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 65px;
}

.robotics-sidebar-right {
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              min-width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              max-width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.25s ease,
              border-color 0.25s ease;
  will-change: width, min-width, max-width;
  position: relative;
}

.robotics-sidebar-right.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  border-left-color: transparent !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.right-sidebar-header {
  padding: 10px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-tab-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.inspector-tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1 0 auto;
  padding: 11px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.inspector-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.inspector-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.inspector-pane.active {
  display: flex;
}

/* Form Controls & Widgets */
.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctrl-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.ctrl-value-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 232, 255, 0.6);
  border: 2px solid #fff;
}

/* Joint Gauge Bar */
.torque-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.torque-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-emerald);
  transition: width 0.1s ease, background-color 0.2s ease;
}

.torque-bar-fill.warning { background: var(--accent-amber); }
.torque-bar-fill.danger { background: var(--accent-rose); }

/* Buttons in Inspector */
.action-btn-primary {
  padding: 10px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 232, 255, 0.2), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(0, 232, 255, 0.4);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn-primary:hover {
  box-shadow: 0 0 20px rgba(0, 232, 255, 0.3);
  transform: translateY(-1px);
}

.action-btn-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Telemetry Canvas Sparkline */
.sparkline-canvas {
  width: 100%;
  height: 65px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

/* ───────────────────────────────────────────────────────────────── */
/* TRAJECTORY EDITOR & WAYPOINT SUITE                                */
/* ───────────────────────────────────────────────────────────────── */
.trajectory-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.preset-traj-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 500;
  justify-content: flex-start;
  text-align: left;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.preset-traj-btn:hover {
  background: rgba(0, 232, 255, 0.08);
  border-color: rgba(0, 232, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.preset-traj-btn svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.preset-traj-btn.active {
  background: rgba(0, 232, 255, 0.12);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 232, 255, 0.15);
}

.waypoint-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 2px;
}

.waypoint-list-container::-webkit-scrollbar {
  width: 4px;
}

.waypoint-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.waypoint-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 11px;
  transition: all 0.15s ease;
}

.waypoint-card:hover {
  border-color: rgba(0, 232, 255, 0.2);
  background: rgba(0, 232, 255, 0.04);
}

.waypoint-card.current {
  border-color: var(--accent-cyan);
  background: rgba(0, 232, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 232, 255, 0.12);
}

.waypoint-card.selected {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.waypoint-card.selected .waypoint-idx-badge {
  background: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.waypoint-idx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(0, 232, 255, 0.15);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
}

.waypoint-coords {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 10.5px;
  flex: 1;
}

.waypoint-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.waypoint-del-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

.waypoint-empty-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 18px 8px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}

.waypoint-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.waypoint-progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.waypoint-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.waypoint-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 8px rgba(0, 232, 255, 0.4);
  transition: width 0.08s linear;
}

.action-btn-primary.executing {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.3), rgba(245, 158, 11, 0.3));
  border-color: rgba(244, 63, 94, 0.6);
  color: #ff859b;
}

/* =================================================================== */
/* LIVE MATHEMATICAL INSPECTOR MODAL (ADIM 2)                          */
/* =================================================================== */
.math-inspector-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.math-inspector-backdrop.hidden {
  display: none !important;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.0); }
}

.math-inspector-dialog {
  width: 100%;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #111624 0%, #070a12 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 16px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 30px 80px rgba(0, 0, 0, 0.95) !important;
  overflow: hidden;
}

/* Modal Header */
.math-modal-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(8, 11, 20, 0.7);
  flex-wrap: wrap;
  position: relative;
}

.math-modal-title-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.math-modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 232, 255, 0.1);
  border: 1px solid rgba(0, 232, 255, 0.3);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 16px rgba(0, 232, 255, 0.2);
}

.math-modal-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
}

.math-modal-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.math-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.math-modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}

.math-tab-btn {
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.math-tab-btn:hover {
  color: #fff;
}

.math-tab-btn.active {
  background: rgba(0, 232, 255, 0.14);
  color: #00e8ff;
  box-shadow: inset 0 0 0 1px rgba(0, 232, 255, 0.35);
}

.math-tab-btn .tab-symbol {
  font-weight: 700;
  color: #c084fc;
}

.math-tab-btn.active .tab-symbol {
  color: #00e8ff;
}

.math-close-btn {
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

/* Modal Body */
.math-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.math-modal-pane {
  display: none;
}

.math-modal-pane.active {
  display: block;
}

.math-grid-2col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

@media (max-width: 820px) {
  .math-inspector-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    max-height: 92vh !important;
    border-radius: 14px !important;
    margin: auto !important;
  }

  .math-modal-header {
    padding: 12px 14px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    position: relative !important;
  }

  .math-modal-title-lockup {
    padding-right: 42px !important;
    gap: 10px !important;
  }

  .math-modal-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }

  .math-modal-title {
    font-size: 12px !important;
    line-height: 1.3 !important;
    letter-spacing: 0.06em !important;
  }

  .math-modal-subtitle {
    font-size: 9.5px !important;
    line-height: 1.3 !important;
  }

  #btn-close-math-inspector {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    z-index: 10 !important;
  }

  .math-modal-actions {
    width: 100% !important;
    display: flex !important;
  }

  .math-modal-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    display: flex !important;
    gap: 5px !important;
    padding: 3px !important;
    background: rgba(4, 7, 14, 0.7) !important;
    border-radius: 8px !important;
  }

  .math-modal-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .math-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 11px !important;
    font-size: 10.5px !important;
    line-height: 1 !important;
  }

  .math-grid-2col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .math-modal-body {
    padding: 12px 14px !important;
  }
}

.math-card {
  background: linear-gradient(180deg, rgba(19, 25, 40, 0.75) 0%, rgba(9, 13, 22, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.math-card-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.math-card-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.math-card-header h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.math-equation-block {
  background: #04060a;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85);
  overflow-x: auto;
}

.katex-eq {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #38bdf8;
  text-align: center;
}

.math-card-desc {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.math-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.math-stat-tile {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.math-stat-title {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.math-stat-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.math-stat-num.cyan { color: var(--accent-cyan); }
.math-stat-num.purple { color: var(--accent-purple); }
.math-stat-num.emerald { color: var(--accent-emerald); }

.math-stat-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  display: inline-block;
  letter-spacing: 0.05em;
  text-align: center;
}
.math-stat-badge.status-good {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.math-stat-badge.status-warn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

/* 3x3 Position Jacobian Matrix Grid */
.jacobian-matrix-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #04060a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.matrix-bracket-left, .matrix-bracket-right {
  font-family: var(--font-mono);
  font-size: 72px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 200;
  user-select: none;
}

.matrix-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.matrix-cell {
  background: rgba(16, 22, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #38bdf8;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease;
}

.matrix-cell:hover {
  border-color: rgba(0, 232, 255, 0.4);
  background: rgba(25, 35, 55, 0.95);
}

.matrix-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
}

/* Vector decomposition list */
.vector-decomp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 12px;
}

.vector-axis {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.vector-axis.axis-x { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.vector-axis.axis-y { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.vector-axis.axis-z { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }

.vector-formula {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.vector-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
}

.vector-positions-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 6px;
}

/* Math Tables */
.math-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
}

.math-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.math-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

/* Proof Checklist */
.proof-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proof-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.proof-check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  shrink: 0;
  margin-top: 2px;
}

.proof-check-item strong {
  color: #fff;
}

.proof-check-item p {
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Modal Footer */
.math-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 9, 16, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.math-footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.status-dot-emerald {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* MOBILE RESPONSIVE NAVIGATION & SLIDE-OVER DRAWER (1:1 STUDIO.HTML) */
/* ═══════════════════════════════════════════════════════════════════ */

/* Mobile Hamburger Toggle Button (Header) */
.btn-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Mobile Sidebar Backdrop (for left & right overlay drawers on mobile) */
.mobile-sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 13, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 35;
  transition: opacity 0.25s ease;
}
.mobile-sidebar-backdrop.hidden {
  display: none !important;
}

@media (min-width: 1025px) {
  .mobile-sidebar-backdrop {
    display: none !important;
  }
}

/* Mobile Nav Drawer Container */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-nav-drawer.hidden {
  display: none !important;
}

/* Backdrop Overlay */
.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInBackdrop 0.25s ease both;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Drawer Panel Sliding in from Right */
.mobile-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(88vw, 375px);
  background: linear-gradient(180deg, #0d121c 0%, #080b12 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  overflow-y: auto;
  z-index: 10;
  animation: slideDrawerRight 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

@keyframes slideDrawerRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Drawer Header */
.drawer-header {
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #0e121b;
  user-select: none;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-brand-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.drawer-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.18em;
  color: #ffffff;
}

.drawer-brand-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 232, 255, 0.12);
  border: 1px solid rgba(0, 232, 255, 0.25);
  color: #00e8ff;
  letter-spacing: 0.08em;
}

.drawer-close-btn {
  padding: 6px 8px;
}

/* Drawer Body */
.drawer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.section-tag {
  font-size: 9px;
  color: #00e8ff;
  background: rgba(0, 232, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Featured Top Action Card */
.drawer-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 27, 44, 0.8) 0%, rgba(12, 16, 28, 0.95) 100%);
  border: 1px solid rgba(0, 232, 255, 0.25);
  box-shadow: 0 4px 18px rgba(0, 232, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-card-btn:hover {
  border-color: rgba(0, 232, 255, 0.5);
  box-shadow: 0 6px 24px rgba(0, 232, 255, 0.16);
  transform: translateY(-1px);
}

.drawer-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-card-icon.math-icon {
  background: rgba(0, 232, 255, 0.12);
  border: 1px solid rgba(0, 232, 255, 0.3);
}

.drawer-card-info {
  display: flex;
  flex-direction: column;
}

.drawer-card-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
}

.drawer-card-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}

.drawer-arrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.2s ease, color 0.2s ease;
}

.drawer-card-btn:hover .drawer-arrow {
  color: #00e8ff;
  transform: translateX(2px);
}

/* Preset & Scenario Pill Items List */
.drawer-pills-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-pill-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  user-select: none;
}

.drawer-pill-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.drawer-pill-item.active {
  background: rgba(0, 232, 255, 0.08);
  border-color: rgba(0, 232, 255, 0.35);
  color: #00e8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 10px rgba(0, 232, 255, 0.12);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 9px;
  flex-shrink: 0;
}
.pill-dot.bg-cyan { background: #00e8ff; box-shadow: 0 0 6px #00e8ff; }
.pill-dot.bg-purple { background: #a855f7; box-shadow: 0 0 6px #a855f7; }
.pill-dot.bg-amber { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.pill-dot.bg-emerald { background: #10b981; box-shadow: 0 0 6px #10b981; }
.pill-dot.bg-rose { background: #f43f5e; box-shadow: 0 0 6px #f43f5e; }
.pill-dot.bg-blue { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }

.pill-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-check {
  font-size: 11px;
  font-weight: 700;
  color: #00e8ff;
  margin-left: 8px;
}

.pill-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  margin-left: 8px;
  letter-spacing: 0.05em;
}

/* Panels Grid */
.drawer-panels-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drawer-panel-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: all 0.18s ease;
}

.drawer-panel-box:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.panel-box-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.panel-box-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel-box-icon.cyan-box { background: rgba(0, 232, 255, 0.12); border: 1px solid rgba(0, 232, 255, 0.25); color: #00e8ff; }
.panel-box-icon.purple-box { background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(168, 85, 247, 0.25); color: #d8b4fe; }
.panel-box-icon.amber-box { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); color: #fbbf24; }
.panel-box-icon.indigo-box { background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.25); color: #818cf8; }
.panel-box-icon.slate-box { background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.panel-box-info {
  display: flex;
  flex-direction: column;
}

.panel-box-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #f1f5f9;
}

.panel-box-desc {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
}

/* Drawer Footer */
.drawer-footer-section {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-core-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
}

/* Premium Studios Select Dropdown is the primary desktop switcher in robotics.html to protect navbar space */
.hud-tabs-desktop {
  display: none !important;
}

.hud-studios-dropdown-wrap {
  display: inline-flex !important;
}

/* On ultra-wide monitors (>= 1650px) where ample space exists, optional full segmented tabs with horizontal scroll safety */
@media (min-width: 1650px) {
  .hud-tabs-desktop {
    display: flex !important;
    max-width: 380px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .hud-studios-dropdown-wrap {
    display: none !important;
  }
}

@media (max-width: 1239px) {

  /* Hide verbose text labels in mode buttons, keeping clean intuitive icons */
  .mode-btn-text {
    display: none !important;
  }
  .mode-hud-btn {
    padding: 5px 8px !important;
  }
  .viewport-hud-top-bar {
    gap: 6px !important;
    padding: 3px 6px !important;
  }
  .viewport-hud-telemetry {
    gap: 8px !important;
    padding: 4px 10px !important;
  }
  .hud-stat-item {
    padding: 2px 5px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* RESPONSIVE LAYOUT RULES FOR TABLET & MOBILE (< 1024px)              */
/* ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Show hamburger button */
  .btn-mobile-menu {
    display: inline-flex !important;
  }

  /* Header adjustments: hide non-essential items */
  .top-hud-navbar {
    padding: 0 10px !important;
    height: 52px !important;
  }

  .top-hud-navbar .hud-pill-link,
  .top-hud-navbar .hud-pill-core,
  .top-hud-navbar #btn-toggle-left-sidebar,
  .top-hud-navbar .nav-segmented-dock,
  .top-hud-navbar #btn-open-math-inspector,
  .top-hud-navbar #btn-toggle-right-sidebar,
  .top-hud-navbar #btn-top-reset,
  .top-hud-navbar a[href="docs.html"],
  .top-hud-navbar .lang-switcher {
    display: none !important;
  }

  /* Compact Brand Title on small phone screens */
  .brand-title {
    font-size: 13px !important;
    letter-spacing: 0.12em !important;
  }

  .brand-sub {
    font-size: 10px !important;
  }

  /* Sidebars slide-over drawer behavior on mobile */
  .robotics-sidebar-left {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(88vw, 330px) !important;
    min-width: 0 !important;
    max-width: 330px !important;
    z-index: 40 !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }

  .robotics-sidebar-left.collapsed {
    transform: translateX(-105%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .robotics-sidebar-right {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    width: min(88vw, 330px) !important;
    min-width: 0 !important;
    max-width: 330px !important;
    z-index: 40 !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }

  .robotics-sidebar-right.collapsed {
    transform: translateX(105%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Hide floating open buttons on mobile/tablet — drawer controls sidebars cleanly */
  .floating-sidebar-toggle {
    display: none !important;
  }

  /* Viewport top HUD container on mobile */
  .viewport-top-hud-container {
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    pointer-events: none !important;
  }

  .viewport-hud-left-cluster,
  .viewport-hud-right-cluster {
    width: 100% !important;
    pointer-events: auto !important;
  }

  /* Camera & modes strip: smooth horizontal scrolling without wrap */
  .viewport-hud-top-bar {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    display: flex !important;
    gap: 6px !important;
    padding-bottom: 2px !important;
  }
  .viewport-hud-top-bar::-webkit-scrollbar {
    display: none !important;
  }

  .viewport-hud-cam, .viewport-hud-modes {
    flex-shrink: 0 !important;
  }

  /* Telemetry bar on mobile: balanced 4-column grid fitting 100% of the viewport width */
  .viewport-hud-telemetry {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    white-space: nowrap !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 6px !important;
    border-radius: 9px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(10, 14, 25, 0.94) !important;
  }

  .hud-stat-item {
    flex-shrink: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 2px 2px !important;
    text-align: center !important;
    align-items: center !important;
  }

  .hud-stat-label-row {
    width: 100% !important;
    justify-content: center !important;
    gap: 2px !important;
  }

  .hud-stat-label {
    font-size: 8px !important;
    letter-spacing: 0.02em !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .hud-stat-label .label-full {
    display: none !important;
  }

  .hud-stat-label .label-short {
    display: inline !important;
  }

  .hud-stat-hint {
    display: none !important;
  }

  .hud-stat-value {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
}

/* Extra compact adjustments on phones (< 640px) */
@media (max-width: 640px) {
  .brand-divider,
  .brand-sub,
  .top-hud-navbar .hud-pill,
  .hud-studios-dropdown-wrap {
    display: none !important;
  }

  .brand-title {
    font-size: 12px !important;
    letter-spacing: 0.1em !important;
  }

  .btn-premium-run {
    padding: 5px 9px !important;
    font-size: 10.5px !important;
    gap: 5px !important;
  }

  .btn-mobile-menu {
    padding: 6px 9px !important;
  }

  /* In mode buttons on small phones, hide text label to keep strip under 230px */
  .mode-btn-text {
    display: none !important;
  }
  .mode-hud-btn {
    padding: 4px 6px !important;
  }
}

/* ───────────────────────────────────────────────────────────────── */
/* ROBOTICS UTILITIES & EXTRACTED CLASSES                            */
/* ───────────────────────────────────────────────────────────────── */
.text-cyan-bold { color: #00e8ff; font-weight: 600; }
.text-cyan { color: #00e8ff; }
.text-purple { color: #c084fc; }
.text-emerald { color: #10b981; }
.text-secondary-slate { color: #94a3b8; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--font-mono); }

.flex-center-gap6 { display: flex; align-items: center; gap: 6px; }
.flex-between-center { display: flex; align-items: center; justify-content: space-between; }
.flex-between-mt8 { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.flex-between-mb4 { display: flex; justify-content: space-between; margin-bottom: 4px; }
.flex-gap8-mt6 { display: flex; gap: 8px; margin-top: 6px; }
.flex-gap8-mt8 { display: flex; gap: 8px; margin-top: 8px; }

.btn-tactile-compact { padding: 3px 6px; border-radius: 6px; }
.btn-math-inspector-shortcut { padding: 3px 7px; font-size: 9.5px; color: #00e8ff; }
.btn-flex-center { flex: 1; justify-content: center; }
.btn-full-mt8 { margin-top: 8px; width: 100%; }
.btn-full-mt6 { margin-top: 6px; width: 100%; justify-content: center; }

.sidebar-header-mt18 { margin-top: 18px; }
.pose-btn-content { text-align: left; flex: 1; }
.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }

.traj-chk-label { font-size: 12px; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.chk-accent-cyan { accent-color: var(--accent-cyan); cursor: pointer; }
.stat-mono-muted { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.desc-muted-sm { font-size: 11px; color: var(--text-muted); line-height: 1.45; margin-top: 4px; }
.desc-muted { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.ctrl-label-sm { font-size: 10px; color: var(--text-muted); }

.task-mission-log-box {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.5);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.6;
}

.sweep-results-log-box {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  line-height: 1.6;
}

.panel-box-icon.emerald-box {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
}

