body {
    background-color: #F9F5EE;
    font-family: 'Poppins', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
}

.landing-page h2,
.landing-page h3 {
    letter-spacing: -1px;
    line-height: 2;
}

.landing-page h1.hero-title {
    letter-spacing: -0.02em;
}

.landing-page p.hero-subtitle,
.landing-page p.hero-subtitle-secondary {
    letter-spacing: normal;
}

/* --- Display heading (mobile-first) --- */
.display-4 {
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    line-height: 1.5;
    color: black;
}

@media (min-width: 768px) {
    .display-4 {
        font-size: 3rem;
    }
}

.highlight-word {
    color: #0b6146;
}

.flex-auto {
    flex: 0 0 auto;
}

.h-250 {
    height: 250px;
}

@media (min-width: 768px) {
    .h-md-250 {
        height: 250px;
    }
}

/*
 * Blog posts
 */
.blog-post {
    margin-top: 20px;
    margin-bottom: 20px;
}

.blog-post-title {
    font-size: 2.5rem;
}

.blog-post-meta {
    margin-bottom: 1.25rem;
    color: #727272;
}

.text-accent {
    color: #09543C;
}

.hero-text {
    position: relative;
    z-index: 2;
}

.landing-image {
    width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 768px) {
    .hero-image-col .landing-image {
        margin-left: -10rem;
        width: 130%;
    }
}

/* --- Landing: Feature text (mobile-first) --- */
.feature-text {
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .feature-text {
        font-size: 1.7rem;
        margin-bottom: 2rem;
    }

    .feature-list li {
        margin-bottom: 1rem;
    }
}

/* --- Landing: CTA button (mobile-first) --- */
.landing-cta {
    font-family: 'Poppins', sans-serif;
    width: 75%;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .landing-cta {
        width: 50%;
        font-size: 1.75rem;
    }
}

/* --- Landing: Demo / Book showcase (mobile-first) --- */
.demo-section {
    background-color: #093d2c;
    padding: 2rem 0;
    margin-top: 1rem;
}

.demo-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    color: #F9F5EE;
    margin-bottom: 1.5rem;
}

.book-showcase {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.book-cover {
    width: 42%;
    max-width: 210px;
    height: auto;
    object-fit: contain;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.book-cover:hover {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .demo-section {
        padding: 4rem 0;
    }

    .demo-title {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    .book-showcase {
        flex-wrap: nowrap;
        gap: 2.5rem;
        margin-top: 2rem;
        padding: 0;
    }

    .book-cover {
        width: 210px;
        height: auto;
    }
}

/* --- Footer (mobile-first) --- */
.footer {
    background-color: #000000;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer__copyright {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    margin: 0;
}

.footer__links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer__link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.footer__link:hover {
    opacity: 0.8;
    color: white;
}

.footer__icon {
    width: 20px;
    height: 20px;
}

.footer__legal {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0.75rem 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer__legal-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer__legal-link:hover {
    color: white;
}

@media (min-width: 768px) {
    .footer__container {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
        text-align: left;
    }

    .footer__links {
        gap: 2rem;
    }
}

/* ===================================================
   SITE HEADER - public pages (base.html)
   =================================================== */

.site-header {
    background-color: #F9F5EE;
    padding: 0.75rem 0;
}

.site-header__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header__logo img {
    width: 140px;
    height: auto;
}

.site-header__lang {
    font-weight: 600;
    font-size: 0.85rem;
    color: #0b6146;
    letter-spacing: 0.5px;
}

.site-header__toggler {
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
}

.site-header__toggler:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.site-header__nav .nav-link {
    position: relative;
    color: black !important;
    transition: color 0.3s ease;
    padding: 0.5rem 1.25rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.site-header__nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: black;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.site-header__nav .nav-link:hover::after {
    width: 100%;
}

.site-header__nav .nav-link:hover {
    color: rgba(0, 0, 0, 0.8) !important;
}

.site-header__nav .nav-link.active::after {
    width: 100%;
}

.site-header .btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.site-header .dropdown-item {
    font-family: 'Poppins', sans-serif;
}

.site-header__mobile-menu {
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

.site-header__mobile-menu .nav {
    flex-direction: column;
}

.site-header__mobile-menu .nav-link {
    display: block;
    padding: 0.85rem 0.25rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    letter-spacing: -0.02em;
}

.site-header__mobile-menu .nav-item:last-child .nav-link {
    border-bottom: none;
}

.site-header__mobile-menu .nav-link:hover,
.site-header__mobile-menu .nav-link:active {
    color: #0b6146;
}

.site-header__mobile-auth {
    padding-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .site-header__container {
        padding: 0 2rem;
    }

    .site-header__logo img {
        width: 176px;
        margin-left: 3rem;
    }

    .site-header__nav {
        margin-left: auto;
        margin-right: 3rem;
        margin-top: 6px;
    }

    .site-header__nav .nav-link {
        font-size: 1.05rem;
        padding: 0.5rem 1.35rem;
    }

    .site-header .btn {
        font-size: 1.05rem;
    }
}

/* --- Login button (pill style) --- */
.btn-login {
    border: none;
    border-radius: 50px;
    color: white;
    padding: 0.4rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-color: #0b6146;
    white-space: nowrap;
}

.btn-login:hover {
    background-color: #094a37;
    color: white;
}

/* "Cerrar sesión" en páginas públicas con sesión en localStorage (base.html). */
.btn-login.btn-logout {
    background-color: #c62828;
}

.btn-login.btn-logout:hover {
    background-color: #a51f1f;
}

@media (min-width: 768px) {
    .btn-login {
        padding: 0.45rem 1.6rem;
        margin-right: 6rem;
    }
}

/* ===================================================
   APP HEADER - standalone pages (home, groups, etc.)
   =================================================== */

@media (max-width: 767.98px) {
    .app-header .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .app-header .app-nav-desktop {
        display: none !important;
    }

    .app-header .app-header__logo img {
        width: 140px;
    }

    .app-header__mobile-menu .nav {
        flex-direction: column;
    }

    .app-header__mobile-menu .nav-link {
        padding: 0.6rem 0;
    }

    .app-header__mobile-menu {
        padding: 0.5rem 0 0.75rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        margin-top: 0.5rem;
    }

    .home-container,
    .rg-container,
    .public-library-container,
    .rgd-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ===================================================
   LANDING: Hero section (mobile-first)
   =================================================== */

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 2.5rem;
    line-height: 1.1;
    color: #09543C;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 1.2rem;
    font-weight: 400;
}

.hero-subtitle-secondary {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 1.6rem;
    font-weight: 400;
}

.hero-cta {
    background-color: #0b6146;
    color: white;
    border-radius: 50px;
    padding: 0.85rem 2.25rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
    border: none;
}

.hero-cta:hover {
    background-color: #094a37;
    color: white;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
        line-height: 1.05;
        margin-bottom: 2.3rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
        margin-bottom: 1.8rem;
    }

    .hero-subtitle-secondary {
        font-size: 1.5rem;
        margin-bottom: 2.3rem;
    }
}

/* ===================================================
   LANDING: Hero fotográfico (flag LANDING_PHOTO_HERO)
   Look 2026-10-13: header flotante sobre la foto, título en dos tonos,
   dos CTAs apilados y una fila de tarjetas de beneficios.
   Mobile-first: foto 4:3 arriba (con el teléfono pisando el borde), copy
   debajo, CTAs a todo el ancho y tarjetas apiladas. Desktop: foto 16:10 a todo el ancho con la copy superpuesta
   sobre la zona luminosa de la izquierda y las tarjetas pisando el borde
   inferior de la foto.
   =================================================== */

/* --- Header flotante (solo con el hero fotográfico) --- */
body.has-photo-hero .site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: transparent;
    padding: 0.75rem 0;
}

body.has-photo-hero .site-header__container {
    padding: 0 0.75rem;
}

body.has-photo-hero .site-header__logo {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 0.55rem 1rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

body.has-photo-hero .site-header__actions {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 0.3rem 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

body.has-photo-hero .site-header__toggler {
    border: none;
    padding: 0.5rem;
    color: #1a1a1a;
}

@media (max-width: 767.98px) {
    body.has-photo-hero .site-header__actions .site-header__lang {
        display: none;
    }

    body.has-photo-hero .site-header__actions .btn-login {
        padding: 0.4rem 0.9rem;
        font-size: 0.9rem;
    }

    body.has-photo-hero .site-header__logo img {
        width: 128px;
    }
}

.site-header__mobile-lang {
    display: none;
}

@media (max-width: 767.98px) {
    body.has-photo-hero .site-header__mobile-lang {
        display: block;
        padding: 0.85rem 0.25rem 0.25rem;
        font-weight: 600;
        font-size: 0.9rem;
        color: #0b6146;
        letter-spacing: 0.5px;
        text-decoration: none;
    }
}

body.has-photo-hero .site-header__toggler svg {
    width: 26px;
    height: 26px;
}

body.has-photo-hero .site-header__mobile-menu {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    border-top: none;
    padding: 0.5rem 1rem 0.75rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* --- Hero --- */
.hero-photo {
    position: relative;
}

.hero-photo-media {
    position: relative;
    /* Mobile: la foto arranca debajo de las tarjetas del header (que si no
       tapan la cabeza) y se funde al crema por arriba. */
    padding-top: 3.25rem;
}

.hero-photo-media::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 7.5rem;
    background: linear-gradient(180deg, #F9F5EE 0%, #F9F5EE 42%, rgba(249, 245, 238, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-photo picture,
.hero-photo-img {
    display: block;
    width: 100%;
    height: auto;
}

/* Fundido al crema en el borde inferior de la foto (mobile) */
.hero-photo-media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 34%;
    background: linear-gradient(180deg, rgba(249, 245, 238, 0) 0%, rgba(249, 245, 238, 0.85) 70%, #F9F5EE 100%);
    pointer-events: none;
}

.hero-photo-phone {
    position: absolute;
    right: 3%;
    top: 25%; /* despegado del header flotante */
    width: 30%;
    aspect-ratio: 661 / 1308;
    background: var(--hero-phone-small, var(--hero-phone)) center / contain no-repeat;
    transform: rotate(5deg);
    transform-origin: center;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.32));
    z-index: 2;
}

.hero-photo-glow {
    display: none; /* mobile: el texto va debajo de la foto, sin resplandor */
}

.hero-photo-copy {
    padding: 1.4rem 1rem 0; /* deja pasar el borde inferior del teléfono */
}

.landing-page h1.hero-photo-title {
    font-weight: 700;
    font-size: 2.75rem;
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: #1a1a1a;
    margin-bottom: 0.9rem;
}

.hero-photo-title-accent {
    color: #0b6146;
}

.hero-photo-subtitle {
    font-size: 1.2rem;
    line-height: 1.4;
    color: #2a2a2a;
    margin-bottom: 1.4rem;
    max-width: 34rem;
}

.hero-photo .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
}

/* Línea de precio justo arriba de los botones del hero */
.hero-price-note {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #0b6146;
    margin: 0 0 0.6rem;
    letter-spacing: 0.01em;
}

.hero-photo .hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(11, 97, 70, 0.18);
}

.hero-photo .hero-cta--demo {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.55);
}

.hero-cta-arrow {
    font-size: 1.25em;
    line-height: 1;
    margin-top: -0.1em;
}

/* Tarjetas de beneficios */
.hero-benefits {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 1rem 2rem;
}

.hero-benefit {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: #fff;
    border-radius: 18px;
    padding: 0.9rem 1rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
}

.hero-benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e7f2ec;
    color: #0b6146;
    flex: none;
}

.hero-benefit-icon svg {
    width: 26px;
    height: 26px;
}

.hero-benefit-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    font-family: 'Poppins', sans-serif;
    line-height: 1.3;
}

.hero-benefit-text strong {
    font-size: 1.02rem;
    font-weight: 600;
    color: #1a1a1a;
}

.hero-benefit-text span {
    font-size: 0.9rem;
    color: #666;
}


.hero-benefits ~ .voice-preview-section {
    margin-top: 1rem;
}

@media (min-width: 768px) {
    body.has-photo-hero .site-header {
        padding: 1.25rem 0;
    }

    body.has-photo-hero .site-header__container {
        max-width: 1380px;
        padding: 0 2.5rem;
    }

    /* En desktop todo el header es UNA tarjeta blanca */
    body.has-photo-hero .site-header__container > .d-flex {
        background: rgba(255, 255, 255, 0.94);
        border-radius: 22px;
        padding: 0.55rem 1.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

    body.has-photo-hero .site-header__logo,
    body.has-photo-hero .site-header__actions {
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    body.has-photo-hero .site-header__logo img {
        margin-left: 0;
        width: 168px;
    }

    body.has-photo-hero .site-header__nav {
        margin-right: 1.5rem;
        margin-top: 0;
    }

    body.has-photo-hero .site-header__nav .nav-link {
        font-size: 1.02rem;
        font-weight: 500;
    }

    body.has-photo-hero .btn-login {
        margin-right: 0;
        margin-left: 0.5rem;
        padding: 0.6rem 1.9rem;
        font-weight: 600;
        border-radius: 999px;
    }

    /* La foto se muestra ENTERA (16:10 exacto, sin object-fit): el ancho es
       100vw y el alto sale de aspect-ratio. OJO: no combinar aspect-ratio
       con max-height — el browser pasa a derivar el ANCHO del alto
       clampeado y el hero queda angosto (bug del 2026-10-12). */
    .hero-photo {
        width: 100%;
        /* 16:10 del ancho, pero nunca más alto que la ventana: en monitores
           anchos (1800px+) el 16:10 superaba el viewport y la foto quedaba
           gigante con los beneficios bajo el fold. La foto se recorta con
           object-fit (centrada un poco hacia arriba para conservar la cara). */
        height: clamp(520px, 56vw, calc(90vh - 1rem));
        overflow: hidden;
        /* En monitores grandes la escena no escala sin límite: el hero se
           centra a 1440px máx. sobre el fondo crema. */
        max-width: 1440px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-photo-media,
    .hero-photo picture,
    .hero-photo-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .hero-photo-media {
        padding-top: 0;
    }

    .hero-photo-img {
        object-fit: cover;
        /* Encuadre sobre la escena (cara, laptop, café), no sobre la ventana. */
        object-position: 50% 55%;
    }

    .hero-photo-media::after {
        display: none;
    }

    /* Teléfono abajo a la derecha, levemente inclinado; el borde inferior
       lo tapa la fila de beneficios. */
    .hero-photo-phone {
        right: 8%;
        top: 30%;
        width: auto;
        height: 59%;
        background-image: var(--hero-phone);
        transform: rotate(7deg);
        filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.35));
    }

    /* Velo crema suave sobre el lado izquierdo para que el texto lea bien
       sobre la ventana luminosa. */
    .hero-photo-media::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg,
            rgba(249, 245, 238, 0.82) 0%,
            rgba(249, 245, 238, 0.55) 28%,
            rgba(249, 245, 238, 0.15) 46%,
            rgba(249, 245, 238, 0) 58%);
        pointer-events: none;
        z-index: 1;
    }

    .hero-photo-glow {
        display: block;
        position: absolute;
        left: 0;
        top: 8%;
        width: 56%;
        height: 80%;
        background: radial-gradient(ellipse 66% 60% at 32% 48%,
            rgba(255, 255, 255, 0.75) 0%,
            rgba(255, 255, 255, 0.45) 40%,
            rgba(255, 255, 255, 0) 76%);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        -webkit-mask-image: radial-gradient(ellipse 70% 64% at 32% 48%, #000 30%, transparent 76%);
        mask-image: radial-gradient(ellipse 70% 64% at 32% 48%, #000 30%, transparent 76%);
        pointer-events: none;
        z-index: 1;
    }

    .hero-photo-copy {
        position: absolute;
        inset: 0;
        z-index: 2;
        padding: min(12.5%, 22vh) 2.5rem 0 5.5%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .landing-page h1.hero-photo-title {
        font-size: 3.4rem;
        max-width: 560px;
        margin-bottom: 1rem;
    }

    .hero-photo-subtitle {
        font-size: 1.25rem;
        max-width: 30rem;
        margin-bottom: 1.6rem;
    }

    .hero-photo .hero-cta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .hero-photo .hero-cta {
        min-width: 17rem;
    }

    .hero-photo .hero-cta {
        padding: 0.9rem 2.2rem;
        font-size: 1.1rem;
    }

    .hero-benefits {
        flex-direction: row;
        gap: 0;
        max-width: 1380px;
        margin: -4.75rem auto 2.5rem;
        padding: 1.25rem 1.5rem;
        background: #fff;
        border-radius: 22px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
        left: 0;
        right: 0;
        width: calc(100% - 5rem);
    }

    .hero-benefit {
        flex: 1;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 0.4rem 1.5rem;
    }

    .hero-benefit + .hero-benefit {
        border-left: 1px solid rgba(0, 0, 0, 0.08);
    }

}

/* Tablet (768-1023): la foto es la 4:3, el hero más alto; header y
   beneficios compactos. */
@media (min-width: 768px) and (max-width: 1023.98px) {
    body.has-photo-hero .site-header__container {
        padding: 0 1.25rem;
    }

    body.has-photo-hero .site-header__container > .d-flex {
        padding: 0.45rem 1rem;
    }

    body.has-photo-hero .site-header__logo img {
        width: 132px;
    }

    body.has-photo-hero .site-header__nav {
        margin-right: 0.75rem;
    }

    body.has-photo-hero .site-header__nav .nav-link {
        font-size: 0.92rem;
        padding: 0.5rem 0.7rem;
    }

    body.has-photo-hero .btn-login {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }

    .hero-photo {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .hero-photo-phone {
        right: 4%;
        top: 24%;
        width: 25%;
        height: auto;
    }

    /* En 4:3 la cara queda más cerca del texto: velo más ancho. */
    .hero-photo-media::before {
        background: linear-gradient(90deg,
            rgba(249, 245, 238, 0.88) 0%,
            rgba(249, 245, 238, 0.7) 35%,
            rgba(249, 245, 238, 0.3) 58%,
            rgba(249, 245, 238, 0) 72%);
    }

    .hero-photo-copy {
        padding: 14% 1.5rem 0 4%;
    }

    .landing-page h1.hero-photo-title {
        font-size: 3rem;
        max-width: 480px;
    }

    .hero-photo-subtitle {
        font-size: 1.15rem;
        max-width: 26rem;
    }

    .hero-photo .hero-cta {
        padding: 0.8rem 1.6rem;
        font-size: 1rem;
    }

    .hero-benefits {
        flex-direction: column;
        gap: 0;
        margin-top: -3rem;
        width: calc(100% - 3rem);
        padding: 0.5rem 1.25rem;
    }

    .hero-benefit {
        padding: 0.75rem 0.5rem;
    }

    .hero-benefit + .hero-benefit {
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
}

/* Pantallas más anchas que el hero (1440px): la foto se funde con el fondo
   crema en los costados en vez de cortarse en seco. Solo la <picture>: el
   teléfono y el velo no se enmascaran. */
@media (min-width: 1500px) {
    .hero-photo picture {
        /* Derecha más gradual: la cocina tiene más contraste que la ventana. */
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 72%, rgba(0, 0, 0, 0.55) 86%, transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 72%, rgba(0, 0, 0, 0.55) 86%, transparent 100%);
    }
}

@media (min-width: 1200px) {
    body.has-photo-hero .site-header__container {
        padding: 0 3.5rem;
    }

    .hero-photo-copy {
        padding-top: min(11.5%, 20vh);
    }

    .landing-page h1.hero-photo-title {
        font-size: 4.4rem;
        max-width: 680px;
        margin-bottom: 1.2rem;
    }

    .hero-photo-subtitle {
        font-size: 1.45rem;
        max-width: 34rem;
        margin-bottom: 2rem;
    }

    .hero-photo .hero-cta {
        padding: 1rem 2.6rem;
        font-size: 1.2rem;
    }

    .hero-benefits {
        width: calc(100% - 7rem);
        padding: 1.5rem 2rem;
    }

    .hero-benefit-text strong {
        font-size: 1.1rem;
    }

    .hero-benefit-text span {
        font-size: 0.95rem;
    }
}

/* ===================================================
   LANDING: Voice preview section
   =================================================== */

.voice-preview-section {
    max-width: 1100px;
    margin: -2rem auto 0;
    padding: 0 1rem 2.5rem;
}

.voice-preview-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 0.3rem;
}

.voice-preview-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    color: #777;
    margin-bottom: 1.5rem;
}

.voice-preview-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.voice-preview-lang-box {
    flex: 0 0 280px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    background: white;
}

.voice-preview-lang-select {
    width: 100%;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #333;
    background: transparent;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
}

.voice-preview-voices-box {
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
}

.voice-preview-voice-select {
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    background: transparent;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
}

.vp-voice-play {
    display: flex;
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.vp-voice-play svg {
    display: block;
    margin-left: 1px;
}

.vp-voice-play.playing svg {
    margin-left: 0;
}

.vp-voice-play:hover {
    background-color: #0b6146;
    border-color: #0b6146;
    color: white;
}

.vp-voice-play.playing {
    background-color: #0b6146;
    border-color: #0b6146;
    color: white;
}

@media (max-width: 767.98px) {
    .voice-preview-row {
        flex-direction: column;
    }

    .voice-preview-lang-box {
        flex: none;
        width: 100%;
    }

    .voice-preview-title {
        font-size: 1.35rem;
    }
}

.landing-divider {
    border: none;
    border-top: 2.5px solid rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    max-width: 1100px;
}

/* ===================================================
   LANDING: Study groups section
   =================================================== */

.study-groups-section {
    padding: 0.75rem 0 1.5rem;
}

.study-groups-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: #09543C;
    margin-bottom: 0.75rem;
    text-align: left;
}

.study-groups-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
}

.study-groups-image img {
    width: 100%;
    max-width: 850px;
    height: auto;
    display: block;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .study-groups-section {
        padding: 0.75rem 0 2rem;
    }

    .study-groups-title {
        font-size: 2.5rem;
    }
}

/* ===================================================
   LANDING: Feature icons grid
   =================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

.feature-card {
    text-align: center;
}

.feature-card-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.75rem;
    color: #0b6146;
}

.feature-card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 0.4rem;
}

.feature-card-desc {
    font-family: 'Poppins', sans-serif;
    font-size: 1.0rem;
    color: #666;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 1.5rem 1rem 4rem;
    }

    .feature-card-title {
        font-size: 1.35rem;
    }
}

/* ==================== LIBRARY SORT BAR ==================== */
.library-sort-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.library-sort-label {
    font-size: 0.88rem;
    color: #666;
    margin: 0;
}

.library-sort-select {
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    color: #244137;
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
}

.library-sort-select:focus {
    outline: none;
    border-color: #0b6146;
}

.library-sort-dir {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    color: #244137;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.library-sort-dir:hover {
    border-color: #0b6146;
    background: #fafdfb;
}

@media (max-width: 600px) {
    .library-sort-bar {
        justify-content: flex-start;
    }

    .library-sort-select {
        flex: 1;
        min-width: 0;
    }
}

/* ==================== SHARED BOOK ROW LIST ====================
   Row-style library list used by home and reading group detail.
   Markup lives in templates/partials/book_row.html. Everything is scoped
   under .library-list so it can't clash with the page-local .book-card /
   .library-grid styles still defined inline in the templates. */

.library-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 3rem;
}

.library-list .book-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.15rem 1.4rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 0.5px 2px rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    position: relative;
    min-height: 88px;
    transition:
        box-shadow 0.2s cubic-bezier(0.4,0,0.2,1),
        transform 0.2s cubic-bezier(0.4,0,0.2,1),
        border-color 0.2s cubic-bezier(0.4,0,0.2,1),
        background 0.2s cubic-bezier(0.4,0,0.2,1);
}

.library-list .book-card:hover {
    box-shadow: 0 4px 16px rgba(11, 97, 70, 0.14), 0 1px 4px rgba(0,0,0,0.06);
    border-color: #0b6146;
    background: #fafdfb;
}

.library-list .book-row-number {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.library-list .book-row-play-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0b6146;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.15s;
    padding: 0;
}

.library-list .book-row-play-btn:hover {
    background: #094a37;
    transform: scale(1.08);
}

.library-list .book-row-play-btn svg {
    margin-left: 2px;
}

.library-list .book-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.library-list .book-row-title {
    font-size: 1.08rem;
    color: #244137;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Duration + pages as fixed-width columns (desktop); collapse under the
   title on narrow screens (see the 768px media query below). */
.library-list .book-row-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.library-list .book-row-duration,
.library-list .book-row-pages {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #888;
    line-height: 1;
    white-space: nowrap;
}

.library-list .book-row-duration {
    width: 108px;
}

.library-list .book-row-pages {
    width: 84px;
}

.library-list .book-row-duration svg,
.library-list .book-row-pages svg {
    flex-shrink: 0;
    color: #999;
}

.library-list .catalog-badge {
    display: inline-block;
    background-color: #e8f5e9;
    color: #0b6146;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.4rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
}

.library-list .book-row-progress {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.library-list .book-row-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    flex-wrap: wrap;
    column-gap: 0.5rem;
}

.library-list .book-row-progress-pct {
    color: #0b6146;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
}

.library-list .book-row-progress-info .time-remaining {
    margin-left: auto;
}

.library-list .progress-container {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.library-list .progress-bar {
    height: 100%;
    background-color: #0b6146;
    border-radius: 3px;
}

.library-list .time-remaining {
    color: #888;
    font-size: 0.82rem;
    white-space: nowrap;
    margin: 0;
    text-align: right;
}

.library-list .fake-progress-container {
    height: 5px;
    background-color: #e0e0e0;
    border-radius: 2.5px;
    overflow: hidden;
    width: 100%;
}

.library-list .fake-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0b6146 0%, #14a077 50%, #0b6146 100%);
    background-size: 200% 100%;
    animation: book-row-shimmer 2s ease-in-out infinite;
    border-radius: 2.5px;
    width: 100%;
}

@keyframes book-row-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.library-list .fake-progress-text {
    font-size: 0.78rem;
    color: #aaa;
    white-space: nowrap;
    text-align: right;
    font-style: italic;
}

.library-list .book-menu-container {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Ícono "compartir y desbloquear" junto a los 3 puntos (libros cortados). */
.library-list .book-row-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b6146;
}
.library-list .book-row-share-btn:hover {
    background-color: rgba(11, 97, 70, 0.1);
}

/* Estado del link de referido bajo el título. */
.library-list .book-row-ref {
    display: block;
    font-size: 0.78rem;
    color: #0b6146;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-list .book-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.library-list .book-menu-button:hover {
    background-color: rgba(0,0,0,0.06);
}

.library-list .book-menu-icon {
    width: 22px;
    height: 22px;
    color: #888;
}

.library-list .book-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 160px;
    overflow: hidden;
}

.library-list .book-menu-dropdown.show {
    display: block;
}

.library-list .book-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background-color 0.2s;
}

.library-list .book-menu-item:hover {
    background-color: #f5f5f5;
}

.library-list .book-menu-item.delete {
    color: #dc2626;
}

.library-list .book-menu-item.delete:hover {
    background-color: #fef2f2;
}

.library-list .book-menu-item-icon {
    width: 16px;
    height: 16px;
}

/* Processing state: grayed title, muted non-clickable play button */
.library-list .book-card.processing .book-row-title {
    color: #aaa;
}

.library-list .book-card.processing .book-row-play-btn {
    background: #a0c4b5;
    pointer-events: none;
}

/* Playing state */
.library-list .book-card.playing,
.library-list .book-card.playing:hover {
    transform: scale(1.012);
    box-shadow: 0 4px 18px rgba(11, 97, 70, 0.22), 0 1px 4px rgba(0,0,0,0.06);
    border: 2.5px solid #0b6146;
    background: #f0f8f5;
}

.library-list .book-card.playing .book-row-play-btn {
    box-shadow: 0 0 0 3px rgba(11, 97, 70, 0.2);
}

/* El transform de .playing crea un stacking context que atrapa al dropdown
   (z-index 100) dentro de la card: las hermanas posteriores en el DOM se
   pintaban encima del menú. Elevar la card completa lo saca adelante. */
.library-list .book-card.playing,
.library-list .book-card.playing:hover {
    z-index: 5;
}

/* Y ante cualquier otro stacking context futuro: la card con menú abierto
   siempre gana (101 > el z-index 100 del dropdown de una card vecina). */
.library-list .book-card:has(.book-menu-dropdown.show) {
    z-index: 101;
}

/* Fake-processing state (JS-driven right after an upload, see upload.js) */
.library-list .book-card.fake-processing {
    pointer-events: none;
    position: relative;
    opacity: 0.8;
}

.library-list .book-card.fake-processing::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
    border-radius: 12px;
}

/* Column headers above the first row. Geometry mirrors .book-card:
   horizontal padding = card padding (1.4rem) + card border (2px), same
   1rem gap and same fixed column widths. */
.library-list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 calc(1.4rem + 2px);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a958d;
}

.library-list-header .llh-num { width: 22px; flex-shrink: 0; }
.library-list-header .llh-play { width: 44px; flex-shrink: 0; }
.library-list-header .llh-title { flex: 1; min-width: 0; }
.library-list-header .llh-meta { display: flex; gap: 0.9rem; flex-shrink: 0; }
.library-list-header .llh-duration { width: 108px; }
.library-list-header .llh-pages { width: 84px; }
.library-list-header .llh-progress { width: 200px; flex-shrink: 0; }
.library-list-header .llh-menu { width: 35px; flex-shrink: 0; }

@media (max-width: 992px) {
    .library-list .book-row-progress,
    .library-list-header .llh-progress {
        width: 160px;
    }
}

/* Collapse to the stacked layout: duration/pages move under the title
   (CSS grid), headers disappear. Data hides progressively on very narrow
   screens rather than letting the layout break. */
@media (max-width: 768px) {
    .library-list-header {
        display: none;
    }

    .library-list .book-card {
        display: grid;
        grid-template-columns: 18px 38px minmax(0, 1fr) 110px auto;
        grid-template-areas:
            "num play info progress menu"
            "num play meta progress menu";
        column-gap: 0.7rem;
        row-gap: 0.25rem;
        align-items: center;
        padding: 0.9rem 1rem;
        min-height: 72px;
    }

    .library-list .book-row-number {
        grid-area: num;
        width: 18px;
        font-size: 0.8rem;
    }

    .library-list .book-row-play-btn {
        grid-area: play;
        width: 38px;
        height: 38px;
    }

    .library-list .book-row-play-btn svg {
        width: 16px;
        height: 16px;
    }

    .library-list .book-row-info {
        grid-area: info;
        align-self: end;
    }

    .library-list .book-row-title {
        font-size: 0.95rem;
    }

    .library-list .book-row-meta {
        grid-area: meta;
        align-self: start;
        gap: 0.7rem;
    }

    .library-list .book-row-duration,
    .library-list .book-row-pages {
        width: auto;
        font-size: 0.78rem;
    }

    .library-list .book-row-progress {
        grid-area: progress;
        width: auto;
    }

    .library-list .book-menu-container {
        grid-area: menu;
    }

    .library-list .time-remaining {
        font-size: 0.75rem;
    }

    .library-list .book-row-progress-pct {
        font-size: 0.78rem;
    }
}

/* Very narrow: drop the row number, the pages column and the "time left"
   label (the % stays), shrink the progress column so the title breathes */
@media (max-width: 430px) {
    .library-list .book-card {
        grid-template-columns: 38px minmax(0, 1fr) 88px auto;
        grid-template-areas:
            "play info progress menu"
            "play meta progress menu";
    }

    .library-list .book-row-number,
    .library-list .book-row-pages,
    .library-list .book-row-progress .time-remaining {
        display: none;
    }
}

/* Narrowest: keep play + title + progress + menu only, one line per row */
@media (max-width: 360px) {
    .library-list .book-card {
        grid-template-areas: "play info progress menu";
    }

    .library-list .book-row-meta {
        display: none;
    }

    .library-list .book-row-info {
        align-self: center;
    }
}

/* =========================================================================
   Panel de texto sincronizado (docs/plan_texto_sincronizado_oraciones.md,
   modo lectura: docs/plan_texto_modo_lectura_e_imagenes.md § A)
   Overlay a pantalla completa por encima de la biblioteca y por debajo del
   player (z-index 1000). Termina donde empieza el player: --player-h la
   escribe text_panel.js midiendo #audioPlayerContainer (ResizeObserver).
   ========================================================================= */
:root { --player-h: 0px; }

.text-panel {
    position: fixed;
    inset: 0;
    bottom: var(--player-h, 0px);
    background: #fffdf8;
    z-index: 999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
.text-panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}

/* Header sticky: título centrado + Cerrar bien visible a la derecha */
.text-panel-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #0b6146;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.text-panel-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.text-panel-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    background: white;
    color: #0b6146;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.text-panel-close:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.text-panel-close:focus-visible { outline: 3px solid rgba(255,255,255,0.7); outline-offset: 2px; }
.text-panel-close .tp-x { font-size: 1.25rem; line-height: 1; }

/* Cuerpo: columna de lectura centrada (máx. 720px), tipografía de libro */
.text-panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 36px max(24px, calc((100% - 720px) / 2)) 56px;
    font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2b2b2b;
    scroll-behavior: smooth;
}
.text-panel-body p { margin: 0 0 1.15em; }

/* Figuras del capítulo intercaladas en el texto (plan § D) */
.tp-fig {
    margin: 1.6em 0;
    padding: 0;
    text-align: center;
    cursor: zoom-in;
    border-radius: 10px;
}
.tp-fig:focus-visible { outline: 2px solid rgba(11, 97, 70, 0.5); outline-offset: 4px; }
.tp-fig img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    background: #f4f1ea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: opacity 0.25s ease;
}
.tp-fig figcaption {
    margin-top: 0.5em;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.82rem;
    color: #7a7a7a;
    letter-spacing: 0.02em;
}
/* placeholder con shimmer mientras carga: reserva alto para que el texto no salte */
.tp-fig.tp-fig-loading img {
    min-height: 180px;
    opacity: 0.6;
    background: linear-gradient(90deg, #eee8dc 25%, #f7f3ea 50%, #eee8dc 75%);
    background-size: 200% 100%;
    animation: tp-shimmer 1.2s infinite;
}
.tp-fig.tp-fig-error { display: none; }

/* Oración: estados futura / leída / sonando / sin audio */
.tp-s {
    border-radius: 4px;
    padding: 0.05em 0.12em;
    margin: -0.05em -0.12em;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.tp-s[data-start] { cursor: pointer; }
.tp-s[data-start]:hover { background-color: rgba(11, 97, 70, 0.07); }
.tp-s[data-start]:focus-visible { outline: 2px solid rgba(11, 97, 70, 0.5); outline-offset: 1px; }
.tp-s.done { color: #6b6b6b; }
.tp-s.active {
    background-color: rgba(11, 97, 70, 0.14);
    box-shadow: 0 0 0 3px rgba(11, 97, 70, 0.14);
    color: #111;
    font-weight: 500;
}
.tp-s.tp-missing {
    color: #a0a0a0;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    cursor: default;
}

/* Pill "volver a la lectura" (autoscroll suspendido y la activa fuera de vista) */
.text-panel-return {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: #0b6146;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.text-panel-return.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

/* Estados de carga / error */
.tp-note { color: #666; font-family: inherit; }
.tp-retry {
    background: #0b6146;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
}
.tp-skeleton span {
    display: block;
    height: 0.9em;
    margin: 0.9em 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%);
    background-size: 200% 100%;
    animation: tp-shimmer 1.2s infinite;
}
.tp-skeleton span:nth-child(2) { width: 92%; }
.tp-skeleton span:nth-child(3) { width: 70%; }
@keyframes tp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .text-panel, .tp-s, .text-panel-return, .text-panel-close { transition: none; }
    .text-panel-body { scroll-behavior: auto; }
    .tp-skeleton span { animation: none; }
    .tp-fig.tp-fig-loading img { animation: none; }
}

@media (max-width: 768px) {
    .text-panel-header { padding: 10px 14px; }
    .text-panel-close { min-height: 40px; padding: 0 14px; font-size: 0.95rem; }
    .text-panel-body { padding: 20px 16px 48px; font-size: 1.04rem; line-height: 1.75; }
    .tp-fig img { max-height: 60vh; }
    .tp-fig { margin: 1.3em 0; }
}
