/* Search history — enabled via body.search-history-enabled */

/* Isolated search field (test pages only — not production main-search-*) */
.search-history-field {
    margin: 20px auto 10px;
    position: relative;
    background: #fff;
    border: 2px solid #ededed;
    border-radius: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 8px 7px 15px;
    color: #555;
    box-sizing: border-box;
}

.search-history-input {
    flex: 1 1 0%;
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 19px;
    color: #555;
    background: transparent;
}

.search-history-input::-webkit-input-placeholder { color: #aaa; opacity: 1; }
.search-history-input::-moz-placeholder { color: #aaa; opacity: 1; }
.search-history-input:-moz-placeholder { color: #aaa; opacity: 1; }
.search-history-input:-ms-input-placeholder { color: #aaa; opacity: 1; }

.search-history-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Paste / clear — fully isolated from production (.paste / .clear), toggled via .has-search-text */
[data-search-history].search-history-form .search-history-btn--paste,
[data-search-history].search-history-form .search-history-btn--clear {
    border: none;
    background: none;
    outline: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    display: none !important;
    padding-right: 10px;
}

[data-search-history].search-history-form .search-history-btn--paste svg,
[data-search-history].search-history-form .search-history-btn--clear svg {
    fill: #ccc;
    width: 27px;
    height: 27px;
    display: block;
}

[data-search-history].search-history-form:not(.has-search-text) .search-history-btn--paste {
    display: flex !important;
}

[data-search-history].search-history-form.has-search-text .search-history-btn--clear {
    display: flex !important;
}

[data-search-history].search-history-form .search-history-btn--paste[hidden],
[data-search-history].search-history-form .search-history-btn--clear[hidden] {
    display: none !important;
}

[data-search-history].search-history-form .search-history-btn--submit,
[data-search-history].search-history-form .search-history-btn--submit-inline {
    align-items: center;
    justify-content: center;
    background: #6b00fe !important;
    border: none;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
    border-radius: 40px;
    font-weight: 500;
    font-size: 20px;
    min-height: 44px;
    max-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
}

[data-search-history].search-history-form .search-history-btn--submit-inline {
    max-width: 44px;
}

/* Desktop main: paste + submit in pill; with text: clear + submit */
@media (min-width: 769px) {
    [data-search-history].search-history-form .search-history-btn--submit-inline {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile simple page: hide inline submit (overlay rules show it when search is open) */
@media (max-width: 768px) {
    [data-search-history].search-history-form .search-history-btn--submit-inline {
        display: none !important;
    }
}

.search-history-btn--submit {
    background: #6b00fe;
    outline: none;
    border: none;
    padding: 10px 12px;
    color: #fff;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    font-size: 20px;
    min-height: 44px;
    max-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-history-btn--submit svg {
    fill: #fff;
    width: 25px;
    height: 25px;
}

.search-history-btn--submit-inline {
    max-width: 44px;
    padding: 10px 12px;
}

.search-history-btn--submit-row {
    width: 100%;
    max-width: unset;
    position: relative;
    margin-bottom: 15px;
}

.search-history-btn--submit-row .search-history-submit-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.search-history-btn--submit-row svg {
    position: absolute;
    right: 15px;
    top: 9px;
}

.search-history-only-mob {
    display: none !important;
}

.search-history-only-desk {
    display: flex;
}

.search-history-notices {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 15px);
    width: 100%;
    max-width: 100%;
    z-index: 100001;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.search-history-notices.is-visible {
    display: flex !important;
}

.search-history-failed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: static;
    left: auto;
    transform: none;
    color: #fff;
    background: #ff3b30;
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    border-radius: 999px;
    box-sizing: border-box;
}

.search-history-notice-text {
    flex: 1;
    text-align: center;
}

.search-history-notice-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    cursor: pointer;
    line-height: 0;
}

.search-history-notice-close svg {
    display: block;
}

.search-history-report {
    display: none;
    color: #fff;
    background: #ff9500;
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    border-radius: 999px;
    text-align: center;
    box-sizing: border-box;
}

.search-history-report.is-visible {
    display: block !important;
}

.search-not-found-report-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.search-not-found-report-thanks[hidden] {
    display: none !important;
}

.main-notice-wrapper.report {
    background: #fff8e1;
    text-align: center;
    padding: 10px 20px;
    margin-top: 10px;
}
.main-notice-wrapper.report .main-notice-text {
    color: #555;
}

.search-history-main-notices {
    width: 100%;
}

.search-history-main-notices .main-notice-error,
.search-history-main-notices .main-notice-report {
    margin-top: 0;
}

.search-history-main-notices .main-notice-error.is-visible,
.search-history-main-notices .main-notice-report.is-visible {
    display: block !important;
}

.search-history-main-notices .main-notice-wrapper.error {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-history-main-notices .main-notice-wrapper.error .main-notice-text {
    flex: 1;
}

.main-notice-report .search-not-found-report-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

[data-search-history].search-history-form {
    position: relative;
}

.search-history-loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.search-history-loader--inline {
    width: 23px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid #fff;
    animation: sh-loader-spin-1 0.8s infinite linear alternate, sh-loader-spin-2 1.6s infinite linear;
}

.search-history-loader--header {
    width: 23px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid #555;
    animation: sh-loader-spin-1 0.8s infinite linear alternate, sh-loader-spin-2-plain 1.6s infinite linear;
}

@keyframes sh-loader-spin-1 {
    0%    { clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%); }
    12.5% { clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%); }
    25%   { clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%); }
    50%   { clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0 100%); }
    62.5% { clip-path: polygon(50% 50%, 100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0 100%); }
    75%   { clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0 100%); }
    100%  { clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0 100%); }
}

@keyframes sh-loader-spin-2 {
    0%     { transform: translate(-50%, -50%) scaleY(1) rotate(0deg); }
    49.99% { transform: translate(-50%, -50%) scaleY(1) rotate(135deg); }
    50%    { transform: translate(-50%, -50%) scaleY(-1) rotate(0deg); }
    100%   { transform: translate(-50%, -50%) scaleY(-1) rotate(-135deg); }
}

@keyframes sh-loader-spin-2-plain {
    0%     { transform: scaleY(1) rotate(0deg); }
    49.99% { transform: scaleY(1) rotate(135deg); }
    50%    { transform: scaleY(-1) rotate(0deg); }
    100%   { transform: scaleY(-1) rotate(-135deg); }
}

.search-history-loader--row {
    width: 45px;
    aspect-ratio: 3;
    --sh-loader-dots: no-repeat radial-gradient(circle closest-side, #fff 90%, #0000);
    background: var(--sh-loader-dots) 0% 50%, var(--sh-loader-dots) 50% 50%, var(--sh-loader-dots) 100% 50%;
    background-size: calc(100% / 3) 50%;
    animation: sh-loader-dots 1s infinite linear;
}

@keyframes sh-loader-dots {
    20% { background-position: 0% 0%, 50% 50%, 100% 50%; }
    40% { background-position: 0% 100%, 50% 0%, 100% 50%; }
    60% { background-position: 0% 50%, 50% 100%, 100% 0%; }
    80% { background-position: 0% 50%, 50% 50%, 100% 100%; }
}

[data-search-history].search-history-form .search-history-btn--submit-inline,
[data-search-history].search-history-form .search-history-btn--submit-row {
    position: relative;
}

.search-history-wrap {
    position: relative;
    width: 100%;
}

.search-history-panel {
    display: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0px 6px 14px 0px rgb(139 139 139 / 12%);
    margin-top: 8px;
    overflow: visible;
    border: 1px solid #e7e7e7;
}

.search-history-wrap.search-history-open .search-history-panel {
    display: block;
}

.search-history-panel-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 15px 15px 10px;
    border-bottom: 1px solid #ededed;
    overflow: visible;
}

.search-history-panel-title {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: #aaa;
}

.search-history-info-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-history-info-btn {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    line-height: 0;
}

.search-history-info-btn svg {
    display: block;
    fill: #ccc;
    width: 18px;
    height: 18px;
}

/* Header search form styles must not affect history panel icons */
.header-search .search-wrap .search-history-panel .search-history-info-btn svg {
    fill: #ccc;
    width: 18px;
    height: 18px;
}

.header-search .search-wrap .search-history-panel .search-history-item-icon svg {
    fill: #a77ddf;
    width: 24px;
    height: 24px;
}

.search-history-info-hint {
    display: none;
    position: absolute;
    left: 0;
    right: auto;
    bottom: calc(100% + 8px);
    width: 273px;
    padding: 12px 14px;
    background: #000000b3;
    color: #fff;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10060;
    text-align: left;
    white-space: normal;
    box-sizing: border-box;
}

.search-history-info-hint.is-visible {
    display: block;
}

.search-history-list {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 12px 12px;
}
.search-history-list::-webkit-scrollbar {
    width: 5px;
    border-radius: 5px;
}
.search-history-list::-webkit-scrollbar-track {
    /*border-radius: 5px;*/
    /*background: #fff;*/
}
.search-history-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 5px;
}
.search-history-list::-webkit-scrollbar-thumb:hover {
    background: #ddd;
    border-radius: 5px;
}

.search-history-item {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    background: #fff;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.search-history-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.search-history-item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
}

.search-history-item-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: #a77ddf;
}

.search-history-item-text {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-history-item-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    cursor: pointer;
}

.search-history-item-remove svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: #ccc;
}

.header-search .search-wrap .search-history-panel .search-history-item-remove svg {
    fill: #ccc;
    width: 24px;
    height: 24px;
}

.search-history-back {
    border: none;
    background: none;
    cursor: pointer;
    display: none;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 24px;
}
.search-history-back svg {
    fill: #ccc;
    width: 30px;
    height: 30px;
    position: absolute;
}

.search-history-enabled .search-history-field .search-history-input {
    flex: 1 1 0%;
    width: 100%;
    min-width: 0;
}

.search-history-panel.is-empty .search-history-list {
    display: none;
}

.search-history-empty {
    display: none;
    padding: 28px 16px 32px;
    text-align: center;
    font-size: 16px;
    color: #555;
}

.search-history-panel.is-empty .search-history-empty {
    display: block;
}

.search-history-enabled .header-search .search-history-wrap--header,
.search-history-enabled .header-search .search-history-wrap--header .search-history-form {
    position: relative;
    width: 100%;
}

/* Header bar: classic single-field look when search is closed */
.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-field {
    margin: 0;
    border: none;
    padding: 0;
    background: transparent;
    display: block;
}

.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-input {
    font-size: 17px;
    font-family: 'Roboto', sans-serif;
    padding: 9px 82px 8px 15px;
    background: #fff;
    color: #555;
    opacity: 1;
    width: 100%;
    line-height: 23px;
    height: 44px;
    border-radius: 40px;
    border: 2px solid #ededed;
    box-sizing: border-box;
}

.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-actions,
.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-btn--submit.search-history-only-mob,
.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-back {
    display: none !important;
}

.search-history-header-only {
    display: none;
}

.search-history-enabled .header-search .search-wrap [data-search-history] .search-history-btn--paste svg,
.search-history-enabled .header-search .search-wrap [data-search-history] .search-history-btn--clear svg {
    fill: #ccc;
}

.search-history-enabled .header-search .search-wrap .search-history-input {
    color: #555;
    opacity: 1;
}

.search-history-enabled .header-search .search-wrap .search-history-input::-webkit-input-placeholder { color: #aaa; opacity: 1; }
.search-history-enabled .header-search .search-wrap .search-history-input::-moz-placeholder { color: #aaa; opacity: 1; }
.search-history-enabled .header-search .search-wrap .search-history-input:-moz-placeholder { color: #aaa; opacity: 1; }
.search-history-enabled .header-search .search-wrap .search-history-input:-ms-input-placeholder { color: #aaa; opacity: 1; }

.search-history-enabled .header-search .search-wrap .search-history-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #fff inset;
    -webkit-text-fill-color: #555;
}

.search-history-enabled .header-search .search-wrap .search-history-header-paste {
    position: absolute;
    right: 44px;
    top: 0;
    bottom: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    z-index: 2;
    border-right: 1px solid #ededed;
    padding-right: 10px;
    margin-right: 2px;
}

.search-history-enabled .header-search .search-wrap .search-history-header-paste svg {
    fill: #ccc;
    width: 24px;
    height: 24px;
    display: block;
    position: relative;
    top: 1px;
}

.search-history-enabled .header-search .search-wrap .search-history-header-paste[hidden] {
    display: none !important;
}

.search-history-enabled .header-search .search-wrap .search-history-header-clear {
    position: absolute;
    right: 44px;
    top: 0;
    bottom: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.search-history-enabled .header-search .search-wrap .search-history-header-clear svg {
    fill: #aaa;
    width: 24px;
    height: 24px;
    display: block;
    position: relative;
    top: 1px;
}

.search-history-enabled .header-search .search-wrap .search-history-header-clear[hidden] {
    display: none !important;
}

.search-history-enabled .header-search .search-wrap .search-history-header-submit {
    position: absolute;
    border: none;
    background: none;
    right: 0;
    top: 0;
    bottom: 0;
    font-size: 19px;
    padding: 0 12px 0 3px;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.search-history-enabled .header-search .search-wrap .search-history-header-submit .search-history-loader--header {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    flex-shrink: 0;
}

.search-history-enabled .header-search .search-wrap .search-history-header-submit svg {
    fill: #555;
    width: 24px;
    height: 24px;
}

.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-header-only.search-history-header-submit,
.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-form.has-search-text .search-history-header-only.search-history-header-clear,
.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-form:not(.has-search-text) .search-history-header-only.search-history-header-paste:not([hidden]) {
    display: flex;
}

.search-history-enabled .search-history-wrap--header .search-history-form.has-search-text .search-history-header-clear {
    z-index: 2;
    border-right: 1px solid #ededed;
    padding-right: 10px;
    margin-right: 2px;
}

.search-history-enabled .search-history-wrap--header:not(.search-history-open) .search-history-input {
    padding-right: 82px;
}

/* Mobile full-screen layer (search UI portaled here) */
.search-history-mobile-layer {
    display: none;
}
.search-history-submit-icon {
    display: flex;
}

@media (max-width: 768px) {
    [data-search-history].search-history-form .search-history-btn--paste svg,
    [data-search-history].search-history-form .search-history-btn--clear svg {
        width: 24px;
        height: 24px;
        position: relative;
        top: 1px;
    }
    .search-history-only-desk {
        display: none !important;
    }

    .search-history-only-mob {
        display: flex !important;
    }

    .search-history-btn--submit-row {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }

    .search-history-field {
        padding: 3px 5px 3px 10px;
        margin: 20px auto 10px;
    }

    .search-history-panel, .search-history-item:last-child {
        border-radius: 0;
        border: none;
    }

    /* Profile header open: same search UI as main page */
    .search-history-enabled .search-history-wrap--header.search-history-open .search-history-header-only,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap--header .search-history-header-only {
        display: none !important;
    }

    .search-history-enabled .search-history-wrap--header.search-history-open .search-history-field,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap--header .search-history-field {
        display: flex;
        align-items: center;
        margin: 0;
        border: 2px solid #ededed;
        border-radius: 40px;
        padding: 7px 8px 7px 15px;
        background: #fff;
    }

    .search-history-enabled .search-history-wrap--header.search-history-open .search-history-input,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap--header .search-history-input {
        height: auto;
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 0 10px;
        font-size: 16px;
        line-height: normal;
    }

    .search-history-enabled .search-history-wrap--header.search-history-open .search-history-actions,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap--header .search-history-actions,
    .search-history-enabled .search-history-wrap--main.is-active .search-history-actions,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap--main .search-history-actions {
        display: flex !important;
        flex-shrink: 0;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-field .search-history-input,
    .search-history-enabled .search-history-mobile-layer .search-history-field .search-history-input,
    .search-history-enabled .search-history-wrap.is-active .search-history-field .search-history-input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-back,
    .search-history-enabled .search-history-wrap.is-active .search-history-back {
        display: flex !important;
        min-width: 24px;
        min-height: 36px;
        justify-content: center;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-field:has(.search-history-back),
    .search-history-enabled .search-history-wrap.is-active .search-history-field:has(.search-history-back) {
        padding-left: 6px;
    }

    .search-history-enabled .search-history-mobile-layer:not(:empty) {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100000;
        background: #fff;
        padding: 10px;
        box-sizing: border-box;
        overflow: hidden;
    }

    body.search-history-enabled.search-history-mobile-active {
        overflow: hidden;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-wrap {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        width: 100%;
        max-width: 100%;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap > form,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap > form {
        flex-shrink: 0;
        position: relative;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap .search-history-notices,
    .search-history-enabled .search-history-mobile-layer .search-history-notices {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: calc(100% + 15px);
        width: 100%;
        max-width: 100%;
        z-index: 100001;
        flex-direction: column;
        gap: 10px;
        box-sizing: border-box;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap .search-history-notices.is-visible,
    .search-history-enabled .search-history-mobile-layer .search-history-notices.is-visible {
        display: flex !important;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap .search-history-failed,
    .search-history-enabled .search-history-mobile-layer .search-history-failed {
        position: static;
        left: auto;
        transform: none;
        top: auto;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap .search-history-report.is-visible,
    .search-history-enabled .search-history-mobile-layer .search-history-report.is-visible {
        display: block !important;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-panel {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        box-shadow: none;
        overflow: visible;
        margin-top: 0;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-panel-head {
        flex-shrink: 0;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-panel.is-empty {
        display: block !important;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-panel.is-empty .search-history-empty {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 120px;
    }

    .search-history-enabled .search-history-mobile-layer .main-title,
    .search-history-enabled .search-history-mobile-layer .live-downloader-tasks-wrapper,
    .search-history-enabled .search-history-mobile-layer .live-downloader-error-wrapper {
        display: none !important;
    }

    /* Main + profile (open): inline purple submit inside pill */
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main > .search-history-btn--submit.search-history-only-mob,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main > .search-history-btn--submit.search-history-only-mob,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main > .search-history-btn--submit.search-history-only-mob,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main > .search-history-btn--submit.search-history-only-mob,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main > .search-history-btn--submit.search-history-only-mob {
        display: none !important;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main .search-history-actions .search-history-btn--submit-inline,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main .search-history-actions .search-history-btn--submit-inline,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main .search-history-actions .search-history-btn--submit-inline,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main .search-history-actions .search-history-btn--submit-inline,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main .search-history-actions .search-history-btn--submit-inline {
        display: none !important;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main.has-search-text .search-history-actions .search-history-btn--submit-inline,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main.has-search-text .search-history-actions .search-history-btn--submit-inline,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main.has-search-text .search-history-actions .search-history-btn--submit-inline,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main.has-search-text .search-history-actions .search-history-btn--submit-inline,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main.has-search-text .search-history-actions .search-history-btn--submit-inline {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 50% !important;
        flex-shrink: 0;
        padding-left: 2px !important;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main .search-history-actions .search-history-btn--submit-inline span,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main .search-history-actions .search-history-btn--submit-inline span,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main .search-history-actions .search-history-btn--submit-inline span,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main .search-history-actions .search-history-btn--submit-inline span,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main .search-history-actions .search-history-btn--submit-inline span {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main .search-history-actions .search-history-btn--submit-inline svg,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main .search-history-actions .search-history-btn--submit-inline svg,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main .search-history-actions .search-history-btn--submit-inline svg,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main .search-history-actions .search-history-btn--submit-inline svg,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main .search-history-actions .search-history-btn--submit-inline svg {
        position: static !important;
        width: 25px;
        height: 25px;
        margin: 0 !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main .search-history-field,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main .search-history-field,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main .search-history-field,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main .search-history-field,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main .search-history-field {
        display: flex;
        align-items: center;
        margin: 0;
        padding: 3px 6px 3px 10px;
    }

    body.search-history-enabled.search-history-mobile-active .search-history-wrap--main form.search-history-form--main .search-history-actions,
    body.search-history-enabled.search-history-mobile-active .search-history-wrap--header.search-history-open form.search-history-form--main .search-history-actions,
    .search-history-enabled .search-history-wrap--main.is-active form.search-history-form--main .search-history-actions,
    .search-history-enabled .search-history-wrap--header.search-history-open.is-active form.search-history-form--main .search-history-actions,
    .search-history-enabled .search-history-mobile-layer .search-history-wrap form.search-history-form--main .search-history-actions {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        gap: 0;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-input {
        font-size: 16px;
    }

    /* Search stays pinned; only the history list scrolls when needed */
    body.search-history-enabled.search-history-mobile-active .search-history-list,
    .search-history-enabled .search-history-mobile-layer .search-history-list,
    .search-history-enabled .search-history-wrap.is-active .search-history-list {
        flex: 1;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .search-history-enabled .search-history-mobile-layer .search-history-wrap--header:not(.search-history-open) .search-history-header-only {
        display: none !important;
    }

    /* Info tooltip: center horizontally above panel head on mobile */
    .search-history-info-wrap {
        position: static;
    }

    .search-history-info-hint {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(273px, calc(100% - 30px));
        bottom: calc(100% - 12px);
    }
}

@media (min-width: 769px) {
    .search-history-enabled .search-history-back {
        display: none !important;
    }

    /* Desktop profile: keep classic header search when history is open */
    .search-history-enabled .search-history-wrap--header .search-history-field {
        margin: 0;
        border: none;
        padding: 0;
        background: transparent;
        display: block;
    }

    .search-history-enabled .search-history-wrap--header .search-history-input {
        font-size: 17px;
        font-family: 'Roboto', sans-serif;
        padding: 9px 82px 8px 15px;
        background: #fff;
        color: #555;
        opacity: 1;
        width: 100%;
        line-height: 23px;
        height: 44px;
        border-radius: 40px;
        border: 2px solid #ededed;
        box-sizing: border-box;
    }

    .search-history-enabled .search-history-wrap--header .search-history-actions,
    .search-history-enabled .search-history-wrap--header .search-history-btn--submit.search-history-only-mob,
    .search-history-enabled .search-history-wrap--header .search-history-back {
        display: none !important;
    }

    .search-history-enabled .search-history-wrap--header .search-history-header-only.search-history-header-submit,
    .search-history-enabled .search-history-wrap--header .search-history-form.has-search-text .search-history-header-only.search-history-header-clear,
    .search-history-enabled .search-history-wrap--header .search-history-form:not(.has-search-text) .search-history-header-only.search-history-header-paste:not([hidden]) {
        display: flex;
    }

    .search-history-enabled .search-history-wrap--header .search-history-input {
        padding-right: 82px;
    }

    .search-history-enabled .search-history-wrap--main {
        position: relative;
        z-index: 20;
    }

    .search-history-enabled .search-history-panel {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 10050;
        margin-top: 8px;
    }
}
