/* ─────────────────────────────────────────────────────────────────────────
   Moodly — AI Image Studio
   styles.css
───────────────────────────────────────────────────────────────────────── */

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

:root {
  --bg-0:        #07060A;
  --bg-1:        #0B0A10;
  --bg-2:        #110F18;

  --glass-1:     rgba(22, 20, 30, 0.55);
  --glass-2:     rgba(28, 25, 38, 0.65);
  --glass-hi:    rgba(38, 33, 50, 0.70);
  --glass-stroke: rgba(255, 255, 255, 0.07);
  --glass-stroke-hi: rgba(255, 255, 255, 0.13);

  --o:           #FF6A00;
  --o-2:         #FF8A1F;
  --o-3:         #FFB266;
  --o-soft:      rgba(255, 106, 0, 0.14);
  --o-soft-2:    rgba(255, 106, 0, 0.06);
  --o-glow:      rgba(255, 122, 30, 0.35);
  --o-stroke:    rgba(255, 122, 30, 0.45);

  --t-hi:        #F4F1EC;
  --t-mid:       #C4C0CC;   /* was #B7B3BD — +8% luminance, better body text */
  --t-low:       #918CA0;   /* was #6E6975 — passes AA on all glass surfaces */
  --t-faint:     #6A6578;   /* was #43404B — was barely 2.5:1, now ~5:1 */

  --success:     #5DE3A0;
  --error:       #FF5577;

  --f-display:   'Instrument Serif', 'Times New Roman', serif;
  --f-ui:        'Geist', system-ui, sans-serif;
  --f-mono:      'Geist Mono', ui-monospace, monospace;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --t-fast: 180ms cubic-bezier(.4,0,.2,1);
  --t-med:  280ms cubic-bezier(.4,0,.2,1);
  --t-slow: 520ms cubic-bezier(.22,.61,.36,1);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--t-hi);
  font-family: var(--f-ui);
  font-feature-settings: "ss01", "cv01";
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  transition: visibility 0s, opacity 180ms ease;
}

/* ─── DARK SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.10) transparent; }

/* Grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035; pointer-events: none; mix-blend-mode: overlay;
}

/* ─── AMBIENT LIGHTS ─── */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.55;
  animation: float 22s ease-in-out infinite;
}
.orb.a {
  width: 580px; height: 580px;
  background: radial-gradient(circle, rgba(255,106,0,0.55) 0%, transparent 70%);
  top: -180px; left: -120px;
}
.orb.b {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,138,31,0.30) 0%, transparent 70%);
  bottom: -200px; right: -100px;
  animation-delay: -8s;
}
.orb.c {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(120,80,255,0.18) 0%, transparent 70%);
  top: 40%; left: 55%;
  animation-delay: -14s;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(40px,-30px) scale(1.08); }
}

/* ─── LAYOUT ─── */
.shell {
  position: relative; z-index: 1;
  margin-left: 280px;
  margin-right: 220px;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed; left: 0; top: 0;
  width: 280px; height: 100vh; z-index: 10;
  padding: 28px 22px;
  display: flex; flex-direction: column; gap: 28px;
  /* En pantallas bajas el pie (créditos) quedaría cortado: scroll propio, igual
     que el sidebar de Shorts Studio. */
  overflow-y: auto;
  border-right: 1px solid var(--glass-stroke);
  background: linear-gradient(180deg, rgba(11,10,16,0.6), rgba(7,6,10,0.4));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 6px;
  text-decoration: none; color: inherit;
}
.brand-mark {
  width: 38px; height: 38px;
  background: transparent; border: none; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.brand-mark img { width: 38px; height: 38px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--f-ui);
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.035em; color: var(--o);
}
.brand-tag {
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--t-low);
  margin-top: 2px;
}

.nav-label {
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--t-faint);
  padding: 0 10px; margin-bottom: 4px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--t-mid); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: all var(--t-fast);
  position: relative;
}
.nav-item:hover {
  color: var(--t-hi);
  background: rgba(255,255,255,0.02);
}
.nav-item.active {
  color: var(--t-hi);
  background: var(--glass-1);
  border-color: var(--glass-stroke-hi);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -22px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: var(--o);
  box-shadow: 0 0 14px var(--o-glow);
}
.nav-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg { width: 17px; height: 17px; stroke-width: 1.6; }
.nav-item.active .nav-icon { color: var(--o-2); }
.nav-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-num { font-family: var(--f-mono); font-size: 9px; color: var(--t-low); letter-spacing: 0.1em; }
.nav-item.active .nav-num { color: var(--o-2); }

/* Product switcher — segmento superior compartido por ambas apps */
.nav.switcher { gap: 6px; }
.nav-item.switch { text-decoration: none; }
.nav-item.switch .nav-num { text-transform: uppercase; letter-spacing: 0.14em; }
.nav-item.switch.active::before { display: none; }
.nav-item.switch.active {
  background: var(--o-soft); border-color: var(--o-stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.nav-item.switch.active .nav-icon { color: var(--o-2); }

.side-foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.credits-card {
  padding: 14px;
  border-radius: var(--r);
  background: var(--glass-1);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(20px);
}
.credits-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.credits-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--t-low);
}
/* Moneda de marca: da identidad al saldo sin robar protagonismo al número */
.credits-coin {
  width: 20px; height: 20px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(255,170,40,0.28));
}
.credits-val {
  font-family: var(--f-display); font-style: italic;
  font-size: 22px; color: var(--t-hi);
}
.credits-val .credits-total { color: var(--t-low); font-size: 14px; }
.credits-bar {
  height: 3px; border-radius: 99px; background: rgba(255,255,255,0.04);
  overflow: hidden; margin-bottom: 6px;
}
.credits-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--o), var(--o-3));
  box-shadow: 0 0 8px var(--o-glow);
  transition: width 0.6s cubic-bezier(.22,.61,.36,1);
}
.credits-foot { font-size: 11px; color: var(--t-low); }
.credits-foot a { color: var(--o-2); text-decoration: none; font-weight: 500; }

/* Botón de compra del sidebar. Antes era un enlace de 11px perdido en una línea
   de texto; siendo la única vía de ingreso, merece ser el elemento con más peso
   de la tarjeta. */
.btn-get-more {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 10px; padding: 9px 14px;
  border-radius: 9px; cursor: pointer;
  border: 1px solid var(--o-stroke);
  background: linear-gradient(180deg, rgba(255,138,31,0.16), rgba(255,106,0,0.08));
  color: var(--o-3);
  font-family: var(--f-ui); font-size: 12.5px; font-weight: 700;
  letter-spacing: -0.01em;
  transition: all var(--t-fast);
}
.btn-get-more:hover {
  background: linear-gradient(180deg, var(--o-2), var(--o));
  color: #0E0A05; border-color: rgba(255,180,100,0.5);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px var(--o-glow);
}
.btn-get-more img { width: 15px; height: 15px; object-fit: contain; }
.btn-get-more:hover img { filter: brightness(0.25) saturate(0); }
/* Sin créditos: deja de ser una sugerencia y pasa a ser la salida. */
.credits-card.empty .btn-get-more {
  background: linear-gradient(180deg, var(--o-2), var(--o));
  color: #0E0A05; border-color: rgba(255,180,100,0.5);
  animation: getMorePulse 2.4s ease-in-out infinite;
}
.credits-card.empty .btn-get-more img { filter: brightness(0.25) saturate(0); }
@keyframes getMorePulse {
  0%, 100% { box-shadow: 0 6px 18px -10px var(--o-glow); }
  50%      { box-shadow: 0 10px 26px -8px var(--o-glow); }
}
@media (prefers-reduced-motion: reduce) { .credits-card.empty .btn-get-more { animation: none; } }

/* ─── MAIN ─── */
.main { padding: 36px 64px 40px; max-width: 1100px; margin-inline: auto; width: 100%; }
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeUp 0.5s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HERO ─── */
.hero { margin-bottom: 28px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 99px;
  background: var(--glass-1);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(14px);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--t-mid);
  margin-bottom: 22px;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--o); box-shadow: 0 0 10px var(--o-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 400; line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--t-hi); margin-bottom: 12px;
}
.hero-title em { font-style: italic; color: var(--o-2); }
.hero-desc {
  font-size: 13.5px; color: var(--t-mid); line-height: 1.55;
  max-width: 520px; letter-spacing: -0.005em;
}

/* ─── FORM LAYOUT ─── */
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;        /* columns grow to equal height */
}
.form-col-left  { display: flex; flex-direction: column; gap: 10px; grid-column: 1; }
.form-col-right { display: flex; flex-direction: column; gap: 10px; grid-column: 2; }
.form-full      { grid-column: 1 / -1; }

/* Upload card stretches to fill its column */
.form-col-left .card:first-child {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.form-col-left .card:first-child .card-head { flex-shrink: 0; }
.form-col-left .card:first-child .drop-zone {
  flex: 1;
  min-height: 80px;
}
.form-col-left .card:first-child .drop-preview {
  flex: 1;
  min-height: 80px;
}
.form-col-left .card:first-child .drop-preview img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.card {
  background: var(--glass-1);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 32px -16px rgba(0,0,0,0.5);
  transition: border-color var(--t-fast);
}
.card.invalid { border-color: var(--error); }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-num {
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: 0.14em;
  color: var(--o-2); background: var(--o-soft-2);
  border: 1px solid var(--o-stroke);
  padding: 2px 6px; border-radius: 5px;
  min-width: 24px; text-align: center;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--t-hi); letter-spacing: -0.005em; }
.card-sub   { font-size: 11px; color: var(--t-low); margin-left: auto; }

/* ─── DETAILS DISCLOSURE ─── */
details.extra {
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.012);
  transition: border-color var(--t-fast);
}
details.extra[open] {
  border-color: var(--glass-stroke-hi);
  background: rgba(255,255,255,0.02);
}
details.extra summary {
  list-style: none; cursor: pointer;
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--t-mid);
  user-select: none; transition: color var(--t-fast);
}
details.extra summary::-webkit-details-marker { display: none; }
details.extra summary:hover { color: var(--t-hi); }
.extra-icon {
  width: 14px; height: 14px;
  stroke: var(--t-low); stroke-width: 1.6; fill: none;
  transition: transform var(--t-med), stroke var(--t-fast);
}
details.extra[open] .extra-icon { transform: rotate(45deg); stroke: var(--o-2); }
.extra-label { flex: 1; }
.extra-hint {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-faint);
}
details.extra > div.extra-body { padding: 0 14px 14px; }

/* ─── DROP ZONE ─── */
.drop-zone {
  border: 1.5px dashed var(--glass-stroke-hi);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.015);
  padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; position: relative;
  min-height: 100px; text-align: center;
  transition: all var(--t-med);
  overflow: hidden;
}
.drop-zone::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--o-soft) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--t-med); pointer-events: none;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--o-stroke);
  background: rgba(255,106,0,0.03);
  transform: translateY(-1px);
}
.drop-zone:hover::before, .drop-zone.dragover::before { opacity: 1; }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }

.drop-icon-wrap {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--glass-2); border: 1px solid var(--glass-stroke-hi);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: all var(--t-med);
}
.drop-zone:hover .drop-icon-wrap { border-color: var(--o-stroke); background: var(--o-soft-2); }
.drop-icon-wrap svg { width: 16px; height: 16px; stroke: var(--t-mid); stroke-width: 1.5; fill: none; transition: stroke var(--t-fast); }
.drop-zone:hover .drop-icon-wrap svg { stroke: var(--o-2); }

.drop-label { font-size: 12.5px; color: var(--t-mid); line-height: 1.35; text-align: center; }
.drop-label strong { color: var(--t-hi); font-weight: 600; display: block; font-size: 13px; }
.drop-label .drop-sub { color: var(--t-low); font-size: 11px; }
.drop-formats {
  font-family: var(--f-mono); font-size: 9px;
  color: var(--t-low); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--glass-stroke); border-radius: 5px;
}

.drop-preview {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: rgba(0,0,0,0.4); border: 1px solid var(--glass-stroke);
}
.drop-preview img { width: 100%; max-height: 320px; object-fit: contain; display: block; }
.preview-overlay { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.preview-meta {
  position: absolute; bottom: 10px; left: 10px;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-stroke);
  font-family: var(--f-mono); font-size: 10px; color: var(--t-mid); letter-spacing: 0.04em;
}
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(0,0,0,0.7); border: 1px solid var(--glass-stroke-hi);
  backdrop-filter: blur(10px); color: var(--t-hi);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--error); border-color: var(--error); }
.icon-btn svg { width: 14px; height: 14px; stroke-width: 2; fill: none; stroke: currentColor; }

/* ─── OPTION CARDS ─── */
.grid { display: grid; gap: 8px; }
.grid.cols-3 { grid-template-columns: repeat(3,1fr); }
.grid.cols-4 { grid-template-columns: repeat(4,1fr); }
.grid.cols-2 { grid-template-columns: repeat(2,1fr); }

/* ─── OPTION GROUPS (varios grids con su propia etiqueta dentro de una card) ─── */
.opt-group + .opt-group { margin-top: 16px; }
.opt-group-label {
  display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--t-low); margin-bottom: 8px;
}
/* Ambient/Time se apagan (no se ocultan: conservan la selección) cuando
   "preservar entorno original" está activo. */
.opt-group.locked { opacity: 0.35; pointer-events: none; filter: grayscale(0.6); transition: opacity var(--t-fast), filter var(--t-fast); }

/* ─── ENVIRONMENT PRESERVE TOGGLE ─── */
.env-preserve {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--glass-stroke); border-radius: var(--r-sm);
  background: var(--glass-2); cursor: pointer;
}
.env-preserve-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.env-preserve-title { font-size: 12px; font-weight: 600; color: var(--t-hi); }
.env-preserve-hint { font-size: 10.5px; color: var(--t-low); line-height: 1.35; }

.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch-track {
  display: block; width: 38px; height: 22px; border-radius: 999px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-stroke-hi);
  transition: background var(--t-fast), border-color var(--t-fast); position: relative;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--t-mid); transition: transform var(--t-fast), background var(--t-fast);
}
.switch input:checked + .switch-track { background: var(--o-soft); border-color: var(--o-stroke); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: var(--o-2); box-shadow: 0 0 8px var(--o-glow); }

.opt {
  position: relative; border: 1px solid var(--glass-stroke);
  border-radius: var(--r); background: var(--glass-2);
  cursor: pointer; overflow: hidden; transition: all var(--t-med);
}
.opt:hover { border-color: var(--glass-stroke-hi); transform: translateY(-2px); background: var(--glass-hi); }
.opt.selected {
  border-color: var(--o-stroke);
  background: linear-gradient(180deg, var(--o-soft-2), transparent), var(--glass-2);
  box-shadow: 0 0 0 3px var(--o-soft-2), 0 8px 28px -10px var(--o-glow);
}
.opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.opt-check {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1.5px solid var(--glass-stroke-hi);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast); z-index: 2;
}
.opt.selected .opt-check { background: var(--o); border-color: var(--o); box-shadow: 0 0 12px var(--o-glow); }
.opt-check svg { width: 9px; height: 9px; stroke: #0a0810; stroke-width: 3; fill: none; opacity: 0; transition: opacity var(--t-fast); }
.opt.selected .opt-check svg { opacity: 1; }

.opt-thumb { aspect-ratio: 16/6; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.opt-thumb svg.viz { width: 100%; height: 100%; }

.opt-body { padding: 7px 10px 9px; }
.opt-name { font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--t-hi); margin-bottom: 3px; }
.opt-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.opt-tag {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.06em;
  color: var(--t-low); padding: 1px 5px; border-radius: 4px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--glass-stroke);
}
.opt.selected .opt-tag { color: var(--o-3); border-color: var(--o-stroke); background: var(--o-soft-2); }

.opt.small .opt-thumb { aspect-ratio: unset; padding: 14px 0 6px; flex-direction: column; gap: 4px; }
.ratio-vis { border: 1.5px solid var(--t-low); border-radius: 3px; background: rgba(255,255,255,0.04); transition: all var(--t-fast); }
.opt.selected .ratio-vis { border-color: var(--o-2); background: var(--o-soft); box-shadow: 0 0 12px var(--o-soft); }
.ratio-sq { width: 26px; height: 26px; }
.ratio-v  { width: 18px; height: 30px; }
.ratio-h  { width: 30px; height: 18px; }
.opt.small .opt-body { padding: 4px 8px 10px; text-align: center; }
.opt.small .opt-name { font-size: 12px; margin-bottom: 1px; }
.opt-sub { font-family: var(--f-mono); font-size: 9px; color: var(--t-low); letter-spacing: 0.08em; }
.opt.small .opt-check { top: 6px; right: 6px; width: 16px; height: 16px; }

.angle-icon { width: 26px; height: 26px; stroke: var(--t-mid); fill: none; stroke-width: 1.4; transition: stroke var(--t-fast); }
.opt.selected .angle-icon { stroke: var(--o-2); }

/* ─── TEXT INPUTS ─── */
textarea, input[type="text"] {
  width: 100%;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-sm);
  color: var(--t-hi);
  font-family: var(--f-mono); font-size: 12px;
  padding: 9px 12px; resize: vertical; outline: none;
  transition: all var(--t-fast); backdrop-filter: blur(10px);
}
textarea:focus, input[type="text"]:focus {
  border-color: var(--o-stroke);
  background: rgba(255,255,255,0.035);
  box-shadow: 0 0 0 3px var(--o-soft-2);
}
textarea { min-height: 60px; line-height: 1.55; }
::placeholder { color: var(--t-low); }

/* ─── MODEL SEGMENT ─── */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: rgba(0,0,0,0.2); border: 1px solid var(--glass-stroke);
  border-radius: var(--r-sm); padding: 4px;
}
.seg-opt {
  position: relative; border-radius: 8px; padding: 9px 12px;
  cursor: pointer; transition: all var(--t-fast); border: 1px solid transparent;
}
.seg-opt:hover { background: rgba(255,255,255,0.025); }
.seg-opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg-opt.selected { background: var(--glass-hi); border-color: var(--glass-stroke-hi); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.seg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.seg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t-faint); transition: all var(--t-fast); }
.seg-opt.selected .seg-dot { background: var(--o); box-shadow: 0 0 10px var(--o-glow); }
.seg-badge { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-low); }
.seg-opt.selected .seg-badge { color: var(--o-2); }
.seg-name { font-family: var(--f-mono); font-size: 11px; color: var(--t-hi); font-weight: 500; margin-bottom: 2px; }
.seg-desc { font-size: 10.5px; color: var(--t-low); line-height: 1.45; }

/* ─── SHOTS COUNT SELECTOR (product · 1–4) ─── */
.shots-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shots-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px 10px; border-radius: var(--r-sm);
  background: var(--glass-1); border: 1px solid var(--glass-stroke);
  cursor: pointer; text-align: center; transition: all var(--t-fast);
}
.shots-opt:hover { border-color: var(--glass-stroke-hi); background: rgba(255,255,255,0.025); }
.shots-opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shots-opt.selected {
  background: var(--o-soft); border-color: var(--o-stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.shots-n { font-family: var(--f-display); font-style: italic; font-size: 24px; line-height: 1; color: var(--t-hi); }
.shots-opt.selected .shots-n { color: var(--o-2); }
.shots-lbl { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-low); }
.shots-opt.selected .shots-lbl { color: var(--o-2); }

/* ─── SUBMIT ROW (logo / product — single card) ─── */
.submit-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--glass-1);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 32px -16px rgba(0,0,0,0.5);
}
.submit-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.submit-info-label { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--t-low); }
.submit-info-val { font-size: 13px; color: var(--t-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.submit-info-val .empty { color: var(--t-faint); font-style: italic; }

/* ─── BOTTOM ROW — render / interior (2 cards) ─── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Extra-details card */
.extra-card {
  display: flex; flex-direction: column; gap: 8px;
}
.extra-card textarea {
  flex: 1; min-height: 64px; resize: none; overflow: hidden;
}

/* Submit / generate card */
.submit-card {
  display: flex; flex-direction: column; gap: 10px;
}
.submit-card .submit-info { flex: none; }
.submit-card .status-msg  { margin: 0; }
.submit-card .btn-gen {
  margin-top: auto;
  width: 100%; justify-content: center;
}

/* Coste de generación: siempre visible junto al botón de generar */
.cost-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--o-stroke); background: var(--o-soft-2);
  align-self: flex-start;
}
.cost-coin {
  width: 18px; height: 18px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(255,170,40,0.3));
}
.cost-amount { font-size: 13px; font-weight: 700; color: var(--o-3); line-height: 1; }
.cost-label {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--t-low);
}

.btn-gen {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--o-2), var(--o));
  color: #0E0A05; border: 1px solid rgba(255,180,100,0.4);
  border-radius: 10px; padding: 10px 20px;
  font-family: var(--f-ui); font-size: 13px; font-weight: 700;
  letter-spacing: -0.005em; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all var(--t-fast);
  box-shadow: 0 8px 24px -8px var(--o-glow), inset 0 1px 0 rgba(255,255,255,0.2);
  white-space: nowrap;
}
.btn-gen:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 32px -8px var(--o-glow), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-gen:active:not(:disabled) { transform: translateY(0); }
.btn-gen:disabled { background: var(--glass-2); color: var(--t-low); border-color: var(--glass-stroke); cursor: not-allowed; box-shadow: none; }
.btn-gen svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.2); border-top-color: #0E0A05;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: none;
}
.btn-gen.loading .btn-spinner { display: block; }
.btn-gen.loading .btn-icon, .btn-gen.loading .btn-label { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-msg { font-family: var(--f-mono); font-size: 11px; color: var(--t-low); display: none; max-width: 220px; line-height: 1.5; }
.status-msg.show { display: block; }
.status-msg.err  { color: var(--error); }
.status-msg.ok   { color: var(--success); }

/* ─── RESULT ─── */
.result-block { display: none; }
.result-block.loading { display: block; }
.result-block.show { display: block; margin-top: 28px; animation: fadeUp 0.55s cubic-bezier(.22,.61,.36,1) both; }

/* Hide real content while loading */
.result-block.loading .result-divider,
.result-block.loading .result-bar,
.result-block.loading .result-img-wrap,
.result-block.loading .results-grid,

/* ─── RESULT SKELETON ─── */
.result-skeleton { display: none; }
.result-block.loading .result-skeleton {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; margin-top: 28px;
  padding: 48px 20px;
  background: var(--glass-1);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-lg);
  min-height: 260px;
}
.sk-ring-wrap {
  position: relative; width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
}
.sk-ring {
  position: absolute; inset: 0;
  border: 2px solid rgba(255,255,255,0.05);
  border-top-color: var(--o); border-radius: 50%;
  animation: spin 1.1s cubic-bezier(.6,.2,.4,.8) infinite;
}
.sk-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--glass-2); border: 1px solid var(--glass-stroke-hi);
  display: flex; align-items: center; justify-content: center;
}
.sk-logo img { width: 30px; height: 30px; }
.sk-label {
  font-family: var(--f-display); font-style: italic;
  font-size: 20px; color: var(--t-hi); text-align: center;
}
.sk-msg {
  font-family: var(--f-mono); font-size: 10.5px;
  color: var(--t-low); letter-spacing: 0.12em;
  text-align: center;
  animation: skPulse 1.8s ease-in-out infinite;
}
@keyframes skPulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }
.sk-lines {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; max-width: 280px; margin-top: 8px;
}
.sk-line {
  height: 7px; border-radius: 99px;
  background: linear-gradient(90deg,
    var(--glass-1) 25%, var(--glass-hi) 50%, var(--glass-1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.sk-line.half { max-width: 55%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.result-divider { display: flex; align-items: center; gap: 14px; margin: 28px 0 20px; }
.result-divider::before, .result-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--glass-stroke-hi), transparent); }
.result-divider-txt { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--t-low); }

.result-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 14px 18px; background: var(--glass-1); border: 1px solid var(--glass-stroke);
  border-radius: var(--r); backdrop-filter: blur(20px); margin-bottom: 14px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-stroke); color: var(--t-mid);
}
.chip.hi { background: var(--o-soft-2); border-color: var(--o-stroke); color: var(--o-2); }

.btn-dl {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--o-stroke); color: var(--o-2);
  border-radius: 10px; padding: 8px 14px;
  font-family: var(--f-mono); font-size: 11px; cursor: pointer; transition: all var(--t-fast);
}
.btn-dl:hover { background: var(--o); color: #0E0A05; border-color: var(--o); }
.btn-dl svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; }

.result-img-wrap {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--glass-stroke); background: rgba(0,0,0,0.4); line-height: 0;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6);
}
.result-img-wrap img { width: 100%; max-height: 720px; object-fit: contain; display: block; }
.results-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.results-grid .result-img-wrap { box-shadow: none; }
.results-grid .result-img-wrap img { max-height: 380px; }


/* ─── GALLERY PANEL ─── */
.gallery-panel {
  position: fixed; right: 0; top: 0;
  width: 220px; height: 100vh; z-index: 10;
  border-left: 1px solid var(--glass-stroke);
  background: linear-gradient(180deg, rgba(11,10,16,0.6), rgba(7,6,10,0.4));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.gallery-head {
  padding: 20px 14px 12px;
  border-bottom: 1px solid var(--glass-stroke);
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
.gallery-title-label {
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--t-low);
}
.gallery-head-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 5px; min-width: 0;
}
.gallery-selection-count {
  font-family: var(--f-mono); font-size: 8px;
  color: var(--t-mid); white-space: nowrap;
}
.gallery-download-selected {
  border: 1px solid var(--glass-stroke-hi); border-radius: 7px;
  background: rgba(255,255,255,.035); color: var(--t-low);
  padding: 5px 7px; font-family: var(--f-mono);
  font-size: 8px; cursor: not-allowed; white-space: nowrap;
  transition: all var(--t-fast);
}
.gallery-download-selected.is-active {
  border-color: var(--o-stroke); background: var(--o-soft-2);
  color: var(--o-2); cursor: pointer;
}
.gallery-download-selected.is-active:hover {
  background: var(--o); color: #0E0A05;
}
.gallery-download-selected:disabled { opacity: .8; }

.gallery-scroll {
  flex: 1; overflow-y: auto; padding: 10px;
  scrollbar-width: thin; scrollbar-color: var(--glass-stroke-hi) transparent;
}
.gallery-scroll::-webkit-scrollbar { width: 4px; }
.gallery-scroll::-webkit-scrollbar-track { background: transparent; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--glass-stroke-hi); border-radius: 99px; }

.gallery-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.gallery-empty {
  grid-column: 1 / -1;
  padding: 28px 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  text-align: center;
}
.gallery-empty svg { color: var(--t-low); }
.gallery-empty p {
  font-size: 10.5px; color: var(--t-low); line-height: 1.55;
}
.gallery-item {
  position: relative; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--glass-stroke); cursor: pointer;
  transition: all var(--t-fast); background: rgba(0,0,0,0.4);
  aspect-ratio: 1;
}
.gallery-item:hover { border-color: var(--o-stroke); transform: scale(1.03); }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery-item-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 5px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
  font-family: var(--f-mono); font-size: 8px;
  color: var(--t-mid); letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.gallery-item-badge {
  position: absolute; top: 5px; right: 5px;
  background: var(--o); color: #0E0A05;
  font-family: var(--f-mono); font-size: 8px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
}
.gallery-select {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  width: 22px; height: 22px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(7,6,10,.78);
  border: 1px solid rgba(255,255,255,.2); cursor: pointer;
}
.gallery-select input {
  position: absolute; width: 1px; height: 1px; opacity: 0;
}
.gallery-select span {
  width: 11px; height: 11px; border: 1px solid var(--t-mid);
  border-radius: 3px; display: block;
}
.gallery-select input:checked + span {
  background: var(--o); border-color: var(--o);
  box-shadow: inset 0 0 0 2px #241205;
}
.gallery-select:focus-within { outline: 2px solid var(--o-2); outline-offset: 1px; }
/* Video items en la galería */
.gallery-vidph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--t-low); background: var(--glass-1);
}
.gallery-play {
  position: absolute; inset: 0; margin: auto;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); border: 1px solid var(--glass-stroke-hi);
  backdrop-filter: blur(6px); color: #fff; pointer-events: none;
  transition: all var(--t-fast);
}
.gallery-play svg { width: 15px; height: 15px; margin-left: 2px; }
.gallery-item:hover .gallery-play { background: var(--o); color: #0E0A05; border-color: var(--o); }

/* ─── IMAGE PREVIEW MODAL (gallery + results) ─── */
.gallery-preview-card {
  background: var(--bg-2);
  border: 1px solid var(--glass-stroke-hi);
  border-radius: var(--r-xl);
  padding: 20px;
  width: min(92vw, 760px);
  max-height: 92vh;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.03);
  animation: fadeUp 0.32s cubic-bezier(.22,.61,.36,1) both;
  position: relative;
  overflow: hidden;
}

/* Body area — filled by JS */
.gp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Single image */
.gp-img-wrap {
  flex: 1; min-height: 0;
  border-radius: var(--r);
  overflow: hidden;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--glass-stroke);
  display: flex; align-items: center; justify-content: center;
}
.gp-img-wrap img {
  width: 100%; height: 100%;
  max-height: calc(92vh - 130px);
  object-fit: contain; display: block;
}

/* Multi-shot 2×2 grid */
.gp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1; min-height: 0;
  overflow-y: auto;
}
.gp-grid-item {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--glass-stroke);
  background: rgba(0,0,0,0.4);
  position: relative;
  cursor: zoom-in;
  transition: border-color var(--t-fast);
}
.gp-grid-item:hover { border-color: var(--o-stroke); }
.gp-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gp-grid-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 5px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-family: var(--f-mono); font-size: 9px;
  color: var(--t-mid); letter-spacing: 0.1em; text-transform: uppercase;
}
.gp-grid-item-dl {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(0,0,0,0.65); border: 1px solid var(--glass-stroke-hi);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: var(--t-hi); cursor: pointer;
  opacity: 0; transition: opacity var(--t-fast);
}
.gp-grid-item:hover .gp-grid-item-dl { opacity: 1; }
.gp-grid-item-dl:hover { background: var(--o); border-color: var(--o); }
.gp-grid-item-dl svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Footer */
.gp-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-shrink: 0;
}
.gp-meta {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.gp-label {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--t-mid); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gp-badge {
  font-family: var(--f-mono); font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  background: var(--o); color: #0E0A05;
}
.gp-badge:empty { display: none; }
.gp-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Result images — clickable for preview */
.result-img-wrap { cursor: zoom-in; }
.result-img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
  pointer-events: none;
}
.result-img-wrap:hover::after { background: rgba(255,255,255,0.03); }

/* ─── LOADING OVERLAY ─── */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(7,6,10,0.85);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  flex-direction: column; align-items: center; justify-content: center; gap: 24px;
}
.loading-overlay.show { display: flex; }
.lo-ring-wrap { position: relative; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.lo-ring { position: absolute; inset: 0; border: 2px solid rgba(255,255,255,0.05); border-top-color: var(--o); border-radius: 50%; animation: spin 1.1s cubic-bezier(.6,.2,.4,.8) infinite; }
.lo-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--glass-stroke-hi); display: flex; align-items: center; justify-content: center; }
.lo-mark img { width: 38px; height: 38px; }
.lo-text { font-family: var(--f-display); font-style: italic; font-size: 24px; color: var(--t-hi); }
.lo-sub { font-family: var(--f-mono); font-size: 11px; color: var(--t-low); letter-spacing: 0.12em; transition: opacity 0.3s; }

/* ═══════════════════════════════════════════════════════════════════════════
   NEW ADDITIONS — cursor glow · toasts · upgrade modal · scroll reveal ·
   hero animations · mobile bottom nav · credits animation
═══════════════════════════════════════════════════════════════════════════ */

/* ─── CURSOR GLOW ─── */
.cursor-glow {
  position: fixed; pointer-events: none; z-index: 9996;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,106,0,0.05) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  will-change: left, top;
  transition: opacity 0.4s;
}

/* ─── TOAST SYSTEM ─── */
.toast-container {
  position: fixed; bottom: 28px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none; max-width: 320px;
}
.toast {
  padding: 12px 16px; border-radius: var(--r);
  background: var(--glass-hi); border: 1px solid var(--glass-stroke-hi);
  backdrop-filter: blur(24px); box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  font-size: 12.5px; color: var(--t-mid); font-family: var(--f-ui);
  pointer-events: auto; display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(10px) scale(0.97);
  transition: opacity 0.22s, transform 0.22s;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.success { border-color: rgba(93,227,160,0.3); }
.toast.success .toast-icon { color: var(--success); }
.toast.error   { border-color: rgba(255,85,119,0.3); }
.toast.error   .toast-icon { color: var(--error); }
.toast-icon { flex-shrink: 0; }
.toast-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── UPGRADE MODAL ─── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(7,6,10,0.88);
  backdrop-filter: blur(16px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.upgrade-card {
  background: var(--bg-2);
  border: 1px solid var(--glass-stroke-hi);
  border-radius: var(--r-xl); padding: 36px;
  max-width: 480px; width: 100%;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,106,0,0.08);
  animation: fadeUp 0.4s cubic-bezier(.22,.61,.36,1) both;
  position: relative;
}
.upgrade-coins {
  display: block; width: min(210px, 62%); height: auto;
  margin: -8px auto 14px;
  filter: drop-shadow(0 14px 26px rgba(255,150,30,0.22));
  animation: coinsIn 0.6s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes coinsIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
.upgrade-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  background: var(--o-soft); border: 1px solid var(--o-stroke);
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--o-2); margin-bottom: 20px;
}
.upgrade-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--o); box-shadow: 0 0 8px var(--o-glow); }
.upgrade-title { font-family: var(--f-display); font-style: italic; font-size: 34px; line-height: 1; color: var(--t-hi); margin-bottom: 10px; }
.upgrade-desc { font-size: 13.5px; color: var(--t-mid); line-height: 1.6; margin-bottom: 28px; }
.upgrade-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 18px;
  border-radius: 12px; border: 1px solid var(--glass-stroke);
  background: rgba(255,255,255,0.02);
}
.upgrade-seg-btn {
  border: 0; border-radius: 9px; padding: 9px 10px; cursor: pointer;
  background: transparent; color: var(--t-mid);
  font-family: var(--f-ui); font-size: 12.5px; font-weight: 600;
  transition: all var(--t-fast);
}
.upgrade-seg-btn:hover { color: var(--t-hi); }
.upgrade-seg-btn.active {
  background: var(--o-soft-2); border: 1px solid var(--o-stroke);
  color: var(--o-2); padding: 8px 9px;
}
.upgrade-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
/* Cuatro packs sueltos: 2x2 equilibrado, sin tarjeta huérfana en la última fila. */
.upgrade-packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
.upgrade-plans[hidden], .upgrade-packs[hidden] { display: none; }
.upgrade-packs .plan-card { padding: 16px 10px; }
.upgrade-packs .plan-credits { font-size: 30px; }
/* ── Tarjetas de plan / pack ───────────────────────────────────────────────
   "Destacado" y "seleccionado" son cosas DISTINTAS y deben verse distintas.
   Antes ambas pintaban el mismo fondo naranja y, al declararse .featured
   después con la misma especificidad, la tarjeta central ganaba siempre: se
   veía marcada permanentemente y no reaccionaba al elegir otra.
   Ahora: destacado = insignia arriba. Seleccionado = anillo naranja + check.  */
.plan-card {
  position: relative;
  padding: 18px 14px; border-radius: var(--r);
  border: 1px solid var(--glass-stroke);
  background: rgba(255,255,255,0.02); text-align: center;
  cursor: pointer; transition: all var(--t-fast);
}
.plan-card:hover { border-color: var(--o-stroke); background: rgba(255,255,255,0.04); }

/* Destacado: solo la insignia y un borde apenas insinuado. Sin fondo propio,
   para que no compita con el estado seleccionado. */
.plan-card.featured { border-color: rgba(255,122,30,0.22); }
.plan-badge {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  padding: 2px 9px; border-radius: 99px; white-space: nowrap;
  background: var(--o-2); color: #0E0A05;
  font-family: var(--f-mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  box-shadow: 0 4px 12px -4px var(--o-glow);
}

/* Seleccionado: gana siempre. La doble clase sube la especificidad por encima
   de .plan-card.featured, sin depender del orden del archivo. */
.plan-card.selected.selected {
  border-color: var(--o); background: var(--o-soft);
  box-shadow: 0 0 0 2px var(--o-soft), 0 10px 26px -14px var(--o-glow);
  transform: translateY(-1px);
}
/* Marca de verificación: el estado no depende solo del color. */
.plan-card::after {
  content: ''; position: absolute; top: 9px; right: 9px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--glass-stroke-hi); background: transparent;
  opacity: 0; transition: all var(--t-fast);
}
.plan-card.selected::after {
  opacity: 1; border-color: var(--o); background: var(--o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E0A05' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat;
}
.plan-card:hover::after { opacity: 1; }
.plan-card.selected .plan-badge { background: var(--o); }
.plan-name { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-mid); margin-bottom: 6px; }
.plan-credits { font-family: var(--f-display); font-style: italic; font-size: 36px; color: var(--o-2); line-height: 1; }
.plan-period { font-family: var(--f-mono); font-size: 9px; color: var(--t-low); letter-spacing: 0.1em; margin-top: 2px; margin-bottom: 8px; }
.plan-price { font-size: 15px; font-weight: 700; color: var(--t-hi); }
.plan-price .plan-sub { font-size: 10px; font-weight: 400; color: var(--t-low); margin-left: 2px; }
.btn-upgrade-cta {
  width: 100%;
  background: linear-gradient(180deg, var(--o-2), var(--o));
  color: #0E0A05; border: 1px solid rgba(255,180,100,0.4);
  border-radius: 10px; padding: 13px 20px;
  font-family: var(--f-ui); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all var(--t-fast);
  box-shadow: 0 8px 24px -8px var(--o-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-upgrade-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -8px var(--o-glow); }
.upgrade-note { text-align: center; font-family: var(--f-mono); font-size: 10px; color: var(--t-faint); margin-top: 14px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-stroke);
  color: var(--t-low); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--t-hi); }
/* Táctil: nunca por debajo del contenido y con área cómoda */
.modal-close { z-index: 5; background: rgba(7,6,10,0.72); backdrop-filter: blur(8px); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ─── SCROLL REVEAL ─── */
.sr {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(.22,.61,.36,1), transform 0.55s cubic-bezier(.22,.61,.36,1);
}
.sr.visible { opacity: 1; transform: translateY(0); }
.sr-d1 { transition-delay: 0.06s; }
.sr-d2 { transition-delay: 0.13s; }
.sr-d3 { transition-delay: 0.22s; }

/* ─── HERO ANIMATIONS ─── */
@keyframes heroFade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-panel.active .hero-eyebrow { animation: heroFade 0.6s cubic-bezier(.22,.61,.36,1) 0.05s both; }
.tab-panel.active .hero-title   { animation: heroFade 0.7s cubic-bezier(.22,.61,.36,1) 0.14s both; }
.tab-panel.active .hero-desc    { animation: heroFade 0.7s cubic-bezier(.22,.61,.36,1) 0.24s both; }

/* ─── CREDITS ANIMATION ─── */
@keyframes creditsPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.22); color: var(--o-2); }
  100% { transform: scale(1); }
}
.credits-val.pop { animation: creditsPop 0.45s cubic-bezier(.22,.61,.36,1) both; }

/* ─── BUTTON RIPPLE ─── */
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: rippleAnim 0.55s linear forwards;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(5); opacity: 0; } }

/* ─── MOBILE BOTTOM NAV ─── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(7,6,10,0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--glass-stroke);
  /* En tablet la barra no se estira: los tabs quedan centrados en 560px */
  padding: 6px max(6px, calc((100% - 560px) / 2)) calc(6px + env(safe-area-inset-bottom));
  /* Todos los workflows en UNA sola fila: la columna se calcula sola */
  grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: 10px; min-width: 0;
  background: transparent; border: none;
  color: var(--t-low); cursor: pointer;
  transition: all var(--t-fast);
  font-size: 9.5px; font-family: var(--f-ui); font-weight: 500;
  line-height: 1.1; letter-spacing: -0.01em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bnav-item:hover  { color: var(--t-mid); }
.bnav-item.active { color: var(--o-2); }
.bnav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; margin-bottom: 1px; }
.bnav-indicator {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--o); box-shadow: 0 0 8px var(--o-glow);
  opacity: 0; transition: opacity var(--t-fast);
}
.bnav-item.active .bnav-indicator { opacity: 1; }

/* ─── MOBILE TOP BAR ─────────────────────────────────────────────────────────
   Nivel de navegación "app": home, cambio de producto, galería y cuenta. La
   barra inferior queda para los workflows. Mismo sistema en Shorts Studio.  */
.mobile-bar {
  display: none;
  position: sticky; top: 0; z-index: 90;
  align-items: center; gap: 8px;
  padding: 8px 12px calc(8px);
  padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(7,6,10,0.88);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--glass-stroke);
}
.mb-home {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
}
.mb-home img { width: 30px; height: 30px; object-fit: contain; }
.mb-switch { display: flex; gap: 6px; flex-shrink: 0; }
/* Mismo lenguaje que los iconos de la barra inferior: sin relleno naranja, el
   producto activo se marca con el acento y un borde tenue. */
.mb-switch-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid transparent; background: transparent;
  color: var(--t-low); text-decoration: none;
  font-family: var(--f-ui); font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.mb-switch-btn svg { width: 19px; height: 19px; stroke-width: 1.6; flex-shrink: 0; }
.mb-switch-btn:active { background: rgba(255,255,255,0.05); }
.mb-switch-btn.active {
  color: var(--o-2);
  background: var(--o-soft-2);
  border-color: var(--o-stroke);
}
/* Con la pill limitada, los iconos se van al borde derecho */
.mobile-bar .mb-icon { margin-left: auto; }
.mobile-bar .mb-icon ~ .mb-icon, .mobile-bar .mb-icon ~ .mb-account { margin-left: 0; }
.mb-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px; border: 1px solid var(--glass-stroke);
  background: rgba(255,255,255,0.03); color: var(--t-mid);
  cursor: pointer; transition: all var(--t-fast);
}
.mb-icon:active { background: rgba(255,255,255,0.08); }
.mb-icon svg { width: 18px; height: 18px; }
.mb-account {
  width: 40px; height: 40px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--glass-stroke); border-radius: 999px;
  background: rgba(255,255,255,0.03); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mb-account .user-avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* ─── BOTTOM SHEETS (galería / cuenta) ─────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 550;
  background: rgba(7,6,10,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none; align-items: flex-end;
}
.sheet-backdrop.show { display: flex; }
.sheet {
  width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-top: 1px solid var(--glass-stroke-hi);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -30px 80px -20px rgba(0,0,0,0.9);
  animation: sheetUp 0.32s cubic-bezier(.22,.61,.36,1) both;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 38px; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.18);
  margin: 10px auto 4px; flex-shrink: 0;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--glass-stroke);
}
.sheet-title-block {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px; min-width: 0;
}
.sheet-head-actions { display: flex; gap: 8px; }
.sheet-title {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--t-low);
}
.sheet-body {
  flex: 1; overflow-y: auto; padding: 14px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
}
.gallery-grid-sheet { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-user { display: flex; align-items: center; gap: 12px; }
.sheet-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; overflow: hidden;
}
.sheet-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sheet-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheet-user-name { font-size: 16px; font-weight: 600; color: var(--t-hi); }
.sheet-user-tag {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--t-faint);
}
.sheet-row-label {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--t-faint); margin-top: 2px;
}
.sheet-links { display: flex; flex-direction: column; gap: 6px; }
.sheet-link {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: var(--r); border: 1px solid var(--glass-stroke);
  background: rgba(255,255,255,0.02); color: var(--t-mid);
  font-family: var(--f-ui); font-size: 14px; font-weight: 500;
  text-align: left; text-decoration: none; cursor: pointer;
  transition: all var(--t-fast);
}
.sheet-link:active { background: rgba(255,255,255,0.06); color: var(--t-hi); }
.sheet-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.sheet-link.danger { color: var(--error); border-color: rgba(255,85,119,0.25); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────
   Un solo corte: ≥1024 escritorio (dos rails fijos), <1024 sistema móvil
   (barra superior + barra inferior de workflows + hojas).                    */
@media (max-width: 1199px) {
  .shell { margin-left: 0; margin-right: 0; min-height: 100vh; }
  .sidebar, .gallery-panel { display: none; }
  .mobile-bar { display: flex; }
  .bottom-nav { display: grid; }
  .main { padding: 22px 20px 104px; max-width: 860px; }
  .form { grid-template-columns: 1fr; }
  .form-col-left, .form-col-right { grid-column: 1; }
  .toast-container { bottom: calc(86px + env(safe-area-inset-bottom)); right: 16px; left: 16px; max-width: none; }
  .cursor-glow { display: none; }
}

@media (max-width: 640px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2,1fr); }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .seg { grid-template-columns: 1fr; }
  .submit-row  { flex-direction: column; align-items: stretch; }
  .bottom-row  { grid-template-columns: 1fr; }
  .btn-gen     { width: 100%; justify-content: center; }
  .main { padding: 18px 14px 104px; }
  .hero-title { font-size: clamp(34px, 10vw, 46px); }

  /* Vista previa a pantalla casi completa, con hueco para el botón de cerrar */
  .gallery-preview-card { width: 100%; max-height: 94vh; padding: 56px 14px 14px; border-radius: var(--r-lg); }
  .gp-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .gp-actions { display: flex; }
  .gp-actions .btn-dl { flex: 1; justify-content: center; min-height: 46px; }
  .gp-grid-item-dl { opacity: 1; }        /* sin hover en táctil */
  .upgrade-card { padding: 26px 18px; border-radius: var(--r-lg); }
  /* Las monedas no deben chocar con el botón de cerrar */
  .upgrade-coins { width: min(180px, 52%); margin: 4px auto 12px; }
  .upgrade-title { font-size: 28px; }
  .btn-upgrade-cta { min-height: 50px; }
  .profile-card { padding: 24px 18px; }
}

/* ─── USER CHIP (sidebar profile) ───────────────────────────────────────── */
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  border-radius: var(--r); border: 1px solid var(--glass-stroke);
  background: rgba(22,20,30,0.4); cursor: pointer;
  transition: all var(--t-fast);
}
.user-chip:hover { border-color: var(--glass-stroke-hi); background: var(--glass-1); }

.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0;
  overflow: hidden; user-select: none;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.user-chip-info { flex: 1; min-width: 0; }
.user-chip-name {
  font-size: 13px; font-weight: 500; color: var(--t-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip-tag {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--t-faint); margin-top: 1px;
}
.user-chip-icon {
  width: 14px; height: 14px; stroke: var(--t-faint);
  fill: none; flex-shrink: 0;
}

/* ─── PROFILE MODAL ──────────────────────────────────────────────────────── */
.profile-card {
  background: var(--glass-1); border: 1px solid var(--glass-stroke-hi);
  border-radius: var(--r-lg); padding: 32px;
  width: 100%; max-width: 380px; position: relative;
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.8);
  animation: fadeUp 0.35s cubic-bezier(.22,.61,.36,1) both;
}
.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; overflow: hidden;
  border: 2px solid var(--glass-stroke-hi);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-upload-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--o); border: 2px solid var(--bg-0);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--t-fast);
}
.avatar-upload-btn:hover { background: var(--o-2); }
.avatar-upload-btn svg { stroke: white; fill: none; stroke-width: 2; flex-shrink: 0; }

.profile-header-info { flex: 1; min-width: 0; }
.profile-email {
  font-size: 12px; color: var(--t-low);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-credits-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  background: var(--o-soft); border: 1px solid var(--o-stroke);
  border-radius: 99px; padding: 3px 9px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--o-2);
}

.profile-body { display: flex; flex-direction: column; gap: 14px; }
.profile-field { display: flex; flex-direction: column; gap: 5px; }
.profile-label {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--t-low);
}
.profile-input {
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-stroke);
  border-radius: var(--r-sm); color: var(--t-hi);
  font-family: var(--f-ui); font-size: 13.5px;
  padding: 9px 13px; outline: none; transition: all var(--t-fast);
}
.profile-input:focus { border-color: var(--o-stroke); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 3px var(--o-soft-2); }

.profile-actions { display: flex; gap: 8px; }
.btn-profile-save {
  flex: 1; background: linear-gradient(180deg, var(--o-2), var(--o));
  color: #0E0A05; border: 1px solid rgba(255,180,100,0.4);
  border-radius: var(--r-sm); padding: 9px 16px;
  font-family: var(--f-ui); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all var(--t-fast);
  box-shadow: 0 6px 18px -6px var(--o-glow);
}
.btn-profile-save:hover { transform: translateY(-1px); }
.btn-profile-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-profile-logout {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--glass-stroke);
  color: var(--t-low); font-size: 12.5px; cursor: pointer;
  transition: all var(--t-fast);
}
.btn-profile-logout:hover { border-color: var(--error); color: var(--error); }
.btn-profile-logout svg { stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

/* Admin dashboard link — solo visible para administradores */
.btn-profile-admin {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 10px; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--o-soft); border: 1px solid var(--o-stroke);
  color: var(--o-2); font-size: 12.5px; font-weight: 500; text-decoration: none;
  transition: all var(--t-fast);
}
.btn-profile-admin:hover { background: var(--o); color: #0E0A05; border-color: var(--o); }
.btn-profile-admin svg { flex-shrink: 0; }

.profile-msg { min-height: 16px; font-size: 12px; text-align: center; }
.profile-msg.ok  { color: var(--success); }
.profile-msg.err { color: var(--error); }
