/* ============================================================
   ChapitaStudio - Estilos principales
   ============================================================ */

:root {
  --bg: #0f0f13;
  --bg2: #16161e;
  --bg3: #1e1e2a;
  --bg4: #252535;
  --border: #2e2e42;
  --accent: #6c63ff;
  --accent2: #8b83ff;
  --accent-hover: #5a52dd;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #e8e8f0;
  --text2: #9898b0;
  --text3: #5a5a7a;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --card-bg: #1a1a26;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow: hidden;  /* Sin scroll en la página: todo el scroll va dentro de los paneles */
}

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 0.5px;
}
.nav-icon { font-size: 22px; }
.nav-version {
  font-size: 11px;
  background: var(--bg4);
  color: var(--text2);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 400;
}
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ── Auth header slot ── */
.auth-header-slot { display: flex; align-items: center; gap: 6px; }
.auth-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}
.auth-btn:hover { background: rgba(255,255,255,0.12); }
.auth-login  { color: var(--accent2); border-color: var(--accent); }
.auth-sync   { padding: 6px 10px; font-size: 14px; }
.auth-logout { padding: 6px 10px; font-size: 14px; color: var(--danger); }
.auth-user-info {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.auth-user-name { font-size: 12px; color: var(--text2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.auth-avatar-icon { font-size: 18px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg4); border-color: var(--accent); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1da84e; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c73c3c; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn-group-v { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.btn-group-v .btn { width: 100%; justify-content: center; }

/* ===== PANELS ===== */
.panel {
  padding: 2px 4px;
  min-height: calc(100vh - 56px);
}
.panel.hidden { display: none !important; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.panel-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* ===== DESIGNS GRID ===== */
.designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.design-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.design-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.2);
}
.design-card-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 40px;
}
.design-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.design-card-info { padding: 12px; }
.design-card-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-card-meta { font-size: 11px; color: var(--text2); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.empty-icon { font-size: 60px; margin-bottom: 16px; }

/* ===== EDITOR LAYOUT ===== */
.editor-layout {
  display: grid;
  grid-template-columns: 300px 1fr 6px 360px;
  gap: 0;
  height: calc(100vh - 76px);
  overflow: hidden;  /* Necesario para contener el resizer */
  align-items: stretch;
}

.col-controls {
  overflow-y: auto;
  overflow-x: hidden;
  /* En grid, el elemento ya ocupa toda la altura de la fila por defecto (align-self: stretch) */
  padding: 8px 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  min-height: 0;  /* Necesario para que overflow-y funcione en flexbox/grid */
}
.col-controls::-webkit-scrollbar { width: 4px; }
.col-controls::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.col-center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 0 8px 8px;
}

/* ── Divisor arrastrable ── */
.col-resizer {
  width: 8px;
  cursor: col-resize;
  background: var(--border);
  transition: background 0.15s;
  z-index: 10;
  flex-shrink: 0;
  align-self: stretch;
}
.col-resizer:hover,
.col-resizer.dragging {
  background: var(--accent);
}

.col-3d {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 8px 8px 0;
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.accordion-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.accordion-header:hover { background: var(--bg4); }
.accordion-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s;
  color: var(--text2);
}
.accordion-header.collapsed .accordion-arrow { transform: rotate(-90deg); }
.accordion-header.collapsed + .card-body { display: none; }
.card-body { padding: 7px; }

/* ===== PLANILLA CARD: scroll interno con botones siempre visibles ===== */
#card-sheet {
  /* El card puede crecer hasta ocupar el espacio disponible,
     pero no más: los slots hacen scroll internamente */
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 520px;   /* límite razonable; ajustable */
}
#card-sheet .card-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
#card-sheet .multi-design-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 6px;
}
#card-sheet .multi-design-section::-webkit-scrollbar { width: 4px; }
#card-sheet .multi-design-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
#card-sheet hr.divider {
  flex-shrink: 0;
  margin: 6px 0;
}
#card-sheet .btn-group-v {
  flex-shrink: 0;
  padding-bottom: 7px;
}

.badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 400;
}
.badge.hidden { display: none; }

/* ===== UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg3);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,0.08);
}
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area p { color: var(--text2); font-size: 13px; }
.upload-area small { color: var(--text3); font-size: 11px; }

/* ===== FILTERS ===== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
h4 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }

.filter-row {
  margin-bottom: 14px;
}
.filter-row label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
}
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.color-picker-row input[type="color"] {
  width: 40px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  padding: 2px;
}
.color-picker-row input[type="range"] { flex: 1; }
.color-picker-row span { font-size: 12px; color: var(--text2); min-width: 28px; }
.filter-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.slider-row span:first-child { min-width: 70px; color: var(--text2); }
.slider-row span:last-child { min-width: 32px; color: var(--text2); text-align: right; }
.slider-row input[type="range"] { flex: 1; }

.effects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.effects-grid .btn { justify-content: center; }

/* ===== RANGE INPUTS ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg4);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

/* ===== TEXT INPUTS ===== */
.input-text {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.input-text:focus { border-color: var(--accent); }

.design-name-row label { display: block; margin-bottom: 6px; color: var(--text2); font-size: 12px; }

/* ===== TABS ===== */
.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
}
.tab-btn:not(.active):hover { background: var(--bg4); color: var(--text); }

.tab-content { flex: 1; overflow: hidden; }
.tab-content.hidden { display: none; }

/* ===== PALETA DE COLORES DOMINANTES ===== */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  min-height: 28px;
  align-items: center;
}
.palette-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.palette-swatch:hover { transform: scale(1.25); border-color: #fff; }
.palette-swatch.selected { border-color: var(--accent); transform: scale(1.2); }
.palette-hint { font-size: 11px; color: var(--text3); }

/* ===== CANVAS 2D (fondo tablero ajedrez = transparente) ===== */
.canvas-wrapper-2d {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100% - 20px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
#canvas-2d {
  cursor: grab;
  /* Sin border-radius aquí porque el canvas muestra área hasta 36mm */
  box-shadow: 0 0 0 2px var(--border);
  /* fondo tipo tablero de ajedrez para mostrar transparencia */
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #fff;
  max-width: 96%;
  max-height: 96%;
}
#canvas-2d:active { cursor: grabbing; }
.canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text3);
  background: rgba(0,0,0,0.5);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ===== SHEET CANVAS ===== */
.sheet-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  padding: 16px;
}
#canvas-sheet {
  background: #fff;
  box-shadow: var(--shadow);
  max-width: 100%;
}

/* ===== 3D VIEW ===== */
.view-3d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent2);
}
.view-3d-controls { display: flex; gap: 6px; }

#canvas-3d-wrapper {
  flex: 1;
  background: radial-gradient(ellipse at center, #1a1a35 0%, #0a0a12 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 300px;
}
#canvas-3d {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,18,0.85);
  z-index: 10;
}
.loading-overlay p { margin-top: 12px; color: var(--text2); font-size: 13px; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.view-3d-hint {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  margin-top: 6px;
}

/* ===== MULTI-DESIGN SLOTS ===== */
.section-subtitle { font-size: 12px; color: var(--text2); margin-bottom: 10px; }
.design-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.design-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.design-slot-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg4);
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.design-slot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.design-slot-count {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.design-slot-count label { font-size: 11px; color: var(--text2); white-space: nowrap; }
.design-slot-count input {
  width: 50px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 6px;
  font-size: 12px;
  outline: none;
}
.design-slot-total { font-size: 11px; color: var(--text3); }
.design-slot-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}

/* ===== SAVE STATUS ===== */
.save-status {
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
}
.save-status.success { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.save-status.error { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.save-status.hidden { display: none; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-preview-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.modal-thumbnail {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px rgba(108,99,255,0.3);
  background: var(--bg3);
  flex-shrink: 0;
}
.modal-sheet-img {
  flex: 1;
  min-width: 160px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg3);
}
/* Colección de chapitas dentro del modal */
.modal-collection {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.modal-collection-title {
  font-size: 12px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  font-weight: 600;
}
.modal-collection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.modal-chapita-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 72px;
}
.modal-chapita-thumb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg4);
  border: 2px solid var(--border);
}
.modal-chapita-count {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== BADGE TYPE SELECTOR (flotante sobre canvas 2D) ===== */
.badge-type-overlay {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  background: rgba(20,20,35,0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px 10px;
  white-space: nowrap;
}
.badge-type-btn {
  padding: 5px 11px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.7);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: border-color .15s, background .15s, color .15s;
}
.badge-type-btn:hover {
  border-color: var(--accent);
  color: #fff;
}
.badge-type-btn.active {
  border-color: var(--accent);
  background: rgba(108,99,255,.4);
  color: #fff;
}
.badge-type-info {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-left: 4px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  z-index: 2000;
  box-shadow: var(--shadow);
  animation: slide-up 0.3s ease;
  max-width: 320px;
}
.toast.hidden { display: none; }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.info { border-color: var(--accent); color: var(--accent2); }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== ALERTA CENTRAL (límite de chapitas) ===== */
.limit-alert-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.18s ease;
}
.limit-alert {
  background: var(--bg2);
  border: 1.5px solid var(--danger);
  border-radius: 14px;
  padding: 32px 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(239,68,68,0.3);
  animation: pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.limit-alert-icon { font-size: 44px; margin-bottom: 12px; }
.limit-alert h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 10px;
}
.limit-alert p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 20px;
}
.limit-alert .btn { min-width: 120px; justify-content: center; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in  { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

/* ===== SCROLLBAR GENERAL ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== RESPONSIVO ===== */
@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: 260px 1fr 300px;
  }
}
@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    overflow: visible;
  }
  .col-controls { max-height: none; }
  #canvas-3d-wrapper { min-height: 260px; }
}
