.ok-library {
    --ok-blue: #032a5d;
    --ok-red: #dc0920;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 32px;
    color: #16324d;
    font-family: Arial, sans-serif;
    max-width: 1440px;
    margin: 24px auto
}

.ok-library > * {
    min-width: 0
}

.ok-library * {
    box-sizing: border-box
}

.ok-library h2,
.ok-library h3,
.ok-library p {
    margin-top: 0
}

.ok-sidebar h2 {
    background: var(--ok-blue);
    color: white;
    font-size: 20px;
    padding: 20px 18px;
    border-radius: 12px;
    margin-bottom: 12px
}

.ok-sidebar nav {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 6px
}

.ok-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 12px;
    color: #344558;
    border-radius: 9px;
    font-size: 14px;
    border-bottom: 1px solid #f4f6f8;
    text-decoration: none
}

.ok-sidebar nav a span {
    font-size: 23px;
    color: var(--ok-red)
}

.ok-sidebar nav a.active {
    background: var(--ok-red);
    color: #fff
}

.ok-sidebar nav a.active span {
    color: #fff
}

.ok-consult {
    background: #f2f7fc;
    padding: 24px 18px;
    border-radius: 12px;
    margin-top: 24px
}

.ok-consult h3 {
    font-size: 21px;
    color: var(--ok-blue)
}

.ok-consult p {
    font-size: 15px;
    line-height: 1.7
}

.ok-consult a {
    display: block;
    background: var(--ok-red);
    color: #fff;
    text-align: center;
    border-radius: 30px;
    padding: 12px;
    text-decoration: none
}

.ok-search {
    display: flex;
    gap: 12px;
    margin-bottom: 28px
}

.ok-library input,
.ok-library select {
    height: 46px;
    border: 1px solid #dfe7ee;
    border-radius: 8px;
    background: white;
    padding: 0 14px;
    font-size: 14px;
    margin: 0;
    box-shadow: none;
    color: #344558
}

.ok-search input {
    flex: 1;
    min-width: 0
}

.ok-library button {
    background: var(--ok-red);
    color: #fff;
    border: 0;
    border-radius: 9px;
    padding: 0 24px;
    height: 46px;
    font-size: 15px;
    margin: 0;
    cursor: pointer
}

.ok-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 22px;
    scroll-margin-top: 30px
}

.ok-heading h2 {
    font-size: 25px;
    font-weight: 800;
    color: var(--ok-blue);
    margin: 0;
    position: relative;
    padding-bottom: 12px
}

.ok-heading h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--ok-red)
}

.ok-heading>a {
    color: var(--ok-red);
    font-size: 14px;
    text-decoration: none
}

.ok-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px
}

.ok-featured {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 34px
}

.ok-card {
    min-width: 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #edf2f6;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s
}

.ok-card:hover {
    box-shadow: 0 8px 24px #07356915;
    transform: translateY(-3px)
}

.ok-cover {
    position: relative;
    aspect-ratio: 4/4.5;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 14px;
    background: #eaf2fc
}

.ok-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.ok-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 22px 12px;
    background: linear-gradient(155deg, #dfecff, #b4d5e5);
    text-align: center;
    border: 6px double #ffffff90
}

.ok-card:nth-child(3n+1) .ok-placeholder {
    background: linear-gradient(155deg, #fff0e2, #e8cbbb)
}

.ok-card:nth-child(3n) .ok-placeholder {
    background: linear-gradient(155deg, #e3f4eb, #b8ded6)
}

.ok-placeholder span {
    font-size: 9px;
    letter-spacing: 1px
}

.ok-placeholder strong {
    font-size: 20px;
    color: var(--ok-blue);
    line-height: 1.5
}

.ok-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 0 8px 0 0;
    background: var(--ok-red);
    color: white;
    font-weight: bold;
    font-size: 11px;
    padding: 8px
}

.ok-card h3 {
    font-size: 16px;
    line-height: 1.45;
    margin-bottom: 9px;
    color: #153450
}

.ok-meta {
    font-size: 12px;
    color: #778391;
    margin-bottom: 6px
}

.ok-library .ok-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #edf2f6;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.ok-library .ok-download-count {
    align-self: flex-start;
    margin: 0;
    padding: 3px 9px;
    border-radius: 20px;
    background: #f2f6fa;
    color: #53677d;
    font-size: 11px;
    line-height: 1.5
}

.ok-library .ok-download,
.ok-library .ok-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
    padding: 10px 8px;
    border: 1px solid var(--ok-blue);
    border-radius: 8px;
    background: var(--ok-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, box-shadow .2s
}

.ok-library .ok-download:hover {
    background: var(--ok-red);
    border-color: var(--ok-red);
    color: #fff;
    box-shadow: 0 4px 12px #dc092026
}

.ok-library .ok-download svg {
    flex-shrink: 0
}

.ok-library .ok-unavailable {
    background: #f5f7fa;
    color: #64748b;
    border-color: #e2e8f0;
    font-weight: 500
}

.ok-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.ok-filters select {
    flex: 1;
    min-width: 130px
}

.ok-results {
    margin: 15px 0;
    color: #7b8793;
    font-size: 13px
}

.ok-empty {
    padding: 40px 20px;
    text-align: center;
    background: #f4f8fc;
    border-radius: 12px
}

.ok-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 28px 0
}

.ok-pagination .page-numbers {
    padding: 8px 14px;
    border: 1px solid #e1e7ef;
    border-radius: 6px;
    color: var(--ok-blue)
}

.ok-pagination .current {
    background: var(--ok-blue);
    color: white
}

.ok-library a:focus-visible,
.ok-library button:focus-visible,
.ok-library input:focus-visible,
.ok-library select:focus-visible {
    outline: 3px solid #f2a400;
    outline-offset: 3px
}

@media(max-width:1200px) {
    .ok-library {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 22px
    }

    .ok-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .ok-featured {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:760px) {
    .ok-library {
        grid-template-columns: minmax(0, 1fr);
        margin: 16px 0;
        gap: 20px
    }

    .ok-sidebar nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto
    }

    .ok-sidebar nav a {
        flex-shrink: 0;
        max-width: 230px;
        border: 0;
        padding: 0px 13px
    }

    .ok-sidebar h2 {
        font-size: 18px;
        padding: 14px
    }

    .ok-consult {
        display: none
    }

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

    .ok-heading h2 {
        font-size: 20px
    }

    .ok-search {
        gap: 8px
    }

    .ok-library button {
        padding: 0 14px
    }

    .ok-card {
        padding: 8px
    }

    .ok-card h3 {
        font-size: 14px
    }

    .ok-placeholder strong {
        font-size: 17px
    }

    .ok-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .ok-filters select,
    .ok-filters button {
        min-width: 0;
        width: 100%
    }

    .ok-empty {
        overflow-wrap: anywhere
    }
}

@media(prefers-reduced-motion:reduce) {
    .ok-card,
    .ok-library .ok-download {
        transition: none
    }

    .ok-card:hover {
        transform: none
    }
}

.ok-sidebar nav a .ok-category-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    object-fit: contain;
    flex-shrink: 0;
    margin: 0;
}
.ok-consult .ok-consult-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0 0;
}

@media (max-width: 760px) {
    .ok-consult .ok-consult-image {
        display: none;
    }
}
