:root {
    --hub-green: #57b651;
    --hub-green-dark: #347731;
    --hub-ink: #17211b;
    --hub-muted: #6f7d74;
    --hub-line: #e1e8e3;
    --hub-surface: #fff;
    --hub-background: #f4f7f4;
    --hub-sidebar: 240px;
}

body.library-page {
    min-width: 0;
    overflow-x: hidden;
    background: var(--hub-background);
}

body.nav-open,
body.modal-open {
    overflow: hidden;
}

.library-app,
.library-workspace {
    min-width: 0;
    min-height: 100vh;
}

.library-sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: var(--hub-sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid var(--hub-line);
}

.sidebar-header {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid #edf1ee;
}

.sidebar-close,
.mobile-menu-button {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    padding: 0;
    border: 1px solid #dde5df;
    border-radius: 12px;
    color: #34423a;
    background: #fff;
    font-size: 22px;
    cursor: pointer;
}

.sidebar-close {
    display: none;
}

.library-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.library-nav-section + .library-nav-section {
    margin-top: 20px;
}

.library-nav-label {
    margin: 0 10px 7px;
    color: #98a39c;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.library-nav-item {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 0;
    border-radius: 11px;
    color: #4b5a51;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.library-nav-item:hover {
    color: #27352c;
    background: #f3f6f3;
}

.library-nav-item.is-active,
.library-nav-item[aria-current="page"] {
    color: var(--hub-green-dark);
    background: #eaf6e9;
}

.nav-glyph {
    width: 22px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 22px;
    color: #718078;
    font-size: 15px;
}

.nav-glyph .hub-icon {
    width: 19px;
    height: 19px;
}

.library-nav-item.is-active .nav-glyph {
    color: var(--hub-green-dark);
}

.category-glyph::before {
    width: 9px;
    height: 9px;
    display: block;
    border: 2px solid currentColor;
    border-radius: 3px;
    content: "";
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #edf1ee;
    background: #fbfcfb;
}

.sidebar-account {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.sidebar-account-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--hub-green-dark);
    background: #eaf6e9;
    border-radius: 12px;
}

.sidebar-account-icon .hub-icon {
    width: 19px;
    height: 19px;
}

.sidebar-account-copy,
.sidebar-account-copy strong,
.sidebar-account-copy small {
    min-width: 0;
    display: block;
}

.sidebar-account-copy strong,
.sidebar-account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-copy strong {
    color: #253229;
    font-size: 13px;
}

.sidebar-account-copy small {
    margin-top: 3px;
    color: #7b8980;
    font-size: 10px;
}

.sidebar-footer form,
.sidebar-footer .button {
    width: 100%;
}

.sidebar-footer .button {
    justify-content: flex-start;
}

.library-mobile-header {
    display: none;
}

.mobile-header-spacer {
    width: 44px;
}

.library-workspace {
    margin-left: var(--hub-sidebar);
}

.library-main-header {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 32px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--hub-line);
    backdrop-filter: blur(14px);
}

.library-heading-eyebrow {
    margin: 0 0 4px;
    color: var(--hub-green-dark);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.library-main-header h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.6px;
}

.library-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-content {
    width: min(100%, 1580px);
    margin: 0 auto;
    padding: 24px 32px 60px;
}

.library-content .notice {
    margin: 0 0 18px;
}

.library-filters {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
    gap: 10px;
    margin: 0 0 24px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--hub-line);
    border-radius: 16px;
}

.library-control {
    min-width: 0;
    display: block;
    margin: 0;
}

.library-control-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.library-filters input,
.library-filters select {
    height: 44px;
    margin: 0;
    border-radius: 11px;
    font-size: 13px;
}

.library-search {
    padding-left: 40px;
    background-image: radial-gradient(circle at 19px 18px, transparent 5px, #7c8981 6px, #7c8981 7px, transparent 8px), linear-gradient(45deg, transparent 46%, #7c8981 47%, #7c8981 55%, transparent 56%);
    background-position: 0 0, 24px 25px;
    background-repeat: no-repeat;
    background-size: 38px 38px, 8px 8px;
}

.library-filters .button {
    min-height: 44px;
}

.library-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 12px;
}

.library-results-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.25px;
}

.library-results-head span {
    color: var(--hub-muted);
    font-size: 12px;
}

.library-empty {
    margin-bottom: 14px;
    padding: 24px;
    border: 1px solid var(--hub-line);
    border-radius: 16px;
    color: var(--hub-muted);
    background: #fff;
    text-align: center;
}

.library-file-list {
    display: grid;
    gap: 10px;
}

.library-file-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 118px;
    align-items: center;
    gap: 18px;
    padding: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--hub-line);
    border-radius: 17px;
}

.file-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 8 / 5;
    display: block;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e4e9e5;
    border-radius: 12px;
    color: inherit;
    background: #f5f7f5;
}

button.file-thumbnail {
    cursor: pointer;
}

button.file-thumbnail:focus-visible,
.library-nav-item:focus-visible,
.mobile-menu-button:focus-visible,
.sidebar-close:focus-visible {
    outline: 3px solid rgba(87, 182, 81, .3);
    outline-offset: 2px;
}

.thumbnail-media,
.thumbnail-media img,
.thumbnail-media video,
.thumbnail-media canvas,
.thumbnail-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.thumbnail-placeholder > .hub-icon {
    width: 48px;
    height: 48px;
    opacity: .82;
}

.thumbnail-extension {
    position: absolute;
    right: 9px;
    bottom: 8px;
    padding: 4px 7px;
    border: 1px solid currentColor;
    border-radius: 7px;
    background: rgba(255, 255, 255, .88);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
}

.thumbnail-media img,
.thumbnail-media video,
.thumbnail-media canvas {
    z-index: 2;
    display: block;
    object-fit: cover;
    background: #f5f7f5;
}

.thumbnail-media canvas,
.thumbnail-media video {
    opacity: 0;
    transition: opacity .16s ease;
}

.thumbnail-media.is-ready canvas,
.thumbnail-media.is-ready video {
    opacity: 1;
}

.thumbnail-media.is-error img,
.thumbnail-media.is-error canvas,
.thumbnail-media.is-error video {
    display: none;
}

.thumbnail-placeholder {
    z-index: 1;
    display: grid;
    place-items: center;
    color: #496051;
    background: #eef3ef;
}

.thumbnail-file-icon {
    position: relative;
    width: 54px;
    height: 66px;
    display: grid;
    place-items: end center;
    padding-bottom: 11px;
    border: 2px solid currentColor;
    border-radius: 9px;
    background: rgba(255, 255, 255, .74);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
}

.thumbnail-file-icon::before {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 17px;
    height: 17px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-radius: 0 7px 0 4px;
    background: #fff;
    content: "";
}

.thumbnail-placeholder--document,
.thumbnail-placeholder--text {
    color: #4670a3;
    background: #eef4fb;
}

.thumbnail-placeholder--spreadsheet {
    color: #39804b;
    background: #edf8f0;
}

.thumbnail-placeholder--presentation {
    color: #b45a32;
    background: #fff2eb;
}

.thumbnail-placeholder--design,
.thumbnail-placeholder--image {
    color: #7a55a4;
    background: #f6effb;
}

.thumbnail-placeholder--archive {
    color: #9a712b;
    background: #fff7e8;
}

.thumbnail-placeholder--video {
    color: #34587d;
    background: #eaf0f6;
}

.thumbnail-play {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(18, 30, 22, .68);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.thumbnail-play::before {
    margin-left: 3px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid currentColor;
    content: "";
}

.thumbnail-state {
    position: absolute;
    z-index: 4;
    right: 8px;
    bottom: 7px;
    padding: 4px 7px;
    border-radius: 99px;
    color: #526158;
    background: rgba(255, 255, 255, .9);
    font-size: 9px;
    font-weight: 800;
}

.thumbnail-media.is-ready .thumbnail-state,
.thumbnail-media.is-error .thumbnail-state {
    display: none;
}

.library-file-info {
    min-width: 0;
}

.library-file-info h3 {
    margin: 0 0 5px;
    overflow-wrap: anywhere;
    color: #202d25;
    font-size: 16px;
    line-height: 1.3;
}

.library-filename {
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--hub-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: #57665d;
    font-size: 11px;
}

.library-file-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.library-file-meta span + span::before {
    width: 3px;
    height: 3px;
    margin-right: 4px;
    border-radius: 50%;
    background: #a9b3ac;
    content: "";
}

.library-file-actions {
    display: grid;
    gap: 7px;
}

.library-file-actions .button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
}

.library-admin-actions {
    grid-column: 2 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: -5px;
}

.library-admin-actions .button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 11px;
}

.library-nav-backdrop {
    display: none;
}

@media (max-width: 1100px) {
    .library-sidebar {
        width: min(84vw, 320px);
        padding-top: env(safe-area-inset-top);
        border-right: 0;
        box-shadow: 20px 0 50px rgba(13, 28, 17, .18);
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    body.nav-open .library-sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: inline-grid;
    }

    .library-nav-backdrop {
        position: fixed;
        z-index: 60;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(20, 34, 25, .58);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    body.nav-open .library-nav-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .library-workspace {
        margin-left: 0;
    }

    .library-mobile-header {
        position: sticky;
        z-index: 30;
        top: 0;
        min-height: calc(64px + env(safe-area-inset-top));
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
        background: rgba(255, 255, 255, .96);
        border-bottom: 1px solid var(--hub-line);
        backdrop-filter: blur(14px);
    }

    .library-mobile-header .hub-brand {
        justify-self: center;
    }

    .mobile-admin-link {
        min-height: 42px;
        padding-inline: 11px;
        font-size: 12px;
    }

    .library-main-header {
        position: static;
        min-height: 0;
        padding: 20px 24px 14px;
        background: transparent;
        border: 0;
        backdrop-filter: none;
    }

    .library-main-header h1 {
        font-size: 22px;
    }

    .library-header-actions {
        display: none;
    }

    .library-content {
        padding: 10px 24px 48px;
    }

    .library-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    }

    .library-control--search {
        grid-column: 1 / -1;
    }

    .library-file-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .library-file-card {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        gap: 13px;
        padding: 12px;
    }

    .file-thumbnail {
        aspect-ratio: 16 / 9;
    }

    .library-file-actions {
        grid-template-columns: 1fr 1fr;
    }

    .library-file-actions .button {
        min-height: 44px;
    }

    .library-file-actions .download-action {
        grid-column: 1 / -1;
    }

    .library-admin-actions {
        grid-column: 1;
        flex-wrap: wrap;
        margin-top: -2px;
    }
}

@media (max-width: 719px) {
    .library-mobile-header {
        padding-inline: 12px;
    }

    .library-main-header {
        padding: 18px 16px 12px;
    }

    .library-main-header p:not(.library-heading-eyebrow) {
        display: none;
    }

    .library-content {
        padding: 8px 12px calc(40px + env(safe-area-inset-bottom));
    }

    .library-filters {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 18px;
        padding: 10px;
        border-radius: 14px;
    }

    .library-control--search,
    .library-control--type {
        grid-column: 1 / -1;
    }

    .library-filters .button {
        grid-column: 1 / -1;
    }

    .library-results-head {
        margin-bottom: 10px;
        padding-inline: 2px;
    }

    .library-file-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .library-file-card {
        border-radius: 16px;
    }

    .library-file-info h3 {
        font-size: 15px;
    }

    .library-file-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
    }

    .library-file-meta span + span::before {
        display: none;
    }

    .library-admin-actions .button {
        flex: 1 1 calc(33.333% - 7px);
    }
}

@media (max-width: 350px) {
    .library-mobile-header {
        grid-template-columns: 44px minmax(0, 1fr) 54px;
        gap: 6px;
        padding-inline: 8px;
    }

    .mobile-admin-link {
        padding-inline: 7px;
        font-size: 11px;
    }

    .library-content {
        padding-inline: 8px;
    }

    .library-main-header {
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .library-sidebar,
    .library-nav-backdrop,
    .thumbnail-media canvas,
    .thumbnail-media video {
        transition: none;
    }
}
