.lesson-search__toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10520;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #0CFE25;
    background: #010618;
    color: #0CFE25;
    box-shadow: 0 0 16px rgba(12, 254, 37, 0.28);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.lesson-search__toggle:hover,
.lesson-search__toggle:focus-visible {
    background: #071021;
    box-shadow: 0 0 22px rgba(12, 254, 37, 0.45);
    outline: none;
}

.lesson-search__backdrop {
    display: none;
}

.lesson-search__panel {
    position: fixed;
    right: 16px;
    bottom: 72px;
    z-index: 10500;
    width: min(420px, calc(100vw - 32px));
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: #162136;
    color: #fff;
    border: 1px solid #0CFE25;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    font-family: "Segoe UI", sans-serif;
}

.lesson-search.is-lesson .lesson-search__panel {
    width: min(960px, calc(100vw - 32px));
    height: min(85vh, 900px);
    max-height: 85vh;
}

.lesson-search.is-left .lesson-search__toggle {
    right: auto;
    left: 16px;
}

.lesson-search.is-left .lesson-search__panel {
    right: auto;
    left: 16px;
}

.lesson-search__bar {
    display: flex;
    justify-content: flex-start;
    padding: 6px 8px 0;
}

.lesson-search.is-left .lesson-search__bar {
    justify-content: flex-end;
}

.lesson-search__dock {
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.lesson-search__dock:hover,
.lesson-search__dock:focus,
.lesson-search__dock:focus-visible,
.lesson-search__dock:active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    box-shadow: none;
    outline: none;
    opacity: 1;
}

.lesson-search.is-lesson .lesson-search__form,
.lesson-search.is-lesson .lesson-search__status {
    display: none;
}

.lesson-search__panel[hidden],
.lesson-search__backdrop[hidden],
.lesson-search__lesson[hidden],
.lesson-search__frame[hidden],
.lesson-search__lock[hidden],
.lesson-search__status[hidden] {
    display: none !important;
}

.lesson-search__form {
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(12, 254, 37, 0.25);
}

.lesson-search__input {
    width: 100%;
    box-sizing: border-box;
    background: #010618;
    color: #fff;
    border: 1px solid rgba(12, 254, 37, 0.45);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.lesson-search__input:focus {
    outline: 1px solid #0CFE25;
}

.lesson-search__status {
    margin: 0;
    padding: 8px 14px 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.lesson-search__results {
    overflow: auto;
    padding: 8px 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: #0CFE25 #010618;
}

.lesson-search__card {
    border: 1px solid rgba(12, 254, 37, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 8px;
    background: #0d1525;
}

.lesson-search__head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.lesson-search__crumb {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.4;
}

.lesson-search__open {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin-top: -2px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #0CFE25;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lesson-search__open:hover,
.lesson-search__open:focus-visible {
    background: rgba(12, 254, 37, 0.12);
    outline: none;
}

.lesson-search__pricing {
    border: 1px solid #0CFE25;
    background: transparent;
    color: #0CFE25;
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
}

.lesson-search__pricing:hover {
    background: rgba(12, 254, 37, 0.12);
}

.lesson-search__back {
    align-self: flex-start;
    margin: 0;
    padding: 2px 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.lesson-search__back:hover,
.lesson-search__back:focus,
.lesson-search__back:focus-visible,
.lesson-search__back:active {
    color: #fff;
    border: none;
    background: none;
    box-shadow: none;
    opacity: 1;
    outline: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lesson-search__hit {
    margin-top: 10px;
    padding: 8px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(1, 6, 24, 0.55);
}

.lesson-search__hit-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.lesson-search__hit-label {
    margin: 0;
    flex: 1;
    min-width: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lesson-search__hit-head .lesson-search__open {
    margin-top: 0;
}

.lesson-search__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.88);
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    white-space: pre-wrap;
}

.lesson-search__more {
    display: block;
    width: fit-content;
    margin: 6px 0 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.62);
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}

.lesson-search__more:hover,
.lesson-search__more:focus,
.lesson-search__more:focus-visible,
.lesson-search__more:active {
    color: #fff;
    border: none;
    background: none;
    box-shadow: none;
    opacity: 1;
    outline: none;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lesson-search__excerpt:hover,
.lesson-search__excerpt:focus,
.lesson-search__excerpt:focus-visible {
    color: rgba(255, 255, 255, 0.88);
    border-color: transparent;
    outline: none;
    opacity: 1;
}

.lesson-search__excerpt.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    max-height: calc(1.45em * 10);
    overflow: auto;
    overscroll-behavior: contain;
    white-space: normal;
    color: rgba(255, 255, 255, 0.92);
    scrollbar-width: thin;
    scrollbar-color: #0CFE25 #010618;
}

.lesson-search__excerpt.is-expanded::-webkit-scrollbar,
.lesson-search__results::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.lesson-search__excerpt.is-expanded::-webkit-scrollbar-track,
.lesson-search__results::-webkit-scrollbar-track {
    background: #010618;
    border-left: 1px solid #0CFE25;
}

.lesson-search__excerpt.is-expanded::-webkit-scrollbar-thumb,
.lesson-search__results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0CFE25, #09a61a);
    border-radius: 10px;
    border: 2px solid #010618;
}

.lesson-search__excerpt.is-expanded::-webkit-scrollbar-thumb:hover,
.lesson-search__results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #13ff32, #0CFE25);
}

.lesson-search__excerpt.is-expanded :where(h1, h2, h3, h4, h5, h6, p, li, a, strong, em, code, pre, span) {
    color: rgba(255, 255, 255, 0.92);
}

.lesson-search__excerpt.is-expanded p {
    margin: 0 0 0.65em;
}

.lesson-search__excerpt.is-expanded p:last-child {
    margin-bottom: 0;
}

.lesson-search__excerpt.is-expanded pre,
.lesson-search__excerpt.is-expanded .solution-box {
    white-space: pre-wrap;
    font-family: "Courier New", Courier, monospace;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
    overflow: visible;
}

.lesson-search mark {
    background: rgba(255, 255, 255, 0.18);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}

.lesson-search__lesson {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex: 1;
    padding: 10px;
}

.lesson-search__frame {
    flex: 1;
    width: 100%;
    min-height: 240px;
    border: 1px solid rgba(12, 254, 37, 0.35);
    border-radius: 10px;
    background: #010618;
}

.lesson-search__lock {
    padding: 8px 4px 12px;
}

.lesson-search__lock h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.lesson-search__lock p {
    margin: 0 0 12px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .lesson-search__panel,
    .lesson-search.is-lesson .lesson-search__panel,
    .lesson-search.is-left .lesson-search__panel,
    .lesson-search.is-left.is-lesson .lesson-search__panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 88vh;
        height: auto;
        border-radius: 16px 16px 0 0;
    }

    .lesson-search.is-lesson .lesson-search__panel {
        height: 88vh;
        padding-bottom: 64px;
        box-sizing: border-box;
    }

}

@media (min-width: 997px) {
    .lesson-search.is-lesson .lesson-search__panel {
        width: calc((100vw - 48px) * 0.49);
    }
}
