:root {
    --mcd-dropdown-max-height: 75vh;
    --mcd-snippet-lines: 3;
    /* Visual Theme Custom Properties */
    --mcd-tab-bg: #f1f5f9;
    --mcd-tab-color: #475569;
    --mcd-tab-border: #cbd5e1;
    --mcd-tab-hover-bg: #cb3366;
    --mcd-tab-hover-color: #ffffff;
    --mcd-tab-active-bg: #1e5974;
    --mcd-tab-active-color: #ffffff;
    --mcd-tab-active-border: #1e5974;
    --mcd-input-border: #1e5974;
    --mcd-input-focus-shadow: rgba(30, 89, 116, 0.25);
    --mcd-panel-bg: #f8fafc;
    --mcd-panel-border: #e2e8f0;
    --mcd-dropdown-bg: #ffffff;
    --mcd-highlight-bg: #fef08a;
    --mcd-highlight-color: #854d0e;
}

.mcd-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
    box-sizing: border-box;
    z-index: 99999;
}

.mcd-search-wrapper * {
    box-sizing: border-box;
}

/* Tabs */
.mcd-search-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.mcd-scope-scroll-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.mcd-tab-btn {
    background: var(--mcd-tab-bg, #f1f5f9);
    color: var(--mcd-tab-color, #475569);
    border: 1px solid var(--mcd-tab-border, #cbd5e1);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

.mcd-search-wrapper .mcd-tab-btn.active,
.mcd-tab-btn.active {
    background: var(--mcd-tab-active-bg, #1e5974) !important;
    color: var(--mcd-tab-active-color, #ffffff) !important;
    border-color: var(--mcd-tab-active-border, #1e5974) !important;
}

.mcd-search-wrapper .mcd-tab-btn:hover,
.mcd-search-wrapper .mcd-tab-btn.active:hover,
.mcd-tab-btn:hover,
.mcd-tab-btn.active:hover {
    background: var(--mcd-tab-hover-bg, #cb3366) !important;
    border-color: var(--mcd-tab-hover-bg, #cb3366) !important;
    color: var(--mcd-tab-hover-color, #ffffff) !important;
}

.mcd-toggle-advanced-btn {
    margin-left: auto;
    background: #f8fafc;
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .mcd-scope-scroll-wrapper {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 4px !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .mcd-scope-scroll-wrapper::-webkit-scrollbar {
        display: none !important;
    }
}

.mcd-toggle-advanced-btn.active {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

/* Input Group */
.mcd-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid var(--mcd-input-border, #1e5974);
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.mcd-input-group:focus-within {
    border-color: var(--mcd-input-border, #1e5974);
    box-shadow: 0 4px 12px var(--mcd-input-focus-shadow, rgba(30, 89, 116, 0.25));
}

.mcd-search-icon {
    display: flex;
    align-items: center;
    padding-left: 8px;
    color: #64748b;
}

.mcd-help-icon {
    display: flex;
    align-items: center;
    padding-left: 14px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.mcd-search-icon {
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: #64748b;
}

.mcd-help-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 14px 16px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
    z-index: 100000;
}

.mcd-help-popover ul {
    margin: 8px 0 0 16px;
    padding: 0;
}

.mcd-help-popover li {
    margin-bottom: 6px;
}

.mcd-help-popover code {
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 4px;
    color: #0f172a;
    font-size: 12px;
}

.mcd-search-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent;
    padding: 12px 14px;
    font-size: 15px;
    color: #1e293b;
    box-shadow: none !important;
}

/* Hide native browser clear button in search input */
.mcd-search-input::-webkit-search-cancel-button,
.mcd-search-input::-webkit-search-decoration,
.mcd-search-input::-webkit-search-results-button,
.mcd-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

.mcd-search-input::placeholder {
    color: #94a3b8;
}

.mcd-clear-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 22px !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 0 12px !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.mcd-clear-btn:hover {
    color: #475569 !important;
    background: transparent !important;
}

.mcd-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--mcd-input-border, #1e5974);
    border-radius: 50%;
    margin-right: 14px;
    animation: mcd-spin 0.8s linear infinite;
}

@keyframes mcd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Advanced Filter Panel */
.mcd-advanced-panel {
    background: var(--mcd-panel-bg, #f8fafc);
    border: 1px solid var(--mcd-panel-border, #e2e8f0);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.mcd-adv-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
}

.mcd-adv-divider {
    flex: 0 0 100% !important;
    width: 100% !important;
    height: 0 !important;
    border: none !important;
    border-top: 1px solid var(--mcd-panel-border, #e2e8f0) !important;
    margin: 8px 0 !important;
    padding: 0 !important;
    clear: both !important;
}

.mcd-adv-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--mcd-panel-border, #e2e8f0);
    width: 100%;
}

.mcd-adv-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.mcd-adv-row-1 {
    margin-bottom: 12px;
}

.mcd-adv-row-2 {
    border-top: 1px solid var(--mcd-panel-border, #e2e8f0);
    padding-top: 12px;
}

.mcd-filter-group {
    display: flex;
    flex-direction: column;
}

.mcd-fg-orderby {
    flex: 1 1 180px;
}

.mcd-fg-snippet {
    flex: 1 1 140px;
}

.mcd-fg-yorum,
.mcd-fg-views,
.mcd-fg-likes,
.mcd-fg-shares,
.mcd-fg-prints {
    flex: 1 1 95px;
}

.mcd-fg-year {
    flex: 0 0 auto;
}

.mcd-fg-month {
    flex: 1 1 140px;
    max-width: 200px;
}

.mcd-fg-reset {
    margin-left: auto;
    flex: 0 0 auto;
    align-self: flex-end;
}

.mcd-filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.mcd-adv-input,
.mcd-adv-select {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #1e293b;
    box-sizing: border-box;
}

.mcd-range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mcd-range-inputs span {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

/* Year inputs: wide enough so 4-digit years (2004, 2026) are never truncated */
.mcd-adv-yil-min,
.mcd-adv-yil-max {
    width: 78px !important;
    min-width: 75px !important;
    text-align: center !important;
    padding: 6px 4px !important;
    font-size: 13px !important;
    letter-spacing: 0.02em;
    -moz-appearance: textfield;
}

.mcd-adv-yil-min::-webkit-inner-spin-button,
.mcd-adv-yil-min::-webkit-outer-spin-button,
.mcd-adv-yil-max::-webkit-inner-spin-button,
.mcd-adv-yil-max::-webkit-outer-spin-button {
    opacity: 0.35;
    margin-right: -2px;
}

.mcd-btn-reset-filters {
    background: #ffffff;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 5px;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.mcd-btn-reset-filters:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}

/* Results Dropdown */
.mcd-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--mcd-dropdown-bg, #ffffff);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--mcd-panel-border, #e2e8f0);
    z-index: 99999;
    overflow: hidden;
}

.mcd-results-header {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Facet / Ön Yüz Sayacı Bar, Multi-Level Rows & Scroll Controls */
.mcd-facet-bar {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.mcd-facet-row {
    position: relative;
    width: 100%;
}

.mcd-facet-row + .mcd-facet-row {
    border-top: 1px dashed #cbd5e1;
    background: #f1f5f9;
}

.mcd-facet-row-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 4px;
}

.mcd-facet-row-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior: contain;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    flex: 1 1 auto;
    min-width: 0;
}

.mcd-facet-row-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Scroll Arrow Buttons (Fixed Left & Right in natural flex layout, Ultra-Compact Circular & Theme-Reset) */
.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn,
.mcd-search-wrapper button.mcd-facet-scroll-btn,
.mcd-facet-bar button.mcd-facet-scroll-btn,
button.mcd-facet-scroll-btn,
.mcd-facet-scroll-btn {
    position: relative !important;
    flex: 0 0 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 2px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    background-image: none !important;
    color: #475569 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    line-height: 1 !important;
    font-size: 0 !important;
    text-indent: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-shadow: none !important;
    filter: none !important;
    overflow: hidden !important;
    vertical-align: middle !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease-in-out !important;
    z-index: 2 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.mcd-facet-scroll-prev,
.mcd-facet-scroll-next {
    background: #ffffff !important;
}

.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn.is-hidden,
.mcd-search-wrapper button.mcd-facet-scroll-btn.is-hidden,
.mcd-facet-bar button.mcd-facet-scroll-btn.is-hidden,
button.mcd-facet-scroll-btn.is-hidden,
.mcd-facet-scroll-btn.is-hidden {
    display: none !important;
}

.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn:focus,
.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn:focus-visible,
button.mcd-facet-scroll-btn:focus,
.mcd-facet-scroll-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(30, 89, 116, 0.25) !important;
    border-color: var(--mcd-tab-active-bg, #1e5974) !important;
}

.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn:hover:not(.is-disabled),
button.mcd-facet-scroll-btn:hover:not(.is-disabled),
.mcd-facet-scroll-btn:hover:not(.is-disabled) {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #94a3b8 !important;
    color: var(--mcd-tab-active-bg, #1e5974) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn:active:not(.is-disabled),
button.mcd-facet-scroll-btn:active:not(.is-disabled),
.mcd-facet-scroll-btn:active:not(.is-disabled) {
    transform: scale(0.95) !important;
    background: #f8fafc !important;
    background-image: none !important;
}

.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn.is-disabled,
button.mcd-facet-scroll-btn.is-disabled,
.mcd-facet-scroll-btn.is-disabled {
    cursor: default !important;
    pointer-events: none !important;
    opacity: 0.3 !important;
    background: #f1f5f9 !important;
    background-image: none !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
}

.mcd-search-wrapper .mcd-facet-bar button.mcd-facet-scroll-btn svg,
.mcd-search-wrapper button.mcd-facet-scroll-btn svg,
.mcd-facet-scroll-btn svg {
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    max-width: 12px !important;
    min-height: 12px !important;
    max-height: 12px !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
    stroke: currentColor !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

.mcd-facet-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--mcd-tab-color, #475569);
    background: #ffffff;
    border: 1px solid var(--mcd-tab-border, #cbd5e1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    line-height: 1.4;
    user-select: none;
    flex-shrink: 0;
}

.mcd-facet-pill:hover {
    background: var(--mcd-tab-hover-bg, #f1f5f9);
    color: var(--mcd-tab-hover-color, #1e293b);
    border-color: #94a3b8;
}

.mcd-facet-pill.active {
    background: var(--mcd-tab-active-bg, #1e5974);
    color: var(--mcd-tab-active-color, #ffffff);
    border-color: var(--mcd-tab-active-border, #1e5974);
    font-weight: 600;
}

.mcd-facet-pill .mcd-facet-count {
    font-size: 11px;
    opacity: 0.85;
}

.mcd-facet-pill.active .mcd-facet-count {
    opacity: 1;
    color: #ffffff;
}

/* Advanced Panel Facet Toggle */
.mcd-adv-facet-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.mcd-adv-facet-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
}

.mcd-adv-facet-toggle-label input[type="checkbox"] {
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: var(--mcd-tab-active-bg, #1e5974);
}

.mcd-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: var(--mcd-dropdown-max-height, 75vh);
    overflow-y: auto;
}

.mcd-result-item {
    border-bottom: 1px solid #f1f5f9;
}

.mcd-result-item:last-child {
    border-bottom: none;
}

.mcd-result-link {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease-in-out;
}

.mcd-result-link:hover,
.mcd-result-link:focus {
    background: #f8fafc;
}

.mcd-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    margin-bottom: 4px;
}

.mcd-result-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.mcd-badge-tur {
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.mcd-result-snippet {
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--mcd-snippet-lines, 3);
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcd-no-results {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.mcd-no-results-msg {
    margin-bottom: 8px;
}

.mcd-did-you-mean {
    margin-top: 10px;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e5974;
    font-size: 14px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mcd-suggestion-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.mcd-suggestion-link:hover {
    color: #1d4ed8;
    background: #dbeafe;
}

/* Pagination */
.mcd-pagination-wrapper {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

.mcd-pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.mcd-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.mcd-page-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.mcd-page-btn.active {
    background: var(--mcd-tab-active-bg, #1e5974);
    color: var(--mcd-tab-active-color, #ffffff);
    border-color: var(--mcd-tab-active-border, #1e5974);
    cursor: default;
}

.mcd-results-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.mcd-view-all-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--mcd-tab-active-bg, #1e5974);
    text-decoration: none;
}

.mcd-view-all-link:hover {
    text-decoration: underline;
}

/* Keyword Highlight */
mark.mcd-highlight {
    background-color: var(--mcd-highlight-bg, #fef08a);
    color: var(--mcd-highlight-color, #854d0e);
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* Search History Pulldown */
.mcd-history-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--mcd-dropdown-bg, #ffffff);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--mcd-panel-border, #e2e8f0);
    z-index: 99999;
    overflow: hidden;
}

.mcd-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
}

.mcd-history-clear-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    line-height: normal !important;
    transition: color 0.15s ease, background 0.15s ease !important;
}

.mcd-history-clear-btn:hover {
    color: #dc2626 !important;
    background: #fee2e2 !important;
    text-decoration: none !important;
}

.mcd-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.mcd-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mcd-history-item:last-child {
    border-bottom: none;
}

.mcd-history-item:hover {
    background: #f8fafc;
}

.mcd-history-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.mcd-history-icon {
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.mcd-history-term {
    font-size: 14px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcd-history-remove-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #94a3b8 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 3px 7px !important;
    border-radius: 4px !important;
    margin-left: 8px !important;
    transition: all 0.15s ease !important;
}

.mcd-history-remove-btn:hover {
    color: #ef4444 !important;
    background: #fee2e2 !important;
}

/* ==========================================================================
   Mobile Responsive Optimizations (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
    .mcd-search-wrapper {
        z-index: 999999 !important;
        padding: 0 4px;
    }

    /* Single-row horizontal scrollable pill tabs (App Style) */
    .mcd-search-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        padding: 2px 2px 8px 2px !important;
        margin-bottom: 6px !important;
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* IE/Edge */
    }

    .mcd-search-tabs::-webkit-scrollbar {
        display: none !important; /* Chrome / Safari / Android */
    }

    .mcd-tab-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        padding: 6px 13px !important;
        border-radius: 20px !important; /* Elegant pill shape */
        background: var(--mcd-tab-bg, #f1f5f9) !important;
        border: 1px solid var(--mcd-tab-border, #cbd5e1) !important;
        color: var(--mcd-tab-color, #475569) !important;
        line-height: normal !important;
    }

    .mcd-tab-btn.active {
        background: var(--mcd-tab-active-bg, #1e5974) !important;
        color: var(--mcd-tab-active-color, #ffffff) !important;
        border-color: var(--mcd-tab-active-border, #1e5974) !important;
    }

    .mcd-search-wrapper .mcd-tab-btn:hover,
    .mcd-search-wrapper .mcd-tab-btn.active:hover,
    .mcd-tab-btn:hover,
    .mcd-tab-btn.active:hover {
        background: var(--mcd-tab-hover-bg, #cb3366) !important;
        border-color: var(--mcd-tab-hover-bg, #cb3366) !important;
        color: var(--mcd-tab-hover-color, #ffffff) !important;
    }

    .mcd-toggle-advanced-btn {
        margin-left: 0 !important;
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        color: #475569 !important;
    }

    .mcd-toggle-advanced-btn.active {
        background: #1e293b !important;
        color: #ffffff !important;
        border-color: #1e293b !important;
    }

    /* Mobile Search Input */
    .mcd-input-group {
        border-radius: 25px !important;
        border-width: 2px !important;
    }

    .mcd-search-input {
        font-size: 14px !important;
        padding: 10px 10px 10px 6px !important;
    }

    /* Advanced Filter Panel on Mobile */
    .mcd-adv-divider {
        flex: 0 0 100% !important;
        width: 100% !important;
        margin: 6px 0 !important;
        border-top: 1px solid var(--mcd-panel-border, #e2e8f0) !important;
    }
    .mcd-adv-row {
        gap: 10px !important;
    }
    .mcd-fg-orderby,
    .mcd-fg-snippet {
        flex: 1 1 100% !important;
    }
    .mcd-fg-yorum,
    .mcd-fg-views {
        flex: 1 1 calc(50% - 6px) !important;
    }
    .mcd-fg-year {
        flex: 1 1 100% !important;
    }
    .mcd-fg-month {
        flex: 1 1 calc(50% - 6px) !important;
        max-width: none !important;
    }
    .mcd-fg-reset {
        flex: 1 1 calc(50% - 6px) !important;
        margin-left: 0 !important;
    }
    .mcd-btn-reset-filters {
        width: 100% !important;
        text-align: center !important;
        padding: 8px 10px !important;
    }

    /* Results Dropdown on Mobile - Natural in-flow expansion pushing following sections down */
    .mcd-results-dropdown,
    .mcd-history-dropdown {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        margin-top: 10px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid #cbd5e1 !important;
        z-index: 10 !important;
    }

    .mcd-results-list {
        max-height: min(var(--mcd-dropdown-max-height, 70vh), 80vh) !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .mcd-result-link {
        padding: 11px 14px !important;
    }

    .mcd-result-title {
        font-size: 14px !important;
        line-height: 1.35 !important;
    }

    .mcd-result-snippet {
        font-size: 12px !important;
        line-height: 1.45 !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: var(--mcd-snippet-lines, 3) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mcd-result-meta {
        font-size: 11px !important;
        gap: 6px !important;
    }

    /* Help popover on mobile */
    .mcd-help-popover {
        width: calc(100vw - 24px) !important;
        max-width: 320px !important;
        left: 0 !important;
        z-index: 99999999 !important;
    }

    /* Facet multi-level rows on mobile: clean native touch swipe without overlapping arrow buttons */
    .mcd-facet-scroll-btn {
        display: none !important;
    }
    .mcd-facet-row-scroll {
        padding: 6px 10px !important;
    }
}
