:root {
  /* Industrial CAD Color Palette (Inspired by modern CAD tools & red accents) */
  --cad-red-primary: #d32f2f;
  --cad-red-dark: #9a0007;
  --cad-red-hover: #b71c1c;
  --cad-red-light: rgba(211, 47, 47, 0.12);
  --cad-red-border: rgba(211, 47, 47, 0.4);
  
  /* CAD Slate & Metallic Workspace Grays */
  --bg-dark: #0f1217;
  --bg-header: #151921;
  --bg-panel: #181d27;
  --bg-panel-hover: #212735;
  --bg-input: #1e2430;
  
  /* Accent & Status Colors */
  --accent-cyan: #38bdf8;
  --accent-blue: #29b6f6;
  --accent-emerald: #34d399;
  --accent-purple: #c084fc;
  --accent-amber: #fbbf24;
  
  /* Text & Typography */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Borders & Spacing */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: #2a3243;
  --border-active: var(--cad-red-primary);
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.4;
}

/* ==========================================================================
   Top App Header
   ========================================================================== */
.app-header {
  height: 48px;
  background: var(--bg-header);
  border-bottom: 2px solid var(--cad-red-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 10;
}

.home-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--accent-cyan);
  font: 700 11px var(--font-mono);
  text-decoration: none;
}

.home-logo {
  display: block;
  width: 28px;
  height: 28px;
  padding: 4px;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--text-main);
  text-decoration: underline;
  outline: none;
}

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

.cad-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.brand-subtitle {
  color: var(--cad-red-primary);
  font-weight: 600;
  font-size: 13px;
  margin-left: 4px;
  font-family: 'Inter', sans-serif;
}

.brand-badge {
  font-size: 10px;
  background: rgba(211, 47, 47, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(211, 47, 47, 0.4);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

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

.header-info-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px 4px 7px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-info-button:hover,
.header-info-button:focus-visible {
  color: var(--text-main);
  background: var(--bg-panel-hover);
  border-color: var(--cad-red-border);
  box-shadow: 0 0 0 2px var(--cad-red-light);
  outline: none;
}

.info-symbol {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 700 12px/1 Georgia, serif;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
}

.cad-status-tag {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border-medium);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ==========================================================================
   Main Workspace Layout (Full Height Fixed Split)
   ========================================================================== */
.workspace {
  display: flex;
  height: calc(100vh - 48px);
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   Left Sidebar Pane
   ========================================================================== */
.sidebar {
  width: 295px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

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

/* Custom Thin Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
  background: #343e52;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cad-red-primary);
}

/* Compact Drop Zone in Sidebar */
.compact-drop-zone {
  border: 2px dashed var(--border-medium);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.compact-drop-zone:hover, .compact-drop-zone.dragover {
  border-color: var(--cad-red-primary);
  background: var(--cad-red-light);
  box-shadow: 0 0 12px rgba(211, 47, 47, 0.2);
}

.drop-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-main);
}

.drop-sublabel {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Hidden native file input — triggered programmatically via click() */
.file-input {
  display: none;
}

/* Sidebar Section Box */
.sidebar-box {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px;
}

.sidebar-box-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

/* Dense Key-Value Metadata Table */
.kv-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}

.kv-table td {
  padding: 4px 0;
  vertical-align: top;
}

.kv-key {
  color: var(--text-muted);
  width: 42%;
}

.kv-val {
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Action Button System
   ========================================================================== */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(180deg, #d32f2f 0%, #9a0007 100%);
  color: #ffffff;
  border-color: #ef5350;
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #e53935 0%, #b71c1c 100%);
  box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
}

.btn-success {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  border-color: #4ade80;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

.btn-success:hover {
  background: linear-gradient(180deg, #22c55e 0%, #166534 100%);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.4);
}

.btn-secondary {
  background: var(--bg-header);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-panel-hover);
  border-color: #434e63;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-full {
  width: 100%;
}

/* ==========================================================================
   Sidebar Navigation Menu
   ========================================================================== */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border-left-color: rgba(211, 47, 47, 0.4);
}

.nav-btn.active {
  color: #ffffff;
  background: var(--cad-red-light);
  border-color: var(--cad-red-border);
  border-left: 3px solid var(--cad-red-primary);
  font-weight: 600;
}

.nav-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.nav-btn.active .nav-badge {
  background: rgba(211, 47, 47, 0.3);
  color: #ffffff;
}

/* ==========================================================================
   Right Main Details Panel & Viewport Area
   ========================================================================== */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
}

.main-top-bar {
  height: 48px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.main-top-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  scroll-behavior: smooth;
}

/* Inspector Sections */
.inspector-section {
  margin-bottom: 28px;
  scroll-margin-top: 14px;
}

.inspector-section:last-child {
  margin-bottom: 60px;
}

.section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--cad-red-primary);
}

/* Cards & Tables */
.panel-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.dense-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.dense-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--cad-red-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.dense-table-wrapper {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

table.dense-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

table.dense-table th, table.dense-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-medium);
}

table.dense-table th {
  background: var(--bg-header);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table.dense-table tr:last-child td {
  border-bottom: none;
}

table.dense-table tr:hover td {
  background: var(--bg-input);
}

code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
}

/* Feature Tree Items */
.tree-row {
  font-size: 12px;
  padding: 5px 10px;
  border-left: 3px solid var(--cad-red-primary);
  background: var(--bg-input);
  margin-bottom: 4px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.tree-row:hover {
  background: var(--bg-panel-hover);
}

.type-tag {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(211, 47, 47, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(211, 47, 47, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* ==========================================================================
   CAD Viewport Preview Area
   ========================================================================== */
#preview-area {
  background: radial-gradient(circle, #222b3a 0%, #0d1117 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

#preview-area::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

#preview-area img {
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

/* Utilities */
.hidden {
  display: none !important;
}

.flex-1 {
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 12px;
  background: var(--bg-panel);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Information Dialog
   ========================================================================== */
.info-dialog {
  width: min(460px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--cad-red-border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--text-main);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), 0 0 28px rgba(211, 47, 47, 0.16);
  overflow: hidden;
}

.info-dialog::backdrop {
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.info-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-medium);
  background: linear-gradient(135deg, rgba(211, 47, 47, 0.12), transparent 55%);
}

.info-dialog h2 {
  font: 700 16px/1.25 var(--font-mono);
  color: var(--text-main);
}

.info-dialog-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.info-dialog-version {
  padding: 2px 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
  color: var(--text-muted);
  font: 600 10px/1 var(--font-mono);
}

.dialog-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: 400 24px/1 Arial, sans-serif;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.dialog-close-button:hover,
.dialog-close-button:focus-visible {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  outline: none;
}

.info-dialog-body {
  padding: 16px 18px 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.info-dialog-body p {
  color: var(--text-main);
  line-height: 1.6;
}

.info-dialog-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding-left: 18px;
}

.info-dialog-list li::marker {
  color: var(--cad-red-primary);
}

.info-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px 16px;
}

.info-dialog-commit {
  margin-right: auto;
  overflow: hidden;
  color: var(--text-dim);
  font: 500 10px/1.3 var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Feature suppressed / config-specific badges */
.suppressed-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: 3px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  vertical-align: middle;
}

.config-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
  vertical-align: middle;
}

/* Dim out suppressed feature rows */
.tree-row--suppressed {
  opacity: 0.45;
}
.tree-row--suppressed:hover {
  opacity: 0.75;
}

/* ==========================================================================
   Full Screen Drag & Drop Overlay
   ========================================================================== */
.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 18, 23, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 3px dashed var(--cad-red-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

body.drag-active .drag-overlay {
  opacity: 1;
}

.drag-overlay-content {
  background: var(--bg-panel);
  border: 1px solid var(--cad-red-border);
  border-radius: var(--radius-lg);
  padding: 32px 48px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(211, 47, 47, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: scale(0.92);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.drag-active .drag-overlay-content {
  transform: scale(1);
}

.drag-overlay-icon {
  font-size: 42px;
  line-height: 1;
}

.drag-overlay-text {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.drag-overlay-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   3D WebGL Viewport Container & Canvas
   ========================================================================== */
.viewer-3d-box {
  width: 100%;
  height: 520px;
  min-height: 380px;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f4 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-3d-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 1;
}

#canvas-3d {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

#viewer-3d-empty {
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.viewport-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.viewer-overlay-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.view-preset-controls,
.projection-controls,
.display-controls,
.fit-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: rgba(15, 18, 23, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.view-preset-btn,
.projection-btn,
.display-toggle-btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.view-preset-btn {
  width: 29px;
  height: 29px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.view-preset-btn:hover,
.projection-btn:hover,
.display-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.35);
}

.view-preset-btn.active,
.projection-btn.active,
.display-toggle-btn.active {
  color: #ffffff;
  background: var(--cad-red-primary);
  border-color: #ef5350;
  box-shadow: 0 0 8px rgba(211, 47, 47, 0.35);
}

.projection-btn {
  min-width: 64px;
  padding: 5px 8px;
  font-size: 10px;
  letter-spacing: 0.2px;
}

.display-toggle-btn {
  padding: 5px 8px;
  font-size: 10px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .viewer-3d-box {
    height: 360px;
  }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-header { height: auto; min-height: 48px; flex-wrap: wrap; gap: 8px 12px; padding: 9px 14px; }
  .brand { min-width: 0; }
  .workspace { height: auto; min-height: calc(100vh - 59px); overflow: visible; flex-direction: column; }
  .sidebar { width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--border-medium); overflow: visible; }
  .sidebar-scroll-content { max-height: none; overflow: visible; }
  .main-panel { height: auto; min-height: 70vh; overflow: visible; }
  .main-scroll-content { overflow: visible; }
}
