[data-dpp-search-root],
.dpp-global-search-fallback {
    position: relative;
    width: 100%;
    isolation: isolate;
}

.dpp-global-search-panel {
    position: absolute;
    inset: calc(100% + 8px) 0 auto 0;
    z-index: 99990;
    overflow: hidden;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    border: 1px solid var(--theme-border, rgba(15, 23, 42, .12));
    border-radius: 16px;
    background: var(--theme-card, #fff);
    color: var(--theme-text, #172033);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .18);
    text-align: right;
    direction: rtl;
}

.dpp-global-search-panel[hidden] { display: none !important; }
.dpp-global-search-list { padding: 7px; }

.dpp-global-search-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 11px;
    min-height: 62px;
    padding: 7px 9px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background .18s ease, transform .18s ease;
}

.dpp-global-search-item:hover,
.dpp-global-search-item.is-active {
    background: var(--theme-primary-soft, rgba(124, 58, 237, .09));
    color: var(--theme-text, #172033);
    transform: translateX(-2px);
}

.dpp-global-search-media {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--theme-primary-soft, rgba(124, 58, 237, .1));
    color: var(--theme-primary, #7c3aed);
    font-size: 21px;
    font-weight: 900;
}

.dpp-global-search-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dpp-global-search-content { min-width: 0; display: grid; gap: 4px; }
.dpp-global-search-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.65; }
.dpp-global-search-meta { min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--theme-muted, #687386); font-size: 11px; line-height: 1.55; }
.dpp-global-search-position { padding: 2px 7px; border-radius: 999px; background: var(--theme-card-2, #f5f7fb); border: 1px solid var(--theme-border, rgba(15, 23, 42, .1)); color: inherit; font-size: 10px; }
.dpp-global-search-arrow { color: var(--theme-primary, #7c3aed); font-size: 18px; text-align: center; }

.dpp-global-search-status {
    padding: 20px 14px;
    color: var(--theme-muted, #687386);
    text-align: center;
    font-size: 12px;
    line-height: 1.9;
}
.dpp-global-search-status.is-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-inline-end: 8px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-inline-start-color: transparent;
    border-radius: 50%;
    animation: dpp-search-spin .7s linear infinite;
}
.dpp-global-search-status.is-error { color: #b42318; }
.dpp-global-search-status.is-locked { color: var(--theme-text, #172033); }

.dpp-global-search-all {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 14px;
    border-top: 1px solid var(--theme-border, rgba(15, 23, 42, .1));
    background: var(--theme-card-2, #f7f8fc);
    color: var(--theme-primary, #7c3aed);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}
.dpp-global-search-all:hover { background: var(--theme-primary-soft, rgba(124, 58, 237, .09)); color: var(--theme-primary, #7c3aed); }

[data-theme="dark"] .dpp-global-search-panel,
.theme-dark .dpp-global-search-panel {
    border-color: rgba(255, 255, 255, .1);
    background: var(--theme-card, #171923);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .46);
}
[data-theme="dark"] .dpp-global-search-position,
[data-theme="dark"] .dpp-global-search-all,
.theme-dark .dpp-global-search-position,
.theme-dark .dpp-global-search-all { border-color: rgba(255, 255, 255, .08); }

@keyframes dpp-search-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
    .dpp-global-search-panel { inset-inline: 0; max-height: min(65vh, 470px); border-radius: 14px; }
    .dpp-global-search-item { grid-template-columns: 43px minmax(0, 1fr) 18px; gap: 9px; min-height: 57px; padding: 7px; }
    .dpp-global-search-media { width: 43px; height: 43px; border-radius: 10px; }
    .dpp-global-search-title { font-size: 12px; }
    .dpp-global-search-meta { font-size: 10px; }
}
