@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #f8fafc;
  --bg-panel: rgba(255, 255, 255, 0.96);
  --bg-panel-solid: #ffffff;
  --border-color: rgba(2, 132, 199, 0.35);
  --border-light: #cbd5e1;
  --accent-cyan: #0284c7;
  --accent-blue: #1d4ed8;
  --accent-green: #15803d;
  --accent-red: #b91c1c;
  --accent-amber: #b45309;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-subtle: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Consolas, monospace;
  --glow-cyan: 0 0 10px rgba(2, 132, 199, 0.25);
  --glow-green: 0 0 10px rgba(21, 128, 61, 0.25);
  --glow-red: 0 0 10px rgba(185, 28, 28, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-dark);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
}

body.in-cockpit {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#app-cockpit {
  display: grid;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  grid-template-rows: 60px 1fr;
  grid-template-columns: 0px 1fr 400px;
  grid-template-areas:
    "top top top"
    "left center right";
}

/* --- COCKPIT TWO-MODE SYSTEM (LAUNCH LAB vs CODE STUDIO) --- */
#app-cockpit.mode-launch-lab {
  grid-template-rows: 60px 1fr;
  grid-template-columns: 1fr 400px;
  grid-template-areas:
    "top top"
    "center right";
}

#app-cockpit.mode-launch-lab #left-panel {
  display: none !important;
}

#app-cockpit.mode-launch-lab #launch-lab-display {
  display: block !important;
}

#app-cockpit.mode-launch-lab #code-studio-display {
  display: none !important;
}

#app-cockpit.mode-code-studio {
  grid-template-rows: 60px 1fr;
  grid-template-columns: 360px 1fr 400px;
  grid-template-areas:
    "top top top"
    "left center right";
}

#app-cockpit.mode-code-studio #left-panel {
  display: flex !important;
}

#app-cockpit.mode-code-studio #launch-lab-display {
  display: none !important;
}

#app-cockpit.mode-code-studio #code-studio-display {
  display: flex !important;
}


/* Glassmorphism utility */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 20px 0 rgba(15, 23, 42, 0.06);
  z-index: 10;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.glass-panel:hover {
  border-color: rgba(2, 132, 199, 0.35);
}

/* --- TOP BAR --- */
#app-cockpit header {
  grid-area: top;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  z-index: 20;
}

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

.logo-icon {
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-cyan);
  border-radius: 4px;
  position: relative;
  box-shadow: var(--glow-cyan);
  animation: pulse 2s infinite alternate;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: var(--accent-cyan);
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 5px rgba(2, 132, 199, 0.2); }
  100% { transform: scale(1.05); box-shadow: 0 0 15px rgba(2, 132, 199, 0.5); }
}

.logo h1 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  font-weight: 800;
  background: linear-gradient(90deg, #0284c7 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn:hover {
  background: #f8fafc;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Toggle Switches */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--border-light);
  padding-left: 15px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.toggle-item input {
  display: none;
}

.toggle-switch {
  width: 32px;
  height: 16px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  position: relative;
  transition: background 0.3s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #94a3b8;
  border-radius: 50%;
  transition: left 0.3s, background 0.3s;
}

.toggle-item input:checked + .toggle-switch {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.toggle-item input:checked + .toggle-switch::after {
  left: 18px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-item input:checked ~ span {
  color: var(--accent-cyan);
}


/* --- LEFT PANEL: JOINT CONTROLS --- */
#left-panel {
  grid-area: left;
  margin: 15px 0 15px 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-sans);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.panel-header-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header-icon {
  font-size: 1rem;
}

.scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.control-group {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  flex-shrink: 0; /* Prevent parent flex column from squishing the categories */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.group-title {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  font-weight: 700;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.group-title::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.control-group.collapsed .group-title::after {
  transform: rotate(-90deg);
}

.group-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.control-group.collapsed .group-content {
  max-height: 0;
  padding: 0;
  overflow: hidden;
  border-bottom-width: 0;
}

.joint-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.joint-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
}

.joint-name {
  color: #1e293b;
  font-family: var(--font-sans);
  font-weight: 600;
}

.joint-val {
  color: #0284c7;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.84rem;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.joint-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  border: none;
}

.joint-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 1px 3px rgba(2, 132, 199, 0.4);
  transition: transform 0.1s;
}

.joint-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.joint-slider:focus::-webkit-slider-thumb {
  background: #0284c7;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.joint-reset-btn {
  font-family: var(--font-sans);
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  line-height: 1;
}

.joint-reset-btn:hover {
  color: var(--accent-cyan);
}

.joint-reset-btn:hover {
  color: var(--accent-red);
}


/* --- CENTER VIEWPORT --- */
#viewport-container {
  grid-area: center;
  margin: 15px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  min-width: 0;
  min-height: 0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.viewport-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.status-badge {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px rgba(21, 128, 61, 0.4);
}

.status-dot.alert {
  background-color: var(--accent-red);
  box-shadow: 0 0 6px rgba(185, 28, 28, 0.4);
  animation: blink 0.5s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.viewport-tools {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
}


/* --- RIGHT PANEL: DIAGNOSTICS & TELEMETRY --- */
#right-panel {
  grid-area: right;
  margin: 15px 15px 15px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.telemetry-section {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0; /* Prevent stability matrix and chart from being squished */
}

.telemetry-section h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stability-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stab-item {
  display: flex;
  flex-direction: column;
}

.stab-label {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

.stab-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.stab-status {
  font-weight: 700;
}

.stab-status.stable {
  color: var(--accent-green);
}

.stab-status.unstable {
  color: var(--accent-red);
}

/* Telemetry Chart Canvas */
.chart-container {
  height: 120px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

#telemetry-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: #334155;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

/* Console Scripting Window */
.console-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important for flex child scrolling */
}

.console-controls {
  padding: 8px 15px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.console-editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.console-textarea {
  flex: 1;
  background: #ffffff;
  color: var(--text-main);
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.console-textarea:focus {
  background: #ffffff;
}

.console-log {
  height: 100px;
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  color: #1e293b;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  padding: 8px;
  overflow-y: auto;
}

.log-entry {
  margin-bottom: 4px;
  line-height: 1.4;
}

.log-entry.info { color: #334155; }
.log-entry.success { color: var(--accent-green); }
.log-entry.error { color: var(--accent-red); }
.log-entry.output { color: var(--accent-cyan); }


/* --- LAUNCH LAB MOTION MODE TOGGLE & SELECTORS --- */
.motion-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  height: 36px;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mode-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 11px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

.mode-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.05);
}

.mode-toggle-btn.active {
  background: #ffffff;
  color: var(--accent-cyan);
  border-color: var(--border-light);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.motion-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  flex-shrink: 0;
}

.motion-select {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: #0f172a;
  height: 36px;
  line-height: 34px;
  padding: 0 26px 0 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  max-width: 225px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.motion-select:hover,
.motion-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.motion-select optgroup {
  background: #f8fafc;
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 4px;
}

.motion-select option {
  background: #ffffff;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.84rem;
  padding: 6px 10px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--accent-cyan);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Utility to override visibility */
.hidden {
  display: none !important;
}

/* Joint Chart custom styling */
.chart-tooltip {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--accent-cyan);
  padding: 4px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  color: var(--text-main);
}

/* --- SYSTEM BADGES & BUTTON EXTENSIONS --- */
.system-version {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.btn-accent {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

.btn-accent:hover {
  background: #0369a1 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

.btn-success {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
}

.btn-success:hover {
  background: #15803d !important;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3) !important;
}

.btn-xs {
  padding: 2px 8px !important;
  font-size: 0.7rem !important;
}

.btn-outline {
  background: transparent !important;
  border-color: var(--border-light) !important;
  color: var(--text-muted) !important;
}

.btn-outline:hover {
  border-color: var(--text-main) !important;
  color: var(--text-main) !important;
  background: #f8fafc !important;
}

/* --- USER AUTHENTICATION SECTION --- */
.user-auth-section {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--border-light);
  padding-left: 15px;
}

.btn-google {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #4285F4;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.user-profile-badge a.btn {
  text-decoration: none;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  object-fit: cover;
  background: #e2e8f0;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storage-status {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.storage-status.cloud {
  color: var(--accent-cyan);
}

.storage-status.local {
  color: var(--accent-amber);
}

/* ======================================================== */
/* COCKPIT TWO-MODE ARCHITECTURE & CONTROLS                 */
/* ======================================================== */

/* Mode Switcher in Header */
.cockpit-mode-switcher {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  gap: 4px;
}

.mode-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.mode-tab-btn.active {
  color: var(--accent-cyan);
  background: #ffffff;
  border-color: var(--border-light);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.mode-tab-btn#btn-mode-studio.active {
  background: #ffffff;
  border-color: var(--border-light);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  color: var(--accent-amber);
}

/* Mode Display Panels in #viewport-container */
.mode-display-panel {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Active Routine Badge in Viewport HUD */
.active-routine-badge {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  pointer-events: auto;
}

.routine-label {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 600;
}

.routine-title-text {
  color: var(--accent-cyan);
  font-weight: 700;
  font-family: var(--font-mono);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Launch Lab Floating Control Deck (Requirement 5) */
.launch-lab-control-deck {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  z-index: 25;
  white-space: nowrap;
  max-width: calc(100% - 32px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.launch-lab-control-deck::-webkit-scrollbar {
  display: none;
}

.deck-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 36px;
}

.deck-divider {
  width: 1px;
  height: 22px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.deck-group-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-right: 2px;
  line-height: 1;
}

/* Consistent Toolbar Buttons */
.launch-lab-control-deck .deck-btn,
.launch-lab-control-deck .btn {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  font-family: var(--font-sans) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

#launch-run-btn {
  background: #15803d !important;
  border: 1px solid #15803d !important;
  color: #ffffff !important;
}

#launch-run-btn:hover {
  background: #166534 !important;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3) !important;
}

#launch-stop-btn {
  background: #fee2e2 !important;
  border: 1px solid #fca5a5 !important;
  color: #dc2626 !important;
}

#launch-stop-btn:hover {
  background: #fecaca !important;
}

#launch-reset-view-btn,
#launch-reset-pose-btn {
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-main) !important;
}

#launch-reset-view-btn:hover {
  background: #f8fafc !important;
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
}

#launch-reset-pose-btn:hover {
  background: #f8fafc !important;
  border-color: var(--accent-amber) !important;
  color: var(--accent-amber) !important;
}

#launch-snapshot-btn {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
  font-weight: 700 !important;
}

#launch-snapshot-btn:hover {
  background: #fef3c7 !important;
}

.deck-status-pill {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--border-light);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
  line-height: 1;
}

.deck-status-pill.status-running {
  background: rgba(22, 163, 74, 0.12);
  color: var(--accent-green);
  border-color: rgba(22, 163, 74, 0.3);
  animation: pulse 1s infinite alternate;
}

/* Camera preset buttons: styled as a cohesive segmented group */
.camera-preset-buttons {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  height: 36px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.camera-preset-btn {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 0.8rem !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  border-radius: 4px !important;
  cursor: pointer;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  letter-spacing: 0.5px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  border-radius: 4px !important;
  cursor: pointer;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1 !important;
}

.camera-preset-btn:hover {
  color: var(--text-main) !important;
  background: rgba(15, 23, 42, 0.05) !important;
}

.camera-preset-btn.active {
  background: #ffffff !important;
  color: var(--accent-cyan) !important;
  border-color: var(--border-light) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  font-weight: 700 !important;
}

/* Deck Toggles */
.deck-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.deck-toggle-group .toggle-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  margin: 0;
  user-select: none;
}

.deck-toggle-group .toggle-item:hover {
  color: var(--text-main);
}

/* Robot Settings Toolbar */
.robot-settings-toolbar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}

/* Embedded Studio Container */
#code-studio-display {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
}

.studio-embedded-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-header {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
  gap: 15px;
  flex-shrink: 0;
}

.studio-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.studio-brand-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--accent-amber);
}

.studio-title-input {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 240px;
  outline: none;
  transition: border-color 0.2s;
}

.studio-title-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.studio-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.badge-cloud {
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(2, 132, 199, 0.25);
}

.badge-local {
  background: rgba(217, 119, 6, 0.1);
  color: var(--accent-amber);
  border-color: rgba(217, 119, 6, 0.25);
}

.badge-unsaved {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-red);
  border-color: rgba(220, 38, 38, 0.25);
}

/* Studio Cloud Sync Compact Icon Button (Aligned with other header action buttons) */
.studio-sync-btn {
  position: relative;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.studio-sync-btn.badge-cloud {
  background: rgba(2, 132, 199, 0.08) !important;
  border: 1px solid rgba(2, 132, 199, 0.3) !important;
  color: var(--accent-cyan) !important;
}

.studio-sync-btn.badge-cloud:hover {
  background: rgba(2, 132, 199, 0.18) !important;
  border-color: rgba(2, 132, 199, 0.5) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

.studio-sync-btn.badge-local {
  background: rgba(217, 119, 6, 0.08) !important;
  border: 1px solid rgba(217, 119, 6, 0.3) !important;
  color: var(--accent-amber) !important;
}

.studio-sync-btn.badge-local:hover {
  background: rgba(217, 119, 6, 0.18) !important;
  border-color: rgba(217, 119, 6, 0.5) !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.studio-sync-btn.badge-unsaved {
  background: rgba(220, 38, 38, 0.08) !important;
  border: 1px solid rgba(220, 38, 38, 0.35) !important;
  color: var(--accent-red) !important;
}

.studio-sync-btn.badge-unsaved:hover {
  background: rgba(220, 38, 38, 0.18) !important;
  border-color: rgba(220, 38, 38, 0.55) !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.studio-sync-icon {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.studio-sync-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

.studio-sync-dot.dot-cloud {
  background-color: #0284c7;
  box-shadow: 0 0 5px rgba(2, 132, 199, 0.8);
}

.studio-sync-dot.dot-local {
  background-color: #d97706;
  box-shadow: 0 0 5px rgba(217, 119, 6, 0.8);
}

.studio-sync-dot.dot-unsaved {
  background-color: #dc2626;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.9);
  animation: studio-pulse-dot 1.4s infinite ease-in-out;
}

@keyframes studio-pulse-dot {
  0% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

.studio-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-header-actions .btn {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 14px !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  font-family: var(--font-sans) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}

/* Studio Body Layout */
.studio-body {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  overflow: hidden;
}

/* Studio Sidebar */
.studio-sidebar {
  border-right: 1px solid var(--border-light);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
}

.studio-tab-btn {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.studio-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.05);
}

.studio-search-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}

.studio-search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  outline: none;
}

.studio-search-input:focus {
  border-color: var(--accent-cyan);
}

.studio-tab-pane {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Script Cards */
.saved-scripts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.script-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.script-card:hover {
  border-color: var(--accent-cyan);
  background: #f8fafc;
  transform: translateY(-1px);
}

.script-card.active {
  border-color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.08);
}

.script-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.script-card-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.source-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.source-tag.cloud {
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-cyan);
}

.source-tag.local {
  background: rgba(217, 119, 6, 0.1);
  color: var(--accent-amber);
}

.script-card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.script-card-actions {
  display: flex;
  gap: 6px;
}

.btn-script-action {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.15s;
}

.btn-script-action:hover {
  background: #f8fafc;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-script-action.text-danger:hover {
  background: #fef2f2;
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Templates List */
.templates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.template-card:hover {
  border-color: var(--accent-amber);
  background: #f8fafc;
}

.template-card-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-amber);
  margin-bottom: 4px;
}

.template-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* API Docs list */
.api-docs-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.api-category-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.api-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.api-item:hover {
  border-color: var(--accent-cyan);
  background: #f8fafc;
  transform: translateX(2px);
}

.api-func-name {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 3px;
}

.api-func-desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 5px;
}

.api-func-snippet {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Studio Editor & Console Area */
.studio-editor-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-gutter-wrapper {
  flex: 1;
  display: flex;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.line-numbers {
  width: 52px;
  padding: 15px 10px 15px 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.6;
  color: #64748b;
  background: #f8fafc;
  border-right: 1px solid var(--border-light);
  user-select: none;
  overflow-y: hidden;
}

.studio-code-textarea {
  flex: 1;
  height: 100%;
  padding: 15px 18px;
  background: transparent;
  border: none;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.6;
  resize: none;
  outline: none;
  white-space: pre;
  tab-size: 2;
  overflow-y: auto;
}

/* Studio Console Drawer */
.studio-console-drawer {
  height: 180px;
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.studio-console-bar {
  height: 34px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.console-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.exec-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-idle {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
}

.status-running {
  background: rgba(22, 163, 74, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(22, 163, 74, 0.3);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.studio-terminal-log {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.empty-list-notice, .loading-scripts-notice {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 30px 10px;
  font-family: var(--font-mono);
}

/* ======================================================== */
/* FIREBASE CONFIGURATION MODAL                             */
/* ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.15);
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.input-dark {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  outline: none;
}

.input-dark:focus {
  border-color: var(--accent-cyan);
}

.modal-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-light);
  background: rgba(8, 10, 16, 0.5);
}

/* ========================================================================== */
/* STUDENT ROBOTICS LANDING PAGE & AUTHENTICATION STYLES                     */
/* ========================================================================== */

.landing-view {
  min-height: 100vh;
  width: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.05) 0%, transparent 60%),
              radial-gradient(circle at 90% 40%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
              var(--bg-dark);
  color: var(--text-main);
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- LANDING NAVIGATION --- */
.landing-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.landing-nav-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.landing-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #0284c7 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--accent-green);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: 6px 0;
}

.landing-nav-links a:hover {
  color: var(--accent-cyan);
}

.landing-nav-links a:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- GOOGLE SIGN IN BUTTONS --- */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #4285F4;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.25);
}

.btn-hero-google {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 14px 28px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15), 0 2px 6px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}

.btn-hero-google::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(2, 132, 199, 0.08), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.btn-hero-google:hover::before {
  left: 100%;
}

.btn-hero-google:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.25);
  transform: translateY(-2px);
}

.google-icon-wrapper {
  background: #ffffff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.hero-google-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.hero-google-text .primary {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-main);
}

.hero-google-text .secondary {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.hero-btn-arrow {
  font-size: 1.2rem;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
}

.btn-hero-google:hover .hero-btn-arrow {
  transform: translateX(4px);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.btn-hero-secondary:hover {
  background: #f8fafc;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

/* --- HERO SECTION --- */
.landing-hero {
  padding: 60px 0 90px;
  position: relative;
}

.landing-hero-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 6px 14px;
  border-radius: 50px;
  width: fit-content;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.badge-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.hero-title {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1px;
  color: #0f172a;
}

.gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #16a34a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.12rem;
  color: #475569;
  max-width: 620px;
  line-height: 1.65;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #64748b;
  font-family: var(--font-sans);
}

.hero-security-note .security-lock {
  color: var(--accent-amber);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.stat-card {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
  margin-top: 2px;
}

.stat-sub {
  font-size: 0.7rem;
  color: #64748b;
}

/* --- HERO VISUAL & HOLOGRAPHIC OVERLAYS --- */
.hero-visual-wrapper {
  position: relative;
}

.hero-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), 0 0 20px rgba(2, 132, 199, 0.08);
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transform: scale(1.02);
  transition: transform 0.5s ease;
}

.hero-frame:hover .hero-img {
  transform: scale(1.05);
}

.hero-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(2, 132, 199, 0.8), transparent);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.8);
  animation: scanline 4s linear infinite;
  pointer-events: none;
}

@keyframes scanline {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.hero-hud-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  pointer-events: none;
}

.hud-top-left {
  top: 20px;
  left: 20px;
}

.hud-bottom-right {
  bottom: 20px;
  right: 20px;
}

.hero-hud-card .hud-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 1px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

.hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.hud-dot.green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.hud-dot.cyan { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }

.hud-data {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #334155;
}

.hud-data .cyan { color: var(--accent-cyan); font-weight: bold; }
.hud-data .amber { color: var(--accent-amber); font-weight: bold; }
.hud-data .green { color: var(--accent-green); font-weight: bold; }

.hero-hud-badge-center {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* --- SECTION SHARED STYLES --- */
.landing-section {
  padding: 90px 0;
  border-top: 1px solid var(--border-light);
  position: relative;
}

.landing-section-alt {
  background: #f1f5f9;
}

.section-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 54px;
}

.section-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.section-subtitle {
  font-size: 1.05rem;
  color: #475569;
  margin-top: 14px;
  line-height: 1.6;
}

/* --- INTERACTIVE MINI-LAB --- */
.mini-lab-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.lab-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.lab-tab-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lab-tab-btn:hover {
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.3);
}

.lab-tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.lab-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.lab-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab 1: Stability Playground */
.stability-playground {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

.stability-visualizer {
  background: rgba(8, 10, 16, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.svg-stability-canvas {
  width: 100%;
  max-width: 380px;
  height: 240px;
}

.stability-info-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stability-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  width: fit-content;
}

.status-stable {
  background: rgba(57, 255, 20, 0.12);
  border: 1px solid rgba(57, 255, 20, 0.35);
  color: var(--accent-green);
}

.status-danger {
  background: rgba(255, 56, 56, 0.15);
  border: 1px solid rgba(255, 56, 56, 0.45);
  color: var(--accent-red);
  animation: shake 0.5s ease infinite alternate;
}

@keyframes shake {
  0% { transform: translateX(0); }
  50% { transform: translateX(-2px); }
  100% { transform: translateX(2px); }
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: #475569;
}

.lab-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #cbd5e1;
  border-radius: 3px;
  outline: none;
}

.lab-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
  transition: transform 0.1s;
}

.lab-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.explanation-card {
  background: #f1f5f9;
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 0.86rem;
  color: #475569;
}

/* Tab 2: Kinematics Inspector */
.kinematics-inspector {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.limb-selector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.limb-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: #475569;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.limb-btn:hover {
  color: var(--accent-cyan);
  border-color: rgba(2, 132, 199, 0.4);
}

.limb-btn.active {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.limb-dof-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}

.limb-btn.active .limb-dof-badge {
  background: rgba(2, 132, 199, 0.15);
  color: var(--accent-cyan);
}

.limb-detail-view {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.limb-joints-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.limb-joints-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid #e2e8f0;
}

.limb-joints-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

/* Tab 3: Gait Stepper */
.gait-phase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.phase-step-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.phase-step-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  transform: translateY(-2px);
}

.phase-step-card.active {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.15);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 6px 0 8px;
}

.step-desc {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.5;
}

/* Tab 4: Code Preview */
.code-preview-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.code-editor-mock {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.code-header-mock {
  background: #f8fafc;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  color: var(--text-muted);
}

.code-body-mock {
  padding: 16px;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

.code-keyword { color: #d946ef; }
.code-func { color: #6366f1; }
.code-param { color: #0284c7; }
.code-string { color: #059669; }
.code-num { color: #0284c7; }
.code-comment { color: #94a3b8; font-style: italic; }

.mini-terminal-preview {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terminal-title {
  color: var(--accent-cyan);
  font-size: 0.7rem;
  letter-spacing: 1px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.terminal-stream {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #475569;
  height: 200px;
  overflow-y: auto;
}

.stream-line.success { color: var(--accent-green); }
.stream-line.info { color: var(--accent-cyan); }
.stream-line.amber { color: var(--accent-amber); }

/* --- PILLARS / FEATURES GRID --- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.pillar-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.pillar-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), 0 0 20px rgba(2, 132, 199, 0.1);
}

.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-cyan);
}

.pillar-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.pillar-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f172a;
}

.pillar-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
}

/* --- CURRICULUM SECTION --- */
.curriculum-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.curriculum-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.curriculum-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.curriculum-item:hover {
  border-color: rgba(2, 132, 199, 0.4);
  background: #f8fafc;
}

.lab-badge-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: bold;
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(2, 132, 199, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.lab-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.lab-title-row h4 {
  font-size: 0.98rem;
  color: #0f172a;
}

.lab-difficulty {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}

.lab-difficulty.beginner { color: var(--accent-green); border: 1px solid rgba(22, 163, 74, 0.2); }
.lab-difficulty.intermediate { color: var(--accent-amber); border: 1px solid rgba(217, 119, 6, 0.2); }
.lab-difficulty.advanced { color: var(--accent-cyan); border: 1px solid rgba(2, 132, 199, 0.2); }

.lab-info p {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.5;
}

.curriculum-media-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(2, 132, 199, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.curriculum-img {
  width: 100%;
  height: auto;
  display: block;
}

.curriculum-overlay-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.95) 100%);
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.curriculum-overlay-caption h5 {
  color: #0f172a;
  font-size: 0.95rem;
}

.curriculum-overlay-caption p {
  font-size: 0.78rem;
  color: #475569;
}

/* --- TESTIMONIALS --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testimonial-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.testimonial-quote {
  font-size: 0.92rem;
  color: #334155;
  font-style: italic;
  line-height: 1.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}

.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.author-role {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* --- FAQ ACCORDION --- */
.faq-grid {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.faq-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.faq-toggle-icon {
  font-size: 1.2rem;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
}

.faq-answer {
  font-size: 0.9rem;
  color: #475569;
  margin-top: 12px;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

/* --- BOTTOM CTA BANNER --- */
.landing-cta-banner {
  padding: 90px 0;
  position: relative;
}

.cta-banner-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.08);
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0f172a;
}

.cta-subtitle {
  font-size: 1.1rem;
  color: #475569;
  max-width: 600px;
}

/* --- FOOTER (HORIZONTAL & CENTER ALIGNED) --- */
.landing-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 44px 0 36px;
  width: 100%;
  display: block;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 18px;
}

.footer-brand-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.footer-brand-row .landing-brand {
  margin: 0 !important;
}

.footer-links {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}

.footer-links a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-dot {
  color: #cbd5e1;
  font-size: 0.75rem;
  user-select: none;
}

.footer-separator {
  color: rgba(2, 132, 199, 0.4);
  font-size: 0.85rem;
  font-weight: 300;
  margin: 0 4px;
  user-select: none;
}

.footer-copyright-row {
  margin-top: 2px;
  width: 100%;
  text-align: center;
}

.footer-copy {
  font-size: 0.82rem;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.footer-sys-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  padding: 4px 12px;
  border-radius: 50px;
}

/* --- AUTH NOTIFICATION TOAST --- */
.auth-toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.auth-toast {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #0f172a;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.auth-toast.info { border-left: 4px solid var(--accent-cyan); }
.auth-toast.success { border-left: 4px solid var(--accent-green); }
.auth-toast.warning { border-left: 4px solid var(--accent-amber); }
.auth-toast.error { border-left: 4px solid var(--accent-red); }

/* --- COCKPIT BANNER: RETURN TO SIMULATION WHEN VIEWING LANDING AS AUTHENTICATED USER --- */
.cockpit-view-guide-bar {
  position: sticky;
  top: 70px;
  left: 0;
  width: 100%;
  background: rgba(2, 132, 199, 0.08);
  border-bottom: 1px solid var(--accent-cyan);
  padding: 8px 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
}

.cockpit-view-guide-bar .guide-notice {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1024px) {
  .landing-hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hero-visual-wrapper {
    max-width: 600px;
    margin: 0 auto;
  }

  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .curriculum-layout {
    grid-template-columns: 1fr;
  }

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

  .stability-playground {
    grid-template-columns: 1fr;
  }

  .code-preview-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .landing-nav-links {
    display: none;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gait-phase-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .kinematics-inspector {
    grid-template-columns: 1fr;
  }
}

/* ======================================================== */
/* ROBOT SETTINGS: TABS & DECORATOR STYLES                  */
/* ======================================================== */

.panel-viewport-toggles-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  gap: 8px;
}

.panel-toggles-label {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.5px;
}

.panel-toggles-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-viewport-toggles-bar .toggle-item {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
  user-select: none;
}

.panel-viewport-toggles-bar .toggle-item:hover {
  color: var(--text-main);
}

.right-panel-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.right-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #475569;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.right-tab-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.03);
}

.right-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: #ffffff;
  font-weight: 700;
}

.right-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.decor-panel-scroll {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
}

.decor-export-banner {
  margin-bottom: 14px;
}

.decor-export-banner .btn-block {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.decor-section {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.decor-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}

.decor-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(2, 132, 199, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

/* Saved Looks & Loadouts */
.decor-saved-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.save-loadout-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.loadout-name-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.loadout-name-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.2);
}

.saved-loadouts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.saved-loadouts-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  text-align: center;
  padding: 12px 8px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
}

.saved-loadout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.saved-loadout-card:hover {
  background: #f1f5f9;
  border-color: rgba(2, 132, 199, 0.3);
}

.saved-loadout-card.active {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
}

.loadout-swatch {
  display: flex;
  align-items: center;
  gap: 4px;
}

.loadout-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

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

.loadout-name {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loadout-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.loadout-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-loadout-apply {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: var(--accent-cyan);
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-loadout-apply:hover {
  background: var(--accent-cyan);
  color: #ffffff;
}

.btn-loadout-delete {
  background: transparent;
  border: none;
  color: #ef4444;
  opacity: 0.6;
  font-size: 0.72rem;
  padding: 3px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-loadout-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
}

/* Theme Presets Grid */
.theme-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.theme-preset-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.theme-preset-card:hover {
  background: #f1f5f9;
  border-color: rgba(2, 132, 199, 0.3);
  transform: translateY(-1px);
}

.theme-preset-card.active {
  border-color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.15);
}

.theme-swatches-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.theme-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Custom Color Pickers */
.custom-colors-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.color-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.color-picker-item label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input-wrapper input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid var(--border-light);
  width: 28px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

.color-val-hex {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-main);
  width: 62px;
  text-align: right;
}

/* Finish Buttons */
.finish-selector-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.finish-selector-group label {
  font-size: 0.76rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: #334155;
}

.finish-buttons-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.finish-btn {
  font-family: var(--font-sans) !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  padding: 6px 4px !important;
  text-align: center;
}

.finish-btn.active {
  background: var(--accent-cyan);
  color: #ffffff !important;
  border-color: var(--accent-cyan) !important;
  font-weight: 700 !important;
}

/* Accessories Grid */
.accessories-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.accessory-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

.accessory-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.accessory-card:hover {
  background: #f1f5f9;
  border-color: rgba(2, 132, 199, 0.3);
}

.accessory-card:has(input:checked) {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-cyan);
}

.accessory-icon {
  font-size: 1.15rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

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

.acc-name {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

.acc-desc {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  color: #475569;
}

.acc-toggle-indicator {
  width: 32px;
  height: 18px;
  background: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.acc-toggle-indicator::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}

.accessory-card:has(input:checked) .acc-toggle-indicator {
  background: var(--accent-cyan);
}

.accessory-card:has(input:checked) .acc-toggle-indicator::after {
  left: 16px;
  background: #ffffff;
}

/* Badge Selector */
.badge-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.badge-option-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 5px;
  padding: 6px 4px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-option-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.badge-option-btn.active {
  background: rgba(2, 132, 199, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ======================================================== */
/* SNAPSHOT MODAL STYLES                                    */
/* ======================================================== */

.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.2s ease;
}

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

.custom-modal-card {
  position: relative;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleInModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.custom-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
}

.snapshot-modal-card {
  max-width: 820px;
  width: 90vw;
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.snapshot-modal-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  padding: 18px 24px 24px;
}

@media (max-width: 768px) {
  .snapshot-modal-body {
    grid-template-columns: 1fr;
  }
}

.snapshot-preview-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.snapshot-preview-checkerboard {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #f8fafc;
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.snapshot-preview-checkerboard.mode-white-bg {
  background: #ffffff !important;
}

.snapshot-preview-checkerboard.mode-studio-bg {
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%) !important;
}

.snapshot-preview-checkerboard img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.08));
}

.snapshot-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
}

.snapshot-options-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-label {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.5px;
}

.option-button-group {
  display: flex;
  gap: 8px;
}

.option-btn {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.option-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: rgba(2, 132, 199, 0.3);
}

.option-btn.active {
  background: rgba(2, 132, 199, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
}

.snapshot-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.snapshot-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent-cyan);
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ======================================================== */
/* CONFIRMATION MODAL STYLES                                */
/* ======================================================== */

.confirm-modal-card {
  max-width: 460px;
  width: 90vw;
  background: #ffffff !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.15) !important;
  border-radius: 12px !important;
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.confirm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.confirm-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.confirm-modal-body {
  padding: 20px 24px 16px;
}

.confirm-message-text {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 14px 0;
  font-family: var(--font-sans);
}

.confirm-loadout-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
}

.confirm-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* Modal Specific Button Styles */
.btn-confirm-cancel {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.8px !important;
  padding: 8px 18px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.btn-confirm-cancel:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.btn-confirm-delete,
.btn-danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  color: #ef4444 !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px !important;
  padding: 8px 18px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1) !important;
}

.btn-confirm-delete:hover,
.btn-danger:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3) !important;
  transform: translateY(-1px);
}

.btn-confirm-delete:active,
.btn-danger:active {
  transform: translateY(0);
}

/* ======================================================== */
/* STUDENT ROBOTICS HELP & CODING COMMANDS MODAL            */
/* ======================================================== */

.student-help-modal-backdrop {
  z-index: 10005;
}

.student-help-card {
  max-width: 1080px;
  width: 95vw;
  max-height: 88vh;
  height: 88vh;
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15) !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

.student-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
  flex-shrink: 0;
  gap: 16px;
}

.student-help-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-header-icon {
  font-size: 1.6rem;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-help-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
  letter-spacing: 0.6px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-help-header .help-header-sub {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  letter-spacing: 0.8px;
}

.student-help-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-help-search-box {
  position: relative;
  width: 280px;
}

.student-help-search-box input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 7px 12px 7px 32px;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  outline: none;
  transition: all 0.2s ease;
}

.student-help-search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.25);
  background: #ffffff;
}

.student-help-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Modal Navigation Tabs */
.student-help-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 20px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  overflow-x: auto;
}

.student-help-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.student-help-tab-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.03);
}

.student-help-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: #ffffff;
}

/* Modal Body & Content Panes */
.student-help-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
  background: #f8fafc;
}

.help-pane {
  display: none;
  animation: fadeInModal 0.2s ease;
}

.help-pane.active {
  display: block;
}

/* Section Headings */
.help-section-intro {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 3px solid var(--accent-cyan);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.help-section-intro p {
  margin: 0;
  font-size: 0.85rem;
  color: #1e40af;
  line-height: 1.5;
}

.help-group-title {
  font-size: 0.95rem;
  color: #0f172a;
  letter-spacing: 0.6px;
  margin: 24px 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.help-group-title:first-child {
  margin-top: 0;
}

/* API Command Card Grid */
.help-api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .help-api-grid {
    grid-template-columns: 1fr;
  }
}

.help-api-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.help-api-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.08);
}

.help-api-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-api-func {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.help-api-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.help-api-tag.async {
  background: rgba(168, 85, 247, 0.15);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.help-api-tag.sync {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.help-api-tag.query {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.help-api-desc {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

/* Parameter mini-table */
.help-params-list {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: #1e293b;
  background: #f1f5f9;
  border-radius: 5px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent-cyan);
}

.help-param-row {
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
}

.help-param-row:last-child {
  margin-bottom: 0;
}

.help-param-name {
  color: #0284c7;
  font-weight: 700;
  min-width: 85px;
}

.help-param-type {
  color: #c2410c;
  font-weight: 600;
}

.help-param-detail {
  color: #334155;
  flex: 1;
}

/* Snippet box with copy action */
.help-snippet-box {
  position: relative;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
}

.help-snippet-code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.55;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
  display: block;
}

.help-snippet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.help-copy-btn,
.help-load-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-copy-btn:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.help-load-btn:hover {
  background: rgba(22, 163, 74, 0.08);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* Actuator Table & Cards */
.help-actuator-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.help-actuator-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.help-actuator-table th {
  background: #f1f5f9;
  color: #334155;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.help-actuator-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.help-actuator-table tr:hover td {
  background: rgba(2, 132, 199, 0.04);
}

.joint-id-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  display: inline-block;
  cursor: pointer;
  transition: all 0.2s ease;
}

.joint-id-badge:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.axis-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

.axis-badge.axis-x { background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.axis-badge.axis-y { background: rgba(168, 85, 247, 0.12); color: #9333ea; border: 1px solid rgba(168, 85, 247, 0.3); }
.axis-badge.axis-z { background: rgba(59, 130, 246, 0.12); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.3); }

/* Ready-to-Run Routines */
.help-routine-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
}

.help-routine-card:hover {
  border-color: rgba(2, 132, 199, 0.35);
}

.help-routine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

.help-routine-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-routine-desc {
  font-size: 0.85rem;
  color: #334155;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.help-code-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0 0 12px 0;
  max-height: 280px;
  overflow-y: auto;
}

/* Shortcuts & Controls Grid */
.help-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.help-shortcut-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.help-shortcut-keys {
  display: flex;
  align-items: center;
  gap: 6px;
}

.help-key-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 0 #cbd5e1;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.help-shortcut-action {
  font-size: 0.82rem;
  color: #334155;
  text-align: right;
}

/* Modal Footer */
.student-help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
  flex-shrink: 0;
  gap: 16px;
}

.help-footer-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #475569;
}

.help-footer-tip strong {
  color: var(--accent-cyan);
}

.help-footer-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Quick link in studio API tab */
.api-help-banner {
  padding: 12px;
  background: rgba(2, 132, 199, 0.06);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 6px;
  margin-bottom: 14px;
  text-align: center;
}
