.study-library {
    margin: 1.5rem 0 2rem;
    scroll-margin-top: 6rem;
    padding: clamp(1rem, 3vw, 2rem);
    border: 1px solid var(--line, #94a3b8);
    border-radius: 18px;
    background: var(--panel, transparent);
}
.study-library .search-box { max-width: 42rem; width: 100%; }
.study-library-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 3rem;
    cursor: pointer;
    list-style: none;
}
.study-library-toggle::-webkit-details-marker { display: none; }
.study-library-arrow {
    flex: 0 0 .6rem;
    width: .6rem;
    height: .6rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}
.study-library[open] > .study-library-toggle .study-library-arrow { transform: rotate(45deg); }
.study-library-heading { display: grid; gap: .35rem; min-width: 0; flex: 1; }
.study-library-heading .eyebrow { margin: 0; }
.study-library-heading strong { font-size: clamp(1.05rem, 2vw, 1.5rem); line-height: 1.4; }
.study-library-count { border-radius: 999px; padding: .4rem .65rem; background: var(--panel-soft, #edf5f8); white-space: nowrap; font-size: .85rem; font-weight: 700; }
.study-library-content { margin-top: 1.5rem; }
.study-library-note { font-size: .85rem; line-height: 1.6; }
.study-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
    padding: .25rem;
}
.study-sheet-card { border: 1px solid #94a3b8; border-radius: 12px; padding: 1rem; }
.study-sheet-card h3 { font-size: 1.05rem; line-height: 1.5; margin: .6rem 0; }
.study-sheet-card p { font-size: .85rem; }
.study-sheet-preview { display: block; width: 100%; height: auto; margin: .75rem 0; border-radius: 7px; }
.study-sheet-card > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.study-sheet-card[hidden] { display: none; }
.study-sheet-modal .shared-pdf-dialog {
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    max-width: 1100px;
    height: min(960px, calc(100vh - 36px));
    height: min(960px, calc(100dvh - 36px));
    max-height: min(960px, calc(100vh - 36px));
    max-height: min(960px, calc(100dvh - 36px));
    overflow: hidden;
}
.study-sheet-modal .shared-pdf-heading { flex-shrink: 0; }
.study-sheet-modal .shared-pdf-viewer { flex: 1; min-height: 0; overflow: auto; }
.study-sheet-modal .shared-pdf-viewer iframe { height: 100%; }
.study-library button:focus-visible { outline: 3px solid #3b82f6; outline-offset: 3px; }
.study-library a:focus-visible, .study-library input:focus-visible, .study-library-toggle:focus-visible { outline: 3px solid #3b82f6; outline-offset: 5px; }
@media (max-width: 600px) {
    .study-library-toggle { gap: .75rem; flex-wrap: wrap; }
    .study-library-heading { flex-basis: calc(100% - 2rem); }
    .study-library-count { margin-left: 1.35rem; }
}
