:root {
  --bg-base: #0c0d10;
  --bg-panel: #13151a;
  --bg-card: #191c23;
  --bg-inner: #0f1115;
  --text-main: #f3f4f6;
  --text-muted: #8e95a5;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.16);
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 9px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Color temático de la pestaña activa */
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ================= SCROLLBARS OSCUROS ================= */
* {
  scrollbar-width: thin;
  scrollbar-color: #262a34 transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #262a34;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #353b49;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  background-image: radial-gradient(ellipse 80% 340px at 50% -40px, var(--accent-glow), transparent 72%);
  background-repeat: no-repeat;
  color: var(--text-main);
  line-height: 1.55;
  overflow-x: hidden;
  padding-bottom: 84px;
  -webkit-font-smoothing: antialiased;
  transition: background-image 0.4s ease;
}

@media (min-width: 860px) {
  body {
    padding-bottom: 36px;
  }
}

/* ================= CABECERA MINIMALISTA DE ESTUDIO ================= */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 13, 16, 0.68);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  padding: 10px 0;
}

.header-container,
main,
.studio-footer {
  max-width: 1380px;
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(16px, 2.5vw, 36px);
}

.header-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.brand-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.brand-icon svg {
  width: 19px;
  height: 19px;
  stroke: #38bdf8;
  transition: transform 0.4s ease, stroke 0.25s ease;
}

.brand:hover .brand-icon {
  border-color: rgba(56, 189, 248, 0.45);
}

.brand:hover .brand-icon svg {
  transform: rotate(14deg) scale(1.05);
}

.brand.burst .brand-icon {
  animation: iconFlash 0.55s ease-out;
}

@keyframes iconFlash {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); border-color: #38bdf8; }
  100% { box-shadow: 0 0 0 12px rgba(56, 189, 248, 0); }
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f4f4f6;
}

.brand-text p {
  display: none;
}

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

.feedback-trigger-btn {
  background: var(--bg-card);
  color: #e5e7eb;
  border: 1px solid var(--border-subtle);
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.feedback-trigger-btn:hover {
  border-color: var(--border-hover);
  background: #20242d;
  color: #ffffff;
}

.share-header-btn {
  background: rgba(56, 189, 248, 0.11);
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.28);
}

.share-header-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

.export-btn {
  background: var(--bg-card);
  color: #e5e7eb;
  border-color: var(--border-subtle);
}

/* ================= NAVEGACIÓN DE PESTAÑAS ================= */
.nav-grid {
  display: none;
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: 11px;
  gap: 3px;
}

@media (min-width: 860px) {
  .nav-grid {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-grid::-webkit-scrollbar {
    display: none;
  }
}

@media (min-width: 1160px) {
  .header-top-row {
    flex-wrap: nowrap;
  }
}

.nav-pill {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.75;
}

.nav-pill:hover {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.03);
}

.nav-pill.active {
  background: var(--bg-card);
  color: #f4f4f6;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.11);
}

.nav-pill.active .dot {
  opacity: 1;
}

.nav-count-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* ================= NAVEGACIÓN MÓVIL INFERIOR ================= */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(12, 13, 16, 0.68);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: space-around;
  padding: 6px 4px;
}

@media (min-width: 860px) {
  .mobile-nav {
    display: none;
  }
}

.mob-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 2px;
  border-radius: 8px;
  font-size: 0.67rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.mob-btn.active {
  color: #f4f4f6;
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ================= CONTENEDOR PRINCIPAL Y TRANSICIONES ================= */
main {
  margin-block: 22px;
}

.section-panel {
  display: none;
}

.section-panel.active {
  display: block;
}

.slide-up {
  animation: slideFromBottom 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-down {
  animation: slideFromTop 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideFromBottom {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ================= ENCABEZADOS DE SECCIÓN Y FILTROS ================= */
.section-title-block {
  margin-bottom: 16px;
}

.section-title-block h2 {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f4f4f6;
  margin-bottom: 4px;
}

.section-title-block p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.toolbar-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar-split .filter-bar,
.toolbar-split .quick-search-row {
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

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

.filter-chip {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--border-hover);
  color: #e5e7eb;
}

.filter-chip.active {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.42);
  color: #e0f2fe;
  font-weight: 600;
}

.quick-search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.quick-search-row input[type="text"] {
  flex: 1 1 220px;
  margin-bottom: 0;
}

/* ================= TARJETAS Y REJILLAS ================= */
.studio-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  width: 100%;
  overflow: hidden;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.studio-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.09), 0 12px 28px rgba(0, 0, 0, 0.32);
}

.studio-card h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f4f4f6;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-card .subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.grid-3,
.cs-panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 16px;
}

.grid-3-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 600px) {
  .grid-3-compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 14px;
}

/* Tarjetas dinámicas generadas en Paletas y Comunidad */
#emotionGrid > div,
#communityGrid > div,
#narrativeScenesGrid > div {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

#emotionGrid > div:hover,
#communityGrid > div:hover,
#narrativeScenesGrid > div:hover {
  border-color: var(--border-hover) !important;
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.09), 0 10px 24px rgba(0, 0, 0, 0.32);
}

/* ================= CONTROLES, INPUTS Y SELECTORES ================= */
.field-label {
  display: block;
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.checkbox-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: #d1d5db;
  margin-bottom: 10px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #38bdf8;
  cursor: pointer;
}

.picker-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}

.picker-box:hover {
  border-color: var(--border-hover);
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e5e7eb;
  gap: 8px;
}

.picker-header .code-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 5px;
}

.picker-header .code-tag:hover {
  color: #f4f4f6;
  border-color: var(--border-hover);
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  height: 32px;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  display: block;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.rgb-subline {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.rgb-subline:hover {
  color: #f4f4f6;
}

/* SLIDERS CALIBRADOS (WEBKIT + FIREFOX) */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #d1d5db;
}

.slider-header span.val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #93c5fd;
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: #232732;
  border-radius: 999px;
  outline: none;
  margin-bottom: 14px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 3px solid #38bdf8;
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 3px solid #38bdf8;
  cursor: pointer;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-family: inherit;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.45);
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e95a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* ================= BOTONES ================= */
.btn {
  background: var(--bg-card);
  color: #e5e7eb;
  border: 1px solid var(--border-subtle);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  border-color: var(--border-hover);
  background: #222630;
  color: #ffffff;
}

.btn-accent {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  font-weight: 600;
}

.btn-accent:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-png {
  background: var(--bg-card);
  color: #d1d5db;
  border: 1px solid var(--border-subtle);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.btn-png:hover {
  border-color: var(--border-hover);
  background: #222630;
  color: #ffffff;
}

/* ================= MUESTRAS DE COLOR ================= */
.color-strip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.swatch-strip {
  flex: 1;
  display: flex;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.swatch-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: flex 0.2s ease;
  overflow: hidden;
}

.swatch-item .role-sub {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swatch-item:hover {
  flex: 1.4;
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* BANNER TONOS DE PIEL */
.skin-tip-banner {
  background: var(--bg-panel);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-lg);
  padding: 12px 15px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: #e5e7eb;
  display: none;
}

/* ================= SECCIÓN 4: 60-30-10 & NOTAN ================= */
.comp-stage {
  position: relative;
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.comp-stage.drag-over {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.05);
}

.comp-stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  color: #d1d5db;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-badge.has-img {
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.segmented-modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.segmented-modes .btn {
  padding: 6px 12px;
  font-size: 0.77rem;
}

.mode-subpanel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-top: 12px;
}

.notan-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.notan-presets .btn {
  flex: 1 1 auto;
  padding: 6px 9px;
  font-size: 0.75rem;
}

.value-meter-wrap {
  margin-top: 10px;
}

.value-meter-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  margin-top: 5px;
}

.prop-preview-bar {
  display: flex;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.prop-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: filter 0.2s ease;
  padding: 0 4px;
  overflow: hidden;
}

.prop-seg:hover {
  filter: brightness(1.08);
}

.prop-seg small {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 500;
  opacity: 0.9;
}

.role-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid var(--border-subtle);
}

/* TARJETAS DE 4 PLANOS ATMOSFÉRICOS */
.atmo-plane-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.atmo-plane-card:hover {
  border-color: var(--border-hover);
}

.atmo-swatch-block {
  height: 68px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border-subtle);
}

.atmo-plane-card strong {
  display: block;
  font-size: 0.83rem;
  color: #f3f4f6;
}

.atmo-plane-card span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* CLAVES DE ILUMINACIÓN PARA PINTORES */
.painter-keys-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.painter-keys-list li {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.painter-keys-list li strong.bullet-title {
  color: #e5e7eb;
}

/* EXTRACTOR DE REFERENCIA */
.extractor-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 560px) {
  .extractor-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.extractor-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.drop-zone {
  height: 165px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
  padding: 16px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.drop-zone canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.extracted-5-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

@media (min-width: 540px) {
  .extracted-5-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
}

.extracted-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.2s ease;
}

.extracted-chip:hover {
  border-color: var(--border-hover);
}

.extracted-chip .color-fill {
  height: 44px;
  border-radius: 7px;
  margin-bottom: 6px;
}

.extracted-chip span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* GLOSARIO ESENCIAL DE TALLER */
.glossary-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.glossary-item h4 {
  font-size: 0.88rem;
  color: #f3f4f6;
  margin-bottom: 4px;
}

.glossary-item p {
  font-size: 0.81rem;
  color: var(--text-muted);
}

/* SIMULADOR 3D Y READOUTS */
canvas.sim-canvas {
  width: 100%;
  height: 270px;
  border-radius: 10px;
  background: var(--bg-inner);
  display: block;
  cursor: crosshair;
}

.shape-bar {
  display: inline-flex;
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.shape-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shape-btn:hover {
  color: #e5e7eb;
}

.shape-btn.active {
  background: var(--bg-card);
  color: #f4f4f6;
  border-color: rgba(255, 255, 255, 0.1);
}

.readout-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

@media (min-width: 520px) {
  .readout-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.readout-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.readout-pill:hover {
  border-color: var(--border-hover);
}

.readout-pill .dot-sq {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.readout-pill small {
  display: block;
  font-size: 0.67rem;
  color: var(--text-muted);
}

.readout-pill strong {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  color: #e5e7eb;
}

/* MEDIDOR DE PROBABILIDAD DE ARMONÍA */
.harmony-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-top: 12px;
}

.harmony-bar-bg {
  height: 6px;
  background: var(--bg-inner);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.harmony-bar-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* TABLA MATRIZ */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

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

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

.pill-c {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
}

/* ================= COMUNIDAD Y CREADOR DE PALETAS ================= */
.comm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.comm-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.comm-badge-live.off {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
}

.comm-swatch-editor {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 500px) {
  .comm-swatch-editor {
    grid-template-columns: repeat(3, 1fr);
  }
}

.comm-swatch-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comm-swatch-box input[type="color"] {
  width: 32px;
  height: 28px;
  flex-shrink: 0;
}

.comm-swatch-box input[type="text"] {
  margin: 0;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.toggle-share-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.like-btn {
  background: var(--bg-card);
  color: #d1d5db;
  border: 1px solid var(--border-subtle);
  padding: 5px 9px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.like-btn.liked,
.like-btn:hover {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.4);
  color: #fda4af;
}

/* ================= PIE DE PÁGINA & MODALES ================= */
.studio-footer {
  margin-top: 32px;
  margin-bottom: 12px;
  padding-block: 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.studio-footer:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.09), 0 12px 28px rgba(0, 0, 0, 0.32);
}

.legal-row {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legal-row a {
  color: var(--text-muted);
  text-decoration: none;
}

.legal-row a:hover {
  color: #f4f4f6;
  text-decoration: underline;
}

.legal-mor {
  margin-left: auto;
  opacity: 0.8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 7, 10, 0.74);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 490px;
  padding: 24px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.75);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  animation: slideFromBottom 0.3s ease;
}

.modal-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.09), 0 28px 66px rgba(0, 0, 0, 0.8);
}

.exp-how-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 10px;
  padding: 10px 14px;
}

.star-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 14px;
}

.star-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #6b7280;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.star-btn.active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.1);
}

/* TOAST */
.toast {
  position: fixed;
  top: 68px;
  right: 18px;
  z-index: 100;
  background: #10b981;
  color: #052e16;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* DALTONISMO & CONTRASTE */
.cvd-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 10px;
}

.cvd-strip {
  display: flex;
  height: 26px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-top: 6px;
}

.cvd-strip div {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.pro-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  vertical-align: middle;
}

.audit-row {
  font-size: 0.8rem;
  padding: 7px 10px;
  margin-bottom: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.pro-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  margin: 4px 0 10px;
}

.pro-chip {
  height: 40px;
  border-radius: 7px;
  font: 0.62rem var(--font-mono);
  display: flex;
  align-items: flex-end;
  padding: 3px 5px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ================= CONSTRUCTOR DE COLOR SCRIPT (PRO) ================= */
.cs-builder-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

@media (min-width: 720px) {
  .cs-builder-bar {
    grid-template-columns: 1.2fr 1.1fr 1.3fr auto;
    align-items: end;
  }
}

.cs-draft-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cs-draft-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 9px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.cs-draft-chip:hover,
.cs-draft-chip.editing {
  border-color: rgba(56, 189, 248, 0.55);
}

.cs-draft-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.cs-color-editor {
  background: var(--bg-card);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.cs-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cs-editor-preview {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.cs-timeline-strip {
  display: flex;
  min-height: 42px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-inner);
  margin-bottom: 14px;
}

.cs-timeline-seg {
  flex: 1 1 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 7px;
  font-size: 0.67rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  min-width: 68px;
}

.cs-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: border-color 0.2s ease;
}

.cs-panel-card:hover {
  border-color: var(--border-hover);
}

.cs-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cs-panel-idx {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 2px 7px;
  border-radius: 999px;
}

.cs-panel-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ================= ASISTENTE CROMÁTICO IA & GLOSARIO ================= */
#sec-5 .grid-2 > * {
  min-width: 0;
}

.ai-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ai-header-row > div {
  flex: 1 1 220px;
  min-width: 0;
}

.ai-quota-badge {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fde68a;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.ai-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ai-text-input {
  flex: 1 1 200px;
  margin-bottom: 0 !important;
}

.ai-generate-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ai-examples-bar {
  margin-bottom: 10px;
}

.ai-status-msg {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 0.81rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ai-result-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 8px;
}

.ai-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ai-palette-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: #f4f4f6;
  margin: 0 0 6px 0;
}

.ai-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-meta-pill {
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.71rem;
  color: var(--text-muted);
}

.ai-art-direction {
  font-size: 0.81rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.ai-swatches {
  margin-bottom: 12px;
}

.ai-actions-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.glossary-accordion {
  padding: 14px 18px;
}

.glossary-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: #f4f4f6;
  list-style: none;
}

.glossary-summary::-webkit-details-marker {
  display: none;
}

.glossary-hint {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
}

.glossary-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ================= MODO PRO & AVATAR DE USUARIO ================= */
.pro-brand-badge {
  display: none;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  vertical-align: middle;
  margin-left: 6px;
}

body.is-pro .pro-brand-badge {
  display: inline-flex;
}

body.is-pro .brand-icon {
  border-color: rgba(251, 191, 36, 0.45);
}

body.is-pro .brand-icon svg {
  stroke: #fbbf24;
}

.auth-avatar-btn {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.auth-avatar-btn svg {
  width: 18px;
  height: 18px;
  stroke: #d1d5db;
  transition: stroke 0.2s ease;
}

.auth-avatar-btn:hover {
  border-color: var(--border-hover);
  background: #20242d;
}

.auth-avatar-btn:hover svg {
  stroke: #ffffff;
}

.auth-avatar-btn.verified {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
}

.auth-avatar-btn.verified svg {
  stroke: #38bdf8;
}

.auth-avatar-btn.verified.is-pro-user {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.12);
}

.auth-avatar-btn.verified.is-pro-user svg {
  stroke: #fbbf24;
}

.auth-avatar-btn .avatar-photo,
.auth-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.auth-avatar-btn.has-avatar {
  padding: 2px;
  overflow: visible;
}

.auth-avatar-clip {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-avatar-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  text-transform: uppercase;
}

.avatar-pro-badge {
  position: absolute;
  bottom: -4px;
  right: -5px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  background: #fbbf24;
  color: #0c0d10;
  border: 1.5px solid #0c0d10;
  pointer-events: none;
}

body.is-pro .pro-tag,
body.is-pro .free-only {
  display: none !important;
}

body.is-pro #authHeaderBtn .pro-tag {
  display: inline-flex !important;
  z-index: 2;
}

/* ================= MODAL DE INICIAR SESIÓN Y PLANES ================= */
.auth-google-btn {
  width: auto;
  padding: 9px 18px;
  font-size: 0.84rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0 12px;
  color: var(--text-muted);
  font-size: 0.73rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 10px;
}

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

.auth-email-input {
  flex: 1;
  margin-bottom: 0 !important;
}

.auth-verify-box {
  background: var(--bg-card);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}

.auth-session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.plans-header-btn {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
}

.plans-header-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.55);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  padding: 16px;
  border-radius: 13px;
  cursor: pointer;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease, transform 0.22s ease, box-shadow 0.22s ease;
  font: inherit;
}

.plan-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.plan-card strong {
  font-size: 0.98rem;
  color: #f4f4f6;
}

.plan-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.plan-card:hover:not(:disabled) {
  border-color: rgba(251, 191, 36, 0.55);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.09), 0 12px 26px rgba(0, 0, 0, 0.38);
}

.plan-card:disabled {
  opacity: 0.6;
  cursor: wait;
}

.plan-price {
  font-size: 1.38rem;
  font-weight: 700;
  color: #fde68a;
}

.plan-price small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.plan-card:hover:not(:disabled) .plan-cta {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.plan-cta-best {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #0c0d10;
  font-weight: 700;
}

.plan-card:hover:not(:disabled) .plan-cta-best {
  background: #fcd34d;
  border-color: #fcd34d;
  color: #0c0d10;
}

.plan-best {
  position: relative;
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.09), 0 0 26px rgba(251, 191, 36, 0.13);
}

.plan-best:hover:not(:disabled) {
  border-color: #fbbf24;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 0 32px rgba(251, 191, 36, 0.22), 0 12px 26px rgba(0, 0, 0, 0.4);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  font-style: normal;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fbbf24;
  color: #0c0d10;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.plans-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-inner);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
}

.plans-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.79rem;
  color: #d1d5db;
  line-height: 1.45;
}

.plans-highlights svg {
  width: 15px;
  height: 15px;
  stroke: #fbbf24;
  flex-shrink: 0;
  margin-top: 2px;
}

.plans-highlights strong {
  color: #f4f4f6;
  font-weight: 600;
}

.plans-trust-strip {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plans-trust-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.plans-trust-label svg {
  width: 14px;
  height: 14px;
  stroke: #34d399;
  flex-shrink: 0;
}

.plans-trust-label strong {
  color: #f4f4f6;
  font-weight: 600;
}

.payment-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--bg-inner);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #e5e7eb;
}

.plans-terms {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.plans-terms p {
  margin: 0;
}

.plans-terms a {
  color: #fde68a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.plans-terms a:hover {
  color: #fef3c7;
}

/* COMPARADOR */
.cmp-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.cmp-row select {
  margin: 0;
  width: auto;
  flex: 1 1 170px;
}

.cmp-row label.btn {
  cursor: pointer;
}

.btn.is-on {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.cmp-probe {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.cmp-sw {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
}

/* ================= RESPONSIVO MÓVIL ================= */
@media (max-width: 859px) {
  header {
    position: relative;
  }

  .header-top-row {
    position: relative;
    padding-right: 44px;
  }

  .brand-text {
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  .header-actions {
    width: 100%;
  }

  #authHeaderBtn {
    position: absolute;
    top: 0;
    right: 0;
  }
}

/* ================= NÚMEROS TABULARES Y RESPUESTA TÁCTIL ================= */
.picker-header .code-tag,
.rgb-subline,
.slider-header span.val,
.swatch-item,
.mono-meta,
.prop-seg small,
.role-pill,
.atmo-plane-card span,
.extracted-chip span,
.readout-pill strong,
.comm-badge-live,
.comm-swatch-box input[type="text"],
.like-btn,
.cvd-strip div,
.pro-chip,
.cs-draft-chip,
.cs-panel-idx,
.ai-quota-badge,
.nav-count-pill,
.plan-price {
  font-variant-numeric: tabular-nums;
}

.btn,
.btn-accent,
.btn-png,
.filter-chip,
.nav-pill,
.mob-btn,
.shape-btn,
.feedback-trigger-btn,
.like-btn,
.star-btn,
.auth-avatar-btn,
.plan-card {
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.14s ease, box-shadow 0.2s ease;
}

.btn:active,
.btn-accent:active,
.btn-png:active,
.filter-chip:active,
.nav-pill:active,
.mob-btn:active,
.shape-btn:active,
.feedback-trigger-btn:active,
.like-btn:active,
.star-btn:active,
.auth-avatar-btn:active,
.plan-card:active:not(:disabled) {
  transform: scale(0.98);
}
