:root {
    --library-ink: #071329;
    --library-muted: #53627a;
    --library-line: #dce5f1;
    --library-blue: #245be8;
    --library-soft: #f5f8fc;
    --library-success: #13734a;
    --library-warning: #8a5a00;
}

.library-source-note {
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid #bfd2f3;
    border-radius: 8px;
    background: #f3f7ff;
    color: #3f4f69;
    font-size: 0.78rem;
    line-height: 1.6;
}

.library-source-note strong {
    color: var(--library-ink);
}

.library-directory-copy {
    max-width: 760px;
}

.library-directory-copy p + p {
    margin-top: 12px;
}

.library-stat-link {
    color: inherit;
    text-decoration: none;
}

.library-stat-link:hover article {
    border-color: #a9c2ef;
}

.library-grid .aishe-registry-card {
    min-height: 430px;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(20, 37, 63, 0.05);
}

.library-grid .aishe-registry-card h3 a {
    color: var(--library-ink);
    text-decoration: none;
}

.library-grid .aishe-registry-badge {
    border-radius: 999px;
    background: #fff5e6;
    color: #a05300;
}

.library-browse-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 20px;
}

.library-browse-links a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--library-line);
    border-radius: 8px;
    background: #fff;
    color: var(--library-blue);
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: none;
}

.library-profile-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 4px;
}

.library-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid #cfd8f5;
    border-radius: 999px;
    background: #eef4ff;
    color: #26469d;
    font-size: 0.76rem;
    font-weight: 750;
}

.library-status.verified {
    border-color: #b7dec9;
    background: #edf9f2;
    color: var(--library-success);
}

.library-status.pending {
    border-color: #efdca5;
    background: #fff9e9;
    color: var(--library-warning);
}

.library-profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.library-profile-content,
.library-profile-sidebar {
    display: grid;
    gap: 22px;
}

.library-section {
    padding: 22px;
    border: 1px solid var(--library-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(20, 37, 63, 0.05);
}

.library-section h2 {
    margin: 0 0 8px;
    color: var(--library-ink);
    font-size: 1.35rem;
}

.library-section h3 {
    color: var(--library-ink);
}

.library-section > p {
    margin: 0;
    color: var(--library-muted);
    line-height: 1.7;
}

.library-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.library-section-head p {
    margin: 5px 0 0;
    color: var(--library-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.library-evidence-label {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    background: #edf9f2;
    color: var(--library-success);
    font-size: 0.72rem;
    font-weight: 800;
}

.library-pending {
    padding: 15px;
    border: 1px solid #ecdba9;
    border-radius: 12px;
    background: #fffaf0;
    color: #755618;
    font-size: 0.88rem;
    line-height: 1.65;
}

.library-source-list,
.library-contact-list,
.library-status-grid,
.library-fact-grid {
    display: grid;
    gap: 10px;
}

.library-source-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2eaf4;
    border-radius: 12px;
    background: #f8fbff;
    color: var(--library-blue);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.library-source-list small {
    display: block;
    margin-top: 2px;
    color: #66738a;
    font-weight: 500;
}

.library-fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.library-fact {
    padding: 13px;
    border: 1px solid #e2eaf4;
    border-radius: 12px;
    background: #f8fbff;
}

.library-fact strong,
.library-fact span {
    display: block;
}

.library-fact strong {
    margin-bottom: 4px;
    color: #66738a;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.library-fact span {
    color: var(--library-ink);
    font-size: 0.88rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.library-program-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.library-program {
    padding: 15px;
    border: 1px solid #e2eaf4;
    border-radius: 14px;
    background: #f9fbff;
}

.library-program h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.4;
}

.library-program p {
    margin: 6px 0;
    color: var(--library-muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.library-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.library-chip-list span {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--library-blue);
    font-size: 0.74rem;
    font-weight: 700;
}

.library-text-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 20px;
    color: var(--library-muted);
}

.library-text-list li {
    line-height: 1.65;
}

.library-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.library-status-item {
    padding: 12px;
    border: 1px solid #e2eaf4;
    border-radius: 12px;
    background: #f8fbff;
}

.library-status-item strong,
.library-status-item span {
    display: block;
}

.library-status-item strong {
    margin-bottom: 4px;
    color: var(--library-ink);
    font-size: 0.82rem;
}

.library-status-item span {
    color: #68758a;
    font-size: 0.78rem;
    line-height: 1.45;
}

.library-status-item.verified span {
    color: var(--library-success);
}

.library-safeguard {
    padding: 16px;
    border-left: 4px solid #df9e16;
    border-radius: 10px;
    background: #fffaf0;
    color: #755618;
    line-height: 1.65;
}

.library-footer {
    padding: 28px 0;
    border-top: 1px solid var(--library-line);
    background: #fff;
    color: #66738a;
    font-size: 0.84rem;
}

@media (max-width: 900px) {
    .library-profile-layout,
    .library-program-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .library-section {
        padding: 16px;
        border-radius: 14px;
    }

    .library-section-head {
        flex-direction: column;
    }

    .library-fact-grid,
    .library-status-grid {
        grid-template-columns: 1fr;
    }
}
