.knowledge-base {
    margin: 0;
    padding: 0;
    background: #f5f7fa;
}

.knowledge-base .container {
    max-width: 1160px;
    padding-right: 28px;
    padding-left: 28px;
}

.kb-hero {
    padding: 48px 0 42px;
    border-bottom: 1px solid #e2e5e9;
    background: #fff;
}

.knowledge-base .kb-eyebrow,
.kb-section-eyebrow {
    margin: 0 0 12px;
    color: #a52328;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.5;
    text-align: left;
    text-transform: uppercase;
}

.knowledge-base .kb-hero h1 {
    margin: 0;
    color: #272d33;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.18;
}

.knowledge-base .kb-intro {
    max-width: 720px;
    margin: 14px 0 0;
    color: #626c76;
    font-size: 1rem;
    line-height: 1.7;
    text-align: left;
}

.kb-library {
    min-height: 400px;
    padding: clamp(44px, 7vw, 78px) 0 64px;
    background:
        radial-gradient(ellipse at 10% 12%, rgba(220, 226, 234, 0.28), transparent 32%),
        #f5f7fa;
}

.kb-library-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.kb-section-eyebrow {
    margin-bottom: 8px;
    color: #b51e25;
}

.kb-library-heading h2 {
    margin: 0 0 7px;
    color: #202831;
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    font-weight: 760;
    letter-spacing: -0.045em;
    text-align: left;
}

.kb-library-heading h2::after {
    display: none;
}

.kb-library-heading > div > p:last-child {
    margin: 0;
    color: #707b87;
    font-size: 0.96rem;
    text-align: left;
}

.kb-search-bar {
    display: flex;
    align-items: center;
    gap: 11px;
    width: min(100%, 370px);
    min-height: 50px;
    margin: 0 0 4px;
    padding: 0 12px 0 15px;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(31, 42, 54, 0.035);
    color: #87919d;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.kb-search-bar:focus-within {
    border-color: #c5484d;
    box-shadow: 0 0 0 3px rgba(197, 72, 77, 0.12);
}

.kb-search-bar > span:first-child {
    font-size: 0.9rem;
}

.kb-search-bar input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #26313c;
    font: inherit;
    font-size: 0.9rem;
}

.kb-search-bar input::placeholder {
    color: #99a2ad;
}

.kb-search-bar kbd {
    display: grid;
    min-width: 23px;
    height: 23px;
    place-items: center;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    background: #f7f8fa;
    color: #89929c;
    font-family: inherit;
    font-size: 0.72rem;
}

.kb-search-bar input:focus-visible,
.kb-filter-button:focus-visible,
.kb-player-button:focus-visible,
.kb-player input:focus-visible {
    outline: 3px solid rgba(204, 0, 0, 0.35);
    outline-offset: 3px;
}

.kb-search-bar input:focus-visible {
    outline: none;
    box-shadow: none;
}

.kb-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 29px;
}

.kb-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 42px;
    padding: 7px 12px 7px 15px;
    border: 1px solid #dce1e7;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    color: #586370;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.kb-filter-button:hover {
    transform: translateY(-1px);
    border-color: #ca8588;
    color: #9c2026;
}

.kb-filter-button.is-active {
    border-color: #a71f25;
    background: #a71f25;
    color: #fff;
    box-shadow: 0 4px 12px rgba(167, 31, 37, 0.16);
}

.kb-filter-count {
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    place-items: center;
    border-radius: 6px;
    background: rgba(33, 43, 53, 0.06);
    color: #697480;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.kb-filter-button.is-active .kb-filter-count {
    background: rgba(255, 255, 255, 0.17);
    color: #fff;
}

.kb-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.kb-list-heading h3 {
    margin: 0;
    color: #26313c;
    font-size: 1.02rem;
    font-weight: 750;
}

.kb-result-count {
    margin: 0;
    color: #87919c;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.kb-entries {
    display: grid;
    gap: 15px;
}

.kb-entry {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid #e1e5ea;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(31, 42, 54, 0.045);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.kb-entry::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, #c82b32, #ed7775);
    content: "";
    opacity: 0;
    transition: opacity 180ms ease;
}

.kb-entry:hover {
    transform: translateY(-2px);
    border-color: #d7dce2;
    box-shadow: 0 12px 30px rgba(31, 42, 54, 0.08);
}

.kb-entry:hover::before {
    opacity: 1;
}

.kb-entry[hidden] {
    display: none;
}

.kb-entry-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 14px;
}

.kb-entry-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: #fff0ef;
    color: #b3272d;
    font-size: 0.78rem;
}

.kb-entry-category {
    color: #a3292d;
    font-size: 0.77rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.kb-entry-video-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 6px;
    background: #f2f4f6;
    color: #697581;
    font-size: 0.73rem;
    font-weight: 650;
}

.kb-entry-video-label .fa-solid {
    color: #b3272d;
}

.kb-entry h3 {
    margin: 0 0 17px;
    color: #222c36;
    font-size: clamp(1.28rem, 2.5vw, 1.68rem);
    font-weight: 740;
    letter-spacing: -0.035em;
    line-height: 1.3;
    text-align: left;
}

.kb-entry h3::after {
    display: none;
}

.kb-entry-body {
    color: #53606d;
    font-size: 0.96rem;
    line-height: 1.78;
}

.kb-entry-body > p {
    max-width: none;
    margin: 0 0 15px;
    text-align: left;
}

.kb-entry-body h4 {
    margin: 22px 0 10px;
    color: #2a3540;
    font-size: 1rem;
    font-weight: 740;
}

.kb-entry-body ul {
    display: grid;
    gap: 9px;
    max-width: none;
    margin: 0 0 19px;
    padding: 0;
    list-style: none;
}

.kb-entry-body li {
    position: relative;
    margin: 0;
    padding: 12px 15px 12px 39px;
    border: 1px solid #edf0f3;
    border-radius: 8px;
    background: #fafbfc;
    color: #56616d;
    line-height: 1.65;
}

.kb-entry-body li::before {
    position: absolute;
    top: 17px;
    left: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c63439;
    box-shadow: 0 0 0 4px #fce9e8;
    content: "";
}

.kb-entry-body li strong {
    color: #303b46;
}

.kb-no-results,
.kb-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin: 18px 0;
    padding: 40px 20px;
    border: 1px dashed #d7dde4;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: #727d89;
    text-align: center;
}

.kb-no-results[hidden] {
    display: none;
}

.kb-no-results > span,
.kb-empty > span {
    margin-bottom: 6px;
    color: #b72b31;
    font-size: 1.5rem;
}

.kb-no-results h3,
.kb-empty h3 {
    margin: 0;
    color: #303b46;
    font-size: 1.12rem;
}

.kb-no-results p,
.kb-empty p {
    max-width: none;
    margin: 0;
    color: #77828d;
    font-size: 0.9rem;
    text-align: center;
}

.kb-safety-note {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 28px;
    padding: 20px 22px;
    border: 1px solid #f0d7d6;
    border-radius: 11px;
    background: linear-gradient(110deg, #fff6f5, #fffafa);
}

.kb-safety-icon {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    background: #fbe4e2;
    color: #ae252a;
    font-size: 1rem;
}

.kb-safety-note h3 {
    margin: 1px 0 5px;
    color: #743235;
    font-size: 0.96rem;
    font-weight: 750;
}

.kb-safety-note p {
    max-width: none;
    margin: 0;
    color: #765d5e;
    font-size: 0.87rem;
    line-height: 1.65;
    text-align: left;
}

.kb-safety-note p strong {
    color: #a51f25;
}

.kb-player {
    overflow: hidden;
    margin-top: 20px;
    border-radius: 12px;
    background: #101317;
    color: #fff;
}

.kb-player-screen {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 9;
    place-items: center;
    background: #080a0c;
}

.kb-player-consent {
    position: absolute;
    z-index: 1;
    display: grid;
    max-width: 460px;
    justify-items: center;
    gap: 12px;
    padding: 20px;
    color: #fff;
    text-align: center;
}

.kb-player-consent[hidden] {
    display: none;
}

.kb-player-consent p {
    margin: 0;
}

.kb-player-screen iframe,
.kb-player-screen video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.kb-player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
}

.kb-player-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #57616c;
    border-radius: 6px;
    background: #262c33;
    color: #fff;
    font: inherit;
    font-size: 0.83rem;
    cursor: pointer;
}

.kb-player-button:hover {
    background: #3a434d;
}

.kb-player-seek {
    flex: 1;
    min-width: 40px;
    accent-color: #e33;
}

.kb-player-volume {
    width: 84px;
    accent-color: #e33;
}

.kb-player-time {
    flex: 0 0 auto;
    color: #e4e8ec;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kb-admin-categories {
    margin-bottom: 28px;
}

.kb-admin-category-required {
    margin: 18px 0;
    padding: 14px 16px;
    border-left: 3px solid #b3272d;
    border-radius: 0 7px 7px 0;
    background: #fff5f5;
    color: #61383a;
}

.kb-admin-categories > h4,
.kb-admin-entry-list > h4 {
    margin-bottom: 12px;
}

.kb-admin-categories {
    display: grid;
    gap: 16px;
    margin-bottom: 28px;
}

.kb-admin-categories > .admin-organization-heading {
    margin: 0;
}

.kb-admin-entry-form {
    margin-top: 28px;
}

.kb-admin-entry-list {
    margin-top: 30px;
}

.kb-admin-entry-list > h4 {
    padding-bottom: 10px;
    border-bottom: 1px solid #e3e8ee;
}

@media (max-width: 900px) {
    .kb-library-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .kb-search-bar {
        width: min(100%, 520px);
    }
}

@media (max-width: 620px) {
    .knowledge-base .container {
        padding-right: 20px;
        padding-left: 20px;
    }

    .kb-hero {
        padding: 36px 0 32px;
    }

    .knowledge-base .kb-eyebrow {
        max-width: 310px;
        font-size: 0.7rem;
    }

    .knowledge-base .kb-hero h1 {
        font-size: clamp(1.9rem, 9vw, 2.5rem);
    }

    .knowledge-base .kb-intro {
        margin: 12px 0 0;
        font-size: 0.96rem;
    }

    .kb-library {
        padding: 40px 0 46px;
    }

    .kb-library-heading h2 {
        font-size: 1.65rem;
    }

    .kb-category-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-right: -20px;
        padding: 0 20px 8px 0;
        scrollbar-width: thin;
    }

    .kb-filter-button {
        flex: 0 0 auto;
        min-height: 40px;
        font-size: 0.8rem;
    }

    .kb-entry {
        padding: 20px 17px;
    }

    .kb-entry h3 {
        font-size: 1.28rem;
    }

    .kb-entry-body {
        font-size: 0.91rem;
    }

    .kb-safety-note {
        gap: 11px;
        padding: 16px 14px;
    }

    .kb-safety-icon {
        width: 36px;
        height: 36px;
    }

    .kb-player-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .kb-player-seek {
        order: 2;
        flex: 1 1 100%;
    }

    .kb-player-volume {
        width: 64px;
    }

    .kb-player-time {
        margin-left: auto;
    }

}

@media (prefers-reduced-motion: reduce) {
    .kb-entry,
    .kb-entry::before,
    .kb-filter-button,
    .kb-player-button {
        transition: none;
    }
}
