/**
 * Filters Section Styles
 * Стили для секции фильтров и связанных компонентов
 */

/* ========================================
   ФИЛЬТРЫ - ОСНОВНАЯ СЕКЦИЯ
   ======================================== */
.filters-section {
    background: var(--glass-bg, #ffffff);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-right: 1px solid var(--glass-border, transparent);
    position: sticky;
    top: 76px; /* Offset for the sticky navbar */
    z-index: 1020;
    border-radius: var(--card-radius, 16px);
}

.filters h5,
.filter-label {
    font-weight: 600;
    color: var(--color-text, #343a40);
}

/* ========================================
   COMBOBOX КОМПОНЕНТ
   ======================================== */
/* ========================================
   VARIABLES & TOKENS (Unified from TreeSelect)
   ======================================== */
:root {
    --ts-primary: var(--color-primary, #007bff);
    --ts-primary-soft: rgba(59, 130, 246, 0.1);
    --ts-border: var(--color-border, #e9ecef);
    --ts-border-hover: var(--color-primary-hover, #ced4da);
    --ts-bg: var(--color-bg-card, #ffffff);
    --ts-radius: 12px;
    --ts-shadow: var(--card-shadow, 0 2px 4px rgba(0, 0, 0, 0.02));
    --ts-shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.15);
    --ts-danger: #ef4444;
    --ts-danger-soft: rgba(239, 68, 68, 0.1);
    --input-height: 48px;
}

.combobox-wrapper {
    position: relative;
    width: 100%;
}

.combobox-input,
.filters-section .form-select,
.filters-section .form-control,
.year-picker-field {
    cursor: pointer;
    background-color: var(--ts-bg) !important;
    border: 1px solid var(--ts-border) !important;
    border-radius: 12px !important;
    min-height: 48px !important;
    height: auto;
    padding: 10px 16px;
    font-size: 0.95rem;
    color: var(--color-text);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    width: 100%;
    box-shadow: var(--ts-shadow) !important;
    display: flex;
    align-items: center;
}

/* Reset display for native form elements */
.filters-section .form-select,
.filters-section .form-control,
input.combobox-input {
    display: block;
    line-height: normal;
    height: 48px !important;
    /* Fixed height for text inputs */
}

/* Visual Consistency: Hover */
.combobox-input:hover,
.filters-section .form-select:hover,
.filters-section .form-control:hover,
.year-picker-field:hover,
.tree-select-display:hover {
    border-color: var(--ts-border-hover) !important;
    background: var(--color-bg) !important;
    box-shadow: var(--card-shadow) !important;
}

/* Visual Consistency: Focus/Open */
.combobox-input:focus,
.filters-section .form-select:focus,
.filters-section .form-control:focus,
.year-picker.open .year-picker-field,
.combobox-input[aria-expanded="true"] {
    background-color: var(--color-bg) !important;
    border-color: var(--ts-primary) !important;
    box-shadow: var(--ts-shadow-focus) !important;
    outline: none;
}

.combobox-wrapper::after {
    content: "\F282";
    /* Bootstrap Icon chevron-down */
    font-family: "bootstrap-icons";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #adb5bd;
    font-size: 12px;
}

/* Кнопка добавления в combobox */
.combobox-add-btn {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    z-index: 5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-bottom: 2px;
    /* Визуальная коррекция вертикали для плюса */
}

/* Выпадающий список combobox */
.combobox-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--color-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow-hover);
    z-index: 1000;
    display: none;
    padding: 5px 0;
    color: var(--color-text);
}

.combobox-dropdown.show {
    display: block;
}

.combobox-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.combobox-option-label {
    line-height: 1.2;
}

.combobox-option-hint {
    color: var(--archive-muted, #6b7280);
    font-size: 12px;
    line-height: 1.25;
}

.combobox-option:hover,
.combobox-option.highlighted {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.combobox-option.selected {
    background-color: var(--color-primary);
    color: white;
}

.combobox-option.selected .combobox-option-hint {
    color: rgba(255, 255, 255, 0.78);
}

.combobox-option.hidden {
    display: none;
}

/* ========================================
   МУЛЬТИВЫБОР - ТЕГИ
   ======================================== */
.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ts-primary-soft);
    color: var(--ts-primary);
    padding: 6px 12px;
    border-radius: 50rem;
    font-size: 13px;
    line-height: 1.5;
    /* Explicit line-height */
    font-weight: 500;
    box-shadow: none;
    border: 1px solid rgba(0, 123, 255, 0.15);
    transition: all 0.2s;
    height: 32px;
    /* Force explicit height */
    box-sizing: border-box;
}

.multi-select-tag:hover {
    background: rgba(0, 123, 255, 0.15);
    transform: none;
    box-shadow: none;
}

.multi-select-tag .remove-tag {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    /* Fix vertical alignment */
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure centering */
    margin-left: 2px;
    padding: 2px;
    border-radius: 50%;
    transition: background 0.2s;
    width: 20px;
    /* Fixed button size */
    height: 20px;
}

.multi-select-tag .remove-tag:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Unified Theme: Both Categories and Regions use the same Soft Blue style */
#selected-category-tags .multi-select-tag,
#selected-region-tags .multi-select-tag {
    background: var(--ts-primary-soft);
    color: var(--ts-primary);
}

/* ========================================
   ИСКЛЮЧЁННЫЕ ТЕГИ
   ======================================== */
.excluded-tag,
.red-badge {
    background: var(--ts-danger-soft) !important;
    color: var(--ts-danger);
    border: 1px solid rgba(220, 53, 69, 0.15);
    text-decoration: line-through;
    opacity: 1;
    border-radius: 50rem;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.5;
    /* Explicit line-height */
    display: inline-flex;
    align-items: center;
    height: 32px;
    /* Force explicit height */
    box-sizing: border-box;
}

.excluded-tag .excluded-prefix,
.red-badge .excluded-prefix {
    font-weight: 600;
    margin-right: 4px;
    opacity: 0.8;
}

.excluded-tag .remove-excluded-tag {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    margin-left: 5px;
}

.excluded-tag .remove-excluded-tag:hover {
    opacity: 1;
}

/* Секция исключений */
#exclusions-section {
    border-top: 1px solid var(--color-border);
    padding-top: 15px;
    margin-top: 10px;
}

#exclusions-section h5 {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Маленький combobox для исключений */
.combobox-wrapper-sm {
    position: relative;
}

.combobox-wrapper-sm .combobox-input {
    font-size: 13px;
    padding: 0.375rem 0.5rem;
}

.combobox-wrapper-sm .combobox-dropdown {
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    background: var(--color-bg-card);
}

.combobox-wrapper-sm .combobox-option {
    padding: 6px 10px;
}

.combobox-no-results {
    padding: 8px 10px;
    color: var(--color-text-muted);
    font-style: italic;
}

#exclude-categories-container,
#exclude-regions-container {
    margin-top: 5px !important;
    padding-top: 0;
    border-top: none;
}

#excluded-categories-tags,
#excluded-regions-tags {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
}

/* ========================================
   СЕЛЕКТЫ ПОДКАТЕГОРИЙ/ПОДРЕГИОНОВ
   ======================================== */
#category-container>.form-select {
    margin-top: 0.75rem;
    margin-left: 0.75rem;
    border-left: 3px solid var(--color-primary);
    padding-left: 0.5rem;
    background-color: var(--color-bg);
}

#category-container>.form-select[data-filter-id] {
    border-left-color: #22c55e;
}

#region-container>.form-select {
    margin-top: 0.75rem;
    margin-left: 0.75rem;
    border-left: 3px solid #06b6d4;
    padding-left: 0.5rem;
    background-color: var(--color-bg);
}

/* ========================================
   МУЛЬТИВЫБОР - DROPDOWN
   ======================================== */
.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--card-shadow);
    z-index: 1000;
    display: none;
    color: var(--color-text);
}

.multi-select-dropdown.show {
    display: block;
}

.multi-select-dropdown .option {
    padding: 8px 12px;
    cursor: pointer;
}

.multi-select-dropdown .option:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.multi-select-dropdown .option.selected {
    background: var(--color-bg);
}

/* ========================================
   РЕЗУЛЬТАТЫ
   ======================================== */
.results-section {
    background-color: transparent;
}

/* ========================================
   ОБЩИЕ ЭЛЕМЕНТЫ
   ======================================== */
.form-select {
    width: 100%;
    border-radius: 5px;
}

.pagination {
    margin-top: 20px;
}

.pagination .page-link {
    cursor: pointer;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .filters-section {
        position: relative;
        min-height: auto;
        border-right: none;
        border-bottom: 2px solid #ced4da;
    }
}



/* ========================================
   YEAR PICKER - КОМПАКТНАЯ ВЕРСИЯ
   ======================================== */
.year-picker {
    position: relative;
}

/* Year Picker Field specific overrides/resets */
.year-picker-field {
    /* Base styles come from shared block above */
    flex-wrap: nowrap;
    /* Prevent wrapping unless many tags */
    overflow: hidden;
    /* Hide overflow */
    min-height: 48px;
    /* Force match others */
}

/* Allow wrapping if needed but keep height dynamic? No, unified height preferred. 
   If many tags, maybe show "+2" etc? For now let's allow it to grow or scroll?
   Design req: "unified style". Fixed height is best for uniformity.
   Let's set overflow-x auto for tags?
*/
.year-picker-field {
    flex-wrap: nowrap;
    overflow-x: auto;
    /* horizontal scroll for tags */
    scrollbar-width: none;
    /* hide scrollbar */
}

.year-picker-field::-webkit-scrollbar {
    display: none;
}

.year-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 50rem;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--ts-primary-soft);
    color: var(--ts-primary);
    border: 1px solid rgba(0, 123, 255, 0.15);
}

.year-tag-ex {
    background: var(--ts-danger-soft);
    color: var(--ts-danger);
    border: 1px solid rgba(220, 53, 69, 0.15);
    text-decoration: line-through;
}

.year-tag-x {
    margin-left: 4px;
    cursor: pointer;
    opacity: 0.6;
    font-weight: bold;
}

.year-tag-x:hover {
    opacity: 1;
}

.year-picker-placeholder {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.year-picker-btn {
    margin-left: auto;
    opacity: 0.6;
    color: var(--color-text);
}

/* Компактный Popup */
.year-picker-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow-hover);
    padding: 10px;
    margin-top: 4px;
    min-width: 240px;
    color: var(--color-text);
}

.yp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.yp-row input[type="number"] {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    background: var(--color-bg);
    color: var(--color-text);
}

.yp-row input[type="text"] {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--color-bg);
    color: var(--color-text);
}

.yp-row span {
    color: var(--color-text-muted);
}

.yp-add,
.yp-exclude-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.yp-add {
    background: #0d6efd;
    color: #fff;
}

.yp-exclude-btn {
    background: #dc3545;
    color: #fff;
}

.yp-presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.yp-presets button {
    padding: 3px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.75rem;
}

.yp-presets button:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--color-primary);
}

/* Табы включить/исключить */
.yp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
}

.yp-tab {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.yp-tab:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.yp-tab.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.yp-tab[data-mode="exclude"].active {
    background: #dc3545;
    border-color: #dc3545;
}

/* Кнопки добавления */
.yp-add-range,
.yp-add-single {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    background: #0d6efd;
    color: #fff;
    transition: background 0.2s;
}

.yp-add-range:hover,
.yp-add-single:hover {
    background: #0b5ed7;
}

.yp-add-range {
    flex: 1;
}

.yp-exclude-style {
    background: #dc3545 !important;
}

.yp-exclude-style:hover {
    background: #bb2d3b !important;
}

/* Строка с одним годом */
.yp-single-row {
    margin-bottom: 10px;
}

.yp-single-row input {
    flex: 1;
}

/* Действия */
.yp-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

.yp-clear {
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--color-text);
}

.yp-clear:hover {
    background: var(--color-bg-card);
    color: var(--color-text);
}


/* ========================================
   SEARCHABLE SELECT КОМПОНЕНТ
   ======================================== */
.searchable-select-container {
    position: relative;
    width: 100%;
}

.searchable-select {
    position: relative;
    width: 100%;
}

/* Display (показывает выбранное значение) */
.searchable-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg);
    color: var(--color-text);
    cursor: pointer;
    min-height: 48px;
    transition: all 0.2s;
}

.searchable-select-display:hover {
    border-color: var(--ts-border-hover);
    background: var(--color-bg);
}

.searchable-select.open .searchable-select-display {
    border-color: var(--ts-primary);
    background: var(--color-bg);
    box-shadow: var(--ts-shadow-focus);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.searchable-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    color: var(--color-text);
}

.searchable-select-arrow {
    font-size: 10px;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}

.searchable-select.open .searchable-select-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--ts-radius) var(--ts-radius);
    box-shadow: var(--card-shadow);
    z-index: 1000;
    display: none;
    color: var(--color-text);
}

.searchable-select.open .searchable-select-dropdown {
    display: block;
}

/* Search input */
.searchable-select-search {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    color: var(--color-text);
}

.searchable-select-search:focus {
    background: var(--color-bg);
}

.searchable-select-search::placeholder {
    color: var(--color-text-muted);
}

/* Options list */
.searchable-select-options {
    max-height: 200px;
    overflow-y: auto;
}

.searchable-select-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.9rem;
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.searchable-select-option.selected {
    background-color: var(--color-primary);
    color: white;
}

.searchable-select-option.hidden {
    display: none;
}

/* Стили для дочерних селектов (подкатегории) */
#category-container .searchable-select-container {
    margin-top: 0.75rem;
    margin-left: 0.75rem;
    border-left: 3px solid #007bff;
    padding-left: 0.5rem;
}

#category-container .searchable-select-container[data-filter-id] {
    border-left-color: #28a745;
}

/* Стили для дочерних селектов (регионы) */
#region-container .searchable-select-container {
    margin-top: 0.75rem;
    margin-left: 0.75rem;
    border-left: 3px solid #17a2b8;
    padding-left: 0.5rem;
}

/* ========================================
   ARCHIVE REFERENCE REDESIGN
   ======================================== */
.filters-section {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid var(--archive-border, #e4e6ea);
    border-radius: 0;
    box-shadow: none;
    padding: 40px 26px 28px 0;
    top: 80px;
}

.filters {
    color: var(--archive-ink, #121722);
}

.filters h6,
.filters label {
    color: var(--archive-ink, #121722) !important;
    font-size: 13px !important;
    letter-spacing: 0 !important;
}

.filters h6 i,
.filters label i {
    color: var(--archive-accent, #2a3047);
    font-size: 17px;
}

.combobox-input,
.filters-section .form-select,
.filters-section .form-control,
.year-picker-field,
.tree-select-display {
    min-height: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    background: var(--archive-surface, #fff) !important;
    border: 1px solid var(--archive-border, #e4e6ea) !important;
    color: var(--archive-ink, #121722) !important;
    box-shadow: none !important;
}

.combobox-input:hover,
.filters-section .form-select:hover,
.filters-section .form-control:hover,
.year-picker-field:hover,
.tree-select-display:hover {
    background: var(--archive-surface, #fff) !important;
    border-color: #cfd3db !important;
    box-shadow: none !important;
}

.combobox-input:focus,
.filters-section .form-select:focus,
.filters-section .form-control:focus,
.year-picker.open .year-picker-field,
.combobox-input[aria-expanded="true"] {
    background: var(--archive-surface, #fff) !important;
    border-color: var(--archive-accent-2, #5d7ee8) !important;
    box-shadow: 0 0 0 3px rgba(93, 126, 232, 0.16) !important;
}

.combobox-wrapper::after {
    color: var(--archive-ink, #121722);
}

.combobox-dropdown,
.year-picker-popup {
    background: var(--archive-surface, #fff);
    border: 1px solid var(--archive-border, #e4e6ea);
    border-radius: 8px;
    box-shadow: var(--archive-shadow, 0 16px 42px rgba(18, 23, 34, 0.08));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.combobox-option:hover,
.combobox-option.highlighted {
    background: var(--archive-surface-soft, #f1f2f4);
}

.combobox-option.selected {
    background: var(--archive-accent, #2a3047);
}

.multi-select-tags {
    gap: 8px;
}

.multi-select-tag,
#selected-category-tags .multi-select-tag,
#selected-region-tags .multi-select-tag,
.year-tag {
    height: 33px;
    border-radius: 16px;
    border: 0;
    background: #edf1ff;
    color: #516ed6;
    font-weight: 600;
}

[data-bs-theme="dark"] .multi-select-tag,
[data-bs-theme="dark"] #selected-category-tags .multi-select-tag,
[data-bs-theme="dark"] #selected-region-tags .multi-select-tag,
[data-bs-theme="dark"] .year-tag {
    background: rgba(143, 167, 255, 0.16);
    color: var(--archive-accent-2, #8fa7ff);
}

.excluded-tag,
.red-badge,
.year-tag-ex {
    border: 0 !important;
    background: rgba(211, 75, 75, 0.12) !important;
    color: #bf3434 !important;
}

.year-picker-placeholder {
    color: var(--archive-faint, #9aa1ad);
}

.hashtags-panel {
    color: var(--archive-ink, #121722);
}

.hashtags-title {
    color: var(--archive-ink, #121722) !important;
    font-size: 13px !important;
    letter-spacing: 0 !important;
}

.hashtags-title i {
    color: var(--archive-accent, #2a3047);
    font-size: 17px;
}

.hashtags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hashtags-panel .hashtag-filter-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    min-height: 30px;
    max-width: 100%;
    padding: 6px 12px;
    border-radius: 15px;
    background: var(--archive-surface-soft, #f1f2f4);
    color: #3f4652;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.1;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.hashtags-panel .hashtag-filter-link:hover {
    background: #e7e9ee;
    color: var(--archive-ink, #121722);
}

.hashtags-panel .hashtag-filter-link.active {
    background: #edf1ff;
    color: #516ed6;
    box-shadow: inset 0 0 0 1px rgba(81, 110, 214, 0.16);
}

.hashtags-panel .hashtag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: rgba(18, 23, 34, 0.08);
    color: var(--archive-muted, #6f7683);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.hashtags-panel .hashtag-filter-link.active .hashtag-count {
    background: rgba(81, 110, 214, 0.14);
    color: #516ed6;
}

.hashtags-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 13px;
}

.hashtags-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--archive-muted, #6f7683);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.hashtags-actions button:hover {
    color: var(--archive-ink, #121722);
}

[data-bs-theme="dark"] .hashtags-panel .hashtag-filter-link {
    background: var(--archive-surface-soft, #222630);
    color: var(--archive-muted, #b4bac6);
}

[data-bs-theme="dark"] .hashtags-panel .hashtag-filter-link:hover {
    color: var(--archive-ink, #f2f4f8);
}

[data-bs-theme="dark"] .hashtags-panel .hashtag-count {
    background: rgba(255, 255, 255, 0.1);
    color: var(--archive-muted, #b4bac6);
}

@media (max-width: 767.98px) {
    .filters-section {
        position: relative;
        top: auto;
        padding: 20px 0;
        border-right: 0;
        border-bottom: 1px solid var(--archive-border, #e4e6ea);
    }
}
