:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: rgba(0, 0, 0, 0.08);
    --accent: #0a84ff;
    --accent-hover: #0071e3;
    --badge-bg: rgba(10, 132, 255, 0.1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --badge-bg: rgba(10, 132, 255, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
}

.container { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.container-narrow { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }

/* Шапка */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(245, 245, 247, 0.8);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] header { background: rgba(28, 28, 30, 0.8); }

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero секция */
.hero {
    text-align: center;
    padding: 56px 0 36px;
}
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--badge-bg);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.hero h1 {
    font-size: clamp(28px, 4.5vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 14px;
}
.hero p {
    color: var(--text-secondary);
    font-size: 17px;
    max-width: 640px;
    margin: 0 auto 28px;
}

/* Карточки и формы */
.card-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.search-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr auto;
    gap: 12px;
}
@media (max-width: 820px) {
    .search-grid { grid-template-columns: 1fr; }
}

.input-field {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.input-field:focus { border-color: var(--accent); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 8px;
}
.reset-link { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Рекламные слоты РСЯ */
.rsya-slot {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 14px;
    min-height: 100px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Сетка карточек лотов */
.lots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
    margin: 24px 0 48px;
}
.lot-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s, box-shadow 0.18s;
    text-decoration: none;
    color: inherit;
}
.lot-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(10, 132, 255, 0.35);
}
.lot-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
}
.tag-type {
    background: var(--badge-bg);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}
.tag-region {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lot-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.38;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lot-cadastral {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 12px;
}
.lot-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.price-label { font-size: 11px; color: var(--text-secondary); display: block; }
.price-value { font-size: 19px; font-weight: 700; color: var(--accent); }
.date-end { font-size: 12px; color: var(--text-secondary); text-align: right; }

/* Страница детального просмотра лота */
.breadcrumbs {
    padding: 24px 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.detail-title {
    font-size: clamp(22px, 3.5vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
}
.detail-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin: 12px 0 20px;
}
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.specs-table th, .specs-table td {
    text-align: left;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}
.specs-table th {
    width: 38%;
    color: var(--text-secondary);
    font-weight: 500;
}
.similar-list {
    list-style: none;
    margin-top: 12px;
}
.similar-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}
.similar-list a { color: var(--text); text-decoration: none; font-weight: 500; }
.similar-list a:hover { color: var(--accent); }

/* Футер */
footer {
    border-top: 1px solid var(--border);
    padding: 36px 0 48px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 40px;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.disclaimer {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.85;
}
:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: rgba(0, 0, 0, 0.08);
    --accent: #0a84ff;
    --accent-hover: #0071e3;
    --badge-bg: rgba(10, 132, 255, 0.1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --badge-bg: rgba(10, 132, 255, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
}

.container { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.container-narrow { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }

header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(245, 245, 247, 0.8);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] header { background: rgba(28, 28, 30, 0.8); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero { text-align: center; padding: 48px 0 32px; }
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--badge-bg);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.hero h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 14px; }
.hero p { color: var(--text-secondary); font-size: 17px; max-width: 640px; margin: 0 auto 24px; }

.card-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.search-grid { display: grid; grid-template-columns: 2fr 1.2fr 1fr auto; gap: 12px; }
@media (max-width: 820px) { .search-grid { grid-template-columns: 1fr; } }

.input-field {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.input-field:focus { border-color: var(--accent); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 8px;
}
.reset-link { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Теги категорий */
.tags-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); }
.tag-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.rsya-slot {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 14px;
    min-height: 100px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.lots-grid { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 32px; width: 100%; }
.lot-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s, box-shadow 0.18s;
    text-decoration: none;
    color: inherit;
}
.lot-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(10, 132, 255, 0.35); }
.lot-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.tag-type {
    background: var(--badge-bg);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 195px;
}
.tag-region { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lot-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.38;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lot-cadastral {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 12px;
}
.lot-footer { padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-end; }
.price-label { font-size: 11px; color: var(--text-secondary); display: block; }
.price-value { font-size: 18px; font-weight: 700; color: var(--accent); }
.date-end { font-size: 12px; color: var(--text-secondary); text-align: right; }

.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin: 20px 0 40px; }
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; pointer-events: none; }
.page-dots { color: var(--text-secondary); padding: 0 4px; }

.breadcrumbs { padding: 24px 0 12px; font-size: 13px; color: var(--text-secondary); }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.detail-title { font-size: clamp(22px, 3.5vw, 30px); font-weight: 700; line-height: 1.25; margin-bottom: 12px; }
.detail-price { font-size: 32px; font-weight: 700; color: var(--accent); margin: 12px 0 20px; }
.specs-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.specs-table th, .specs-table td { text-align: left; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.specs-table th { width: 38%; color: var(--text-secondary); font-weight: 500; }
.similar-list { list-style: none; margin-top: 12px; }
.similar-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.similar-list a { color: var(--text); text-decoration: none; font-weight: 500; }
.similar-list a:hover { color: var(--accent); }

footer { border-top: 1px solid var(--border); padding: 36px 0 48px; color: var(--text-secondary); font-size: 13px; margin-top: 40px; }
.footer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.disclaimer { font-size: 12px; line-height: 1.5; opacity: 0.85; }


/* Вертикальный список вакансий */
.lots-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin: 20px 0 32px !important;
}
.lot-card {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    padding: 20px 24px !important;
}
.lot-card > div:first-child {
    flex: 1;
    min-width: 0;
}
.lot-meta {
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
}
.lot-title {
    font-size: 18px !important;
    -webkit-line-clamp: 2 !important;
    margin-bottom: 6px !important;
}
.lot-cadastral {
    margin-bottom: 0 !important;
}
.lot-footer {
    border-top: none !important;
    border-left: 1px solid var(--border) !important;
    padding-top: 0 !important;
    padding-left: 20px !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    min-width: 210px !important;
    gap: 6px !important;
}
@media (max-width: 720px) {
    .lot-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .lot-footer {
        border-left: none !important;
        border-top: 1px solid var(--border) !important;
        padding-left: 0 !important;
        padding-top: 12px !important;
        flex-direction: row !important;
        align-items: flex-end !important;
        min-width: 0 !important;
    }
}

/* STRICT_LIST_VIEW */
#lots.lots-grid, #similarFeed.lots-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 14px !important;
}
#lots .lot-card, #similarFeed .lot-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 20px !important;
    padding: 20px 24px !important;
}
#lots .lot-card, #similarFeed .lot-card > div:first-child {
    flex: 1;
    min-width: 0;
}
#lots .lot-footer, #similarFeed .lot-footer {
    border-top: none !important;
    border-left: 1px solid var(--border) !important;
    padding-top: 0 !important;
    padding-left: 20px !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    min-width: 220px !important;
    gap: 6px !important;
}
@media (max-width: 720px) {
    #lots .lot-card, #similarFeed .lot-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    #lots .lot-footer, #similarFeed .lot-footer {
        border-left: none !important;
        border-top: 1px solid var(--border) !important;
        padding-left: 0 !important;
        padding-top: 12px !important;
        flex-direction: row !important;
        min-width: 0 !important;
    }
}


/* ANDROID_MOBILE_OPTIMIZATION */
.input-field {
    font-size: 16px !important; /* Защита от авто-зума при фокусе на мобильных */
}
.tag-pill {
    min-height: 38px;
    touch-action: manipulation;
}
@media (max-width: 720px) {
    .container, .container-narrow {
        padding: 0 14px;
    }
    .hero {
        padding: 28px 0 20px;
    }
    .hero p {
        font-size: 15px;
        margin-bottom: 16px;
    }
    /* Горизонтальный свайп тегов вместо длинной стены кнопок */
    .tags-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .tags-bar::-webkit-scrollbar {
        display: none;
    }
    .tag-pill {
        flex-shrink: 0;
        white-space: nowrap;
    }
    /* Адаптация таблицы зарплат и характеристик */
    .specs-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .specs-table th, .specs-table td {
        padding: 10px 12px 10px 0;
        font-size: 14px;
    }
    #loadMoreWrap label {
        display: flex !important;
        justify-content: center;
        margin-left: 0 !important;
        margin-top: 12px;
    }
}
@media (max-width: 480px) {
    .hide-mobile {
        display: none !important;
    }
    .nav-links {
        gap: 12px;
        font-size: 13px;
    }
    .logo {
        font-size: 16px;
    }
}


/* FIXED_FOOTER */
body {
    padding-bottom: 84px !important;
}
footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    margin-top: 0 !important;
    padding: 10px 0 !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    background: rgba(245, 245, 247, 0.85) !important;
    border-top: 1px solid var(--border) !important;
}
[data-theme="dark"] footer {
    background: rgba(28, 28, 30, 0.85) !important;
}
footer .footer-top {
    margin-bottom: 2px !important;
    font-size: 12px !important;
}
footer .disclaimer {
    font-size: 11px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
@media (max-width: 720px) {
    body {
        padding-bottom: 64px !important;
    }
    footer .disclaimer {
        display: none !important; /* На смартфонах оставляем одну компактную строку в футере */
    }
}

/* FOOTER_WRAP_FIX */
body {
    padding-bottom: 115px !important;
}
footer .disclaimer {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.4 !important;
    margin-top: 4px !important;
}
@media (max-width: 720px) {
    body {
        padding-bottom: 64px !important;
    }
    footer .disclaimer {
        display: none !important;
    }
}


/* AUTO_HIDE_FOOTER */
body {
    padding-bottom: 36px !important;
}
footer {
    transform: translateY(100%) !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) !important;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.08) !important;
}
footer.footer-visible,
footer:hover,
footer:focus-within {
    transform: translateY(0) !important;
}
@media (max-width: 720px) {
    body {
        padding-bottom: 56px !important;
    }
    footer {
        transform: translateY(0) !important;
    }
}

/* HIDE_RSYA */
.rsya-slot, .rsya-infeed { display: none !important; }

/* === АДАПТАЦИЯ ПОД СМАРТФОНЫ ANDROID (360px – 768px) === */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Компактная шапка и удобное меню навигации */
    header .container, .navbar, .header-inner {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    nav a, .nav-links a {
        font-size: 13px !important;
        padding: 6px 8px !important;
    }

    /* Заголовки страниц */
    h1 {
        font-size: 21px !important;
        line-height: 1.25 !important;
        word-break: break-word;
    }

    h2 {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }

    /* Форма поиска: шрифт 16px исключает авто-зум экрана на Android */
    form input[type="text"],
    form input[type="search"],
    form input[type="number"],
    form select {
        font-size: 16px !important;
        min-height: 44px !important;
        width: 100% !important;
    }

    form button[type="submit"] {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 15px !important;
    }

    /* Горизонтальный свайп для длинных рядов чипов регионов/профессий без раздувания экрана */
    .filter-chips, .region-chips {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        scrollbar-width: none;
    }
    .filter-chips::-webkit-scrollbar,
    .region-chips::-webkit-scrollbar {
        display: none;
    }

    /* Увеличенная область касания (Touch Target >= 36px) */
    .filter-chip, .tag-type, .tag-region {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
    }

    /* Карточка вакансии в ленте */
    .lots-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .lot-card {
        padding: 14px !important;
        border-radius: 14px !important;
    }

    .lot-title {
        font-size: 16px !important;
        line-height: 1.3 !important;
        word-break: break-word;
    }

    .lot-cadastral {
        font-size: 13px !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .lot-footer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding-top: 10px !important;
        margin-top: 10px !important;
    }

    .lot-footer .price-value {
        font-size: 17px !important;
    }

    .lot-footer .date-end {
        text-align: left !important;
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .lot-footer .date-end br {
        display: none;
    }

    /* Таблицы аналитики зарплат (/salaries) — плавная горизонтальная прокрутка */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Кнопки отклика, Telegram, MAX и голосования в карточке вакансии */
    #showContactsBtn, #btnJobUp, #btnJobDown, #btnVacOk, #btnVacDead {
        min-height: 42px !important;
        font-size: 14px !important;
    }

    #contactsBox {
        width: 100% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    #tgActionWrap {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    #tgActionWrap a, #tgActionWrap button {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
    }
}

@media (max-width: 380px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    h1 {
        font-size: 19px !important;
    }
}

/* === ИСПРАВЛЕНИЕ ВЕРХНЕГО ГЛАВНОГО МЕНЮ НА СМАРТФОНАХ === */
@media (max-width: 768px) {
    header {
        position: sticky;
        top: 0;
        z-index: 100;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    header > div,
    header .container,
    header nav {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }

    /* Логотип слева в верхней строке */
    header a:first-child,
    .logo {
        font-size: 16px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        margin-right: auto !important;
    }

    /* Кнопка переключения темы (🌙/☀️) всегда в правом верхнем углу */
    #themeToggle,
    .theme-toggle,
    header button {
        order: 2 !important;
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 6px 10px !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Контейнер ссылок меню переносится на вторую строку на всю ширину с плавным свайпом */
    header nav,
    .nav-menu,
    .header-links {
        order: 3 !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        gap: 6px !important;
        padding: 4px 0 6px !important;
        scrollbar-width: none;
    }

    header nav::-webkit-scrollbar,
    .nav-menu::-webkit-scrollbar,
    .header-links::-webkit-scrollbar {
        display: none;
    }

    /* Каждый пункт меню — аккуратная кнопка-пилюля */
    header nav a,
    .nav-menu a,
    .header-links a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        padding: 7px 12px !important;
        border-radius: 999px !important;
        border: 1px solid var(--border) !important;
        background: var(--surface) !important;
        text-decoration: none !important;
    }
}

/* === ЧИСТАЯ ШАПКА ДЛЯ ДЕСКТОПА И СМАРТФОНОВ ANDROID === */
.only-mobile { display: none; }
.only-desktop { display: inline; }

@media (min-width: 769px) {
    .nav-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }
    .nav-links {
        order: 2;
        display: flex;
        align-items: center;
        gap: 16px;
    }
    #themeToggle {
        order: 3;
    }
}

@media (max-width: 768px) {
    .only-desktop { display: none !important; }
    .only-mobile { display: inline !important; }
    .hide-mobile { display: none !important; }

    .nav-inner {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }

    .nav-inner .logo {
        order: 1 !important;
        font-size: 16px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    .nav-inner #themeToggle {
        order: 2 !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }

    .nav-inner .nav-links {
        order: 3 !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        margin: 0 !important;
    }

    .nav-inner .nav-links a {
        text-align: center !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        padding: 8px 6px !important;
        border-radius: 10px !important;
        border: 1px solid var(--border) !important;
        background: var(--surface) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
    }
}

/* === ТОЧЕЧНАЯ ДОРАБОТКА ШАПКИ И ФУТЕРА НА ANDROID === */
@media (max-width: 768px) {
    header, footer {
        position: static !important;
        bottom: auto !important;
        top: auto !important;
    }

    .nav-inner .nav-links {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-inner .nav-links a {
        margin: 0 !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    footer {
        margin-top: 32px !important;
        padding-bottom: 24px !important;
    }
}

/* === СНЯТИЕ ФИКСИРОВАННОЙ ВЫСОТЫ ШАПКИ НА ANDROID === */
@media (max-width: 768px) {
    header {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding-bottom: 8px !important;
        margin-bottom: 12px !important;
        overflow: visible !important;
    }

    .nav-inner {
        height: auto !important;
        min-height: 0 !important;
    }
}

/* === ПРЕМИУМ-СКИН === */
.lot-card.premium-job {
    border: 1.5px solid #f59e0b !important;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.09) 0%, rgba(251, 191, 36, 0.03) 100%) !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.16) !important;
}
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

/* === ОПТИМИЗАЦИЯ СКИНОВ И HERO-БАННЕРА ПОД ANDROID 14+ (360px - 680px) === */
@media (max-width: 680px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Компактный и аккуратный Hero-баннер без перекосов и горизонтального скролла */
    .jm-hero-ab {
        padding: 14px 15px !important;
        border-radius: 14px !important;
        gap: 10px !important;
        margin-bottom: 14px !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12) !important;
    }
    .jm-hero-ab > div {
        flex: 1 1 100% !important;
    }
    .jm-hero-pill {
        font-size: 10px !important;
        padding: 3px 9px !important;
        margin-bottom: 6px !important;
        transform: none !important;
        box-shadow: none !important;
    }
    #jmHeroTitle {
        font-size: 17px !important;
        line-height: 1.25 !important;
        margin-bottom: 5px !important;
    }
    #jmHeroSub {
        font-size: 12.5px !important;
        line-height: 1.45 !important;
    }
    .jm-hero-cta {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
        box-shadow: none !important;
    }

    /* Адаптация карточек со скинами (military, vip, punk, premium) на смартфоне */
    .lot-card[class*="skin-"] {
        padding: 14px !important;
        border-radius: 14px !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16) !important;
    }
    .lot-card[class*="skin-"] .lot-title {
        font-size: 16px !important;
        line-height: 1.28 !important;
    }
    .lot-card[class*="skin-"] [class*="skin-badge-"] {
        font-size: 9.5px !important;
        padding: 2.5px 8px !important;
        transform: none !important;
    }
    .lot-card[class*="skin-"] .lot-footer {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-left: 0 !important;
        padding-top: 10px !important;
        margin-top: 8px !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .lot-card.skin-military .price-value {
        font-size: 15px !important;
        padding: 4px 10px !important;
    }
}
