/* =============================================
   Warhammer Fantasy Roleplay — Custom Theme
   Paleta: fondo carbón oscuro, texto pergamino claro, acentos dorado/ámbar
   ============================================= */

:root {
  /* Backgrounds — carbón oscuro con matiz cálido */
  --wh-bg:          #0d0b08;   /* página principal */
  --wh-bg-card:     #1a1510;   /* tarjetas, filas de tabla */
  --wh-bg-card-alt: #252018;   /* hover / filas alternas */

  /* Dorado — acento principal */
  --wh-gold:        #d4a830;   /* enlaces, badges */
  --wh-gold-dark:   #9a7422;   /* bordes, gradientes oscuros */
  --wh-gold-light:  #f2cc50;   /* encabezados, hover — alto contraste */

  /* Rojo sangre */
  --wh-red:         #7a1010;
  --wh-red-light:   #c04030;

  /* Texto — contraste WCAG AA o superior contra --wh-bg-card */
  --wh-text:        #ede0c4;   /* ~13:1 sobre #1a1510 — pergamino claro */
  --wh-text-muted:  #c0964a;   /* ~5.5:1 — ámbar cálido */

  /* Bordes */
  --wh-border:      #352a14;   /* separadores sutiles */
  --wh-border-gold: #5e4418;   /* bordes de tarjeta / tabla */

  --wh-parchment:   #f5e6c8;
}

/* =============================================
   Modo claro — mismas variables, releídas cuando <html data-theme="light">.
   El modo oscuro de arriba sigue siendo el valor por defecto (sin atributo)
   - así los usuarios existentes no ven ningún cambio hasta que elijan "Modo
   claro" desde el menú de usuario (ver base.html + main.js).

   La barra de navegación, sus desplegables y el pie de página SÍ cambian
   con el tema (siguen las mismas variables). La única excepción es la
   banda de "entorno de preproducción" (`.wh-navbar-prepro`): se queda fija
   en su teal oscuro con texto claro en los dos temas a propósito - todo su
   sentido es ser inconfundible, así que no debe camuflarse solo porque
   alguien eligió "Modo claro" (ver el bloque `.wh-navbar-prepro` más abajo,
   con selectores sobre-cualificados para ganar siempre a la regla general). */
[data-theme="light"] {
  --wh-bg:          #f7f2e4;
  --wh-bg-card:     #fffdf8;
  --wh-bg-card-alt: #ede0c0;

  --wh-gold:        #7a4d00;
  --wh-gold-dark:   #b8935a;
  --wh-gold-light:  #5c3d00;

  --wh-text:        #2b2013;
  --wh-text-muted:  #6b5028;

  --wh-border:      #e0d5b8;
  --wh-border-gold: #c9ac70;

  --wh-parchment:   #fffdf8;
}

/* ---- Base ---- */
body {
  background-color: var(--wh-bg);
  color: var(--wh-text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.05rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.wh-title, .wh-heading, .wh-name {
  font-family: 'Cinzel', 'Times New Roman', serif;
  color: var(--wh-gold-light);
}

a { color: var(--wh-gold); }
a:hover { color: var(--wh-gold-light); }

/* ---- Navbar ---- */
.wh-navbar {
  background: linear-gradient(180deg, #080604 0%, #151008 100%);
  border-bottom: 2px solid var(--wh-gold-dark);
  padding: 0.4rem 1rem;
}

.wh-brand {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--wh-gold-light) !important;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Preproduction-only: visually distinct navbar so it's never confused with
   production at a glance (deliberately a different hue family, not just a
   shade of the same gold/carbón palette). */
.wh-navbar-prepro {
  background: linear-gradient(180deg, #041a1f 0%, #0a2b33 100%) !important;
  border-bottom: 2px solid #2ab0c9 !important;
}
/* Its text stays fixed light-on-teal in BOTH app themes (unlike the rest of
   the navbar below, which now follows the light/dark toggle) - the whole
   point of this banner is to be unmistakable, so it doesn't get to look
   different just because someone picked "Modo claro". Selectors are
   over-qualified (chained classes) on purpose so this wins regardless of
   source order against the general `.navbar-nav .nav-link` rule and its
   `[data-theme="light"]` override below, both equally `!important`. */
.wh-navbar.wh-navbar-prepro .navbar-nav .nav-link { color: #ede0c4 !important; }
.wh-navbar.wh-navbar-prepro .wh-brand { color: #f2cc50 !important; }
.wh-navbar.wh-navbar-prepro .navbar-nav .nav-link:hover,
.wh-navbar.wh-navbar-prepro .navbar-nav .nav-link.active { color: #f2cc50 !important; }
.wh-env-banner {
  background: #ffb020;
  color: #1a1200;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-left: 12px;
  white-space: nowrap;
}

.navbar-nav .nav-link {
  color: var(--wh-text) !important;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.9rem;
  transition: color 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--wh-gold-light) !important;
}

/* B3 (2026-10-08): con todas las secciones, el menú horizontal necesita
   ~1400-1600px; antes se desplegaba desde 992px (navbar-expand-lg) y cada
   enlace partía icono y texto en dos líneas. Ahora: icono y texto nunca se
   separan, menú móvil por debajo de 1200px (navbar-expand-xl), solo iconos
   (nombre en el title/tooltip) entre 1200 y 1599px, e icono+texto desde 1600px. */
.navbar-nav .nav-link { white-space: nowrap; }
@media (min-width: 1200px) and (max-width: 1599.98px) {
  .wh-navbar .wh-nav-label { display: none; }
  .wh-navbar .navbar-nav .nav-link > .bi { margin-right: 0 !important; font-size: 1.05rem; }
  .wh-navbar .navbar-nav .nav-link { padding: 0.5rem 0.7rem; }
}

/* ---- Cards ---- */
.wh-card {
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  border-radius: 4px;
  color: var(--wh-text);
}

.wh-card-sm {
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border);
  border-radius: 4px;
  color: var(--wh-text);
  transition: border-color 0.2s;
}
.wh-card-sm:hover { border-color: var(--wh-gold-dark); }

.wh-card-header {
  background: linear-gradient(90deg, #2a1e0a 0%, var(--wh-bg-card) 100%);
  border-bottom: 1px solid var(--wh-border-gold);
  color: var(--wh-gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* ---- Buttons ---- */
.btn-wh {
  background: linear-gradient(180deg, #9a7422 0%, #6b5018 100%);
  color: #0d0b08;
  border: 1px solid var(--wh-gold);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-wh:hover, .btn-wh:focus {
  background: linear-gradient(180deg, #d4a830 0%, #9a7422 100%);
  color: #080604;
  border-color: var(--wh-gold-light);
  box-shadow: 0 0 10px rgba(212, 168, 48, 0.45);
}

.btn-wh:active { transform: scale(0.97); }

/* ---- Forms / Inputs ---- */
.wh-input, .wh-input.form-control, .wh-input.form-select {
  background: #120f08;
  border: 1px solid var(--wh-border-gold);
  color: var(--wh-text);
  border-radius: 3px;
}

.wh-input:focus {
  background: #1c1810;
  border-color: var(--wh-gold);
  color: var(--wh-text);
  box-shadow: 0 0 0 2px rgba(212, 168, 48, 0.3);
}

.wh-input::placeholder { color: var(--wh-text-muted); opacity: 0.7; }

/* Deshabilitado - .wh-input fija su propio fondo/color siempre, así que sin
   esto el estado disabled nativo del navegador queda invisible (mismo
   aspecto que uno activo, solo deja de responder al clic). */
.wh-input:disabled, .wh-input.form-select:disabled {
  background: var(--wh-border);
  color: var(--wh-text-muted);
  border-color: var(--wh-border);
  opacity: 0.65;
  cursor: not-allowed;
}

.wh-label {
  color: var(--wh-gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* ---- Tables ---- */
.wh-table {
  color: var(--wh-text);
  border-color: var(--wh-border-gold);
  /* Neutralize Bootstrap 5's inset box-shadow hover trick (table-hover) */
  --bs-table-hover-bg: transparent;
  --bs-table-accent-bg: transparent;
}

.wh-table thead th {
  background: #261c08;
  color: var(--wh-gold-light);
  border-color: var(--wh-border-gold);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.wh-table tbody td {
  background: var(--wh-bg-card);
  border-color: var(--wh-border);
  color: var(--wh-text);
  /* Block Bootstrap's inset box-shadow overlay */
  box-shadow: none !important;
}

.wh-table tbody tr:hover td {
  background: var(--wh-bg-card-alt);
}

/* Zebra striping - opt-in modifier for tables with many similar-looking rows
   (e.g. inventory), so the eye doesn't lose track of a row while scanning
   across several columns. Not the .wh-table default since most tables here
   are short/simple and don't need it. */
.wh-zebra tbody tr:nth-child(even) td {
  background: var(--wh-bg-card-alt);
}

/* Carga (encumbrance) severity - a green -> yellow -> orange -> red
   progression applied to the whole card, so the color itself communicates
   the level at a glance, not just the text. Text color picked per step for
   contrast against its own background. */
.wh-carga-sin_carga { background: #1e4620 !important; color: #d9f2d9 !important; border-color: #2e6b30 !important; }
.wh-carga-ligera     { background: #6b5b0e !important; color: #fff3cd !important; border-color: #a5891a !important; }
.wh-carga-media      { background: #7a4a12 !important; color: #ffe4bf !important; border-color: #b06a1a !important; }
.wh-carga-pesada     { background: #7a1f1f !important; color: #ffffff !important; border-color: #a52a2a !important; }

.wh-carga-badge.wh-carga-sin_carga { background: #2e8b32 !important; }
.wh-carga-badge.wh-carga-ligera    { background: #b8960b !important; color: #2b2200 !important; }
.wh-carga-badge.wh-carga-media     { background: #c56a1a !important; }
.wh-carga-badge.wh-carga-pesada    { background: #c62828 !important; }

/* Mochila/Saco physical capacity exceeded - a hard container limit,
   independent of the Fuerza+Resistencia carga tiers above. Explicit
   red/white per the user's request, distinct from the carga progression. */
.wh-carga-overflow {
  background: #a30000 !important;
  color: #ffffff !important;
  border-color: #a30000 !important;
}

/* Characteristic tables */
.wh-stat-table {
  font-size: 0.85rem;
  color: var(--wh-text);
}

.wh-stat-table th {
  background: #261c08;
  color: var(--wh-gold);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-color: var(--wh-border-gold);
  min-width: 36px;
}

.wh-stat-table td {
  background: var(--wh-bg-card);
  padding: 4px 6px;
  border-color: var(--wh-border);
  color: var(--wh-text);
}

.wh-stat-positive {
  color: #6ee87a !important;
  font-weight: 600;
}

/* ---- Badges ---- */
.wh-badge-skill {
  background: #0e2a10;
  border: 1px solid #266628;
  color: #8edaa0;
  font-size: 0.78rem;
  font-weight: normal;
}

.wh-badge-skill-opt {
  background: #0e1e2e;
  border: 1px solid #224466;
  color: #7ab4d4;
  font-size: 0.78rem;
  font-weight: normal;
}

.wh-badge-talent {
  background: #2e1e08;
  border: 1px solid #664a18;
  color: #e0b86a;
  font-size: 0.78rem;
  font-weight: normal;
}

.wh-badge-talent-opt {
  background: #2e0e1e;
  border: 1px solid #661842;
  color: #e07aaa;
  font-size: 0.78rem;
  font-weight: normal;
}

.wh-badge-trapping {
  background: #242210;
  border: 1px solid #524e20;
  color: #d0cc6a;
  font-size: 0.78rem;
  font-weight: normal;
}

.wh-badge-prof {
  background: #1e0e2e;
  border: 1px solid #4a2266;
  color: #b07ae0;
  font-size: 0.78rem;
  font-weight: normal;
  text-decoration: none;
}

.wh-badge-prof:hover { color: var(--wh-gold-light); }

/* Contacto oculto (admin): antes bg-secondary, casi invisible en tema oscuro -
   naranja con borde para que destaque en ambos temas (2026-10-08). */
.wh-badge-hidden {
  background: #5a2a08;
  border: 1px solid #f0883e;
  color: #ffb070;
  font-weight: 600;
}

/* ---- Choice groups ---- */
.wh-choice-group { display: inline-flex; align-items: center; gap: 3px; }
.wh-or {
  color: var(--wh-text-muted);
  font-style: italic;
  font-size: 0.75rem;
}

/* ---- Accordion ---- */
.wh-accordion-item {
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  margin-bottom: 2px;
}

.wh-accordion-btn {
  background: #241a08;
  color: var(--wh-gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
}

.wh-accordion-btn:not(.collapsed) {
  background: #302616;
  color: var(--wh-gold-light);
}

.wh-accordion-btn::after { filter: brightness(2) sepia(1) hue-rotate(15deg); }

/* ---- Dividers ---- */
.wh-divider {
  border-color: var(--wh-gold-dark);
  border-width: 2px;
  opacity: 0.5;
  margin: 1.5rem auto;
  width: 60%;
}

.wh-divider-sm {
  border-color: var(--wh-border-gold);
  opacity: 0.4;
}

/* ---- Misc UI ---- */
.wh-subtitle { color: var(--wh-text-muted); font-family: 'Cinzel', serif; }

.wh-description {
  color: var(--wh-text);
  line-height: 1.7;
}

.wh-link { color: var(--wh-gold); text-decoration: none; }
.wh-link:hover { color: var(--wh-gold-light); text-decoration: underline; }

/* Row-primary link that keeps the surrounding text's own color (2026-07-24,
   Contactos list) - unlike .wh-link (always gold), this is for making an
   existing piece of text tappable without changing how it looks, so on
   narrow/mobile widths you don't have to scroll a table-responsive all the
   way right to reach the "Ver" button just to open a ficha. */
.wh-row-link { color: inherit; text-decoration: none; }
.wh-row-link:hover { text-decoration: underline; }

.wh-breadcrumb { background: transparent; font-size: 0.85rem; }
.wh-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--wh-text-muted); }
.wh-breadcrumb .breadcrumb-item.active { color: var(--wh-text-muted); }

.wh-alert { background: var(--wh-bg-card); border-color: var(--wh-gold-dark); color: var(--wh-text); }

.wh-footer {
  background: var(--wh-bg);
  border-top: 1px solid var(--wh-border-gold);
  margin-top: auto;
}

/* ---- Profession images ---- */
.wh-card-img {
  height: 180px;
  object-fit: cover;
  filter: sepia(20%) brightness(0.85);
}

.wh-card-img-placeholder {
  height: 180px;
  background: var(--wh-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--wh-border-gold);
}

/* Equipment images: the FRAME is a separate element from the IMG itself,
   which is sized only to its own content (max-width/max-height with
   width/height:auto - no baked-in letterbox). This split matters for the
   hover-zoom below: transform:scale() enlarges the whole box it's applied
   to, so if the frame and the image were the same element, the letterbox
   padding would visibly stretch along with the photo. Scaling only the
   inner img leaves the frame untouched.

   The leftover space around the (uncropped, contain-fit) photo is filled
   dynamically with a blurred, cover-scaled copy of that SAME photo - a
   wood-grain background stays wood-grain-coloured, a gradient stays that
   gradient, a plain background stays plain - instead of one fixed frame
   colour for every item. The blur is what makes this safe: baking a sharp
   reflection of the image's own edges into a padded file (tried earlier)
   visibly duplicated the weapon itself whenever it reached close to the
   edge; blurred and softly scaled, that same duplication reads as an
   ambient glow instead of a repeated shape. A nested clipping layer holds
   the backdrop so its over-scaled edges never poke out, while the OUTER
   wrap stays overflow:visible so the sharp hover-zoomed photo can still
   pop out above neighbouring cards. */
.wh-card-img-wrap, .wh-detail-img-wrap {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: #e8e2d5;
}
.wh-card-img-wrap { min-height: 220px; padding: 8px; }
.wh-detail-img-wrap { min-height: 480px; padding: 16px; }

.wh-img-backdrop-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.wh-img-backdrop {
  position: absolute;
  inset: -12%;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.8) saturate(1.15);
}

.wh-card-img-left, .wh-detail-img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  display: block;
  filter: sepia(20%) brightness(0.9);
}
.wh-card-img-left { max-width: 100%; max-height: 280px; }
.wh-detail-img { max-width: 100%; max-height: 460px; }

.wh-card-img-left-placeholder {
  height: 100%;
  min-height: 220px;
  background: var(--wh-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--wh-border-gold);
}

/* Hover-to-inspect: hold the pointer over an equipment photo for a beat and
   it zooms in-place (no layout shift, transform only); moving away snaps it
   back immediately. The image is raised above neighbouring cards while
   zoomed so it isn't clipped or hidden behind the next one. List thumbnails
   are small so they zoom a lot more than the already-large detail image. */
.wh-card-img-left, .wh-detail-img {
  transform: scale(1);
  transition: transform 0.25s ease-out;
  cursor: zoom-in;
}
.wh-card-img-left:hover {
  transform: scale(1.7);
  transition: transform 0.25s ease-out 1s;
  position: relative;
  z-index: 20;
}
.wh-detail-img:hover {
  transform: scale(1.3);
  transition: transform 0.25s ease-out 1s;
  position: relative;
  z-index: 20;
}

/* Click-to-enlarge lightbox (see main.js): a full-viewport overlay showing
   the clicked equipment photo at its largest comfortable size. */
.wh-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 5, 0.9);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.wh-lightbox.wh-lightbox-open {
  display: flex;
}
.wh-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* Jump target from the image explorer's global search (see images_explorer.html's
   ?highlight= handling): a temporary outline on the card the search sent you to. */
.wh-image-highlight {
  outline: 3px solid var(--wh-gold-dark, gold);
  outline-offset: 2px;
}

.wh-prof-image {
  max-height: 360px;
  /* contain, not cover - a tall full-body portrait (common for Personajes)
     was getting its head/feet cropped off by cover+fixed-height. This scales
     to fit the box instead, at the cost of empty margin next to non-portrait
     aspect ratios (background fills that gap so it doesn't look like a hole). */
  object-fit: contain;
  background: var(--wh-bg-card);
  width: 100%;
  filter: sepia(15%) brightness(0.9);
  /* Same hover-zoom + click-to-lightbox as .wh-detail-img (see main.js and
     the block above) - this is the standard portrait size used by
     Contactos/Personajes/Profesiones ficha images (2026-07-17). */
  transform: scale(1);
  transition: transform 0.25s ease-out;
  cursor: zoom-in;
}
.wh-prof-image:hover {
  transform: scale(1.3);
  transition: transform 0.25s ease-out 1s;
  position: relative;
  z-index: 20;
}

.wh-prof-image-placeholder {
  height: 220px;
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--wh-border-gold);
  border-radius: 4px;
}

.wh-prof-thumb {
  height: 70px;
  width: 100%;
  object-fit: cover;
  filter: sepia(20%) brightness(0.8);
}

.wh-prof-thumb-placeholder {
  height: 70px;
  background: var(--wh-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--wh-border-gold);
}

/* Fixed-size photo box for the contact edit/new forms (2026-07-19) - unlike
   .wh-prof-image (ficha display, height driven by the image itself),
   this box's height is fixed so the "Visible" checkbox beneath it always
   lines up with the bottom of "Notas del director" in the column next to
   it, regardless of each contact's own photo dimensions. object-fit:contain
   keeps every photo undistorted and uncropped (letterboxed if its ratio
   doesn't match the box) rather than stretching it to fill. */
.wh-contact-photo-box {
  height: 434px;
  width: 100%;
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wh-contact-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wh-contact-photo-box .wh-contact-photo-placeholder {
  font-size: 4rem;
  color: var(--wh-border-gold);
}

/* Ficha de detalle de contacto (2026-07-19) - unos pocos campos (Raza,
   Estado, Lugares...) quedaban apilados en dt/dd estrecho arriba a la
   izquierda, dejando vacío el resto de la columna. Una sola columna con
   align-content: space-between reparte los campos verticalmente por todo
   el alto disponible (el primero pegado arriba, el último abajo) en vez de
   amontonarlos al principio; se mantiene en una columna en todos los
   anchos, así que no hace falta ningún ajuste para tablet/móvil. */
.wh-contact-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 1.5rem;
  height: 100%;
  align-content: space-between;
}
.wh-contact-field-wide { grid-column: 1 / -1; }
.wh-contact-fields-grid .wh-field-label {
  color: var(--wh-gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}
.wh-contact-fields-grid .wh-field-value {
  font-size: 1.15rem;
  line-height: 1.4;
}

/* Small round avatar, e.g. next to a character's name in a list card -
   unlike .wh-prof-thumb (full-width card-top image), this stays inline.
   Same hover-zoom + click-to-lightbox as .wh-card-img-left (see main.js and
   the "Hover-to-inspect"/"Click-to-enlarge lightbox" rules above) - scales
   more on hover since the avatar itself is much smaller. */
.wh-char-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--wh-border-gold);
  flex-shrink: 0;
  transform: scale(1);
  transition: transform 0.25s ease-out;
  cursor: zoom-in;
}
.wh-char-avatar:hover {
  transform: scale(2.5);
  transition: transform 0.25s ease-out 1s;
  position: relative;
  z-index: 20;
}

/* Round avatar for the Contactos list table (2026-07-24) - unlike
   .wh-char-avatar, this deliberately has NO hover-zoom: inside a
   .table-responsive wrapper (overflow-x:auto, needed for the table to work
   on phone-width screens) a scaled-up hover preview gets clipped by that
   wrapper's edge, which is worse than no preview at all. Click still opens
   the full-size lightbox (wh-lightbox-trigger, unchanged - see main.js).
   object-fit:contain (not cover) because contact photos vary wildly -
   headshots, waist-up, full-body - and cover was cropping tall/full-body
   photos down to an arbitrary square slice, sometimes cutting the head off
   entirely. contain scales the whole photo down to fit instead, leaving
   the rest of the circle transparent (shows the table row underneath) for
   photos that aren't already square - always uncropped, at the cost of not
   filling every corner of the circle for a non-square photo. Slightly
   bigger than .wh-char-avatar (56px vs 48px) so the shrunk photo still
   reads clearly at a glance. */
.wh-contact-avatar {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--wh-border-gold);
  flex-shrink: 0;
  cursor: zoom-in;
}

/* ---- Stat number ---- */
.wh-stat-number {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  color: var(--wh-gold);
  line-height: 1;
  margin: 0.5rem 0;
}

.wh-icon-lg {
  font-size: 2.5rem;
  color: var(--wh-gold-dark);
  display: block;
  margin: 0.5rem 0;
}

/* ---- Pre text (PDF pages) ---- */
.wh-pre-text {
  background: var(--wh-bg);
  border: 1px solid var(--wh-border);
  color: var(--wh-text);
  font-size: 0.82rem;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--wh-bg); }
::-webkit-scrollbar-thumb { background: var(--wh-border-gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--wh-gold-dark); }

/* ---- Skill/Talent list items ---- */
.wh-item-list { display: flex; flex-direction: column; }

.wh-item-entry {
  padding: .8rem 1rem;
  border-left: 1px solid var(--wh-border-gold);
  border-right: 1px solid var(--wh-border-gold);
  border-top: 1px solid var(--wh-border);
  background: var(--wh-bg-card);
}
.wh-item-entry:first-child {
  border-top-color: var(--wh-border-gold);
  border-radius: 4px 4px 0 0;
}
.wh-item-entry:last-child {
  border-bottom: 1px solid var(--wh-border-gold);
  border-radius: 0 0 4px 4px;
}
.wh-item-entry:hover { background: var(--wh-bg-card-alt); }

.wh-item-name  { font-family: 'Cinzel', serif; font-size: .95rem; color: var(--wh-gold-light); }
.wh-item-desc  { color: var(--wh-text); font-size: .9rem; line-height: 1.6; }
.wh-item-meta  { font-size: .8rem; color: var(--wh-text-muted); }

/* Type badges — WH-styled, no Bootstrap */
.badge-wh-basic {
  display: inline-block;
  background: #0c2610;
  border: 1px solid #245a28;
  color: #7adc90;
  font-size: .73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .3px;
  vertical-align: middle;
}
.badge-wh-advanced {
  display: inline-block;
  background: #281a00;
  border: 1px solid #604000;
  color: #d8a428;
  font-size: .73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .3px;
  vertical-align: middle;
}

/* Filter bar */
.wh-filter-bar {
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  border-radius: 4px;
  padding: .6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}
.wh-filter-bar .form-check-label,
.wh-filter-bar label { color: var(--wh-text); font-size: .85rem; }
.wh-filter-bar .form-check-input:checked { background-color: var(--wh-gold-dark); border-color: var(--wh-gold); }
.wh-filter-bar select.wh-input { padding: .2rem .6rem; font-size: .85rem; height: auto; }

/* Search input highlight */
mark { background: rgba(212, 168, 48, .28); color: var(--wh-gold-light); padding: 0 2px; border-radius: 2px; }

/* =============================================
   Bootstrap overrides — adapt to dark WH theme
   ============================================= */

/* text-muted */
.text-muted { color: var(--wh-text-muted) !important; }

/* btn-outline-secondary */
.btn-outline-secondary {
  color: var(--wh-text) !important;
  border-color: var(--wh-border-gold) !important;
  background: transparent;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active {
  background-color: var(--wh-bg-card-alt) !important;
  color: var(--wh-gold-light) !important;
  border-color: var(--wh-gold-dark) !important;
}

/* btn-outline-warning / danger — visible on dark bg */
.btn-outline-warning {
  color: #e0a830 !important;
  border-color: #8a6018 !important;
}
.btn-outline-warning:hover {
  background-color: #2e1e06 !important;
  color: var(--wh-gold-light) !important;
  border-color: var(--wh-gold) !important;
}
.btn-outline-danger {
  color: #e06060 !important;
  border-color: #7a2020 !important;
}
.btn-outline-danger:hover {
  background-color: #2a0808 !important;
  color: #ff8080 !important;
  border-color: #c04040 !important;
}

/* dropdown-toggle caret */
.dropdown-toggle::after { border-top-color: inherit; }

/* Dropdown menus */
.dropdown-menu {
  background-color: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
  min-width: 10rem;
}
.dropdown-item {
  color: var(--wh-text);
  font-size: 0.88rem;
  padding: 0.4rem 1rem;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--wh-bg-card-alt);
  color: var(--wh-gold-light);
}
.dropdown-divider { border-color: var(--wh-border-gold); }

/* Bootstrap badges — replace Bootstrap colors with WH palette */
.badge.bg-secondary {
  background-color: #2e2410 !important;
  color: var(--wh-text-muted) !important;
  border: 1px solid var(--wh-border-gold);
}
.badge.bg-info {
  background-color: #0e2010 !important;
  color: #7acc80 !important;
  border: 1px solid #266630;
}
.badge.bg-success {
  background-color: #0a2010 !important;
  color: #60c870 !important;
  border: 1px solid #205830;
}
.badge.bg-warning {
  background-color: #261808 !important;
  color: #d4a030 !important;
  border: 1px solid #604010;
}
.badge.bg-danger {
  background-color: #200808 !important;
  color: #d46060 !important;
  border: 1px solid #602020;
}
/* text-dark for badges (e.g. bg-warning text-dark) */
.badge.bg-warning.text-dark { color: #c89020 !important; }

/* "sí" prefix badge in synonym dictionary */
.wh-badge-prefix {
  display: inline-block;
  background: #0e2210;
  border: 1px solid #2a6630;
  color: #7ad888;
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
}

/* Alerts */
.alert-warning { color: #e0c060; background-color: #221400; border-color: #604010; }
.alert-danger   { color: #e08080; background-color: #200808; border-color: #602020; }
.alert-info     { color: #80c8c8; background-color: #081818; border-color: #104040; }
.alert-success  { color: #80cc80; background-color: #081408; border-color: #204020; }

/* Form checks - "checked" necesita un relleno que se vea inequívoco en los
   dos temas. --wh-gold NO sirve para esto: es la variable de texto/enlaces,
   deliberadamente oscura en modo claro para leerse bien sobre fondo claro -
   como relleno sólido de fondo eso la deja apagada justo en el tema donde
   más hacía falta contraste (bug real: un intento anterior de arreglar este
   mismo problema usó --wh-gold y solo mejoró el modo oscuro). --wh-gold-dark
   sí funciona en los dos: es la misma variable que ya usa con éxito
   .wh-filter-btn.active (profesiones/form.html) en ambos modos, precisamente
   porque es un tono medio pensado para funcionar como relleno, no como texto.
   El tick va en trazo oscuro explícito (no el SVG por defecto de Bootstrap)
   para no depender de que el relleno sea claro u oscuro. */
.form-check-input { background-color: #120f08; border-color: var(--wh-border-gold); }
.form-check-input:checked {
  background-color: var(--wh-gold-dark);
  border-color: var(--wh-gold-light);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23120f08' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3e%3cpath d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}
.form-check-input:focus { box-shadow: 0 0 0 2px rgba(212, 168, 48, 0.4); }
.form-check-label { color: var(--wh-text); }

/* Modal */
.modal-content {
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  color: var(--wh-text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
}
.modal-header  { border-bottom-color: var(--wh-border-gold); }
.modal-footer  { border-top-color: var(--wh-border-gold); }
.btn-close { filter: invert(0.8) sepia(0.3) hue-rotate(20deg); }

/* Pagination */
.page-link {
  background-color: var(--wh-bg-card);
  border-color: var(--wh-border-gold);
  color: var(--wh-text);
}
.page-link:hover {
  background-color: var(--wh-bg-card-alt);
  border-color: var(--wh-gold-dark);
  color: var(--wh-gold-light);
}
.page-item.active .page-link {
  background-color: var(--wh-gold-dark);
  border-color: var(--wh-gold);
  color: #0d0b08;
}
.page-item.disabled .page-link {
  background-color: var(--wh-bg-card);
  border-color: var(--wh-border);
  color: var(--wh-text-muted);
}

/* Profession picker (searchable combobox, career-exit highlighting) */
.prof-picker { position: relative; }
.prof-picker-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
  background: var(--wh-bg-card);
  border: 1px solid var(--wh-border-gold);
  border-radius: 4px;
  margin-top: 2px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.prof-picker-dropdown.open { display: block; }
.prof-picker-group-label {
  padding: 4px 10px 2px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--wh-text-muted);
}
.prof-picker-option {
  padding: 5px 10px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--wh-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.prof-picker-option:hover { background: var(--wh-bg-card-alt); }
.prof-picker-option.is-exit { background: rgba(212,168,48,.12); }
.prof-picker-option.is-exit:hover { background: rgba(212,168,48,.22); }
.prof-picker-exit-badge {
  font-size: .68rem;
  color: var(--wh-gold-light);
  border: 1px solid var(--wh-gold-dark);
  border-radius: 3px;
  padding: 0 4px;
  white-space: nowrap;
}
.prof-picker-empty { color: var(--wh-text-muted); }

/* Responsive tweaks */
@media (max-width: 768px) {
  .wh-stat-number { font-size: 1.8rem; }
  .wh-stat-table th, .wh-stat-table td { padding: 2px 3px; font-size: 0.7rem; min-width: 28px; }

  /* Cabeceras de página (título + botones de acción, mismo patrón repetido
     en ~30 plantillas: `.d-flex.justify-content-between.align-items-center.mb-3`
     con un `h2` y, o un botón suelto, o un `.d-flex.gap-2` con varios). En
     móvil no caben en una sola fila - sin esto, los botones se apretujaban
     hasta partir su propio texto en 2-3 líneas y `align-items: stretch`
     igualaba su altura con la del hermano, dejando huecos vacíos. Al
     envolver, cada botón que no cabe cae a su propia línea entero en vez de
     deformarse. */
  .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .d-flex.justify-content-between.align-items-center.mb-3 > .d-flex {
    flex-wrap: wrap;
  }
}

/* =============================================
   MODO CLARO — overrides puntuales
   ============================================= */
/* La mayoría del sitio ya se retinta solo al cambiar las variables --wh-*
   de arriba (130+ usos de var() en este fichero). Lo que queda aquí es lo
   que NO pasaba por una variable: fondos de superficie con un valor propio
   (inputs, cabeceras de tabla/acordeón...) y los "tripletes" de color con
   identidad de matiz propia (insignias por tipo, alertas, niveles de
   carga...) que no se pueden resolver invirtiendo una única variable
   compartida sin perder esa identidad. Cada regla de aquí tiene mayor
   especificidad que su equivalente en modo oscuro (por el selector de
   atributo `[data-theme="light"]`), así que gana sin tocar nada de arriba. */

/* Selector de tema en el menú de usuario: el check solo se muestra en la
   opción activa (clase alternada por JS, ver main.js). */
.wh-theme-check { visibility: hidden; }
.wh-theme-option.wh-theme-active .wh-theme-check { visibility: visible; }

/* Superficies con fondo propio (no cubiertas por las variables) */
[data-theme="light"] .wh-navbar { background: linear-gradient(180deg, #fffaf0 0%, #f0e2b8 100%); }
/* Icono hamburguesa (menú móvil): el navbar siempre lleva la clase Bootstrap
   `navbar-dark`, así que por defecto su SVG viene fijo en blanco - invisible
   sobre el fondo crema del modo claro. Repintado a oscuro aquí; excluido de
   `.wh-navbar-prepro` porque esa banda se queda fija en oscuro en los dos
   temas (ver el bloque `.wh-navbar-prepro` más arriba), así que su icono
   debe seguir siendo blanco. */
[data-theme="light"] .wh-navbar:not(.wh-navbar-prepro) .navbar-toggler {
  border-color: rgba(43, 32, 19, .35);
}
[data-theme="light"] .wh-navbar:not(.wh-navbar-prepro) .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(43, 32, 19, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
[data-theme="light"] .wh-card-header { background: linear-gradient(90deg, #f0e6c0 0%, var(--wh-bg-card) 100%); }
[data-theme="light"] .wh-input,
[data-theme="light"] .wh-input.form-control,
[data-theme="light"] .wh-input.form-select { background: #ffffff; }
[data-theme="light"] .wh-input:focus { background: #fffdf5; }
[data-theme="light"] .wh-table thead th { background: #ecdfb8; }
[data-theme="light"] .wh-stat-table th { background: #ecdfb8; }
[data-theme="light"] .wh-accordion-btn { background: #f0e6c0; }
[data-theme="light"] .wh-accordion-btn:not(.collapsed) { background: #e3d0a0; }
/* :not(:checked) - sin esto, esta regla empata en especificidad con
   .form-check-input:checked y gana por ir después en el fichero, anulando
   silenciosamente el relleno "checked" en modo claro (bug real, detectado
   por el usuario con capturas: el relleno seguía sin verse pese al fix
   anterior). */
[data-theme="light"] .form-check-input:not(:checked) { background-color: #ffffff; }

/* .btn-wh (botón "primario": Ver, Generador de personaje, Nueva...) - la
   versión oscura es un bronce apagado con texto casi negro; sin retocarlo,
   se ve como una isla de modo oscuro sobre una página clara. En claro pasa
   a un dorado más luminoso ("latón al sol" en vez de "bronce viejo"). */
[data-theme="light"] .btn-wh {
  background: linear-gradient(180deg, #e0b040 0%, #c0922a 100%);
  color: #2b1d00;
  border-color: #8a6010;
}
[data-theme="light"] .btn-wh:hover,
[data-theme="light"] .btn-wh:focus {
  background: linear-gradient(180deg, #f0c860 0%, #d4a830 100%);
  color: #1a1100;
  border-color: var(--wh-gold-light);
  box-shadow: 0 0 10px rgba(212, 168, 48, 0.35);
}

/* Botones outline (Editar/Eliminar/Creación rápida/Exportar/Importar...) ya
   se leían bien, pero sobre una página casi blanca un simple contorno fino
   cuesta un poco de detectar como botón - un tinte de fondo muy sutil (no
   un relleno, eso ya lo hace `:hover`) ayuda a que se perciban como control
   interactivo de un vistazo. */
[data-theme="light"] .btn-outline-secondary { background-color: rgba(120, 90, 40, .05); }
[data-theme="light"] .btn-outline-warning   { background-color: rgba(224, 160, 32, .07); }
[data-theme="light"] .btn-outline-danger    { background-color: rgba(220, 53, 69, .05); }

/* Iconos pensados para fondo oscuro (invertidos con filter) - en claro basta
   con el color por defecto de Bootstrap, ya oscuro y legible de por sí. */
[data-theme="light"] .btn-close { filter: none; }
[data-theme="light"] .wh-accordion-btn::after { filter: none; }

/* Insignias de habilidades/talentos/enseres/profesión por tipo - cada una
   mantiene su matiz (verde/azul/ámbar/magenta/oliva/morado) pero invertida
   en luminancia para leerse sobre fondo claro. El BORDE es lo que más
   trabajo hace para que la insignia "salte a la vista" igual que en modo
   oscuro, así que va bastante más saturado que el típico tono pastel
   apagado - un borde demasiado suave es justo lo que se veía apagado en
   la primera versión de este tema. */
[data-theme="light"] .wh-badge-skill        { background: #d9f5db; border-color: #2fae48; color: #146428; }
[data-theme="light"] .wh-badge-skill-opt    { background: #d6ecfa; border-color: #2f8fc0; color: #0f4c6e; }
[data-theme="light"] .wh-badge-talent       { background: #faecc8; border-color: #c08a1a; color: #6b4a00; }
[data-theme="light"] .wh-badge-talent-opt   { background: #fadcec; border-color: #c0308a; color: #7a1050; }
[data-theme="light"] .wh-badge-trapping     { background: #f5f0c0; border-color: #a89b1a; color: #5c5410; }
[data-theme="light"] .wh-badge-prof         { background: #ecdafa; border-color: #8a30c0; color: #4a1080; }

/* Chips de permisos en la lista de plantillas: propio / heredado / denegado */
.perm-chip-own       { background: #0e2a10; border: 1px solid #266628; color: #8edaa0; font-weight: normal; }
.perm-chip-inherited { background: #0e1e2e; border: 1px solid #224466; color: #7ab4d4; font-weight: normal; }
.perm-chip-denied    { background: #2e0e0e; border: 1px solid #7a1010; color: #e89088; font-weight: normal; text-decoration: line-through; }
[data-theme="light"] .perm-chip-own       { background: #d9f5db; border-color: #2fae48; color: #146428; }
[data-theme="light"] .perm-chip-inherited { background: #d6ecfa; border-color: #2f8fc0; color: #0f4c6e; }
[data-theme="light"] .perm-chip-denied    { background: #fadcdc; border-color: #c03030; color: #7a1010; }

/* Niveles de carga (Fuerza+Resistencia) - misma progresión verde→amarillo→
   naranja→rojo, con el borde bien saturado (sobre todo "pesada", el nivel
   de alerta real). Las versiones "badge" (chip sólido) y el desbordamiento
   de Mochila/Saco se dejan igual en ambos temas a propósito - son chips
   saturados que ya aportan su propio contraste, sea cual sea el fondo. */
[data-theme="light"] .wh-carga-sin_carga { background: #d9f2da !important; color: #146428 !important; border-color: #2fae48 !important; }
[data-theme="light"] .wh-carga-ligera    { background: #fff3c0 !important; color: #6b5b0e !important; border-color: #d9b300 !important; }
[data-theme="light"] .wh-carga-media     { background: #ffe0b3 !important; color: #7a4a12 !important; border-color: #e08a20 !important; }
[data-theme="light"] .wh-carga-pesada    { background: #f8d7da !important; color: #842029 !important; border-color: #dc3545 !important; }

[data-theme="light"] .badge-wh-basic    { background: #d9f5db; border-color: #2fae48; color: #0f5820; }
[data-theme="light"] .badge-wh-advanced { background: #faecc8; border-color: #c08a1a; color: #5c3f00; }
[data-theme="light"] .wh-badge-prefix   { background: #d9f5db; border-color: #2fae48; color: #125822; }
[data-theme="light"] .wh-badge-hidden   { background: #c4540f; border-color: #8a3a08; color: #ffffff; }

/* Insignias Bootstrap (bg-secondary/info/success/warning/danger) */
[data-theme="light"] .badge.bg-secondary { background-color: #ece0c0 !important; }
[data-theme="light"] .badge.bg-info      { background-color: #d9f5db !important; color: #146428 !important; border-color: #2fae48 !important; }
[data-theme="light"] .badge.bg-success   { background-color: #d1f0d1 !important; color: #146428 !important; border-color: #2fae48 !important; }
[data-theme="light"] .badge.bg-warning   { background-color: #ffe9b3 !important; color: #6b4400 !important; border-color: #e0a020 !important; }
[data-theme="light"] .badge.bg-danger    { background-color: #f8d7da !important; color: #842029 !important; border-color: #dc3545 !important; }
[data-theme="light"] .badge.bg-warning.text-dark { color: #4a3000 !important; }

/* Alertas */
[data-theme="light"] .alert-warning { color: #6b4400; background-color: #ffe9b3; border-color: #e0a020; }
[data-theme="light"] .alert-danger  { color: #842029; background-color: #f8d7da; border-color: #dc3545; }
[data-theme="light"] .alert-info    { color: #0f5c5c; background-color: #d0f0f0; border-color: #2f9898; }
[data-theme="light"] .alert-success { color: #146428; background-color: #d1f0d1; border-color: #2fae48; }

/* Botones outline warning/danger - el de "Eliminar" en concreto necesita
   saltar a la vista tanto como en modo oscuro (donde un rojo intenso avisa
   del riesgo), no un tono lavado apenas perceptible. */
[data-theme="light"] .btn-outline-warning { color: #8a5c10 !important; border-color: #e0a020 !important; }
[data-theme="light"] .btn-outline-warning:hover {
  background-color: #fdf1d0 !important;
  color: var(--wh-gold-light) !important;
  border-color: var(--wh-gold) !important;
}
[data-theme="light"] .btn-outline-danger { color: #b02a37 !important; border-color: #dc3545 !important; }
[data-theme="light"] .btn-outline-danger:hover {
  background-color: #fbe0e2 !important;
  color: #842029 !important;
  border-color: #b02a37 !important;
}

/* Modificador de característica positivo - verde brillante ilegible sobre
   fondo claro, se oscurece manteniendo el matiz pero sin apagarlo. */
[data-theme="light"] .wh-stat-positive { color: #158a28 !important; }

/* ---- Contactos: panel expandible "Personajes con relación" ----
   El botón que lo abre pasa a look "pulsado" (mismo lenguaje visual que
   .wh-accordion-btn:not(.collapsed)), y el panel usa una paleta teal - la
   misma familia que .wh-navbar-prepro - para que quede inconfundible que
   son datos ajenos al catálogo de contactos (vínculos de otros personajes),
   no una fila más de la tabla. */
.wh-links-toggle {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 8px !important;
  transition: background-color .15s, color .15s, border-color .15s;
}
.wh-links-toggle[aria-expanded="true"] {
  background: #1f5866;
  color: #dff6fa !important;
  border-color: #2ab0c9;
  font-weight: 600;
  text-decoration: none;
}
.wh-links-panel {
  background: #0d2229;
  border: 1px solid #1f5866;
  /* Sin esto hereda el color de .card de Bootstrap (#212529), casi invisible
     sobre el fondo oscuro del panel (notas del personaje, 2026-10-09).
     --wh-text ya cambia con el tema: claro en oscuro, oscuro en claro. */
  color: var(--wh-text);
}
.wh-links-panel-header {
  background: linear-gradient(90deg, #0a1a20 0%, #0d2229 100%);
  border-bottom: 1px solid #1f5866;
  color: #6fd0e0;
  font-family: 'Cinzel', serif;
  font-size: .9rem;
  padding: .5rem .75rem;
}
.wh-links-table { color: var(--wh-text); }
.wh-links-table thead th {
  color: #6fd0e0;
  border-color: #1f5866;
  background: transparent;
}
.wh-links-table tbody td {
  background: #0d2229;
  border-color: #163944;
  color: var(--wh-text);
}
[data-theme="light"] .wh-links-toggle[aria-expanded="true"] {
  background: #cdeef4;
  color: #0a4a55 !important;
  border-color: #2ab0c9;
}
[data-theme="light"] .wh-links-panel { background: #e6f7fa; border-color: #7fd4e0; }
[data-theme="light"] .wh-links-panel-header {
  background: linear-gradient(90deg, #d3eff5 0%, #e6f7fa 100%);
  border-color: #7fd4e0;
  color: #0a5560;
}
[data-theme="light"] .wh-links-table thead th { color: #0a5560; border-color: #7fd4e0; }
[data-theme="light"] .wh-links-table tbody td { background: #e6f7fa; border-color: #c5e8ee; color: var(--wh-text); }

/* Cuadro de notas del vínculo (2026-10-11): crece con el texto (main.js)
   hasta este máximo; a partir de ahí, barra de desplazamiento. */
.wh-autogrow { resize: none; overflow-y: auto; max-height: 60vh; }
