/* app/public/css/images.css — lote imagenes (region:images, incluye el visor).
   Sobre base.css (kit). Plano: mockups/app/imagenes.html. Prefijos img-/lb-.
   Por debajo de 900 px: pestañas Crear | Galería, un solo scroll en Crear y
   lo único fijo abajo es la barra de Generar. */

/* ===== Panel: ocupa el área de trabajo, cada columna con su scroll ===== */
.img-main { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.img-main[hidden] { display: none; }
.icon.s-fill { fill: currentColor; }

/* ===== Pantalla: compositor | galería ===== */
.img-page { flex: 1 1 auto; display: grid; grid-template-columns: 400px minmax(0, 1fr); height: 100%; min-height: 0; }
.img-page > * { min-height: 0; min-width: 0; }
.img-tabs { display: none; }

.img-compose { display: flex; flex-direction: column; min-height: 0; background: rgb(var(--c-sink)); border-right: 1px solid var(--line); }
.img-compose__scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 20px; }
.img-compose__foot { flex: none; padding: 14px 20px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; background: rgb(var(--c-sink)); }

.img-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.img-bar__model { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.img-bar__name { font: 600 1.125rem / 1 var(--font-serif); color: rgb(var(--c-text)); }
.img-safe .switch__label { color: rgb(var(--c-soft)); font-size: var(--fs-small); }

/* Estado del servicio (como .status-live de la web): punto + texto, nunca solo color */
.img-svc { display: inline-flex; align-items: center; gap: 7px; font: 600 0.75rem / 1 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: rgb(var(--c-muted)); white-space: nowrap; }
.img-svc::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.img-svc[data-state='loading']::before { display: none; }
.img-svc[data-state='ok'] { color: rgb(var(--c-live)); }
.img-svc[data-state='ok']::before { background: currentColor; border: 0; }
.img-svc[data-state='starting'] { color: rgb(var(--c-warn)); }
.img-svc[data-state='starting']::before { background: currentColor; border: 0; }
@media (prefers-reduced-motion: no-preference) {
  .img-svc[data-state='starting']::before { animation: v-pulse 1.1s ease-in-out infinite; }
}

/* Prompt + barra de «Mejorar prompt» pegada al campo */
.img-prompt { display: flex; flex-direction: column; }
.img-prompt textarea.field { min-height: 8em; max-height: 40vh; resize: vertical; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.img-prompt__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 4px;
  border: 1px solid var(--line-strong); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); background: rgb(var(--c-panel-2)); }
.img-prompt__bar .btn { color: rgb(var(--c-soft)); }
.img-prompt__bar .btn small { color: rgb(var(--c-muted)); font-weight: 500; }
.img-prompt__bar .btn:disabled { color: rgb(var(--c-muted)); }
.img-improve[aria-busy='true'] > .icon { display: none; }
.img-verify .notice__actions, .img-block .notice__actions { margin-top: 8px; }

.img-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.img-label-row .field-label { margin-bottom: 0; }

/* Filtros de grupo del estilo (botones de texto, radiogroup) */
.img-agroups { display: flex; gap: 2px; }
.img-agroups button { min-height: 32px; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: rgb(var(--c-muted)); font: 500 var(--fs-xs) / 1 var(--font-sans); cursor: pointer; }
.img-agroups button:hover { color: rgb(var(--c-text)); }
.img-agroups button[aria-checked='true'] { color: rgb(var(--c-text)); background: rgb(var(--c-panel-2)); box-shadow: inset 0 0 0 1px var(--line-2); }
.img-agroups button:focus-visible { outline-offset: -2px; box-shadow: none; }
@media (pointer: coarse) { .img-agroups button { min-height: 44px; } }

/* Combobox de estilo: miniatura dentro del campo (si es un destacado) + Quitar */
.img-style > .field { padding-left: 12px; }
.img-style.has-value > .field { padding-right: 88px; font-family: var(--font-mono); font-size: var(--fs-code); }
.img-style.has-thumb > .field { padding-left: 52px; }
.img-style__thumb { display: none; position: absolute; left: 6px; top: 6px; width: 32px; height: 32px; border-radius: 5px; object-fit: cover; pointer-events: none; }
.img-style.has-thumb .img-style__thumb { display: block; }
.img-style__clear { display: none; position: absolute; right: 30px; top: 6px; }
.img-style.has-value .img-style__clear { display: inline-flex; }
.img-style .img-style__clear.btn { min-height: 32px; padding: 4px 8px; }
@media (pointer: coarse) { .img-style .img-style__clear.btn { top: 0; min-height: var(--tap); } }
.img-style__list { position: fixed; right: auto; width: min(560px, calc(100vw - 40px)); max-height: min(470px, calc(100dvh - 260px));
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; align-content: start; z-index: var(--z-drawer); }
.img-style__list > .img-style__head { grid-column: 1 / -1; padding: 8px 8px 4px; font: 600 var(--fs-label) / 1.2 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--c-muted)); }
.img-style__list > .combo__opt, .img-style__list > .combo__empty { grid-column: 1 / -1; align-items: center; }
.img-style__list > .img-feat { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 8px; cursor: pointer; color: rgb(var(--c-soft)); font: 400 11.5px / 1.2 var(--font-mono); min-width: 0; }
.img-feat img { width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; border-radius: 6px; display: block; }
.img-feat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-feat:hover, .img-feat[data-active] { background: rgb(var(--c-line) / 0.08); color: rgb(var(--c-text)); }
.img-feat[data-active] img { outline: 2px solid rgb(var(--c-coral)); outline-offset: 1px; }
.combo__opt .img-tok { font-family: var(--font-mono); font-size: var(--fs-code); color: rgb(var(--c-text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.img-f-style .field-error { margin-top: 6px; }

/* Tamaño: select + orientación + ancho × alto */
.img-size-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.img-orients > label > span { min-width: 44px; padding-inline: 10px; }
.img-orients .icon { width: 18px; height: 18px; }
.img-dims { display: flex; align-items: center; gap: 6px; color: rgb(var(--c-muted)); font-size: var(--fs-xs); }
.img-dims .field { width: 72px; min-height: 40px; padding: 6px 8px; text-align: center; font-family: var(--font-mono); font-size: var(--fs-code); }
.img-compose .seg > label > input:disabled + span { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; text-decoration-thickness: 1px; }
.img-note { margin-top: 8px; color: rgb(var(--c-soft)); font-size: var(--fs-xs); line-height: 1.45; display: flex; gap: 8px; }
.img-note .icon { flex: none; margin-top: 1px; color: rgb(var(--c-muted)); width: 14px; height: 14px; }

/* Opciones avanzadas */
.img-adv { border-top: 1px solid var(--line); padding-top: 4px; }
.img-adv > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; color: rgb(var(--c-soft)); font-size: var(--fs-small); border-radius: var(--r-sm); }
.img-adv > summary::-webkit-details-marker { display: none; }
.img-adv > summary .icon { color: rgb(var(--c-muted)); transition: transform var(--dur) ease; }
.img-adv[open] > summary .icon { transform: rotate(180deg); }
.img-adv > summary small { color: rgb(var(--c-muted)); font-size: var(--fs-xs); font-family: var(--font-mono); }
.img-seed-label { margin-top: 8px; }
.img-seed-hint { margin-top: 0; }
.img-seedrow { display: flex; gap: 8px; margin-top: 8px; }
.img-seedrow .field { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-code); }

/* Pie: generar + cuota + datos */
.img-go-bar { display: flex; flex-direction: column; }
.img-go { justify-content: space-between; gap: 12px; }
.img-go__main { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.img-go__main > .spinner { display: none; }
.img-go[aria-busy='true'] .img-go__main > .spinner { display: inline-block; }
.img-go__cost { font-weight: 500; opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.img-quota .meter__row { font-size: var(--fs-xs); }
.img-quota .meter__label { color: rgb(var(--c-soft)); }
.img-quota__keys { color: rgb(var(--c-muted)); font-size: var(--fs-xs); white-space: nowrap; }
@media (pointer: coarse) { .img-quota__keys { display: none; } }
.img-privacy { color: rgb(var(--c-muted)); font-size: var(--fs-xs); line-height: 1.45; }
.img-privacy .link { display: inline-block; padding-block: 9px; margin-block: -9px; background: none; border: 0; padding-inline: 0; margin-left: 2px; font: inherit; color: rgb(var(--c-soft)); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.img-privacy .link:hover { color: rgb(var(--c-text)); }

/* ===== Galería: filas justificadas (sin recorte) ===== */
.img-gallery { overflow: auto; padding: 18px 28px 48px; }
.img-ghead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.img-ghead h2 { font: 600 1.25rem / 1.2 var(--font-serif); }
.img-grid { --rh: 215px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.img-grid::after { content: ''; flex: 999 1 0; }
.img-grid > * { flex: var(--ar) 1 calc(var(--ar) * var(--rh)); min-width: 0; max-width: calc(var(--ar) * var(--rh) * 2.2); }
.img-card { position: relative; aspect-ratio: var(--ar); container-type: inline-size; }
.img-tile { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: rgb(var(--c-panel)); cursor: zoom-in; color: inherit; font: inherit; text-align: left; }
.img-tile > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.img-tile:focus-visible { outline: 2px solid rgb(var(--c-coral)); outline-offset: 2px; box-shadow: none; }
.img-tile.is-queued, .img-tile.is-running, .img-tile.is-waiting { border-style: dashed; border-color: var(--line-2); background: rgb(var(--c-panel) / 0.5); cursor: pointer; }
/* Fallida = .frame--pending.frame--failed de los cimientos: mismo hueco que la imagen pedida, chip y nada más */
.img-tile.is-error { border-style: dashed; border-color: rgb(var(--c-warn) / 0.45); background: rgb(var(--c-panel) / 0.5); cursor: pointer; }
.img-live { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; padding: 12px; text-align: left; }
.img-live__text { color: rgb(var(--c-soft)); font-size: var(--fs-xs); line-height: 1.4; font-variant-numeric: tabular-nums; }
.img-live .progress { align-self: stretch; }
.img-live .chip, .img-batch__label .chip { max-width: 100%; white-space: normal; }
.img-err { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; }
/* Tarjeta estrecha (vertical en móvil): el puesto en cola sale del chip y el chip pierde el punto */
.img-pos-out { display: none; }
@container (max-width: 130px) {
  .img-live { padding: 6px; gap: 6px; }
  .img-live .chip, .img-err .chip { padding: 2px 6px; }
  .img-live .chip::before { display: none; }
  .img-pos-in { display: none; }
  .img-pos-out { display: inline; }
}

/* Tanda: un grupo que ocupa su sitio en la fila; en marcha lleva marco y una sola etiqueta */
.img-batch { position: relative; display: flex; gap: 6px; align-items: flex-start; border-radius: var(--r-md); }
.img-batch > .img-card { flex: var(--ar) 1 0; min-width: 0; }
.img-batch.is-live { outline: 1px solid rgb(var(--c-coral) / 0.5); outline-offset: 5px; }
.img-batch.is-live .img-tile { border-color: rgb(var(--c-coral) / 0.25); }
.img-batch__status { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; pointer-events: none; }
.img-batch__label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: rgb(var(--c-soft)); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.img-batch__tag { position: absolute; top: -14px; left: 10px; z-index: 1; padding: 0 6px; background: rgb(var(--c-bg)); color: rgb(var(--c-muted)); font: 600 var(--fs-label) / 20px var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; }
.img-batch.is-live .img-batch__tag { color: rgb(var(--c-coral)); }
.img-batch:not(.is-live) .img-batch__tag { display: none; }

/* Valoraciones: franja al pie, con hover/foco; la favorita marcada siempre */
.prefs-tile { position: absolute; left: 1px; right: 1px; bottom: 1px; display: flex; justify-content: flex-end; gap: 2px; padding: 20px 6px 6px;
  border-radius: 0 0 calc(var(--r-md) - 1px) calc(var(--r-md) - 1px); background: linear-gradient(transparent, rgb(var(--c-scrim) / 0.85)); opacity: 0; transition: opacity var(--dur) ease; pointer-events: none; }
.img-card:hover .prefs-tile, .img-card:focus-within .prefs-tile { opacity: 1; pointer-events: auto; }
.pref { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: none; color: rgb(var(--c-soft)); cursor: pointer; }
.pref .icon { width: 18px; height: 18px; }
.pref:hover { background: rgb(var(--c-line) / 0.12); color: rgb(var(--c-text)); }
.pref[aria-pressed='true'] { color: rgb(var(--c-coral)); }
.pref[aria-pressed='true'] .icon { fill: currentColor; }
.pref:focus-visible { outline-offset: -2px; box-shadow: none; }
.img-mark { position: absolute; right: 8px; bottom: 8px; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(var(--c-scrim) / 0.8); color: rgb(var(--c-coral)); pointer-events: none; }
.img-mark .icon { width: 14px; height: 14px; fill: currentColor; }
.img-card:hover .img-mark, .img-card:focus-within .img-mark { display: none; }
@media (hover: none) { .prefs-tile { display: none; } .img-card .img-mark { display: inline-grid; } }

.img-more { display: flex; justify-content: center; margin-top: 24px; }

/* Vacío + PROPUESTA destacados */
.img-empty { max-width: 44rem; }
.img-starters-box > p { margin-top: 20px; }
.img-starters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding: 12px; }
.img-starter { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: rgb(var(--c-soft)); font: 400 var(--fs-xs) / 1.2 var(--font-mono); text-align: left; cursor: pointer; min-width: 0; border-radius: var(--r-md); }
.img-starter img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); }
.img-starter:hover img { border-color: var(--line-hover); }
.img-starter:hover { color: rgb(var(--c-text)); }
.img-starter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Visor (<dialog> modal a pantalla completa) ===== */
.lightbox { position: fixed; inset: 0; z-index: var(--z-dialog); width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px;
  border: 0; background: transparent; color: rgb(var(--c-text)); overflow: hidden; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(var(--c-scrim) / 0.9); }
.lb-scrim { position: absolute; inset: 0; }
.lb-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 360px; width: min(1280px, 100%); height: min(860px, 100%);
  background: rgb(var(--c-panel)); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.8); }
.lb-media { position: relative; display: grid; place-items: center; min-height: 0; padding: 20px 64px; background: rgb(var(--c-sink)); }
.lb-media > img { position: absolute; top: 20px; left: 64px; width: calc(100% - 128px); height: calc(100% - 40px); object-fit: contain; }
.lb-state { width: auto; max-width: 100%; max-height: 100%; height: min(100%, 560px); aspect-ratio: var(--ar, 1); display: block; position: relative; }
.lb-err { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.lb-err__text { max-width: 28ch; color: rgb(var(--c-soft)); font-size: var(--fs-small); line-height: 1.45; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-nav--prev { left: 12px; } .lb-nav--next { right: 12px; }
.lb-nav .btn-icon { background: rgb(var(--c-panel-2)); border-color: var(--line-2); }
.lb-nav .btn-icon:disabled { opacity: 0.4; }
.lb-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.lb-side__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.lb-side__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.lb-prompt { max-height: 13.5em; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgb(var(--c-sink));
  color: rgb(var(--c-soft)); font: 400 var(--fs-small) / 1.55 var(--font-sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.lb-prompt:focus-visible { outline-offset: 2px; }
.lb-kv { grid-template-columns: 6.5em minmax(0, 1fr); align-items: center; }
.lb-kv > dt, .lb-kv > dd { min-height: 32px; display: flex; align-items: center; }
.lb-kv > dd { gap: 8px; justify-content: space-between; }
.lb-kv .mono { font-size: var(--fs-code); }
.lb-kv > dd.muted { color: rgb(var(--c-muted)); }
.prefs-viewer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* Una línea por botón (reparto por contenido); si no caben los tres, baja el botón entero */
.prefs-viewer .btn { flex: 1 1 auto; min-width: 0; padding-inline: 6px; font-size: var(--fs-xs); gap: 6px; white-space: nowrap; line-height: 1.15; text-align: center; }
.prefs-viewer .btn[aria-pressed='true'] .icon { fill: currentColor; color: rgb(var(--c-coral)); }
.lb-actions { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 14px 20px 16px; border-top: 1px solid var(--line); background: rgb(var(--c-panel)); }
.lb-actions__row { display: flex; gap: 8px; }
.lb-actions__row > .btn { flex: 1 1 0; }
.lb-actions .btn-danger.arm { background: rgb(var(--c-warn)); color: rgb(var(--c-on-coral)); border-color: transparent; }
.lb-help { color: rgb(var(--c-muted)); font-size: var(--fs-xs); line-height: 1.45; padding: 2px 4px; }

/* Diálogo de edad: el .dialog de los cimientos tal cual (centrado; hoja inferior < 560 px) */
.img-age .dialog__body .field-help { margin-top: 2px; }

/* ===== Móvil (< 900): pestañas Crear | Galería ===== */
@media (max-width: 899.98px) {
  .img-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .img-tabs { display: flex; padding-inline: 8px; background: rgb(var(--c-bg)); }
  .img-tabs [role='tab'] { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .img-tabs .chip { min-height: 20px; padding: 1px 7px; font-size: 11px; }
  [data-img-view='create'] > .img-gallery, [data-img-view='gallery'] > .img-compose { display: none; }
  /* Un solo scroll para todo el formulario: lo único fijo abajo es la barra de Generar.
     Cuota y nota de datos bajan al formulario (cuota tras Tamaño; datos al final), los avisos suben arriba. */
  .img-compose { border-right: 0; overflow: auto; overscroll-behavior: contain; gap: 20px; padding: 12px 16px 0; }
  .img-compose__scroll, .img-compose__foot { display: contents; }
  .img-compose .notice { order: -1; }
  .img-compose .img-quota { order: 1; }
  .img-compose .img-f-count, .img-compose .img-adv, .img-compose .img-privacy { order: 2; }
  .img-go-bar { order: 3; position: sticky; bottom: 0; z-index: 2; margin: auto -16px 0; padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgb(var(--c-sink)); border-top: 1px solid var(--line); }
  .img-go-bar .img-go { min-height: var(--tap); padding: 10px 18px; }
  .img-privacy { margin-top: -8px; }
  .img-gallery { padding: 14px 16px 32px; }
  .img-grid { --rh: 120px; gap: 8px; }
  .img-batch { gap: 4px; }
  .img-live, .img-err, .img-batch__status { padding: 8px; }
  .img-live .chip, .img-batch__label .chip, .img-err .chip { font-size: 11px; padding: 2px 7px; }
  .img-batch.is-live { outline-offset: 3px; }
  .img-style__list { left: 8px; right: 8px; width: auto; max-height: 60dvh; gap: 2px; }
  .img-style__list > .img-feat { padding: 3px; font-size: 11px; }
  .img-starters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 8px; }
  textarea.field.field-read { font-size: 16px; }
  .img-seedrow .field, .img-dims .field, .img-style > .field { font-size: 16px; }
  /* Visor a pantalla completa */
  .lightbox { padding: 0; }
  .lb-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100%; border-radius: 0; border: 0; }
  .lb-media { padding: 8px 8px 52px; height: 58dvh; }
  .lb-media > img { top: 8px; left: 8px; width: calc(100% - 16px); height: calc(100% - 60px); }
  .lb-state { height: 100%; }
  .lb-nav { top: auto; bottom: 4px; transform: none; }
  .lb-nav--prev { left: 4px; } .lb-nav--next { right: 4px; }
  .lb-side { border-left: 0; border-top: 1px solid var(--line); }
  .lb-side__head { position: absolute; top: 8px; right: 8px; left: auto; z-index: 2; padding: 0; border: 0; }
  .lb-side__head .chip { display: none; }
  .lb-side__head .btn-icon { background: rgb(var(--c-scrim) / 0.8); border-color: var(--line-2); }
  .lb-side__body { padding: 14px 16px; }
  .lb-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
}
/* Teclado abierto en el prompt (táctil): la barra de Generar se pliega, como la línea de estado del chat */
@media (max-width: 899.98px) and (pointer: coarse) {
  .img-compose:has(textarea:focus) .img-go-bar { display: none; }
}
@media (max-width: 479.98px) {
  .lb-kv { grid-template-columns: 6em minmax(0, 1fr); gap: 4px 12px; }
  .lb-kv > dd + dt { margin-top: 0; }
  .img-style__list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .img-live .progress > span, .img-batch__status .progress > span, .lb-state .progress > span { transition: none; }
}

/* «Desactivar» de la línea de datos: objetivo de 44 px con puntero grueso sin mover la línea */
@media (pointer: coarse) { .img-privacy .link { padding-block: 13px; margin-block: -13px; min-width: var(--tap); } }
/* Error de «Mejorar prompt», bajo el botón */
.img-improve-err { margin-top: 4px; }
