/* MontajIA — AI Creative Studio.
   Base heredada de vibecodingcoach (cristal, píldoras, tarjetas), identidad propia:
   sala de montaje oscura, acento en el degradado del logo (cian → azul → magenta → naranja)
   y detalles en monoespaciada tipo timecode. */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --bg: #060a17;
  --bg-2: #0b1124;
  --ink: #eef1ff;
  --text-2: #c3c8de;
  --muted: #8a91ad;
  --cyan: #22d3ee;
  --blue: #3b6bff;
  --magenta: #c13cff;
  --orange: #ff9a3c;
  --grad: linear-gradient(120deg, #22d3ee 0%, #3b6bff 34%, #c13cff 68%, #ff9a3c 100%);
  --grad-soft: linear-gradient(120deg, rgba(34, 211, 238, 0.16), rgba(193, 60, 255, 0.16));
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --rim: rgba(255, 255, 255, 0.12);
  --field: rgba(255, 255, 255, 0.05);
  --blur: saturate(140%) blur(18px);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 26px 50px rgba(0, 0, 0, 0.55);
  --glow: 0 10px 34px rgba(124, 77, 255, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  --danger: #ff5a6e;
  --ml-blue: #1f66ff;
  --ml-ink: #111111;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Sora", "Inter", system-ui, sans-serif;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { position: relative; min-height: 100vh; margin: 0; color: var(--ink); font-family: "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased; isolation: isolate; }
/* luces de sala: halos del color del logo sobre el negro */
.page-bg { position: fixed; z-index: -1; inset: 0; pointer-events: none; background:
  radial-gradient(40% 35% at 12% 8%, rgba(34, 211, 238, 0.16), transparent 70%),
  radial-gradient(45% 40% at 92% 18%, rgba(193, 60, 255, 0.18), transparent 70%),
  radial-gradient(50% 45% at 70% 100%, rgba(255, 154, 60, 0.1), transparent 70%),
  var(--bg); }
.page-bg::after { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 22px 22px; content: ""; -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%); mask-image: linear-gradient(to bottom, black, transparent 80%); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--muted); }
code { border-radius: 6px; background: var(--grad-soft); color: #dcd2ff; font-family: var(--mono); font-size: 0.85em; padding: 1px 6px; }

/* ---------- Glass ---------- */
.glass, .topbar-inner, .h-item {
  border: 1px solid var(--rim);
  background: var(--glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ---------- Header ---------- */
.topbar { position: sticky; z-index: 20; top: 12px; margin-top: 12px; }
.topbar-inner { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 16px; border-radius: var(--radius-xl); padding: 10px 12px 10px 14px; flex-wrap: wrap; background: rgba(10, 14, 30, 0.7); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 11px; transition: transform 260ms var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand-text { display: grid; line-height: 1; }
.brand-word { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; }
.brand-sub { margin-top: 4px; color: var(--muted); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.32em; }
.tabs { display: flex; gap: 4px; }
.tab { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--text-2); cursor: pointer; font-weight: 600; padding: 9px 16px; transition: background-color 180ms ease, color 180ms ease; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { border-color: var(--rim); background: var(--grad-soft); color: var(--ink); }

/* ---------- Layout ---------- */
.main { padding: 36px 0 40px; }
.view { animation: rise 520ms var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.intro { margin-bottom: 26px; }
h1 { margin: 0; font-family: var(--display); font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; }
h2 { margin: 0; font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; border: 1px solid var(--rim); border-radius: 999px; background: var(--glass); color: var(--text-2); font-family: var(--mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; padding: 7px 14px; text-transform: uppercase; }
.eyebrow .rec { width: 8px; height: 8px; border-radius: 50%; background: #ff3b4e; box-shadow: 0 0 10px #ff3b4e; animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: 0.35; } }
.studio { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 22px; align-items: start; }
@media (max-width: 920px) { .studio { grid-template-columns: minmax(0, 1fr); } }
.panel { border-radius: var(--radius-xl); padding: 24px; }
.stage { position: sticky; top: 100px; min-height: 420px; }
@media (max-width: 920px) { .stage { position: static; } }
.block { margin-bottom: 20px; }
.label { display: block; margin: 0 0 8px; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Form ---------- */
textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--field); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; padding: 12px 14px; resize: vertical; transition: border-color 160ms ease, background-color 160ms ease; }
textarea::placeholder { color: #646b88; }
textarea:focus { border-color: var(--blue); background: rgba(255, 255, 255, 0.07); outline: 3px solid rgba(59, 107, 255, 0.22); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.25); padding: 4px; }
.segmented input, .chips input, .model-grid input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; color: var(--muted); cursor: pointer; font-weight: 600; transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.segmented span:hover { color: var(--ink); }
.segmented input:checked + span { background: var(--glass-strong); box-shadow: 0 0 0 1px var(--rim) inset, 0 6px 18px rgba(0, 0, 0, 0.35); color: var(--ink); }
.segmented input:checked + span i { color: var(--cyan); }
.segmented input:focus-visible + span { outline: 2px solid var(--cyan); }

.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .model-grid { grid-template-columns: minmax(0, 1fr); } }
.model-card { position: relative; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--field); cursor: pointer; padding: 14px 16px; transition: border-color 160ms ease, box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out), background-color 160ms ease; }
.model-card:hover { border-color: var(--rim); transform: translateY(-2px); }
.model-card .cat { color: var(--cyan); font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.model-card .name { font-weight: 700; }
.model-card .price { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.model-card .tick { position: absolute; top: 12px; right: 12px; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--grad); color: white; font-size: 14px; opacity: 0; transform: scale(0.6); transition: opacity 160ms ease, transform 200ms var(--ease-out); }
/* tarjeta elegida: borde con el degradado del logo */
.model-grid input:checked + .model-card { border-color: transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--grad) border-box; box-shadow: 0 12px 30px rgba(124, 77, 255, 0.25); }
.model-grid input:checked + .model-card .tick { opacity: 1; transform: none; }
.model-grid input:focus-visible + .model-card { outline: 2px solid var(--cyan); }

.options { display: flex; flex-wrap: wrap; gap: 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { display: inline-flex; min-height: 36px; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--text-2); cursor: pointer; font-family: var(--mono); font-size: 0.84rem; font-weight: 500; padding: 6px 13px; transition: all 160ms ease; }
.chips span:hover { border-color: var(--rim); color: var(--ink); }
.chips input:checked + span { border-color: transparent; background: var(--grad); box-shadow: var(--glow); color: white; }
.chips input:focus-visible + span { outline: 2px solid var(--cyan); }

.drop { position: relative; display: grid; min-height: 150px; place-items: center; overflow: hidden; border: 1.5px dashed rgba(255, 255, 255, 0.18); border-radius: var(--radius-lg); background: rgba(0, 0, 0, 0.2); color: var(--muted); cursor: pointer; text-align: center; padding: 14px; transition: border-color 160ms ease, background-color 160ms ease; }
.drop:hover, .drop.over { border-color: var(--cyan); background: rgba(34, 211, 238, 0.06); color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-width: 100%; max-height: 280px; border-radius: var(--radius-md); object-fit: contain; }
.drop span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.cost-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.cost-row .label { margin: 0; }
.badge { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; border: 1px solid var(--rim); border-radius: 999px; background: var(--grad-soft); color: #e6dcff; font-family: var(--mono); font-size: 0.78rem; font-weight: 500; padding: 5px 12px; }

/* ---------- Buttons ---------- */
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--rim); border-radius: 999px; background: var(--glass-strong); color: var(--ink); cursor: pointer; font-weight: 650; padding: 10px 20px; text-decoration: none; transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), background-color 160ms ease; }
.button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.button:active:not(:disabled) { transform: scale(0.98); transition-duration: 80ms; }
.button:disabled { cursor: wait; opacity: 0.55; }
.button.primary { border-color: transparent; background: var(--grad); box-shadow: var(--glow); color: white; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.button.primary:hover:not(:disabled) { box-shadow: 0 16px 44px rgba(124, 77, 255, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.22) inset; filter: saturate(1.1); }
.button.lg { width: 100%; min-height: 62px; font-family: var(--display); font-size: 1.12rem; letter-spacing: -0.01em; }
.button.sm { min-height: 38px; font-size: 0.86rem; padding: 6px 14px; }

/* ---------- Stage (estado + resultado) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; justify-items: center; gap: 6px; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; text-align: center; counter-increment: s; }
.steps li::before { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--field); content: counter(s); font-weight: 600; transition: all 200ms ease; }
.steps li.done::before { border-color: transparent; background: var(--grad-soft); color: var(--cyan); content: "✓"; }
.steps li.active { color: var(--ink); }
.steps li.active::before { border-color: transparent; background: var(--grad); box-shadow: var(--glow); color: white; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.steps.ok li::before { border-color: transparent; background: var(--grad); color: white; content: "✓"; animation: none; }
.state { min-height: 1.4em; margin: 0 0 14px; color: var(--text-2); font-family: var(--mono); font-size: 0.9rem; text-align: center; }
.state.err { border: 1px solid rgba(255, 90, 110, 0.35); border-radius: var(--radius-md); background: rgba(255, 90, 110, 0.1); color: #ffb3bd; font-family: inherit; padding: 10px 12px; text-align: left; }

.empty { display: grid; justify-items: center; gap: 12px; padding: 44px 12px; text-align: center; }
.empty-mark { width: 96px; height: 96px; border-radius: 22px; filter: drop-shadow(0 10px 30px rgba(124, 77, 255, 0.45)); }
.empty p { max-width: 26em; margin: 0; color: var(--muted); line-height: 1.55; }
.empty strong { color: var(--ink); }

video { display: block; width: 100%; max-height: 66vh; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #000; }
.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 16px 0; font-size: 0.9rem; }
.meta dt { color: var(--muted); font-family: var(--mono); font-size: 0.74rem; padding-top: 2px; text-transform: uppercase; }
.meta dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
#download { width: 100%; }

/* ---------- Referencias ---------- */
.drop.small { min-height: 84px; }
.refs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.ref { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #000; aspect-ratio: 1; }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; }
.ref .tag { position: absolute; left: 6px; bottom: 6px; border-radius: 999px; background: var(--grad); color: white; font-family: var(--mono); font-size: 0.68rem; font-weight: 600; padding: 3px 8px; }
.ref .x { position: absolute; top: 6px; right: 6px; display: grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: white; cursor: pointer; }
.ref .x:hover { background: var(--danger); }
.help { margin: 10px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.5; }
.help code { white-space: nowrap; }
.help strong { color: #ffb3bd !important; }
.meta-refs { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-refs img, .meta-refs video { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; }

/* ---------- Historial ---------- */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.h-item { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms ease; }
.h-item:hover { border-color: rgba(255, 255, 255, 0.22); box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.h-thumb { display: grid; aspect-ratio: 4 / 5; place-items: center; background: #000; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.h-thumb img, .h-thumb video { width: 100%; height: 100%; object-fit: contain; }
.h-body { display: grid; gap: 8px; padding: 14px; font-size: 0.88rem; }
.h-body .badge { justify-self: start; }
.h-prompt { display: -webkit-box; overflow: hidden; color: var(--ink); font-weight: 600; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.h-meta { color: var(--muted); font-family: var(--mono); font-size: 0.76rem; }
.h-err { display: -webkit-box; overflow: hidden; color: #ffb3bd; font-size: 0.8rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.h-actions { display: flex; gap: 8px; }
.h-actions .button:first-child:not(.danger) { flex: 1; }
.button.danger { color: #ffb3bd; }
.button.danger:hover:not(:disabled) { border-color: rgba(255, 90, 110, 0.5); background: rgba(255, 90, 110, 0.14); color: #fff; }
.h-empty { grid-column: 1 / -1; padding: 40px; border-radius: var(--radius-xl); text-align: center; }

.notice { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; border: 1px solid rgba(255, 90, 110, 0.35); border-radius: var(--radius-lg); background: rgba(255, 90, 110, 0.08); color: var(--text-2); padding: 14px 18px; }
.notice i { color: var(--danger); font-size: 22px; }

/* ---------- Promo ---------- */
.promo-bar { margin-bottom: 18px; padding: 16px 20px; }
.promo-bar-row { display: flex; gap: 8px; align-items: center; }
select, input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="range"]) { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; font-size: 15px; padding: 8px 12px; }
select:focus, input:focus { border-color: var(--blue); outline: 3px solid rgba(59, 107, 255, 0.22); }
input[type="file"] { width: 100%; color: var(--muted); font-size: 0.85rem; }
.pstep { margin-bottom: 18px; }
.pstep h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.num { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--grad); color: white; font-family: var(--mono); font-size: 0.85rem; box-shadow: var(--glow); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field textarea, .field select { font-family: "Inter", system-ui, sans-serif; letter-spacing: normal; text-transform: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.pstate { min-height: 1.2em; margin: 10px 0 0; color: var(--text-2); font-family: var(--mono); font-size: 0.85rem; }
.pstate.err { color: #ffb3bd; }
.small { font-size: 0.88rem; }
.scenes { display: grid; gap: 8px; margin-bottom: 16px; }
.scene { display: grid; grid-template-columns: 34px 78px 92px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--field); padding: 8px; }
.scene .idx { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; text-align: center; }
.scene input, .scene select { min-height: 38px !important; font-size: 0.9rem !important; padding: 6px 8px !important; }
@media (max-width: 720px) { .scene { grid-template-columns: 30px 70px minmax(0, 1fr); } .scene .t-en { grid-column: 2 / -1; } .scene .t-es { grid-column: 2 / -1; } }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shot { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--field); padding: 12px; }
.shot.missing { border-color: rgba(255, 90, 110, 0.45); }
.shot .preview { display: grid; aspect-ratio: 9 / 16; max-height: 300px; place-items: center; overflow: hidden; border-radius: 12px; background: #000; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; text-align: center; padding: 8px; }
.shot .preview img, .shot .preview video { width: 100%; height: 100%; object-fit: cover; }
.shot .head { display: flex; justify-content: space-between; gap: 8px; }
.shot .sid { font-family: var(--mono); color: var(--cyan); font-size: 0.8rem; }
.shot textarea { font-size: 0.85rem; min-height: 70px; }
.asset-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.asset-pick button { width: 52px; height: 52px; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: #000; cursor: pointer; padding: 0; }
.asset-pick button.on { border-color: var(--cyan); }
.asset-pick img { width: 100%; height: 100%; object-fit: cover; }
.gen-row { display: flex; gap: 6px; }
.gen-row select { flex: 1; min-height: 38px !important; font-size: 0.85rem !important; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.music-info { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.music-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 10px 0; }
input[type="range"] { width: 100%; accent-color: var(--magenta); }
.renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.renders video { max-height: 520px; }
.chips input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.chips input[type="checkbox"]:checked + span { border-color: transparent; background: var(--grad); box-shadow: var(--glow); color: white; }
.chips { margin-bottom: 14px; }

.style-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(112px, 156px); justify-content: start; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.style-strip label { scroll-snap-align: start; }
.style-strip input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; transition: transform 200ms var(--ease-out), border-color 160ms ease, box-shadow 200ms ease; }
.swatch:hover { transform: translateY(-3px); border-color: var(--rim); }
.swatch .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.75)); color: #fff; font-size: 0.74rem; font-weight: 700; text-align: center; }
.style-strip input:checked + .swatch { border-color: transparent; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff, 0 14px 30px rgba(0,0,0,0.45); }
.style-strip input:focus-visible + .swatch { outline: 2px solid var(--cyan); }
.style-hint { min-height: 1.3em; margin: 4px 0 16px; color: var(--muted); font-size: 0.86rem; }
.style-hint b { color: var(--ink); }
/* muestras: cada estilo dibuja su rótulo */
.sw-punk { background: #e9e5da; }
.sw-punk .s { display: flex; gap: 2px; transform: rotate(-4deg); }
.sw-punk .s span { padding: 2px 4px 0; font-size: 26px; line-height: 1.1; }
.sw-rock { background: radial-gradient(circle at 30% 20%, #ff9a3c55, transparent 60%), #1a0c0c; }
.sw-rock .s { padding: 3px; background: linear-gradient(120deg, #ff3b4e, #ff9a3c); transform: rotate(-3deg); }
.sw-rock .s b { display: block; padding: 6px 10px 4px; background: #0b0b10; color: #fff; font: 400 26px Anton, sans-serif; }
.sw-electronica { background: radial-gradient(circle at 70% 30%, #c13cff66, transparent 60%), #05081a; }
.sw-electronica .s { padding: 6px 8px; border: 2px solid #fff; border-radius: 10px; color: #fff; font: 400 15px "Rubik Mono One", sans-serif; box-shadow: 0 0 12px #22d3ee, inset 0 0 10px #22d3ee88; text-shadow: 0 0 8px #22d3ee, 0 0 18px #c13cff; }
.sw-pop { background: linear-gradient(160deg, #7c3aed, #ff2d7a); }
.sw-pop .s { font: 400 30px/0.95 "Archivo Black", sans-serif; text-align: center; color: #fff; text-shadow: 4px 4px 0 #ffd400; }
.sw-pop .s i { display: block; font-style: normal; color: #ffd400; text-shadow: 4px 4px 0 #7c3aed; }
.sw-acustico { background: radial-gradient(circle at 50% 30%, #e8b86d66, transparent 65%), #2a1a0e; }
.sw-acustico .s { color: #fff3e0; font: italic 700 26px "Playfair Display", serif; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.sw-flamenco { background: radial-gradient(ellipse at 50% 40%, #5a0d12, #0b0606 75%); }
.sw-flamenco .s { padding: 6px 10px 4px; border-top: 2px solid #d4a017; border-bottom: 2px solid #d4a017; color: #fff3e0; font: 400 24px "DM Serif Display", serif; text-transform: uppercase; }
.sw-flamenco .s::after { content: ""; display: block; height: 3px; margin-top: 4px; background: #c1121f; }
.sw-latino { background: linear-gradient(160deg, #ffb300, #ff2d7a 55%, #00c2a8); }
.sw-tech { background: radial-gradient(circle at 25% 15%, #22d3ee55, transparent 55%), radial-gradient(circle at 85% 80%, #c13cff55, transparent 55%), #070a16; }
.sw-tech .s { padding: 3px; background: linear-gradient(120deg, #22d3ee, #3b6bff, #c13cff); transform: rotate(-3deg); }
.sw-tech .s b { display: block; padding: 6px 10px 4px; background: #0b0b10; color: #fff; font: 400 22px Anton, sans-serif; }
.sw-minimal { background: #f4f2ee; }
.sw-minimal .s { padding: 10px 16px; border-radius: 999px; background: #fff; color: #111; font: 800 18px Inter, sans-serif; letter-spacing: -0.02em; box-shadow: 0 10px 24px rgba(0,0,0,0.15); }
.sw-minimal .nm { color: #fff; }
.sw-directo { background: #ffd400; }
.sw-directo .s { font: 400 34px/0.92 "Archivo Black", sans-serif; color: #111; text-align: center; transform: rotate(-4deg); }
.sw-directo .s i { display: block; font-style: normal; color: #ff3d00; }
.sw-cercano { background: radial-gradient(circle at 50% 30%, #e8b86d55, transparent 65%), #2a1a0e; }
.sw-cercano .s { color: #fff3e0; font: italic 700 20px "Playfair Display", serif; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.sw-latino .s { font: 400 28px/0.95 "Archivo Black", sans-serif; color: #fff; text-align: center; -webkit-text-stroke: 1px #ff2d7a; text-shadow: 3px 3px 0 #00c2a8; transform: rotate(-4deg); }
.hooks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.hooks input { position: absolute; opacity: 0; pointer-events: none; }
.hook { display: grid; gap: 6px; height: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--field); cursor: pointer; padding: 14px; transition: border-color 160ms ease, transform 200ms var(--ease-out); }
.hook:hover { border-color: var(--rim); transform: translateY(-2px); }
.hook .mv { color: var(--cyan); font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hook .cap { font-family: var(--display); font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.hook .vis, .hook .seg { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.hooks input:checked + .hook { border-color: transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--grad) border-box; }
.segmented.two { grid-template-columns: repeat(2, 1fr); }

/* ---------- Pie: firma del autor ---------- */
.footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 0 40px; color: var(--muted); font-size: 0.85rem; }
.footer a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer .ml-logo { width: 34px; height: auto; }
.ml-cursor { animation: caret-blink 1.1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* ---------- Móvil ---------- */
@media (max-width: 480px) {
  .panel { padding: 18px; }
  .segmented span { gap: 6px; font-size: 0.8rem; white-space: nowrap; }
  .segmented span i { display: none; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- cuenta, créditos y acceso (beta) ---------- */
.account { display: flex; align-items: center; gap: 8px; }
.credits { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; border: 1px solid var(--rim); border-radius: 999px; background: var(--grad-soft); color: var(--ink); font-family: var(--mono); font-size: 0.86rem; padding: 6px 14px; }
.credits b { font-weight: 600; }
.credits.low { border-color: rgba(255, 90, 110, 0.55); color: #ffb3bd; }
.cost { opacity: 0.8; font-weight: 500; }
.auth { display: flex; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin: 0 0 16px; font-family: var(--display); font-size: 1.6rem; }
.auth-card .button.lg { margin-top: 6px; }
.auth-card a { color: var(--cyan); }
.auth-error { margin: 0; max-width: 420px; border: 1px solid rgba(255, 90, 110, 0.35); border-radius: var(--radius-lg); background: rgba(255, 90, 110, 0.08); color: #ffb3bd; padding: 12px 16px; }
.hidden { display: none !important; }

/* ---------- Redes ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tpl-grid input { position: absolute; opacity: 0; pointer-events: none; }
.tpl { display: flex; height: 100%; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--field); cursor: pointer; padding: 14px; transition: border-color 160ms ease, transform 200ms var(--ease-out); }
.tpl:hover { transform: translateY(-2px); border-color: var(--rim); }
.tpl i { font-size: 26px; color: var(--cyan); }
.tpl b { color: var(--ink); }
.tpl small { color: var(--muted); line-height: 1.4; }
.tpl-grid input:checked + .tpl { border-color: transparent; background: var(--grad-soft); box-shadow: 0 0 0 2px #fff; }
.tpl-grid input:focus-visible + .tpl { outline: 2px solid var(--cyan); }
.s-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
.s-grid textarea { min-height: 120px; }
.plat { display: flex; flex-wrap: wrap; gap: 6px; text-transform: none; }
.s-result { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 22px; align-items: start; }
.s-result video { width: 100%; aspect-ratio: 9 / 16; border-radius: 18px; background: #000; }
.s-music-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.s-music-row input { flex: 1; }
@media (max-width: 720px) { .s-result { grid-template-columns: 1fr; } }
.s-result > * { min-width: 0; } /* la tira de estilos no debe ensanchar la columna (móvil) */
#s-files input[type="file"] { max-width: 100%; color: var(--muted); font-size: 0.84rem; }
#s-files input[type="file"]::file-selector-button { margin-right: 10px; border: 1px solid var(--rim); border-radius: 999px; background: var(--glass-strong); color: var(--ink); cursor: pointer; font: inherit; font-weight: 650; padding: 8px 14px; }
#s-files input[type="file"]::file-selector-button:hover { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 720px) { .s-result { grid-template-columns: minmax(0, 1fr); } .s-result video { max-width: 280px; justify-self: center; } }
/* móvil: los radios invisibles se anclan a su tarjeta (si no, escapan del recorte de la tira y ensanchan la página) */
.style-strip label, .tpl-grid label, .segmented label, .chips label { position: relative; }
@media (max-width: 720px) {
  .tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 9px 12px; }
}

/* ---------- planos sin material: biblioteca, pack, IA ---------- */
.nomat { flex-wrap: wrap; }
.picker { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(0,0,0,0.25); }
.picker .results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.picker .results button { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: #000; cursor: pointer; padding: 0; }
.picker .results button:hover { border-color: var(--cyan); }
.picker .results img { width: 100%; height: 100%; object-fit: cover; }
.picker .results i { position: absolute; right: 6px; bottom: 6px; color: #fff; text-shadow: 0 1px 4px #000; }
.picker a, .credit a { color: var(--cyan); }
.credit { color: var(--muted); font-size: 0.75rem; }
.err { color: #ffb3bd; }

#s-sectors { margin-bottom: 12px; }
.check-field span { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-family: var(--body, inherit); font-size: 0.9rem; color: var(--text-2); }
.check-field input { width: 18px; height: 18px; accent-color: var(--cyan); }

/* muestras de los estilos de vino: una imagen de su propio pack */
.sw-bodega, .sw-vinedo, .sw-premium, .sw-gastro { background-size: cover; background-position: center; }
.sw-bodega { background-image: linear-gradient(rgba(20,8,4,0.35), rgba(20,8,4,0.55)), url(/packs/bodega/barrica.jpg); }
.sw-vinedo { background-image: linear-gradient(rgba(255,250,240,0.15), rgba(255,250,240,0.35)), url(/packs/vinedo/vina.jpg); }
.sw-premium { background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.5)), url(/packs/premium/copa.jpg); }
.sw-gastro { background-image: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.5)), url(/packs/gastro/mesa.jpg); }
.sw-bodega .s { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; font-size: 1.35rem; color: #f3e6c8; }
.sw-vinedo .s { font-family: Inter, sans-serif; font-weight: 800; font-size: 1.05rem; color: #1d1a16; background: rgba(255,255,255,0.9); border-radius: 999px; padding: 4px 12px; }
.sw-premium .s { font-family: "DM Serif Display", serif; font-size: 1.2rem; letter-spacing: 0.12em; text-transform: uppercase; color: #f4efe3; border-top: 2px solid #c9a227; border-bottom: 2px solid #c9a227; padding: 4px 6px; }
.sw-gastro .s { font-family: Anton, sans-serif; font-size: 1.15rem; text-transform: uppercase; color: #fff; background: #0b0b10; border: 3px solid #9c2f2f; padding: 2px 10px; transform: rotate(-2deg); }

/* hueco del vídeo mientras se prepara */
.s-left { min-width: 0; }
.s-wait { display: grid; place-items: center; align-content: center; gap: 18px; aspect-ratio: 9 / 16; border: 1px dashed var(--rim); border-radius: 18px; background: rgba(0,0,0,0.25); color: var(--muted); padding: 20px; text-align: center; }
.s-wait p { margin: 0; font-size: 0.9rem; line-height: 1.4; }
.s-wait .eq { display: flex; align-items: flex-end; gap: 6px; height: 46px; opacity: 0.35; }
.s-wait .eq i { width: 8px; height: 12px; border-radius: 4px; background: var(--grad); }
.s-wait.busy .eq { opacity: 1; }
.s-wait.busy .eq i { animation: eq 0.9s ease-in-out infinite; }
.s-wait .eq i:nth-child(2) { animation-delay: 0.15s; } .s-wait .eq i:nth-child(3) { animation-delay: 0.3s; } .s-wait .eq i:nth-child(4) { animation-delay: 0.45s; } .s-wait .eq i:nth-child(5) { animation-delay: 0.6s; }
@keyframes eq { 0%, 100% { height: 12px; } 50% { height: 46px; } }
@media (max-width: 720px) { .s-wait { max-width: 280px; justify-self: center; width: 100%; } }

.fill-btn { justify-self: start; margin: -6px 0 14px; }

/* círculo de progreso */
.ring { position: relative; display: grid; place-items: center; width: 120px; margin: 0 auto; gap: 8px; }
.ring svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 7; }
.ring .bar { fill: none; stroke: url(#rg); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 600ms ease; }
.ring b { position: absolute; top: 33px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 1rem; color: var(--ink); }
.ring span { font-size: 0.82rem; color: var(--muted); }
.ring.spin svg { animation: ring-spin 1.1s linear infinite; }
@keyframes ring-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
.render-wait { display: grid; align-content: start; gap: 10px; padding: 14px 0; }

#s-cover img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
#s-cover { margin-bottom: 12px; }

/* ---------- Mi marca ---------- */
.brand-list { display: grid; gap: 10px; }
.brand-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: var(--field); padding: 10px 12px; }
.brand-card.on { border-color: var(--rim); background: var(--grad-soft); }
.brand-logo { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: #0b0b10; overflow: hidden; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo span { font-family: var(--display); font-weight: 800; color: var(--ink); }
.brand-info small { color: var(--muted); }
.brand-info .dots { display: flex; gap: 5px; margin: 6px 0 4px; }
.brand-info .dots i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); }
.brand-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.b-prev { max-width: 160px; max-height: 90px; object-fit: contain; margin-top: 8px; border-radius: 10px; background: #0b0b10; padding: 6px; }
.colors-row input[type="color"] { width: 54px; height: 42px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); cursor: pointer; }
.brand-pick { max-width: 360px; }
@media (max-width: 720px) { .brand-card { grid-template-columns: 52px 1fr; } .brand-actions { grid-column: 1 / -1; justify-content: flex-start; } }
/* Mi marca: botones de archivo como el resto de MontajIA y muestras de color cuadradas (pisaban la regla general de inputs) */
#b-form input[type="file"] { max-width: 100%; color: var(--muted); font-size: 0.84rem; }
#b-form input[type="file"]::file-selector-button { margin-right: 10px; border: 1px solid var(--rim); border-radius: 999px; background: var(--glass-strong); color: var(--ink); cursor: pointer; font: inherit; font-weight: 650; padding: 8px 14px; }
#b-form .colors-row input[type="color"] { width: 56px; min-height: 0; height: 44px; padding: 3px; flex: 0 0 auto; }

/* biblioteca: pestañas, elegidos y créditos */
.lib-tabs { margin-bottom: 4px; }
.picker .results button.picked { border-color: var(--cyan); }
.lib-open { justify-self: start; margin: -6px 0 8px; }
.lib-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lib-picked .pick { position: relative; width: 54px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.lib-picked .pick img { width: 100%; height: 100%; object-fit: cover; }
.lib-picked .pick button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,0.7); color: #fff; cursor: pointer; line-height: 1; }
.credits-box textarea { width: 100%; font-size: 0.82rem; min-height: 0; }
.credits-box { margin: 10px 0; }

/* ficha de estilo: vista previa + guía */
.style-hint { margin: 6px 0 14px; }
.style-guide { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: 16px; background: var(--field); padding: 12px; }
.style-guide video { width: 120px; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; object-fit: cover; }
.style-guide p { margin: 2px 0 8px; color: var(--muted); font-size: 0.86rem; }
.style-guide ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 0.86rem; color: var(--text-2); }
.style-guide li span { display: inline-block; min-width: 170px; color: var(--cyan); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 720px) { .style-guide { grid-template-columns: 90px 1fr; } .style-guide video { width: 90px; } .style-guide li span { display: block; min-width: 0; } }
#s-sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.style-guide li span { min-width: 120px; }

/* generador de estilo de marca */
.b-q { display: grid; gap: 14px; margin: 14px 0; }
.b-q .q b { display: block; margin-bottom: 6px; font-size: 0.9rem; }
.b-q .chips input:checked + span { border-color: var(--rim); background: var(--grad-soft); color: var(--ink); }
.b-job { display: flex; align-items: center; gap: 16px; margin: 10px 0; }
.swatch.sw-mine { background: var(--sw-grad); }
.swatch.sw-mine .s { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.swatch.sw-mine .sw-logo { width: 62%; max-height: 55%; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.45)); }

/* Redes por lotes */
.batch-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); font-size: 0.92rem; }
.batch-steps .button { margin-left: 8px; vertical-align: middle; }
.batch-check, .bv-rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.batch-check li, .bv-rows li { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: baseline; border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 8px 12px; }
.batch-check li small, .bv-rows li small, .bv-rows li a { grid-column: 2; font-size: 0.82rem; }
.batch-check li.ok, .bv-rows li.ok { border-color: rgba(34, 211, 238, 0.35); }
.batch-check li.bad, .bv-rows li.bad { border-color: rgba(255, 99, 99, 0.45); }
.batch-check .n, .bv-rows .n { grid-row: span 2; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.err-txt { color: #ff8a8a; }
.bv-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.bv-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .bv-head { grid-template-columns: auto 1fr; } .bv-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* formatos */
.fmt-chips { margin-bottom: 14px; }
.fmt-chips input:checked + span { border-color: var(--rim); background: var(--grad-soft); color: var(--ink); }
.extra-dl { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.extra-dl .muted { font-size: 0.82rem; }
.brand-word b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }

/* ¿uno o muchos? — dos tarjetas grandes; y el aviso de arriba que lleva al lote */
.mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.mode-grid input:disabled + .tpl { opacity: 0.4; cursor: not-allowed; }
.batch-cta { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--rim); border-radius: 18px; background: var(--grad-soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
.batch-cta:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.batch-cta > i:first-child { font-size: 1.8rem; color: #21a366; }
.batch-cta span { flex: 1; color: var(--text-2); }
.batch-cta b { color: var(--ink); }
@media (max-width: 720px) { .mode-grid { grid-template-columns: 1fr; } }
#s-batch .upload-btn { display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin: 6px 0 4px; }
#s-batch .field small { display: block; }
#s-batch .upload-btn, #s-batch .field small { font-family: Inter, system-ui, sans-serif; text-transform: none; letter-spacing: normal; }
#s-batch .upload-btn { font-size: 0.95rem; font-weight: 600; }
#s-batch .field small { font-size: 0.85rem; }
.batch-check .files-line { color: var(--text-2); }
.batch-check .files-line em { color: var(--cyan); font-style: normal; }

/* ================= Móvil (≤ 720 px): cabecera compacta, pestañas abajo, más aire ================= */
@media (max-width: 720px) {
  .container { width: calc(100% - 24px); }
  /* cabecera: una sola línea (logo · créditos · salir) */
  .topbar { top: 0; margin-top: 0; }
  .topbar.container { width: 100%; }
  /* sin desenfoque: un backdrop-filter haría que la barra «fija» de abajo se fijara a la cabecera y no a la pantalla */
  .topbar-inner { flex-wrap: nowrap; min-height: 56px; gap: 10px; border-radius: 0 0 18px 18px; padding: 8px 14px; background: #080c1a; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .brand-word { font-size: 1.2rem; }
  .brand-sub, .credits-word, #me-name { display: none; }
  .credits { min-height: 34px; padding: 4px 11px; font-size: 0.82rem; }
  #logout { min-height: 34px; padding: 0 10px; }
  /* las cinco secciones, fijas abajo y siempre a la vista */
  .tabs {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; width: auto; overflow: visible;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(8, 12, 26, 0.94); backdrop-filter: saturate(140%) blur(16px); -webkit-backdrop-filter: saturate(140%) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tab { flex-direction: column; gap: 3px; min-height: 52px; padding: 6px 2px; border-radius: 14px; font-size: 0.68rem; font-weight: 600; justify-content: center; }
  .tab i { font-size: 1.35rem; }
  .tab[aria-current="page"] i { color: var(--cyan); }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* la portada de cada sección no se come la pantalla */
  .main { padding: 18px 0 28px; }
  .intro { margin-bottom: 16px; }
  h1 { font-size: 1.85rem; }
  .eyebrow { font-size: 0.64rem; padding: 5px 10px; margin-bottom: 10px; }
  .panel { padding: 16px; }
  /* campos: etiquetas legibles (sin mayúsculas de máquina) y más aire entre ellos */
  .field { gap: 7px; margin-bottom: 18px; font-family: Inter, system-ui, sans-serif; font-size: 0.84rem; letter-spacing: 0; text-transform: none; color: var(--text-2); }
  .label { margin-top: 6px; }
  .s-grid { gap: 0; }
  /* sectores: una fila de botones que se desliza, no un óvalo */
  #s-form, #s-form > *, .view { min-width: 0; max-width: 100%; }
  #s-sectors { display: flex; gap: 6px; overflow-x: auto; width: 100%; max-width: 100%; border: 0; background: none; padding: 0 0 6px; border-radius: 0; scrollbar-width: none; }
  #s-sectors::-webkit-scrollbar { display: none; }
  #s-sectors label { flex: 0 0 auto; position: relative; } /* el radio invisible, anclado a su botón (si no, ensancha la página) */
  #s-sectors span { min-height: 40px; padding: 0 16px; border: 1px solid var(--line); background: var(--field); }
  /* plantillas en dos columnas, con el texto contenido */
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tpl-grid .tpl { padding: 12px; }
  .tpl-grid .tpl b { font-size: 0.92rem; }
  .tpl-grid .tpl small { font-size: 0.76rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .mode-grid { grid-template-columns: 1fr; }
  /* estilos: tarjetas más pequeñas y un difuminado que avisa de que hay más a la derecha */
  .style-strip { grid-auto-columns: 100px; -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 40px; }
  .style-guide { grid-template-columns: 1fr; }
  .style-guide video { width: 120px; }
  .style-guide li span { display: block; min-width: 0; }
  .chips { gap: 8px; }
  .footer { padding-bottom: 12px; }
  .h-item video, .h-item img { max-height: 60vh; object-fit: contain; background: #000; }
}
/* selectores de archivo propios (app.js) */
.field .file-pretty { display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-top: 2px; font-family: Inter, system-ui, sans-serif; text-transform: none; letter-spacing: normal; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.field .file-pretty.has-file { border-color: rgba(34, 211, 238, 0.5); }
.field .file-name { font-family: Inter, system-ui, sans-serif; text-transform: none; letter-spacing: normal; font-size: 0.82rem; color: var(--cyan); word-break: break-all; }
.field .file-name:empty { display: none; }

/* entrar con Google */
.google-btn { display: flex; width: 100%; justify-content: center; align-items: center; gap: 12px; background: #fff; color: #1f1f1f; border-color: #fff; font-weight: 700; text-decoration: none; }
.google-btn:hover { background: #f1f3f4; }
.auth-card .small-print { font-size: 0.78rem; color: var(--muted); }
.auth-card h1.secondary { font-size: 1.15rem; }
.trial-note { align-items: center; gap: 12px; border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.07); }
.trial-note > i { color: var(--cyan); font-size: 1.4rem; }
.trial-note span { flex: 1; }
@media (max-width: 720px) { .trial-note { flex-wrap: wrap; } }

/* tu cuenta de fal */
.fal-box { margin-bottom: 18px; padding: 14px 18px; }
.fal-box summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; list-style: none; }
.fal-box summary::-webkit-details-marker { display: none; }
.fal-box summary i { color: var(--cyan); font-size: 1.2rem; }
.fal-box.on summary i { color: #4ade80; }
.fal-box[open] summary { margin-bottom: 12px; }
.fal-steps { margin: 10px 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); font-size: 0.92rem; }
.fal-steps a, .fal-box a { color: var(--cyan); }
.fal-row { display: flex; gap: 8px; margin: 8px 0; }
.fal-row input { flex: 1; min-width: 0; font-family: var(--mono); }
#fal-on p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#fal-on i { color: #4ade80; font-size: 1.2rem; }
@media (max-width: 720px) { .fal-row { flex-direction: column; } }

/* ---------- bienvenida: «¿Qué quieres crear?» ---------- */
body.onb-open { overflow: hidden; }
.onb { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 14, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: onb-in 220ms ease both; }
@keyframes onb-in { from { opacity: 0; } }
.onb-box { position: relative; width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 26px; padding: 28px; background: rgba(10, 14, 30, 0.97); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); animation: onb-up 320ms var(--ease-out) both; }
@keyframes onb-up { from { transform: translateY(24px) scale(0.98); opacity: 0; } }
.onb-logo { width: 46px; height: 46px; border-radius: 12px; }
.onb-box h2 { margin: 12px 0 6px; font-family: var(--display); font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.03em; }
.onb-box > p { margin: 0 0 18px; }
.onb-x { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--field); color: var(--text-2); cursor: pointer; font-size: 1.1rem; }
.onb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.onb-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 12px; align-items: start; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--field); color: var(--ink); cursor: pointer; padding: 16px; font: inherit; transition: transform 180ms var(--ease-out), border-color 160ms ease, background-color 160ms ease; }
.onb-card:hover, .onb-card:focus-visible { transform: translateY(-2px); border-color: var(--rim); background: var(--grad-soft); outline: none; }
.onb-card i { grid-row: span 2; font-size: 1.7rem; color: var(--cyan); margin-top: 2px; }
.onb-card b { font-size: 1rem; }
.onb-card small { color: var(--text-2); font-size: 0.84rem; line-height: 1.4; }
.onb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.link-btn { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 0.9rem; text-decoration: underline; }
#create-btn { white-space: nowrap; }
@media (max-width: 720px) {
  .onb { align-items: end; padding: 0; }
  .onb-box { width: 100%; max-height: 88vh; border-radius: 24px 24px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
  .onb-grid { grid-template-columns: 1fr; }
  .onb-card { padding: 13px 14px; }
  .create-word { display: none; }
  #create-btn { min-height: 34px; padding: 0 11px; }
}
