/* ============================================================
   Новая панель фильтрации карточек (компактная умная панель +
   модалка расширенных фильтров). Модалка переиспользует базовую
   оболочку .gm-overlay/.gm-modal/.gm-hdr/.gm-tabs/.gm-body/.gm-close
   из gamification.css — здесь только контент и модификаторы размера.
   ============================================================ */

/* Компактная панель и ряд чипов живут вне модалки — на общем фоне страницы,
   который поддерживает обе темы (переключатель body#dark/body#light), поэтому
   для них ниже задан полноценный светлый вид по умолчанию + #dark-переопределения.
   Сама модалка переиспользует .gm-modal, который в проекте всегда тёмный
   (см. gamification.css) — её здесь не трогаем. */

/* Приманки для автозаполнения — полностью скрыты, но не display:none (некоторые
   браузеры игнорируют невидимые через display/visibility поля для эвристики) */
.cf-autofill-decoy {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
    opacity: 0 !important; pointer-events: none !important;
}

.cf-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #F7F5FF;
    box-shadow: inset 0 0 0 1px #CFD8DF;
    border-radius: 16px;
    padding: 8px;
}
#dark .cf-bar {
    background: rgba(255,255,255,.035);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

/* ---- умный поиск ---- */
.cf-search {
    flex: 1;
    position: relative;
    min-width: 0;
}
.cf-search__icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; opacity: .55; pointer-events: none; color: #87919E;
}
#dark .cf-search__icon { opacity: .35; color: #fff; }
.cf-search__icon svg { width: 100%; height: 100%; }
.cf-search input {
    width: 100%; box-sizing: border-box; appearance: none;
    background: #fff;
    border: none; outline: none;
    border-radius: 11px;
    padding: 11px 14px 11px 38px;
    color: #7F2DE8; font-family: 'Rubik', sans-serif; font-size: 14px; font-weight: 500;
    box-shadow: inset 0 0 0 1px #CFD8DF;
    transition: box-shadow .15s, background .15s;
}
.cf-search input::placeholder { color: #87919E; font-weight: 400; }
.cf-search input:focus {
    box-shadow: inset 0 0 0 1.5px rgba(127,45,232,.45), 0 0 0 4px rgba(127,45,232,.1);
}
#dark .cf-search input {
    background: rgba(255,255,255,.04); color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
#dark .cf-search input::placeholder { color: rgba(200,190,230,.4); }
#dark .cf-search input:focus {
    background: rgba(255,255,255,.06);
    box-shadow: inset 0 0 0 1.5px rgba(140,110,255,.55), 0 0 0 4px rgba(120,80,255,.12);
}

.cf-search__dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(30,20,60,.16), 0 0 0 1px #E4E7EC;
    padding: 8px; z-index: 40;
    display: none; max-height: 380px; overflow-y: auto;
}
#dark .cf-search__dropdown { background: #211f26; box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07); }
.cf-search__dropdown.open { display: block; animation: cfPop .14s ease; }
@keyframes cfPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cf-search__group-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: #9AA2AC; padding: 8px 10px 4px;
}
#dark .cf-search__group-label { color: rgba(200,190,230,.35); }
.cf-search__row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 9px; cursor: pointer;
}
.cf-search__row:hover { background: #F7F5FF; }
#dark .cf-search__row:hover { background: rgba(255,255,255,.06); }
.cf-search__avatar {
    width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    background: #ECE7FB;
}
#dark .cf-search__avatar { background: #34313c; }
.cf-search__avatar.sq { border-radius: 8px; }
.cf-search__row-text { min-width: 0; flex: 1; }
.cf-search__row-name { color: #1a1a1a; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dark .cf-search__row-name { color: #fff; }
.cf-search__row-sub { color: #87919E; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dark .cf-search__row-sub { color: rgba(200,190,230,.4); }
.cf-search__row-plus {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    background: #F7F5FF; color: #7F2DE8;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
#dark .cf-search__row-plus { background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); }
.cf-search__empty { padding: 14px 10px; text-align: center; color: #87919E; font-size: 13px; }
#dark .cf-search__empty { color: rgba(200,190,230,.4); }

/* ---- пилюли (сортировка / фильтры) ---- */
.cf-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: #F7F5FF;
    box-shadow: inset 0 0 0 1px #CFD8DF;
    border: none; border-radius: 11px;
    padding: 11px 15px;
    color: #624CFF; font-family: 'Rubik', sans-serif; font-size: 13.5px; font-weight: 500;
    cursor: pointer; white-space: nowrap; position: relative;
    transition: background .14s, box-shadow .14s, color .14s;
}
.cf-pill:hover { background: #EFEAFF; }
#dark .cf-pill { background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); color: rgba(230,225,245,.8); }
#dark .cf-pill:hover { background: rgba(255,255,255,.075); color: #fff; }
.cf-pill svg { width: 15px; height: 15px; opacity: .7; flex-shrink: 0; }

.cf-pill--sort { padding: 0 6px 0 12px; }
.cf-pill--sort select {
    background: transparent; border: none; outline: none; appearance: none;
    color: #624CFF; font-family: 'Rubik', sans-serif; font-size: 13.5px; font-weight: 500;
    padding: 11px 24px 11px 6px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23624CFF'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 4px center; background-size: 16px;
}
.cf-pill--sort select option { background-color: #fff; color: #1a1a1a; }
/* <optgroup> игнорирует большинство CSS в нативном попапе select — задаём явно,
   иначе браузер (особенно на Windows) рисует подпись группы серым по белому,
   пока обычные option идут тёмным/светлым по фону страницы */
.cf-pill--sort select optgroup { background-color: #fff; color: #9AA2AC; font-weight: 600; }
#dark .cf-pill--sort select {
    color: rgba(230,225,245,.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(230,225,245,0.5)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}
#dark .cf-pill--sort select option { background-color: #211f26; color: #fff; }
#dark .cf-pill--sort select optgroup { background-color: #211f26; color: rgba(230,225,245,.55); }

.cf-pill--accent {
    background: linear-gradient(98.17deg, rgba(79,160,255,.14) 4%, rgba(82,79,255,.14) 40%, rgba(179,56,255,.14) 93%);
    box-shadow: inset 0 0 0 1px rgba(127,45,232,.22);
    color: #7F2DE8;
}
.cf-pill--accent:hover { box-shadow: inset 0 0 0 1px rgba(127,45,232,.4); }
#dark .cf-pill--accent {
    background: linear-gradient(98.17deg, rgba(79,160,255,.16) 4%, rgba(82,79,255,.16) 40%, rgba(179,56,255,.16) 93%);
    box-shadow: inset 0 0 0 1px rgba(150,110,255,.35);
    color: #fff;
}
#dark .cf-pill--accent:hover { box-shadow: inset 0 0 0 1px rgba(170,130,255,.55); }

.cf-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
    border-radius: 99px; background: linear-gradient(120deg, #4FA0FF, #B338FF);
    color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
    box-shadow: 0 0 0 2px #F7F5FF;
}
#dark .cf-badge { box-shadow: 0 0 0 2px #18161b; }

.cf-share-btn {
    width: 46px; height: 46px; flex-shrink: 0; box-sizing: border-box;
    border: none; border-radius: 11px;
    background: #F7F5FF url(/ui/share-icon.png) no-repeat center;
    background-size: 18px;
    box-shadow: inset 0 0 0 1px #CFD8DF;
    cursor: pointer; transition: background-color .14s, box-shadow .14s;
}
.cf-share-btn:hover { background-color: #EFEAFF; }
#dark .cf-share-btn { background-color: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
#dark .cf-share-btn:hover { background-color: rgba(255,255,255,.075); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }

/* ---- ряд активных фильтров ---- */
.cf-chips {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    margin-top: 12px; min-height: 0;
}
.cf-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: #F7F5FF;
    box-shadow: inset 0 0 0 1px rgba(127,45,232,.16);
    color: #624CFF; border-radius: 99px; padding: 5px 5px 5px 9px;
    font-size: 12.5px; font-weight: 500; cursor: default; user-select: none;
    animation: cfPop .14s ease;
}
#dark .cf-chip { background: rgba(140,110,255,.1); box-shadow: inset 0 0 0 1px rgba(150,110,255,.3); color: #cdbfff; }
.cf-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.cf-chip img.sq { border-radius: 5px; }
.cf-chip button {
    width: 16px; height: 16px; border-radius: 50%; border: none; flex-shrink: 0;
    background: rgba(98,76,255,.12); color: #624CFF; font-size: 10px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: .8; transition: opacity .12s, background .12s, color .12s; padding: 0;
    font-family: inherit;
}
.cf-chip button:hover { opacity: 1; background: rgba(255,60,60,.15); color: #d43838; }
#dark .cf-chip button { background: rgba(255,255,255,.1); color: #fff; }
#dark .cf-chip button:hover { background: rgba(255,80,80,.5); color: #fff; }
.cf-chips__reset {
    color: #87919E; font-size: 12.5px; cursor: pointer; padding: 5px 4px;
    text-decoration: underline; text-decoration-color: #CFD8DF; text-underline-offset: 2px;
}
.cf-chips__reset:hover { color: #1a1a1a; }
#dark .cf-chips__reset { color: rgba(200,190,230,.4); text-decoration-color: rgba(200,190,230,.2); }
#dark .cf-chips__reset:hover { color: rgba(230,225,245,.8); }

/* Чип в режиме "исключить" (!value) — используется в cf-selected-row модалки (тёмная, без светлой версии) */
.cf-chip--exclude { background: rgba(255,90,90,.1); box-shadow: inset 0 0 0 1px rgba(255,90,90,.35); color: #ffb3b3; }
.cf-exclude-toggle {
    font-size: 10px; color: rgba(255,255,255,.3); background: rgba(255,255,255,.06);
    border-radius: 6px; padding: 2px 6px; cursor: pointer; flex-shrink: 0; user-select: none;
}
.cf-exclude-toggle:hover { color: rgba(255,140,140,.9); background: rgba(255,90,90,.12); }
.cf-exclude-toggle.active { color: #ff8f8f; background: rgba(255,90,90,.18); }

/* Теги — tag.color хранит имя класса (не hex), то же самое, что и .card-tags .tag.*
   внизу карточки (card.css). Переносим ту же палитру на форму .cf-choice. */
.cf-choice.blue       { background: #4e8cff21; box-shadow: inset 0 0 0 1px #4e8cff50; color: #6199ff; }
.cf-choice.light-blue { background: #4ed0ff21; box-shadow: inset 0 0 0 1px #4ec6ff50; color: #61cbff; }
.cf-choice.green      { background: #52e70d21; box-shadow: inset 0 0 0 1px #52e70d50; color: #72d30c; }
.cf-choice.red        { background: #ff4e4e21; box-shadow: inset 0 0 0 1px #ff4e4e50; color: #ff6161; }
.cf-choice.gold       { background: #ffc14e21; box-shadow: inset 0 0 0 1px #ffc14e50; color: #ffb561; }
.cf-choice.purple     { background: #ff4eaf21; box-shadow: inset 0 0 0 1px #ff4eaf50; color: #ff61c2; }
.cf-choice.yellow     { background: #ff763921; box-shadow: inset 0 0 0 1px #e7860d30; color: #d39748; }
.cf-choice.grey       { background: #afafaf0f; box-shadow: inset 0 0 0 1px #a9a9a929; color: #838383; }
.cf-choice.blue.selected, .cf-choice.light-blue.selected, .cf-choice.green.selected,
.cf-choice.red.selected, .cf-choice.gold.selected, .cf-choice.purple.selected,
.cf-choice.yellow.selected, .cf-choice.grey.selected {
    box-shadow: inset 0 0 0 1.5px currentColor;
    color: #fff;
    filter: brightness(1.35) saturate(1.3);
}

/* ============================================================
   МОДАЛКА ФИЛЬТРОВ — расширяет .gm-overlay/.gm-modal
   ============================================================ */
.gm-modal--filters { width: min(94vw, 640px); max-height: min(86vh, 780px); }
.gm-modal--filters .gm-hdr__title small { display: block; font-weight: 400; font-size: 12px; color: rgba(200,190,230,.45); margin-top: 1px; }
.gm-modal--filters .gm-hdr__btn.cf-reset { color: rgba(255,150,150,.75); }

.cf-tabpanel { display: flex; flex-direction: column; gap: 18px; padding: 4px 4px 2px; }

.cf-section-label {
    font-size: 12px; font-weight: 600; color: rgba(200,190,230,.45);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px;
}

.cf-choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cf-choice {
    padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer;
    background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
    color: rgba(230,225,245,.65); transition: .13s; user-select: none;
}
.cf-choice:hover { background: rgba(255,255,255,.07); }
.cf-choice.selected {
    background: linear-gradient(98deg, rgba(79,160,255,.22), rgba(82,79,255,.22), rgba(179,56,255,.22));
    box-shadow: inset 0 0 0 1px rgba(160,120,255,.55);
    color: #fff;
}

.cf-segmented { display: inline-flex; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); border-radius: 10px; padding: 3px; }
.cf-segmented button {
    border: none; background: transparent; color: rgba(230,225,245,.5);
    font-family: 'Rubik', sans-serif; font-size: 12.5px; font-weight: 500;
    padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: .13s;
}
.cf-segmented button.selected { background: rgba(255,255,255,.1); color: #fff; }

/* Редкости — базовый вид остаётся обычным .cf-choice, а классы редкости
   (r.class из card.css: yellow/purple/gold/green/...) только красят его
   переливом/обводкой в цвет самой редкости — форма и поведение как у всех
   остальных чипов модалки, без визуального разнобоя. */
.cf-choice.r        { background: rgba(163,163,163,.10); box-shadow: inset 0 0 0 1px rgba(163,163,163,.25); color: #c7c7c7; }
.cf-choice.yellow, .cf-choice.grey-yellow, .cf-choice.yellow-grey {
    background: rgba(247,169,1,.12); box-shadow: inset 0 0 0 1px rgba(247,169,1,.35); color: rgb(247,180,60);
}
.cf-choice.purple, .cf-choice.purple-grad { background: rgba(174,112,255,.14); box-shadow: inset 0 0 0 1px rgba(174,112,255,.4); color: #ac6bff; }
.cf-choice.pink, .cf-choice.pink-grad     { background: rgba(255,135,182,.12); box-shadow: inset 0 0 0 1px rgba(255,135,182,.35); color: #ffa5d8; }
.cf-choice.red, .cf-choice.red-grad       { background: rgba(255,105,105,.12); box-shadow: inset 0 0 0 1px rgba(255,105,105,.35); color: #ff6969; }
.cf-choice.gold                           { background: rgba(255,184,0,.16); box-shadow: inset 0 0 0 1px rgba(255,184,0,.45); color: #ffce6b; }
.cf-choice.silver                         { background: rgba(200,220,235,.12); box-shadow: inset 0 0 0 1px rgba(200,220,235,.35); color: #d6e3ec; }
.cf-choice.grey                           { background: rgba(193,199,204,.10); box-shadow: inset 0 0 0 1px rgba(193,199,204,.3); color: #aeb6bc; }
.cf-choice.green, .cf-choice.green-grad   { background: rgba(77,193,103,.13); box-shadow: inset 0 0 0 1px rgba(77,193,103,.4); color: #4dc167; }
.cf-choice.blue, .cf-choice.blue-grad     { background: rgba(96,188,255,.13); box-shadow: inset 0 0 0 1px rgba(96,188,255,.4); color: #60bcff; }
.cf-choice.dark-yellow, .cf-choice.dark-yellow-grad { background: rgba(255,134,96,.13); box-shadow: inset 0 0 0 1px rgba(255,134,96,.4); color: #ff9060; }
/* Выбранная редкость — усиливаем заливку/обводку тем же цветом, текст в белый для контраста */
.cf-choice.r.selected,
.cf-choice.yellow.selected, .cf-choice.grey-yellow.selected, .cf-choice.yellow-grey.selected,
.cf-choice.purple.selected, .cf-choice.purple-grad.selected,
.cf-choice.pink.selected, .cf-choice.pink-grad.selected,
.cf-choice.red.selected, .cf-choice.red-grad.selected,
.cf-choice.gold.selected,
.cf-choice.silver.selected,
.cf-choice.grey.selected,
.cf-choice.green.selected, .cf-choice.green-grad.selected,
.cf-choice.blue.selected, .cf-choice.blue-grad.selected,
.cf-choice.dark-yellow.selected, .cf-choice.dark-yellow-grad.selected {
    box-shadow: inset 0 0 0 1.5px currentColor;
    color: #fff;
    filter: brightness(1.35) saturate(1.3);
}

/* Обрезка длинных списков (редкости, серии) по высоте (2-3 строки) с градиентом
   снизу вместо резкого обрыва + неброская кнопка "Развернуть"/"Свернуть" под списком.
   Общий паттерн, высота задаётся модификатором под конкретный список. */
.cf-collapse-fade { position: relative; overflow: hidden; }
.cf-collapse-fade::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30px;
    background: linear-gradient(to bottom, rgba(24,22,27,0), #18161b);
    pointer-events: none;
}
.cf-collapse-fade.expanded { max-height: none !important; }
.cf-collapse-fade.expanded::after { display: none; }
.cf-collapse-fade--rarity { max-height: 108px; }
.cf-collapse-fade--series { max-height: 200px; }
.cf-rarity-group-label {
    font-size: 11px; font-weight: 600; color: rgba(200,190,230,.4);
    margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .03em;
}
.cf-rarity-group-label:first-child { margin-top: 0; }
.cf-collapse-toggle {
    display: flex; justify-content: flex-end;
    margin-top: 6px; font-size: 12px; color: rgba(200,190,230,.4);
    cursor: pointer; user-select: none; transition: color .13s;
}
.cf-collapse-toggle:hover { color: rgba(230,225,245,.8); }

/* Тайлы серий — компактная сетка вместо длинного select'а */
.cf-tile-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-tile {
    flex: 0 0 auto; width: 76px; text-align: center; cursor: pointer; padding: 4px;
    border-radius: 12px; transition: background .13s; user-select: none;
}
.cf-tile:hover { background: rgba(255,255,255,.04); }
.cf-tile__img {
    width: 52px; height: 52px; border-radius: 13px; object-fit: cover; margin: 0 auto 6px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); display: flex; align-items: center;
    justify-content: center; background: #2a2730; color: rgba(230,225,245,.5); font-size: 11px;
}
.cf-tile span {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; font-size: 11px; line-height: 1.25; color: rgba(230,225,245,.6);
}
.cf-tile.selected .cf-tile__img { box-shadow: 0 0 0 2px #a883ff, 0 0 0 4px rgba(168,131,255,.18); }
.cf-tile.selected span { color: #fff; font-weight: 600; }

.cf-picker-search { position: relative; margin-bottom: 10px; }
.cf-picker-search input {
    width: 100%; box-sizing: border-box; appearance: none;
    background: rgba(255,255,255,.04); border: none; outline: none;
    border-radius: 10px; padding: 9px 12px 9px 34px;
    color: #fff; font-family: 'Rubik', sans-serif; font-size: 13.5px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.cf-picker-search input:focus { box-shadow: inset 0 0 0 1.5px rgba(140,110,255,.5); }
.cf-picker-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; opacity: .35; color: #fff; }

.cf-selected-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cf-picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.cf-picker-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.cf-picker-row:hover { background: rgba(255,255,255,.045); }
.cf-picker-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #34313c; flex-shrink: 0; }
.cf-picker-row img.sq { border-radius: 8px; }
.cf-picker-text { min-width: 0; flex: 1; }
.cf-picker-name { color: #fff; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-picker-sub { color: rgba(200,190,230,.4); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-picker-check {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center; color: transparent; font-size: 13px;
    transition: .13s;
}
.cf-picker-row.selected .cf-picker-check { background: linear-gradient(120deg, #4FA0FF, #B338FF); box-shadow: none; color: #fff; }
.cf-picker-row.selected .cf-picker-name { color: #cdbfff; }

.cf-switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid rgba(255,255,255,.05); }
.cf-switch-row:last-child { border-bottom: none; }
.cf-switch-row div span { display: block; color: #fff; font-size: 13.5px; font-weight: 500; }
.cf-switch-row div small { display: block; color: rgba(200,190,230,.4); font-size: 11.5px; margin-top: 1px; }
.cf-switch { width: 40px; height: 24px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.cf-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.cf-switch.on { background: linear-gradient(120deg, #4FA0FF, #B338FF); }
.cf-switch.on::after { transform: translateX(16px); }

.cf-price-row { display: flex; align-items: center; gap: 10px; }
.cf-price-row input {
    width: 100%; box-sizing: border-box; background: rgba(255,255,255,.04); border: none; outline: none;
    border-radius: 9px; padding: 9px 11px; color: #fff; font-family: 'Rubik', sans-serif; font-size: 13.5px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); text-align: center;
}
.cf-price-row span { color: rgba(200,190,230,.35); font-size: 12px; flex-shrink: 0; }

.cf-context-note {
    font-size: 12px; color: rgba(200,190,230,.4); background: rgba(255,255,255,.03);
    border-radius: 9px; padding: 8px 11px;
}

/* select/input generic look inside modal tabs (не переиспользуем .filter_item — он занят прогрессом наборов).
   input[type="search"] — намеренно, чтобы браузер не путал поле с логином (см. cf-search) */
.cf-tabpanel select,
.cf-tabpanel input[type="text"],
.cf-tabpanel input[type="search"],
.cf-tabpanel input[type="number"] {
    width: 100%; box-sizing: border-box; appearance: none;
    background: rgba(255,255,255,.04); border: none; outline: none;
    border-radius: 9px; padding: 9px 11px; color: #fff;
    font-family: 'Rubik', sans-serif; font-size: 13.5px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
}
.cf-tabpanel select option { background-color: #211f26; color: #fff; }
/* Выше по специфичности, чем .cf-tabpanel input[type="..."] выше — иначе оно
   перебивает left-padding у .cf-picker-search и текст залезает под иконку лупы */
.cf-tabpanel .cf-picker-search input[type="search"] { padding-left: 34px; }

.cf-modal-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 18px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.cf-footer-reset { color: rgba(200,190,230,.5); font-size: 13px; cursor: pointer; background: none; border: none; font-family: 'Rubik', sans-serif; }
.cf-footer-reset:hover { color: #fff; }
.cf-footer-apply {
    background: linear-gradient(98.17deg, #4FA0FF 4%, #524FFF 40%, #B338FF 93%);
    border: none; border-radius: 11px; padding: 11px 22px; color: #fff; font-weight: 600; font-size: 13.5px;
    font-family: 'Rubik', sans-serif; cursor: pointer; box-shadow: 0 8px 22px rgba(120,80,255,.35);
}

/* мобильная версия модалки — bottom sheet, как у .gm-modal--shop */
@media (max-width: 600px) {
    .gm-overlay--cf { align-items: flex-end; padding: 0; }
    .gm-modal--filters { width: 100%; max-width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; }
    .gm-overlay--cf .gm-hdr { position: relative; }
    .gm-overlay--cf .gm-hdr::before {
        content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
        width: 36px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.18);
    }
    .cf-bar { flex-wrap: wrap; }
    .cf-search { flex-basis: 100%; }
}
