/* =======================================================================
   Influsxy · Estilos de la plataforma de generación IA
   Reutiliza los tokens del sistema de diseño (oklch, radios, sombras).
   ======================================================================= */

/* ---------------------------------------------------------- Spinner --- */
.ai-spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid color-mix(in oklab, currentColor 35%, transparent);
  border-top-color: currentColor;
  animation: ai-rot .7s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
@keyframes ai-rot { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- Avatares --- */
.ai-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), 0 6px 16px -10px rgb(0 0 0 / .8);
  overflow: hidden;
}
.ai-avatar.sq { border-radius: 14px; }
.ai-avatar-logo { position: relative; box-shadow: 0 6px 16px -10px rgb(0 0 0 / .8); }
.ai-avatar-logo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #0b0b12;
  padding: 10%;
  box-sizing: border-box;
  object-fit: contain;
}

/* --------------------------------------------------- Fila de modelo --- */
.ai-modelrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: var(--radius-2xl);
  padding: 10px 12px;
  margin-bottom: 10px;
  animation: popIn .22s ease both;
}
.ai-modelrow-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ai-modelrow-open:active { transform: scale(.99); }
.ai-modelrow-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.ai-modelrow-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-modelrow-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 16%, transparent);
  color: var(--primary-glow);
  border: 1px solid color-mix(in oklab, var(--primary) 26%, transparent);
}
.ai-tag.alt {
  background: color-mix(in oklab, var(--muted-foreground) 14%, transparent);
  color: var(--muted-foreground);
  border-color: color-mix(in oklab, var(--muted-foreground) 22%, transparent);
}
/* Badges reales por modalidad (colores distintos, mismo lenguaje visual) */
.ai-tag.video { background: color-mix(in oklab, #8b5cf6 20%, transparent); color: #c4b5fd; border-color: color-mix(in oklab, #8b5cf6 40%, transparent); }
.ai-tag.img { background: color-mix(in oklab, #06b6d4 18%, transparent); color: #67e8f9; border-color: color-mix(in oklab, #06b6d4 38%, transparent); }
.ai-tag.t2v { background: color-mix(in oklab, #f59e0b 18%, transparent); color: #fcd34d; border-color: color-mix(in oklab, #f59e0b 38%, transparent); }
.ai-tag.i2v { background: color-mix(in oklab, #ec4899 18%, transparent); color: #f9a8d4; border-color: color-mix(in oklab, #ec4899 38%, transparent); }
.ai-tag.t2i { background: color-mix(in oklab, #10b981 18%, transparent); color: #6ee7b7; border-color: color-mix(in oklab, #10b981 38%, transparent); }
.ai-tag.i2i { background: color-mix(in oklab, #3b82f6 18%, transparent); color: #93c5fd; border-color: color-mix(in oklab, #3b82f6 38%, transparent); }
.ai-tag.audio { background: color-mix(in oklab, #14b8a6 18%, transparent); color: #5eead4; border-color: color-mix(in oklab, #14b8a6 38%, transparent); }
.ai-tag.three-d { background: color-mix(in oklab, #a855f7 22%, transparent); color: #d8b4fe; border-color: color-mix(in oklab, #a855f7 42%, transparent); }
.ai-tag.avatar { background: color-mix(in oklab, #f43f5e 18%, transparent); color: #fda4af; border-color: color-mix(in oklab, #f43f5e 38%, transparent); }
.ai-tag.edit { background: color-mix(in oklab, #eab308 18%, transparent); color: #fde047; border-color: color-mix(in oklab, #eab308 38%, transparent); }
.ai-modelrow-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--foreground);
}
.ai-modelrow-price small { font-size: 10px; font-weight: 600; color: var(--muted-foreground); }

.ai-fav {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: transform .1s, color .1s, background .1s;
}
.ai-fav:hover { background: var(--secondary); }
.ai-fav.on { color: var(--warning); }
.ai-fav:active { transform: scale(.88); }

/* ------------------------------------------------- Catálogo plataformas */
.ai-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: var(--radius-2xl);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  animation: popIn .22s ease both;
}
.ai-platform:active { transform: scale(.99); }
.ai-platform-main { flex: 1; min-width: 0; }
.ai-platform-name { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.ai-platform-meta { font-size: 12px; color: var(--muted-foreground); margin-top: 3px; }
.ai-platform-count {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  color: var(--primary-glow);
  border: 1px solid color-mix(in oklab, var(--primary) 24%, transparent);
}
.ai-chiprow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.ai-chiprow::-webkit-scrollbar { display: none; }
.ai-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ai-chip.on { background-image: var(--gradient-primary); color: var(--primary-foreground); border-color: transparent; }

/* ----------------------------------------------------- Tarjeta generación */
.ai-gen-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.ai-gen-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  animation: popIn .22s ease both;
}
.ai-gen-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: oklch(0.18 0.02 286);
  overflow: hidden;
}
.ai-gen-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-gen-thumb.noimg { display: flex; align-items: center; justify-content: center; }
.ai-gen-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
}
.ai-gen-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgb(0 0 0 / .5);
  color: #fff;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .25);
}
.ai-gen-kind {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgb(0 0 0 / .55);
  color: #fff;
  backdrop-filter: blur(3px);
}
.ai-gen-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgb(0 0 0 / .4);
}
.ai-gen-progress > span {
  display: block;
  height: 100%;
  background-image: var(--gradient-primary);
  transition: width .4s ease;
}
.ai-gen-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-gen-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ai-gen-top b { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-gen-date { font-size: 11px; color: var(--muted-foreground); }
.ai-gen-actions { display: flex; gap: 6px; margin-top: 2px; }
.ai-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: var(--foreground);
  cursor: pointer;
  transition: transform .1s, filter .1s;
}
.ai-icon-btn:hover { filter: brightness(1.15); }
.ai-icon-btn:active { transform: scale(.9); }
.ai-icon-btn.on { color: var(--warning); border-color: color-mix(in oklab, var(--warning) 40%, transparent); }
.ai-status { display: inline-flex; align-items: center; }

/* --------------------------------------------------------- Reproductor */
.ai-player {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}
.ai-player video { display: block; width: 100%; height: auto; max-height: 70vh; background: #000; }
.ai-player-img img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: oklch(0.12 0.01 286); }
.ai-player-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  background: var(--secondary);
  color: var(--foreground);
}
.ai-player-dl:hover { filter: brightness(1.1); }

/* ---------------------------------------------------- Formulario generar */
.ai-field { margin-bottom: 14px; }
.ai-field > label { margin-top: 0; }
.ai-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-choice button {
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: var(--secondary);
  color: var(--muted-foreground);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s;
}
.ai-choice button:active { transform: scale(.96); }
.ai-choice button.on {
  background-image: var(--gradient-primary);
  color: var(--primary-foreground);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}
.ai-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-xl);
  border: 1px dashed color-mix(in oklab, var(--border) 90%, transparent);
  background: color-mix(in oklab, var(--secondary) 50%, transparent);
  cursor: pointer;
}
.ai-drop.has { border-style: solid; border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.ai-drop img { width: 48px; height: 48px; border-radius: var(--radius-md); object-fit: cover; }
.ai-drop small { display: block; color: var(--muted-foreground); font-size: 11px; }
.ai-counter { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-foreground); margin-top: 4px; }

.ai-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-2xl);
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  box-shadow: var(--shadow-glow);
  margin-bottom: 12px;
}
.ai-price-bar .lbl { font-size: 12px; color: var(--muted-foreground); }
.ai-price-bar .val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.ai-price-bar .val small { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }

/* ------------------------------------------------------------- Detalle */
.ai-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 50%, transparent); font-size: 13px; }
.ai-kv:last-child { border-bottom: 0; }
.ai-kv span:first-child { color: var(--muted-foreground); }
.ai-kv span:last-child { font-weight: 600; text-align: right; word-break: break-word; }
.ai-prompt {
  font-size: 13px;
  line-height: 1.5;
  color: var(--foreground);
  background: color-mix(in oklab, var(--secondary) 55%, transparent);
  border-radius: var(--radius-xl);
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------- Admin */
.ai-plat-card {
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: var(--radius-2xl);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.ai-plat-head { display: flex; align-items: center; gap: 12px; }
.ai-plat-head .grow { flex: 1; min-width: 0; }
.ai-plat-head b { font-size: 15px; font-weight: 800; display: block; }
.ai-plat-head small { font-size: 12px; color: var(--muted-foreground); }
.ai-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.ai-kpi {
  background: color-mix(in oklab, var(--secondary) 60%, transparent);
  border-radius: var(--radius-lg);
  padding: 10px;
  text-align: center;
}
.ai-kpi small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.ai-kpi b { font-size: 14px; font-weight: 800; }
.ai-plat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-plat-actions .btn { width: auto; }

.ai-model-card {
  background: color-mix(in oklab, var(--secondary) 45%, transparent);
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: var(--radius-xl);
  padding: 12px;
  margin-bottom: 10px;
}
.ai-model-card .row { margin-bottom: 6px; }
.ai-model-card .name { font-size: 14px; font-weight: 700; }
.ai-model-card .meta { font-size: 11px; color: var(--muted-foreground); }
.ai-mult { display: flex; gap: 6px; }
.ai-mult button {
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: var(--secondary);
  color: var(--foreground);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ai-mult button.on { background-image: var(--gradient-primary); color: var(--primary-foreground); border-color: transparent; }
.ai-profit { font-size: 12px; font-weight: 700; }
.ai-profit.up { color: var(--success); }
.ai-profit.down { color: var(--destructive); }

.ai-driver-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-driver-pick button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: var(--secondary);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--foreground);
}
.ai-driver-pick button b { font-size: 13px; }
.ai-driver-pick button small { font-size: 10px; color: var(--muted-foreground); }
.ai-driver-pick button.on { border-color: var(--ring); background: color-mix(in oklab, var(--primary) 16%, transparent); }

.ai-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ai-tabs button {
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: var(--secondary);
  color: var(--muted-foreground);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ai-tabs button.on { background-image: var(--gradient-primary); color: var(--primary-foreground); border-color: transparent; }

.ai-empty { padding: 32px 16px; text-align: center; color: var(--muted-foreground); font-size: 14px; }
.ai-empty .big { display: flex; justify-content: center; margin-bottom: 10px; opacity: .6; }

/* ---------------------------------------------- Tiles home (Inicio IA) */
.ai-home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.ai-home-actions .action { align-items: flex-start; text-align: left; }
.ai-home-actions .action .ico { border-radius: var(--radius-lg); }
.ai-home-actions .action small { display: block; }

.ai-quick { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-bottom: 4px; }
.ai-quick::-webkit-scrollbar { display: none; }
.ai-quick a {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
}

/* ------------------------------------------------ Responsive (desktop) */
@media (min-width: 640px) {
  .ai-gen-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .ai-gen-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-home-actions { grid-template-columns: repeat(4, 1fr); }
  .ai-driver-pick { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .ai-gen-grid { grid-template-columns: 1fr; }
}

/* ======================================================================
   Ajustes de fidelidad visual (según mockups de referencia)
   ====================================================================== */

/* ------------------- Catálogo de plataformas en grilla 2x2 ------------------- */
.ai-plat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-plat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  min-height: 132px;
  padding: 18px 12px;
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  animation: popIn .22s ease both;
  transition: transform .08s, border-color .1s;
}
.ai-plat-tile:active { transform: scale(.97); }
.ai-plat-tile:hover { border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.ai-plat-tile .ai-avatar { box-shadow: 0 8px 20px -10px rgb(0 0 0 / .9); }
.ai-plat-tile .t { font-size: 14px; font-weight: 800; line-height: 1.15; }
.ai-plat-tile .m { font-size: 11px; font-weight: 600; color: var(--muted-foreground); }
.ai-plat-tile .n {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 16%, transparent);
  color: var(--primary-glow);
  border: 1px solid color-mix(in oklab, var(--primary) 26%, transparent);
}
@media (min-width: 640px) { .ai-plat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .ai-plat-grid { grid-template-columns: repeat(4, 1fr); } }

.ai-top-badge{display:inline-flex;align-items:center;font-size:9px;font-weight:800;letter-spacing:.06em;padding:2px 7px;border-radius:6px;background-image:var(--gradient-primary);color:var(--primary-foreground);box-shadow:var(--shadow-glow)}
/* ------------------------- Vista previa (generar) ------------------------- */
.ai-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-2xl);
  border: 1px dashed color-mix(in oklab, var(--border) 90%, transparent);
  background: color-mix(in oklab, var(--secondary) 45%, transparent);
  color: var(--muted-foreground);
  text-align: center;
  overflow: hidden;
  margin-bottom: 14px;
}
.ai-preview .play {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 34%, transparent);
  color: var(--primary-glow);
}
.ai-preview .cap { font-size: 13px; font-weight: 600; }
.ai-preview .sub { font-size: 11px; }
.ai-preview img, .ai-preview video { width: 100%; height: 100%; object-fit: cover; }

/* --------------------- Contador de duración (- valor +) --------------------- */
.ai-stepper {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: var(--secondary);
  border-radius: var(--radius-xl);
  padding: 8px 10px;
}
.ai-stepper button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--primary) 14%, transparent);
  color: var(--primary-glow);
  font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer;
}
.ai-stepper button:active { transform: scale(.92); }
.ai-stepper .val { font-size: 18px; font-weight: 800; text-align: center; flex: 1; }
.ai-stepper .val small { display: block; font-size: 10px; font-weight: 600; color: var(--muted-foreground); }

/* -------------------- Tarjetas home con chevron (Inicio) -------------------- */
.ai-home-actions .action { position: relative; }
.ai-home-actions .action .chev {
  position: absolute; right: 12px; top: 12px;
  color: var(--muted-foreground); opacity: .8;
}

/* ---------------------- Admin: saldo plataforma (rojo) ---------------------- */
.ai-plat-bal { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.ai-plat-bal .l { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.ai-plat-bal .v { font-size: 14px; font-weight: 800; color: var(--destructive); }
.ai-plat-bal .v.ok { color: var(--success); }

/* ======================================================================
   Inicio: tarjetas horizontales (icono a la izquierda, texto, chevron)
   ====================================================================== */
.ai-home-actions .action.home-card {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px;
  text-align: left;
  min-height: 76px;
}
.ai-home-actions .action.home-card .ico {
  position: relative;
  flex: none;
  height: 44px;
  width: 44px;
  border-radius: 999px;
  background-image: var(--gradient-primary);
  color: var(--primary-foreground);
  box-shadow: 0 8px 18px -10px oklch(0.58 0.222 296 / 0.9);
}
.ai-home-actions .action.home-card .ico-dot {
  position: absolute;
  right: -1px;
  top: -1px;
  height: 10px;
  width: 10px;
  border-radius: 999px;
  background: var(--destructive);
  box-shadow: 0 0 0 2px var(--card);
}
.ai-home-actions .action.home-card .txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.ai-home-actions .action.home-card .txt b { font-size: 13.5px; font-weight: 800; line-height: 1.15; }
.ai-home-actions .action.home-card .txt small { font-size: 11px; color: var(--muted-foreground); }
.ai-home-actions .action.home-card .chev {
  position: static;
  flex: none;
  color: var(--muted-foreground);
  opacity: .7;
  display: flex;
}

/* Home: cuatro accesos directos (grilla 2x2) */
.grid2 .action.home-card {
  position: relative;
  gap: 8px;
  padding: 18px 12px;
  text-align: center;
}
.grid2 .action.home-card .ico {
  height: 54px;
  width: 54px;
  border-radius: 999px;
  background-image: var(--gradient-primary);
  box-shadow: 0 12px 24px -12px oklch(0.58 0.222 296 / 0.95), inset 0 1px 0 oklch(1 0 0 / 0.25);
}
.grid2 .action.home-card .ico svg { width: 26px; height: 26px; }
.grid2 .action.home-card b { font-size: 14px; font-weight: 800; line-height: 1.2; }
.grid2 .action.home-card small { font-size: 11px; line-height: 1.25; color: var(--muted-foreground); }
.grid2 .action.home-card .chev {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--muted-foreground);
  opacity: .65;
}

/* ---- Encabezado de categoría en el catálogo de modelos ---- */
.ai-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 2px 10px;
}
.ai-cat-head:first-of-type { margin-top: 6px; }
.ai-cat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: 10px;
  color: var(--primary-glow);
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 34%, transparent);
  flex: none;
}
.ai-cat-name { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.ai-cat-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  background: color-mix(in oklab, var(--muted-foreground) 14%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
}

/* ---- Formulario público de generación ---- */
.ai-gen-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 2px 8px;
  box-sizing: border-box;
}
.ai-gen-wrap form { display: flex; flex-direction: column; gap: 14px; }
.ai-gen-wrap select,
.ai-gen-wrap textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.ai-gen-modelhead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ai-gen-modeltxt {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.ai-gen-modeltxt b {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.ai-gen-modeltxt .ai-tag { align-self: flex-start; }
.ai-gen-desc {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}
@media (max-width: 430px) {
  .ai-gen-wrap { padding: 0 0 6px; }
  .ai-gen-wrap form { gap: 12px; }
  .ai-gen-modelhead { gap: 10px; }
  .ai-gen-modeltxt b { font-size: 14px; }
}

/* ==========================================================================
   Generador público: botón de ajustes, modal centrado y pantalla de carga
   ========================================================================== */
body.ai-noscroll { overflow: hidden; }

.ai-cfgbtn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
  color: var(--foreground); text-align: left; font: inherit;
  transition: border-color .15s;
}
.ai-cfgbtn:hover { border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.ai-cfgbtn-ico { display: inline-flex; color: var(--primary-glow); flex: none; }
.ai-cfgbtn-txt { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-cfgbtn-chev { display: inline-flex; color: var(--muted-foreground); flex: none; }

.ai-balance {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 26%, transparent);
  border-radius: 14px; padding: 11px 14px; font-size: 12.5px; color: var(--muted-foreground);
}
.ai-balance b { font-size: 15px; font-weight: 800; color: var(--primary-glow); }

/* Modal centrado de configuración */
.ai-cfg-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.ai-cfg-backdrop[hidden] { display: none; }
.ai-cfg-sheet {
  width: 100%; max-width: 24rem; max-height: calc(100dvh - 28px);
  background: var(--card); border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 24px; padding: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
  display: flex; flex-direction: column; animation: aiCfgIn .18s ease;
}
@keyframes aiCfgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.ai-cfg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ai-cfg-head b { font-size: 15px; font-weight: 800; }
.ai-cfg-x {
  border: 0; background: var(--secondary); color: var(--foreground); border-radius: 999px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; line-height: 1;
}
.ai-cfg-model {
  background: color-mix(in oklab, var(--background) 55%, transparent);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
}
.ai-cfg-model .ai-gen-desc { margin: 6px 0 0; font-size: 11.5px; }
.ai-cfg-body { display: flex; flex-direction: column; gap: 14px; }
.ai-cfg-block label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: 7px; }
.ai-cfg-foot { margin-top: 16px; }
.ai-cfg-foot .btn { width: 100%; justify-content: center; }

/* Pantalla de carga animada */
.ai-load {
  position: fixed; inset: 0; z-index: 95; background: rgba(6,4,12,.86);
  backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ai-load[hidden] { display: none; }
.ai-load-card {
  width: 100%; max-width: 22rem; text-align: center; padding: 26px 20px;
  background: var(--card); border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 26px; box-shadow: 0 30px 90px -20px rgba(0,0,0,.85);
  animation: aiCfgIn .22s ease;
}
.ai-ring {
  width: 112px; height: 112px; margin: 0 auto 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; position: relative;
  background: conic-gradient(var(--primary) 0deg, rgba(255,255,255,.10) 0deg);
  transition: background .25s linear;
}
.ai-ring::before {
  content: ""; position: absolute; inset: 9px; border-radius: 999px;
  background: var(--card);
}
.ai-ring span {
  position: relative; z-index: 1; font-size: 24px; font-weight: 800;
  color: var(--primary-glow); letter-spacing: -.02em;
}
.ai-load-title { margin: 0; font-size: 16px; font-weight: 800; }
.ai-load-sub { margin: 6px 0 14px; font-size: 12.5px; color: var(--muted-foreground); min-height: 18px; }
.ai-load-bar {
  height: 6px; border-radius: 999px; background: var(--secondary); overflow: hidden; margin-bottom: 14px;
}
.ai-load-bar span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background-image: var(--gradient-primary); transition: width .3s ease;
}
.ai-load-note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted-foreground); }
@media (max-width: 430px) {
  .ai-cfg-sheet { padding: 16px; border-radius: 20px; }
  .ai-load-card { padding: 22px 16px; }
  .ai-ring { width: 96px; height: 96px; }
  .ai-ring span { font-size: 21px; }
}

/* Carga animada dentro de la página de resultado */
.ai-load-inline {
  text-align: center; padding: 26px 18px;
  background-image: var(--gradient-surface);
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 22px; margin-bottom: 14px;
}
.ai-load-inline .ai-ring { margin-bottom: 14px; }
.ai-load-inline .ai-load-bar { max-width: 280px; margin: 0 auto 12px; }
.ai-saved-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; color: var(--muted-foreground); margin: 10px 0 0;
}
.ai-saved-note a { color: var(--primary-glow); font-weight: 700; text-decoration: none; }

/* ===== Vista previa del modelo (video de ejemplo visible antes de generar) ===== */
.ai-prev-wrap{position:relative;margin-top:10px;border-radius:14px;overflow:hidden;background:#000;border:1px solid color-mix(in oklab,var(--border) 70%,transparent)}
.ai-prev-video{display:block;width:100%;max-height:260px;object-fit:contain;background:#000}
.ai-prev-badge{position:absolute;top:8px;left:8px;display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:800;letter-spacing:.02em;color:#fff;background:rgba(0,0,0,.55);backdrop-filter:blur(6px);padding:4px 8px;border-radius:999px;pointer-events:none}
.ai-prev-wrap.compact .ai-prev-video{max-height:150px}
@media (max-width:520px){.ai-prev-video{max-height:200px}.ai-prev-wrap.compact .ai-prev-video{max-height:120px}}
