.site-library {
    margin: 2rem 0;
    padding: 1.4rem;
    border: 1px solid var(--site-line);
    border-radius: 14px;
    background: var(--site-panel);
}
.library-heading h2 { margin: 0; max-width: none; font-size: 1.25rem; }
.site-library [hidden] { display: none; }
button.library-button:disabled { opacity: .5; cursor: default; }
.library-scope, .library-empty { color: var(--site-muted); font-size: .88rem; }
.library-toolbar, .library-tabs, .library-item-controls, .library-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.library-toolbar { justify-content: space-between; margin: 1rem 0; }
.library-filter { font-size: .85rem; }
.library-filter select, .library-item-controls select {
    width: auto;
    min-height: 34px;
    padding: .45rem;
    max-width: 100%;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: var(--site-bg);
    color: var(--site-text);
    font: inherit;
    font-size: .82rem;
}
button.library-button {
    padding: .45rem .7rem;
    min-height: 34px;
    border-radius: 6px;
    border: 1px solid var(--site-line);
    background: transparent;
    color: var(--site-text);
    box-shadow: none;
    font-size: .82rem;
}
button.library-button[aria-pressed="true"] { background: var(--site-text); color: var(--site-bg); }
.library-list { list-style: none; padding: 0; margin: 0; max-height: 440px; overflow-y: auto; }
.library-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--site-line); padding: 1rem 0; }
.library-item-text { min-width: 0; }
button.library-open, a.library-open {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--site-text);
    text-align: left;
    font-size: .95rem;
    font-weight: 650;
    min-height: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
button.library-open:hover, a.library-open:hover { text-decoration: underline; background: none; }
.library-row .library-item-controls { flex-shrink: 0; }
.site-library .tool-message:empty { display: none; }
.library-empty { padding: 1rem 0; }
.library-footer { margin-top: .6rem; }
.library-flag { font-size: 1.3rem; color: var(--site-muted); }
.library-flag[data-colour="red"] { color: #e95662; }
.library-flag[data-colour="orange"] { color: #df853b; }
.library-flag[data-colour="yellow"] { color: #bea020; }
.library-flag[data-colour="green"] { color: #31996b; }
.library-flag[data-colour="blue"] { color: #539ce6; }
.library-flag[data-colour="purple"] { color: #b182de; }
.company-filing-actions .library-item-controls { width: 100%; }
.company-filing-actions { flex-wrap: wrap; }
@media (max-width: 700px) {
    .site-library { padding: 1rem; }
    .library-row { flex-direction: column; align-items: flex-start; }
    .library-filter { width: 100%; }
}
