.online-library {
    --of-bg: rgba(255,255,255,.78);
    --of-bg-soft: rgba(246,250,253,.92);
    --of-border: rgba(23,112,180,.18);
    --of-text: #1f2937;
    --of-muted: #667085;
    --of-accent: #0b67b2;
    --of-accent-soft: rgba(15,132,210,.10);
    --of-shadow: 0 10px 28px rgba(33,76,110,.08);

    color: var(--of-text);
}

html[data-theme="dark"] .online-library,
body.dark .online-library,
body.dark-theme .online-library,
body.theme-dark .online-library {
    --of-bg: rgba(26,34,44,.90);
    --of-bg-soft: rgba(18,25,34,.92);
    --of-border: rgba(130,180,230,.18);
    --of-text: #edf4fb;
    --of-muted: #aebdcc;
    --of-accent: #70b9ff;
    --of-accent-soft: rgba(112,185,255,.12);
    --of-shadow: 0 12px 30px rgba(0,0,0,.20);
}

.of-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.of-title {
    margin: 0 0 4px;
    font-size: 1.35rem;
}

.of-subtitle {
    margin: 0;
    color: var(--of-muted);
}

.of-total,
.of-folder__count {
    white-space: nowrap;
    border-radius: 999px;
    background: var(--of-accent-soft);
    color: var(--of-accent);
    font-weight: 700;
}

.of-total {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 92px;
    min-height: 68px;

    padding: 8px 16px;

    border-radius: 999px;

    background: var(--of-accent-soft);
    color: var(--of-accent);

    line-height: 1.05;
    text-align: center;
}

.of-total__number {
    font-size: 1.28rem;
    font-weight: 900;
    letter-spacing: .01em;
}

.of-total__label {
    margin-top: 4px;

    font-size: .88rem;
    font-weight: 800;
}

.of-toolbar {
    display: grid;
    grid-template-columns: minmax(240px,1fr) auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

.of-search,
.of-btn {
    min-height: 42px;
    border: 1px solid var(--of-border);
    border-radius: 12px;
    background: var(--of-bg);
    color: var(--of-text);
    font: inherit;
}

.of-search {
    padding: 0 13px;
    outline: none;
}

.of-search:focus {
    border-color: var(--of-accent);
    box-shadow: 0 0 0 3px var(--of-accent-soft);
}

.of-btn {
    padding: 0 13px;
    cursor: pointer;
    font-weight: 650;
}

.of-btn:hover {
    background: var(--of-accent-soft);
}

.of-common,
.of-folder {
    border: 1px solid var(--of-border);
    border-radius: 14px;
    background: var(--of-bg);
    box-shadow: var(--of-shadow);
}

.of-common {
    padding: 10px;
    margin-bottom: 12px;
}

.of-section-title {
    padding: 6px 8px 10px;
    font-weight: 800;
}

.of-tree {
    display: grid;
    gap: 10px;
}

.of-folder {
    overflow: hidden;
}

.of-folder > summary {
    display: grid;
    grid-template-columns: 20px 28px minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-weight: 750;
}

.of-folder > summary::-webkit-details-marker {
    display: none;
}

.of-folder > summary:hover {
    background: var(--of-accent-soft);
}

.of-chevron {
    font-size: 25px;
    line-height: 1;
    transition: transform .15s ease;
}

.of-folder[open] > summary .of-chevron {
    transform: rotate(90deg);
}

.of-folder__icon {
    font-size: 19px;
}

.of-folder__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.of-folder__count {
    padding: 4px 8px;
    font-size: .84rem;
}

.of-folder__body {
    display: grid;
    gap: 7px;
    padding: 0 10px 10px 28px;
}

.of-folder__body > .of-folder {
    box-shadow: none;
    background: var(--of-bg-soft);
}

.of-file {
    display: grid;
    grid-template-columns: 54px minmax(0,1fr) auto 26px;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 7px 10px;
    border-radius: 11px;

    color: inherit;
    text-decoration: none;
}

.of-file:hover {
    background: var(--of-accent-soft);
    text-decoration: none;
}

.of-ext {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 46px;
    height: 28px;

    padding: 0 6px;

    border-radius: 8px;

    background: var(--of-accent-soft);
    color: var(--of-accent);

    font-size: .72rem;
    font-weight: 850;
}

.of-file__name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 620;
}

.of-file__size {
    color: var(--of-muted);
    white-space: nowrap;
    font-size: .88rem;
}

.of-empty,
.online-library__error {
    padding: 18px;
    border: 1px dashed var(--of-border);
    border-radius: 12px;
    color: var(--of-muted);
    text-align: center;
}

@media (max-width: 760px) {

    .of-head {
        display: block;
    }

    .of-total {
        display: inline-flex;
        margin-top: 10px;
    }

    .of-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .of-search {
        grid-column: 1 / -1;
    }

    .of-folder__body {
        padding-left: 12px;
    }

    .of-file {
        grid-template-columns: 48px minmax(0,1fr) 24px;
    }

    .of-file__size {
        display: none;
    }
}

.of-file__download {
    position: relative;

    display: block;

    width: 28px;
    height: 28px;

    color: var(--of-accent);

    transition:
        transform .15s ease,
        opacity .15s ease;
}

/* вертикальная палка */
.of-file__download::before {
    content: "";

    position: absolute;

    left: 50%;
    top: 4px;

    width: 3px;
    height: 13px;

    background: currentColor;
    border-radius: 3px;

    transform: translateX(-50%);
}

/* наконечник стрелки */
.of-file__download::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 10px;

    width: 9px;
    height: 9px;

    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;

    transform:
        translateX(-50%)
        rotate(45deg);
}

.of-file:hover .of-file__download {
    transform: translateY(2px);
}

@media (max-width: 760px) {

    html[data-theme="dark"] .online-library,
    body.dark .online-library,
    body.dark-theme .online-library,
    body.theme-dark .online-library {
        background: transparent !important;
        color: var(--of-text) !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] .online-library .of-head,
    body.dark .online-library .of-head,
    body.dark-theme .online-library .of-head,
    body.theme-dark .online-library .of-head {
        background: transparent !important;
    }
}