.search-widget {
    position: relative;
    width: 100%;
    color: var(--color-text, #111511);
}

.site-header {
    position: relative;
    z-index: 900;
}

.site-header__topbar {
    background:
        linear-gradient(90deg, rgba(0, 155, 124, 0.18) 0%, rgba(0, 155, 124, 0.1) 100%),
        #24342f;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__topbar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}

.site-header__search-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.site-header__search-open:hover,
.site-header__search-open:focus-visible {
    border-color: rgba(0, 155, 124, 0.48);
    background: rgba(0, 155, 124, 0.18);
}

.site-header__search-open-icon {
    display: block;
    flex: 0 0 auto;
}

.site-header__search-shell {
    position: relative;
    z-index: 1100;
    border-bottom: 1px solid var(--color-border, #dde3e0);
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(17, 21, 17, 0.08);
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    will-change: opacity, transform;
}

.site-header__search-shell.is-open {
    opacity: 1;
    transform: translateY(0);
}

.site-header__search-shell-inner {
    position: relative;
    z-index: 1;
    padding-top: 20px;
    padding-bottom: 28px;
}

.site-header__search-shell-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.site-header__search-shell-close {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--color-text, #111511);
    font-size: 15px;
    font-weight: 500;
}

.site-header__search-shell-close-icon {
    position: relative;
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 auto;
}

.site-header__search-shell-close-icon::before,
.site-header__search-shell-close-icon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
}

.site-header__search-shell-close-icon::before {
    transform: rotate(45deg);
}

.site-header__search-shell-close-icon::after {
    transform: rotate(-45deg);
}

.site-header__search-shell-widget {
    width: 100%;
}

.site-search-shell-open {
    overflow-x: hidden;
}

.search-widget__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-widget__row {
    display: flex;
    gap: 14px;
    align-items: end;
}

.search-widget__field {
    flex: 1 1 auto;
}

.search-widget__label,
.search-widget__date-label,
.search-widget__group-title {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-muted, #5a665e);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.search-widget__input,
.search-widget__date-input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--color-border, #dde3e0);
    border-radius: 16px;
    padding: 14px 18px;
    background: var(--color-page, #ffffff);
    color: var(--color-text, #111511);
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.search-widget__input::placeholder,
.search-widget__date-input::placeholder {
    color: var(--color-text-muted, #5a665e);
}

.search-widget__input:focus,
.search-widget__date-input:focus {
    outline: none;
    border-color: var(--color-accent, #009b7c);
    box-shadow: 0 0 0 4px var(--color-accent-soft, rgba(47, 125, 50, 0.12));
}

.search-widget__submit {
    flex: 0 0 auto;
}

.search-widget__submit-button {
    min-width: 144px;
    min-height: 54px;
    padding: 14px 28px;
    border: 1px solid var(--color-accent, #009b7c);
    border-radius: 16px;
    background: var(--color-accent, #009b7c);
    color: #ffffff;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.search-widget__submit-button:hover,
.search-widget__submit-button:focus-visible {
    border-color: var(--color-text, #000000);
    background: var(--color-text, #000000);
    color: #ffffff;
}

.search-widget__settings {
    position: relative;
}

.search-widget__settings-link,
.search-widget__reset {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--color-accent, #009b7c);
    font-size: 14px;
    font-weight: 600;
    text-underline-offset: 0.18em;
}

.search-widget__settings-link:hover,
.search-widget__reset:hover {
    text-decoration: underline;
}

.search-widget__layer {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 1300;
    width: min(720px, 100%);
}

.search-widget__layer-inner {
    border: 1px solid var(--color-border, #dde3e0);
    border-radius: 24px;
    background: var(--color-surface, #ffffff);
    box-shadow: 0 20px 44px rgba(17, 21, 17, 0.12);
    padding: 24px;
}

.search-widget__layer-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.search-widget__layer-close {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border, #dde3e0);
    border-radius: 50%;
    background: var(--color-surface-muted, #f5f7f7);
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.search-widget__layer-close:hover,
.search-widget__layer-close:focus-visible {
    border-color: var(--color-accent, #009b7c);
    background: var(--color-accent-soft, rgba(47, 125, 50, 0.12));
}

.search-widget__layer-close::before,
.search-widget__layer-close::after {
    content: '';
    position: absolute;
    top: 19px;
    left: 11px;
    width: 16px;
    height: 2px;
    background: var(--color-text, #111511);
}

.search-widget__layer-close::before {
    transform: rotate(45deg);
}

.search-widget__layer-close::after {
    transform: rotate(-45deg);
}

.search-widget__group {
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.search-widget__group:last-child {
    margin-bottom: 0;
}

.search-widget__check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--color-text, #111511);
}

.search-widget__check:last-child {
    margin-bottom: 0;
}

.search-widget__check input,
.search-widget__check-input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-right: 0;
    accent-color: var(--color-accent, #009b7c);
}

.search-widget__check-label {
    display: inline;
    font-weight: 400;
    margin: 0;
}

.search-widget__dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.search-widget__actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

.search-page {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.search-page__title {
    margin: 0;
}

.search-page__widget {
    padding: 28px;
    border: 1px solid var(--color-border, #dde3e0);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(0, 155, 124, 0.06) 0%, rgba(0, 155, 124, 0.02) 100%),
        var(--color-surface-muted, #f5f7f7);
}

.search-page__meta,
.search-page__hint,
.search-page__empty,
.search-page__date,
.search-page__type {
    color: var(--color-text-muted, #5b6664);
}

.search-page__meta {
    font-size: 0.95rem;
}

.search-page__results {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.search-page__result {
    padding: 22px 24px;
    border: 1px solid var(--color-border, #dde3e0);
    border-radius: 22px;
    background: var(--color-surface, #ffffff);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.search-page__result:hover {
    border-color: rgba(0, 155, 124, 0.28);
    box-shadow: 0 16px 32px rgba(17, 21, 17, 0.06);
    transform: translateY(-1px);
}

.search-page__result:last-child {
    margin-bottom: 0;
}

.search-page__type {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--color-accent-soft, rgba(47, 125, 50, 0.12));
    color: var(--color-accent-strong, #0b6a56);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.search-page__result-title {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.search-page__result-link {
    color: var(--color-text, #111511);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.search-page__result-link:hover {
    color: var(--color-accent-strong, #0b6a56);
}

.search-page__snippet {
    margin-bottom: 12px;
    color: var(--color-text, #111511);
    line-height: 1.6;
}

.search-page mark {
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(0, 155, 124, 0.16);
}

@media (max-width: 767px) {
    .site-header__topbar-inner {
        justify-content: space-between;
        gap: 10px;
        min-height: 44px;
    }

    .site-header__search-open {
        padding: 8px 12px;
        font-size: 13px;
    }

    .site-header__search-shell-inner {
        padding-top: 16px;
        padding-bottom: 20px;
    }

    .search-widget__row,
    .search-widget__dates {
        grid-template-columns: 1fr;
        display: grid;
    }

    .search-widget__submit-button {
        width: 100%;
    }

    .search-widget__layer {
        position: static;
        width: 100%;
    }

    .search-page__widget {
        padding: 18px;
    }

    .search-page__result {
        padding: 18px;
        border-radius: 18px;
    }

    .search-page__result-title {
        font-size: 20px;
    }
}
