/* Estilos del panel de radar. Sin dependencias externas. */
:root {
  --fondo: #f6f5f1;
  --superficie: #ffffff;
  --superficie-2: #efede6;
  --texto: #1d1d1b;
  --texto-suave: #63625d;
  --borde: #dddbd3;
  --acento: #1f5f8b;
  --acento-suave: #e3eef6;
  --acento-texto: #ffffff;
  --aviso-fondo: #fdecea;
  --aviso-texto: #8a1c13;
  --ok-texto: #2c6b2f;
  --seleccion: #e8eef3;
  --sombra: 0 6px 24px rgba(0, 0, 0, 0.12);
  --e-entera-fondo: #fff1d6; --e-entera-texto: #7a4b00;
  --e-herramienta-fondo: #e2f3e4; --e-herramienta-texto: #23602a;
  --e-resumida-fondo: #e6eef7; --e-resumida-texto: #234f7a;
  --e-gris-fondo: #ecebe6; --e-gris-texto: #5d5c57;
  --e-seguridad-fondo: #fde3e1; --e-seguridad-texto: #8a1c13;
  --lectura-ancho: 42rem;
  --cabecera-alto: 3.25rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #171716;
    --superficie: #21211f;
    --superficie-2: #2a2a27;
    --texto: #ecebe6;
    --texto-suave: #a3a29b;
    --borde: #3a3936;
    --acento: #6cb0dc;
    --acento-suave: #1f3442;
    --acento-texto: #10100f;
    --aviso-fondo: #3b1a17;
    --aviso-texto: #f3b3ab;
    --ok-texto: #8fd193;
    --seleccion: #273139;
    --sombra: 0 6px 24px rgba(0, 0, 0, 0.5);
    --e-entera-fondo: #3d2e10; --e-entera-texto: #f3cf87;
    --e-herramienta-fondo: #1d3520; --e-herramienta-texto: #9edba4;
    --e-resumida-fondo: #1d2b3a; --e-resumida-texto: #a7c8ea;
    --e-gris-fondo: #2e2e2b; --e-gris-texto: #b3b2ab;
    --e-seguridad-fondo: #45201c; --e-seguridad-texto: #f6b9b1;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1 { font-size: 1.4rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
a { color: var(--acento); }
kbd {
  font: 0.8em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.05em 0.35em;
  border: 1px solid var(--borde);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--superficie);
}
.oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ controles */
button, .boton {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--acento);
  border-radius: 8px;
  background: var(--acento);
  color: var(--acento-texto);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
}
button:disabled { opacity: 0.55; cursor: progress; }
button.secundario, .boton.secundario { background: transparent; color: var(--acento); padding: 0.4rem 0.8rem; }
button.peligro { border-color: var(--aviso-texto); color: var(--aviso-texto); }
button.enlace {
  background: none; border: 0; padding: 0; color: var(--acento);
  text-decoration: underline; font-size: inherit; display: inline;
}
button.icono { background: transparent; color: var(--texto); border-color: var(--borde); padding: 0.3rem 0.6rem; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, .boton:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}
input[type="text"], input[type="url"], input[type="search"], input[type="password"], select, textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--fondo);
  color: var(--texto);
  min-width: 0;
}
textarea { width: 100%; resize: vertical; }
.interruptor { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; color: var(--texto-suave); cursor: pointer; white-space: nowrap; }
.ayuda { color: var(--texto-suave); font-size: 0.88rem; margin: 0.3rem 0; }
.cuenta { color: var(--texto-suave); font-size: 0.85em; font-weight: normal; font-variant-numeric: tabular-nums; }
.aviso {
  margin: 0 0 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--aviso-fondo);
  color: var(--aviso-texto);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------------ entrada */
.entrada {
  max-width: 22rem;
  margin: 12vh auto 0;
  padding: 2rem 1.5rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 12px;
}
.entrada h1 { margin-bottom: 1.25rem; }
.entrada form { display: grid; gap: 0.4rem; }
.entrada label { font-size: 0.9rem; color: var(--texto-suave); margin-top: 0.6rem; }
.entrada input { padding: 0.6rem 0.7rem; }
.entrada button { margin-top: 1.2rem; justify-content: center; }

/* ------------------------------------------------------------------ cabecera */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--cabecera-alto);
  padding: 0.45rem 1rem;
  padding-top: max(0.45rem, env(safe-area-inset-top));
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.marca { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--texto); text-decoration: none; }
.secciones { display: flex; gap: 0.2rem; }
.secciones a {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  color: var(--texto-suave);
  text-decoration: none;
  font-size: 0.95rem;
}
.secciones a[aria-current="page"] { background: var(--acento-suave); color: var(--acento); font-weight: 600; }
.buscar { margin-left: auto; flex: 0 1 18rem; display: flex; }
.buscar input { width: 100%; }
.cabecera .salir { margin: 0; }
.pagina-simple .cabecera .salir { margin-left: auto; }
.solo-movil { display: none; }

/* ------------------------------------------------------------------ lector: tres columnas */
.pagina-lector { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.lector {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 15.5rem minmax(19rem, 26rem) 1fr;
}
.lateral, .columna-lista, .columna-lectura { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.lateral {
  background: var(--superficie);
  border-right: 1px solid var(--borde);
  padding: 0.75rem 0.5rem 2rem;
  font-size: 0.93rem;
}
.lateral ul { list-style: none; margin: 0; padding: 0; }
.lateral-titulo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-suave);
  margin: 1.1rem 0.5rem 0.3rem;
}
.vista {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  color: var(--texto);
  text-decoration: none;
  min-width: 0;
  flex: 1;
}
.vista:hover { background: var(--superficie-2); }
.vista[aria-current="page"] { background: var(--acento-suave); color: var(--acento); font-weight: 600; }
.vista .nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vista .cuenta { flex: none; }
.fila-carpeta { display: flex; align-items: center; }
.plegar {
  background: none; border: 0; color: var(--texto-suave);
  padding: 0.2rem 0.15rem; width: 1.3rem; justify-content: center; font-size: 0.8rem;
}
.fuentes-lector { margin-left: 1.3rem !important; }
.carpetas-lector .vista .nombre { font-weight: 500; }
.fuentes-lector .vista .nombre { font-weight: normal; }
.marca-error {
  flex: none; display: inline-grid; place-items: center;
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--aviso-fondo); color: var(--aviso-texto); font-size: 0.7rem; font-weight: 700;
}
.marca-pausa, .marca-sin-triaje { flex: none; color: var(--texto-suave); font-size: 0.8rem; }

.columna-lista { border-right: 1px solid var(--borde); background: var(--fondo); display: flex; flex-direction: column; }
.barra-lista {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--fondo);
  border-bottom: 1px solid var(--borde);
}
.barra-lista h1 { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.controles-lista { display: flex; align-items: center; gap: 0.6rem; }
.aviso-nuevas {
  margin: 0.6rem auto 0; border-radius: 99px; font-size: 0.88rem; padding: 0.35rem 0.9rem;
  box-shadow: var(--sombra);
}
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-bottom: 1px solid var(--borde); }
.pieza {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.7rem 0.9rem;
  color: var(--texto); text-decoration: none;
}
.pieza:hover { background: var(--superficie-2); }
.lista li.actual .pieza { background: var(--seleccion); box-shadow: inset 3px 0 0 var(--acento); }
.texto-pieza { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.titulo-pieza { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.lista li.leida .titulo-pieza { font-weight: normal; color: var(--texto-suave); }
.lista li.descartada .pieza { opacity: 0.5; }
.lista li.descartada .titulo-pieza { text-decoration: line-through; }
.meta-pieza { display: flex; gap: 0.3rem; font-size: 0.82rem; color: var(--texto-suave); min-width: 0; }
.fuente-pieza { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.meta-pieza time { flex: none; }
.meta-pieza time::before { content: "· "; }
.miniatura {
  flex: none; width: 4.2rem; height: 4.2rem; object-fit: cover;
  border-radius: 6px; background: var(--superficie-2);
}
.etiquetas { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.etiquetas:empty { display: none; }
.etiqueta {
  font-size: 0.72rem; font-weight: 600; line-height: 1;
  padding: 0.22rem 0.45rem; border-radius: 99px;
  background: var(--e-gris-fondo); color: var(--e-gris-texto);
}
.etiqueta.entera { background: var(--e-entera-fondo); color: var(--e-entera-texto); }
.etiqueta.herramienta { background: var(--e-herramienta-fondo); color: var(--e-herramienta-texto); }
.etiqueta.resumida { background: var(--e-resumida-fondo); color: var(--e-resumida-texto); }
.etiqueta.seguridad, .etiqueta.critica, .etiqueta.error { background: var(--e-seguridad-fondo); color: var(--e-seguridad-texto); }
.etiqueta.critica { outline: 1px solid currentColor; }
.etiqueta.guardada, .etiqueta.luego { background: var(--acento-suave); color: var(--acento); }
.estado-lista { color: var(--texto-suave); text-align: center; padding: 1.5rem 1rem; margin: 0; }
.estado-lista:empty { display: none; }
.mas { margin: 1rem auto 2rem; }

/* ------------------------------------------------------------------ lectura */
.columna-lectura { background: var(--superficie); }
.columna-lectura:focus { outline: none; }
.vacio { max-width: 28rem; margin: 18vh auto 0; padding: 0 1.5rem; color: var(--texto-suave); text-align: center; }
.atajos-resumen { font-size: 0.85rem; line-height: 1.9; }
.lectura-interior { max-width: var(--lectura-ancho); margin: 0 auto; padding: 0 1.5rem 4rem; }
.barra-acciones {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0.65rem 0;
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.accion {
  font-size: 0.85rem; padding: 0.35rem 0.65rem;
  background: transparent; color: var(--texto); border: 1px solid var(--borde);
  border-radius: 7px; text-decoration: none;
}
.accion:hover { border-color: var(--acento); }
.accion[aria-pressed="true"] { background: var(--acento-suave); color: var(--acento); border-color: var(--acento); font-weight: 600; }
.boton-enlace { display: inline-flex; align-items: center; margin-left: auto; }
.accion.volver { display: none; }
.cabecera-lectura { padding: 1.3rem 0 0.6rem; }
.meta-lectura { margin: 0 0 0.4rem; color: var(--texto-suave); font-size: 0.88rem; }
.meta-lectura a { color: inherit; font-weight: 600; text-decoration: none; }
.titulo-lectura { font-size: 1.65rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.6rem; overflow-wrap: anywhere; }
.titulo-lectura a { color: var(--texto); text-decoration: none; }
.titulo-lectura a:hover { text-decoration: underline; }
.origen-texto { font-size: 0.82rem; color: var(--texto-suave); margin: 0.4rem 0 1rem; }
.origen-texto.error { color: var(--aviso-texto); }
.origen-texto.cargando::after { content: " ⏳"; }
.valoracion {
  margin: 0.6rem 0 1.2rem; padding: 0.9rem 1.1rem;
  border-radius: 10px; background: var(--acento-suave);
  border-left: 4px solid var(--acento);
}
.valoracion h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--acento); margin-bottom: 0.4rem; }
.valoracion h3 { font-size: 0.9rem; margin: 0.8rem 0 0.2rem; }
.valoracion p, .valoracion ul { margin: 0.3rem 0; }
.valoracion .titulo-es { font-weight: 600; }
.valoracion.entera { background: var(--e-entera-fondo); border-left-color: var(--e-entera-texto); }
.valoracion.entera h2 { color: var(--e-entera-texto); }
.valoracion.herramienta { background: var(--e-herramienta-fondo); border-left-color: var(--e-herramienta-texto); }
.valoracion.herramienta h2 { color: var(--e-herramienta-texto); }
.valoracion.descartada { background: var(--e-gris-fondo); border-left-color: var(--e-gris-texto); }
.valoracion.descartada h2 { color: var(--e-gris-texto); }
.valoracion .motivo { font-style: italic; }
.valoracion .corregida { font-size: 0.85rem; color: var(--texto-suave); }
.corregir { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid rgba(127, 127, 127, 0.25); }
.corregir .ayuda { margin: 0 0.3rem 0 0; }
.corregir .accion { font-size: 0.78rem; padding: 0.25rem 0.55rem; background: var(--superficie); }
.corregir .accion:disabled { opacity: 1; cursor: default; }
.nota-radar { font-size: 0.85rem; color: var(--texto-suave); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.valoracion pre { white-space: pre-wrap; }

.cuerpo-articulo {
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}
.cuerpo-articulo img { max-width: 100%; height: auto; border-radius: 6px; }
.cuerpo-articulo figure { margin: 1.4rem 0; }
.cuerpo-articulo figcaption { font: 0.85rem/1.4 system-ui, sans-serif; color: var(--texto-suave); margin-top: 0.35rem; }
.cuerpo-articulo pre {
  font: 0.86rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--superficie-2); padding: 0.8rem 1rem; border-radius: 8px; overflow-x: auto;
}
.cuerpo-articulo code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.cuerpo-articulo blockquote { margin: 1rem 0; padding: 0.1rem 1rem; border-left: 3px solid var(--borde); color: var(--texto-suave); }
.cuerpo-articulo table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.95rem; }
.cuerpo-articulo td, .cuerpo-articulo th { border: 1px solid var(--borde); padding: 0.3rem 0.5rem; }
.cuerpo-articulo h1, .cuerpo-articulo h2, .cuerpo-articulo h3 { font-family: system-ui, sans-serif; line-height: 1.25; margin: 1.6rem 0 0.6rem; }
.cuerpo-articulo h1 { font-size: 1.4rem; }
.cuerpo-articulo h2 { font-size: 1.25rem; }
.cuerpo-articulo h3 { font-size: 1.1rem; }
.sin-contenido { color: var(--texto-suave); font-style: italic; }
.nota { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--borde); }
.nota summary { cursor: pointer; color: var(--texto-suave); font-size: 0.92rem; }
.nota textarea { margin: 0.6rem 0; }

/* ------------------------------------------------------------------ avisos y diálogos */
.avisos {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; display: flex; flex-direction: column; gap: 0.5rem; align-items: center;
  width: min(30rem, calc(100vw - 2rem));
  pointer-events: none;
}
.aviso-flotante {
  pointer-events: auto;
  display: flex; gap: 0.9rem; align-items: center;
  padding: 0.6rem 1rem; border-radius: 10px;
  background: var(--texto); color: var(--fondo);
  box-shadow: var(--sombra); font-size: 0.92rem;
}
.aviso-flotante.error { background: var(--aviso-texto); color: #fff; }
.aviso-flotante .enlace { color: inherit; font-weight: 700; }
.dialogo {
  border: 1px solid var(--borde); border-radius: 12px;
  background: var(--superficie); color: var(--texto);
  padding: 1.3rem 1.5rem; max-width: 26rem; box-shadow: var(--sombra);
}
.dialogo::backdrop { background: rgba(0, 0, 0, 0.35); }
.atajos { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; font-size: 0.92rem; }
.atajos dd { margin: 0; }

/* ------------------------------------------------------------------ fuentes */
.contenido { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem; }
.contenido.ancho { max-width: 58rem; }
.contenido > h1 { margin-bottom: 1rem; }
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px;
  padding: 1.1rem 1.2rem; margin-bottom: 1.1rem;
}
.fila-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
.fila-form input[type="url"], .fila-form input[type="text"] { flex: 1 1 14rem; }
.candidato { border-top: 1px solid var(--borde); padding: 0.7rem 0 0.3rem; }
.url-candidato, .url-feed { font: 0.82rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--texto-suave); margin: 0.15rem 0; overflow-wrap: anywhere; }
.carpetas { list-style: none; padding: 0; margin: 0.4rem 0 0.8rem; }
.fila-carpeta-gestion { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.45rem 0; border-bottom: 1px solid var(--borde); }
.fila-carpeta-gestion input[type="text"] { flex: 1 1 12rem; }
.titulo-con-controles { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.grupo-feeds h3 { font-size: 0.95rem; margin: 1.1rem 0 0.3rem; }
.feeds { list-style: none; margin: 0; padding: 0; }
.feed { border-top: 1px solid var(--borde); padding: 0.75rem 0; }
.feed-cabeza { display: flex; gap: 0.6rem; align-items: center; }
.titulo-feed { flex: 1; font-weight: 600; }
.ver-feed { font-size: 0.85rem; white-space: nowrap; }
.feed-ajustes { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; margin: 0.4rem 0; }
.feed-ajustes label:not(.interruptor) { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.78rem; color: var(--texto-suave); }
.feed-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.estado-feed { font-size: 0.84rem; color: var(--texto-suave); overflow-wrap: anywhere; }
.estado-feed.ok { color: var(--ok-texto); }
.estado-feed.error { color: var(--aviso-texto); }
.acciones-feed { display: flex; gap: 0.4rem; }
.acciones-feed button { font-size: 0.82rem; padding: 0.3rem 0.6rem; }

/* ------------------------------------------------------------------ pantallas medianas: lista + lectura */
@media (max-width: 1100px) {
  .lector { grid-template-columns: minmax(17rem, 22rem) 1fr; }
  .solo-movil { display: inline-flex; }
  .lateral {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
    width: min(19rem, 85vw);
    transform: translateX(-105%); transition: transform 0.18s ease-out;
    box-shadow: var(--sombra);
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }
  .lateral.abierto { transform: none; }
  .velo { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.3); }
}

/* ------------------------------------------------------------------ móvil: una columna cada vez */
@media (max-width: 760px) {
  .pagina-lector { height: auto; overflow: visible; display: block; }
  .lector { display: block; }
  .columna-lista, .columna-lectura { overflow: visible; border: 0; }
  .lector[data-modo="lectura"] .columna-lista { display: none; }
  .lector[data-modo="lista"] .columna-lectura { display: none; }
  .barra-lista { top: var(--cabecera-alto); }
  .cabecera { gap: 0.5rem; padding-left: 0.6rem; padding-right: 0.6rem; }
  .secciones a { padding: 0.3rem 0.45rem; }
  .buscar { flex: 1 1 6rem; }
  #actualizar { display: none; }
  .cabecera .salir { display: none; }
  .barra-acciones {
    top: var(--cabecera-alto); margin: 0 -1rem; padding: 0.5rem 1rem;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .barra-acciones::-webkit-scrollbar { display: none; }
  .accion { flex: none; }
  .accion.volver { display: inline-flex; }
  .boton-enlace { margin-left: 0; }
  .lectura-interior { padding: 0 1rem 5rem; }
  .titulo-lectura { font-size: 1.4rem; }
  .cuerpo-articulo { font-size: 1.08rem; }
  .miniatura { width: 3.6rem; height: 3.6rem; }
  .pagina-simple .cabecera .salir { display: block; }
}
.fila-carpeta-gestion .ayuda { min-width: 4.5rem; text-align: right; }

/* ------------------------------------------------------------------ ajustes */
.instrucciones { display: grid; gap: 0.35rem; }
.instrucciones label { font-weight: 600; margin-top: 0.7rem; font-size: 0.95rem; }
.instrucciones label .ayuda { font-weight: normal; margin-left: 0.4rem; }
.instrucciones textarea { font: 0.92rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.historial { margin-top: 1.2rem; }
.historial > summary { cursor: pointer; color: var(--acento); }
.versiones { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.versiones > li { border-top: 1px solid var(--borde); padding: 0.5rem 0; }
.versiones summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.versiones h3 { font-size: 0.85rem; margin: 0.8rem 0 0.2rem; color: var(--texto-suave); }
.texto-version {
  white-space: pre-wrap; font: 0.85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--fondo); padding: 0.6rem 0.8rem; border-radius: 8px; margin: 0; max-height: 18rem; overflow-y: auto;
}
.ajustes fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.ajustes legend { font-weight: 600; margin-bottom: 0.3rem; }
.campo-ajuste { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--borde); }
.campo-ajuste label { font-size: 0.92rem; }
.control-ajuste { flex: none; white-space: nowrap; color: var(--texto-suave); }
.control-ajuste input { width: 5.5rem; text-align: right; }
.tokens { list-style: none; padding: 0; margin: 0.8rem 0 0; }
.token { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--borde); }
.token[data-revocado="si"] { opacity: 0.55; }
.token .ayuda { margin: 0.15rem 0 0; }
.token-creado p { margin: 0 0 0.4rem; }
.token-valor { flex: 1 1 20rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; }

/* ------------------------------------------------------------------ consumo */
.cifras {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem; margin: 1rem 0 1.2rem;
}
.cifras div { padding: 0.8rem 1rem; background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; }
.cifras dt { font-size: 0.82rem; color: var(--texto-suave); }
.cifras dd { margin: 0.15rem 0 0; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.cifras dd.ayuda { font-size: 0.78rem; }
.tabla-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabla th { text-align: left; font-weight: 600; color: var(--texto-suave); font-size: 0.8rem; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla .numero { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla tr.sin-datos td { color: var(--texto-suave); }
.lista-vigilados { max-height: 24rem; overflow-y: auto; margin-top: 0.5rem; }
.tabla .notas { font-size: 0.8rem; color: var(--texto-suave); min-width: 10rem; }
.barra { display: inline-block; width: 5rem; height: 0.5rem; margin-right: 0.5rem; background: var(--superficie-2); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.barra .relleno { display: block; height: 100%; background: var(--acento); }

/* ------------------------------------------------------------------ secciones dentro del menú lateral (móvil) */
.lateral-secciones { display: none; }
@media (max-width: 760px) {
  .pagina-lector .secciones { display: none; }
  .lateral-secciones {
    display: block; margin-top: 1.5rem; padding-top: 0.8rem; border-top: 1px solid var(--borde);
  }
  .lateral-secciones a { display: block; padding: 0.45rem 0.5rem; color: var(--texto); text-decoration: none; }
  .lateral-secciones form { margin: 0.6rem 0.5rem 0; }
  .secciones { overflow-x: auto; scrollbar-width: none; }
  .secciones::-webkit-scrollbar { display: none; }
  .campo-ajuste { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .token { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------------ resumen semanal */
.intro-semanal { font-size: 1.1rem; line-height: 1.6; padding: 1rem 1.2rem; background: var(--acento-suave); border-radius: 10px; }
.apartado { margin-top: 1.8rem; }
.apartado > h2 { font-size: 1.15rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--borde); }
.apartado.seguridad > h2 { color: var(--e-seguridad-texto); border-color: var(--e-seguridad-texto); }
.apartado.entera > h2 { color: var(--e-entera-texto); }
.apartado.herramienta > h2 { color: var(--e-herramienta-texto); }
.lista-semanal { list-style: none; margin: 0; padding: 0; }
.pieza-semanal { padding: 0.9rem 0; border-bottom: 1px solid var(--borde); }
.pieza-semanal.leida { opacity: 0.7; }
.pieza-semanal h3 { font-size: 1.05rem; margin: 0 0 0.2rem; line-height: 1.3; }
.pieza-semanal h3 a { color: var(--texto); text-decoration: none; }
.pieza-semanal h3 a:hover { text-decoration: underline; }
.pieza-semanal h4 { font-size: 0.85rem; margin: 0.6rem 0 0.15rem; }
.pieza-semanal ul { margin: 0.4rem 0; padding-left: 1.2rem; }
.pieza-semanal pre { white-space: pre-wrap; background: var(--superficie-2); padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.85rem; }
.pieza-semanal .etiquetas { margin: 0.3rem 0; }
.por-que { margin: 0.4rem 0; }
.descartadas { margin-top: 2rem; color: var(--texto-suave); }
.descartadas summary { cursor: pointer; }
