:root { color-scheme: dark; --fondo: #141414; --panel: #1f1f1f; --texto: #f2f2f2; --suave: #a3a3a3; --linea: #333; --error: #ff8a80; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 640px; padding: 16px; background: var(--fondo); color: var(--texto); font: 16px/1.45 system-ui, "Segoe UI", sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
button, input { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--linea); border-radius: 6px; padding: 10px 14px; min-height: 44px; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }
form { display: grid; gap: 10px; max-width: 360px; margin: 48px auto; }
.ayuda, #aviso, #aviso-entrada { color: var(--suave); font-size: 14px; margin: 0 0 12px; }
#aviso.mal { color: var(--error); }
.rejilla { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-bottom: 3px; }
.celda { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 0; min-height: 0; overflow: hidden; background: var(--panel); width: 100%; }
.celda img { width: 100%; height: 100%; object-fit: cover; display: block; }
.celda.mover { cursor: grab; }
.celda.fantasma { opacity: .35; }
.etiqueta { position: absolute; inset: auto 0 0; padding: 4px 6px; background: rgb(0 0 0 / .72); color: #fff; font-size: 12px; line-height: 1.3; text-align: left; }
.etiqueta:empty { display: none; }
.etiqueta b { display: block; font-weight: 600; }
.etiqueta.error { background: #7f1d1d; }
dialog { width: min(100% - 32px, 480px); max-height: 90vh; background: var(--panel); color: var(--texto); border: 1px solid var(--linea); border-radius: 8px; padding: 16px; }
dialog::backdrop { background: rgb(0 0 0 / .7); }
#cerrar { float: right; min-width: 44px; }
#detalle-fotos { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 12px; clear: both; }
#detalle-fotos img { height: 220px; aspect-ratio: 4 / 5; object-fit: cover; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: var(--suave); }
#detalle-mover { display: flex; gap: 8px; flex-wrap: wrap; }
a { color: var(--texto); }
