/* ==========================================================================
   PALABRA VIVA — Hoja de estilos (rediseño editorial)
   --------------------------------------------------------------------------
   Lenguaje visual: IMPRESO CLÁSICO, no app. Como una Biblia de editorial
   fina: esquinas rectas (cero border-radius), filetes de 1px, dobles
   líneas, versalitas espaciadas, ornamentos tipográficos (✦), y oro usado
   como tinta —no como brillo—. Sin sombras difusas, sin gradientes, sin
   glow: la elegancia sale de la tipografía y las líneas.
   ========================================================================== */

:root {
    /* ======================================================================
       PALETA "ESTUDIO A LA LUZ DE UNA VELA" (tema oscuro por defecto)
       Estudio de color aplicado:
       - Base: índigo profundo DESATURADO (azul = serenidad/profundidad;
         al quitarle saturación deja de ser frío o "de app genérica").
       - Acento: miel/ámbar apagado (luz de vela = calidez, refugio,
         confianza — el contraste frío-cálido es el más agradable al ojo).
       - Texto: marfil cálido, nunca blanco puro (el blanco absoluto
         sobre oscuro produce fatiga y halo).
       - Nada de saturados puros ni negro #000: todo apagado y entonado.
       ====================================================================== */
    /* PALETA "REFUGIO EDITORIAL" (tema nocturno)
       Dirección: calma, privacidad, compañía. Verde salvia profundo como
       base (bosque de noche: confianza y refugio), acción en salvia clara,
       y el dorado RESERVADO solo para referencias y fragmentos bíblicos. */
    --pv-night:      #111815;   /* fondo: verde bosque nocturno */
    --pv-night-2:    #18221e;   /* superficies */
    --pv-night-3:    #1f2c26;   /* superficies elevadas */
    --pv-action:     #76b5a5;   /* acción principal (salvia clara) */
    --pv-gold:       #d3ad60;   /* SOLO referencias/fragmentos bíblicos */
    --pv-gold-dim:   #9a7f47;
    --pv-care:       #d09a9e;   /* cuidado/emoción (rosa apagado) */
    --pv-parchment:  #e8eee9;   /* texto destacado */
    --pv-ink:        #ccd6cf;   /* texto normal */
    --pv-muted:      #8ba095;   /* secundario */
    --pv-line:       #2d3b35;   /* bordes */
    --pv-line-gold:  #3d4f47;   /* bordes marcados */

    --pv-font-display: "Literata", Georgia, serif;   /* lectura larga */
    --pv-font-ui: "Inter", system-ui, -apple-system, sans-serif;
}

/* Transición suave al cambiar de tema (sin mareos: solo color y fondo) */
body, .pv-card, .pv-navbar, .pv-footer, .pv-chat-sidebar, .pv-chat-inputbar,
.pv-auth-card, .form-control, .pv-verse-card {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

/* ==========================================================================
   TEMA CLARO — "página de libro a la luz del día".
   Cómo funciona: mismo diseño editorial, pero remapeando las variables:
   la tinta nocturna pasa a papel crema, el texto claro a tinta sepia,
   y el oro se oscurece para mantener contraste legible sobre claro.
   Se activa con data-theme="light" en <html> (theme.js + botón navbar).
   ========================================================================== */
[data-theme="light"] {
    /* PALETA "REFUGIO EDITORIAL" (tema claro)
       Papel verdoso muy suave, superficies blancas, tinta verde-gris
       profunda, acción en verde bosque (confianza) y dorado solo para
       lo bíblico. Nada deslumbra; todo acompaña. */
    --pv-night:      #f6f7f4;   /* fondo papel verdoso */
    --pv-night-2:    #ffffff;   /* superficies */
    --pv-night-3:    #eef1ec;   /* superficies elevadas */
    --pv-action:     #2f6f62;   /* acción principal (verde bosque) */
    --pv-gold:       #b6852f;   /* referencias bíblicas */
    --pv-gold-dim:   #c9a765;
    --pv-care:       #9d646b;   /* cuidado/emoción */
    --pv-parchment:  #1f2b27;   /* texto destacado */
    --pv-ink:        #33403a;   /* texto normal */
    --pv-muted:      #6d7d75;   /* secundario */
    --pv-line:       #d8e0dc;
    --pv-line-gold:  #c4cfc8;
}

/* La cita «...» del chat usa un tono fijo: se adapta por tema */
[data-theme="light"] .pv-quote { color: #6b5416; }

/* ---------- Base: NADA redondeado, NADA con sombra difusa -------------- */
*, *::before, *::after { border-radius: 0 !important; box-shadow: none !important; }

body {
    background: var(--pv-night);
    color: var(--pv-ink);
    font-family: var(--pv-font-ui);
    font-size: .95rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

h1, h2, h3, .pv-display {
    font-family: var(--pv-font-display);
    color: var(--pv-parchment);
    font-weight: 500;
}

a { color: var(--pv-action); text-decoration: none; }
a:hover { color: var(--pv-parchment); }

::selection { background: var(--pv-action); color: var(--pv-night); }

/* Etiqueta editorial reutilizable: VERSALITAS espaciadas */
.pv-label {
    font-family: var(--pv-font-ui);
    font-size: .78rem;
    font-weight: 600;
    color: var(--pv-muted);
}

/* Ornamento tipográfico centrado:  ───── ✦ ─────  */
.pv-ornament {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--pv-gold);
    margin: 1.5rem auto;
    max-width: 280px;
}
.pv-ornament::before, .pv-ornament::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--pv-line-gold);
}

/* ---------- Navbar: cabecera de periódico -------------------------------- */
.pv-navbar {
    background: var(--pv-night);
    border-bottom: 1px solid var(--pv-line-gold);
}

.pv-brand {
    font-family: var(--pv-font-display);
    font-size: 1.45rem;
    letter-spacing: .04em;
    color: var(--pv-parchment) !important;
}

.pv-brand .pv-flame { color: var(--pv-action); }
.pv-brand-accent { color: var(--pv-action); }

/* --- Menú de cuenta (avatar con inicial, estilo Claude/ChatGPT) --------- */
.pv-avatar {
    width: 2.2rem; height: 2.2rem;
    background: var(--pv-night-3);
    border: 1px solid var(--pv-line-gold);
    color: var(--pv-gold);
    font-family: var(--pv-font-display);
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.pv-avatar:hover { border-color: var(--pv-action); }
.pv-avatar.dropdown-toggle::after { display: none; } /* sin la flechita de Bootstrap */

.pv-dropdown {
    background: var(--pv-night-2);
    border: 1px solid var(--pv-line-gold);
    padding: .4rem 0;
    min-width: 220px;
}
.pv-dropdown .dropdown-item {
    color: var(--pv-ink);
    font-size: .85rem;
    padding: .55rem 1rem;
}
.pv-dropdown .dropdown-item:hover { background: var(--pv-night-3); color: var(--pv-action); }
.pv-dropdown .dropdown-divider { border-color: var(--pv-line); opacity: 1; }

.pv-dropdown-header { padding: .5rem 1rem .4rem; }
.pv-dropdown-name { font-family: var(--pv-font-display); font-size: 1.05rem; color: var(--pv-parchment); }
.pv-dropdown-mail { font-size: .72rem; color: var(--pv-muted); }

.navbar-nav .nav-link {
    font-size: .88rem;
    font-weight: 500;
    color: var(--pv-muted);
}
.navbar-nav .nav-link:hover { color: var(--pv-action); }

/* Selector de idioma ES · EN */
.pv-lang { font-size: .75rem; letter-spacing: .1em; color: var(--pv-muted); }
.pv-lang a { color: var(--pv-muted); }
.pv-lang a.active { color: var(--pv-action); border-bottom: 1px solid var(--pv-action); }
.pv-lang a:hover { color: var(--pv-gold); }

/* Botón de tema claro/oscuro (☾ / ☀) */
.pv-theme-btn {
    background: transparent;
    border: 1px solid var(--pv-line);
    color: var(--pv-muted);
    width: 2.1rem; height: 2.1rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.pv-theme-btn:hover { color: var(--pv-action); border-color: var(--pv-action); }

/* ---------- Botones: rectangulares, tipo papelería fina ------------------ */
.btn-gold, .btn-ghost {
    font-family: var(--pv-font-ui);
    font-size: .88rem;
    font-weight: 600;
    padding: .65rem 1.5rem;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn-gold {
    background: transparent;
    border: 1px solid var(--pv-action);
    color: var(--pv-action);
}
.btn-gold:hover:not(:disabled) {
    background: var(--pv-action);   /* hover: se invierte, con calma */
    color: var(--pv-night);
    border-color: var(--pv-action);
}
.btn-gold:disabled { border-color: var(--pv-line); color: var(--pv-muted); background: transparent; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--pv-line);
    color: var(--pv-muted);
}
.btn-ghost:hover { border-color: var(--pv-action); color: var(--pv-action); background: transparent; }

/* ---------- Superficies: filete + doble línea superior ------------------- */
.pv-card {
    background: var(--pv-night-2);
    border: 1px solid var(--pv-line);
    border-top: 3px double var(--pv-gold-dim);   /* firma editorial */
    padding: .25rem;
}

/* ---------- Hero (portada): portada de libro ----------------------------- */
.pv-hero { padding: 5.5rem 0 2.5rem; text-align: center; }

.pv-hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 500;
    letter-spacing: .01em;
}
.pv-hero h1 em { font-style: italic; color: var(--pv-gold); }

.pv-hero .lead {
    color: var(--pv-muted);
    max-width: 620px;
    margin: 1.25rem auto 2rem;
    font-size: 1rem;
    line-height: 1.8;
}

/* Los rayos SVG ya no se usan (quedó el bloque por compatibilidad) */
.pv-rays { display: none; }

/* Versículo del día: enmarcado como lámina, doble filete ------------------ */
.pv-verse-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 2.75rem 2.5rem;
    background: var(--pv-night-2);
    border: 1px solid var(--pv-line-gold);
    outline: 1px solid var(--pv-line-gold);
    outline-offset: 5px;             /* marco doble clásico de imprenta */
    position: relative;
}

.pv-verse-card::before {
    /* pequeño ornamento superior en lugar de la comilla gigante */
    content: "·";
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pv-night);
    padding: 0 .75rem;
    color: var(--pv-gold);
    font-size: .9rem;
}

.pv-verse-text {
    font-family: var(--pv-font-display);
    font-size: 1.55rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--pv-parchment);
}

.pv-verse-ref {
    font-size: .7rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--pv-gold);
    margin-top: 1.25rem;
}

/* ---------- Formularios (login / registro): ficha de registro civil ------ */
.pv-auth-card {
    max-width: 440px;
    margin: 4rem auto;
    padding: 2.5rem 2.25rem;
    background: var(--pv-night-2);
    border: 1px solid var(--pv-line);
    border-top: 3px double var(--pv-gold-dim);
}

.pv-auth-card .form-control {
    background: var(--pv-night);
    border: none;
    border-bottom: 1px solid var(--pv-line);   /* subrayado, como formulario impreso */
    color: var(--pv-ink);
    padding: .7rem .75rem;
}

.pv-auth-card .form-control:focus {
    border-bottom-color: var(--pv-gold);
    background: var(--pv-night);
    color: var(--pv-ink);
    outline: none;
}

.pv-auth-card label {
    font-size: .7rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--pv-muted);
}

/* ---------- Lector bíblico: índice de libro clásico ----------------------- */
.pv-testament-title {
    font-family: var(--pv-font-ui);
    font-size: .72rem;
    font-weight: 600;
    color: var(--pv-muted);
    border-bottom: 3px double var(--pv-line-gold);
    padding-bottom: .6rem;
    margin: 2rem 0 1rem;
}

.pv-book-link {
    display: block;
    padding: .45rem .25rem;
    color: var(--pv-ink);
    font-family: var(--pv-font-display);
    font-size: 1.05rem;
    border-bottom: 1px dotted var(--pv-line);  /* línea de índice/tabla de contenido */
}
.pv-book-link:hover { color: var(--pv-gold); border-bottom-color: var(--pv-gold-dim); }

/* Capítulos: casillas cuadradas, numeración de imprenta */
.pv-chapter-grid { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--pv-line); border-left: 1px solid var(--pv-line); max-width: 46rem; }

.pv-chapter-pill {
    width: 3.1rem; height: 3.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-right: 1px solid var(--pv-line);
    border-bottom: 1px solid var(--pv-line);
    color: var(--pv-parchment);
    font-family: var(--pv-font-display);
    font-size: 1.05rem;
}
.pv-chapter-pill:hover { background: var(--pv-action); color: var(--pv-night); }

/* ---------- Lector de capítulo: página de libro interactiva -------------- */

/* Barra de lectura fija (arriba): navegar sin perder el hilo */
.pv-reader-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--pv-night);
    border-bottom: 1px solid var(--pv-line-gold);
    padding: .55rem 0;
}

.pv-reader-nav {
    font-size: .72rem;
        color: var(--pv-muted);
    white-space: nowrap;
}
.pv-reader-nav:hover { color: var(--pv-gold); }

.pv-reader-title {
    font-family: var(--pv-font-display);
    font-size: 1.1rem;
    color: var(--pv-parchment);
}

.pv-chapter-select {
    background: var(--pv-night);
    color: var(--pv-gold);
    border: 1px solid var(--pv-line);
    font-family: var(--pv-font-ui);
    font-size: .85rem;
    padding: .2rem .5rem;
    cursor: pointer;
}
.pv-chapter-select:focus { border-color: var(--pv-gold); outline: none; }

/* El texto: columna de lectura cómoda */
.pv-scripture {
    font-family: var(--pv-font-display);
    color: var(--pv-parchment);
    max-width: 42rem;
    margin: 0 auto;
}

/* Cada versículo es un bloque clicable con número colgante a la izquierda */
.pv-verse {
    position: relative;
    font-size: 1.3rem;
    line-height: 1.85;
    margin: 0 0 .35rem;
    padding: .35rem 1rem .35rem 3.2rem;
    cursor: pointer;
    scroll-margin-top: 5rem;   /* que la barra fija no tape el ancla #v5 */
    transition: background .12s ease;
}
.pv-verse:hover { background: var(--pv-night-2); }

/* Seleccionado (click) o llegando por link directo (#v5): resaltado */
.pv-verse.selected, .pv-verse:target {
    background: var(--pv-night-3);
    border-left: 2px solid var(--pv-gold);
    padding-left: calc(3.2rem - 2px);
}

/* Número colgante en el margen, como Biblia de estudio */
.pv-verse-num {
    position: absolute;
    left: .5rem;
    top: .55rem;
    width: 2.2rem;
    text-align: right;
    font-family: var(--pv-font-ui);
    font-size: .72rem;
    color: var(--pv-gold-dim);
}
.pv-verse-num:hover { color: var(--pv-gold); }

/* Capitular dorada en el primer versículo del capítulo */
.pv-verse:first-of-type .pv-verse-body::first-letter {
    font-size: 3em;
    float: left;
    line-height: .85;
    padding-right: .1em;
    color: var(--pv-gold);
}

/* Barra de acciones del versículo (copiar / link / compartir) */
.pv-verse-actions {
    max-width: 42rem;
    margin: .25rem auto .9rem;
    padding-left: 3.2rem;
    display: flex;
    gap: .5rem;
}

.pv-verse-actions button {
    background: transparent;
    border: 1px solid var(--pv-line);
    color: var(--pv-muted);
    font-family: var(--pv-font-ui);
    font-size: .7rem;
        padding: .4rem .9rem;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.pv-verse-actions button:hover { border-color: var(--pv-action); color: var(--pv-action); }

/* --- SUBRAYADOS de colores (persistidos en el navegador) ------------------
   Funcionan en ambos temas: fondos translúcidos sobre el texto.
   !important a propósito: el subrayado debe verse SIEMPRE, incluso cuando
   el versículo está seleccionado/:target/hover (esas reglas pintan su
   propio fondo y taparían el color — era el bug de "no funciona"). */
.pv-hl-gold  { background: rgba(201, 169, 97, .22) !important; }
.pv-hl-olive { background: rgba(133, 153, 92, .25) !important; }
.pv-hl-rose  { background: rgba(198, 106, 106, .22) !important; }
.pv-hl-blue  { background: rgba(100, 133, 186, .25) !important; }

/* Paleta de colores en la barra de acciones */
.pv-swatches { display: inline-flex; gap: .35rem; margin-left: .5rem; align-items: center; }

.pv-swatch {
    width: 1.5rem; height: 1.5rem;
    border: 1px solid var(--pv-line);
    cursor: pointer;
    padding: 0;
}
.pv-swatch:hover { border-color: var(--pv-gold); }
.pv-swatch-gold  { background: rgba(201, 169, 97, .55); }
.pv-swatch-olive { background: rgba(133, 153, 92, .55); }
.pv-swatch-rose  { background: rgba(198, 106, 106, .55); }
.pv-swatch-blue  { background: rgba(100, 133, 186, .55); }
.pv-swatch-none  { background: transparent; color: var(--pv-muted); font-size: .9rem; line-height: 1; }

/* Cierre del capítulo: seguir leyendo */
.pv-reader-footer {
    max-width: 42rem;
    margin: 3rem auto 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 3px double var(--pv-line-gold);
    padding-top: 1.5rem;
}

/* ---------- Chat: diálogo de libro impreso, no burbujas ------------------- */
/* 100dvh: altura real en móviles (la barra del navegador no rompe el layout) */
.pv-chat-wrap { display: flex; height: calc(100dvh - 62px); }

.pv-chat-sidebar {
    width: 300px;
    background: var(--pv-night-2);
    border-right: 1px solid var(--pv-line);
    overflow-y: auto;
    padding: 1.25rem 1rem;
}

.pv-thread {
    display: block;
    padding: .6rem .5rem;
    color: var(--pv-muted);
    font-size: .9rem;
    border-bottom: 1px dotted var(--pv-line);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-thread:hover { color: var(--pv-gold); }
.pv-thread.active { color: var(--pv-parchment); border-left: 2px solid var(--pv-gold); padding-left: .75rem; }

.pv-chat-main { flex: 1; display: flex; flex-direction: column; }

.pv-chat-messages { flex: 1; overflow-y: auto; padding: 2.5rem 1.25rem; }

/* Cada intervención es un BLOQUE editorial con su etiqueta de hablante,
   no una burbuja. La Palabra lleva filete dorado; el usuario, neutro. */
.pv-msg { max-width: 44rem; margin: 0 auto 1.75rem; display: block; }

.pv-msg-bubble { padding: 0 0 0 1.25rem; line-height: 1.75; }

.pv-msg-bubble::before {
    display: block;
    font-size: .65rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    margin-bottom: .5rem;
    font-family: var(--pv-font-ui);
}

.pv-msg-user .pv-msg-bubble {
    border-left: 1px solid var(--pv-line);
    color: var(--pv-ink);
}
.pv-msg-user .pv-msg-bubble::before { content: "Tú"; color: var(--pv-muted); }

.pv-msg-assistant .pv-msg-bubble {
    border-left: 2px solid var(--pv-gold);
    font-family: var(--pv-font-display);
    font-size: 1.14rem;
    line-height: 1.85;
    color: var(--pv-parchment);
}
.pv-msg-assistant .pv-msg-bubble::before { content: "BibleComfort"; color: var(--pv-action); }

/* El usuario escribe texto plano: respetar sus saltos de línea */
.pv-msg-user .pv-msg-bubble { white-space: pre-wrap; }

/* --- Formato enriquecido de los mensajes de la IA (via chat.js) --- */

/* Párrafos con aire entre ideas */
.pv-msg-assistant .pv-msg-bubble p { margin: 0 0 1rem; }
.pv-msg-assistant .pv-msg-bubble p:last-child { margin-bottom: 0; }

/* Bloque de versículo citado: sangrado con doble filete dorado */
.pv-msg-assistant .pv-msg-bubble .pv-verse-block {
    border-left: 3px double var(--pv-gold-dim);
    padding: .35rem 0 .35rem 1.1rem;
    margin: 1.1rem 0;
}

/* La cita «...» en sí: tono papel cálido, cursiva */
.pv-quote { color: #e8d5a3; font-style: italic; }

/* Referencia bíblica linkeada: dorada con subrayado punteado;
   lleva al versículo exacto en el lector */
.pv-ref {
    color: var(--pv-gold);
    border-bottom: 1px dotted var(--pv-gold-dim);
    white-space: nowrap;
    font-family: var(--pv-font-ui);
    font-size: .82em;
    letter-spacing: .06em;
}
.pv-ref:hover { color: var(--pv-parchment); border-bottom-color: var(--pv-gold); }

/* Resaltado de ideas clave (las **negritas** del modelo) */
.pv-msg-assistant .pv-msg-bubble strong {
    color: var(--pv-gold);
    font-weight: 600;
}

.pv-msg-assistant .pv-msg-bubble em { color: var(--pv-parchment); }

/* --- "Pensando": tres ✦ que laten en secuencia (editorial, sin spinners) */
.pv-thinking span {
    color: var(--pv-gold);
    animation: pv-pulse 1.2s ease-in-out infinite;
    display: inline-block;
    margin-right: .4rem;
}
.pv-thinking span:nth-child(2) { animation-delay: .2s; }
.pv-thinking span:nth-child(3) { animation-delay: .4s; }

@keyframes pv-pulse {
    0%, 100% { opacity: .15; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

/* Cursor de escritura (typewriter) */
.pv-caret {
    color: var(--pv-gold);
    animation: pv-blink 1s step-end infinite;
    font-family: var(--pv-font-ui);
}
@keyframes pv-blink { 50% { opacity: 0; } }

/* Botón ☰ del sidebar en móvil */
.pv-sidebar-toggle {
    position: fixed;
    top: 72px;
    left: .6rem;
    z-index: 45;
    background: var(--pv-night-2);
    border: 1px solid var(--pv-line-gold);
    color: var(--pv-gold);
    width: 2.4rem; height: 2.4rem;
    cursor: pointer;
}

/* Barra de entrada: escritorio de trabajo, línea superior fina */
.pv-chat-inputbar {
    border-top: 1px solid var(--pv-line-gold);
    padding: 1.1rem 1.25rem;
    background: var(--pv-night-2);
}

.pv-chat-inputbar .form-control {
    background: var(--pv-night);
    border: none;
    border-bottom: 1px solid var(--pv-line);
    color: var(--pv-ink);
    padding: .75rem .5rem;
}
.pv-chat-inputbar .form-control:focus {
    border-bottom-color: var(--pv-gold);
    background: var(--pv-night);
    outline: none;
}

/* ---------- Bootstrap: aplacar sus redondeos/sombras restantes ----------- */
.alert { border: 1px solid var(--pv-line); border-left: 3px solid currentColor; background: var(--pv-night-2); }
.breadcrumb { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.input-group .form-control { background: var(--pv-night); border: 1px solid var(--pv-line); color: var(--pv-ink); }
.input-group .form-control:focus { border-color: var(--pv-gold); }

/* ---------- Footer: colofón editorial de 3 columnas ---------------------- */
.pv-footer {
    border-top: 3px double var(--pv-line-gold);
    color: var(--pv-muted);
    font-size: .82rem;
    line-height: 1.7;
    padding: 2.5rem 0 1.25rem;
    margin-top: 4rem;
    background: var(--pv-night-2);
}

.pv-footer .pv-brand { font-size: 1.2rem; }

.pv-footer-links { list-style: none; padding: 0; margin: 0; }
.pv-footer-links li { padding: .15rem 0; }
.pv-footer-links a { color: var(--pv-muted); }
.pv-footer-links a:hover { color: var(--pv-gold); }

.pv-footer-bottom {
    border-top: 1px solid var(--pv-line);
    margin-top: 1.75rem;
    padding-top: 1rem;
    text-align: center;
    font-family: var(--pv-font-display);
    font-style: italic;
    font-size: .95rem;
}

/* Aviso bajo el input del chat */
.pv-chat-disclaimer {
    max-width: 46rem;
    margin: .5rem auto 0;
    text-align: center;
    font-size: .68rem;
    color: var(--pv-muted);
}

/* ---------- Páginas legales ------------------------------------------------ */
.pv-legal h2 {
    font-size: 1.15rem;
    margin: 2rem 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--pv-line);
}
.pv-legal p, .pv-legal li { color: var(--pv-ink); line-height: 1.8; font-size: .92rem; }
.pv-legal strong { color: var(--pv-parchment); }
.pv-legal ul { padding-left: 1.25rem; }

/* ---------- Panel de admin -------------------------------------------------- */
.pv-admin-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    border: 1px solid var(--pv-line);
}
.pv-admin-nav a {
    padding: .6rem 1.4rem;
    font-size: .75rem;
        color: var(--pv-muted);
    border-right: 1px solid var(--pv-line);
}
.pv-admin-nav a:last-child { border-right: none; }
.pv-admin-nav a.active { color: var(--pv-action); background: var(--pv-night-2); }
.pv-admin-nav a:hover { color: var(--pv-action); }

.pv-admin-num {
    font-family: var(--pv-font-display);
    font-size: 1.9rem;
    color: var(--pv-gold);
}

.pv-admin-table { --bs-table-bg: transparent; color: var(--pv-ink); font-size: .84rem; }
.pv-admin-table th {
    font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
    color: var(--pv-muted); border-color: var(--pv-line-gold) !important;
}
.pv-admin-table td { border-color: var(--pv-line) !important; color: var(--pv-ink); }

.form-select.pv-admin-input, .pv-card .form-control, .pv-card .form-select {
    background: var(--pv-night);
    border: 1px solid var(--pv-line);
    color: var(--pv-ink);
}
.pv-card .form-control:focus, .pv-card .form-select:focus { border-color: var(--pv-gold); }

/* ---------- Responsive ------------------------------------------------------ */
@media (max-width: 768px) {
    /* CHAT móvil: el sidebar se convierte en panel deslizante (botón ☰) */
    .pv-chat-sidebar {
        display: none;
        position: fixed;
        top: 62px; bottom: 0; left: 0;
        width: min(85vw, 320px);
        z-index: 40;
        border-right: 1px solid var(--pv-line-gold);
    }
    .pv-chat-sidebar.open { display: block; }
    .pv-chat-messages { padding: 1.25rem .9rem 1.25rem 3.4rem; } /* aire para el ☰ */
    .pv-msg-assistant .pv-msg-bubble { font-size: 1.08rem; }

    /* Portada y lector */
    .pv-hero { padding: 3rem 0 2rem; }
    .pv-hero h1 { font-size: 2.4rem; }
    .pv-verse-card { padding: 2rem 1.25rem; }
    .pv-verse-text { font-size: 1.25rem; }
    .pv-verse { font-size: 1.15rem; padding-left: 2.6rem; }
    .pv-verse.selected, .pv-verse:target { padding-left: calc(2.6rem - 2px); }
    .pv-verse-num { width: 1.8rem; left: .3rem; }
    .pv-verse-actions { padding-left: 2.6rem; flex-wrap: wrap; row-gap: .5rem; }
    .pv-reader-footer { flex-direction: column; }
    .pv-reader-bar .pv-reader-nav { font-size: .65rem; }

    /* Formularios y tarjetas cómodos en pantalla chica */
    .pv-auth-card { margin: 2rem auto; padding: 1.75rem 1.25rem; }
    .pv-chapter-pill { width: 2.8rem; height: 2.8rem; }

    /* Inputs: 16px mínimo para que iOS no haga zoom al enfocar */
    .form-control, .pv-chat-inputbar .form-control { font-size: 16px; }
}

/* Pantallas muy chicas: compactar la navbar */
@media (max-width: 400px) {
    .pv-brand { font-size: 1.2rem; }
    .pv-hero h1 { font-size: 2rem; }
}


/* ---------- Compositor del chat: textarea que crece 2-8 líneas ---------- */
.pv-chat-inputbar textarea.form-control {
    resize: none;
    overflow-y: auto;
    min-height: 3rem;
    max-height: 12rem;
    line-height: 1.5;
}

/* ---------- Banner fino de apoyo (descartable) --------------------------- */
.pv-banner {
    background: var(--pv-night-3);
    border-bottom: 1px solid var(--pv-line);
    font-size: .8rem;
    color: var(--pv-muted);
    padding: .45rem 0;
}
.pv-banner a { color: var(--pv-action); }
.pv-banner button {
    background: none; border: none; color: var(--pv-muted);
    cursor: pointer; padding: 0 .5rem; font-size: 1rem; line-height: 1;
}

/* ---------- Chips de temas en la portada --------------------------------- */
.pv-topics { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.pv-topic {
    border: 1px solid var(--pv-line);
    background: var(--pv-night-2);
    color: var(--pv-ink);
    padding: .55rem 1.1rem;
    font-size: .88rem;
}
.pv-topic:hover { border-color: var(--pv-action); color: var(--pv-action); }

/* ---------- Accesibilidad: respetar la preferencia de menos movimiento --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
