/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- Design tokens (Vexels Designer DS) --- */
:root {
  --font-main: 'Poppins', sans-serif;
  --brand: #7c5cfc;
  --brand-hover: #6344e0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --gray-800: #1d1d1d;
  --gray-700: #696969;
  --gray-400: #bdbdbd;
  --gray-50: #f7f7f7;
  --gray-600: #8c8c8c;
  --gray-200: #e0e0e0;
  --gray-100: #f2f2f2;
  --gray-800-10: rgba(29, 29, 29, 0.10);
  --checker-a: rgba(29, 29, 29, 0.08);
  --checker-size: 16px;
  --muted: var(--gray-700);
  --border: var(--gray-800-10);
  --radius-full: 9999px;
  --radius-lg: 8px;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* --- Transparency preview background (checkerboard) --- */
.transparent-checkerboard {
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a)),
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a));
  background-size: var(--checker-size) var(--checker-size);
  background-position: 0 0, calc(var(--checker-size) / 2) calc(var(--checker-size) / 2);
}
.canvas-viewport.is-transparent-bg {
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a)),
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a));
  background-size: var(--checker-size) var(--checker-size);
  background-position: 0 0, calc(var(--checker-size) / 2) calc(var(--checker-size) / 2);
}

/* --- Transparent toggle (transparent background switch) --- */
.transparent-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.transparent-toggle-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-800);
  padding-left: 4px;
}

.transparent-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  user-select: none;
}

.transparent-switch input {
  display: none;
}

.transparent-switch-icon {
  display: block;
}

.cp-alpha-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cp-transparent-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cp-transparent-indicator svg {
  display: block;
}

.transparent-switch input:checked + .transparent-switch-icon {
  color: var(--brand);
}

.transparent-switch-thumb {
  transition: transform 0.18s ease;
  transform: translateX(0);
}

.transparent-switch input:checked + .transparent-switch-icon .transparent-switch-thumb {
  transform: translateX(16px);
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--bg);
}

/* --- Layout --- */
.app {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  position: relative;
}

/* --- Sidebar --- */
.sidebar {
  width: 340px;
  min-width: 340px;
  padding: 12px 14px;
  background: transparent;
  border-right: none;
  overflow: visible;
  z-index: 60; /* allow color picker popover to overlay right tool */
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-shell {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: visible;
}

.sidebar-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
}

/* Pattern / Templates: altura según contenido; scroll lo hace .sidebar-scroll */
#sidebarPanelPattern,
#sidebarPanelTemplates {
  flex: 0 0 auto;
}

/* Elements: misma tarjeta blanca que Templates (#sidebarPanelTemplates .section) */
#sidebarPanelElements.sidebar-panel--elements {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section.elements-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}

.section.elements-section .slot-search {
  flex-shrink: 0;
  margin-bottom: 10px;
}

.section.elements-section .elements-panel-scroll {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
}

/* Mismo grid que #searchModalResults (.search-modal-results) */
.elements-results-grid.search-modal-results {
  padding: 0;
  margin: 0;
}

.title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--card);
  border-radius: var(--radius-full);
  width: fit-content;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.10);
}

.title::after {
  content: "";
}

.title-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.title-logo-img {
  width: 30px;
  height: 30px;
  transform: translateY(1px) scale(0.86);
}

.title-text {
  font-size: 14px;
  font-weight: 500;
  color: #646464;
}

/* --- Edit toolbar (DS: slim vertical pill like Designer) --- */
.edit-toolbar {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 0;
  padding: 4px;
  background: var(--card);
  border: 1px solid rgba(29, 29, 29, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  box-sizing: border-box;
}

.edit-toolbar--vertical {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 54px;
  min-width: 54px;
  flex-shrink: 0;
  align-self: center;
  padding: 10px 6px;
  gap: 6px;
  border-radius: 9999px;
  background: #ffffff;
  background: var(--card);
  border: 1px solid var(--gray-800-10);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 6;
  overflow: visible;
}

.edit-toolbar-item {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--gray-700);
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.edit-toolbar--vertical .edit-toolbar-item {
  flex: 0 0 auto;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  color: var(--gray-600);
  position: relative;
  overflow: visible;
  text-transform: none;
}

/* Mismo estilo que .colors-tool-hover-pill (tool de colores a la derecha) */
.edit-toolbar-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--gray-900, #1d1d1d);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  line-height: 1;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 80;
}

.edit-toolbar--vertical .edit-toolbar-item:hover .edit-toolbar-tooltip,
.edit-toolbar--vertical .edit-toolbar-item:focus-visible .edit-toolbar-tooltip {
  opacity: 1;
  visibility: visible;
}

.edit-toolbar-item:hover {
  background: var(--gray-50);
  color: var(--gray-800);
}

.edit-toolbar--vertical .edit-toolbar-item:hover {
  background: transparent;
  color: var(--gray-800);
}

.edit-toolbar--vertical .edit-toolbar-item.is-active:hover {
  background: transparent;
}

.edit-toolbar-item.is-active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Rail vertical: activo sin fondo, solo icono más oscuro */
.edit-toolbar--vertical .edit-toolbar-item.is-active {
  background: transparent;
  color: var(--gray-800);
  box-shadow: none;
}

.edit-toolbar--vertical .edit-toolbar-item.is-active .edit-toolbar-icon {
  color: var(--gray-800);
}

.edit-toolbar--vertical .edit-toolbar-item.is-active:hover {
  background: transparent;
  color: var(--gray-800);
}

.edit-toolbar--vertical .edit-toolbar-item.is-active:hover .edit-toolbar-icon {
  color: var(--gray-800);
}

/* Solo el rail horizontal u otros usos legacy conservan el estilo brand */
.edit-toolbar:not(.edit-toolbar--vertical) .edit-toolbar-item.is-active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.edit-toolbar:not(.edit-toolbar--vertical) .edit-toolbar-item.is-active .edit-toolbar-icon {
  color: #ffffff;
}

.edit-toolbar-icon {
  flex-shrink: 0;
  color: currentColor;
  width: 18px;
  height: 18px;
  display: block;
}

.edit-toolbar--vertical .edit-toolbar-icon {
  width: 22px;
  height: 22px;
}

.sidebar-panel[hidden] {
  display: none !important;
}

.templates-save-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

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

.templates-empty {
  margin: 0;
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800-10);
}

.template-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
}

.template-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.3;
  word-break: break-word;
}

.template-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-card-load {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.template-card-load:hover {
  background: var(--brand-hover);
}

.template-card-delete {
  flex-shrink: 0;
  width: 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-800-10);
  border-radius: var(--radius-full);
  background: var(--card);
  cursor: pointer;
  color: var(--gray-800);
}

.template-card-delete:hover {
  background: var(--gray-50);
}

.elements-panel-scroll {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.elements-results-grid .search-modal-thumb-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.elements-status {
  flex-shrink: 0;
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600);
  min-height: 0;
}

.elements-status:empty {
  display: none;
}

.section {
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--gray-800-10);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.section.actions {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.add-image-slot-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 16px;
}

.add-image-slot-wrap[hidden] {
  display: none !important;
}

.add-image-slot-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.add-image-slot-btn:hover {
  filter: brightness(1.06);
}

.add-image-slot-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
}

.control {
  margin-bottom: 14px;
}

.control label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--gray-800);
  font-weight: 500;
  padding-left: 4px;
}

/* --- Palette swatches --- */
.swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.swatch input[type="color"] {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* --- Slider + number control (Figma DS: Slider & Porcentage atom) --- */
.control-slider .slider-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-slider .slider-wrap input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0;
  background: transparent; /* track se dibuja en runnable-track */
  border-radius: 9999px;
}

.control-slider .slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(
    to right,
    #1d1d1d 0%,
    #1d1d1d var(--p, 0%),
    rgba(29, 29, 29, 0.10) var(--p, 0%),
    rgba(29, 29, 29, 0.10) 100%
  );
  border-radius: 9999px;
}

.control-slider .slider-wrap input[type="range"]::-moz-range-track {
  height: 3px;
  background: linear-gradient(
    to right,
    #1d1d1d 0%,
    #1d1d1d var(--p, 0%),
    rgba(29, 29, 29, 0.10) var(--p, 0%),
    rgba(29, 29, 29, 0.10) 100%
  );
  border-radius: 9999px;
}

.control-slider .slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--gray-600);
  box-sizing: border-box;
  cursor: pointer;
  margin-top: -4.5px; /* centra el thumb sobre el track de 4px */
}

.control-slider .slider-wrap input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--gray-600);
  box-sizing: border-box;
  cursor: pointer;
}

.control-slider .slider-wrap .number-input-wrap {
  position: relative;
  width: 54px;
  height: 26px;
  flex-shrink: 0;
}

.control-slider .slider-wrap input[type="number"] {
  width: 100%;
  height: 26px;
  padding: 2px 14px 2px 7px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  border: 2px solid var(--gray-800-10);
  border-radius: 10px;
  background: var(--card);
  color: var(--gray-800);
  line-height: 1.2;
  text-align: center;
  box-sizing: border-box;
  -moz-appearance: textfield !important;
  appearance: textfield;
  -webkit-appearance: textfield;
  font-variant-numeric: tabular-nums;
  display: block;
  overflow: visible;
}

.control-slider .slider-wrap input[type="number"]:focus {
  outline: none;
  border-color: var(--brand);
}

.control-slider .slider-wrap input[type="number"]::-webkit-inner-spin-button,
.control-slider .slider-wrap input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none;
  margin: 0;
  display: none !important;
}

.control-slider .slider-wrap .num-spin {
  position: absolute;
  right: 2px;
  width: 16px;
  height: 9px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  cursor: default;
  line-height: 1;
}

.control-slider .slider-wrap .num-spin svg {
  width: 10px;
  height: 10px;
  display: block;
}

.control-slider .slider-wrap .num-spin-up {
  top: 3px;
}

.control-slider .slider-wrap .num-spin-down {
  bottom: 3px;
}

.control-slider .slider-wrap .num-spin:hover {
  color: var(--gray-800);
  cursor: default;
}

/* --- Color picker (Figma DS) --- */
.control-color .color-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-color label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-color label {
  color: var(--brand);
  font-size: 12px;
}

.control-color label::before {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20256%20256%22%3E%3Cpath%20d%3D%22M144%2C200a16%2C16%2C0%2C1%2C1-16-16A16%2C16%2C0%2C0%2C1%2C144%2C200Zm-16-40a8%2C8%2C0%2C0%2C0%2C8-8V48a8%2C8%2C0%2C0%2C0-16%2C0V152A8%2C8%2C0%2C0%2C0%2C128%2C160Z%22/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20256%20256%22%3E%3Cpath%20d%3D%22M144%2C200a16%2C16%2C0%2C1%2C1-16-16A16%2C16%2C0%2C0%2C1%2C144%2C200Zm-16-40a8%2C8%2C0%2C0%2C0%2C8-8V48a8%2C8%2C0%2C0%2C0-16%2C0V152A8%2C8%2C0%2C0%2C0%2C128%2C160Z%22/%3E%3C/svg%3E");
}

.control-color input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 8px 12px;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-lg);
  color: var(--gray-800);
}

.control-color input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
}

.color-swatch-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid var(--gray-800-10);
  border-radius: var(--radius-lg);
  background: var(--card);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.color-swatch-btn:focus {
  outline: none;
  border-color: var(--brand);
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--gray-800-10);
  background:
    linear-gradient(45deg, rgba(0,0,0,0.06) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.06) 75%) 0 0 / 8px 8px,
    linear-gradient(45deg, transparent 25%, rgba(0,0,0,0.06) 25%) 4px 4px / 8px 8px,
    linear-gradient(45deg, rgba(0,0,0,0.06) 75%, transparent 75%) 4px 4px / 8px 8px;
  position: relative;
  overflow: hidden;
}

.color-swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--swatch-color, #ffffff);
  opacity: var(--swatch-alpha, 1);
}

.color-popover {
  margin-top: 10px;
  width: 100%;
  padding: 34px 12px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800-10);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  z-index: 1000000;
  position: relative;
}

.cp-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 4;
}

.cp-sv {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: red;
  cursor: crosshair;
}

.cp-sv-white {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}

.cp-sv-black {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #000, rgba(0,0,0,0));
}

.cp-sv-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.35);
  transform: translate(-7px, -7px);
}

.cp-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.cp-label {
  display: none;
}

.cp-slider {
  position: relative;
  height: 9px;
  border-radius: var(--radius-full);
  overflow: visible;
  cursor: pointer;
}

.cp-slider.hue {
  background: linear-gradient(to right,
    #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.cp-slider.alpha {
  background:
    linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.08) 75%) 0 0 / 8px 8px,
    linear-gradient(45deg, transparent 25%, rgba(0,0,0,0.08) 25%) 4px 4px / 8px 8px,
    linear-gradient(45deg, rgba(0,0,0,0.08) 75%, transparent 75%) 4px 4px / 8px 8px;
}

.cp-alpha-gradient {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
}

.cp-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.25);
  transform: translate(-7px, -50%);
  z-index: 3;
}

.cp-bottom {
  display: grid;
  grid-template-columns: 34px minmax(96px, 1fr) 74px;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 22px; /* room for HEX/ALPHA labels below */
  width: 100%;
}

.cp-eyedropper-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-lg);
  background: #eaeaea;
  color: var(--gray-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.cp-eyedropper-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.cp-hex-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 6px 7px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-800-10);
  background: var(--card);
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.cp-hex-prefix {
  display: inline-block;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-600);
  margin-right: 2px;
}

.cp-hex {
  width: 100%;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  background: transparent;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-sub-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 4px);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.06em;
}

.cp-alpha-wrap {
  height: 36px;
  padding: 0 6px;
  border-radius: 10px;
  border: 2px solid var(--gray-800-10);
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 56px;
  position: relative;
  width: 74px;
  flex: 0 0 74px;
}

.cp-alpha-number-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.cp-alpha-input {
  width: 100%;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield !important;
  background: transparent;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
  line-height: 16px;
  text-align: center;
  padding-right: 14px;
}

.cp-alpha-input::-webkit-inner-spin-button,
.cp-alpha-input::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none;
  margin: 0;
  display: none !important;
}

.cp-alpha-spin {
  position: absolute;
  right: 0;
  width: 12px;
  height: 8px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  line-height: 1;
  cursor: default;
}

.cp-alpha-spin svg {
  width: 9px;
  height: 9px;
  display: block;
}

.cp-alpha-spin-up { top: 3px; }
.cp-alpha-spin-down { bottom: 3px; }

.cp-alpha-spin:hover {
  color: var(--gray-800);
}

.cp-alpha-suffix {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  transform: none;
}

.cp-presets {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}

.cp-preset {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid var(--gray-800-10);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
}

.cp-preset:hover {
  transform: scale(1.15);
}

.cp-preset.is-selected::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.3);
}

/* --- Upload area (Figma DS) --- */
.upload-area {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 72px;
  padding: 14px;
  border: 2px dashed var(--gray-400);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

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

.upload-row .upload-area {
  flex: 1 1 auto;
}

.upload-delete-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--gray-800-10);
  border-radius: 8px;
  background: var(--card);
  color: var(--gray-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.upload-delete-btn:hover {
  background: var(--gray-50);
}

.upload-delete-btn[hidden] {
  display: none !important;
}

.upload-delete-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900, #1d1d1d);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.upload-delete-btn:hover::after {
  opacity: 1;
}

.upload-area .upload-delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.upload-area:hover {
  border-color: var(--gray-700);
  background: #f0f0f0;
}

.upload-area.dragover {
  border-color: var(--brand);
  background: rgba(124, 92, 252, 0.06);
}

.upload-text {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.upload-text.has-file {
  color: var(--gray-800);
  font-weight: 500;
}

.upload-area.has-thumb .upload-text {
  padding-left: 36px;
  padding-right: 42px; /* reserve room for Delete button */
  text-align: left;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upload-thumb {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--gray-800-10);
  object-fit: contain;
  background: #ffffff;
  pointer-events: none;
}

/* --- Slot mode + Vexels search (Figma DS: pill buttons) --- */
.slot-modes {
  display: flex;
  gap: 6px;
  margin: 10px 0 8px;
}

.mode-btn {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-800-10);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  transition: background 0.15s, border-color 0.15s;
}

.mode-btn.is-active {
  border-color: var(--brand);
  background: rgba(124, 92, 252, 0.06);
  color: var(--brand);
}

.slot-search {
  margin-bottom: 12px;
  max-width: 100%;
  width: 100%;
}

.slot-alt-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  width: 100%;
}

.slot-alt-divider-line {
  flex: 1;
  height: 1px;
  background: var(--gray-800-10);
}

.slot-alt-divider-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.search-row {
  display: flex;
  gap: 0;
  align-items: center;
  width: 100%;
  max-width: 100%;
  height: 40px;
  border: 2px solid var(--gray-800-10);
  border-radius: 10px;
  background: var(--card);
  padding-left: 14px;
  box-sizing: border-box;
}

.search-input {
  flex: 1;
  min-width: 0; /* evita que el input fuerce overflow fuera del sidebar */
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  border: none;
  box-sizing: border-box;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  background: transparent;
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: var(--gray-400);
  opacity: 1;
}

.search-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
}

.search-back-btn {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-800-10);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.search-back-btn:hover {
  background: var(--gray-50);
}

.search-btn {
  height: 100%;
  width: 40px;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.search-btn:hover {
  background: rgba(29, 29, 29, 0.04);
}

.search-btn svg {
  display: block;
}

.search-results {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

/* --- Fullscreen search modal --- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.search-modal[hidden] {
  display: none;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 29, 29, 0.06);
  pointer-events: auto;
}

.search-modal-panel {
  position: absolute;
  top: 76px; /* evita solape con el header/brand del sidebar */
  bottom: 16px;
  height: auto;
  width: 280px;
  left: 16px;
  margin-left: 0;
  background: var(--card);
  border: 1px solid var(--gray-800-10);
  border-right: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.search-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-800-10);
  background: var(--card);
}

.search-modal-back-btn {
  height: 32px;
  width: 32px;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-modal-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-600);
}

.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
  gap: 6px;
}

.search-modal-skeleton {
  aspect-ratio: 1;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  border: none;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a)),
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a));
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}

.search-modal-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: search-skeleton-shimmer 1.1s infinite;
}

@keyframes search-skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.search-modal-bottom-loader {
  grid-column: 1 / -1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-modal-bottom-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(29, 29, 29, 0.2);
  border-top-color: var(--gray-800);
  animation: search-bottom-spin 0.7s linear infinite;
}

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

.search-modal-thumb-btn {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.search-modal-thumb-btn:hover {
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a)),
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a));
  background-size: var(--checker-size) var(--checker-size);
  background-position: 0 0, calc(var(--checker-size) / 2) calc(var(--checker-size) / 2);
}

.search-modal-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.search-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800-10);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.search-item:hover {
  background: var(--gray-50);
}

.search-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid var(--gray-800-10);
  background: var(--gray-50);
}

.search-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-sub {
  font-size: 12px;
  color: var(--gray-400);
}

/* --- Buttons (Figma DS: pill-shaped, Poppins Medium) --- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  height: 40px;
  padding: 0 20px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-transform: capitalize;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
}

.btn-secondary {
  background: var(--card);
  color: var(--gray-800);
  border: none;
  box-shadow: var(--shadow-lg);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
}

/* --- Preview area --- */
.preview-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  padding-top: 76px;
  background: transparent;
  overflow: hidden;
}

.canvas-floating {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  pointer-events: auto;
}

.zoom-floating {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: auto;
}

.preview-topbar {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.preview-topbar .dropdown-btn {
  border-radius: var(--radius-full);
  height: 45px;
  padding: 0 18px;
  box-shadow: var(--shadow-lg);
}

.preview-topbar .dropdown-btn-caret {
  display: none;
}

.download-btn-top {
  height: 45px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--brand);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
}

.download-btn-top:hover:not(:disabled) {
  background: var(--brand-hover);
}

.download-btn-top:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-btn-text {
  display: inline-block;
  transform: translateY(-0.5px);
}

/* --- Right Colors Tool (drawer) --- */
.colors-tool {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: none;
  z-index: 30;
  pointer-events: auto;
  width: 44px; /* keep icon stable when panel opens */
  height: 44px; /* icon height */
  overflow: visible;
}

.colors-tool-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%); /* keep only icon centered vertically */
}

.colors-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: none;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.colors-tool-btn svg {
  display: block;
}

.colors-tool-hover-pill {
  position: absolute;
  right: 54px;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--gray-900, #1d1d1d);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  display: none;
  align-items: center;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  pointer-events: none;
}

.colors-tool-btn-wrap:hover .colors-tool-hover-pill {
  display: inline-flex;
}

.colors-tool-panel {
  width: 300px;
  height: auto;
  position: fixed;
  right: 60px; /* 16px (tool right) + 44px (icon container) */
  top: 76px; /* align with canvas/sidebar top working area */
  bottom: 86px; /* end around Reset section height */
  transform: none;
  margin-top: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0px 1px 23px -3px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--gray-800-10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.colors-tool-panel[hidden] {
  display: none !important;
}

.colors-tool-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: transparent;
}

.colors-tool-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.colors-tool-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--gray-800);
}

.colors-tool-body {
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow: hidden;
}

.colors-tool-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.colors-tool-block--palettes {
  flex: 1;
  min-height: 0;
}

.colors-tool-block--used {
  flex: 0 0 auto;
}

.colors-tool-block-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.colors-tool-block--used .colors-tool-block-title {
  display: none;
}

.colors-tool-maintain-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.colors-tool-maintain-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.maintain-bg-switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  color: var(--gray-600); /* off state */
}

.maintain-bg-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.maintain-bg-switch-icon {
  display: block;
}

.maintain-bg-switch-thumb {
  transition: transform 0.18s ease;
  transform: translateX(0);
}

.maintain-bg-switch input:checked + .maintain-bg-switch-icon {
  color: var(--brand); /* on state */
}

.maintain-bg-switch input:checked + .maintain-bg-switch-icon .maintain-bg-switch-thumb {
  transform: translateX(16px);
}

.colors-tool-palettes {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  flex: 1;
  min-height: 0;
}

.colors-tool-palettes::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.colors-tool-palettes {
  scrollbar-width: none;
}

.colors-tool-used-colors {
  scrollbar-width: none;
}

.colors-tool-used-colors::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.colors-tool-palette-btn {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  text-align: left;
}

.colors-tool-palette-btn,
.colors-tool-palette-btn:hover,
.colors-tool-palette-btn:focus-visible,
.colors-tool-palette-btn .colors-tool-palette-swatches,
.colors-tool-palette-btn .colors-tool-palette-swatch,
.colors-tool-palette-btn .colors-tool-palette-name {
  cursor: pointer !important;
}

.colors-tool-palette-btn:hover {
  background: transparent;
}

.colors-tool-palette-swatches {
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid #E0E0E0;
  display: flex;
  overflow: hidden;
  width: 100%;
  position: relative;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.colors-tool-palette-swatch {
  flex: 1 1 0;
  height: 30px;
}

.colors-tool-palette-shuffle-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.colors-tool-palette-shuffle-hint svg {
  width: 22px;
  height: 22px;
  color: #1d1d1d;
  background: #ffffff;
  border-radius: 9999px;
  padding: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

.colors-tool-palette-btn:hover .colors-tool-palette-shuffle-hint {
  opacity: 1;
}

.colors-tool-palette-btn:hover .colors-tool-palette-swatches {
  border-color: #bdbdbd;
}

.colors-tool-palette-name {
  font-size: 11px;
  font-weight: 500;
  color: #A6A6A6;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px;
  width: 100%;
  text-align: left;
}

.colors-tool-used-colors {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  padding-right: 4px;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.colors-tool-used-color-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
}

.colors-tool-used-color-chip:hover {
  background: transparent;
}

.colors-tool-used-chip-swatch {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid var(--gray-800-10);
  position: relative;
  pointer-events: auto;
}

.colors-tool-used-chip-hex {
  display: none;
}

.colors-tool-used-chip-swatch.is-transparent {
  background:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a)) 0 0 / var(--checker-size) var(--checker-size),
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%, transparent 75%, var(--checker-a) 75%, var(--checker-a)) calc(var(--checker-size) / 2) calc(var(--checker-size) / 2) / var(--checker-size) var(--checker-size);
}

.colors-tool-used-chip-transparent-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.colors-tool-used-chip-transparent-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.dropdown {
  position: relative;
}

.dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-lg);
  border: none;
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-main);
}

.dropdown-btn-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
}

.dropdown-btn-caret {
  font-size: 12px;
  opacity: 0.8;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800-10);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.dropdown-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--gray-800-10);
}

.dropdown-custom {
  padding: 8px 8px 6px;
}

.dropdown-custom-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 2px 2px 8px;
}

.dropdown-custom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.dropdown-custom input[type="number"] {
  width: 100%;
  height: 32px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  border: 2px solid var(--gray-800-10);
  border-radius: 10px;
  color: var(--gray-800);
  box-sizing: border-box;
}

.dropdown-custom input[type="number"]::-webkit-inner-spin-button,
.dropdown-custom input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0;
  opacity: 1;
  width: 18px;
  height: 50%;
  background-color: transparent;
  border-left: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='10'%20viewBox='0%200%20256%20256'%3E%3Cpath%20fill='%231D1D1D'%20d='M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z'/%3E%3C/svg%3E");
}

.dropdown-custom input[type="number"]::-webkit-outer-spin-button {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='10'%20viewBox='0%200%20256%20256'%3E%3Cpath%20fill='%231D1D1D'%20d='M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E");
}

.dropdown-custom-actions {
  display: flex;
  justify-content: flex-end;
}

.dropdown-apply {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-lg);
  border: none;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.dropdown-apply:hover {
  background: var(--brand-hover);
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-main);
}

.dropdown-item:hover {
  background: var(--gray-50);
}

.dropdown-item.is-selected {
  background: rgba(124, 92, 252, 0.08);
}

.dropdown-item .preset-ico {
  flex-shrink: 0;
}

.dropdown-item .item-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-item .item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
}

.dropdown-item .item-subtitle {
  font-size: 12px;
  color: var(--gray-400);
}

.canvas-wrapper {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}

.viewport-zoom {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--card);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.viewport-zoom #vzRange {
  width: 140px;
  height: 4px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-radius: 9999px;
}

.viewport-zoom #vzRange::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(
    to right,
    #1d1d1d 0%,
    #1d1d1d var(--p, 0%),
    rgba(29, 29, 29, 0.10) var(--p, 0%),
    rgba(29, 29, 29, 0.10) 100%
  );
  border-radius: 9999px;
}

.viewport-zoom #vzRange::-moz-range-track {
  height: 4px;
  background: linear-gradient(
    to right,
    #1d1d1d 0%,
    #1d1d1d var(--p, 0%),
    rgba(29, 29, 29, 0.10) var(--p, 0%),
    rgba(29, 29, 29, 0.10) 100%
  );
  border-radius: 9999px;
}

.viewport-zoom #vzRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--gray-600);
  box-sizing: border-box;
  cursor: pointer;
  margin-top: -4.5px; /* centra el thumb sobre el track de 4px */
}

.viewport-zoom #vzRange::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--gray-600);
  box-sizing: border-box;
  cursor: pointer;
}

.vz-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--gray-800-10);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
}

.vz-btn:hover {
  background: var(--gray-50);
}

.viewport-zoom #vzNumber {
  width: 52px;
  height: 26px;
  padding: 2px 14px 2px 7px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border: 2px solid var(--gray-800-10);
  border-radius: 10px;
  color: var(--gray-800);
  line-height: 1.2;
  box-sizing: border-box;
  -moz-appearance: textfield !important;
  appearance: textfield;
  -webkit-appearance: textfield;
  font-variant-numeric: tabular-nums;
  display: block;
  overflow: visible;
}

.viewport-zoom .vz-number-wrap {
  position: relative;
  width: 54px;
  height: 26px;
  flex-shrink: 0;
}

/* Chrome/WebKit: avoid clipped glyphs in compact number fields */
@supports (-webkit-appearance: none) {
  .control-slider .slider-wrap input[type="number"],
  .viewport-zoom #vzNumber {
    padding-top: 1px;
    padding-bottom: 1px;
  }
}

.viewport-zoom .vz-number-wrap #vzNumber {
  width: 100%;
}

.viewport-zoom #vzNumber::-webkit-inner-spin-button,
.viewport-zoom #vzNumber::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none;
  margin: 0;
  display: none !important;
}

.viewport-zoom .vz-spin {
  position: absolute;
  right: 2px;
  width: 16px;
  height: 9px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  cursor: default;
  line-height: 1;
}

.viewport-zoom .vz-spin svg {
  width: 10px;
  height: 10px;
  display: block;
}

.viewport-zoom .vz-spin-up {
  top: 3px;
}

.viewport-zoom .vz-spin-down {
  bottom: 3px;
}

.viewport-zoom .vz-spin:hover {
  color: var(--gray-800);
  cursor: default;
}

.vz-suffix {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
}

.vz-reset {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-800-10);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
}

.vz-reset:hover {
  background: var(--gray-50);
}

.canvas-viewport {
  position: relative;
  width: 800px;
  height: 600px;
  background: #fff;
  overflow: hidden;
  cursor: default;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artboard-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.35);
  z-index: 4;
  pointer-events: none;
}

.artboard-loader[hidden] {
  display: none !important;
}

.artboard-loader-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(29, 29, 29, 0.2);
  border-top-color: var(--gray-800);
  animation: artboard-spin 0.7s linear infinite;
}

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

.canvas-viewport:hover {
  cursor: grab;
}

.canvas-viewport.is-panning {
  cursor: grabbing;
}

.canvas-viewport.is-picking-color {
  cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' width='22' height='22'%3E%3Crect width='256' height='256' fill='none'/%3E%3Cpath d='M182.43,113.17l4.88,4.89a16,16,0,0,1,0,22.63l-9,9a8,8,0,0,1-11.31,0L106.34,89a8,8,0,0,1,0-11.31l9-9a16,16,0,0,1,22.63,0l4.89,4.88,25-25.1c10.79-10.79,28.37-11.45,39.44-1a28,28,0,0,1,.57,40.15Z' fill='none' stroke='%231d1d1d' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cpath d='M159.31,141.94l-56.68,56.69a32,32,0,0,1-32.06,8h0l-20,8.74a8,8,0,0,1-8.86-1.67h0a5.74,5.74,0,0,1-1.2-6.36l9.19-21.06h0a32,32,0,0,1,7.7-32.87l56.69-56.68' fill='none' stroke='%231d1d1d' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E") 2 20, crosshair !important;
}

.canvas-viewport.is-picking-color,
.canvas-viewport.is-picking-color * {
  cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' width='22' height='22'%3E%3Crect width='256' height='256' fill='none'/%3E%3Cpath d='M182.43,113.17l4.88,4.89a16,16,0,0,1,0,22.63l-9,9a8,8,0,0,1-11.31,0L106.34,89a8,8,0,0,1,0-11.31l9-9a16,16,0,0,1,22.63,0l4.89,4.88,25-25.1c10.79-10.79,28.37-11.45,39.44-1a28,28,0,0,1,.57,40.15Z' fill='none' stroke='%231d1d1d' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cpath d='M159.31,141.94l-56.68,56.69a32,32,0,0,1-32.06,8h0l-20,8.74a8,8,0,0,1-8.86-1.67h0a5.74,5.74,0,0,1-1.2-6.36l9.19-21.06h0a32,32,0,0,1,7.7-32.87l56.69-56.68' fill='none' stroke='%231d1d1d' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E") 2 20, crosshair !important;
}

html.is-eyedropper-active,
html.is-eyedropper-active * {
  cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' width='22' height='22'%3E%3Crect width='256' height='256' fill='none'/%3E%3Cpath d='M182.43,113.17l4.88,4.89a16,16,0,0,1,0,22.63l-9,9a8,8,0,0,1-11.31,0L106.34,89a8,8,0,0,1,0-11.31l9-9a16,16,0,0,1,22.63,0l4.89,4.88,25-25.1c10.79-10.79,28.37-11.45,39.44-1a28,28,0,0,1,.57,40.15Z' fill='none' stroke='%231d1d1d' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cpath d='M159.31,141.94l-56.68,56.69a32,32,0,0,1-32.06,8h0l-20,8.74a8,8,0,0,1-8.86-1.67h0a5.74,5.74,0,0,1-1.2-6.36l9.19-21.06h0a32,32,0,0,1,7.7-32.87l56.69-56.68' fill='none' stroke='%231d1d1d' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E") 2 20, crosshair !important;
}

/* Always show hand pointer in color-activation areas. */
.colors-tool-used-color-chip,
.colors-tool-used-color-chip *,
.colors-tool-palette-btn,
.colors-tool-palette-btn *,
#bgColorBtn,
#bgColorBtn * {
  cursor: pointer !important;
}

#canvas {
  display: block;
  transform-origin: 50% 50%;
  will-change: transform;
}

.preset-ico {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-800);
  border-radius: 3px;
  opacity: 0.3;
}

.preset-ico.landscape {
  width: 20px;
  height: 14px;
}

.preset-ico.portrait {
  width: 14px;
  height: 20px;
}

.preset-ico.square {
  width: 18px;
  height: 18px;
}

/* removed: canvas toolbar (pan/zoom) */
