/* AuraSculpt 3D - Luxury MedSpa Aesthetics & Responsive Layout */

:root {
  --bg-dark: #080B11;
  --bg-sidebar: #0D121D;
  --bg-card: rgba(19, 26, 41, 0.7);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(229, 184, 105, 0.3);
  
  --text-primary: #F0F4F8;
  --text-muted: #8E9BAE;
  --text-gold: #E5B869;
  --gold-glow: rgba(229, 184, 105, 0.25);
  
  --zone-lips: #F4A69A;
  --zone-malar: #E5B869;
  --zone-nasolabial: #6FCF97;
  --zone-jawline: #56CCF2;
  --zone-chin: #BB6BD9;
  --zone-teartrough: #F2994A;
  --zone-marionette: #EB5757;
  --zone-nose: #9B51E0;
  --zone-temple: #2D9CDB;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* App Core Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Top Navigation Bar */
.navbar {
  height: 64px;
  background: rgba(13, 18, 29, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

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

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, rgba(229, 184, 105, 0.2), rgba(244, 166, 154, 0.2));
  border: 1px solid var(--border-highlight);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

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

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.gold-text {
  color: var(--text-gold);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Model Status Badge */
.model-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
}

.poly-count {
  background: rgba(229, 184, 105, 0.15);
  color: var(--text-gold);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.text-success { color: #27AE60; }
.text-gold { color: var(--text-gold); }

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button Component Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-gold {
  background: linear-gradient(135deg, #E5B869, #C89947);
  color: #0A0D14;
  font-weight: 600;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-gold:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(229, 184, 105, 0.4);
}

.btn-primary {
  background: #3B82F6;
  color: white;
  font-weight: 600;
}

.btn-primary:hover {
  background: #2563EB;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-text-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
}
.btn-text-sm:hover { color: var(--text-gold); }

/* Workspace Container */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Left Sidebar */
.sidebar {
  width: 380px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.tab-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--text-gold);
  border-bottom-color: var(--text-gold);
  background: rgba(229, 184, 105, 0.05);
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.section-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Total Volume Metric Card */
.volume-summary-card {
  background: linear-gradient(135deg, rgba(229, 184, 105, 0.08), rgba(13, 18, 29, 0.6));
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.volume-metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-gold);
}

.syringe-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Accordion Control Cards */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
}

.control-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.zone-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-lips { background: rgba(244, 166, 154, 0.15); color: var(--zone-lips); }
.zone-malar { background: rgba(229, 184, 105, 0.15); color: var(--zone-malar); }
.zone-nasolabial { background: rgba(111, 207, 151, 0.15); color: var(--zone-nasolabial); }
.zone-jawline { background: rgba(86, 204, 242, 0.15); color: var(--zone-jawline); }
.zone-chin { background: rgba(187, 107, 217, 0.15); color: var(--zone-chin); }
.zone-teartrough { background: rgba(242, 153, 74, 0.15); color: var(--zone-teartrough); }
.zone-marionette { background: rgba(235, 87, 87, 0.15); color: var(--zone-marionette); }
.zone-nose { background: rgba(155, 81, 224, 0.15); color: var(--zone-nose); }
.zone-nose_tip, .zone-nose_dorsum { background: rgba(155, 81, 224, 0.15); color: var(--zone-nose); }
.zone-temple { background: rgba(45, 156, 219, 0.15); color: var(--zone-temple); }
.zone-cupid { background: rgba(244, 166, 154, 0.15); color: var(--zone-lips); }

.zone-volume-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Slider Controls */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.slider-val {
  color: var(--text-gold);
  font-weight: 600;
}

.filler-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.filler-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-gold);
  box-shadow: 0 0 8px var(--gold-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

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

.product-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.select-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  outline: none;
}

/* 3D Viewport Area */
.viewport-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #05070A;
}

.viewport-area {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Floating Collapsible Viewport Toolbar */
.floating-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(13, 18, 29, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease, transform 0.25s ease, padding 0.25s ease, border-radius 0.25s ease;
  max-width: 95%;
}

/* Auto-Hide / Dimming during 3D camera pan/orbit */
.floating-toolbar.dimmed {
  opacity: 0.18;
  pointer-events: none;
}

.floating-toolbar.dimmed:hover,
.viewport-area:hover .floating-toolbar.dimmed {
  opacity: 1.0;
  pointer-events: auto;
}

/* Collapsed State */
.floating-toolbar.collapsed {
  padding: 4px 12px;
  border-radius: 20px;
}

.floating-toolbar.collapsed .toolbar-expanded-content {
  display: none !important;
}

.floating-toolbar.collapsed .toolbar-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.summary-badge {
  font-size: 0.76rem;
  color: var(--text-primary);
  font-weight: 500;
}

.expand-toolbar-btn {
  background: rgba(229, 184, 105, 0.15);
  border: 1px solid var(--border-highlight);
  color: var(--text-gold);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.expand-toolbar-btn:hover {
  background: rgba(229, 184, 105, 0.3);
}

/* Expanded State */
.floating-toolbar.expanded {
  padding: 6px 14px;
  border-radius: 16px;
}

.floating-toolbar.expanded .toolbar-summary {
  display: none !important;
}

.floating-toolbar.expanded .toolbar-expanded-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.collapse-toolbar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.collapse-toolbar-btn:hover {
  background: rgba(229, 184, 105, 0.25);
  color: var(--text-gold);
}

.view-mode-selector {
  display: flex;
  gap: 6px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-btn.active {
  background: rgba(229, 184, 105, 0.15);
  color: var(--text-gold);
  border-color: var(--border-highlight);
  font-weight: 600;
}

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

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn.active {
  background: #E5B869;
  color: #000;
  font-weight: 600;
}

.camera-angles {
  display: flex;
  gap: 4px;
}

.angle-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
}

.angle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* 3D Canvas Container */
.canvas-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#webglCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* On-Canvas Floating Collapsible Node Footprint Controller Widget */
.canvas-node-widget {
  position: absolute;
  top: 55px;
  right: 16px;
  z-index: 40;
  background: rgba(13, 18, 29, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease, transform 0.25s ease, padding 0.25s ease, border-radius 0.25s ease;
  animation: fadeIn 0.2s ease;
}

/* Auto-Hide / Dimming during 3D camera pan/orbit or node dragging */
.canvas-node-widget.dimmed {
  opacity: 0.18;
  pointer-events: none;
}

.canvas-node-widget.dimmed:hover,
.viewport-area:hover .canvas-node-widget.dimmed {
  opacity: 1.0;
  pointer-events: auto;
}

/* Collapsed State */
.canvas-node-widget.collapsed {
  padding: 5px 12px;
  border-radius: 20px;
  width: auto;
}

.canvas-node-widget.collapsed .node-widget-expanded-content {
  display: none !important;
}

.canvas-node-widget.collapsed .node-widget-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.expand-node-widget-btn {
  background: rgba(229, 184, 105, 0.15);
  border: 1px solid var(--border-highlight);
  color: var(--text-gold);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.expand-node-widget-btn:hover {
  background: rgba(229, 184, 105, 0.3);
}

.close-widget-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
}

.close-widget-icon:hover {
  color: #eb5757;
}

/* Expanded State */
.canvas-node-widget.expanded {
  width: 280px;
  padding: 14px;
  border-radius: 12px;
}

.canvas-node-widget.expanded .node-widget-summary {
  display: none !important;
}

.canvas-node-widget.expanded .node-widget-expanded-content {
  display: block;
}

/* On-Canvas Floating Color Correction Widget */
.color-correction-widget {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 310px;
  background: rgba(13, 18, 29, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 12px;
  padding: 14px;
  z-index: 45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
  animation: fadeIn 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.color-preset-pills .preset-pill {
  flex: 1;
  min-width: 55px;
  padding: 5px 4px;
  font-size: 0.68rem;
}

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

.slider-header-sm {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.slider-header-sm span {
  font-weight: 700;
  color: var(--text-gold);
}

.color-widget-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

/* Floating Detachable On-Screen Rigging Control Widget */
.floating-rigging-widget {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(13, 18, 29, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 290px;
  max-width: 380px;
  user-select: none;
  animation: fadeIn 0.2s ease;
}

.floating-rig-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  cursor: grab;
}

.floating-rig-header:active {
  cursor: grabbing;
}

.floating-rig-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.floating-rig-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.floating-rig-body .btn-xs {
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
}

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

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.widget-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-text-xs {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
}
.btn-text-xs:hover { color: #fff; }

.widget-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-node-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-gold);
}

.widget-size-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

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

.size-step-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.size-step-btn:hover {
  background: var(--text-gold);
  color: #000;
}

.size-val-display {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-gold);
  min-width: 48px;
  text-align: right;
}

/* Expanded Quick Presets, Controls & Action Buttons */
.widget-quick-presets {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.preset-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 4px 2px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.preset-pill:hover, .preset-pill.active {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold, #d4af37);
  color: #fff;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.preset-pill small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 400;
}

.widget-control-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.widget-select {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.widget-select:hover, .widget-select:focus {
  border-color: var(--gold, #d4af37);
}

.widget-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.widget-actions-row .btn {
  flex: 1;
  font-size: 0.71rem;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.widget-actions-row .btn.active {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold, #d4af37);
  color: var(--gold, #d4af37);
  font-weight: 600;
}

.widget-tip {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  background: rgba(229, 184, 105, 0.2);
  color: var(--text-gold);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* 3D Split Curtain Bar */
.split-curtain-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: var(--text-gold);
  box-shadow: 0 0 12px var(--text-gold);
  cursor: ew-resize;
  z-index: 30;
  transform: translateX(-50%);
}

.curtain-badge {
  position: absolute;
  top: 36px; /* Moved into top dead space above the face */
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text-gold);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.curtain-label-left, .curtain-label-right {
  position: absolute;
  top: 36px; /* Moved into top dead space aligned with handle */
  transform: translateY(-50%);
  background: rgba(13, 18, 29, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.curtain-label-left { right: 42px; }
.curtain-label-right { left: 42px; }

/* Viewport Hint */
.viewport-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 18, 29, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.74rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 17, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 50;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(229, 184, 105, 0.2);
  border-top-color: var(--text-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Preset Cards */
.preset-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.preset-card.active {
  background: rgba(229, 184, 105, 0.1);
  border-color: var(--text-gold);
}

.preset-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-gold);
}

.preset-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.preset-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Modal Report */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-card {
  background: #0E1422;
  border: 1px solid var(--border-highlight);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #0B0F19;
}

.report-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.meta-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.meta-box label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.snapshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.snapshot-card {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.snapshot-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.snapshot-card span {
  font-size: 0.72rem;
  padding: 4px;
  color: var(--text-muted);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.report-table th, .report-table td {
  padding: 10px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.report-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-gold);
}

.notes-and-consent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.notes-box textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.8rem;
}

.sig-pad-box {
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  position: relative;
}

#clearSigBtn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #eee;
  color: #333;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Printable PDF styles */
@media print {
  body * { visibility: hidden; }
  #reportPrintableArea, #reportPrintableArea * { visibility: visible; }
  #reportPrintableArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    color: #000;
    background: #fff !important;
  }
}

/* Custom Luxury Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
  background: rgba(229, 184, 105, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(229, 184, 105, 0.6);
}

/* Custom Filler Range Sliders */
.filler-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  transition: background 0.2s;
}
.filler-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-gold);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(229, 184, 105, 0.5);
  transition: transform 0.15s ease, background 0.15s ease;
}
.filler-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: #FFF;
}


/* ---------- Lip design (LipDesigner.js) ---------- */
.lip-design { margin: 10px 0 12px; padding: 10px 10px 8px; border: 1px solid var(--border-color); border-radius: 10px; background: rgba(244, 166, 154, 0.04); }
.lip-design.disabled { opacity: 0.45; pointer-events: none; }
.lip-design-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.78rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.lip-design-head i { color: var(--zone-lips); margin-right: 4px; }
.lip-src { font-weight: 400; font-size: 0.7rem; color: var(--text-muted); text-align: right; }
.lip-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.lip-chip { flex: 1 1 auto; padding: 5px 8px; font-size: 0.72rem; border-radius: 999px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.lip-chip:hover { color: var(--text-primary); border-color: var(--border-highlight); }
.lip-chip.active { color: #1a1206; background: var(--zone-lips); border-color: var(--zone-lips); font-weight: 600; }
.lip-note { font-size: 0.68rem; color: var(--text-muted); margin: 6px 2px 0; line-height: 1.35; }
.lip-tools { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.lip-tool { padding: 5px 9px; font-size: 0.72rem; border-radius: 6px; border: 1px solid var(--border-color); background: rgba(255,255,255,0.03); color: var(--text-primary); cursor: pointer; }
.lip-tool:hover:not(:disabled) { border-color: var(--border-highlight); color: var(--text-gold); }
.lip-tool.active { border-color: var(--text-gold); color: var(--text-gold); background: var(--gold-glow); }
.lip-tool:disabled { opacity: 0.4; cursor: default; }
.lip-sym { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.lip-metrics { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.lip-metrics th { text-align: right; font-weight: 500; color: var(--text-muted); padding: 2px 4px; }
.lip-metrics td { padding: 3px 4px; text-align: right; color: var(--text-primary); border-top: 1px solid var(--border-color); white-space: nowrap; }
.lip-metrics td:first-child { text-align: left; color: var(--text-muted); }
.lip-metrics .delta { color: var(--text-gold); margin-left: 3px; }
.lip-metrics .muted { text-align: center; color: var(--text-muted); }

.paint-analysis { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-card); }
.paint-analysis-title { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); }
.paint-analysis-title i { color: var(--text-gold); margin-right: 4px; }
.paint-analysis-line { font-size: 0.75rem; color: var(--text-gold); margin-top: 4px; }
.paint-analysis-note { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }

/* ---------- Anatomy & Modeling Toolboxes (AnatomyModelingToolbox.js) ---------- */
.anatomy-toolbox-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.anatomy-toolbox-card:hover {
  border-color: rgba(229, 184, 105, 0.4);
}
.toolbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 6px;
}
.toolbox-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.toolbox-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}
.git-badge {
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-gold);
  background: rgba(229, 184, 105, 0.12);
  border: 1px solid rgba(229, 184, 105, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.git-badge:hover {
  background: rgba(229, 184, 105, 0.22);
  border-color: var(--text-gold);
  color: #fff;
}
.toolbox-desc {
  font-size: 0.70rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 0 8px 0;
}
.toolbox-toggle-row {
  margin-bottom: 8px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.metric-cell {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
}
.metric-cell.full-width {
  grid-column: span 2;
}
.metric-name {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.metric-val {
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ==========================================================================
   Floating Canvas Motor Testing HUD (Mobile & Viewport Live Controls)
   ========================================================================== */
.canvas-motor-hud {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(14, 20, 34, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 1px rgba(212, 175, 55, 0.35);
  z-index: 45;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.canvas-motor-hud.minimized {
  padding: 6px 12px;
  max-width: 320px;
}

.canvas-motor-hud.minimized .motor-pills-scroll,
.canvas-motor-hud.minimized .motor-slider-track {
  display: none !important;
}

.motor-hud-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.motor-hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.motor-hud-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.motor-hud-badge {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-gold);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.motor-hud-active-label {
  font-size: 0.80rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.motor-hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.motor-action-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.motor-action-btn:hover,
.motor-action-btn:active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
  color: #fff;
}

.motor-action-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.15));
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.motor-hud-toggle-btn {
  padding: 4px 6px;
  border-radius: 6px;
}

.motor-pills-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 1px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.motor-pills-scroll::-webkit-scrollbar {
  display: none;
}

.motor-pill {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.motor-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.motor-pill.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(184, 134, 11, 0.20));
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.motor-slider-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 2px;
}

.motor-val-display {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-gold);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.motor-val-display#hudMotorMinVal {
  min-width: 24px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
}

.motor-range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.25), rgba(255, 255, 255, 0.12));
  outline: none;
  transition: background 0.2s;
}

.motor-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 2px solid #fff;
  transition: transform 0.1s;
}

.motor-range-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

.motor-range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 2px solid #fff;
}


/* ==========================================================================
   Mobile Responsive Architecture & Touch Interfaces (@media max-width: 820px)
   ========================================================================== */

@media screen and (max-width: 820px) {
  body {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100vw;
  }

  .app-layout {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
  }

  /* 1. Header & Navigation Adjustments for Touch Screens */
  .navbar {
    height: 52px;
    padding: 0 10px;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .brand {
    gap: 8px;
  }

  .brand-title {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
  }

  .brand-subtitle {
    display: none !important;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1.0rem;
    border-radius: 8px;
  }

  .model-status-badge {
    padding: 4px 8px;
    font-size: 0.7rem;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .poly-count {
    display: none !important;
  }

  .nav-actions {
    gap: 4px;
  }

  .nav-actions .btn {
    padding: 5px 8px;
    font-size: 0.72rem;
    border-radius: 6px;
  }

  /* 2. Workspace Layout: 3D Canvas Top (55vh), Bottom Sheet Controls (45vh) */
  .workspace {
    flex-direction: column-reverse !important;
    height: calc(100vh - 52px);
    width: 100vw;
    overflow: hidden;
  }

  .viewport-area {
    flex: 1 1 55% !important;
    height: 55vh !important;
    min-height: 240px;
    width: 100vw !important;
    position: relative;
  }

  .sidebar {
    width: 100vw !important;
    height: 45vh !important;
    min-height: 200px;
    max-height: 45vh;
    border-right: none;
    border-top: 1px solid var(--border-highlight);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.8);
    z-index: 50;
    background: #0B0E17;
  }

  .tab-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0E1422;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .tab-btn {
    flex: 1 0 auto;
    padding: 10px 10px;
    font-size: 0.76rem;
    gap: 6px;
    white-space: nowrap;
  }

  .tab-content {
    padding: 10px;
    gap: 10px;
  }

  /* 3. Touch Friendly Sliders & Hit Areas */
  .filler-slider {
    height: 10px;
    border-radius: 5px;
  }

  .filler-slider::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
  }

  .filler-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
  }

  .btn, .preset-pill, .size-step-btn, .mode-btn, .tool-btn, .lip-chip, .lip-tool {
    min-height: 38px;
    touch-action: manipulation;
  }

  /* 4. Top Floating Dock Toolbar Adjustments */
  .floating-toolbar {
    top: 6px;
    right: 50% !important;
    transform: translateX(50%) !important;
    width: calc(100% - 12px) !important;
    max-width: 96% !important;
    z-index: 60;
  }

  .floating-toolbar.collapsed {
    padding: 4px 10px;
  }

  .floating-toolbar.expanded {
    padding: 8px;
    max-height: 50vh;
    overflow-y: auto;
  }

  .floating-toolbar.expanded .toolbar-expanded-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .view-mode-selector, .camera-angles, .view-tools {
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
  }

  /* 5. Active Node Footprint Floating Panel on Mobile */
  .canvas-node-widget {
    top: 46px;
    right: 6px !important;
    left: auto !important;
    max-width: calc(100vw - 12px);
    z-index: 65;
  }

  .canvas-node-widget.collapsed {
    padding: 4px 10px;
    border-radius: 16px;
  }

  .canvas-node-widget.expanded {
    width: calc(100vw - 16px);
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
  }

  /* 6. Color Correction Panel on Mobile */
  .color-correction-widget {
    top: 46px;
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    max-width: calc(100vw - 12px);
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
    z-index: 65;
  }

  /* 7. Modal Cards on Mobile */
  .modal-card {
    max-width: 96vw !important;
    max-height: 85vh;
    margin: 8px;
  }

  .modal-body {
    padding: 12px;
    gap: 10px;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  /* 8. Toast Notifications on Mobile */
  #appToast {
    width: 90vw !important;
    text-align: center;
    bottom: 16px !important;
    font-size: 0.78rem !important;
  }
}

@media screen and (max-width: 480px) {
  .brand-title {
    font-size: 0.85rem;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  /* Compact header buttons on small mobile */
  .import-label-text, .report-btn-text {
    display: none !important;
  }

  #importGlbLabel, #treatmentReportBtn {
    padding: 5px 8px !important;
  }

  .viewport-area {
    height: 52vh !important;
  }

  .sidebar {
    height: 48vh !important;
    max-height: 48vh;
  }

  .volume-metric .metric-value {
    font-size: 1.25rem;
  }

  .viewport-hint {
    display: none !important;
  }

  .tab-btn {
    flex: 1 1 0 !important;
    padding: 9px 2px !important;
    font-size: 0.70rem !important;
    gap: 3px !important;
  }

  .canvas-motor-hud {
    bottom: 6px;
    left: 6px;
    right: 6px;
    padding: 6px 10px;
    border-radius: 12px;
  }

  .motor-hud-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
  }

  .motor-hud-active-label {
    font-size: 0.72rem;
    max-width: 100px;
  }

  .motor-action-btn span {
    display: none;
  }

  .motor-action-btn {
    padding: 4px 6px;
  }

  .motor-pill {
    padding: 4px 9px;
    font-size: 0.70rem;
  }
}
