/* =====================================================================
   Datos dosimétricos de fuentes de braquiterapia — hoja de estilos
   Sin dependencias externas: funciona abriendo los .html en local.
   ===================================================================== */

/* ---------- 1. Variables ----------
   Fondo de página blanco y cuadros de texto en azul oscuro con texto
   claro. El aspecto es el mismo con el sistema en modo claro u oscuro. */
:root {
  /* Página (fondo blanco) */
  --fondo: #ffffff;
  --superficie: #ffffff;
  --superficie-2: #f3f5f9;
  --texto: #18212f;
  --texto-suave: #586577;
  --borde: #dbe2ec;
  --cabecera: #0f2240;
  --cabecera-2: #18375f;
  --acento: #0b7285;
  --c-puntuales: #6741d9;
  --c-ir: #0b7d8f;
  --c-co: #1f5fd1;
  --sombra: 0 1px 2px rgba(15, 34, 64, .10), 0 8px 22px rgba(15, 34, 64, .12);
  --sombra-fuerte: 0 2px 6px rgba(15, 34, 64, .12), 0 18px 40px rgba(15, 34, 64, .22);
  --radio: 14px;
  --ancho-max: 1320px;
  --ancho-panel: 300px;
  --alto-cabecera: 64px;
  --alto-boton-cabecera: 2.75rem; /* menú, idioma (con las banderas) y contacto */
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

/* Cuadros de texto: fondo azul oscuro y texto claro */
.bloque, .tarjeta, .cabecera-seccion, .panel, .tarjeta-fuente,
.boton-grande, .aviso, .aviso-uso, .contacto-panel, .publicacion {
  --superficie: #141c2a;
  --superficie-2: #1a2435;
  --texto: #e5eaf1;
  --texto-suave: #9ba8ba;
  --borde: #2a374c;
  --acento: #3bc9db;
  --c-puntuales: #a58cff;
  --c-ir: #3bc9db;
  --c-co: #7eaaff;
  color-scheme: dark;
  color: var(--texto);
}

/* Color de cada sección */
.b-puntuales { --color: var(--c-puntuales); }
.b-ir        { --color: var(--c-ir); }
.b-co        { --color: var(--c-co); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}

a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--acento) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

img, svg { max-width: 100%; }

sup, sub { line-height: 0; }

.saltar {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--superficie);
  color: var(--texto);
  padding: .6rem 1rem;
  border-radius: 0 0 10px 0;
}
.saltar:focus { left: 0; }

/* ---------- 3. Cabecera ---------- */
.cabecera {
  --acento: #3bc9db; /* contraste del foco sobre el azul de la cabecera */
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--cabecera);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 4px 18px rgba(0, 0, 0, .12);
}

.cabecera-interior {
  max-width: var(--ancho-max);
  min-height: var(--alto-cabecera);
  margin: 0 auto;
  padding: .55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
}
.marca:hover { text-decoration: none; }
.marca svg { width: 38px; height: 38px; flex: none; }

.marca-texto {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: .005em;
}
.marca-texto small {
  font-weight: 400;
  font-size: .8rem;
  opacity: .72;
}

.boton-menu {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: .45rem;
  height: var(--alto-boton-cabecera);
  padding: 0 .8rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.boton-menu:hover { background: rgba(255, 255, 255, .12); }
.boton-menu svg { width: 18px; height: 18px; }

/* Nombre de la base de datos (solo en la portada), junto a «Contacto» */
.cabecera-base {
  margin: 0 0 0 auto;
  font-size: .9rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, .8);
  white-space: nowrap;
}
.cabecera-base strong { color: #fff; font-weight: 700; }
.cabecera-base + .idiomas, .idiomas + .contacto { margin-left: 0; }

/* Idioma: «ES | EN» junto a «Contacto», con la bandera encima de cada código;
   el idioma de la página va marcado y el otro enlaza con la misma página en
   ese idioma */
.idiomas {
  display: inline-flex;
  flex: none;
  height: var(--alto-boton-cabecera);
  margin-left: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .06em;
  line-height: 1.1;
}
.idiomas a, .idioma-actual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 .62rem;
  color: #fff;
}
.idiomas a { color: rgba(255, 255, 255, .72); }
.idiomas a:hover { color: #fff; background: rgba(255, 255, 255, .12); text-decoration: none; }
.idioma-actual { background: rgba(255, 255, 255, .18); }
.bandera {
  display: block;
  width: 21px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3);
}
.idiomas a .bandera { opacity: .75; }
.idiomas a:hover .bandera { opacity: 1; }

/* Contacto: <details> en la cabecera; el cuadro se despliega debajo */
.contacto { position: relative; margin-left: auto; flex: none; }
.contacto-boton {
  display: block;
  list-style: none;
  height: var(--alto-boton-cabecera);
  padding: 0 .7rem 0 .9rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .08em;
  line-height: calc(var(--alto-boton-cabecera) - 2px); /* texto centrado en la altura del botón */
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.contacto-boton::-webkit-details-marker { display: none; }
.contacto-boton::marker { content: ""; }
.contacto-boton:hover, .contacto[open] > .contacto-boton { background: rgba(255, 255, 255, .14); }
.contacto-flecha {
  width: 14px;
  height: 14px;
  margin-left: .3rem;
  vertical-align: -2px;
  transition: transform .2s ease;
}
.contacto[open] .contacto-flecha { transform: rotate(180deg); }

.contacto-panel {
  position: absolute;
  top: calc(100% + .65rem);
  right: 0;
  width: 25rem;
  max-width: calc(100vw - 2rem);
  padding: 1.1rem 1.25rem 1.15rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-fuerte);
  font-size: .95rem;
  line-height: 1.5;
}
.contacto-panel p { margin: 0 0 .85rem; }
.contacto-lista { list-style: none; margin: 0; padding: 0; }
.contacto-lista li { padding: .6rem 0; border-top: 1px solid var(--borde); }
.contacto-lista li:last-child { padding-bottom: 0; }
.contacto-nombre { display: block; font-weight: 650; }
.contacto-lista a { font-size: .9rem; overflow-wrap: anywhere; }

/* ---------- 4. Portada ---------- */
.portada { flex: 1; }

.heroe {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 1.25rem 8rem;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(ellipse 60% 70% at 85% 10%, rgba(59, 201, 219, .22), transparent 60%),
    radial-gradient(ellipse 50% 60% at 8% 95%, rgba(124, 92, 255, .25), transparent 60%),
    linear-gradient(165deg, var(--cabecera) 0%, var(--cabecera-2) 100%);
}

.heroe-decoracion {
  position: absolute;
  right: -120px;
  top: 50%;
  width: 640px;
  height: 640px;
  transform: translateY(-50%);
  opacity: .5;
  pointer-events: none;
}

.heroe-interior { position: relative; max-width: 860px; margin: 0 auto; }

.antetitulo {
  display: inline-block;
  margin: 0 0 1rem;
  padding: .3rem .85rem;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}

.heroe h1 {
  margin: 0 0 .9rem;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -.01em;
}

.heroe p.subtitulo {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.12rem;
  color: rgba(255, 255, 255, .82);
}

.botones-grandes {
  position: relative;
  max-width: 1200px;
  margin: -5rem auto 3.5rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.boton-grande {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 280px;
  padding: 2rem 1.75rem 1.6rem;
  overflow: hidden;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 20px;
  box-shadow: var(--sombra-fuerte);
  color: var(--texto);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.boton-grande::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--color);
}
.boton-grande::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--color) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.boton-grande:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--color) 55%, var(--borde));
  text-decoration: none;
}

.boton-grande .etiqueta {
  font-size: 1.45rem;
  font-weight: 720;
  line-height: 1.22;
}
.boton-grande .descripcion {
  margin: 0;
  color: var(--texto-suave);
  font-size: .98rem;
}
.boton-grande .flecha {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 650;
  color: var(--color);
}
.boton-grande .flecha svg { width: 18px; height: 18px; transition: transform .18s ease; }
.boton-grande:hover .flecha svg { transform: translateX(4px); }

.estado {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  padding: .22rem .65rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 650;
  background: color-mix(in srgb, var(--color) 13%, transparent);
  color: var(--color);
}

/* Ficha tipo tabla periódica */
.ficha {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 16px;
  border: 1.5px solid color-mix(in srgb, var(--color) 45%, transparent);
  background: color-mix(in srgb, var(--color) 10%, var(--superficie));
  color: var(--color);
  font-weight: 750;
}
.ficha .simbolo { font-size: 2.1rem; line-height: 1; }
.ficha .simbolo.griega { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 600; font-size: 2.5rem; }
.ficha .masa { position: absolute; top: 8px; left: 10px; font-size: .8rem; font-weight: 700; }
.ficha .z { position: absolute; bottom: 7px; left: 10px; font-size: .72rem; font-weight: 600; opacity: .8; }

.datos-rapidos {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.datos-rapidos li {
  padding: .2rem .6rem;
  border-radius: 8px;
  background: var(--superficie-2);
  border: 1px solid var(--borde);
  font-size: .82rem;
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
}

/* ---------- 5. Estructura de las subpáginas ---------- */
.contenedor {
  flex: 1;
  width: 100%;
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: var(--ancho-panel) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* El contenido va antes en el HTML (accesibilidad) pero el panel se
   muestra a la izquierda */
.contenido { min-width: 0; grid-column: 2; grid-row: 1; }
.contenedor > .panel { grid-column: 1; grid-row: 1; }

.migas {
  margin: 0 0 1rem;
  font-size: .88rem;
  color: var(--texto-suave);
}
.migas a { color: var(--texto-suave); }
.migas a:hover { color: var(--acento); }
.migas .sep { margin: 0 .45rem; opacity: .55; }

.cabecera-seccion {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 1.75rem;
  padding: 1.5rem 1.6rem;
  overflow: hidden;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.cabecera-seccion::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--color);
}
.cabecera-seccion h1 {
  margin: 0 0 .3rem;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  line-height: 1.18;
}
.cabecera-seccion .entradilla { margin: 0; color: var(--texto-suave); font-size: 1.04rem; }

.contenido h2 {
  margin: 2.2rem 0 .9rem;
  font-size: 1.32rem;
  line-height: 1.3;
  scroll-margin-top: calc(var(--alto-cabecera) + 1rem);
}
.contenido h3 {
  margin: 1.6rem 0 .6rem;
  font-size: 1.08rem;
  scroll-margin-top: calc(var(--alto-cabecera) + 1rem);
}
.contenido p, .contenido li { max-width: 80ch; }

.tarjeta {
  margin: 0 0 1.5rem;
  padding: 1.4rem 1.5rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.tarjeta > :first-child { margin-top: 0; }
.tarjeta > :last-child { margin-bottom: 0; }

.aviso {
  padding: 2.25rem 1.5rem;
  text-align: center;
  color: var(--texto-suave);
  background: var(--superficie);
  border: 1.5px dashed var(--borde);
  border-radius: var(--radio);
}
.aviso strong { display: block; color: var(--texto); font-size: 1.05rem; margin-bottom: .3rem; }
.aviso p { margin: 0 auto; }

/* Listado de fuentes de una sección */
.rejilla-fuentes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}
.rejilla-fuentes.vacio { display: block; }

.tarjeta-fuente {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1.05rem 1.2rem 1.15rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-top: 4px solid var(--color);
  border-radius: 12px;
  box-shadow: var(--sombra);
  color: var(--texto);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tarjeta-fuente:hover { transform: translateY(-3px); box-shadow: var(--sombra-fuerte); text-decoration: none; }
.tarjeta-fuente .fabricante {
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--texto-suave);
}
.tarjeta-fuente .modelo { font-size: 1.06rem; font-weight: 680; }
.tarjeta-fuente .nota { font-size: .86rem; color: var(--texto-suave); }

/* Figuras */
figure { margin: 1.25rem 0; }
figure img {
  display: block;
  height: auto;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
}
figcaption { margin-top: .5rem; font-size: .88rem; color: var(--texto-suave); }

/* ---------- 6. Tablas de datos ---------- */
.tabla-titulo { margin: 1.25rem 0 .35rem; font-weight: 650; }

.tabla-herramientas {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin: .4rem 0 .45rem;
}

.boton-mini {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.boton-mini:hover { border-color: var(--acento); color: var(--acento); }

.tabla-envoltorio {
  max-height: 72vh;
  overflow: auto;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 12px;
  box-shadow: var(--sombra);
}

table.datos {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
table.datos th,
table.datos td {
  padding: .42rem .75rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--borde);
}
table.datos thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--superficie-2);
  font-weight: 650;
  color: var(--texto);
}
table.datos tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--superficie);
  font-weight: 620;
}
table.datos thead th:first-child { left: 0; z-index: 3; }
table.datos tbody tr:nth-child(even) td,
table.datos tbody tr:nth-child(even) th { background: var(--superficie-2); }
table.datos tbody tr:hover td,
table.datos tbody tr:hover th { background: color-mix(in srgb, var(--acento) 9%, var(--superficie)); }
table.datos tbody tr:last-child td,
table.datos tbody tr:last-child th { border-bottom: 0; }
table.datos tfoot th,
table.datos tfoot td {
  border-top: 2px solid var(--borde);
  border-bottom: 0;
  background: var(--superficie-2);
  font-weight: 650;
}
table.datos tfoot th { position: sticky; left: 0; z-index: 1; }
table.datos td.vacio { color: var(--texto-suave); }

/* Tablas estrechas: el bloque se ajusta al ancho de la tabla */
.tabla-bloque { margin: .25rem 0 1rem; }
.tabla-bloque.ajustada { width: fit-content; max-width: 100%; }
.tabla-bloque.ajustada .tabla-envoltorio { max-height: none; }
.tabla-bloque.ajustada table.datos th,
.tabla-bloque.ajustada table.datos td { padding-left: 1.1rem; padding-right: 1.1rem; }

/* ---------- 6b. Fichas de fuente ---------- */
.bloque {
  margin: 0 0 1.5rem;
  padding: 1.4rem 1.6rem 1.5rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.bloque > h2:first-child { margin-top: 0; }
.bloque > :last-child { margin-bottom: 0; }
.bloque h3 { color: var(--texto); }

.cabecera-seccion .datos-rapidos { margin-top: .7rem; }

.valores { display: flex; flex-wrap: wrap; gap: .9rem; margin: .25rem 0 1rem; }
.valor {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .25rem .6rem;
  padding: .85rem 1.2rem;
  border: 1px solid var(--borde);
  border-left: 4px solid var(--color, var(--acento));
  border-radius: 12px;
  background: var(--superficie-2);
  font-variant-numeric: tabular-nums;
}
.valor-simbolo { font-weight: 700; font-size: 1.15rem; font-style: italic; }
.valor-etiqueta {
  align-self: center;
  padding: .05rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--borde);
  font-size: .82rem;
  font-weight: 600;
  color: var(--texto-suave);
}
.valor-igual { font-weight: 600; font-size: 1.2rem; }
.valor-numero { font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.valor-unidad { color: var(--texto-suave); font-size: 1rem; }

.descargas {
  list-style: none;
  margin: .35rem 0 1rem;
  padding: 0;
  display: grid;
  gap: .55rem;
  max-width: 760px;
}
.descargas a {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .65rem .9rem;
  border: 1px solid var(--borde);
  border-radius: 11px;
  background: var(--superficie);
  color: var(--texto);
  transition: border-color .15s ease, background .15s ease;
}
.descargas a:hover { border-color: var(--color, var(--acento)); background: var(--superficie-2); text-decoration: none; }
.descargas .formato {
  flex: none;
  min-width: 2.9rem;
  padding: .2rem .45rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color, var(--acento)) 13%, transparent);
  color: var(--color, var(--acento));
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-align: center;
}
.descargas .descarga-texto { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.descargas .descarga-titulo { font-weight: 600; font-size: .95rem; }
.descargas .descarga-archivo {
  font-family: var(--fuente-mono);
  font-size: .78rem;
  color: var(--texto-suave);
  overflow-wrap: anywhere;
}
.descargas svg { flex: none; width: 18px; height: 18px; color: var(--texto-suave); }
.descargas a:hover svg { color: var(--color, var(--acento)); }

.figura { margin: .5rem 0 1.25rem; }
.figura img { width: 100%; max-width: 640px; }
.figura figcaption { max-width: 640px; }
.figura.falta img { display: none; }
.figura.falta::before {
  content: "Imagen pendiente · " attr(data-archivo);
}
:lang(en) .figura.falta::before { content: "Image pending · " attr(data-archivo); }
.figura.falta::before {
  display: grid;
  place-items: center;
  max-width: 640px;
  min-height: 170px;
  padding: 1rem;
  border: 1.5px dashed var(--borde);
  border-radius: 10px;
  background: var(--superficie-2);
  color: var(--texto-suave);
  font-size: .9rem;
  text-align: center;
}

.nota { font-size: .88rem; color: var(--texto-suave); }

.referencias { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.referencias li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--borde);
  font-size: .93rem;
  line-height: 1.5;
  max-width: none;
}
.referencias li:last-child { border-bottom: 0; }
.referencias .num { color: var(--texto-suave); font-variant-numeric: tabular-nums; font-weight: 600; }
.referencias .texto { overflow-wrap: anywhere; }
.enlace-ref {
  display: inline-block;
  margin-left: .35rem;
  padding: 0 .45rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}
.enlace-ref:hover { border-color: var(--acento); text-decoration: none; }

.aviso-uso {
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid color-mix(in srgb, #e8a300 45%, var(--borde));
  border-left: 4px solid #e8a300;
  border-radius: 12px;
  background: color-mix(in srgb, #e8a300 8%, var(--superficie));
  font-size: .93rem;
}
.aviso-uso p { margin: 0; max-width: none; }

/* «Los datos contenidos en esta página están parcialmente publicados en: …» */
.publicacion {
  margin: 0 0 1.75rem;
  padding: 1rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--acento) 40%, var(--borde));
  border-left: 4px solid var(--acento);
  border-radius: 12px;
  background: color-mix(in srgb, var(--acento) 7%, var(--superficie));
  font-size: .93rem;
}
.bloque .publicacion { margin: 1.25rem 0 0; }
.publicacion p { margin: 0; max-width: none; }
.publicacion .cita { margin-top: .35rem; }
.publicacion a { overflow-wrap: anywhere; }

/* Pie de tabla (composición de los materiales) */
.pie-tabla { margin: -.4rem 0 0; font-size: .88rem; color: var(--texto-suave); }

.vinculos { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.vinculos a {
  display: flex;
  flex-direction: column;
  padding: .7rem .95rem;
  border: 1px solid var(--borde);
  border-radius: 11px;
  color: var(--texto);
}
.vinculos a:hover { border-color: var(--acento); text-decoration: none; }
.vinculos .vinculo-nombre { font-weight: 600; }
.vinculos .vinculo-url { font-family: var(--fuente-mono); font-size: .8rem; color: var(--acento); overflow-wrap: anywhere; }

.nota-pie { margin: 1.5rem 0 0; font-size: .86rem; color: var(--texto-suave); }
.notas-pie { margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--borde); }
.notas-pie .nota-pie { margin: .35rem 0 0; }

.h2-original { font-weight: 400; font-size: .8em; color: var(--texto-suave); }

.seccion-fuentes { margin: 0 0 1.75rem; }
.seccion-fuentes > h2 { margin-top: .25rem; }

/* ---------- 7. Panel de navegación (derecha) ---------- */
.panel {
  position: sticky;
  top: calc(var(--alto-cabecera) + 1.25rem);
  max-height: calc(100vh - var(--alto-cabecera) - 2.5rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem .85rem 1.1rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.panel-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 .35rem .6rem;
}

.panel-titulo {
  display: block;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

.panel-cerrar {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--borde);
  border-radius: 9px;
  background: var(--superficie-2);
  color: var(--texto);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.panel-buscar {
  width: 100%;
  margin: 0 0 .75rem;
  padding: .55rem .8rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie-2);
  color: var(--texto);
  font: inherit;
  font-size: .9rem;
}
.panel-buscar:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 22%, transparent); }

.nav-lista, .nav-sublista, .indice-pagina ul { list-style: none; margin: 0; padding: 0; }
.nav-lista > li { margin: 2px 0; }

.nav-fila { display: flex; align-items: center; gap: .15rem; }

.nav-enlace {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  border-radius: 9px;
  color: var(--texto);
  font-size: .94rem;
  line-height: 1.3;
}
.nav-enlace:hover { background: var(--superficie-2); text-decoration: none; }
.nav-enlace[aria-current="page"] {
  background: color-mix(in srgb, var(--color, var(--acento)) 12%, transparent);
  color: var(--color, var(--acento));
  font-weight: 650;
}
.nav-texto { min-width: 0; display: flex; flex-direction: column; }
.nav-texto small { font-size: .74rem; color: var(--texto-suave); font-weight: 400; }
.nav-seccion.pronto .nav-texto small { color: var(--color); font-weight: 600; }

.punto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--color, var(--acento)); }
.icono { flex: none; display: inline-flex; color: var(--texto-suave); }

.contador, .etiqueta-pronto {
  margin-left: auto;
  flex: none;
  padding: .05rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 650;
  background: var(--superficie-2);
  border: 1px solid var(--borde);
  color: var(--texto-suave);
}
.etiqueta-pronto {
  background: color-mix(in srgb, var(--color, var(--acento)) 12%, transparent);
  border-color: transparent;
  color: var(--color, var(--acento));
}

.desplegar {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--texto-suave);
  cursor: pointer;
}
.desplegar:hover { background: var(--superficie-2); color: var(--texto); }
.desplegar::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.desplegar[aria-expanded="true"]::before { transform: rotate(45deg); }

.nav-sublista {
  margin: 2px 0 8px 1.05rem;
  padding-left: .55rem;
  border-left: 2px solid color-mix(in srgb, var(--color, var(--borde)) 35%, var(--borde));
}
.nav-sublista .nav-enlace { padding: .36rem .55rem; font-size: .88rem; }

.sin-resultados { margin: .5rem .6rem; font-size: .86rem; color: var(--texto-suave); }

.indice-pagina {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--borde);
}
.indice-pagina .panel-titulo { margin: 0 .35rem .5rem; }
.indice-pagina a {
  display: block;
  padding: .28rem .65rem;
  border-left: 2px solid transparent;
  font-size: .86rem;
  line-height: 1.35;
  color: var(--texto-suave);
}
.indice-pagina a:hover { color: var(--texto); text-decoration: none; }
.indice-pagina a.activo { color: var(--acento); border-left-color: var(--acento); font-weight: 600; }

.velo { display: none; }

/* ---------- 8. Pie ---------- */
.pie {
  margin-top: auto;
  background: var(--superficie);
  border-top: 1px solid var(--borde);
  color: var(--texto-suave);
  font-size: .88rem;
}
.pie-interior {
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding: 1.3rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
}
.pie a { color: var(--texto-suave); }
.pie a:hover { color: var(--acento); }

/* ---------- 9. Pantallas estrechas ---------- */
@media (max-width: 1000px) {
  .botones-grandes { grid-template-columns: minmax(0, 1fr); max-width: 640px; margin-top: -4rem; gap: 1.1rem; }
  .boton-grande { min-height: 0; }
}

@media (max-width: 960px) {
  .contenedor { grid-template-columns: minmax(0, 1fr); padding-top: 1.25rem; }
  .contenido { grid-column: 1; }
  .boton-menu { display: inline-flex; order: -1; margin-left: 0; }
  .panel-cerrar { display: grid; place-items: center; }

  .panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: min(88vw, 340px);
    max-height: none;
    border-radius: 0;
    border-width: 0 1px 0 0;
    padding-top: 1.1rem;
    transform: translateX(-105%);
    transition: transform .25s ease;
    visibility: hidden;
  }
  body.menu-abierto .panel { transform: none; visibility: visible; }

  .velo {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(6, 12, 24, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.menu-abierto .velo { opacity: 1; pointer-events: auto; }
  body.menu-abierto { overflow: hidden; }
}

@media (max-width: 760px) {
  .heroe-decoracion { display: none; }
}

@media (max-width: 700px) {
  /* Portada: no caben marca, nombre de la base de datos, idioma y contacto;
     queda el logotipo (el título completo está justo debajo, en la portada) */
  .cabecera.con-base .marca-texto { display: none; }
  .cabecera-base { white-space: normal; text-align: right; }
}

@media (max-width: 620px) {
  /* Cabecera compacta para que quepan menú, marca, idioma y contacto */
  .marca-texto { font-size: .95rem; }
  .marca-texto small { display: none; }
  .cabecera-interior { gap: .6rem; padding-left: 1rem; padding-right: 1rem; }
  .marca { min-width: 0; gap: .6rem; }
  .boton-menu { flex: none; padding: 0 .6rem; }
  .boton-menu span {           /* solo el icono; el texto queda para lectores de pantalla */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .contacto-boton { padding: 0 .65rem; font-size: .78rem; letter-spacing: .05em; }
  .contacto-flecha { display: none; }
  .idiomas { font-size: .78rem; letter-spacing: .04em; }
  .idiomas a, .idioma-actual { padding: 0 .5rem; }
}

@media (max-width: 560px) {
  .contacto-panel {
    position: fixed;
    top: calc(var(--alto-cabecera) + .5rem);
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
  }
  .heroe { padding: 3rem 1rem 6.5rem; }
  .botones-grandes { padding: 0 1rem; }
  .boton-grande { padding: 1.6rem 1.3rem 1.3rem; }
  .cabecera-seccion { flex-direction: column; align-items: flex-start; padding: 1.25rem 1.2rem 1.25rem 1.5rem; }
  .contenedor { padding-left: 1rem; padding-right: 1rem; }
  .bloque { padding: 1.15rem 1rem 1.2rem; }
  .valor { gap: .2rem .45rem; padding: .75rem .9rem; }
  .valor-numero { font-size: 1.2rem; }
  /* Descarga pendiente: la etiqueta «Pendiente» pasa debajo del nombre del
     archivo, para que la descarga quepa en las pantallas más estrechas */
  .descargas li.pendiente a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "formato texto icono" "formato estado icono";
    row-gap: .4rem;
  }
  .descargas li.pendiente .formato { grid-area: formato; align-self: center; }
  .descargas li.pendiente .descarga-texto { grid-area: texto; }
  .descargas li.pendiente .estado-pendiente { grid-area: estado; justify-self: start; }
  .descargas li.pendiente a > svg { grid-area: icono; align-self: center; }
}

@media (max-width: 440px) {
  /* Móviles, páginas con botón de menú: solo el logotipo, para que quepan el
     menú, el idioma y el contacto */
  .cabecera.con-menu .marca-texto { display: none; }
}

@media (max-width: 400px) {
  /* Portada en móviles estrechos: del nombre de la base de datos queda «bqSeeds_v2» */
  .cabecera-base { font-size: 0; }
  .cabecera-base strong { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 10. Impresión ---------- */
@media print {
  .cabecera, .panel, .velo, .tabla-herramientas, .pie, .saltar { display: none !important; }
  body { background: #fff; color: #000; }
  .contenedor { display: block; max-width: none; padding: 0; }
  .tarjeta, .cabecera-seccion, .tabla-envoltorio, .bloque { box-shadow: none; }
  .tabla-envoltorio { max-height: none; overflow: visible; }
  table.datos thead th, table.datos tbody th { position: static; }
  /* Al imprimir, los cuadros pasan a fondo blanco y texto negro */
  .bloque, .tarjeta, .cabecera-seccion, .tarjeta-fuente, .aviso, .aviso-uso, .publicacion {
    --superficie: #ffffff;
    --superficie-2: #f3f5f9;
    --texto: #000000;
    --texto-suave: #444444;
    --borde: #cccccc;
    --acento: #0b7285;
    --c-ir: #0b7d8f;
    --c-co: #1f5fd1;
    --c-puntuales: #6741d9;
    color-scheme: light;
  }
}

/* Descargas cuyo archivo todavía no está en la carpeta tablas/ */
.descargas li.pendiente a { border-style: dashed; opacity: .75; }
.estado-pendiente {
  flex: none;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, #e8a300 18%, transparent);
  color: #f0b429;
  font-size: .72rem;
  font-weight: 700;
}

/* Pestañas de las tablas reducidas (Valores / Incertidumbre) */
.pestanas { margin: .35rem 0 .5rem; }
.pestanas-botones {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  margin-bottom: .2rem;
  border: 1px solid var(--borde);
  border-radius: 11px;
  background: var(--superficie-2);
}
.pestanas-botones [role="tab"] {
  padding: .35rem .85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--texto-suave);
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
}
.pestanas-botones [role="tab"]:hover { color: var(--texto); }
.pestanas-botones [role="tab"][aria-selected="true"] {
  background: var(--superficie);
  color: var(--texto);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
table.datos.reducida { font-size: .84rem; }
table.datos.reducida th,
table.datos.reducida td { padding: .38rem .6rem; }
table.datos td.ref { box-shadow: inset 0 0 0 2px var(--acento); font-weight: 700; }

/* ---------- Fuentes puntuales ---------- */
/* Texto de «Detalles del cálculo» */
.documento { max-width: 82ch; }
.documento ol { padding-left: 1.4rem; }
.documento li { margin: .4rem 0; max-width: none; }
.formula {
  position: relative;
  margin: .7rem 0;
  padding: .45rem 3rem;
  text-align: center;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 1.15rem;
}
.formula .num-ec {
  position: absolute;
  right: .25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--fuente);
  font-size: .9rem;
  color: var(--texto-suave);
}
/* superíndice y subíndice apilados (R^j_M) */
.ss {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: .05em;
  font-size: .66em;
  line-height: 1.05;
}
.ss > span { display: block; }
.doc-nota { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--borde); font-size: .85rem; color: var(--texto-suave); overflow-wrap: anywhere; }

/* Tabla de energías y tablas de resultados */
table.datos th small { display: block; margin-top: .1rem; font-size: .72rem; font-weight: 500; color: var(--texto-suave); white-space: nowrap; }
.tabla-energias .enlace-energia {
  display: inline-block;
  min-width: 3.4rem;
  padding: .15rem .55rem;
  border-radius: 7px;
  background: color-mix(in srgb, var(--c-puntuales) 16%, transparent);
  color: var(--c-puntuales);
  font-weight: 750;
  text-align: center;
}
.tabla-energias .enlace-energia:hover { background: color-mix(in srgb, var(--c-puntuales) 28%, transparent); text-decoration: none; }
.tabla-energias .celda-archivo a { display: inline-flex; align-items: center; gap: .35rem; color: var(--texto-suave); font-size: .82rem; }
.tabla-energias .celda-archivo a:hover { color: var(--acento); text-decoration: none; }
.tabla-energias .celda-archivo svg { width: 15px; height: 15px; }

.navegacion-energias { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 1.25rem; }
.navegacion-energias a, .navegacion-energias .inactivo {
  min-width: 7.5rem;
  padding: .45rem .9rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
  color: var(--texto);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
}
.navegacion-energias a:hover { border-color: var(--c-puntuales); color: var(--c-puntuales); text-decoration: none; }
.navegacion-energias .inactivo { visibility: hidden; }
.navegacion-energias .todas { min-width: 0; font-weight: 500; color: var(--texto-suave); }
@media (max-width: 560px) {
  /* En el móvil no caben los tres en una fila: anterior y siguiente arriba
     y «Todas las energías» debajo, a todo el ancho */
  .navegacion-energias { flex-wrap: wrap; gap: .6rem; }
  .navegacion-energias .todas { order: 3; flex: 1 0 100%; }
}
.nav-enlace.en-seccion { color: var(--color, var(--acento)); font-weight: 650; }
