/* ==========================================================================
   Авито-клон — дизайн-система
   1. Токены   2. База   3. Кнопки   4. Формы   5. Шапка   6. Категории
   7. Лента и карточки   8. Страница объявления   9. Авторизация и формы
   10. Табы / мои объявления / сообщения   11. Модалки и тосты
   12. Админ-панель   13. Подвал и мобильная навигация   14. Адаптив
   ========================================================================== */

/* 1. Токены ---------------------------------------------------------------- */
:root {
    --blue: #00aaff;
    --blue-600: #0098e6;
    --blue-700: #0086cc;
    --blue-50: #e8f7ff;
    --blue-100: #cdeeff;
    --yellow: #ffc700;
    --yellow-600: #f0b800;
    --yellow-50: #fff8dc;
    --green: #00c853;
    --green-700: #00a844;
    --green-50: #e6f9ee;
    --red: #ff3b30;
    --red-700: #e5271c;
    --red-50: #ffecea;
    --orange: #ff9500;
    --orange-50: #fff3e0;

    --text: #1a1a1a;
    --text-2: #2c2c2c;
    --muted: #767676;
    --muted-2: #9e9e9e;
    --border: #e0e0e0;
    --border-2: #eeeeee;
    --bg: #ffffff;
    --bg-soft: #f5f5f5;
    --bg-soft-2: #f8f9fa;

    --r-card: 12px;
    --r-btn: 8px;
    --r-pill: 20px;
    --r-lg: 16px;

    --sh-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --sh-card-hover: 0 10px 28px rgba(0, 0, 0, 0.14);
    --sh-header: 0 1px 4px rgba(0, 0, 0, 0.06);
    --sh-pop: 0 8px 30px rgba(0, 0, 0, 0.16);
    --sh-modal: 0 24px 64px rgba(0, 0, 0, 0.28);
    --ring: 0 0 0 4px rgba(0, 170, 255, 0.18);

    --header-h: 72px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2. База ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.body-soft { background: var(--bg-soft); }
body.has-overlay { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
p { margin: 0; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--blue); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border-2); margin: 16px 0; }

:focus-visible { outline: 3px solid rgba(0, 170, 255, 0.45); outline-offset: 2px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon {
    width: 1.25em; height: 1.25em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #4d6bff);
    color: #fff; font-weight: 700; font-size: 16px;
}
.avatar--lg { width: 52px; height: 52px; font-size: 21px; }

/* 3. Кнопки ------------------------------------------------------------------ */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 20px;
    border: 1.5px solid transparent; border-radius: var(--r-btn);
    font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
    cursor: pointer; user-select: none; text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 1.15em; height: 1.15em; }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-600); color: #fff; }
.btn--primary:active { background: var(--blue-700); }

.btn--yellow { background: var(--yellow); color: #1a1a1a; }
.btn--yellow:hover { background: var(--yellow-600); color: #1a1a1a; }

.btn--outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--blue); color: var(--blue-700); background: var(--blue-50); }

.btn--text { background: transparent; color: var(--muted); }
.btn--text:hover { background: var(--bg-soft); color: var(--text); }

.btn--success { background: var(--green); color: #fff; }
.btn--success:hover { background: var(--green-700); color: #fff; }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: var(--red-700); color: #fff; }
.btn--danger-text { color: var(--red); }
.btn--danger-text:hover { background: var(--red-50); border-color: var(--red); color: var(--red-700); }

.btn--dark { background: #2c2c2c; color: #fff; }
.btn--dark:hover { background: #000; color: #fff; }

.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn--xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; gap: 5px; border-radius: 7px; }
.btn--lg { min-height: 50px; padding: 0 28px; font-size: 16px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--r-pill); }

.btn.is-loading { pointer-events: none; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}
.btn--outline.is-loading::after, .btn--text.is-loading::after, .btn--yellow.is-loading::after {
    border-color: rgba(0, 0, 0, 0.15); border-top-color: var(--blue);
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px;
    border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }

.chip {
    display: inline-flex; align-items: center; padding: 6px 14px; border: 1px solid var(--border);
    border-radius: var(--r-pill); background: #fff; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue-700); background: var(--blue-50); }

/* 4. Формы -------------------------------------------------------------------- */
.field { margin-bottom: 18px; border: 0; padding: 0; min-width: 0; }
.field__label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); padding: 0; }
.field__hint { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.field__error { margin-top: 5px; font-size: 13px; color: var(--red); min-height: 0; }
.field__error:empty { display: none; }
.field__meta { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.field__meta .field__error { flex: 1; }
.counter { margin-top: 5px; font-size: 12.5px; color: var(--muted-2); white-space: nowrap; margin-left: auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input, .select, .textarea {
    width: 100%; min-height: 46px; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text); font: inherit; font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: #c4c4c4; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.select {
    padding-right: 38px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
input[list]::-webkit-calendar-picker-indicator { display: none !important; }

.input-suffix { position: relative; }
.input-suffix .input { padding-right: 40px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }

.range { display: flex; align-items: center; gap: 8px; }
.range__dash { color: var(--muted-2); }

.radio { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 14.5px; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio__mark {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c4c4c4; flex: none;
    display: grid; place-items: center; transition: border-color 0.15s;
}
.radio__mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform 0.15s; }
.radio input:checked + .radio__mark { border-color: var(--blue); }
.radio input:checked + .radio__mark::after { transform: scale(1); }
.radio input:focus-visible + .radio__mark { box-shadow: var(--ring); }
.radio:hover .radio__mark { border-color: var(--blue); }

/* 5. Шапка ---------------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: var(--sh-header); }
.header__inner {
    display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center;
    gap: 24px; height: var(--header-h);
}

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.logo:hover { color: var(--text); }
.logo__mark {
    position: relative; display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 11px; background: var(--blue); color: #fff; font-weight: 800; font-size: 21px;
}
.logo__mark i { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--yellow); border: 2px solid #fff; }
.logo__text b { color: var(--blue); font-weight: 800; }
.logo--sm { font-size: 18px; }
.logo--sm .logo__mark { width: 32px; height: 32px; font-size: 18px; }

.search {
    position: relative; display: flex; align-items: center; width: 100%; max-width: 760px; justify-self: center;
    height: 46px; border: 2px solid var(--blue); border-radius: 12px; background: #fff;
    transition: box-shadow 0.15s;
}
.search:focus-within { box-shadow: var(--ring); }
.search__icon { position: absolute; left: 14px; color: var(--muted-2); pointer-events: none; }
.search__input {
    flex: 1; min-width: 0; height: 100%; padding: 0 12px 0 44px; border: 0; background: transparent;
    font: inherit; font-size: 15px; color: var(--text); outline: none;
}
.search__btn { height: 100%; min-height: 0; border-radius: 9px; margin: -2px -2px -2px 0; padding: 0 24px; }

.header__actions { display: flex; align-items: center; gap: 8px; }
.header__link {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px;
    color: var(--text-2); font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.header__link:hover { background: var(--bg-soft); color: var(--text); }
.header__create { margin: 0 4px; }

.user-menu { position: relative; }
.user-menu__btn { position: relative; display: block; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.user-menu__btn:hover .avatar { box-shadow: 0 0 0 4px var(--blue-100); }
.avatar { transition: box-shadow 0.15s; }
.dot-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
    display: grid; place-items: center; border: 2px solid #fff; line-height: 1;
}
.user-menu__dropdown {
    position: absolute; right: 0; top: calc(100% + 10px); width: 260px; padding: 8px;
    background: #fff; border-radius: 14px; box-shadow: var(--sh-pop); border: 1px solid var(--border-2);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all 0.15s;
}
.user-menu.is-open .user-menu__dropdown { opacity: 1; visibility: visible; transform: none; }
.user-menu__head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border-2); margin-bottom: 6px; }
.user-menu__head span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.user-menu__dropdown a, .user-menu__dropdown button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
    background: none; color: var(--text-2); font-weight: 500; font-size: 14.5px; text-align: left; cursor: pointer;
}
.user-menu__dropdown a:hover, .user-menu__dropdown button:hover { background: var(--bg-soft); color: var(--text); }
.user-menu__dropdown .icon { color: var(--muted); }
.pill-count { margin-left: auto; padding: 1px 8px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; }

/* 6. Полоса категорий ------------------------------------------------------------ */
.cat-bar { background: #fff; border-bottom: 1px solid var(--border-2); }
.cat-bar__scroll { display: flex; gap: 6px; padding: 10px 0 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-bar__scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none;
    padding: 8px 14px 12px; color: var(--text-2); font-weight: 600; font-size: 14.5px; white-space: nowrap;
    border-radius: 10px 10px 0 0; transition: color 0.15s, background 0.15s;
}
.cat-chip__icon { font-size: 20px; line-height: 1; }
.cat-chip::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
    background: var(--blue); transform: scaleX(0); transition: transform 0.2s;
}
.cat-chip:hover { color: var(--blue-700); background: var(--bg-soft-2); }
.cat-chip.is-active { color: var(--blue-700); }
.cat-chip.is-active::after { transform: scaleX(1); }

/* 7. Лента и карточки --------------------------------------------------------------- */
.page-index { padding-top: 24px; padding-bottom: 56px; }
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px; align-items: start; }

.filters { position: sticky; top: calc(var(--header-h) + 16px); }
.filters__card { background: #fff; border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-card); }
.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.filters__head h2 { font-size: 18px; }
.filters__close { display: none; }
.filters__actions { display: grid; gap: 6px; margin-top: 6px; }
.filters .field--radios { margin-bottom: 14px; }
.filters-toggle { display: none; }
.sheet-overlay { display: none; }

.results__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.results__title { font-size: 26px; }
.results__count { color: var(--muted); font-size: 14px; margin-top: 2px; }

.seller-banner {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 14px 18px;
    border-radius: var(--r-card); background: var(--blue-50); border: 1px solid var(--blue-100);
}
.seller-banner > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.seller-banner span { color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

.card {
    position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--r-card);
    box-shadow: var(--sh-card); overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: card-in 0.35s ease both;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-card-hover); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card__link { display: flex; flex-direction: column; flex: 1; color: inherit; }
.card__link:hover { color: inherit; }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; border-radius: var(--r-card) var(--r-card) 0 0; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); }
.card__noimg .icon { width: 40px; height: 40px; stroke-width: 1.5; }
.card__photos {
    position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; font-weight: 600;
    backdrop-filter: blur(4px);
}
.card__photos .icon { width: 13px; height: 13px; }
.card__badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.card__title {
    font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
.card:hover .card__title { color: var(--blue-700); }
.card__price { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin-top: 2px; }
.card__meta { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: auto; padding-top: 4px; }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-pill);
    font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.badge .icon { width: 12px; height: 12px; }
.badge--hit { background: var(--yellow); color: #1a1a1a; }
.badge--pending { background: var(--yellow); color: #1a1a1a; }
.badge--approved { background: var(--green); color: #fff; }
.badge--rejected { background: var(--red); color: #fff; }
.badge--blocked { background: #2c2c2c; color: #fff; }

.card.is-skeleton { pointer-events: none; animation: none; }
.sk { background: linear-gradient(100deg, #eee 30%, #f7f7f7 50%, #eee 70%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.card.is-skeleton .card__media { background: none; }
.card.is-skeleton .card__media .sk { width: 100%; height: 100%; border-radius: 0; }
.sk-line { height: 14px; margin-top: 8px; }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 64px 20px; grid-column: 1 / -1; color: var(--muted); }
.empty__icon { font-size: 54px; line-height: 1; margin-bottom: 4px; }
.empty h3, .empty h1 { color: var(--text); }
.empty .btn { margin-top: 10px; }
.empty--page { padding: 96px 20px; }

.load-more { display: grid; justify-items: center; gap: 10px; margin-top: 32px; }
.load-more__info { color: var(--muted); font-size: 13px; }

/* 8. Страница объявления -------------------------------------------------------------- */
.ad-page { padding-top: 20px; padding-bottom: 56px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; font-size: 13.5px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue-700); }
.breadcrumbs .icon { width: 14px; height: 14px; color: var(--muted-2); }
.breadcrumbs span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }

.notice { display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 20px; border-radius: var(--r-card); border: 1px solid transparent; }
.notice .icon { width: 24px; height: 24px; margin-top: 1px; }
.notice p { font-size: 14px; margin-top: 2px; }
.notice__reason { margin-top: 8px !important; }
.notice--pending { background: var(--yellow-50); border-color: #ffe58a; }
.notice--pending .icon { color: #c98f00; }
.notice--rejected { background: var(--red-50); border-color: #ffc9c4; }
.notice--rejected .icon { color: var(--red); }
.notice--blocked { background: #f0f0f0; border-color: #d6d6d6; }

.ad-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px 40px; align-items: start;
    grid-template-areas: "title side" "gallery side" "info side";
}
.ad-title { grid-area: title; font-size: 30px; padding-bottom: 8px; word-break: break-word; }
.gallery { grid-area: gallery; }
.ad-side { grid-area: side; grid-row: 1 / span 3; position: sticky; top: calc(var(--header-h) + 16px); }
.ad-info { grid-area: info; padding-top: 16px; }

.gallery__main { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: #eef1f4; }
.gallery__main--empty { display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted-2); }
.gallery__main--empty .icon { width: 56px; height: 56px; stroke-width: 1.4; }
.gallery__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; overscroll-behavior-x: contain; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; cursor: zoom-in; }
.gallery__slide img { width: 100%; height: 100%; object-fit: contain; user-select: none; }
.gallery__nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: rgba(255, 255, 255, 0.95); box-shadow: var(--sh-pop); color: var(--text);
    display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.2s, transform 0.15s;
}
.gallery__nav--prev { left: 14px; }
.gallery__nav--next { right: 14px; }
.gallery__main:hover .gallery__nav { opacity: 1; }
.gallery__nav:hover { transform: translateY(-50%) scale(1.08); }
.gallery__nav:disabled { opacity: 0 !important; pointer-events: none; }
.gallery__counter {
    position: absolute; right: 12px; bottom: 12px; padding: 4px 12px; border-radius: var(--r-pill);
    background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; font-weight: 600;
}
.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.gallery__thumb {
    flex: none; width: 92px; height: 69px; padding: 0; border: 2px solid transparent; border-radius: 10px;
    overflow: hidden; background: var(--bg-soft); cursor: pointer; opacity: 0.75; transition: all 0.15s;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-active { border-color: var(--blue); opacity: 1; }

.buy-card { background: #fff; border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-card); }
.price-big { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.buy-card__actions { display: grid; gap: 10px; margin: 20px 0 18px; }
.btn.is-revealed { background: var(--green-50); border-color: var(--green); color: #00873a; }
.btn.is-revealed:hover { background: var(--green-50); color: #00873a; }
.seller { display: flex; align-items: center; gap: 14px; padding: 16px 0; margin-top: 6px; border-top: 1px solid var(--border-2); }
.seller__info { display: flex; flex-direction: column; min-width: 0; }
.seller__name { font-size: 16px; }
.seller__since { color: var(--muted); font-size: 13px; }
.seller__link { font-size: 14px; font-weight: 600; margin-top: 4px; }
.share-btn { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; padding: 20px; margin-bottom: 28px; background: var(--bg-soft-2); border-radius: var(--r-card); }
.facts li { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: 8px; font-size: 14.5px; }
.facts .icon { color: var(--muted-2); width: 18px; height: 18px; }
.facts span { color: var(--muted); }
.facts b { font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.section-title { font-size: 22px; margin-bottom: 12px; }
.ad-description { white-space: pre-line; font-size: 16px; line-height: 1.65; color: var(--text-2); word-break: break-word; }
.ad-number { margin-top: 24px; color: var(--muted-2); font-size: 13px; }
.related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border-2); }
.related .grid { margin-top: 16px; }

.lightbox {
    position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(8, 12, 20, 0.94);
    opacity: 0; visibility: hidden; transition: opacity 0.2s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox button {
    position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
    color: #fff; display: grid; place-items: center; cursor: pointer; transition: background 0.15s;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox__close { top: 18px; right: 18px; }
.lightbox__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.14); padding: 4px 14px; border-radius: var(--r-pill); }

/* 9. Авторизация и формы --------------------------------------------------------------- */
.auth { display: grid; place-items: start center; padding-top: 48px; padding-bottom: 64px; }
.auth__card { width: 100%; max-width: 440px; padding: 36px; background: #fff; border-radius: 20px; box-shadow: var(--sh-card-hover); }
.auth__card h1 { font-size: 28px; }
.auth__sub { color: var(--muted); margin: 6px 0 26px; }
.auth__switch { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14.5px; }
.auth__switch a { font-weight: 600; }
.auth__demo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }

.form-page { padding-top: 20px; padding-bottom: 64px; max-width: 820px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); font-weight: 500; font-size: 14.5px; }
.back-link:hover { color: var(--blue-700); }
.form-card { background: #fff; border-radius: 20px; padding: 36px; box-shadow: var(--sh-card); }
.form-card h1 { font-size: 28px; }
.form-card__sub { color: var(--muted); margin: 6px 0 28px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }

.dropzone {
    display: grid; justify-items: center; gap: 4px; padding: 30px 20px; text-align: center;
    border: 2px dashed #c9d3dc; border-radius: var(--r-card); background: var(--bg-soft-2); color: var(--muted);
    cursor: pointer; transition: all 0.15s;
}
.dropzone strong { color: var(--text); font-size: 16px; }
.dropzone u { color: var(--blue-700); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.dropzone__icon { width: 38px; height: 38px; color: var(--blue); stroke-width: 1.7; margin-bottom: 6px; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--blue); background: var(--blue-50); }
.dropzone.is-invalid { border-color: var(--red); background: var(--red-50); }
.dropzone.is-full { display: none; }
.previews { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--border-2); animation: card-in 0.25s ease both; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview__main { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 8px; background: var(--yellow); font-size: 11px; font-weight: 700; }
.preview__remove {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, 0.65); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background 0.15s;
}
.preview__remove:hover { background: var(--red); }
.preview__remove .icon { width: 14px; height: 14px; }
.preview.is-uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.7); }
.preview.is-uploading::before {
    content: ""; position: absolute; z-index: 1; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
    border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--blue); animation: spin 0.7s linear infinite;
}
.preview.is-error { border-color: var(--red); }
.preview.is-error::after { content: "Ошибка"; position: absolute; inset: auto 0 0; padding: 3px; background: var(--red); color: #fff; text-align: center; font-size: 11px; font-weight: 600; }

.success-panel { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 28px 8px; }
.success-panel__icon { width: 84px; height: 84px; border-radius: 50%; background: var(--yellow-50); display: grid; place-items: center; font-size: 42px; }
.success-panel .badge { font-size: 13px; padding: 6px 14px; }
.success-panel p { color: var(--muted); max-width: 440px; }
.success-panel__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* 10. Табы / мои объявления / сообщения -------------------------------------------------- */
.page-my, .page-messages { padding-top: 28px; padding-bottom: 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 22px; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--border);
    border-radius: var(--r-pill); background: #fff; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer;
    transition: all 0.15s;
}
.tab:hover { border-color: var(--blue); color: var(--blue-700); }
.tab.is-active { background: var(--yellow); border-color: var(--yellow); color: #1a1a1a; }
.tab__count { min-width: 22px; padding: 0 6px; border-radius: 10px; background: rgba(0, 0, 0, 0.07); font-size: 12px; text-align: center; line-height: 22px; }
.tab.is-active .tab__count { background: rgba(0, 0, 0, 0.12); }

.grid--my { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.card__reason {
    margin: 0 12px 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
    background: var(--red-50); border: 1px solid #ffc9c4; color: #8c1a12;
}
.card__reason b { display: block; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.card__reason--blocked { background: #f3f3f3; border-color: #d9d9d9; color: #333; }
.card__reason--pending { background: var(--yellow-50); border-color: #ffe58a; color: #7a5b00; }
.card__actions { display: flex; gap: 8px; padding: 0 12px 12px; }
.card__actions .btn { flex: 1; padding: 0 10px; }

.messages { display: grid; gap: 10px; max-width: 820px; }
.msg {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 16px 18px;
    background: #fff; border: 1px solid var(--border-2); border-radius: var(--r-card); box-shadow: var(--sh-card);
}
.msg.is-unread { border-left: 4px solid var(--blue); background: var(--blue-50); }
.msg__body { min-width: 0; }
.msg__top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 4px; }
.msg__ad { font-size: 13px; color: var(--muted); }
.msg__text { white-space: pre-line; word-break: break-word; }
.msg__date { font-size: 12.5px; color: var(--muted-2); margin-left: auto; }

/* 11. Модалки и тосты --------------------------------------------------------------------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity 0.2s;
}
.modal-overlay.is-open { opacity: 1; }
.modal {
    width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; padding: 28px;
    background: #fff; border-radius: 18px; box-shadow: var(--sh-modal);
    transform: translateY(14px) scale(0.97); transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-overlay.is-open .modal { transform: none; }
.modal__title { font-size: 21px; margin-bottom: 6px; }
.modal__text { color: var(--muted); margin-bottom: 18px; font-size: 14.5px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .field { margin-bottom: 0; }
.modal__phone { display: block; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin: 6px 0 4px; }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); font-size: 14.5px; font-weight: 500; line-height: 1.4;
    pointer-events: auto; animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
.toast .icon { width: 22px; height: 22px; margin-top: 0; }
.toast--success { background: var(--green); }
.toast--error { background: var(--red); }
.toast--warning { background: var(--yellow); color: #1a1a1a; }
.toast--info { background: var(--blue); }
.toast.is-leaving { animation: toast-out 0.22s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* 12. Админ-панель --------------------------------------------------------------------------- */
.admin-body { background: #f3f5f9; }
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin__sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px;
    background: #0f1a2e; color: #c4cde0;
}
.admin__brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; color: #fff; }
.admin__brand:hover { color: #fff; }
.admin__brand b { display: block; font-size: 16px; line-height: 1.2; }
.admin__brand small { color: #7d8aa5; font-size: 12px; }
.admin__nav { display: grid; gap: 4px; }
.admin__nav a, .admin__foot a, .admin__foot button {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px;
    background: none; color: #b4bfd6; font-weight: 600; font-size: 14.5px; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.admin__nav a:hover, .admin__foot a:hover, .admin__foot button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.admin__nav a.is-active { background: rgba(0, 170, 255, 0.16); color: #5fd0ff; }
.admin__nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.nav-badge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--yellow); color: #1a1a1a; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; }
.admin__foot { margin-top: auto; display: grid; gap: 2px; }
.admin__foot button:hover { color: #ff8a82; }
.admin__me { display: flex; align-items: center; gap: 10px; padding: 12px 10px; margin-bottom: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.admin__me strong { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.admin__me small { color: #7d8aa5; font-size: 12px; }
.admin__me > div { min-width: 0; }
.admin__me small { display: block; overflow: hidden; text-overflow: ellipsis; }

.admin__main { min-width: 0; }
.admin__content { padding: 32px 32px 64px; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-title h1 { font-size: 28px; }
.admin-title p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat {
    display: block; padding: 24px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-card); color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s; border-top: 4px solid var(--c, var(--blue));
}
a.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-card-hover); color: var(--text); }
.stat__label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.stat__label .icon { color: var(--c, var(--blue)); }
.stat__num { margin-top: 10px; font-size: 48px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--c, var(--blue)); }
.stat--blue { --c: var(--blue); }
.stat--green { --c: var(--green); }
.stat--yellow { --c: #f0a800; }
.stat--red { --c: var(--red); }
.stats--small { margin-top: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats--small .stat { padding: 18px 22px; }
.stats--small .stat__num { font-size: 30px; }

.panel { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-card); overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.search-big { position: relative; flex: 1; min-width: 260px; }
.search-big .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 22px; height: 22px; }
.search-big .input { min-height: 56px; padding-left: 52px; font-size: 16px; border-radius: 14px; box-shadow: var(--sh-card); border-color: transparent; }
.search-big .input:focus { border-color: var(--blue); }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: var(--r-pill); background: var(--blue-50); border: 1px solid var(--blue-100); font-size: 13.5px; font-weight: 600; color: var(--blue-700); }
.filter-chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.08); cursor: pointer; color: inherit; }
.filter-chip button:hover { background: rgba(0, 0, 0, 0.18); }
.filter-chip .icon { width: 13px; height: 13px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 13px 14px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #f8f9fb; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr:nth-child(even) { background: #fafbfd; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: #eef8ff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; color: var(--muted); }
.table .cell-title { display: block; max-width: 300px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table a.cell-title:hover { color: var(--blue-700); }
.table .cell-sub { display: block; font-size: 12.5px; color: var(--muted); }
.table .cell-reason { display: block; max-width: 300px; margin-top: 3px; font-size: 12.5px; color: #8c1a12; white-space: normal; line-height: 1.35; }
.table .price { font-weight: 700; white-space: nowrap; }
.cell-stack { min-width: 0; }
.table .nowrap { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.table td:last-child, .table th:last-child { text-align: right; }
.table--ads .row-actions { max-width: 240px; margin-left: auto; }
.table--users .row-actions { max-width: 330px; margin-left: auto; }
.table--ads .cell-title { max-width: 200px; }
.table--ads td:nth-child(3) .cell-title { max-width: 170px; }
.table--ads td:nth-child(5) { min-width: 96px; }
.table--ads td:nth-child(7) { min-width: 108px; }
.table--sticky th:last-child, .table--sticky td:last-child { position: sticky; right: 0; z-index: 1; }
.table--sticky td:last-child { background: #fff; box-shadow: -10px 0 14px -10px rgba(0, 0, 0, 0.14); }
.table--sticky tbody tr:nth-child(even) td:last-child { background: #fafbfd; }
.table--sticky tbody tr:hover td:last-child { background: #eef8ff; }
.table--sticky th:last-child { background: #f8f9fb; }
.table-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border-2); color: var(--muted); font-size: 13.5px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--pending { background: var(--orange-50); color: #b86e00; }
.pill--approved { background: var(--green-50); color: #00873a; }
.pill--rejected { background: var(--red-50); color: #d3281d; }
.pill--blocked { background: #ececec; color: #333; }
.pill--active { background: var(--green-50); color: #00873a; }
.pill--admin { background: var(--blue-50); color: var(--blue-700); }

.cat-list { display: grid; }
.cat-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border-2); }
.cat-row:nth-child(even) { background: #fafbfd; }
.cat-row:last-child { border-bottom: 0; }
.cat-row__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-50); font-size: 24px; }
.cat-row__name { font-weight: 600; font-size: 15.5px; }
.cat-row__count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cat-row .input { min-height: 40px; }
.cat-row__icon-input { width: 56px !important; text-align: center; font-size: 22px; padding: 4px !important; }

/* 13. Подвал и мобильная навигация -------------------------------------------------------------- */
.footer { margin-top: 24px; padding: 28px 0; border-top: 1px solid var(--border-2); background: var(--bg-soft-2); }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__note { margin-top: 8px; color: var(--muted); font-size: 13px; }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.footer__links a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.footer__links a:hover { color: var(--blue-700); }
body.body-soft .footer { background: transparent; border-top-color: transparent; }

.bottom-nav { display: none; }

/* 14. Адаптив ------------------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .grid, .grid--my { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .layout { grid-template-columns: 248px minmax(0, 1fr); gap: 22px; }
    .ad-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 12px 28px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header__link--text { display: none; }
}

@media (max-width: 1023px) {
    .container { padding: 0 16px; }
    .layout { grid-template-columns: minmax(0, 1fr); }
    .grid, .grid--my { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

    /* фильтры превращаются в нижнюю шторку */
    .filters-toggle { display: inline-flex; }
    .filters {
        position: fixed; inset: auto 0 0 0; top: auto; z-index: 90; max-height: 88vh; overflow-y: auto;
        transform: translateY(105%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
        border-radius: 22px 22px 0 0; background: #fff; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    }
    .filters.is-open { transform: none; }
    .filters__card { border: 0; box-shadow: none; border-radius: 0; padding: 20px 20px 28px; }
    .filters__close { display: inline-grid; }
    .sheet-overlay { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.45); opacity: 0; visibility: hidden; transition: opacity 0.25s; }
    .sheet-overlay.is-open { opacity: 1; visibility: visible; }

    .ad-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "gallery" "side" "info"; gap: 14px; }
    .ad-side { grid-row: auto; position: static; }
    .ad-title { font-size: 24px; padding-bottom: 0; }
    .gallery__thumbs { display: none; }
    .gallery__nav { display: none; }
    .gallery__main { border-radius: 14px; }
    .buy-card { padding: 20px; }
    .price-big { font-size: 32px; }

    .header__inner { grid-template-columns: auto 1fr; grid-template-areas: "logo actions" "search search"; height: auto; gap: 10px 12px; padding-top: 10px; padding-bottom: 12px; }
    .logo { grid-area: logo; }
    .header__actions { grid-area: actions; justify-self: end; }
    .search { grid-area: search; max-width: none; height: 44px; }
    .header__create span { display: none; }
    .header__create { padding: 0; width: 42px; }
    .header__login span { display: none; }
    .header__login { padding: 9px; background: var(--bg-soft); }

    /* админка: сайдбар становится горизонтальной полосой */
    .admin { grid-template-columns: minmax(0, 1fr); }
    .admin__sidebar { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 6px; overflow-x: auto; }
    .admin__brand { padding: 0 8px 0 4px; }
    .admin__brand span:last-child { display: none; }
    .admin__nav { display: flex; gap: 2px; }
    .admin__nav a { width: auto; padding: 9px 12px; white-space: nowrap; }
    .admin__nav a.is-active::before { display: none; }
    .admin__foot { margin: 0 0 0 auto; display: flex; }
    .admin__me { display: none; }
    .admin__foot a, .admin__foot button { width: auto; padding: 9px 12px; white-space: nowrap; }
    .admin__content { padding: 20px 16px 56px; }
}

@media (max-width: 767px) {
    body { padding-bottom: 64px; font-size: 15px; }
    h1 { font-size: 24px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat { padding: 18px; }
    .stat__num { font-size: 36px; }
    .stats--small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .form-card, .auth__card { padding: 24px 20px; border-radius: 18px; }
    .previews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .facts { grid-template-columns: 1fr; padding: 16px; }
    .results__title { font-size: 22px; }
    .toasts { top: 10px; right: 10px; left: 10px; width: auto; }
    .footer { display: none; }
    .msg { grid-template-columns: auto 1fr; }
    .msg > .btn { grid-column: 1 / -1; }
    .cat-row { grid-template-columns: 48px minmax(0, 1fr); }
    .cat-row__count { grid-column: 2; }
    .cat-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .modal { padding: 22px; }
    .modal__actions { flex-direction: column-reverse; }
    .modal__actions .btn { width: 100%; }

    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-2);
    }
    .bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 4px 0; color: var(--muted); font-size: 11px; font-weight: 600; }
    .bottom-nav a.is-active { color: var(--blue-700); }
    .bottom-nav .icon { width: 24px; height: 24px; }
    .bottom-nav__create span { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(0, 170, 255, 0.45); }
    .bottom-nav__create .icon { width: 24px; height: 24px; }
    .header__create { display: none; }
    .admin-body { padding-bottom: 0; }

    /* таблицы админки превращаются в список карточек: подпись поля слева, значение справа */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border-2); }
    .table tbody tr:last-child { border-bottom: 0; }
    .table td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 5px 0; border: 0; text-align: right; }
    .table td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; text-align: left; }
    .table td:not([data-label])::before { content: none; }
    .table td:last-child { display: block; padding-top: 10px; }
    .table td > * { min-width: 0; }
    .cell-stack { flex: 1; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 3px; }
    .table .cell-title, .table--ads .cell-title, .table--ads td:nth-child(3) .cell-title { max-width: 100%; }
    .table .cell-reason { max-width: none; text-align: right; }
    .table--ads .row-actions, .table--users .row-actions { max-width: none; justify-content: flex-start; margin: 0; }
    .table--sticky td:last-child, .table--sticky tbody tr:nth-child(even) td:last-child, .table--sticky tbody tr:hover td:last-child { position: static; background: none; box-shadow: none; }
    .table--ads td:nth-child(5), .table--ads td:nth-child(7) { min-width: 0; }
    .table-empty { padding: 32px 12px; }
}

@media (max-width: 519px) {
    .container { padding: 0 14px; }
    .grid, .grid--my { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    /* на узком экране карточка — горизонтальная: фото слева, текст справа */
    .card__link { flex-direction: row; }
    .card__media { flex: 0 0 42%; aspect-ratio: auto; min-height: 128px; border-radius: var(--r-card) 0 0 var(--r-card); }
    .card__body { padding: 10px 12px; }
    .card__title { min-height: 0; font-size: 14.5px; }
    .card__price { font-size: 18px; }
    .grid--my .card__link { flex-direction: row; }
    .price-big { font-size: 30px; }
    .results__head { align-items: center; }
    .user-menu__dropdown { right: -4px; }
    .cat-chip { padding: 8px 10px 12px; font-size: 14px; }
    .table th, .table td { padding: 11px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
