.header-main .opt-search:focus-within { box-shadow: 0 0 0 2px var(--maincolor, #5a45ad); }
.header-main .opt-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.header-main .opt-search button:focus-visible { outline: 2px solid var(--maincolor, #5a45ad); outline-offset: -3px; }
.kbn-search-panel {
    display: none;
    position: fixed;
    inset: auto;
    z-index: 10000010;
    width: min(440px, calc(100vw - 32px));
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 1px solid #e9e5f1;
    border-radius: 18px;
    background: var(--whitecolor, #fff);
    color: var(--blackcolor, #17153b);
    box-shadow: 0 18px 64px rgba(56, 35, 90, .18);
    direction: rtl;
    text-align: right;
    overflow: hidden;
    font-family: YekanBakh, sans-serif;
    font-size: 13px;
    line-height: 1.8;
}
.kbn-search-panel.is-open {
    display: flex;
    flex-direction: column;
}
.kbn-search-panel.is-compact .kbn-search-heading,
.kbn-search-panel.is-compact .kbn-search-help {
    display: none;
}
.kbn-search-panel [hidden] {
    display: none !important;
}
.kbn-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(110deg, #fff, #f3effb);
    flex-shrink: 0;
}
.kbn-search-heading-copy {
    display: flex;
    align-items: center;
    gap: 9px;
}
.kbn-search-symbol {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #fff;
    color: var(--maincolor, #5a45ad);
    font-size: 20px;
}
.kbn-search-heading strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
}
.kbn-search-heading-copy div > span {
    display: block;
    margin-top: 3px;
    color: #777087;
    font-size: 11px;
}
.kbn-search-panel button {
    font: inherit;
    cursor: pointer;
}
.kbn-search-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    color: #777087;
    background: rgba(255, 255, 255, .8);
    font-size: 24px !important;
}
.kbn-search-content {
    padding: 12px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
}
.kbn-search-content section + section {
    margin-top: 16px;
}
.kbn-search-content section[hidden] + section {
    margin-top: 0;
}
.kbn-search-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.kbn-search-section-heading h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.8;
}
.kbn-search-section-heading > span {
    color: #777087;
    font-size: 11px;
}
.kbn-search-clear {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--maincolor, #5a45ad);
    font-size: 12px !important;
}
.kbn-search-recent-list, .kbn-search-shortcut-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kbn-search-recent-item {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid #eae6f0;
    border-radius: 12px;
    background: #f8f7fb;
}
.kbn-search-recent-term {
    overflow: hidden;
    max-width: 230px;
    padding: 9px 12px 9px 4px;
    border: 0;
    background: transparent;
    color: var(--blackcolor, #17153b);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.kbn-search-recent-term::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-inline-end: 7px;
    border: 1.5px solid #9b8db0;
    border-radius: 50%;
}
.kbn-search-remove {
    width: 32px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8b7d9a;
    font-size: 18px !important;
}
.kbn-search-shortcut-list a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 11px;
    border-radius: 12px;
    background: #f0ebf9;
    color: #5a45ad;
    text-decoration: none;
    font-weight: 600;
}
.kbn-search-shortcut-list a::after {
    content: "←";
}
.kbn-search-history-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed #e2daed;
    border-radius: 14px;
    background: #fcfbfe;
    color: #777087;
    font-size: 12px;
}
.kbn-search-result-list {
    display: grid;
    gap: 6px;
}
.kbn-search-result-list a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #eeebf4;
    border-radius: 12px;
    color: var(--blackcolor, #17153b);
    text-decoration: none;
}
.kbn-search-result-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #f4f0f7;
    color: #826c91;
    font-size: 18px;
}
.kbn-search-result-copy {
    flex: 1;
    min-width: 0;
}
.kbn-search-result-copy strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.kbn-search-result-copy small {
    display: block;
    margin-top: 2px;
    color: #777087;
    font-size: 11px;
}
.kbn-search-result-arrow {
    color: var(--maincolor, #5a45ad);
}
.kbn-search-status {
    margin: 0;
    color: #777087;
    font-size: 12px;
}
.kbn-search-status:not(:empty) {
    padding: 14px 0 6px;
}
.kbn-search-status.is-loading::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-inline-end: 8px;
    border: 2px solid #e7dff3;
    border-top-color: var(--maincolor, #5a45ad);
    border-radius: 50%;
    vertical-align: middle;
    animation: kbn-search-spin .6s linear infinite;
}
.kbn-search-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 16px 10px;
    padding: 9px 12px;
    border-radius: 14px;
    background: var(--maincolor, #5a45ad);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    flex-shrink: 0;
}
.kbn-search-all:hover {
    background: var(--subcolor, #403080);
    color: #fff;
}
.kbn-search-help {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-top: 1px solid #eeebf4;
    color: #777087;
    font-size: 11px;
    flex-shrink: 0;
}
.kbn-search-help > span:first-child {
    flex: 1;
}
.kbn-search-help kbd {
    padding: 1px 5px;
    border: 1px solid #e4dced;
    border-radius: 5px;
    background: #f8f7fb;
    color: #777087;
    font: inherit;
}
.kbn-search-panel :is(a, button):hover {
    filter: brightness(.96);
}
.kbn-search-panel :is(a, button):focus-visible {
    outline: 2px solid var(--maincolor, #5a45ad) !important;
    outline-offset: 2px;
}
@keyframes kbn-search-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 640px) {
    .header-main .head-fixed .options-site .opt-search,
    .header-main .head-fixed.affix .options-site .opt-search {
        width: 160px;
        max-width: calc(100vw - 140px);
    }
    .header-main .head-fixed .options-site .opt-search input,
    .header-main .head-fixed .options-site .opt-search input:focus,
    .header-main .head-fixed.affix .options-site .opt-search input {
        width: 100%;
        min-width: 0;
        padding: 8px 16px 8px 50px;
    }
    .kbn-search-panel { border-radius: 18px; }
    .kbn-search-heading { padding: 12px 16px; }
    .kbn-search-heading strong { font-size: 14px; }
    .kbn-search-heading-copy { gap: 9px; }
    .kbn-search-heading-copy div > span { font-size: 11px; }
    .kbn-search-content { padding: 12px 16px; }
    .kbn-search-all { margin-inline: 16px; }
    .kbn-search-help { padding-inline: 16px; }
    .kbn-search-help > kbd, .kbn-search-help > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .kbn-search-status.is-loading::before { animation: none; }
}
