/* Publimatrix Admin — estilos. Misma familia que el panel de Hosanna, otra paleta. */
:root {
  --brand: #0f766e;
  --brand-deep: #134e4a;
  --brand-soft: #ccfbf1;
  --ink: #1c1c2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f8f8;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2f2; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
pre.json { background: #0b1b1a; color: #d1fae5; padding: 12px 14px; border-radius: 9px; font-size: 12px; overflow: auto; max-height: 420px; }

/* ── Top nav ── */
.nav { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; align-items: center; gap: 18px; min-height: 58px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.nav .brand { font-weight: 800; letter-spacing: .5px; color: var(--brand-deep); }
.nav .brand span { color: var(--brand); }
.brand-icon { width: 28px; height: 28px; margin-right: 8px; border-radius: 7px; vertical-align: middle; }
.brand-icon-lg { width: 44px; height: 44px; margin-right: 10px; border-radius: 11px; }
.nav a.link { color: var(--ink); font-weight: 500; padding: 6px 2px; font-size: 14px; }
.nav a.link.active { color: var(--brand); border-bottom: 2px solid var(--brand); }
.nav .spacer { flex: 1; }
.nav .who { color: var(--muted); font-size: 14px; min-width: 0; }
.admin-nav { display: block; }
.nav-top { display: flex; align-items: center; gap: 24px; }
.nav-top .brand { flex-shrink: 0; }
.nav-menu { display: flex; align-items: center; gap: 12px 24px; flex: 1; min-width: 0; flex-wrap: wrap; }
.nav-links { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.nav-account { display: flex; align-items: center; gap: 12px; min-width: 0; margin-left: auto; }
.nav-account form { flex-shrink: 0; }
.nav .nav-toggle { display: none; }
.nav-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-creditos { order: 2; margin: 10px 0 0 auto; }
.nav-creditos a { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--brand); border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; }
.nav-creditos a.sin-creditos { border-color: var(--warn); }
.nav-creditos strong { font-variant-numeric: tabular-nums; }
/* El producto activo (header): como el selector de idioma del panel de Hosanna */
.nav .prod-switch { display: flex; width: fit-content; max-width: 100%; min-width: 0; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: #fff; scrollbar-width: thin; }
.nav .prod-switch a { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; white-space: nowrap; gap: 6px; padding: 9px 12px; min-height: 40px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav .prod-switch a + a { border-left: 1px solid var(--line); }
.nav .prod-switch a img { width: 16px; height: 16px; flex-shrink: 0; border-radius: 4px; }
.nav .prod-switch a.active { background: var(--brand); color: #fff; }
.nav-new-app { flex: 0 0 auto; margin-top: 10px; min-height: 40px; }
.estudio-app-elegida { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.estudio-app-elegida img { border-radius: 5px; flex: 0 0 auto; }
.delete-material { margin-top: 24px; border-color: var(--danger); }
.delete-material h2 { margin: 0 0 8px; font-size: 18px; }
.delete-material p, .trash-policy p { line-height: 1.65; }
.trash-list { display: grid; gap: 14px; }
.trash-item { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.trash-item-info { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.trash-item h2 { font-size: 18px; margin: 8px 0 4px; }
.trash-dates { display: flex; gap: 20px; flex-wrap: wrap; margin: 0; }
.trash-dates dt { color: var(--muted); font-size: 12px; }
.trash-dates dd { margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.trash-item form { margin: 0; }
@media (max-width: 600px) {
  .trash-item { gap: 16px; }
  .trash-item form, .trash-item button { width: 100%; }
  .nav-new-app { order: 1; min-height: 44px; }
}

select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%; min-width: 0; max-width: 100%;
}
textarea { resize: vertical; }
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; flex: 1 1 240px; min-width: 0; }
.page-head > *, .row-between > *, .actions > * { min-width: 0; max-width: 100%; }

.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--brand); color: #fff; border: none; cursor: pointer; padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.btn:hover { filter: brightness(0.96); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── La llave de la API (alta de producto): un bloque aparte, con sus pasos ── */
.llave { border: 1px solid var(--brand); border-radius: var(--radius); padding: 14px 18px 6px; background: #f3fbfa; margin-bottom: 18px; }
.pasos-llave { list-style: none; counter-reset: paso; margin: 0; padding: 0; }
.pasos-llave > li { position: relative; padding: 8px 0 8px 40px; border-top: 1px dashed var(--line); }
.pasos-llave > li:first-child { border-top: none; }
.pasos-llave > li::before { counter-increment: paso; content: counter(paso); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.pasos-llave table.kv th { width: 90px; }

/* ── Alta guiada de un producto: elegir cómo, y después de a un paso ── */
.alta { max-width: 980px; margin: 0 auto; }
.alta-titulo { margin-bottom: 20px; }
.alta-titulo h1 { font-size: 26px; margin: 6px 0; }
.alta-titulo p { color: var(--muted); margin: 0; max-width: 640px; line-height: 1.6; }
.alta-volver { font-size: 13px; color: var(--muted); }
.alta-pie { margin: 14px 0 0; }
.alta-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.alta-opcion { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.alta-opcion:hover { border-color: var(--brand); box-shadow: 0 6px 24px rgba(15, 118, 110, .12); text-decoration: none; }
.alta-opcion:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.alta-opcion strong { font-size: 17px; }
.alta-opcion-texto { color: var(--muted); font-size: 14px; line-height: 1.55; flex: 1; }
.alta-icono { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); display: flex; align-items: center; justify-content: center; }
.alta-ir { color: var(--brand); font-weight: 600; font-size: 14px; margin-top: 4px; }
.alta-agente { max-width: 720px; }
.alta-pedido { margin: 8px 0 10px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.5; background: #f3f7f6; resize: none; }
.alta-espera { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding: 12px 14px; border-radius: 9px; background: #f3f7f6; color: var(--muted); font-size: 13px; }
.alta-espera.listo { background: var(--brand-soft); color: var(--brand-deep); justify-content: space-between; font-size: 14px; }
.alta-punto { width: 9px; height: 9px; flex-shrink: 0; border-radius: 999px; background: var(--brand); animation: alta-latido 1.4s ease-in-out infinite; }
@keyframes alta-latido { 50% { opacity: .25; } }
.alta-marco { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.alta-form { margin: 0; padding: 24px; }
.alta-form:not(.con-pasos) .solo-js { display: none; }
.alta-marcas { list-style: none; display: flex; gap: 8px; margin: 0 0 22px; padding: 0; }
.alta-marca { flex: 1; min-width: 0; }
.alta-marca button { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: none; border-top: 3px solid var(--line); padding: 10px 0 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; cursor: pointer; }
.alta-marca button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.alta-marca button span { width: 20px; height: 20px; flex-shrink: 0; border-radius: 999px; background: var(--line); color: var(--muted); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.alta-marca.hecho button { border-top-color: var(--brand); color: var(--brand-deep); }
.alta-marca.hecho button span, .alta-marca.actual button span { background: var(--brand); color: #fff; }
.alta-marca.actual button { border-top-color: var(--brand); color: var(--ink); }
.alta-form:not(.con-pasos) .alta-paso + .alta-paso { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.alta-paso h2 { font-size: 20px; margin: 0 0 4px; }
.alta-bajada { margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
.alta-estado { margin-top: 6px; }
.alta-botones { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; }
.alta-color-fila { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.alta-colores { display: flex; flex-wrap: wrap; gap: 8px; }
.alta-color { width: 30px; height: 30px; padding: 0; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.alta-color:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.alta-color.elegido { box-shadow: 0 0 0 2px var(--ink); }
.alta-color-libre { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.alta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.alta-chip { font: inherit; font-size: 13px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; }
.alta-chip:hover { border-color: var(--brand); }
.alta-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.alta-chip.elegido { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }
.alta-ingles summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.alta-vista { position: sticky; top: 16px; }
.alta-vista-titulo { margin-bottom: 8px; }
.alta-vista-pie { margin-top: 8px; line-height: 1.5; }
.anuncio { aspect-ratio: 4 / 5; display: flex; flex-direction: column; padding: 18px; border-radius: 14px; overflow: hidden; color: #fff; background: linear-gradient(170deg, #27313a, #101418 62%); background: radial-gradient(120% 70% at 85% 0%, color-mix(in srgb, var(--acento) 55%, transparent), transparent), linear-gradient(170deg, #27313a, #101418 62%); }
.anuncio-marca { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; min-width: 0; }
.anuncio-marca img { width: 26px; height: 26px; border-radius: 6px; background: #fff; object-fit: cover; flex-shrink: 0; }
.anuncio-lema { margin-top: auto; font-size: 25px; font-weight: 800; line-height: 1.15; }
.anuncio-boton { align-self: flex-start; max-width: 100%; margin-top: 14px; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--acento); color: var(--sobre); }
.alta-lista { border-color: var(--brand); background: #f3fbfa; }

/* ── Barra de «trabajando» (admin.js): aparece al enviar un formulario ── */
.cargando { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); z-index: 100; opacity: 0; transition: opacity .2s; }
body.esperando .cargando { opacity: 1; animation: cargando 1.6s ease-in-out infinite; }
body.esperando { cursor: progress; }
@keyframes cargando { 0% { width: 0; left: 0; } 50% { width: 60%; left: 20%; } 100% { width: 0; left: 100%; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
details.card summary { cursor: pointer; font-weight: 600; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-scroll > table { min-width: 680px; border: none; border-radius: 0; }
.table-scroll th, .table-scroll td { overflow-wrap: normal; }
.table-scroll:focus-visible, .nav a:focus-visible, .tabs a:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav .prod-switch a:focus-visible, .tabs a:focus-visible { outline-offset: -3px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f3f7f6; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
table.kv { border: none; table-layout: fixed; }
table.kv th { width: 130px; background: none; text-transform: none; letter-spacing: 0; font-size: 12px; vertical-align: top; }
table.kv td, table.kv th { padding: 7px 6px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.published { background: #dcfce7; color: var(--ok); }
.badge.draft { background: #fef3c7; color: var(--warn); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.cat { background: #f1f5f9; color: #475569; }
.badge.lang { background: #ecfeff; color: #0e7490; text-transform: uppercase; letter-spacing: .5px; }
.badge.fmt { background: rgba(255,255,255,.9); color: var(--ink); }
.badge.pend { background: #fef3c7; color: var(--warn); }
.badge.status-borrador { background: #f3f4f6; color: var(--muted); }
.badge.status-lista { background: #e0e7ff; color: #4f46e5; }
.badge.status-en_meta { background: #dcfce7; color: var(--ok); }
.badge.status-pausado { background: #fef3c7; color: var(--warn); }
.badge.status-descartado { background: #fee2e2; color: var(--danger); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 > *, .grid3 > *, .grid-cards > *, .stat-grid > * { min-width: 0; }
.field { margin-bottom: 16px; }
@media (max-width: 880px) {
  .grid2, .grid3, .alta-opciones, .alta-marco { grid-template-columns: minmax(0, 1fr); }
  .alta-vista { position: static; max-width: 300px; margin: 0 auto; }
  .alta-marco:not([data-paso="3"]) .alta-vista { display: none; }
}

.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-weight: 500; }
.flash.success { background: #dcfce7; color: var(--ok); }
.flash.error { background: #fee2e2; color: var(--danger); }
.flash.info { background: var(--brand-soft); color: var(--brand-deep); }

.login-wrap { width: calc(100% - 32px); max-width: 380px; margin: 9vh auto; }
.login-wrap .brand { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 4px; color: var(--brand-deep); }
.login-wrap .brand span { color: var(--brand); }
.login-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.o-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.o-sep::before, .o-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--brand); }
.stat .n { font-size: 30px; font-weight: 800; color: var(--brand-deep); }
.stat .n.warn { color: var(--warn); }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ícono del producto, sacado de su sitio (lib/product-icon.js) */
.pico { width: 22px; height: 22px; border-radius: 6px; vertical-align: -5px; object-fit: cover; background: #fff; border: 1px solid var(--line); }
.pico.sm { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; }
.pico.lg { width: 32px; height: 32px; border-radius: 8px; vertical-align: -7px; }
a.badge { text-decoration: none; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Filtros ── */
.filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.filtros select, .filtros input { width: auto; flex: 1 1 140px; }
.filtros input[type="search"] { flex: 3 1 240px; }
.tabs { display: flex; min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: #fff; scrollbar-width: thin; }
.tabs a { padding: 9px 14px; flex-shrink: 0; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.tabs a + a { border-left: 1px solid var(--line); }
.tabs a.active { background: var(--brand); color: #fff; }

/* ── Grillas de tarjetas ── */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px; }
.card.creative { padding: 0; overflow: hidden; color: inherit; display: flex; flex-direction: column; margin: 0; }
.card.creative:hover { border-color: var(--brand); text-decoration: none; }
.card.creative .thumb { position: relative; aspect-ratio: 1 / 1; background: #eef2f2; }
.card.creative .thumb { overflow: hidden; }
.card.creative .thumb img, .card.creative .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card.creative .thumb .noimg { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.card.creative .thumb .badge { position: absolute; left: 8px; top: 8px; }
.card.creative .thumb .badge.pend, .card.creative .thumb .badge.fmt { left: auto; right: 8px; }
.card.creative .body { padding: 12px 14px; display: grid; gap: 3px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.badge.brief-planificando, .badge.brief-aprobado, .badge.brief-generando, .badge.job-corriendo { background: #fef3c7; color: var(--warn); }
.badge.brief-plan { background: #e0e7ff; color: #4f46e5; }
.badge.brief-listo, .badge.job-listo { background: #dcfce7; color: var(--ok); }
.badge.brief-error, .badge.job-error { background: #fee2e2; color: var(--danger); }
.badge.brief-descartado, .badge.job-pendiente { background: #f3f4f6; color: var(--muted); }
.perf { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.perf span { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.perf span.ok { background: #dcfce7; color: var(--ok); }

.formatos { display: flex; gap: 14px; flex-wrap: wrap; }
.formatos figure { margin: 0; flex: 1 1 180px; max-width: 320px; }
.formatos img, .formatos video { width: 100%; border-radius: 9px; border: 1px solid var(--line); display: block; }
.formatos figcaption { margin-top: 6px; }
.piezas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.piezas a { display: grid; gap: 4px; width: 92px; text-align: center; }
.piezas img, .piezas video { width: 92px; height: 92px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
audio { width: 100%; min-width: 0; margin-top: 10px; }
input[type="file"] { max-width: 100%; }

/* Referencias del Estudio: selección opcional, ordenada y acotada al producto. */
.studio-references { min-width: 0; margin: 18px 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.studio-references [hidden] { display: none !important; }
.studio-references legend { padding: 0 5px; font-weight: 700; }
.studio-references p { margin: 8px 0; line-height: 1.6; }
.reference-product-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.reference-search { margin-top: 14px; }
.reference-search > label { display: block; font-size: 13px; margin-bottom: 6px; }
.reference-search > div { display: flex; gap: 8px; }
.reference-search input { min-width: 0; flex: 1; width: 100%; }
.reference-options { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.reference-option { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.reference-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.reference-option input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; }
.reference-option img, .reference-used-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.reference-option > span, .reference-used-list li > span { min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; font-size: 12px; }
.reference-option [data-reference-description] { color: var(--muted); }
.reference-more { margin-top: 10px; }
.reference-selection { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.reference-selection ol { margin: 8px 0 0; padding-left: 22px; }
.reference-selection li { margin-bottom: 10px; overflow-wrap: anywhere; font-size: 13px; }
.reference-selection li .btn { margin: 5px 8px 0 0; }
.studio-reference-summary h2 { font-size: 17px; margin: 0 0 8px; }
.reference-used-list { display: grid; gap: 12px; margin: 16px 0 0; padding-left: 22px; }
.reference-used-list li { display: flex; align-items: center; gap: 12px; }
@media (max-width: 400px) {
  .studio-references { padding: 11px; }
  .reference-search > div { flex-wrap: wrap; }
  .reference-search input { flex-basis: 100%; }
  .reference-option img, .reference-used-list img { width: 54px; height: 54px; }
}

/* La cabecera crece con su contenido; en pantallas chicas el menú es plegable. */
@media (max-width: 1100px) {
  .admin-nav { position: static; }
  .nav-top { flex-wrap: wrap; justify-content: space-between; gap: 12px; }
  .nav-menu { flex-basis: 100%; }
  .nav-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 4px; }
  .nav a.link { padding: 12px; border-radius: 8px; }
  .nav a.link.active { background: var(--brand-soft); border-bottom: none; }
  .nav-account { width: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
  .nav-zona { display: none; }
  .nav-enhanced .nav-toggle { display: inline-flex; min-height: 44px; }
  .nav-enhanced:not(.menu-open) .nav-menu { display: none; }
}

@media (max-width: 600px) {
  .nav { padding: 10px 16px; gap: 10px; }
  .nav-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav .prod-switch { width: 100%; }
  .nav .prod-switch a, .tabs a { min-height: 44px; }
  .container { padding: 22px 16px 48px; }
  .page-head { gap: 10px; margin-bottom: 16px; }
  .page-head h1 { font-size: 23px; flex-basis: 100%; }
  .card { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 16px; }
  .stat .n { font-size: 28px; }
  .btn, .btn.sm { min-height: 44px; justify-content: center; }
  .filtros { padding: 12px; }
  .filtros select, .filtros input, .filtros input[type="search"] { flex-basis: 100%; }
  .filtros input[type="checkbox"] { flex-basis: auto; }
  select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], textarea { font-size: 16px; }
  table.kv tr { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  table.kv tr:last-child { border-bottom: none; }
  table.kv th, table.kv td { display: block; width: auto; border: none; }
  table.kv th, .pasos-llave table.kv th { width: auto; padding-bottom: 0; }
  .llave { padding: 12px; }
  .login-wrap { margin: 5vh auto; }
}

/* ── Conectar tu IA: una guía para quien nunca programó ── */
.ia { max-width: 1020px; margin: 0 auto; }
.ia-hero, .inicio-pedido { color: #fff; border-radius: 20px; background: radial-gradient(90% 130% at 100% 0%, rgba(94, 234, 212, .32), transparent 60%), linear-gradient(150deg, #134e4a, #0f766e 78%); box-shadow: 0 18px 40px rgba(19, 78, 74, .2); }
.ia-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 40px; }
.ia-hero h1 { font-size: clamp(30px, 4.2vw, 42px); line-height: 1.1; margin: 10px 0 12px; }
.ia-hero p { margin: 0; color: #d7f5ef; font-size: 17px; line-height: 1.55; }
.ia-hero .ia-antetitulo, .ia-antetitulo { margin: 0; color: #99f6e4; font-size: 13px; font-weight: 600; }
.ia-charla { display: grid; gap: 10px; padding: 18px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 16px 36px rgba(3, 40, 37, .3); }
.ia-globo { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.ia-globo.vos { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.ia-globo.ella { justify-self: start; background: #eef4f3; border-bottom-left-radius: 4px; }
.ia-globo-marca { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--brand-deep); font-size: 11px; font-weight: 700; }
.ia-globo-marca img { border-radius: 4px; }
.ia-pregunta { margin: 30px 0 14px; font-size: 20px; }

.ia-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ia-opcion { display: flex; flex-direction: column; gap: 6px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: inherit; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .05); transition: transform .15s, box-shadow .15s, border-color .15s; }
.ia-opcion:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 12px 28px rgba(15, 118, 110, .16); text-decoration: none; }
.ia-opcion:focus-visible, .ia-codigo a:focus-visible, .media-parte:focus-visible, .inicio-ia:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ia-opcion strong { margin-top: 8px; font-size: 18px; }
.ia-opcion-texto { flex: 1; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ia-opcion-ir { margin-top: 8px; color: var(--brand); font-size: 14px; font-weight: 700; }
.ia-etiqueta { align-self: flex-start; margin-top: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ia-etiqueta.ok { background: #dcfce7; color: #166534; }
.ia-etiqueta.aviso { background: #fef3c7; color: #92400e; }
.ia-marca { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px; background: #475569; color: #fff; }
.ia-marca svg { width: 24px; height: 24px; }
.ia-marca-claude, .ia-marca-claude-code { background: #c15f3c; }
.ia-marca-chatgpt { background: #10a37f; }
.ia-marca-otra { background: var(--brand); }
.ia-marca-codex, .ia-marca-cursor { background: #1f2937; }
.ia-marca-vscode { background: #2563eb; }
.ia-codigo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.ia-codigo span { margin-right: 4px; }
.ia-codigo a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 500; }
.ia-codigo a:hover { border-color: var(--brand); text-decoration: none; }
.ia-garantias { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; margin: 30px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.ia-garantias li { position: relative; display: grid; gap: 3px; padding-left: 28px; font-size: 14px; }
.ia-garantias li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 19px; height: 19px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; }
.ia-garantias span { color: var(--muted); line-height: 1.5; }

.ia-volver { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.ia-cabeza { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.ia-cabeza .ia-marca { width: 58px; height: 58px; border-radius: 16px; }
.ia-cabeza .ia-marca svg { width: 30px; height: 30px; }
.ia-cabeza h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; }
.ia-cabeza p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.ia-pasos { list-style: none; counter-reset: ia-paso; display: grid; gap: 14px; margin: 0; padding: 0; }
.ia-paso { counter-increment: ia-paso; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; padding: 24px 24px 24px 74px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .05); }
.ia-paso:not(:has(.ia-mock)) { grid-template-columns: minmax(0, 1fr); }
.ia-paso::before { content: counter(ia-paso); position: absolute; left: 22px; top: 24px; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: linear-gradient(150deg, #14b8a6, #0f766e); color: #fff; font-weight: 800; box-shadow: 0 4px 10px rgba(15, 118, 110, .3); }
.ia-paso:not(:last-child)::after { content: ""; position: absolute; left: 38px; top: 64px; bottom: -38px; width: 2px; background: var(--brand-soft); z-index: 1; }
.ia-paso.sola { padding: 24px; }
.ia-paso.sola::before, .ia-paso.sola::after { display: none; }
.ia-paso-texto { min-width: 0; }
.ia-paso-texto h2 { margin: 4px 0 8px; font-size: 19px; }
.ia-paso-texto p { margin: 0 0 12px; color: #374151; line-height: 1.6; }
.ia-paso-texto p:last-child { margin-bottom: 0; }
.btn.ia-boton { padding: 11px 18px; font-size: 15px; }
.ia-copiar { margin: 0 0 12px; }
.ia-copiar label { margin-bottom: 5px; color: var(--muted); }
.ia-copiar-fila { display: flex; gap: 8px; align-items: stretch; }
.ia-copiar-fila input[type="text"], .ia-copiar-fila textarea { flex: 1; width: auto; background: #f3f7f6; border-color: #d5e4e1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; resize: none; }
.ia-copiar-fila textarea { field-sizing: content; }
.ia-copiar-fila .btn { flex-shrink: 0; align-self: flex-start; min-width: 92px; justify-content: center; }
.btn.copiado { background: var(--ok); }
.ia-mock { padding: 14px; border-radius: 14px; background: linear-gradient(160deg, #eef6f4, #dcece8); }
.ia-ventana { overflow: hidden; border-radius: 10px; background: #fff; font-size: 12px; box-shadow: 0 8px 20px rgba(16, 24, 40, .12); }
.ia-ventana-barra { display: flex; align-items: center; gap: 5px; padding: 7px 10px; background: #f3f4f6; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10.5px; }
.ia-ventana-barra i { width: 7px; height: 7px; flex-shrink: 0; border-radius: 999px; background: #d1d5db; }
.ia-ventana-barra span { min-width: 0; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-ventana-cuerpo { display: grid; gap: 10px; padding: 13px; }
.ia-ventana-cuerpo.centrado { justify-items: center; text-align: center; }
.ia-mock-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ia-mock-fila.derecha { justify-content: flex-end; }
.ia-mock-boton { padding: 5px 10px; border-radius: 7px; background: #111827; color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ia-mock-boton.ancho { width: 100%; background: var(--brand); text-align: center; }
.ia-mock-menu { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; box-shadow: 0 4px 12px rgba(16, 24, 40, .12); }
.ia-mock-campo { display: grid; gap: 3px; }
.ia-mock-campo small { color: var(--muted); font-size: 10px; }
.ia-mock-campo span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: ui-monospace, monospace; font-size: 10.5px; }
.ia-mock-linea { width: 100%; height: 7px; border-radius: 999px; background: #eef1f2; }
.ia-mock-linea.corta { width: 60%; }
.ia-mock .marca { outline: 2px solid #f59e0b; outline-offset: 2px; animation: ia-latido 1.8s ease-in-out infinite; }
@keyframes ia-latido { 50% { outline-color: rgba(245, 158, 11, .2); } }

.ia-aviso { margin-bottom: 16px; padding: 16px 18px; border: 1px solid #fde68a; border-radius: 14px; background: #fffbeb; }
.ia-aviso p { margin: 6px 0 8px; color: #57534e; line-height: 1.55; }
.ia-aviso a { font-weight: 600; }
.ia-final { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 26px; margin-top: 16px; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .05); transition: border-color .3s, background .3s; }
.ia-final [hidden] { display: none; }
.ia-final-estado { display: flex; align-items: flex-start; gap: 14px; }
.ia-final-icono { flex-shrink: 0; width: 14px; height: 14px; margin-top: 7px; border-radius: 999px; background: var(--brand); animation: alta-latido 1.4s ease-in-out infinite; }
.ia-final h2 { margin: 0 0 6px; font-size: 20px; }
.ia-final p { margin: 0 0 10px; color: var(--muted); line-height: 1.55; }
.ia-final.listo { border-color: #86efac; background: linear-gradient(160deg, #f0fdf4, #fff 65%); }
.ia-final.listo .ia-final-icono { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-top: 0; background: var(--ok); animation: none; }
.ia-final.listo .ia-final-icono::before { content: "✓"; color: #fff; font-size: 18px; font-weight: 800; }
.ia-probar h3 { margin: 0 0 4px; font-size: 15px; }
.ia-dudas { margin-top: 26px; }
.ia-dudas h2 { margin: 0 0 10px; font-size: 18px; }
.ia-duda { margin-bottom: 8px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ia-duda summary { cursor: pointer; font-weight: 600; }
.ia-duda p { margin: 10px 0 2px; color: #374151; line-height: 1.6; }
.ia-a-mano { margin-top: 14px; }
.ia-a-mano pre.json { max-height: none; white-space: pre-wrap; line-height: 1.7; }
.ia-a-mano pre code, #alternativa-local pre code { background: none; padding: 0; color: inherit; }
.ia-pie { margin-top: 28px; text-align: center; }

.ia-conexiones { display: grid; gap: 12px; }
.ia-conexion { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .05); }
.ia-conexion form { margin: 0; flex-shrink: 0; }
.ia-conexion-cuerpo { flex: 1; min-width: 0; }
.ia-conexion-titulo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ia-conexion-titulo strong { font-size: 17px; }
.ia-conexion p { margin: 4px 0 8px; color: var(--muted); font-size: 14px; }
.ia-conexion-permisos { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.ia-conexion-permisos li { padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; }
.ia-actividad { list-style: none; margin: 0; padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.ia-actividad li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.ia-actividad li:first-child { border-top: none; }
.ia-actividad-quien { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-programan { margin-top: 26px; }
.ia-programan > summary { color: var(--muted); }
.ia-programan > form { margin-top: 14px; }

/* El permiso se abre en una ventanita, viniendo de la IA: una sola decisión, sin menú. */
body.ia-solo { min-height: 100vh; background: radial-gradient(70% 50% at 50% 0%, #dff5f0, transparent 70%), var(--bg); }
.ia-permiso { width: calc(100% - 32px); max-width: 500px; margin: 0 auto; padding: 36px 0 44px; text-align: center; }
.ia-permiso-marcas { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ia-permiso-marcas img { width: 46px; height: 46px; border-radius: 13px; }
.ia-permiso-enlace { width: 34px; border-top: 2px dashed #94a3b8; }
.ia-permiso h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; }
.ia-permiso-bajada { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.ia-permiso .flash { text-align: left; }
.ia-permiso-form { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; text-align: left; box-shadow: 0 12px 32px rgba(16, 24, 40, .08); }
.ia-permiso-form h2 { margin: 0 0 10px; font-size: 15px; }
.ia-permiso-fila { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 400; cursor: pointer; }
.ia-permiso-fila:has(input:checked) { border-color: var(--brand); background: #f3fbfa; }
.ia-permiso-fila:has(input:disabled) { cursor: default; }
.ia-permiso-fila input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }
.ia-permiso-fila strong { display: block; margin-bottom: 2px; font-size: 15px; }
.ia-permiso-fila small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.btn.ia-boton-grande { width: 100%; margin-top: 8px; padding: 13px 18px; justify-content: center; font-size: 15px; }
.ia-permiso-nota { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.ia-permiso-instancia { display: block; margin-top: 4px; font-size: 11px; opacity: .8; }

/* ── Media: anuncios terminados y materiales para armarlos ── */
.media-partes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.media-parte { display: grid; gap: 3px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: inherit; transition: border-color .15s, background .15s; }
.media-parte strong { font-size: 16px; }
.media-parte span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.media-parte:hover { border-color: var(--brand); text-decoration: none; }
.media-parte.activa { border-color: var(--brand); background: #f3fbfa; box-shadow: inset 0 0 0 1px var(--brand); }
.media-parte.activa strong { color: var(--brand-deep); }
.media-origenes { width: fit-content; margin-bottom: 12px; }
.media-total { margin: 0 0 12px; }
.media-total p { margin: 0; }

/* ── Inicio: qué pedir, qué espera y lo último que salió ── */
.inicio-pedido { margin-bottom: 24px; padding: 32px 36px; }
.inicio-pedido h1 { margin: 6px 0 14px; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; }
.inicio-pedido > p:not(.ia-antetitulo):not(.inicio-nota) { max-width: 640px; margin: 0 0 18px; color: #d7f5ef; font-size: 16px; line-height: 1.55; }
.inicio-pedido > .actions { gap: 16px; }
.inicio-pedido > .actions .btn { background: #fff; color: var(--brand-deep); }
.inicio-enlace { color: #d7f5ef; font-size: 14px; text-decoration: underline; }
.inicio-enlace:hover { color: #fff; }
.inicio-form { padding: 10px; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 12px 30px rgba(3, 40, 37, .25); }
.inicio-form textarea { display: block; padding: 8px 10px; border: none; color: var(--ink); font-size: 16px; line-height: 1.45; resize: none; }
.inicio-form textarea:focus { outline: none; }
.inicio-form:focus-within { box-shadow: 0 0 0 3px rgba(153, 246, 228, .75), 0 12px 30px rgba(3, 40, 37, .25); }
.inicio-form-pie { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 6px 2px 2px 10px; }
.inicio-form select { width: auto; max-width: 280px; }
.inicio-para { color: var(--muted); font-size: 13px; }
.btn.inicio-boton { padding: 10px 18px; font-size: 15px; }
.inicio-nota { margin: 10px 2px 0; color: #c7efe7; font-size: 13px; }
.inicio-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.inicio-columnas { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.inicio-principal { display: grid; gap: 24px; min-width: 0; }
.inicio-principal h2 { margin: 0 0 12px; font-size: 18px; }
.inicio-seccion { margin-bottom: 12px; }
.inicio-seccion h2 { margin: 0; }
.inicio-idiomas { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.inicio-idiomas label { margin: 0; }
.inicio-idiomas select { width: auto; max-width: 100%; }
#inicio-ultimos { scroll-margin-top: 180px; }
.inicio-tareas { list-style: none; margin: 0; padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.inicio-tarea { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.inicio-tarea:first-child { border-top: none; }
.inicio-tarea .btn { flex-shrink: 0; }
.inicio-tarea-punto { flex-shrink: 0; width: 10px; height: 10px; border-radius: 999px; background: #cbd5e1; }
.inicio-tarea.plan .inicio-tarea-punto { background: var(--brand); }
.inicio-tarea.planificando .inicio-tarea-punto, .inicio-tarea.aprobado .inicio-tarea-punto, .inicio-tarea.generando .inicio-tarea-punto { background: var(--warn); animation: alta-latido 1.4s ease-in-out infinite; }
.inicio-tarea.error .inicio-tarea-punto { background: var(--danger); }
.inicio-tarea-texto { flex: 1; display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.inicio-grilla { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
.inicio-vacio { margin: 0; padding: 40px 20px; }
.inicio-vacio p { margin: 0 0 4px; }
.usage-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; margin: 20px 0; }
.usage-summary .card { margin: 0; }
.usage-metric { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.usage-number { display: block; font-size: clamp(24px, 3vw, 34px); font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.usage-metric .hint { line-height: 1.5; }
.card.stats-creditos { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.stats-creditos .hint { color: inherit; }
.stats-creditos .inicio-barra { margin: 6px 0; }
.stats-intro { margin-top: -8px; font-size: 14px; }
.usage-filters { align-items: flex-end; flex-wrap: wrap; }
.usage-filters .field { margin: 0; flex: 1 1 180px; }
.usage-filters > .grid2 { margin-bottom: 14px; }
.usage-account { margin-top: 20px; }
.stats-detalle { align-items: start; }
.stats-detalle h2 { font-size: 18px; margin: 0 0 16px; }
.stats-desglose { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.stats-desglose .row-between { align-items: baseline; font-size: 14px; }
.stats-desglose .row-between > span { font-variant-numeric: tabular-nums; }
#stats-consumo { scroll-margin-top: 180px; }
.inicio-lateral { display: grid; gap: 14px; min-width: 0; }
.inicio-lateral .card { margin: 0; padding: 16px; }
.inicio-numeros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inicio-barra { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #eef2f2; }
.inicio-barra span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14b8a6, #0f766e); }
.inicio-pasos ol { list-style: none; display: grid; gap: 8px; margin: 10px 0; padding: 0; font-size: 14px; }
.inicio-pasos li { position: relative; padding-left: 24px; }
.inicio-pasos li::before { content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border: 2px solid var(--line); border-radius: 999px; }
.inicio-pasos li.hecho { color: var(--muted); }
.inicio-pasos li.hecho::before { content: "✓"; border-color: var(--brand); background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }
.inicio-ia { display: flex; align-items: center; gap: 12px; color: inherit; transition: border-color .15s; }
.inicio-ia:hover { border-color: var(--brand); text-decoration: none; }
.inicio-ia .ia-marca { width: 38px; height: 38px; border-radius: 10px; }
.inicio-ia .ia-marca svg { width: 20px; height: 20px; }
.inicio-ia > span:nth-child(2) { flex: 1; display: grid; gap: 2px; min-width: 0; }
.inicio-ia small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.inicio-productos ul { list-style: none; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; }
.inicio-productos li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inicio-productos li > a { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); }
.inicio-pico-vacio { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; font-weight: 800; }
.inicio-tecnico { margin: 24px 0 0; }
.inicio-tecnico > summary { color: var(--muted); }

@media (max-width: 880px) {
  .ia-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 22px; }
  .ia-opciones, .ia-garantias, .ia-final, .inicio-columnas { grid-template-columns: minmax(0, 1fr); }
  .ia-paso { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 18px 20px 62px; }
  .ia-paso::before { left: 16px; top: 20px; width: 32px; height: 32px; }
  .ia-paso:not(:last-child)::after { display: none; }
  .ia-mock { max-width: 360px; }
  .inicio-pedido { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .ia-paso { padding: 18px 16px; }
  .ia-paso::before { position: static; margin-bottom: -6px; }
  .ia-copiar-fila { flex-wrap: wrap; }
  .ia-copiar-fila input[type="text"], .ia-copiar-fila textarea { flex-basis: 100%; }
  .ia-copiar-fila .btn { width: 100%; }
  .ia-conexion { flex-wrap: wrap; }
  .ia-conexion form, .ia-conexion form .btn { width: 100%; }
  .ia-actividad li { grid-template-columns: minmax(0, 1fr) auto; }
  .ia-actividad-que { grid-column: 1 / -1; grid-row: 2; }
  .media-partes { grid-template-columns: minmax(0, 1fr); }
  .media-origenes { width: 100%; }
  .inicio-form select, .inicio-form .btn { width: 100%; max-width: none; }
  .inicio-tarea { flex-wrap: wrap; }
  .inicio-tarea .btn { width: 100%; }
  .inicio-form textarea { min-height: 104px; }
  .inicio-grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .inicio-grilla .card.creative .body { padding: 10px 11px; }
  .ia-copiar-fila textarea { min-height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .ia-opcion, .media-parte, .ia-final, .inicio-ia { transition: none; }
  .ia-opcion:hover { transform: none; }
  .ia-mock .marca, .ia-final-icono, .inicio-tarea-punto { animation: none; }
}

/* ── El Estudio: charla a un lado, plan al otro ── */
.estudio-portada { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 42px; align-items: center; margin-bottom: 18px; padding: 36px; border: 1px solid #245d56; border-radius: 24px; background: radial-gradient(ellipse at 0 0, #24675c, transparent 65%), #103c36; color: #fff; }
.estudio-portada .ia-antetitulo { margin: 0 0 12px; color: #a6e7d4; }
.estudio-portada h1 { max-width: 520px; margin: 0; font-size: clamp(28px, 3.5vw, 40px); font-weight: 650; letter-spacing: -1.3px; line-height: 1.12; }
.estudio-portada p:not(.ia-antetitulo) { max-width: 500px; margin: 16px 0 22px; color: #c1dcd5; font-size: 14px; line-height: 1.65; }
.estudio-portada .btn { padding: 12px 18px; background: #ccfbdf; color: #103c36; }
.estudio-portada-pasos { display: grid; gap: 20px; list-style: none; padding: 24px 0 24px 30px; margin: 0; border-left: 1px solid #46756b; }
.estudio-portada-pasos li { display: flex; align-items: start; gap: 14px; }
.estudio-portada-pasos li > span { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border: 1px solid #527f73; border-radius: 10px; font-size: 11px; color: #c8f4df; }
.estudio-portada-pasos strong, .estudio-portada-pasos small { display: block; }
.estudio-portada-pasos strong { font-size: 14px; font-weight: 600; }
.estudio-portada-pasos small { margin-top: 5px; color: #b5d1c8; font-size: 12px; line-height: 1.4; }
.estudio-arranques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.estudio-arranque { display: grid; gap: 7px; padding: 19px 20px; border: 1px solid #dce6e2; border-radius: 16px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1.5; transition: border-color .15s, background .15s; }
.estudio-arranque:hover { border-color: var(--brand); background: #f3fbf7; text-decoration: none; }
.estudio-arranque:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.estudio-arranque .estudio-arranque-tipo { color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.estudio-arranque strong { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 16px; font-weight: 600; }
.estudio-arranque strong span { color: var(--brand); }
.estudio-seccion-cabeza { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; margin: 26px 0 12px; }
.estudio-seccion-cabeza h2 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
.estudio-filtros { padding: 12px; box-shadow: none; }
.estudio-siguiente { margin-top: 4px; color: var(--brand); font-size: 12px; font-weight: 600; }
.estudio-siguiente span { margin-left: 4px; }
.badge.brief-conversando { background: var(--brand-soft); color: var(--brand-deep); }
.estudio-nuevo { max-width: 860px; margin: 0 auto; }
.estudio-nuevo-hero { margin: 0 0 16px; padding: 32px; border-radius: 24px; background: radial-gradient(ellipse at 0 0, #24675c, transparent 65%), #103c36; }
.estudio-nuevo-hero h1 { font-size: clamp(27px, 3.5vw, 36px); letter-spacing: -1px; }
.estudio-nuevo-hero > p:not(.ia-antetitulo) { margin-bottom: 18px; }
.estudio-nuevo-hero.inicio-pedido > p.estudio-sin-cargo { margin: 16px 0 0; font-size: 12px; color: #c1dcd5; }
.estudio-prompt-ayuda { display: flex; justify-content: space-between; gap: 12px; padding: 0 14px 10px; color: #64736e; font-size: 11px; }
#estudio-contador { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.estudio-nuevo-hero textarea { min-height: 128px; line-height: 1.6; }
.estudio-producto { min-width: 0; flex: 1; }
.estudio-producto select { width: auto; max-width: 100%; }
.estudio-ejemplos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; color: #c7efe7; font-size: 13px; }
.estudio-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--brand-deep); font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.estudio-chip:hover { border-color: var(--brand); background: #f3fbfa; }
.estudio-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.estudio-chip.claro { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; }
.estudio-chip.claro:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .6); }
.estudio-chip.claro:focus-visible { outline-color: #99f6e4; }
.estudio-pasos { list-style: none; counter-reset: estudio-paso; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; }
.estudio-pasos li { counter-increment: estudio-paso; display: grid; gap: 3px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.estudio-pasos li::before { content: counter(estudio-paso); display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-bottom: 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; font-weight: 800; }
.estudio-pasos span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.estudio-extra { margin-bottom: 12px; padding: 14px 18px; }
.estudio-extra .studio-references { margin: 12px 0 0; }

.estudio-cabeza { margin-bottom: 14px; }
.estudio-recorrido { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 20px 0 24px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.estudio-recorrido li { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--muted); font-size: 12px; }
.estudio-recorrido li + li { border-left: 1px solid var(--line); }
.estudio-recorrido li > span { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 50%; background: #f0f3f2; font-size: 10px; }
.estudio-recorrido li.actual { background: #eaf6ef; color: var(--brand-deep); }
.estudio-recorrido li.actual > span { background: var(--brand-deep); color: #fff; }
.estudio-recorrido li.completo > span { color: var(--brand); background: #eaf6ef; }
.estudio-saltos { display: none; }
.estudio-charla-cabeza { display: flex; flex-shrink: 0; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #f9fcfa; }
.estudio-charla-cabeza img { border-radius: 10px; }
.estudio-charla-cabeza h2 { margin: 0; font-size: 14px; font-weight: 650; }
.estudio-charla-cabeza p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.estudio-plan-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.estudio-plan-cabeza .ia-antetitulo { margin: 0 0 5px; color: var(--brand); font-size: 10px; }
.estudio-plan-cabeza h2 { margin: 0; font-size: 22px; letter-spacing: -.5px; }
.estudio-plan-ayuda { margin: 0; padding: 12px 14px; color: #426459; background: #eaf3ee; border-radius: 10px; font-size: 12px; line-height: 1.5; }
#estudio-panel, #estudio-conversacion { scroll-margin-top: 150px; }
.estudio-titulo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.estudio-titulo h1 { margin: 0; font-size: 22px; }
.estudio-titulo h1 .hint { font-size: 13px; }
.estudio-marco { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.estudio-charla { position: sticky; top: 142px; display: flex; flex-direction: column; min-width: 0; max-height: calc(100dvh - 158px); overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06); }
.estudio-mensajes { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 120px; padding: 16px; overflow-y: auto; }
.estudio-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.estudio-msg > div { white-space: pre-wrap; }
.estudio-msg.persona { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.estudio-msg.asistente { align-self: flex-start; background: #eef4f3; color: var(--ink); border-bottom-left-radius: 4px; }
.estudio-msg-autor { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; color: var(--brand-deep); font-size: 11px; font-weight: 700; }
.estudio-msg-autor img { border-radius: 4px; }
.estudio-escribiendo { display: flex; align-items: center; gap: 5px; padding: 14px; }
.estudio-escribiendo span { width: 7px; height: 7px; border-radius: 999px; background: #8aa9a4; animation: estudio-punto 1.2s ease-in-out infinite; }
.estudio-escribiendo span:nth-child(2) { animation-delay: .15s; }
.estudio-escribiendo span:nth-child(3) { animation-delay: .3s; }
@keyframes estudio-punto { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.estudio-sugerencias { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.estudio-composer { padding: 12px; border-top: 1px solid var(--line); background: #fbfdfc; overflow-y: auto; flex-shrink: 1; min-height: 100px; max-height: 48vh; }
.estudio-composer[aria-busy="true"] button[type="submit"] { opacity: .6; cursor: wait; }
.estudio-composer textarea { display: block; font-size: 15px; line-height: 1.45; resize: none; }
.estudio-composer-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.estudio-error { margin: 8px 0 0; padding: 8px 12px; font-size: 13px; }
.estudio-materiales { margin-top: 8px; font-size: 13px; }
.estudio-materiales summary { color: var(--muted); font-weight: 600; cursor: pointer; }
.estudio-materiales .studio-references { margin: 8px 0 0; padding: 12px; }
.estudio-materiales .reference-options { max-height: 220px; }
.estudio-panel { display: grid; gap: 14px; min-width: 0; }
.estudio-panel > .flash { margin: 0; }
.estudio-vacio { padding: 36px 24px; text-align: center; background: #fff; border: 1px dashed #c9d8d5; border-radius: 16px; }
.estudio-vacio strong { font-size: 16px; }
.estudio-vacio p { max-width: 420px; margin: 6px auto 14px; color: var(--muted); line-height: 1.5; }
.estudio-armando, .estudio-avance, .estudio-listo, .estudio-cola, .estudio-aprobar, .estudio-fotos, .estudio-resultados { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.estudio-armando p { margin: 4px 0 14px; }
.estudio-esqueleto { display: grid; gap: 8px; }
.estudio-esqueleto span { height: 14px; border-radius: 999px; background: linear-gradient(90deg, #eef2f2, #f8faf9, #eef2f2); background-size: 200% 100%; animation: estudio-brillo 1.4s linear infinite; }
.estudio-esqueleto span:nth-child(2) { width: 80%; }
.estudio-esqueleto span:nth-child(3) { width: 60%; }
@keyframes estudio-brillo { to { background-position: -200% 0; } }
.estudio-cola { display: flex; align-items: flex-start; gap: 16px; border-color: #fcd34d; background: #fffdf5; }
.estudio-cola-numero { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(150deg, #f59e0b, #d97706); color: #fff; font-size: 24px; font-weight: 800; }
.estudio-cola strong { font-size: 16px; }
.estudio-cola p { margin: 4px 0 10px; color: #57534e; line-height: 1.5; }
.estudio-etapas { list-style: none; display: grid; gap: 6px; margin: 12px 0 0; padding: 0; font-size: 14px; }
.estudio-etapas li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding-left: 22px; }
.estudio-etapas li::before { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 999px; }
.estudio-etapas li.corriendo::before { border-color: var(--warn); background: var(--warn); animation: alta-latido 1.4s ease-in-out infinite; }
.estudio-etapas li.listo { color: var(--muted); }
.estudio-etapas li.listo::before { border-color: var(--brand); background: var(--brand); }
.estudio-etapas li.error::before { border-color: var(--danger); background: var(--danger); }
.estudio-listo { border-color: #86efac; background: linear-gradient(160deg, #f0fdf4, #fff 65%); }
.estudio-listo strong { font-size: 17px; }
.estudio-listo p { margin: 4px 0 12px; color: var(--muted); }
.estudio-aprobar { position: sticky; bottom: 12px; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; border-color: var(--brand); box-shadow: 0 -6px 24px rgba(15, 118, 110, .14), 0 10px 24px rgba(15, 118, 110, .14); }
.estudio-aprobar-costo { flex: 1; display: grid; min-width: 150px; }
.estudio-aprobar-costo strong { font-size: 24px; line-height: 1.15; color: var(--brand-deep); }
.estudio-aprobar .btn:not(.sm) { padding: 12px 20px; font-size: 15px; }
.estudio-aprobar-nota { flex-basis: 100%; margin: 0; line-height: 1.5; }
.estudio-descartar { margin: 0; text-align: right; }
.estudio-plan { display: grid; gap: 12px; }
.estudio-plan-resumen { margin: 0; color: #374151; font-size: 15px; line-height: 1.5; }
.estudio-anuncio { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.estudio-anuncio header { display: flex; justify-content: space-between; gap: 10px; }
.estudio-anuncio-tipo { color: var(--brand); font-size: 12px; font-weight: 700; }
.estudio-anuncio h3 { margin: 6px 0 4px; font-size: 17px; line-height: 1.3; }
.estudio-anuncio > p { margin: 8px 0 0; }
.estudio-datos { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; padding: 0; }
.estudio-datos li { padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; }
.estudio-guion { padding: 10px 12px; border-radius: 10px; background: #f6f8f8; color: #374151; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.estudio-escenas { list-style: none; counter-reset: estudio-escena; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; }
.estudio-escenas li { counter-increment: estudio-escena; position: relative; display: grid; gap: 2px; padding-left: 28px; font-size: 14px; line-height: 1.45; }
.estudio-escenas li::before { content: counter(estudio-escena); position: absolute; left: 0; top: 1px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-deep); font-size: 11px; font-weight: 800; }
.estudio-escenas.unica li { padding-left: 0; }
.estudio-escenas.unica li::before { display: none; }
.estudio-razon { font-style: italic; }
.estudio-fotos .reference-used-list { margin-top: 10px; }
.estudio-resultados h2 { margin: 0; font-size: 17px; }
.estudio-resultado { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.estudio-tecnico { padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.estudio-tecnico summary { color: var(--muted); font-weight: 600; cursor: pointer; }
.estudio-tecnico .hint { font-weight: 400; }
.estudio-pie { margin: 0 2px; line-height: 1.5; }

.estudio-gasto { margin-bottom: 14px; padding: 14px 18px; }
.estudio-pedidos { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.estudio-pedido { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.estudio-pedido:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(15, 118, 110, .1); text-decoration: none; }
.estudio-pedido:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.estudio-pedido-texto { flex: 1; display: grid; gap: 3px; min-width: 0; }
.estudio-pedido-texto strong { font-weight: 600; -webkit-line-clamp: 2; }
.estudio-pedido-estado { flex-shrink: 0; display: grid; justify-items: end; gap: 4px; }

@media (max-width: 880px) {
  .estudio-portada { gap: 26px; padding: 28px; }
  .estudio-portada-pasos { padding-left: 22px; }
  .estudio-arranque { padding: 16px; }
  .estudio-arranque strong { font-size: 14px; }
  .estudio-marco { grid-template-columns: minmax(0, 1fr); }
  .estudio-charla { position: static; max-height: none; }
  .estudio-mensajes { max-height: 55vh; min-height: 160px; }
  .estudio-pasos { grid-template-columns: minmax(0, 1fr); }
  .estudio-aprobar { position: static; }
  .estudio-saltos { display: flex; gap: 10px; margin: -8px 0 18px; }
  .estudio-saltos a { padding: 9px 12px; border: 1px solid #dce6e2; border-radius: 9px; background: #fff; font-size: 12px; }
}
@media (max-width: 600px) {
  .estudio-portada { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; border-radius: 18px; }
  .estudio-portada-pasos { gap: 14px; padding: 20px 0 0; border-left: 0; border-top: 1px solid #46756b; }
  .estudio-portada p:not(.ia-antetitulo) { margin: 12px 0 18px; }
  .estudio-arranques { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .estudio-arranque { gap: 4px; }
  .estudio-nuevo-hero { padding: 22px 18px; border-radius: 18px; }
  .estudio-recorrido li { flex-direction: column; justify-content: start; gap: 6px; padding: 12px 4px; text-align: center; font-size: 10px; }
  .estudio-nuevo-hero .inicio-form-pie { flex-direction: column; align-items: stretch; }
  .estudio-producto select { width: 100%; }
  .estudio-nuevo-hero .inicio-boton { justify-content: center; }
  .estudio-composer-pie { align-items: end; }
  .estudio-aprobar form, .estudio-aprobar .btn { width: 100%; }
  .estudio-pedido { flex-wrap: wrap; }
  .estudio-pedido-estado { width: 100%; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .estudio-cola { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .estudio-escribiendo span, .estudio-esqueleto span, .estudio-etapas li.corriendo::before { animation: none; }
  .estudio-chip, .estudio-pedido { transition: none; }
  .estudio-arranque { transition: none; }
}

/* Muestras: elegir qué piezas se comparten */
.muestra-pieza { cursor: pointer; }
.muestra-pieza:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.muestra-enlace { width: 100%; min-width: 220px; font-family: ui-monospace, monospace; font-size: 12px; }

/* El tema sigue al sistema; las imágenes y los anuncios conservan sus colores. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand: #6ee7cf;
    --brand-deep: #b2f5e5;
    --brand-soft: #173e35;
    --ink: #e5efea;
    --muted: #a5b9ae;
    --line: #354c41;
    --bg: #0d1713;
    --ok: #8be6aa;
    --warn: #f4cd82;
    --danger: #ffb9b0;
    --surface: #16251e;
    --surface-raised: #203329;
    --control: #101e17;
    --on-accent: #073b31;
  }

  body { background: var(--bg); color: var(--ink); }
  ::selection { background: #286655; color: #f2fff8; }
  :focus-visible { outline-color: var(--brand); }
  code { background: var(--surface-raised); color: #c3f4df; }
  pre.json { background: #091710; color: #cef4dc; border: 1px solid var(--line); }
  pre.json code { background: transparent; color: inherit; }

  .nav, .nav .prod-switch, .card, .stat, table, .tabs,
  .alta-opcion, .alta-chip, .alta-color-libre,
  .ia-charla, .ia-opcion, .ia-codigo a, .ia-paso, .ia-ventana,
  .ia-mock-menu, .ia-final, .ia-duda, .ia-conexion, .ia-actividad,
  .ia-permiso-form, .media-parte, .inicio-form, .inicio-tareas,
  .estudio-arranque, .estudio-chip, .estudio-pasos li, .estudio-recorrido,
  .estudio-charla, .estudio-vacio, .estudio-armando, .estudio-avance,
  .estudio-aprobar, .estudio-fotos, .estudio-resultados, .estudio-anuncio,
  .estudio-tecnico, .estudio-pedido, .estudio-saltos a {
    background: var(--surface);
    border-color: var(--line);
  }
  .estudio-aprobar { border-color: #448e74; box-shadow: 0 -6px 24px #0004, 0 10px 24px #0004; }
  .nav { box-shadow: 0 3px 20px #0002; }
  th, .ia-ventana-barra, .estudio-charla-cabeza, .estudio-composer {
    background: var(--surface-raised);
  }
  table.kv th { background: transparent; }
  select, input[type="text"], input[type="search"], input[type="email"],
  input[type="password"], input[type="number"], textarea {
    background: var(--control);
    color: var(--ink);
    border-color: var(--line);
    caret-color: var(--brand);
  }
  input::placeholder, textarea::placeholder { color: #92aa9b; opacity: 1; }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
  input:disabled, textarea:disabled, select:disabled { color: var(--muted); background: var(--surface-raised); }
  input[type="file"]::file-selector-button { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
  .ia-copiar-fila input[type="text"], .ia-copiar-fila textarea,
  .alta-pedido, .alta-espera, .estudio-guion { background: var(--control); border-color: var(--line); }

  .btn, .btn:hover, .btn.copiado, .nav .prod-switch a.active, .tabs a.active,
  .pasos-llave > li::before, .alta-marca.hecho button span,
  .alta-marca.actual button span, .inicio-pasos li.hecho::before {
    color: var(--on-accent);
  }
  .btn.secondary, .btn.secondary:hover { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
  .btn.danger, .btn.danger:hover { background: #f18f86; color: #32110d; }
  .inicio-pedido > .actions .btn { background: #c6f7db; color: #103c2b; }
  .estudio-portada .btn, .estudio-portada .btn:hover { background: #ccfbdf; color: #103c36; }
  .alta-color { border-color: var(--surface); }

  .badge.cat, .badge.fmt, .badge.status-borrador,
  .badge.brief-descartado, .badge.job-pendiente,
  .perf span, .ia-conexion-permisos li, .estudio-datos li {
    background: #283d31;
    color: #c3d4c8;
  }
  .badge.published, .badge.status-en_meta, .badge.brief-listo,
  .badge.job-listo, .flash.success, .perf span.ok, .ia-etiqueta.ok {
    background: #1b3c28;
    color: var(--ok);
  }
  .badge.draft, .badge.pend, .badge.status-pausado,
  .badge.brief-planificando, .badge.brief-aprobado, .badge.brief-generando,
  .badge.job-corriendo, .ia-etiqueta.aviso {
    background: #3f321a;
    color: var(--warn);
  }
  .badge.danger, .badge.status-descartado, .badge.brief-error,
  .badge.job-error, .flash.error { background: #432820; color: var(--danger); }
  .badge.status-lista, .badge.brief-plan { background: #2e2d48; color: #ccc6ff; }
  .badge.lang { background: #193d44; color: #a5e4ea; }
  .flash.info, .badge.brief-conversando { background: var(--brand-soft); color: var(--brand-deep); }

  .llave, .alta-lista, .media-parte.activa, .ia-permiso-fila:has(input:checked),
  .estudio-chip:hover, .estudio-arranque:hover { background: #1b392c; border-color: #47866a; }
  .alta-espera.listo, .alta-chip.elegido { background: var(--brand-soft); color: var(--brand-deep); }
  .card.creative .thumb, .inicio-barra { background: #233b2e; }
  .inicio-barra span { background: linear-gradient(90deg, #4ed7ae, #229a80); }
  .ia-globo.ella, .estudio-msg.asistente { background: #243d30; color: var(--ink); }
  .ia-globo.vos, .estudio-msg.persona { background: #1a6856; color: #f0fff8; }
  .ia-paso-texto p, .ia-duda p, .estudio-plan-resumen,
  .estudio-guion { color: #c9dace; }
  .ia-marca-otra { background: #0f766e; }
  .ia-marca-codex, .ia-marca-cursor { background: #2d3b35; }
  .ia-mock { background: linear-gradient(160deg, #203c2e, #172b21); }
  .ia-ventana-barra i, .ia-mock-linea { background: #47614e; }
  .ia-mock-boton { background: #324d3c; }
  .ia-mock-boton.ancho { background: #216c54; }
  .ia-aviso, .estudio-cola { background: #322c1b; border-color: #806a34; }
  .ia-aviso p, .estudio-cola p { color: #dfd0ac; }
  .ia-final.listo, .estudio-listo { background: linear-gradient(160deg, #1c3e2a, var(--surface) 75%); border-color: #4e8a60; }
  .ia-final.listo .ia-final-icono::before { color: #123c22; }
  body.ia-solo { background: radial-gradient(70% 50% at 50% 0%, #204b37, transparent 70%), var(--bg); }

  .estudio-prompt-ayuda { color: var(--muted); }
  .estudio-chip.claro { border-color: #76a08c; background: #ffffff12; color: #e9fff2; }
  .estudio-chip.claro:hover { background: #ffffff20; border-color: #a5c6b3; }
  .estudio-recorrido li > span { background: #2a4033; }
  .estudio-recorrido li.actual, .estudio-recorrido li.completo > span,
  .estudio-plan-ayuda { background: #1d4030; color: #b5e6c8; }
  .estudio-recorrido li.actual > span { background: #69d3a8; color: #123c29; }
  .estudio-esqueleto span { background-image: linear-gradient(90deg, #253e30, #36553f, #253e30); }
}

/* Campo señuelo fuera del recorrido visual y del teclado. */
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Página de una pieza (/app/c/:id) */
.pieza-player { position: relative; display: grid; gap: 10px; justify-items: center; }
.pieza-media { max-width: 100%; border-radius: 10px; background: #0001; }
video.pieza-media { width: 100%; max-height: 70vh; }
audio.pieza-media { width: 100%; }
.pieza-img { cursor: zoom-in; max-height: 70vh; object-fit: contain; }
.pieza-player.zoom { overflow: auto; max-height: 80vh; justify-items: start; }
.pieza-player.zoom .pieza-img { max-width: none; max-height: none; cursor: zoom-out; }
.pieza-estado { font-size: 14px; color: var(--muted); }
.pieza-estado.error { color: var(--danger); }
.pieza-play { font-size: 16px; padding: 12px 22px; }
.pieza-acciones { margin: 12px 0 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
