:root {
    --brand: #0a8dff;
    --brand-600: #0073e6;
    --brand-700: #005bbb;
    --brand-800: #063f86;
    --brand-soft: #eaf5ff;
    --brand-tint: #f5faff;
    --ink: #111827;
    --ink-2: #273244;
    --muted: #667085;
    --line: #e4eaf2;
    --line-strong: #cad5e4;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --success: #10815c;
    --success-soft: #e9f8f0;
    --danger: #b42318;
    --danger-soft: #fff1ef;
    --warning: #b54708;
    --warning-soft: #fff7e8;
    --shadow: 0 22px 60px rgba(15, 23, 42, .10);
    --shadow-soft: 0 12px 34px rgba(15, 23, 42, .07);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand-600); text-decoration: none; transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
a:hover { color: var(--brand-700); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.container {
    width: min(var(--container), calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.site-main { min-height: 58vh; }
.muted, small { color: var(--muted); }
.help-text { margin-top: 6px; color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(17, 24, 39, .08);
    backdrop-filter: blur(18px);
}

.topbar { color: #fff; background: linear-gradient(90deg, #063f86, #0788ff); font-size: 13px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 34px; }
.topbar__accent { font-weight: 800; }

.header-main { display: flex; align-items: center; gap: 20px; min-height: 82px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 170px; }
.brand__mark { display: block; width: 178px; height: auto; }

.main-menu { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.main-menu > a,
.categories-menu__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 9px 13px;
    color: var(--ink-2);
    background: transparent;
    font-weight: 700;
    white-space: nowrap;
}
.main-menu > a:hover,
.categories-menu__button:hover { color: var(--brand-700); background: var(--brand-soft); }

.categories-menu { position: relative; flex: 0 0 auto; }
.categories-menu__panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    display: none;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    width: min(720px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.categories-menu:hover .categories-menu__panel,
.categories-menu.is-open .categories-menu__panel { display: flex; }
.categories-menu__group { flex: 1 1 260px; border-radius: 16px; padding: 12px; background: #f8fbff; }
.categories-menu__parent { display: block; color: var(--ink); font-weight: 800; }
.categories-menu__children { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.categories-menu__children a { color: var(--muted); font-size: 13px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.header-actions form { margin: 0; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.nav-toggle span:not(.sr-only) { display: block; width: 18px; height: 2px; margin: 4px auto; border-radius: 999px; background: var(--ink); }

/* Buttons */
.btn,
button[type="submit"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 18px;
    color: #fff;
    background: var(--brand);
    font-weight: 800;
    text-align: center;
    box-shadow: 0 12px 26px rgba(10, 141, 255, .20);
}
.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover { color: #fff; background: var(--brand-700); transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: #fff; box-shadow: none; }
.btn--ghost:hover { color: var(--brand-700); background: var(--brand-soft); border-color: #b6dfff; }
.btn--danger { color: #fff; background: var(--danger); box-shadow: 0 12px 26px rgba(180, 35, 24, .16); }
.btn--danger:hover { background: #8f1d14; }
.btn--small { min-height: 36px; padding: 7px 13px; font-size: 14px; }
.btn--large { min-height: 54px; padding: 13px 26px; font-size: 16px; }
.action-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }

/* Alerts */
.flash { margin-top: 18px; border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow-soft); }
.flash--success { color: var(--success); background: var(--success-soft); border: 1px solid #bbebd1; }
.flash--danger { color: var(--danger); background: var(--danger-soft); border: 1px solid #ffd4ce; }
.flash ul { margin: 8px 0 0 20px; }

/* Generic panels */
.panel,
.card,
.form-card,
.admin-card,
.auth-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}
.panel { padding: 22px; }
.card { padding: 0; overflow: hidden; }
.form-card, .auth-card { padding: 28px; }
.admin-card { padding: 24px; }

.page-section { padding: 58px 0; }
.page-section--compact { padding-top: 28px; }
.page-hero {
    padding: 42px 0 28px;
    color: #fff;
    background: radial-gradient(circle at 80% 10%, rgba(10, 141, 255, .35), transparent 34%), linear-gradient(135deg, #0d1728 0%, #0b315c 62%, #086ec6 100%);
}
.page-hero--compact { padding: 30px 0; }
.page-hero h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; }
.page-hero p { max-width: 720px; margin: 12px 0 0; color: rgba(255,255,255,.82); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); }
.section-head p { margin: 7px 0 0; color: var(--muted); }

/* Home hero */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(circle at 88% 16%, rgba(72, 156, 255, .38), transparent 34%), linear-gradient(135deg, #0d1728 0%, #102944 48%, #065fae 100%);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(9, 18, 32, .78), rgba(9, 27, 50, .36), rgba(0, 116, 224, .18));
    pointer-events: none;
}
.hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    min-height: 580px;
    padding: 72px 0;
}
.hero__inner > div:first-child { flex: 1 1 620px; max-width: 720px; }
.hero__visual { display: flex; justify-content: center; flex: 0 1 420px; }
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,.44);
    border-radius: 999px;
    padding: 8px 14px;
    color: #fff;
    background: rgba(255,255,255,.08);
    font-weight: 900;
    letter-spacing: .02em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.13);
}
.hero h1 {
    margin: 16px 0 16px;
    max-width: 760px;
    color: #fff;
    font-size: clamp(48px, 7vw, 86px);
    line-height: .96;
    text-transform: uppercase;
    letter-spacing: -.05em;
    text-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.hero p { max-width: 640px; color: rgba(255,255,255,.92); font-size: clamp(18px, 2.4vw, 22px); }
.hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 620px;
    margin-top: 28px;
    border: 8px solid rgba(255,255,255,.95);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 22px 50px rgba(0,0,0,.24);
}
.hero-search input { flex: 1 1 auto; min-width: 0; border: 0; padding: 0 14px; color: var(--ink); outline: 0; }
.hero-search input::placeholder { color: #7b8494; }
.hero-search .btn { flex: 0 0 auto; min-width: 132px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero .btn--ghost { color: var(--ink); background: #fff; }
.hero .btn--ghost:hover { color: var(--brand-700); }

.hero-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: min(360px, 100%);
    border: 12px solid rgba(235, 242, 255, .96);
    border-radius: 36px;
    padding: 36px 28px 32px;
    color: #fff;
    background: rgba(12, 22, 38, .86);
    box-shadow: 0 32px 80px rgba(0,0,0,.34);
}
.hero-card__logo { width: 178px; filter: brightness(0) invert(1); }
.hero-card__percent {
    position: absolute;
    right: -36px;
    top: -52px;
    color: rgba(10,141,255,.18);
    font-size: 190px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}
.hero-card__content { display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.hero-card__content strong { font-size: 28px; line-height: 1.05; text-transform: uppercase; }
.hero-card__content span { color: rgba(255,255,255,.78); }
.hero-card__tags { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.hero-card__tags span { flex: 1 1 128px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px; background: rgba(10,141,255,.18); color: #fff; font-weight: 800; text-align: center; }

/* Flexible lists and cards */
.category-list,
.category-grid,
.card-list,
.listing-grid,
.listing-grid,
.pricing-list,
.pricing-grid,
.plans-grid,
.limit-list,
.limit-grid,
.usage-grid,
.form-row,
.form-grid,
.admin-form-row,
.admin-form-grid,
.check-list,
.check-grid,
.catalog-filter__grid,
.grid-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.category-list > *, .category-grid > * { flex: 1 1 190px; }
.card-list > *, .listing-grid > *, .listing-grid > * { flex: 1 1 300px; }
.pricing-list > *, .pricing-grid > *, .plans-grid > * { flex: 1 1 280px; }
.limit-list > *, .limit-grid > *, .usage-grid > * { flex: 1 1 210px; }
.form-row > *, .form-grid > *, .admin-form-row > *, .admin-form-grid > *, .catalog-filter__grid > * { flex: 1 1 260px; }
.form-row--3 > *, .form-grid--3 > * { flex-basis: 220px; }
.admin-form-row--5 > *, .admin-form-grid--5 > * { flex-basis: 150px; }
.check-list > *, .check-grid > * { flex: 1 1 220px; }
.form-full, .catalog-filter__wide { flex: 1 1 100%; }
.metric-row { display: flex; flex-wrap: wrap; gap: 18px; }
.metric-row > * { flex: 1 1 220px; }

.category-tile {
    position: relative;
    display: flex;
    min-height: 126px;
    border-radius: 20px;
    padding: 20px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-700));
    box-shadow: 0 18px 36px rgba(10,141,255,.18);
}
.category-tile::after { content: attr(data-icon); position: absolute; right: 18px; top: 16px; font-size: 34px; opacity: .8; }
.category-tile:hover { color: #fff; transform: translateY(-3px); }
.category-tile > span { display: flex; flex-direction: column; justify-content: end; gap: 4px; position: relative; z-index: 1; }
.category-tile__name { font-size: 18px; font-weight: 900; }
.category-tile__count { color: rgba(255,255,255,.82); font-size: 14px; }

.listing-card { display: flex; flex-direction: column; min-height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.listing-card__image { display: block; position: relative; aspect-ratio: 4 / 3; background: #eef5ff; overflow: hidden; }
.listing-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.listing-card:hover .listing-card__image img { transform: scale(1.035); }
.listing-card__badge { position: absolute; left: 12px; top: 12px; display: inline-flex; border-radius: 999px; padding: 5px 10px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 900; }
.listing-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; padding: 18px; }
.listing-card__category { color: var(--brand-700); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; }
.listing-card h3 { margin: 0; color: var(--ink); font-size: 19px; line-height: 1.22; }
.listing-card__meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 14px; }
.listing-card__price { margin-top: auto; color: var(--ink); font-size: 22px; font-weight: 900; }
.listing-card__vat, .price-panel__vat { color: var(--muted); font-size: 13px; }

.listing-list { display: flex; flex-direction: column; gap: 18px; }
.listing-row { display: flex; align-items: stretch; gap: 18px; padding: 16px; }
.listing-row__image { flex: 0 0 220px; border-radius: 16px; overflow: hidden; background: #eef5ff; }
.listing-row__image img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; display: block; }
.listing-row > div:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.listing-row h3 { margin: 6px 0 8px; color: var(--ink); }
.listing-row__price { display: flex; flex-direction: column; gap: 6px; flex: 0 0 210px; align-items: flex-end; text-align: right; }
.listing-row__price strong { color: var(--ink); font-size: 22px; }

/* Catalog */
.catalog-search-panel,
.search-panel,
.catalog-filter,
.dynamic-filters {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.catalog-filter__head,
.catalog-filter__bottom,
.catalog-filter__actions,
.filter-summary,
.range-filter__inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.catalog-filter__head { justify-content: space-between; margin-bottom: 16px; }
.catalog-filter__actions { justify-content: flex-end; margin-top: 18px; }
.catalog-filter__bottom { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dynamic-filters__title { margin: 0 0 14px; font-size: 18px; }
.range-filter { display: flex; flex-direction: column; gap: 8px; }
.range-filter__label { color: var(--muted); font-size: 13px; font-weight: 800; }

/* Forms */
label { display: flex; flex-direction: column; gap: 7px; color: var(--ink-2); font-weight: 800; }
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="tel"],
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10,141,255,.12); }
.form-actions, .admin-form__actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.actions--column { align-items: stretch; flex-direction: column; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 700; }
.checkbox-line, .check-row, .check-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: #fbfdff;
}
.checkbox-line input, .check-row input, .check-card input { width: auto; min-height: auto; margin-top: 3px; }
.check-card { flex-direction: row; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.filter-form > * { flex: 1 1 210px; }
.filter-form button, .filter-form .btn { flex: 0 0 auto; }

/* Auth */
.auth-page { display: flex; align-items: stretch; min-height: 70vh; padding: 48px 0; }
.auth-aside { flex: 1 1 45%; border-radius: var(--radius-lg); padding: 44px; color: #fff; background: linear-gradient(135deg, var(--brand-800), var(--brand)); }
.auth-card { flex: 1 1 520px; max-width: 620px; margin-left: auto; }

/* Detail page */
.listing-detail__layout,
.listing-detail__grid,
.moderation-layout,
.subscription-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.listing-detail__layout > :first-child,
.listing-detail__grid > :first-child,
.moderation-layout > :first-child,
.subscription-layout > :first-child { flex: 1 1 auto; min-width: 0; }
.listing-detail__layout > :last-child,
.listing-detail__grid > :last-child,
.moderation-sidebar,
.subscription-layout > :last-child { flex: 0 0 360px; }
.gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery__main { border-radius: 20px; overflow: hidden; background: #eef5ff; }
.gallery__main img { width: 100%; max-height: 540px; object-fit: cover; display: block; }
.gallery__thumbs, .image-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery__thumbs img, .image-strip__item img { width: 84px; height: 70px; border-radius: 12px; object-fit: cover; }
.price-panel { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.price-panel__amount { display: block; color: var(--ink); font-size: 30px; font-weight: 900; line-height: 1.1; }
.listing-actions-box, .contact-form-box, .complaint-box { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.data-list, dl { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.data-list > div, dl > div { flex: 1 1 240px; }
dt { color: var(--muted); font-size: 13px; font-weight: 800; }
dd { margin: 3px 0 0; color: var(--ink); font-weight: 700; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span, .tag-list a { border-radius: 999px; padding: 6px 10px; color: var(--brand-700); background: var(--brand-soft); font-size: 13px; font-weight: 800; }

/* Badges */
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 5px 10px; color: var(--brand-700); background: var(--brand-soft); font-size: 12px; font-weight: 900; }
.badge--warning { color: var(--warning); background: var(--warning-soft); }
.badge--danger { color: var(--danger); background: var(--danger-soft); }
.badge--muted { color: var(--muted); background: #f1f4f8; }
.badge--success { color: var(--success); background: var(--success-soft); }

/* Tables */
.table-wrap, .table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); background: #f8fbff; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table__actions, .table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-table__actions form, .table-actions form { margin: 0; }

/* Admin */
.site-shell.is-admin { background: #eef4fb; }
.admin-shell { display: flex; align-items: stretch; gap: 24px; width: min(1440px, calc(100% - 32px)); margin: 26px auto 44px; }
.admin-sidebar {
    position: sticky;
    top: 114px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 0 0 270px;
    align-self: flex-start;
    min-height: calc(100vh - 150px);
    border-radius: 24px;
    padding: 20px;
    color: #fff;
    background: linear-gradient(180deg, #10233e, #0a3f76);
    box-shadow: var(--shadow);
}
.admin-sidebar__brand { display: flex; flex-direction: column; gap: 5px; padding: 10px 10px 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.admin-sidebar__brand strong { font-size: 18px; }
.admin-sidebar__brand span { color: rgba(255,255,255,.72); font-size: 13px; }
.admin-sidebar__nav { display: flex; flex-direction: column; gap: 7px; }
.admin-sidebar__nav a, .admin-sidebar__site {
    display: flex;
    align-items: center;
    min-height: 42px;
    border-radius: 14px;
    padding: 10px 12px;
    color: rgba(255,255,255,.86);
    font-weight: 800;
}
.admin-sidebar__nav a:hover, .admin-sidebar__nav a.is-active, .admin-sidebar__site:hover { color: #fff; background: rgba(255,255,255,.14); }
.admin-sidebar__site { margin-top: auto; border: 1px solid rgba(255,255,255,.18); }
.admin-content, .admin-workspace { flex: 1 1 auto; min-width: 0; }
.admin-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px 22px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.admin-page-head h1, .admin-page-head h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; }
.admin-page-head p { margin: 6px 0 0; color: var(--muted); }
.admin-kicker { color: var(--brand-700); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.admin-form { display: flex; flex-direction: column; gap: 22px; }
.admin-form__section { display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--line); border-radius: 20px; padding: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.admin-form__section h2, .admin-form__section h3 { margin: 0; }

/* Plans */
.pricing-card { position: relative; display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--line); border-radius: 24px; padding: 24px; background: #fff; box-shadow: var(--shadow-soft); }
.pricing-card--featured { border-color: rgba(10,141,255,.38); box-shadow: 0 24px 58px rgba(10,141,255,.16); }
.pricing-card__label { display: inline-flex; align-self: flex-start; border-radius: 999px; padding: 6px 10px; color: var(--brand-700); background: var(--brand-soft); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.pricing-card__price, .plan-card__price { color: var(--ink); font-size: 32px; font-weight: 900; }
.feature-list, .plan-features { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.feature-list li, .plan-features li { display: flex; gap: 8px; align-items: flex-start; }
.feature-list li::before, .plan-features li::before { content: "✓"; color: var(--success); font-weight: 900; }
.plan-current, .plan-summary, .plan-inline { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.plan-current { align-items: stretch; }
.limit-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.limit-card strong { font-size: 24px; }

/* Cabinet, messages, moderation */
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.status-tabs a { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--ink-2); background: #fff; font-weight: 800; }
.status-tabs a.is-active, .status-tabs a:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
.panel-list { display: flex; flex-direction: column; gap: 14px; }
.message-list, .message-thread, .chat { display: flex; flex-direction: column; gap: 12px; }
.message-thread__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.chat-message__body { border-radius: 16px; padding: 12px 14px; background: #f6f9fd; }
.chat-message__meta { color: var(--muted); font-size: 12px; }
.timeline-item { border-left: 3px solid var(--brand); padding: 2px 0 16px 14px; }
.moderation-preview, .moderation-listing-cell { display: flex; align-items: center; gap: 12px; }
.moderation-preview img, .moderation-listing-cell img { width: 70px; height: 58px; border-radius: 12px; object-fit: cover; background: #eef5ff; }
.moderation-bulk { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 14px 0; }
.moderation-layout--bottom { margin-top: 22px; }

/* Footer */
.site-footer { margin-top: 60px; color: rgba(255,255,255,.82); background: #0f1c2f; }
.footer-columns,
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px; padding: 44px 0 28px; }
.footer-columns > div,
.footer-grid > div { min-width: 0; }
.footer-logo { width: 170px; filter: brightness(0) invert(1); }
.site-footer h3 { margin: 0 0 12px; color: #fff; }
.site-footer a { display: flex; color: rgba(255,255,255,.78); margin: 7px 0; }
.site-footer a:hover { color: #fff; }
.footer-contact { color: #fff; font-weight: 800; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; }

@media (max-width: 1180px) {
    .main-menu { display: none; position: absolute; left: 16px; right: 16px; top: 100%; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; box-shadow: var(--shadow); }
    .main-menu.is-open { display: flex; }
    .main-menu > a, .categories-menu__button { justify-content: flex-start; }
    .categories-menu__panel { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
    .nav-toggle { display: inline-block; }
    .header-main { position: relative; }
    .admin-shell { flex-direction: column; }
    .admin-sidebar { position: static; flex-basis: auto; min-height: 0; }
    .admin-sidebar__nav { flex-direction: row; flex-wrap: wrap; }
    .admin-sidebar__nav a { flex: 1 1 160px; }
}

@media (max-width: 920px) {
    .footer-columns,
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero__inner { flex-direction: column; align-items: flex-start; min-height: 0; padding: 52px 0; }
    .hero__visual { width: 100%; justify-content: flex-start; }
    .hero h1 { font-size: clamp(42px, 11vw, 62px); }
    .listing-detail__layout, .listing-detail__grid, .moderation-layout, .subscription-layout { flex-direction: column; }
    .listing-detail__layout > :last-child, .listing-detail__grid > :last-child, .moderation-sidebar, .subscription-layout > :last-child { flex: 1 1 auto; width: 100%; }
    .listing-row { flex-direction: column; }
    .listing-row__image, .listing-row__price { flex-basis: auto; width: 100%; align-items: flex-start; text-align: left; }
    .admin-page-head, .section-head { align-items: flex-start; flex-direction: column; }
    .auth-page { flex-direction: column; gap: 18px; }
    .auth-card { max-width: none; margin-left: 0; }
}

@media (max-width: 640px) {
    .container { width: min(var(--container), calc(100% - 22px)); }
    .footer-columns,
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .topbar__inner, .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 0; }
    .header-main { min-height: 72px; gap: 10px; }
    .brand { min-width: 130px; }
    .brand__mark { width: 138px; }
    .header-actions { display: none; }
    .hero-search { flex-direction: column; align-items: stretch; border-radius: 24px; padding: 6px; }
    .hero-search input { min-height: 46px; }
    .hero-search .btn { width: 100%; }
    .hero-card { border-width: 8px; padding: 28px 20px; }
    .page-section { padding: 36px 0; }
    .panel, .form-card, .auth-card, .admin-card { padding: 18px; }
    .admin-shell { width: min(100% - 22px, 1440px); }
    .admin-sidebar { border-radius: 18px; padding: 14px; }
    .admin-sidebar__nav a { flex-basis: 100%; }
    .form-actions, .admin-form__actions, .actions { flex-direction: column; align-items: stretch; }
    .btn, button[type="submit"], input[type="submit"] { width: 100%; }
}

/* Step 10: header, catalog view modes and admin map area */
.header-main {
    gap: 16px;
}

.main-menu {
    justify-content: flex-start;
    overflow: visible;
}

.main-menu > a.is-active,
.nav-group__panel a.is-active,
.nav-group__button.is-active {
    color: var(--brand-700);
    background: var(--brand-soft);
}

.nav-group {
    position: relative;
    flex: 0 0 auto;
}

.nav-group__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 9px 13px;
    color: var(--ink-2);
    background: transparent;
    font-weight: 700;
    white-space: nowrap;
}

.nav-group__button:hover,
.nav-group.is-open .nav-group__button {
    color: var(--brand-700);
    background: var(--brand-soft);
}

.nav-group__panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 80;
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}

.nav-group:hover .nav-group__panel,
.nav-group.is-open .nav-group__panel {
    display: flex;
}

.nav-group__panel a {
    display: flex;
    align-items: center;
    min-height: 38px;
    border-radius: 12px;
    padding: 8px 10px;
    color: var(--ink-2);
    font-weight: 800;
    white-space: nowrap;
}

.nav-group__panel a:hover {
    color: var(--brand-700);
    background: var(--brand-soft);
}

.nav-group__lead {
    color: #fff !important;
    background: var(--brand) !important;
}

.header-actions .btn--small {
    min-height: 40px;
    padding: 9px 15px;
}

.section-head--catalog {
    align-items: center;
}

.catalog-toolbar,
.view-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.view-switch {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    background: #fff;
}

.view-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 999px;
    padding: 7px 14px;
    color: var(--muted);
    font-weight: 900;
}

.view-switch a.is-active,
.view-switch a:hover {
    color: #fff;
    background: var(--brand);
}

.listings-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 20px;
}

.listings-layout > .listing-card {
    min-width: 0;
}

.listings-layout--tiles > .listing-card,
.listings-layout--tiles > .listing-card.card.listing-card--tile {
    flex: 0 0 calc((100% - 60px) / 4);
    width: calc((100% - 60px) / 4);
    max-width: calc((100% - 60px) / 4);
}

.listings-layout--list {
    flex-direction: column;
}

.listings-layout--list > .listing-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
}

.listing-card--tile {
    width: auto;
    max-width: 100%;
}

.listing-card--row {
    flex-direction: row;
    width: 100%;
}

.listing-card--row .listing-card__image {
    flex: 0 0 280px;
    width: 280px;
    min-height: 190px;
    aspect-ratio: auto;
}

.listing-card--row .listing-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.listing-card__excerpt {
    margin: 0;
    color: var(--muted);
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.admin-content > * {
    max-width: 100%;
}

.schema-component\:\:form\.karta-tocki-i-svobodnaa-linia\:\:data\:\:section,
.admin-content [class*="karta-tocki-i-svobodnaa-linia"],
.admin-content [id*="karta-tocki-i-svobodnaa-linia"],
.admin-content [data-field*="karta-tocki-i-svobodnaa-linia"],
.admin-content [data-section*="karta-tocki-i-svobodnaa-linia"],
.admin-content [data-component*="karta-tocki-i-svobodnaa-linia"],
.admin-content [wire\:key*="karta-tocki-i-svobodnaa-linia"],
.admin-content [x-data*="karta-tocki-i-svobodnaa-linia"] {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    align-self: stretch !important;
}

.admin-content [class*="karta-tocki-i-svobodnaa-linia"] > *,
.admin-content [id*="karta-tocki-i-svobodnaa-linia"] > *,
.admin-content [data-field*="karta-tocki-i-svobodnaa-linia"] > *,
.admin-content [data-section*="karta-tocki-i-svobodnaa-linia"] > *,
.admin-content [data-component*="karta-tocki-i-svobodnaa-linia"] > * {
    width: 100% !important;
    max-width: 100% !important;
}

.admin-content .map-field,
.admin-content .map-wrapper,
.admin-content .map-container,
.admin-content [class*="map"],
.admin-content [class*="Map"],
.admin-content .leaflet-container,
.admin-content [class*="ymaps"],
.admin-content [id*="map"],
.admin-content [id*="Map"] {
    width: 100% !important;
    max-width: 100% !important;
}

.admin-content .leaflet-container,
.admin-content [class*="ymaps"],
.admin-content [id*="map"],
.admin-content [id*="Map"] {
    min-height: 520px;
    border-radius: 18px;
    overflow: hidden;
}

@media (min-width: 981px) {
    .listings-layout--tiles > .listing-card,
    .listings-layout--tiles > .listing-card.card.listing-card--tile {
        flex: 0 0 calc((100% - 60px) / 4);
        width: calc((100% - 60px) / 4);
        max-width: calc((100% - 60px) / 4);
    }
}

@media (max-width: 980px) {
    .listings-layout--tiles > .listing-card,
    .listings-layout--tiles > .listing-card.card.listing-card--tile {
        flex: 0 0 calc((100% - 20px) / 2);
        width: calc((100% - 20px) / 2);
        max-width: calc((100% - 20px) / 2);
    }

    .listing-card--row {
        flex-direction: column;
    }

    .listing-card--row .listing-card__image {
        flex-basis: auto;
        width: 100%;
        min-height: 220px;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 1180px) {
    .main-menu .nav-group__button,
    .main-menu .nav-group__panel a {
        justify-content: flex-start;
        width: 100%;
    }

    .main-menu .nav-group {
        width: 100%;
    }

    .main-menu .nav-group__panel {
        position: static;
        display: none;
        min-width: 0;
        margin-top: 8px;
        box-shadow: none;
    }

    .main-menu .nav-group.is-open .nav-group__panel {
        display: flex;
    }
}

@media (max-width: 640px) {
    .listings-layout--tiles > .listing-card,
    .listings-layout--tiles > .listing-card.card.listing-card--tile {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .catalog-toolbar,
    .view-switch {
        width: 100%;
    }

    .view-switch a {
        flex: 1 1 0;
    }

    .admin-content .leaflet-container,
    .admin-content [class*="ymaps"],
    .admin-content [id*="map"],
    .admin-content [id*="Map"] {
        min-height: 380px;
    }
}


/* Step 11: ad detail, gallery and media manager. Flex only. */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--muted);
    font-weight: 800;
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.listing-detail--pro {
    padding-bottom: 46px;
}

.listing-detail__layout--pro {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.listing-detail__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.listing-detail__side {
    flex: 0 0 360px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.listing-hero-card,
.listing-title-card,
.listing-content-card,
.similar-listings,
.seller-card,
.contact-card,
.safe-deal-card {
    width: 100%;
}

.listing-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.listing-gallery__main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 480px;
    border-radius: 22px;
    overflow: hidden;
    background: #f3f6f8;
}

.listing-gallery__main img {
    width: 100%;
    height: 100%;
    max-height: 620px;
    object-fit: contain;
}

.listing-gallery__label {
    position: absolute;
    left: 16px;
    top: 16px;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 119, 182, .92);
    font-weight: 900;
    box-shadow: 0 14px 26px rgba(0, 119, 182, .24);
}

.listing-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.listing-gallery__thumb {
    flex: 0 0 92px;
    width: 92px;
    height: 74px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
}

.listing-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-gallery__thumb.is-active,
.listing-gallery__thumb:hover {
    border-color: var(--brand);
}

.listing-gallery__hint {
    margin: 0;
    color: var(--muted);
}

.listing-title-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.listing-title-card h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
}

.listing-title-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
}

.listing-title-card__meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-2);
}

.section-head--compact {
    margin-bottom: 14px;
}

.listing-description {
    color: var(--text);
    line-height: 1.75;
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
}

.spec-list__row {
    display: flex;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.spec-list__row:last-child {
    border-bottom: 0;
}

.spec-list dt {
    flex: 0 0 230px;
    color: var(--muted);
    font-weight: 800;
}

.spec-list dd {
    flex: 1 1 auto;
    margin: 0;
    font-weight: 900;
}

.tag-list--detail {
    margin-top: 14px;
}

.price-panel--sticky {
    position: sticky;
    top: 18px;
    z-index: 2;
}

.vat-breakdown,
.seller-card__requisites {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 0;
}

.vat-breakdown div,
.seller-card__requisites div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.vat-breakdown dt,
.seller-card__requisites dt {
    color: var(--muted);
    font-weight: 800;
}

.vat-breakdown dd,
.seller-card__requisites dd {
    margin: 0;
    text-align: right;
    font-weight: 900;
}

.seller-card,
.contact-card,
.contact-form-box,
.complaint-box,
.safe-deal-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-card form,
.contact-form-box form,
.complaint-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.safe-deal-card p {
    margin: 0;
}

.listings-layout--compact {
    gap: 14px;
}

.listings-layout--compact > .listing-card,
.listings-layout--compact > .listing-card.card.listing-card--tile {
    flex: 0 0 calc((100% - 42px) / 4);
    width: calc((100% - 42px) / 4);
    max-width: calc((100% - 42px) / 4);
}

.media-fieldset {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.image-manager {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.image-manager__item {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.image-manager__preview {
    position: relative;
    display: flex;
    height: 150px;
    background: #f3f6f8;
}

.image-manager__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-manager__preview .badge {
    position: absolute;
    left: 10px;
    top: 10px;
}

.image-manager__controls {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 12px;
}

.image-manager__controls input[type="number"] {
    max-width: 120px;
}

.radio-line,
.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.check-line--danger {
    color: #b42318;
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-list:not([hidden]) {
    margin-top: 6px;
}

.image-preview-list__item {
    flex: 0 0 112px;
    width: 112px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.image-preview-list__item img {
    width: 100%;
    height: 82px;
    object-fit: cover;
}

.image-preview-list__item span {
    display: block;
    padding: 6px 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 1180px) {
    .listing-detail__layout--pro {
        flex-direction: column;
    }

    .listing-detail__side {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .price-panel--sticky {
        position: static;
    }

    .listings-layout--compact > .listing-card,
    .listings-layout--compact > .listing-card.card.listing-card--tile {
        flex: 0 0 calc((100% - 28px) / 3);
        width: calc((100% - 28px) / 3);
        max-width: calc((100% - 28px) / 3);
    }
}

@media (max-width: 860px) {
    .listing-gallery__main {
        min-height: 340px;
    }

    .spec-list__row,
    .vat-breakdown div,
    .seller-card__requisites div {
        flex-direction: column;
        gap: 4px;
    }

    .spec-list dt,
    .spec-list dd,
    .vat-breakdown dd,
    .seller-card__requisites dd {
        flex: 1 1 auto;
        text-align: left;
    }

    .listings-layout--compact > .listing-card,
    .listings-layout--compact > .listing-card.card.listing-card--tile {
        flex: 0 0 calc((100% - 14px) / 2);
        width: calc((100% - 14px) / 2);
        max-width: calc((100% - 14px) / 2);
    }
}

@media (max-width: 640px) {
    .listing-gallery__main {
        min-height: 260px;
        border-radius: 16px;
    }

    .listing-gallery__thumb {
        flex-basis: 72px;
        width: 72px;
        height: 58px;
    }

    .listings-layout--compact > .listing-card,
    .listings-layout--compact > .listing-card.card.listing-card--tile,
    .image-manager__item {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}

/* Step 12: stable dropdown hover bridge and billing UI */
.categories-menu,
.nav-group {
    isolation: isolate;
}

.categories-menu::after,
.nav-group::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 79;
    display: none;
    height: 18px;
    background: transparent;
}

.categories-menu:hover::after,
.categories-menu.is-open::after,
.nav-group:hover::after,
.nav-group.is-open::after {
    display: block;
}

.categories-menu__panel,
.nav-group__panel {
    top: calc(100% + 8px);
    z-index: 90;
}

.nav-group__button:focus-visible,
.categories-menu__button:focus-visible {
    outline: 3px solid rgba(7, 136, 255, .22);
    outline-offset: 2px;
}

.payment-layout,
.subscription-layout,
.payment-mini-list,
.billing-summary,
.billing-actions {
    display: flex;
}

.payment-layout {
    align-items: flex-start;
    gap: 24px;
}

.payment-main-card {
    flex: 1 1 560px;
    min-width: 0;
}

.payment-requisites {
    flex: 0 1 420px;
    min-width: 300px;
}

.payment-total {
    margin: 14px 0;
    color: var(--brand-700);
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 900;
    line-height: 1;
}

.pending-payments-panel {
    margin-top: 24px;
}

.payment-mini-list {
    flex-wrap: wrap;
    gap: 12px;
}

.payment-mini-card {
    display: flex;
    flex: 1 1 240px;
    min-width: 220px;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    color: var(--ink);
    background: #fff;
}

.payment-mini-card:hover {
    border-color: rgba(7, 136, 255, .38);
    box-shadow: 0 14px 30px rgba(17, 24, 39, .08);
}

.requisites-list {
    margin: 0;
}

.requisites-list dt {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.requisites-list dd {
    margin: 4px 0 0;
    color: var(--ink);
    font-weight: 800;
    word-break: break-word;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-form--separated {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.billing-summary {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
    margin-top: 18px;
}

.billing-summary__item {
    flex: 1 1 180px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: #f8fbff;
}

.billing-summary__item span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.billing-summary__item strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
    line-height: 1;
}

.billing-actions {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 1180px) {
    .categories-menu::after,
    .nav-group::after {
        display: none !important;
    }
}

@media (max-width: 920px) {
    .payment-layout {
        flex-direction: column;
    }

    .payment-main-card,
    .payment-requisites {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }
}

/* Step 12 fix 01: restore Step 11 detail page media styles. Flex only. */
.listing-detail-hero h1 {
    max-width: 980px;
}

.listing-detail-page {
    padding-top: 28px;
}

.listing-detail-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1 1 auto;
    min-width: 0;
}

.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-gallery__main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 520px;
    border-radius: 22px;
    overflow: hidden;
    background: #eef5ff;
}

.detail-gallery__main img {
    width: 100%;
    height: 100%;
    max-height: 620px;
    object-fit: contain;
    display: block;
}

.detail-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-gallery__thumbs button {
    flex: 0 0 96px;
    width: 96px;
    height: 76px;
    min-height: 0;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
}

.detail-gallery__thumbs button.is-active,
.detail-gallery__thumbs button:hover {
    border-color: var(--brand);
}

.detail-gallery__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.owner-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.owner-notice > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-description {
    font-size: 17px;
    line-height: 1.75;
}

.detail-specs,
.price-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
}

.detail-specs > div,
.price-breakdown > div {
    flex: 1 1 230px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: #fbfdff;
}

.detail-extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.detail-sidebar {
    position: sticky;
    top: 114px;
    gap: 18px;
}

.detail-sidebar hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0;
}

.price-panel__top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.seller-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seller-card h2,
.seller-card h3,
.contact-form-box h3 {
    margin: 0;
}

.seller-card p {
    margin: 0;
}

.seller-card__line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.seller-card--contacts .btn {
    width: 100%;
}

.detail-warning {
    margin: 0;
    border-radius: 14px;
    padding: 12px;
    background: var(--warning-soft);
}

.detail-related {
    padding-top: 24px;
}

.listing-card__media-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    color: #fff;
    background: rgba(15, 28, 47, .76);
    font-size: 12px;
    font-weight: 900;
}

.image-manager__controls label {
    gap: 5px;
}

.image-manager__controls input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 40px;
}

@media (max-width: 920px) {
    .detail-sidebar {
        position: static;
    }

    .detail-gallery__main {
        min-height: 340px;
    }

    .owner-notice {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .detail-gallery__main {
        min-height: 260px;
        border-radius: 16px;
    }

    .detail-gallery__thumbs button {
        flex-basis: 72px;
        width: 72px;
        height: 58px;
    }
}

/* Step 13: SEO pages and redirect admin UI. Flex only. */
.page-section { padding-top: 28px; }
.page-container { display: flex; flex-direction: column; gap: 18px; }
.content-card--wide { width: 100%; max-width: 960px; margin: 0 auto; padding: 30px; }
.content-card h1 { margin-top: 0; }
.content-body { display: flex; flex-direction: column; gap: 14px; color: var(--ink); font-size: 16px; line-height: 1.75; white-space: normal; }
.content-body br { display: block; content: ''; margin-top: 8px; }
.footer-subtitle { margin-top: 18px; }
.seo-preview { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fbff; }
.seo-preview__title { color: #1a0dab; font-size: 18px; line-height: 1.25; }
.seo-preview__url { color: #188038; font-size: 13px; overflow-wrap: anywhere; }
.seo-preview__description { color: var(--muted); font-size: 14px; line-height: 1.5; }
.redirect-path { overflow-wrap: anywhere; }
@media (max-width: 720px) {
    .content-card--wide { padding: 20px; }
}

/* Step 14: regions and free Leaflet/OpenStreetMap map. Flex only. */
.regions-strip,
.regions-list,
.city-list,
.region-layout,
.admin-form-wide,
.map-form-block,
.location-meta-list {
    display: flex;
}

.regions-strip {
    flex-wrap: wrap;
    gap: 12px;
}

.region-pill {
    flex: 1 1 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.region-pill:hover {
    border-color: rgba(10, 141, 255, .42);
    transform: translateY(-1px);
}

.region-pill span,
.region-row strong,
.city-list strong {
    color: var(--brand-600);
}

.regions-group {
    margin-bottom: 18px;
}

.regions-list {
    flex-wrap: wrap;
    gap: 10px;
}

.region-row {
    flex: 1 1 260px;
    min-width: 240px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--ink);
    background: #f8fbff;
}

.region-row:hover {
    border-color: rgba(10, 141, 255, .44);
    background: #fff;
}

.region-layout {
    align-items: flex-start;
    gap: 22px;
}

.region-main {
    flex: 1 1 auto;
    min-width: 0;
}

.region-sidebar {
    flex: 0 0 320px;
    width: 320px;
}

.city-list {
    flex-direction: column;
    gap: 8px;
}

.city-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    color: var(--ink);
}

.snds-map,
.leaflet-container.snds-map {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    background: #eef5ff;
}

.snds-map--admin,
.admin-content .snds-map,
.admin-content [class*="karta-tocki-i-svobodnaa-linia"] .snds-map,
.admin-content [data-section*="karta-tocki-i-svobodnaa-linia"] .snds-map {
    width: 100%;
    max-width: 100%;
    min-height: 540px;
    flex: 1 1 100%;
    align-self: stretch;
}

.snds-map--form {
    min-height: 460px;
}

.snds-map--detail,
.snds-map--region {
    min-height: 440px;
}

.map-form-block,
.schema-component--form-karta-tocki-i-svobodnaa-linia,
[data-section="karta-tocki-i-svobodnaa-linia"] {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    gap: 10px;
}

.admin-form-wide > .map-form-block,
.admin-form-wide > .schema-component--form-karta-tocki-i-svobodnaa-linia {
    flex-basis: 100%;
    width: 100%;
}

.location-meta-list {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.location-meta-list span,
.location-meta-list a {
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--ink);
    background: #eef6ff;
    font-size: 13px;
    font-weight: 800;
}

.detail-location .snds-map {
    margin-top: 12px;
}

@media (max-width: 980px) {
    .region-layout {
        flex-direction: column;
    }

    .region-sidebar {
        flex: 1 1 auto;
        width: 100%;
    }

    .snds-map,
    .snds-map--admin,
    .snds-map--form,
    .snds-map--detail,
    .snds-map--region {
        min-height: 380px;
    }
}

@media (max-width: 620px) {
    .region-pill,
    .region-row {
        flex-basis: 100%;
        min-width: 0;
    }

    .snds-map,
    .snds-map--admin,
    .snds-map--form,
    .snds-map--detail,
    .snds-map--region {
        min-height: 320px;
        border-radius: 16px;
    }
}

/* Step 15: in-site notifications. Flex only. */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    border-radius: 999px;
    padding: 2px 7px;
    color: #fff;
    background: var(--danger);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.nav-group__panel a .nav-badge {
    margin-left: auto;
}

.nav-badge--footer {
    margin-left: 8px;
}

.badge--info {
    color: var(--brand-700);
    background: var(--brand-soft);
}

.notification-list,
.notification-card,
.notification-card__body,
.notification-card__top,
.notification-card__actions {
    display: flex;
}

.notification-list {
    flex-direction: column;
    gap: 14px;
}

.notification-card {
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.notification-card--unread {
    border-color: rgba(10, 141, 255, .34);
    box-shadow: 0 14px 40px rgba(10, 141, 255, .10);
}

.notification-card__body {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.notification-card__top {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-card__top time {
    color: var(--muted);
    font-size: 13px;
}

.notification-card h2 {
    margin: 0;
    font-size: 20px;
}

.notification-card p {
    margin: 0;
    color: var(--ink-2);
}

.notification-card__actions {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
}

.notification-card__actions form {
    margin: 0;
}

@media (max-width: 740px) {
    .notification-card {
        flex-direction: column;
    }

    .notification-card__actions {
        justify-content: stretch;
    }

    .notification-card__actions .btn {
        width: 100%;
    }
}

/* Step 16: security, antispam and production UI */
.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 20px;
}

.metric-card {
    flex: 1 1 200px;
    min-width: 190px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.metric-card strong {
    display: block;
    font-size: 32px;
    line-height: 1;
}

.status-pill--orange {
    background: #fff4df;
    color: #a15c00;
}

.status-pill--red,
.status-pill--danger {
    background: #ffe7e7;
    color: #b30000;
}

.status-pill--gray {
    background: #eef2f7;
    color: #475569;
}

.table-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.table-headline h2 {
    margin: 0;
}

.danger-zone {
    border-color: #ffd7d7;
    background: #fffafa;
}

.btn--danger {
    background: #d71920;
    color: #fff;
    border-color: #d71920;
}

.btn--danger:hover {
    background: #b81218;
    border-color: #b81218;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-line input {
    width: auto;
}

.error-page {
    display: flex;
    justify-content: center;
    padding: 80px 0;
}

.error-page .content-card {
    width: 100%;
    max-width: 680px;
}

code {
    display: inline-flex;
    max-width: 360px;
    white-space: normal;
    word-break: break-word;
    font-size: 12px;
}

/* Step 16 fix 1: compact and fully loaded map on ad detail page. Flex only. */
.detail-location {
    gap: 12px;
}

.detail-location .section-head {
    margin-bottom: 0;
}

.detail-location__map-shell {
    display: flex;
    width: 100%;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #eef5ff;
}

.detail-location .snds-map.snds-map--detail,
.detail-location .leaflet-container.snds-map--detail {
    flex: 1 1 auto;
    width: 100%;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    position: relative;
}

.detail-location .leaflet-container {
    font-size: 13px;
}

.detail-location .leaflet-tile-container img,
.detail-location .leaflet-marker-icon,
.detail-location .leaflet-marker-shadow {
    max-width: none !important;
}

.detail-location .snds-map--is-loading::after {
    content: 'Загружаем карту…';
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 400;
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--ink);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 800;
}

.detail-location .snds-map--is-ready::after {
    display: none;
}

@media (max-width: 980px) {
    .detail-location__map-shell,
    .detail-location .snds-map.snds-map--detail,
    .detail-location .leaflet-container.snds-map--detail {
        height: 240px;
        min-height: 240px;
        max-height: 240px;
    }
}

@media (max-width: 620px) {
    .detail-location__map-shell,
    .detail-location .snds-map.snds-map--detail,
    .detail-location .leaflet-container.snds-map--detail {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
        border-radius: 16px;
    }
}

/* Step 17: Leaflet stable rendering fallback for ad detail map. Flex only.
   This prevents partially loaded / striped tiles when external Leaflet CSS is delayed. */
.leaflet-container {
    overflow: hidden;
    background: #eef5ff;
    -webkit-tap-highlight-color: transparent;
}

.leaflet-container .leaflet-pane,
.leaflet-container .leaflet-tile,
.leaflet-container .leaflet-marker-icon,
.leaflet-container .leaflet-marker-shadow,
.leaflet-container .leaflet-tile-container,
.leaflet-container .leaflet-pane > svg,
.leaflet-container .leaflet-pane > canvas,
.leaflet-container .leaflet-zoom-box,
.leaflet-container .leaflet-image-layer,
.leaflet-container .leaflet-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-container .leaflet-tile-pane { z-index: 200; }
.leaflet-container .leaflet-overlay-pane { z-index: 400; }
.leaflet-container .leaflet-shadow-pane { z-index: 500; }
.leaflet-container .leaflet-marker-pane { z-index: 600; }
.leaflet-container .leaflet-tooltip-pane { z-index: 650; }
.leaflet-container .leaflet-popup-pane { z-index: 700; }

.leaflet-container img.leaflet-tile,
.leaflet-container .leaflet-tile-container img {
    width: 256px !important;
    height: 256px !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: initial !important;
    display: block !important;
}

.leaflet-container .leaflet-tile {
    user-select: none;
    -webkit-user-drag: none;
    visibility: hidden;
}

.leaflet-container .leaflet-tile-loaded {
    visibility: inherit;
}

.leaflet-container .leaflet-marker-icon,
.leaflet-container .leaflet-marker-shadow {
    max-width: none !important;
    width: auto;
    height: auto;
}

.leaflet-container .leaflet-control-container .leaflet-top,
.leaflet-container .leaflet-control-container .leaflet-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.leaflet-container .leaflet-control-container .leaflet-top { top: 0; }
.leaflet-container .leaflet-control-container .leaflet-bottom { bottom: 0; }
.leaflet-container .leaflet-control-container .leaflet-left { left: 0; }
.leaflet-container .leaflet-control-container .leaflet-right { right: 0; }
.leaflet-container .leaflet-control {
    position: relative;
    z-index: 800;
    pointer-events: auto;
}

.detail-location__map-shell {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
}

.detail-location .snds-map.snds-map--detail,
.detail-location .leaflet-container.snds-map--detail {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
}

@media (max-width: 980px) {
    .detail-location__map-shell,
    .detail-location .snds-map.snds-map--detail,
    .detail-location .leaflet-container.snds-map--detail {
        height: 230px;
        min-height: 230px;
        max-height: 230px;
    }
}

@media (max-width: 620px) {
    .detail-location__map-shell,
    .detail-location .snds-map.snds-map--detail,
    .detail-location .leaflet-container.snds-map--detail {
        height: 210px;
        min-height: 210px;
        max-height: 210px;
    }
}

/* Step 18: site settings and production checklist */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.settings-panel__header h2 {
    margin: 0 0 6px;
}

.settings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 360px;
    min-width: 260px;
}

.settings-field textarea,
.settings-field input[type="text"],
.settings-field input[type="email"],
.settings-field input[type="url"] {
    width: 100%;
}

.settings-field__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--ink);
}

.settings-field__hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.toggle-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-weight: 700;
}

.form-actions--sticky {
    position: sticky;
    bottom: 16px;
    z-index: 4;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15, 35, 60, .12);
}

.production-checks,
.production-env,
.production-commands,
.production-note {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.production-checks__list,
.command-list,
.soft-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.production-check {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 220px;
    min-width: 200px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #f7fbff;
}

.production-check strong,
.command-card strong {
    color: var(--ink);
}

.production-check span {
    color: var(--muted);
    font-weight: 700;
}

.production-check--ok {
    border-color: rgba(20, 166, 91, .28);
    background: #eefbf4;
}

.production-check--warning {
    border-color: rgba(245, 158, 11, .34);
    background: #fff8e9;
}

.production-check--error {
    border-color: rgba(220, 38, 38, .32);
    background: #fff1f1;
}

.metric-list--wide .metric-row {
    align-items: flex-start;
}

.command-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 360px;
    min-width: 260px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #fff;
}

.command-card code {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: 12px;
    padding: 12px;
    background: #0b1728;
    color: #dbeafe;
}

.soft-list span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef6ff;
    color: var(--ink);
    font-weight: 800;
}

@media (max-width: 720px) {
    .settings-field,
    .production-check,
    .command-card {
        flex-basis: 100%;
        min-width: 0;
    }

    .settings-panel__header {
        flex-direction: column;
    }

    .form-actions--sticky {
        position: static;
    }
}


/* Step 19: final cabinet/forms UI polish. Flex only. */
body.is-menu-open {
    overflow: hidden;
}

.site-main {
    padding-bottom: 10px;
}

.page-section > .section-head:first-child,
.form-card > .section-head:first-child,
.auth-card > .section-head:first-child,
.admin-content > .admin-page-head:first-child {
    margin-bottom: 24px;
}

.page-section > .section-head:first-child,
.form-card > .section-head:first-child,
.auth-card > .section-head:first-child {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.panel + .panel,
.panel + .form-card,
.form-card + .panel,
.panel-list > * + *,
.page-section > .panel + .panel {
    margin-top: 18px;
}

.form-card > form,
.auth-card > form,
.admin-card > form,
.panel > form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

fieldset {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), #f9fbff);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

fieldset + fieldset {
    margin-top: 18px;
}

legend {
    padding: 0 12px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.01em;
}

label {
    width: 100%;
    font-size: 14px;
    line-height: 1.35;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="tel"],
select,
textarea {
    min-height: 50px;
    border-radius: 14px;
    padding: 12px 14px;
}

textarea {
    min-height: 140px;
}

input::placeholder,
textarea::placeholder {
    color: #98a2b3;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--brand);
}

input[disabled],
select[disabled],
textarea[disabled] {
    color: #7b8796;
    background: #f3f6fb;
}

.form-actions,
.admin-form__actions,
.actions {
    align-items: center;
    gap: 12px;
    padding-top: 2px;
}

.form-actions .btn,
.form-actions button,
.admin-form__actions .btn,
.actions .btn {
    white-space: nowrap;
}

.filter-form {
    gap: 14px;
}

.filter-form > label,
.filter-form > div {
    flex: 1 1 220px;
}

.check-card,
.checkbox-line,
.check-row {
    border-radius: 16px;
    padding: 14px;
}

.check-card span,
.checkbox-line span,
.check-row span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-inline,
.plan-current,
.plan-summary {
    align-items: stretch;
}

.plan-inline > div,
.plan-current > div,
.plan-summary > div {
    display: flex;
    flex: 1 1 170px;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 15px 16px;
    background: #f8fbff;
}

.plan-inline > a.btn,
.plan-current > a.btn,
.plan-summary > a.btn {
    align-self: center;
}

.message-thread {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.message-thread:hover {
    color: inherit;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.message-thread p {
    margin: 0;
    color: var(--ink-2);
}

.message-thread small {
    color: var(--muted);
}

.message-list > .panel,
.message-list > .message-thread {
    margin: 0;
}

.image-strip {
    gap: 12px;
}

.image-strip__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    background: #fff;
}

table[border] {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line) !important;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

table[border] th,
table[border] td {
    padding: 14px 16px;
    border-color: var(--line) !important;
    vertical-align: top;
}

table[border] th {
    color: var(--muted);
    background: #f8fbff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table-wrap + nav[role="navigation"],
table[border] + nav[role="navigation"],
.listing-list + nav[role="navigation"],
.listing-grid + nav[role="navigation"],
.message-list + nav[role="navigation"] {
    margin-top: 24px;
}

body.is-cabinet .page-section,
body.is-auth .auth-page,
body.is-admin .admin-content {
    scroll-margin-top: 110px;
}

@media (max-width: 860px) {
    table[border] {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    fieldset {
        padding: 18px;
        border-radius: 18px;
    }

    legend {
        font-size: 16px;
        padding: 0 8px;
    }

    .plan-inline > div,
    .plan-current > div,
    .plan-summary > div {
        flex-basis: 100%;
    }
}

@media (max-width: 640px) {
    .page-section > .section-head:first-child,
    .form-card > .section-head:first-child,
    .auth-card > .section-head:first-child {
        padding-bottom: 14px;
        margin-bottom: 18px;
    }

    .form-card > form,
    .auth-card > form,
    .admin-card > form,
    .panel > form {
        gap: 16px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="url"],
    input[type="tel"],
    select,
    textarea {
        min-height: 48px;
    }
}


/* Step 19 fix 2: ad detail map is explicitly interactive and not a flat picture. Flex only. */
.detail-location .section-head--compact {
    align-items: flex-start;
}

.detail-location__map-shell {
    position: relative;
    border: 1px solid #d6e1ee;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.70), 0 12px 26px rgba(15, 35, 60, .07);
}

.detail-location__map-shell::before,
.detail-location__map-shell::after {
    position: absolute;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255,255,255,.94);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 900;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
}

.detail-location__map-shell::before {
    content: "Интерактивная карта";
    left: 12px;
    top: 12px;
}

.detail-location__map-shell::after {
    content: "Перетаскивайте и приближайте";
    left: 12px;
    bottom: 12px;
}

.detail-location .leaflet-control-container .leaflet-top,
.detail-location .leaflet-control-container .leaflet-bottom,
.detail-location .leaflet-control-container .leaflet-left,
.detail-location .leaflet-control-container .leaflet-right {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.detail-location .leaflet-control-container .leaflet-top { top: 0; }
.detail-location .leaflet-control-container .leaflet-bottom { bottom: 0; }
.detail-location .leaflet-control-container .leaflet-left { left: 0; }
.detail-location .leaflet-control-container .leaflet-right { right: 0; }

.detail-location .leaflet-control {
    clear: both;
    pointer-events: auto;
}

.detail-location .leaflet-top .leaflet-control { margin-top: 12px; }
.detail-location .leaflet-left .leaflet-control { margin-left: 12px; }
.detail-location .leaflet-right .leaflet-control { margin-right: 12px; }
.detail-location .leaflet-bottom .leaflet-control { margin-bottom: 12px; }

.detail-location .leaflet-bar {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}

.detail-location .leaflet-bar a,
.detail-location .leaflet-bar a:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.detail-location .leaflet-bar a:last-child {
    border-bottom: 0;
}

.detail-location .leaflet-bar a:hover {
    color: var(--brand-700);
    background: var(--brand-soft);
}

.snds-map-marker {
    width: 34px !important;
    height: 42px !important;
    background: transparent !important;
    border: 0 !important;
}

.snds-map-marker__pin {
    position: relative;
    display: block;
    width: 34px;
    height: 34px;
    border: 4px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: var(--brand);
    transform: rotate(-45deg);
    box-shadow: 0 12px 24px rgba(10, 141, 255, .34);
}

.snds-map-marker__pin::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

.detail-location__map-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.detail-location__map-links a {
    font-weight: 900;
}

@media (max-width: 620px) {
    .detail-location__map-shell::before,
    .detail-location__map-shell::after {
        font-size: 11px;
        padding: 5px 8px;
    }

    .detail-location__map-shell::after {
        display: none;
    }
}


/* Step 19 fix 3: smooth in-page zoom for ad detail map. Flex only. */
.detail-location__map-links--hint {
    justify-content: flex-start;
}

.detail-location__map-links--hint span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--brand-700);
    background: var(--brand-soft);
    font-weight: 900;
}

.detail-location .leaflet-control-zoom a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 900;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.detail-location .leaflet-control-zoom a:hover {
    color: #fff;
    background: var(--brand);
    transform: scale(1.02);
}

.detail-location .leaflet-container {
    cursor: grab;
}

.detail-location .leaflet-container.leaflet-dragging {
    cursor: grabbing;
}

.detail-location .leaflet-tile {
    transition: opacity .18s ease;
}

/* Step 20: search aliases, seller privacy, billing documents, mobile registration and limit UI. Flex only. */
.seller-locked {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    padding: 16px;
    background: #f7fbff;
}

.seller-card__line strong {
    overflow-wrap: anywhere;
}

.plan-payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.plan-payment-actions form {
    display: flex;
    flex: 1 1 180px;
}

.plan-payment-actions .btn,
.plan-payment-actions button {
    width: 100%;
}

.payment-documents,
.document-list,
.billing-document,
.billing-document__header,
.billing-document__columns {
    display: flex;
}

.payment-documents,
.billing-document {
    flex-direction: column;
    gap: 16px;
    margin-top: 22px;
}

.document-list {
    flex-wrap: wrap;
    gap: 12px;
}

.document-card {
    display: flex;
    flex: 1 1 240px;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    color: var(--ink);
    background: #f8fbff;
}

.document-card:hover {
    color: var(--brand-700);
    border-color: #b6dfff;
    background: #eef7ff;
}

.billing-document__header {
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.billing-document__header h2,
.billing-document__header p {
    margin: 0;
}

.billing-document__header strong {
    font-size: 28px;
    white-space: nowrap;
}

.billing-document__columns {
    flex-wrap: wrap;
    gap: 20px;
}

.billing-document__columns > section {
    flex: 1 1 320px;
    min-width: 0;
}

.auth-page--register {
    align-items: flex-start;
    min-height: auto;
    padding-bottom: 72px;
}

.auth-page--register .auth-card,
.registration-form {
    overflow: visible;
}

.auth-aside--compact {
    position: sticky;
    top: 126px;
}

.auth-aside__note {
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 18px;
    padding: 14px;
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.1);
}

.form-grid--registration > * {
    min-width: 240px;
}

.registration-form__agree {
    margin-top: 18px;
}

.registration-form__actions {
    position: sticky;
    bottom: 14px;
    z-index: 8;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 40px rgba(15, 35, 60, .14);
    backdrop-filter: blur(12px);
}

.admin-form-row--5 > label,
.form-grid--registration > div,
.form-grid--registration > label {
    min-width: 0;
}

@media (max-width: 920px) {
    .auth-aside--compact {
        position: static;
        width: 100%;
    }

    .auth-page--register {
        gap: 18px;
        padding-top: 28px;
        padding-bottom: 96px;
    }
}

@media (max-width: 640px) {
    .auth-page--register {
        width: min(100% - 18px, var(--container));
        padding-top: 18px;
        padding-bottom: 120px;
    }

    .auth-page--register .auth-aside {
        padding: 24px;
        border-radius: 22px;
    }

    .registration-form {
        padding: 18px;
        border-radius: 22px;
    }

    .registration-form fieldset {
        padding: 16px;
    }

    .form-grid--registration > * {
        flex-basis: 100%;
        min-width: 0;
    }

    .registration-form__actions {
        bottom: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .billing-document__header {
        flex-direction: column;
    }

    .billing-document__header strong {
        white-space: normal;
    }
}

@media print {
    .site-header,
    .site-footer,
    .section-head .inline-actions,
    .billing-document-page .btn {
        display: none !important;
    }

    .billing-document-page,
    .billing-document {
        padding: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
    }
}

/* Step 21: final admin forms, unified filters and invoice layout. Flex only. */
.admin-content .settings-list,
.admin-content .admin-form-row,
.admin-content .form-row,
.admin-content .admin-filter-form {
    align-items: flex-start;
}

.admin-content .settings-list {
    gap: 18px;
}

.admin-content .settings-field {
    flex: 1 1 320px;
    min-width: 260px;
    max-width: calc(50% - 9px);
}

.admin-content .settings-field--text,
.admin-content .settings-field--json,
.admin-content .settings-field--wide,
.admin-content .settings-field--billing-invoice_notice,
.admin-content .settings-field--general-footer_description,
.admin-content .settings-field--company-legal_address {
    flex-basis: 100%;
    max-width: none;
}

.admin-content .settings-field input,
.admin-content .settings-field select,
.admin-content .settings-field textarea,
.admin-content .admin-form-row input,
.admin-content .admin-form-row select,
.admin-content .admin-form-row textarea,
.admin-content .form-row input,
.admin-content .form-row select,
.admin-content .form-row textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    height: auto;
    margin: 0;
    border-radius: 14px;
    line-height: 1.35;
}

.admin-content .settings-field textarea {
    min-height: 92px;
    max-height: 260px;
}

.admin-content .settings-field--json textarea {
    min-height: 170px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

.admin-content .settings-field--url input,
.admin-content .settings-field--map-tile_url input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

.admin-content .settings-field__label {
    min-height: 22px;
    flex-direction: row;
    align-items: center;
}

.admin-content .settings-field__hint {
    min-height: 0;
}

.admin-content .toggle-line,
.admin-content .check-row,
.admin-content .check-card,
.admin-content .checkline,
.admin-content .check-row--inline {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: 50px;
}

.admin-content .toggle-line input,
.admin-content .check-row input,
.admin-content .check-card input,
.admin-content .checkline input {
    flex: 0 0 auto;
    width: auto;
    min-height: auto;
}

.admin-content .admin-table td:last-child {
    width: 190px;
}

.admin-content .admin-table__actions,
.admin-content .table-actions,
.admin-content .filter-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.admin-content .admin-table__actions {
    flex-direction: column;
    align-items: stretch;
    min-width: 170px;
}

.admin-content .admin-table__actions .btn,
.admin-content .admin-table__actions button,
.admin-content .admin-table__actions form {
    width: 100%;
}

.admin-content .admin-filter-card,
.admin-content .admin-card {
    overflow: visible;
}

.admin-content .admin-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-content .admin-filter-form > label {
    flex: 1 1 260px;
}

.admin-content .admin-filter-form .filter-actions {
    flex: 0 0 auto;
    align-self: flex-end;
}

.admin-content .admin-form__section--home-category {
    background: #f7fbff;
}

.listing-card__topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.catalog-filter-container {
    margin-top: -34px;
    position: relative;
    z-index: 2;
}

.catalog-filter-shell {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.catalog-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(180deg, #fff, #f8fbff);
}

.catalog-filter-summary::-webkit-details-marker {
    display: none;
}

.catalog-filter-summary::after {
    content: "Свернуть";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 7px 13px;
    color: var(--ink);
    background: #fff;
    font-weight: 800;
    font-size: 13px;
}

.catalog-filter-shell:not([open]) .catalog-filter-summary::after {
    content: "Раскрыть";
}

.catalog-filter-summary span:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.catalog-filter-summary strong {
    color: var(--ink);
    font-size: 18px;
}

.catalog-filter-summary em,
.catalog-filter-summary__hint {
    color: var(--muted);
    font-style: normal;
    font-size: 14px;
}

.catalog-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding: 22px;
}

.catalog-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.catalog-filter-row--search .catalog-filter-field {
    flex-basis: 100%;
}

.catalog-filter-field {
    display: flex;
    flex: 1 1 230px;
    min-width: 210px;
    flex-direction: column;
    gap: 8px;
    color: var(--ink);
    font-weight: 800;
}

.catalog-filter-field > span:first-child,
.filter-check span {
    font-size: 14px;
    color: var(--ink);
}

.catalog-filter-field--wide {
    flex-basis: 100%;
}

.catalog-filter-field--large {
    flex: 1 1 300px;
}

.catalog-filter-field--small {
    flex: 0 1 180px;
}

.catalog-filter-field--range .range-filter__inputs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.catalog-filter-field--range .range-filter__inputs input {
    min-width: 0;
}

.catalog-filter-row--checks {
    gap: 12px;
}

.filter-check {
    display: flex;
    flex: 1 1 210px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: #f8fbff;
}

.filter-check input {
    width: auto;
    min-height: auto;
}

.dynamic-filters--unified {
    border: 1px dashed var(--line-strong);
    border-radius: 20px;
    padding: 18px;
    background: #fbfdff;
    box-shadow: none;
}

.catalog-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.invoice-paper {
    max-width: 920px;
    margin: 0 auto;
    border: 1px solid #d7d7d7;
    padding: 28px 30px;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.25;
    box-shadow: var(--shadow-soft);
}

.invoice-bank-table,
.invoice-items {
    width: 100%;
    border-collapse: collapse;
    color: #111;
}

.invoice-bank-table td,
.invoice-bank-table th,
.invoice-items td,
.invoice-items th {
    border: 1px solid #222;
    padding: 4px 6px;
    vertical-align: top;
}

.invoice-bank-table__label {
    width: 76px;
    font-weight: 700;
}

.invoice-bank-table span {
    color: #333;
    font-size: 12px;
}

.invoice-title {
    margin: 26px 0 14px;
    color: #111;
    font-size: 26px;
    line-height: 1.15;
}

.invoice-rule {
    height: 3px;
    margin-bottom: 18px;
    background: #222;
}

.invoice-parties {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 18px;
}

.invoice-parties__label {
    flex: 0 0 115px;
    color: #333;
}

.invoice-parties__value {
    flex: 1 1 calc(100% - 140px);
    min-width: 260px;
}

.invoice-items th {
    text-align: center;
    font-weight: 700;
}

.invoice-items td:nth-child(1),
.invoice-items td:nth-child(3),
.invoice-items td:nth-child(4),
.invoice-items td:nth-child(5),
.invoice-items td:nth-child(6) {
    text-align: right;
    white-space: nowrap;
}

.invoice-items td:nth-child(2) {
    text-align: left;
}

.invoice-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin: 14px 0;
}

.invoice-totals div {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    min-width: 290px;
    font-weight: 700;
}

.invoice-count,
.invoice-words {
    margin: 8px 0;
}

.invoice-notice {
    margin-top: 28px;
    color: #222;
}

.invoice-notice p {
    margin: 3px 0;
}

.invoice-signature {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 34px;
    border-top: 2px solid #222;
    padding-top: 18px;
}

.invoice-signature strong {
    flex: 0 0 180px;
}

.invoice-signature span {
    flex: 1 1 auto;
    border-bottom: 1px solid #444;
    height: 18px;
}

.invoice-signature em {
    flex: 0 0 160px;
    text-align: right;
    font-style: normal;
}

.no-print {
    display: flex;
}

@media (max-width: 760px) {
    .admin-content .settings-field {
        flex-basis: 100%;
        max-width: none;
    }

    .catalog-filter-summary,
    .catalog-filter-form {
        padding: 16px;
    }

    .catalog-filter-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .catalog-filter-field,
    .catalog-filter-field--small,
    .catalog-filter-field--large,
    .filter-check {
        flex-basis: 100%;
        min-width: 0;
    }

    .catalog-filter-actions .btn,
    .catalog-filter-actions button {
        width: 100%;
    }

    .invoice-paper {
        padding: 18px 14px;
        overflow-x: auto;
    }

    .invoice-title {
        font-size: 21px;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .site-header,
    .site-footer,
    .no-print,
    .flash {
        display: none !important;
    }

    .site-main,
    .page-section,
    .billing-document-page {
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .invoice-paper {
        max-width: none;
        border: 0;
        padding: 0;
        box-shadow: none;
        font-size: 13px;
    }
}

/* Category cascade and admin category tree */
.category-cascade {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    width: 100%;
}

.category-cascade label {
    min-width: 0;
}

.category-cascade label[hidden] {
    display: none !important;
}

.catalog-filter-field--cascade {
    min-width: min(100%, 460px);
}

.catalog-filter-field input,
.catalog-filter-field select,
.catalog-filter-field textarea {
    min-height: 50px;
    border-radius: 14px;
}

.category-manager {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.category-manager__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.category-manager__head h2 {
    margin: 0 0 6px;
}

.category-manager__status[data-mode="success"] {
    color: var(--success);
    font-weight: 800;
}

.category-manager__status[data-mode="error"] {
    color: var(--danger);
    font-weight: 800;
}

.category-manager__status[data-mode="dirty"] {
    color: var(--brand-700);
    font-weight: 800;
}

.category-tree,
.category-tree-children {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-tree-children {
    margin-top: 10px;
    margin-left: 30px;
    padding-left: 16px;
    border-left: 2px dashed var(--line-strong);
}

.category-tree-node {
    position: relative;
}

.category-tree-node.is-dragging {
    opacity: .55;
}

.category-tree-node.is-drop-before > .category-tree-item {
    box-shadow: 0 -4px 0 var(--brand);
}

.category-tree-node.is-drop-after > .category-tree-item {
    box-shadow: 0 4px 0 var(--brand);
}

.category-tree-node.is-drop-inside > .category-tree-item {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(10,141,255,.12);
}

.category-tree-item {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto minmax(230px, 300px) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.category-tree-item__handle {
    width: 42px;
    min-height: 42px;
    border-radius: 14px;
    padding: 0;
    cursor: grab;
}

.category-tree-item__main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.category-tree-item__main strong {
    color: var(--ink);
    font-size: 16px;
}

.category-tree-item__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 170px;
}

.category-tree-item__stats span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 8px;
    color: var(--muted);
    background: #f8fbff;
    font-size: 12px;
    font-weight: 800;
}

.category-tree-item__parent {
    gap: 5px;
    min-width: 0;
}

.category-tree-item__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.category-tree-item__actions form {
    margin: 0;
}

@media (max-width: 1120px) {
    .category-tree-item {
        grid-template-columns: auto minmax(180px, 1fr) auto;
    }

    .category-tree-item__parent,
    .category-tree-item__actions {
        grid-column: 2 / -1;
    }
}

@media (max-width: 760px) {
    .category-manager__head {
        flex-direction: column;
    }

    .category-tree-children {
        margin-left: 14px;
        padding-left: 10px;
    }

    .category-tree-item {
        grid-template-columns: auto 1fr;
    }

    .category-tree-item__stats,
    .category-tree-item__parent,
    .category-tree-item__actions {
        grid-column: 1 / -1;
    }
}

/* Public site pages with admin-controlled layout */
.site-page-section {
    padding-top: 42px;
}

.site-page-container--full {
    max-width: min(1440px, calc(100% - 32px));
}

.site-page {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(24px, 4vw, 44px);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.site-page--narrow {
    max-width: 820px;
    margin: 0 auto;
}

.site-page--wide {
    max-width: 1040px;
    margin: 0 auto;
}

.site-page--full {
    width: 100%;
}

.site-page--paper {
    border-color: #d8dee9;
    background: linear-gradient(180deg, #fff, #fbfbf8);
}

.site-page--accent {
    border-color: rgba(10,141,255,.25);
    background: linear-gradient(180deg, #f6fbff, #fff);
}

.site-page--minimal {
    border-color: transparent;
    padding-inline: 0;
    background: transparent;
    box-shadow: none;
}

.site-page__head {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.site-page__head h1 {
    margin: 0;
}

.site-page__lead {
    max-width: 850px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.45;
}

.site-page__body {
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1.75;
}

.site-page__body h2,
.site-page__body h3,
.site-page__body h4 {
    margin: 1.4em 0 .55em;
    color: var(--ink);
    line-height: 1.25;
}

.site-page__body p,
.site-page__body ul,
.site-page__body ol,
.site-page__body blockquote,
.site-page__body table {
    margin: 0 0 1em;
}

.site-page__body ul,
.site-page__body ol {
    padding-left: 1.35em;
}

.site-page__body blockquote {
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    padding: 14px 18px;
    background: #f6fbff;
}

.site-page__body table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 14px;
}

.site-page__body th,
.site-page__body td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.site-page__body th {
    background: #f8fbff;
    color: var(--ink);
}

@media (max-width: 760px) {
    .site-page {
        border-radius: 18px;
    }

    .site-page--minimal {
        padding-inline: 0;
    }
}

/* Visual page editor for admin/site-pages */
.page-builder-shell {
    gap: 18px;
}

.page-builder-shell__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.page-builder-shell__head p {
    max-width: 920px;
    margin: 6px 0 0;
}

.page-builder-source {
    min-height: 1px;
}

.page-builder {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-builder__toolbar {
    position: sticky;
    top: 106px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.page-builder__tool-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-builder__tool {
    min-height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--ink-2);
    background: #fff;
    font-size: 13px;
    font-weight: 900;
}

.page-builder__tool:hover,
.page-builder__tool:focus-visible {
    color: var(--brand-700);
    border-color: #b6dfff;
    background: var(--brand-soft);
}

.page-builder__tool--compact {
    min-width: 38px;
    padding-inline: 9px;
}

.page-builder__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
}

.page-builder__editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.page-builder__canvas {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 360px;
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    padding: 16px;
    background: #f8fbff;
}

.page-builder__canvas.is-empty::before {
    content: "Добавьте первый блок через панель сверху";
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    color: var(--muted);
    background: #fff;
    font-weight: 800;
}

.page-builder__add-bottom {
    min-height: 46px;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    padding: 12px;
    color: var(--brand-700);
    background: #fff;
    font-weight: 900;
}

.page-builder__add-bottom:hover {
    border-color: #b6dfff;
    background: var(--brand-soft);
}

.page-builder-block {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.page-builder-block.is-active {
    border-color: rgba(10, 141, 255, .55);
    box-shadow: 0 18px 34px rgba(10, 141, 255, .12);
}

.page-builder-block.is-dragging {
    opacity: .72;
    transform: scale(.995);
}

.page-builder-block__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    color: var(--muted);
    background: #fbfdff;
    border-radius: 18px 18px 0 0;
}

.page-builder-block__meta,
.page-builder-block__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-builder-block__meta strong {
    color: var(--ink-2);
    font-size: 13px;
}

.page-builder-block__drag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: #fff;
    cursor: grab;
    font-weight: 900;
}

.page-builder-block__drag:active {
    cursor: grabbing;
}

.page-builder-block__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink-2);
    background: #fff;
    font-weight: 900;
}

.page-builder-block__action:hover {
    color: var(--brand-700);
    border-color: #b6dfff;
    background: var(--brand-soft);
}

.page-builder-block__action--delete:hover {
    color: var(--danger);
    border-color: #ffd1cc;
    background: var(--danger-soft);
}

.page-builder-block__content {
    padding: 18px;
}

.page-builder-editable {
    outline: none;
}

.page-builder-editable:focus {
    box-shadow: none;
}

.page-builder-editable:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.page-builder-editable--paragraph,
.page-builder-editable--heading,
.page-builder-editable--list,
.page-builder-editable--quote,
.page-builder-column,
.page-builder-cta__text,
.page-builder-image__caption,
.page-builder-editable.page-table {
    min-height: 42px;
    border-radius: 12px;
    padding: 8px 10px;
}

.page-builder-editable--paragraph:hover,
.page-builder-editable--heading:hover,
.page-builder-editable--list:hover,
.page-builder-editable--quote:hover,
.page-builder-column:hover,
.page-builder-cta__text:hover,
.page-builder-image__caption:hover,
.page-builder-editable.page-table:hover,
.page-builder-editable--paragraph:focus,
.page-builder-editable--heading:focus,
.page-builder-editable--list:focus,
.page-builder-editable--quote:focus,
.page-builder-column:focus,
.page-builder-cta__text:focus,
.page-builder-image__caption:focus,
.page-builder-editable.page-table:focus {
    background: #f8fbff;
}

.page-builder-editable--heading {
    margin: 0;
    color: var(--ink);
    line-height: 1.25;
}

.page-builder-editable--list {
    padding-left: 34px;
}

.page-builder-editable--quote {
    margin: 0;
    border-left: 4px solid var(--brand);
    background: #f6fbff;
}

.page-builder-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.page-builder-column {
    border: 1px solid var(--line);
    background: #fff;
}

.page-builder-cta,
.page-builder-image {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.page-builder-cta__controls,
.page-builder-image__controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.page-builder-image img {
    display: block;
    width: 100%;
    max-height: 360px;
    border-radius: 16px;
    object-fit: cover;
    background: #eef5ff;
}

.page-builder-image figcaption {
    color: var(--muted);
    font-size: 14px;
}

.page-builder-editable.page-table {
    width: 100%;
    border-collapse: collapse;
}

.page-builder__preview-card {
    position: sticky;
    top: 190px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 220px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.page-builder__preview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.page-builder__preview-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.page-builder__preview {
    font-size: 14px;
    line-height: 1.65;
}

.page-builder__preview .btn {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 13px;
}

.page-builder__html-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    background: #fbfdff;
}

.page-builder__html-panel summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 900;
}

.page-builder__html-panel textarea {
    margin-top: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

/* Admin editor blocks and public rendering */
.site-page__body .page-callout,
.page-builder__preview .page-callout,
.page-builder .page-callout {
    border: 1px solid rgba(10, 141, 255, .22);
    border-radius: 18px;
    padding: 18px;
    background: #f6fbff;
}

.site-page__body .page-callout > :last-child,
.page-builder__preview .page-callout > :last-child,
.page-builder .page-callout > :last-child,
.site-page__body .page-cta > :last-child,
.page-builder__preview .page-cta > :last-child,
.page-builder .page-cta > :last-child,
.site-page__body .page-column > :last-child,
.page-builder__preview .page-column > :last-child,
.page-builder .page-column > :last-child {
    margin-bottom: 0;
}

.site-page__body .page-columns,
.page-builder__preview .page-columns,
.page-builder .page-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.site-page__body .page-column,
.page-builder__preview .page-column,
.page-builder .page-column {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: #fff;
}

.site-page__body .page-cta,
.page-builder__preview .page-cta,
.page-builder .page-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid rgba(10, 141, 255, .24);
    border-radius: 22px;
    padding: 22px;
    background: linear-gradient(135deg, #f6fbff, #fff);
}

.site-page__body .page-cta__content,
.page-builder__preview .page-cta__content,
.page-builder .page-cta__content {
    min-width: 0;
}

.site-page__body .page-image,
.page-builder__preview .page-image,
.page-builder .page-image {
    margin: 22px 0;
}

.site-page__body .page-image img,
.page-builder__preview .page-image img,
.page-builder .page-image img {
    display: block;
    width: 100%;
    border-radius: 20px;
    object-fit: cover;
    background: #eef5ff;
}

.site-page__body .page-image figcaption,
.page-builder__preview .page-image figcaption,
.page-builder .page-image figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.site-page__body hr,
.page-builder__preview hr,
.page-builder hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 28px 0;
}

@media (max-width: 1180px) {
    .page-builder__layout {
        grid-template-columns: 1fr;
    }

    .page-builder__preview-card {
        position: static;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .page-builder__toolbar {
        position: static;
    }

    .page-builder__canvas,
    .page-builder-block__content {
        padding: 12px;
    }

    .page-builder-block__bar,
    .page-builder-block__actions,
    .page-builder-shell__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-builder-cta__controls,
    .page-builder-image__controls,
    .page-builder-columns,
    .site-page__body .page-columns,
    .page-builder__preview .page-columns,
    .page-builder .page-columns {
        grid-template-columns: 1fr;
    }

    .site-page__body .page-cta,
    .page-builder__preview .page-cta,
    .page-builder .page-cta {
        align-items: stretch;
        flex-direction: column;
    }
}

.page-builder-image__controls input[type="file"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 9px;
    color: var(--ink);
    background: #fff;
}

/* Client fixes 2026-05-22: categories, mobile menu, PWA, cookies, gallery, watermark. */
.hero h1 {
    max-width: 680px;
    font-size: clamp(38px, 5.4vw, 64px);
    line-height: 1.02;
    letter-spacing: -.035em;
}

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pwa-install-prompt {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    z-index: 118;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    max-width: 640px;
    margin: 0 auto;
    border: 1px solid rgba(10, 141, 255, .22);
    border-radius: 22px;
    padding: 15px;
    color: var(--ink);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 70px rgba(15, 28, 47, .20);
    backdrop-filter: blur(18px);
}

.pwa-install-prompt[hidden] {
    display: none !important;
}

.pwa-install-prompt strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.pwa-install-prompt p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.pwa-install-prompt__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.cookie-consent {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    max-width: 980px;
    margin: 0 auto;
    border: 1px solid rgba(10, 141, 255, .18);
    border-radius: 22px;
    padding: 16px;
    color: var(--ink);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 70px rgba(15, 28, 47, .18);
    backdrop-filter: blur(18px);
}

.cookie-consent[hidden] {
    display: none !important;
}

.cookie-consent p {
    margin: 4px 0;
    color: var(--muted);
}

.cookie-consent a {
    color: var(--brand-700);
    font-weight: 800;
}

.cookie-consent__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.detail-gallery:focus-visible {
    outline: 3px solid rgba(10, 141, 255, .34);
    outline-offset: 4px;
}

.detail-gallery__main {
    position: relative;
    touch-action: pan-y;
}

.detail-gallery__control {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 28, 47, .54);
    box-shadow: 0 10px 24px rgba(15, 28, 47, .24);
    font-size: 32px;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.detail-gallery__control:hover,
.detail-gallery__control:focus-visible {
    background: rgba(10, 141, 255, .92);
}

.detail-gallery__control--prev {
    left: 16px;
}

.detail-gallery__control--next {
    right: 16px;
}

.ad-photo-watermark {
    position: relative;
}

.ad-photo-watermark::after {
    content: "s-nds.ru";
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    border-radius: 999px;
    padding: 5px 9px;
    color: rgba(255,255,255,.9);
    background: rgba(15, 28, 47, .42);
    box-shadow: 0 8px 18px rgba(15, 28, 47, .16);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1;
    pointer-events: none;
    text-transform: lowercase;
}

.detail-gallery__main.ad-photo-watermark::after {
    right: 16px;
    bottom: 16px;
    padding: 7px 11px;
    font-size: 14px;
}

@media (min-width: 821px) {
    .pwa-install-prompt {
        display: none !important;
    }
}

@media (max-width: 1180px) {
    .main-menu {
        max-height: calc(100dvh - 104px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .categories-menu {
        width: 100%;
    }

    .categories-menu__panel {
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: min(58vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .categories-menu__group {
        flex: 0 0 auto;
    }
}

@media (max-width: 920px) {
    .hero h1 {
        font-size: clamp(34px, 8.5vw, 48px);
        letter-spacing: -.028em;
    }
}

@media (max-width: 640px) {
    .auth-form__row,
    .cookie-consent,
    .cookie-consent__actions,
    .pwa-install-prompt,
    .pwa-install-prompt__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-consent,
    .pwa-install-prompt {
        right: 10px;
        bottom: 10px;
        left: 10px;
        border-radius: 18px;
        padding: 14px;
    }

    .cookie-consent__actions .btn,
    .pwa-install-prompt__actions .btn {
        width: 100%;
    }

    .detail-gallery__control {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }

    .detail-gallery__control--prev {
        left: 8px;
    }

    .detail-gallery__control--next {
        right: 8px;
    }

    .ad-photo-watermark::after {
        right: 8px;
        bottom: 8px;
        padding: 4px 7px;
        font-size: 11px;
    }
}

.listing-card__image.ad-photo-watermark::after,
.listing-row__image.ad-photo-watermark::after {
    right: auto;
    left: 10px;
}

.listing-card__badge,
.listing-card__media-count {
    z-index: 5;
}

@media (max-width: 640px) {
    .listing-card__image.ad-photo-watermark::after,
    .listing-row__image.ad-photo-watermark::after {
        left: 8px;
    }
}

/* BEGIN S-NDS listing card width fix 20260527 */
.card-list > .listing-card,
.card-list > .listing-card.card,
.card-list > .listing-card.card.listing-card--tile {
    flex: 0 0 calc((100% - 36px) / 3);
    width: calc((100% - 36px) / 3);
    max-width: calc((100% - 36px) / 3);
    min-width: 0;
}

@media (max-width: 980px) {
    .card-list > .listing-card,
    .card-list > .listing-card.card,
    .card-list > .listing-card.card.listing-card--tile {
        flex: 0 0 calc((100% - 18px) / 2);
        width: calc((100% - 18px) / 2);
        max-width: calc((100% - 18px) / 2);
    }
}

@media (max-width: 640px) {
    .card-list > .listing-card,
    .card-list > .listing-card.card,
    .card-list > .listing-card.card.listing-card--tile {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}
/* END S-NDS listing card width fix 20260527 */

/* BEGIN S-NDS staff header responsive fix 20260527 */
@media (min-width: 1181px) {
    .site-shell.has-staff-nav .header-main {
        gap: 8px;
    }

    .site-shell.has-staff-nav .brand {
        min-width: 136px;
    }

    .site-shell.has-staff-nav .brand__mark {
        width: 150px;
    }

    .site-shell.has-staff-nav .main-menu {
        gap: 2px;
        flex: 1 1 auto;
    }

    .site-shell.has-staff-nav .main-menu > a,
    .site-shell.has-staff-nav .categories-menu__button,
    .site-shell.has-staff-nav .nav-group__button {
        min-height: 38px;
        padding: 8px 8px;
        font-size: 14px;
        line-height: 1.12;
    }

    .site-shell.has-staff-nav .header-actions {
        gap: 5px;
    }

    .site-shell.has-staff-nav .header-actions .btn--small,
    .site-shell.has-staff-nav .header-actions button.btn--small {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 14px;
        line-height: 1.12;
        white-space: nowrap;
    }
}

@media (min-width: 1181px) and (max-width: 1320px) {
    .site-shell.has-staff-nav .brand {
        min-width: 124px;
    }

    .site-shell.has-staff-nav .brand__mark {
        width: 138px;
    }

    .site-shell.has-staff-nav .main-menu > a,
    .site-shell.has-staff-nav .categories-menu__button,
    .site-shell.has-staff-nav .nav-group__button {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 13px;
    }

    .site-shell.has-staff-nav .header-actions .btn--small,
    .site-shell.has-staff-nav .header-actions button.btn--small {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
    }
}

@media (max-width: 1180px) {
    .header-main {
        justify-content: space-between;
    }

    .brand {
        min-width: 0;
    }

    .nav-toggle {
        flex: 0 0 42px;
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .header-main {
        justify-content: space-between;
    }

    .brand {
        flex: 0 1 auto;
        min-width: 0;
    }

    .brand__mark {
        width: min(138px, 44vw);
    }

    .nav-toggle {
        flex: 0 0 42px;
        margin-left: auto;
    }
}
/* END S-NDS staff header responsive fix 20260527 */

/* BEGIN S-NDS mobile dropdown toggle fix 20260527 */
@media (max-width: 1180px) {
    .main-menu .categories-menu:hover .categories-menu__panel,
    .main-menu .categories-menu:not(.is-open):hover .categories-menu__panel {
        display: none;
    }

    .main-menu .categories-menu.is-open .categories-menu__panel,
    .main-menu .categories-menu.is-open:hover .categories-menu__panel {
        display: flex;
    }

    .main-menu .nav-group:hover .nav-group__panel,
    .main-menu .nav-group:not(.is-open):hover .nav-group__panel {
        display: none;
    }

    .main-menu .nav-group.is-open .nav-group__panel,
    .main-menu .nav-group.is-open:hover .nav-group__panel {
        display: flex;
    }

    .main-menu .categories-menu:hover::after,
    .main-menu .categories-menu.is-open::after,
    .main-menu .nav-group:hover::after,
    .main-menu .nav-group.is-open::after {
        display: none;
    }
}
/* END S-NDS mobile dropdown toggle fix 20260527 */
