/* Panel: misma paleta que la web (carbón #404041), tipografía del sistema, pensado primero
   para el móvil. Sin dependencias. */
:root {
  --carbon: #404041;
  --carbon-hondo: #2f2f30;
  --tinta: #2b2b2c;
  --gris: #626263;
  --linea: #dcdbdb;
  --niebla: #f4f4f3;
  --papel: #fff;
  --ok: #1d6b3a;
  --ok-fondo: #e8f4ec;
  --error: #a3211b;
  --error-fondo: #fbeceb;
  --info-fondo: #eef1f6;
  --borrador: #8a5a00;
  --borrador-fondo: #fdf3dc;
  --radio: 4px;
  --f: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 1rem/1.5 var(--f); color: var(--tinta); background: var(--niebla); }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
a { color: var(--carbon); }
:focus-visible { outline: 3px solid #4a7bd0; outline-offset: 2px; }
[hidden] { display: none !important; }

.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; background: var(--carbon); color: #fff; }
.cabecera .marca { color: #fff; text-decoration: none; font-weight: 600; }
.enlace-boton { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: .5rem; min-height: 44px; }
.contenedor { max-width: 76rem; margin: 0 auto; padding: 1rem; }
.titular { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: .5rem 0 1rem; }
.titular h1 { margin-right: auto; }
.discreto { color: var(--gris); font-size: .9rem; margin: .25rem 0 .75rem; }

/* Botones y campos: 44 px de alto como mínimo, que es lo que pide un dedo. */
.boton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem 1rem; border: 1px solid var(--carbon); border-radius: var(--radio); background: var(--papel); color: var(--carbon); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.boton:hover { background: var(--niebla); }
.boton--principal { background: var(--carbon); color: #fff; }
.boton--principal:hover { background: var(--carbon-hondo); }
.boton--peligro { border-color: var(--error); color: var(--error); }
.boton:disabled { opacity: .55; cursor: progress; }
.boton--archivo { position: relative; overflow: hidden; }
.boton--archivo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
input, select, textarea { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid #b9b8b8; border-radius: var(--radio); background: var(--papel); color: var(--tinta); font: inherit; }
textarea { resize: vertical; }
label, .etiqueta-campo, legend { display: block; font-weight: 600; margin: 0 0 .35rem; }
.ayuda { color: var(--gris); font-size: .875rem; margin: .35rem 0 0; }
.ayuda--error { color: var(--error); }
.campo { margin: 0 0 1.25rem; }
fieldset { border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem; background: var(--papel); }
fieldset label:not(:first-of-type) { margin-top: 1rem; }
.fila { display: flex; gap: .5rem; align-items: stretch; margin-top: .5rem; }
.fila > .boton { flex: none; }
.fila--fin { justify-content: flex-end; }
.casilla { display: flex; align-items: center; gap: .5rem; font-weight: 400; min-height: 40px; margin: 0; cursor: pointer; }
.casilla input { width: 1.25rem; min-height: 1.25rem; height: 1.25rem; flex: none; }

/* Avisos */
.aviso { border-radius: var(--radio); padding: .75rem 1rem; margin: 1rem 0; border-left: 4px solid; }
.aviso p { margin: 0; }
.aviso__texto { white-space: pre-line; overflow-wrap: anywhere; }
.aviso:has(.aviso__cerrar) { padding-right: 2.75rem; }
.aviso:not(.aviso-fijo):has(.aviso__cerrar) { position: relative; }
.aviso__cerrar { position: absolute; top: .25rem; right: .25rem; min-width: 40px; min-height: 40px; border: 0; background: none; color: inherit; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: var(--radio); }
.aviso__cerrar:hover { background: rgba(0,0,0,.08); }
/* En la lista, el aviso flota abajo: la página es larga y el aviso, si no, quedaría fuera de la vista. */
.aviso-fijo { position: fixed; z-index: 10; left: 1rem; right: 1rem; bottom: 1rem; max-width: 40rem; margin: 0 auto; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.aviso-fijo.aviso--ok { background: var(--ok-fondo); }
.aviso-fijo.aviso--info { background: var(--info-fondo); }
.aviso-fijo.aviso--error { background: var(--error-fondo); }
.aviso--ok { background: var(--ok-fondo); border-color: var(--ok); color: var(--ok); }
.aviso--error { background: var(--error-fondo); border-color: var(--error); color: var(--error); }
.aviso--info { background: var(--info-fondo); border-color: var(--carbon); }
.aviso pre { white-space: pre-wrap; font-size: .8rem; color: var(--tinta); max-height: 16rem; overflow: auto; }
.aviso summary { cursor: pointer; margin-top: .5rem; }

/* Entrar */
.entrar { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.tarjeta-entrar { width: 100%; max-width: 24rem; background: var(--papel); padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tarjeta-entrar .marca { color: var(--gris); margin: 0 0 .5rem; font-size: .9rem; }
.tarjeta-entrar h1 { margin-bottom: 1.25rem; }
.tarjeta-entrar input { margin-bottom: 1rem; }
.tarjeta-entrar #codigo { margin-bottom: .35rem; }
.tarjeta-entrar .ayuda { margin: 0 0 1rem; }
.tarjeta-entrar .boton { width: 100%; }

/* Lista */
.filtros { display: flex; gap: .5rem; }
.filtros input { flex: 1; }
.filtros select { width: auto; flex: none; }
.entradas { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.entradas li + li { border-top: 1px solid var(--linea); }
.entradas a { display: flex; flex-direction: column; gap: .25rem; padding: .85rem 1rem; text-decoration: none; color: var(--tinta); }
.entradas a:hover { background: var(--niebla); }
.entrada__titulo { font-weight: 600; overflow-wrap: anywhere; }
.entrada__meta { display: flex; gap: .75rem; align-items: center; color: var(--gris); font-size: .875rem; }
.vacia { padding: 1rem; color: var(--gris); }
.estado { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .15rem .5rem; border-radius: 99px; }
.estado--publicada { background: var(--ok-fondo); color: var(--ok); }
.estado--borrador { background: var(--borrador-fondo); color: var(--borrador); }
.estado--programada { background: var(--info-fondo); color: var(--carbon); }
.estado--fallo { background: var(--error-fondo); color: var(--error); }
.entrada__fallo { color: var(--error); font-size: .8125rem; }
.web { margin-bottom: 9rem; margin-top: 2rem; padding: 1rem; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.acciones-web { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 48rem) {
  .entradas a { flex-direction: row; justify-content: space-between; align-items: center; gap: 1rem; }
  .entrada__meta { flex: none; }
}

/* Editor */
.titulo-grande { font-size: 1.2rem; font-weight: 600; line-height: 1.35; resize: none; field-sizing: content; min-height: 3.2em; }
.con-prefijo { display: flex; align-items: stretch; border: 1px solid #b9b8b8; border-radius: var(--radio); background: var(--papel); overflow: hidden; }
.con-prefijo span { display: flex; align-items: center; padding: 0 .1rem 0 .7rem; color: var(--gris); white-space: nowrap; font-size: .9rem; }
.con-prefijo input { border: 0; min-width: 0; padding-left: .1rem; }
.con-prefijo input[readonly] { background: var(--niebla); color: var(--gris); }
@media (max-width: 30rem) { .con-prefijo span { display: none; } .con-prefijo input { padding-left: .7rem; } }
.enlace-externo { font-weight: 600; }

.barra-herramientas { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: .15rem; padding: .35rem; background: var(--papel); border: 1px solid #b9b8b8; border-bottom: 0; border-radius: var(--radio) var(--radio) 0 0; }
.barra-herramientas select { width: auto; min-height: 40px; padding: .3rem .5rem; }
.barra-herramientas button { min-width: 36px; min-height: 40px; padding: .3rem .35rem; border: 1px solid transparent; border-radius: var(--radio); background: none; font: inherit; font-size: .9rem; color: var(--tinta); cursor: pointer; }
.barra-herramientas button:hover { background: var(--niebla); border-color: var(--linea); }
.barra-herramientas button[aria-pressed="true"] { background: var(--carbon); color: #fff; }
.prosa-editor { min-height: 22rem; padding: 1rem; background: var(--papel); border: 1px solid #b9b8b8; border-radius: 0 0 var(--radio) var(--radio); font-size: 1.0625rem; line-height: 1.7; overflow-wrap: break-word; }
.prosa-editor:focus { outline: 2px solid #4a7bd0; outline-offset: -1px; }
.prosa-editor > :first-child { margin-top: 0; }
.prosa-editor h2, .prosa-editor h3, .prosa-editor h4 { line-height: 1.3; margin: 1.5em 0 .5em; }
.prosa-editor h2 { font-size: 1.4rem; }
.prosa-editor h3 { font-size: 1.2rem; }
.prosa-editor h4 { font-size: 1.05rem; }
.prosa-editor blockquote { margin: 1em 0; padding: .25em 1em; border-left: 4px solid var(--carbon); color: #444; background: var(--niebla); }
.prosa-editor img { max-width: 100%; height: auto; }
.prosa-editor a { color: #1d4f9c; }
.prosa-editor iframe { display: none; }

.destacada { margin: 0 0 .5rem; }
.destacada img { display: block; width: 100%; height: auto; border-radius: var(--radio); background: var(--linea); }
.casillas { max-height: 16rem; overflow: auto; margin-top: .5rem; padding: .25rem .75rem; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.sugerencias { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.sugerencia { min-height: 36px; padding: .25rem .6rem; border: 1px solid var(--linea); border-radius: 99px; background: var(--papel); font: inherit; font-size: .875rem; cursor: pointer; }
.cuenta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cuenta--larga { color: var(--error); font-weight: 700; }

/* Barra de acciones fija abajo: en el móvil, publicar está siempre a mano. */
.barra-acciones { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin: 0 -1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--linea); }
.barra-acciones #borrar { margin-right: auto; }
/* Los avisos van dentro de la barra: siempre a la vista, encima de los botones. */
.barra-acciones { max-height: 70vh; overflow-y: auto; background: rgba(255,255,255,.98); box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
.barra-acciones .aviso { order: -1; flex: 1 0 100%; margin: 0 0 .25rem; box-shadow: none; }
.barra-acciones .aviso pre { max-height: 25vh; }
.nota-inventario { margin: 0 0 1rem; }
@media (max-width: 30rem) {
  .barra-acciones .boton { flex: 1 1 auto; }
  .barra-acciones #borrar { flex: 0 0 auto; }
}
/* En el móvil, una sola columna en el orden de escribir: lo de la columna lateral (fecha,
   imagen, categorías, etiquetas) va tras el texto, y extracto y SEO al final. */
@media (max-width: 63.99rem) {
  .columnas { display: flex; flex-direction: column; }
  .principal, .lateral { display: contents; }
  .al-final { order: 2; }
}
@media (min-width: 64rem) {
  .columnas { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: start; }
  .lateral { position: sticky; top: 1rem; }
}

.dialogo { width: min(30rem, calc(100vw - 2rem)); border: 0; border-radius: 8px; padding: 1.25rem; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.dialogo::backdrop { background: rgba(0,0,0,.4); }
.dialogo input { margin-bottom: .5rem; }
