/* ==========================================================================
   Visor de Archivos 3DS (.3DS) - Estilos Canónicos y Sistema Visual
   ========================================================================== */

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.16);
  --accent-cyan: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  --bg-app: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-header: #19243d;
  --bg-card-sub: #1e293b;
  --bg-input: #0f172a;
  --border-color: #24314d;
  --border-color-focus: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #cbd5e1;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-header: #f1f5f9;
  --bg-card-sub: #e2e8f0;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-color-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #334155;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* Migas de pan */
.tool-breadcrumbs {
  margin-bottom: 16px;
}

.tool-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tool-breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--text-dim);
}

.tool-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.tool-breadcrumbs a:hover {
  color: var(--primary-color);
}

.tool-breadcrumbs li[aria-current="page"] {
  color: var(--text-main);
  font-weight: 600;
}

/* Barra de acciones superior */
.tool-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.action-bar-left,
.action-bar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sample-models-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
}

.upload-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Regla canónica para select */
.custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 40px;
  padding: 0 32px 0 12px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.88rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-select:focus {
  outline: none;
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.custom-range {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* Botones de acción */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

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

.btn-secondary:hover {
  background: var(--border-color);
  border-color: var(--primary-color);
}

.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-card-sub);
  color: var(--primary-color);
}

.btn-danger {
  background: var(--danger-color);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--danger-color);
}

.btn-link-action {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: color 0.15s;
}

.btn-link-action:hover {
  text-decoration: underline;
}

.btn-link-action.text-danger {
  color: var(--danger-color);
}

.w-100 {
  width: 100% !important;
}

/* Cuadrícula principal del visor */
.viewer-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

/* Tarjeta del Viewport 3D */
.viewport-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 10;
  min-height: 520px;
}

.viewport-3d-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
}

.canvas-wrapper {
  width: 100%;
  height: 100%;
}

.canvas-wrapper canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* Spinner de carga */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 40;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

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

/* Dropzone Overlay */
.dropzone-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 15, 25, 0.6);
  backdrop-filter: blur(2px);
  z-index: 20;
  transition: background-color 0.2s, opacity 0.2s;
}

.dropzone-overlay.drag-active {
  background: rgba(59, 130, 246, 0.25);
  backdrop-filter: blur(6px);
}

.dropzone-box {
  max-width: 480px;
  width: 100%;
  border: 2px dashed rgba(59, 130, 246, 0.6);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  background: rgba(19, 27, 46, 0.85);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-lg);
}

.dropzone-overlay.drag-active .dropzone-box {
  transform: scale(1.02);
  border-color: var(--primary-color);
  background: rgba(19, 27, 46, 0.95);
}

.dropzone-icon {
  color: var(--primary-color);
  margin-bottom: 16px;
  display: inline-flex;
}

.dropzone-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.dropzone-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dropzone-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.badge-item {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--bg-card-sub);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Elementos HUD sobre el canvas */
.hud-top-left {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}

.hud-badge {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.hud-top-right {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.hud-btn-group {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}

.hud-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.hud-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.hud-btn.active {
  color: #ffffff;
  background: var(--primary-color);
}

/* Indicador central de herramienta activa */
.hud-tool-status {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 9999px;
  z-index: 15;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

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

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

.btn-mini-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.btn-mini-close:hover {
  color: var(--danger-color);
}

/* Barra inferior del viewport */
.hud-bottom-bar {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
}

.hud-pill-group {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
  padding: 3px 8px 3px 12px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.hud-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hud-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
}

.hud-pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.hud-pill-btn.active {
  color: #ffffff;
  background: var(--primary-color);
}

/* Barra lateral / Inspector */
.sidebar-inspector {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 6px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

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

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: var(--bg-card);
}

.tab-pane {
  display: none;
  padding: 18px 16px;
  flex-direction: column;
  gap: 18px;
}

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

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.panel-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.panel-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Cuadrícula de datos */
.info-data-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  gap: 8px;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
}

.text-ellipsis {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ficha de dimensiones */
.dims-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dim-chip {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dim-axis {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.dim-chip strong {
  font-family: var(--font-mono);
  color: var(--text-main);
  font-size: 0.88rem;
}

.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }

/* Lista de mallas y árbol jerárquico */
.mesh-tree-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.mesh-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.82rem;
  transition: border-color 0.15s;
}

.mesh-item-row:hover {
  border-color: var(--primary-color);
}

.mesh-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mesh-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.mesh-poly-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.mesh-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-eye {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.btn-toggle-eye:hover {
  color: var(--primary-color);
}

.btn-toggle-eye.hidden {
  color: var(--danger-color);
}

.empty-state-text {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 16px 8px;
}

/* Materiales */
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.material-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.8rem;
}

.material-color-preview {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* Herramientas interactivas */
.tool-controls-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.ruler-results-box {
  background: var(--bg-card-sub);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ruler-distance-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-main);
}

.ruler-distance-display strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent-cyan);
}

/* Exportación */
.export-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.privacy-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.privacy-notice-box svg {
  color: var(--success-color);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Modales accesibles */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  animation: fadeIn 0.15s ease-out;
}

.app-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.15s ease-out;
}

.app-modal-card.modal-large {
  max-width: 640px;
}

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

.app-modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-modal-close:hover {
  color: var(--text-main);
}

.app-modal-body {
  padding: 20px;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.55;
  max-height: 70vh;
  overflow-y: auto;
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card-header);
  border-top: 1px solid var(--border-color);
}

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

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

/* Ficha técnica en modal */
.report-content-area table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 10px;
}

.report-content-area th,
.report-content-area td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.report-content-area th {
  color: var(--text-muted);
  font-weight: 600;
  width: 40%;
}

.report-content-area td {
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Acordeón FAQ en guía SEO */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-main);
  user-select: none;
}

.faq-item[open] .faq-question {
  border-bottom: 1px solid var(--border-color);
  color: var(--primary-color);
}

.faq-answer {
  padding: 16px 18px;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ==========================================================================
   Adaptabilidad Responsive (Reglas Móviles)
   ========================================================================== */

@media (max-width: 1024px) {
  .viewer-main-grid {
    grid-template-columns: 1fr;
  }

  .viewport-card {
    min-height: 440px;
  }
}

@media (max-width: 768px) {
  .tool-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar-left,
  .action-bar-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .sample-models-group {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

  .upload-buttons-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .btn-action {
    width: 100% !important;
    min-height: 40px;
  }

  .viewport-card {
    min-height: 380px;
    aspect-ratio: auto;
    height: 420px;
  }

  .viewport-3d-container {
    min-height: 380px;
  }

  .hud-top-right {
    top: 8px;
    right: 8px;
    gap: 4px;
  }

  .hud-btn-group {
    padding: 2px;
  }

  .hud-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .hud-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 6px;
  }

  .hud-pill-group {
    justify-content: center;
    width: 100%;
  }

  .hud-pill-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .inspector-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab-btn {
    padding: 10px 4px;
    font-size: 0.75rem;
  }

  .dropzone-box {
    padding: 24px 16px;
  }

  .dropzone-title {
    font-size: 1.05rem;
  }
}
