.ai-protected-book-page {
    min-height: 100%;
    background: #f3f5f8;
    color: #172238;
}

.ai-protected-book-frame {
    display: grid;
    gap: 1rem;
    padding-block: 1rem 2.5rem;
}

.ai-protected-book {
    display: grid;
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
    gap: clamp(1.25rem, 3vw, 2.6rem);
    align-items: center;
    padding: clamp(1rem, 3vw, 2.4rem);
    border: 1px solid #d8dee9;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 48px rgb(23 34 56 / 8%);
}

.ai-protected-book__cover {
    margin: 0;
    padding: clamp(0.55rem, 2vw, 1rem);
    border-radius: 12px;
    background: #ece7dc;
}

.ai-protected-book__cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 16px 36px rgb(23 34 56 / 20%);
}

.ai-protected-book__panel {
    min-width: 0;
}

.ai-protected-book__panel h2 {
    margin: 0.35rem 0 0;
    font-size: clamp(1.8rem, 4vw, 3.25rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
    word-break: keep-all;
}

.ai-protected-book__subtitle {
    max-width: 34rem;
    margin: 0.9rem 0 0;
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.65;
    word-break: keep-all;
}

.ai-protected-book__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1.35rem 0;
}

.ai-protected-book__facts div {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.ai-protected-book__facts dt {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
}

.ai-protected-book__facts dd {
    margin: 0.2rem 0 0;
    font-weight: 800;
}

.ai-protected-book__gate {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.1rem;
    padding: 1rem;
    border: 1px solid #d8dee9;
    border-radius: 12px;
    background: #fbfcfe;
}

.ai-protected-book__status {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.ai-protected-book__status > i {
    display: grid;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 50%;
    background: #ede9fe;
    color: #6d42cf;
}

.ai-protected-book__status strong {
    display: block;
    margin-top: 0.1rem;
    font-size: 1rem;
}

.ai-protected-book__status p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.55;
    word-break: keep-all;
}

.ai-protected-book__help {
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.5;
}

.ai-protected-book__error {
    margin: 0;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    background: #fff1f2;
    color: #be123c;
    font-size: 0.88rem;
    font-weight: 800;
}

.ai-protected-book__unlock-button {
    display: inline-flex;
    min-height: 48px;
    gap: 0.55rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 8px;
    background: #6d42cf;
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.ai-protected-book__unlock-button:hover {
    background: #5630b7;
}

.ai-protected-book__password {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
    margin: 0;
}

.ai-protected-book__password-label {
    font-size: 0.86rem;
    font-weight: 800;
    color: #334155;
}

.ai-protected-book__password-row {
    display: flex;
    gap: 0.5rem;
}

.ai-protected-book__password-input {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ai-protected-book__password-input:focus {
    outline: 3px solid rgba(109, 66, 207, 0.25);
    border-color: #6d42cf;
}

.ai-protected-book__password-input[aria-invalid="true"] {
    border-color: #be123c;
}

.ai-protected-book__password-row .ai-protected-book__unlock-button {
    flex: 0 0 auto;
}

.ai-concepts-page.is-protected-book img {
    -webkit-user-drag: none;
    user-select: none;
}

.ai-protected-reader-note {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    color: #475569;
}

.ai-protected-reader-note i {
    color: #6d42cf;
}

.ai-protected-admin-link {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.55rem;
    color: #5b32bd;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.ai-protected-admin-link:hover {
    color: #3f218d;
    text-decoration: underline;
}

@media (max-width: 760px) {
    .ai-protected-book {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        padding: 0.85rem;
    }

    .ai-protected-book__cover {
        width: min(100%, 310px);
        margin-inline: auto;
    }

    .ai-protected-book__panel {
        order: -1;
    }

    .ai-protected-book__facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .ai-protected-book__facts div {
        padding: 0.6rem;
    }

    .ai-protected-book__facts dd {
        font-size: 0.86rem;
        word-break: keep-all;
    }

    .ai-protected-book__panel h2 {
        font-size: 2rem;
    }
}

.ai-book-access { width: 100%; max-width: 480px; margin-top: 12px; }
.ai-book-access summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.ai-book-access__form { display: grid; gap: 8px; margin: 12px 0; }
.ai-book-access__search { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-book-access__search input { flex: 1 1 200px; min-width: 0; width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px; color: #172033; background: #fff; }
.ai-book-access .ai-reading-button { white-space: nowrap; }
.ai-book-access__account { display: grid; gap: 8px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; overflow-wrap: anywhere; }
.ai-book-access .ai-book-access__error { color: #b42318; }
