.livre-page .book-free-box {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.free-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .08em;
    white-space: nowrap;
}

.book-pdf-section {
    padding-top: 10px;
}

.book-pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.book-pdf-viewer {
    width: 100%;
    height: min(900px, 80vh);
    background: #f4f4f4;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.book-pdf-viewer iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.comments-section {
    margin-top: 40px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 24px 0 40px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-small);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.comment-form .field {
    width: 100%;
    min-width: 0;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.comment-form textarea {
    min-height: 140px;
    resize: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    min-width: 0;
}

.comment-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-small);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.comment-avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
}

.comment-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.comment-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    min-width: 0;
}

.comment-head strong {
    font-size: 1.02rem;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-date {
    color: var(--muted);
    font-size: .82rem;
    white-space: nowrap;
}

.comment-body {
    color: var(--ink);
    font-size: .96rem;
    line-height: 1.65;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.comment-body * {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pagination-wrap {
    margin-top: 32px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.no-comments {
    padding: 32px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.no-comments p {
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.no-comments span {
    color: var(--muted);
    font-size: .92rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .grid-2 {
    align-items: start;
    min-width: 0;
}

.livre-page .grid-2 > * {
    min-width: 0;
    max-width: 100%;
}

.livre-page .grid-2 p,
.livre-page .grid-2 h1,
.livre-page .grid-2 h2,
.livre-page .grid-2 h3,
.livre-page .grid-2 span,
.livre-page .grid-2 a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .cover-img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    display: block;
}

.livre-page .book-cover {
    width: 100%;
    min-height: 420px;
    border-radius: var(--book-radius);
    box-sizing: border-box;
    overflow: hidden;
}

.livre-page .book-cover strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .book-cover span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .purchase {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 100%;
}

.livre-page .purchase select {
    min-width: 240px;
    max-width: 100%;
    box-sizing: border-box;
}

.livre-page .purchase .btn {
    flex-shrink: 0;
}

.livre-page .card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.livre-page .card h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .meta-block {
    width: 100%;
    min-width: 0;
}

.livre-page .meta-block > div {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .meta-block b {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .quote {
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.livre-page .lead {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.livre-page .page-wrap {
    width: 100%;
    min-width: 0;
}

.livre-page .container {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .livre-page .grid-2 {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .livre-page .cover-img {
        max-height: none;
    }

    .livre-page .grid-2 > * {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .book-pdf-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .book-pdf-header > * {
        max-width: 100%;
    }

    .book-pdf-viewer {
        height: 75vh;
    }

    .livre-page .book-free-box {
        flex-direction: column;
        align-items: stretch;
    }

    .livre-page .book-free-box .btn {
        width: 100%;
        box-sizing: border-box;
    }

    .comment-form {
        padding: 22px;
    }

    .comment-card {
        flex-direction: column;
        gap: 12px;
        padding: 18px;
    }

    .comment-avatar {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .comment-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .comment-date {
        white-space: normal;
    }

    .livre-page .purchase {
        flex-direction: column;
        align-items: stretch;
    }

    .livre-page .purchase select,
    .livre-page .purchase .btn {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .livre-page .book-cover {
        min-height: 340px;
        padding: 26px;
    }

    .livre-page .book-cover strong {
        font-size: 1.6rem;
    }

    .book-pdf-viewer {
        height: 70vh;
        border-radius: 12px;
    }

    .comment-form {
        padding: 18px;
        border-radius: 20px;
    }

    .comment-card {
        padding: 16px;
        border-radius: 16px;
    }

    .comment-content {
        width: 100%;
    }

    .no-comments {
        padding: 24px 18px;
    }
}
