:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #1f2937;
    --muted: #667085;
    --border: #d8dee9;
    --primary: #1f7ae0;
    --primary-dark: #1765bd;
    --success: #1b8f5a;
    --danger: #c93535;
    --shadow: 0 12px 32px rgba(31, 41, 55, .08);
    --sidebar-width: 260px;
    --public-sidebar-width: 300px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
button {
    font: inherit;
}

.container {
    width: min(1280px, calc(100% - 16px));
    margin: 0 auto;
}

.admin-shell.container {
    width: min(1280px, calc(100% - 8px));
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    min-height: 68px;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    gap: 20px;
    align-items: center;
}

.brand,
.admin-brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.header-search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.header-search-field {
    position: relative;
    min-width: 0;
}

.header-search-field > input[type="search"] {
    padding-right: min(27.6vw, 207px);
}

.header-search-suggest {
    position: absolute;
    z-index: 45;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: none;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.header-search-suggest.is-open {
    display: grid;
}

.header-search-result,
.header-search-empty {
    padding: 8px 10px;
    border-radius: 6px;
}

.header-search-result {
    display: grid;
    gap: 2px;
}

.header-search-result:hover {
    background: var(--surface-soft);
}

.header-search-result strong {
    font-size: 14px;
    line-height: 1.2;
}

.header-search-result span,
.header-search-empty {
    color: var(--muted);
    font-size: 13px;
}

.header-search input,
.header-search select,
.header-city-select-toggle,
.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.header-search input,
.header-search select,
.header-city-select-toggle,
.form-grid input,
.form-grid select {
    height: 40px;
    padding: 0 12px;
}

.form-grid textarea {
    min-height: 120px;
    padding: 12px 14px;
    resize: vertical;
}

.header-search button,
.btn,
.form-grid button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.header-search button {
    min-height: 40px;
}

.header-city-select {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(25.3vw, 179px);
    min-width: 0;
}

.header-city-select-toggle {
    width: 100%;
    height: 100%;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-weight: 400;
    cursor: pointer;
    justify-content: flex-start;
}

.header-city-select-toggle:focus-visible {
    outline: 2px solid rgba(37, 99, 235, .28);
    outline-offset: 1px;
}

.header-city-select-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.header-city-picker-toggle {
    gap: 8px;
    color: var(--primary);
    font-weight: 700;
    padding: 0 12px;
    overflow: hidden;
}

.header-city-picker-toggle [data-city-picker-label] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-city-picker-toggle::after {
    display: none;
}

.city-picker-pin {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50% 50% 50% 0;
    display: inline-block;
    flex: 0 0 auto;
    transform: rotate(-45deg);
    position: relative;
}

.city-picker-pin::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.city-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 34px 24px 24px;
    background: rgba(15, 23, 42, .42);
}

.city-picker-modal.is-open {
    display: grid;
}

.city-picker-dialog {
    width: min(1040px, 100%);
    max-height: min(680px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
}

.city-picker-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.city-picker-close {
    position: absolute;
    right: -18px;
    top: -18px;
    width: 36px;
    height: 36px;
    max-width: 36px;
    flex: 0 0 36px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.header-search .city-picker-close {
    width: 36px;
    height: 36px;
    max-width: 36px;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
}

.city-picker-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.city-picker-search {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
}

.city-picker-all,
.city-picker-result {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 0 12px;
    text-align: left;
    justify-content: flex-start;
}

.city-picker-all:hover,
.city-picker-result:hover {
    background: var(--surface-soft);
}

.city-picker-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: auto;
    padding-right: 2px;
    min-height: 0;
}

.city-picker-empty {
    color: var(--muted);
    padding: 10px 2px;
}

.btn-primary,
.header-search button,
.form-grid button {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.header-search button:hover,
.form-grid button:hover {
    background: var(--primary-dark);
}

.header-search .header-city-select-toggle,
.header-search .header-city-select-toggle:hover {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.header-search .header-city-picker-toggle,
.header-search .header-city-picker-toggle:hover {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border);
    color: var(--primary);
}

.header-search .city-picker-close,
.header-search .city-picker-all,
.header-search .city-picker-result {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.header-search .city-picker-close:hover,
.header-search .city-picker-all:hover,
.header-search .city-picker-result:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.btn-light {
    background: var(--surface-soft);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.header-account-link {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-account-link svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-account-link:hover {
    background: var(--primary);
    color: #fff;
}

.header-icon-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--primary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.header-icon-button svg,
.mobile-category-menu svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-icon-button:hover,
.header-icon-button.is-active {
    background: var(--primary);
    color: #fff;
}

.mobile-category-menu {
    display: none;
}

.mobile-category-menu__head,
.mobile-category-menu__list {
    display: contents;
}

.hero {
    background: linear-gradient(180deg, #fff 0%, #eef4ff 100%);
    border-bottom: 1px solid var(--border);
}

.panel,
.auth-card,
.stat-card,
.ad-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.section {
    padding: 34px 0;
}

.section-title,
.admin-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.section-title h1,
.section-title h2,
.admin-header-inner h1 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.ad-card {
    padding: 14px;
}

.ad-image {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #dbeafe, #f8fafc);
    border-radius: 8px;
    margin-bottom: 12px;
}

.ad-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.ad-card span {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--public-sidebar-width);
    gap: 16px;
    align-items: start;
}

.home-ad-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ad-card-image-width, 260px)), 1fr));
    gap: 26px 18px;
}

.home-ad-card {
    display: block;
    min-width: 0;
}

.home-ad-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.22;
    font-weight: 400;
}

.home-ad-card h3 a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-ad-body span {
    display: block;
    color: var(--text);
    font-size: 13px;
    margin-top: 2px;
    line-height: 1.25;
}

.ad-location {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    color: #475569;
}

.ad-location::before {
    content: "";
    width: 15px;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 5.2-8 11-8 11S4 15.2 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='2.8'/%3E%3C/svg%3E") center / contain no-repeat;
    display: inline-block;
    flex: 0 0 auto;
}

.home-ad-body .ad-location {
    display: flex;
    align-items: center;
}

.home-ad-thumb {
    position: relative;
    width: 100%;
    height: var(--ad-card-image-height, 360px);
    max-height: 360px;
    border-radius: 16px;
    background: linear-gradient(135deg, #dbeafe, #f8fafc);
    overflow: hidden;
    display: block;
    margin-bottom: 8px;
}

.home-ad-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-ad-gallery-zones {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

.home-ad-gallery-zones span {
    min-width: 0;
}

.home-ad-gallery-indicators {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    z-index: 3;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.home-ad-thumb:hover .home-ad-gallery-indicators,
.home-ad-thumb:focus-visible .home-ad-gallery-indicators {
    opacity: 1;
}

.home-ad-gallery-indicators span {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .28);
}

.home-ad-gallery-indicators span.is-active {
    background: #fff;
}

.home-ad-body strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.public-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.public-pagination a {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.public-pagination a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--primary);
}

.breadcrumbs a::after,
.breadcrumbs span:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--muted);
}

.ad-page-title {
    margin: 0 0 18px;
    font-size: 32px;
    line-height: 1.12;
}

.ad-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--public-sidebar-width);
    gap: 16px;
    align-items: start;
}

.ad-banner {
    min-width: 0;
}

.ad-banner-top {
    width: 100%;
    padding: 0 12px;
    margin-top: 12px;
}

.ad-banner-after-gallery {
    margin-top: 14px;
}

.ad-banner-after-text {
    margin-top: 18px;
}

.ad-banner-sidebar {
    margin: -4px 0 14px;
}

.ad-demo-banner {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px dashed #d21f1f;
    border-radius: 4px;
    background: #fff;
    color: #d21f1f;
    font-weight: 700;
    text-align: center;
}

.ad-demo-banner-small {
    min-height: 54px;
}

.ad-detail-main,
.ad-detail-side {
    min-width: 0;
}

.ad-detail-gallery {
    display: grid;
    gap: 10px;
}

.ad-gallery-main-wrap {
    position: relative;
}

.ad-gallery-main {
    width: 100%;
    height: min(64vh, 560px);
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: #eef1f5;
    cursor: zoom-in;
    overflow: hidden;
}

.ad-gallery-inline-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 96px;
    border: 0;
    border-radius: 8px;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, .28);
    color: #fff;
    font-size: 38px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.ad-gallery-inline-nav:hover {
    background: rgba(15, 23, 42, .42);
}

.ad-gallery-inline-prev {
    left: 12px;
}

.ad-gallery-inline-next {
    right: 12px;
}

.ad-gallery-main img,
.ad-detail-empty-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ad-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
}

.ad-gallery-thumbs button {
    height: 66px;
    border: 0;
    border-radius: 4px;
    padding: 0;
    background: var(--surface-soft);
    cursor: pointer;
    overflow: hidden;
}

.ad-gallery-thumbs button.is-active {
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--primary);
}

.ad-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-detail-description {
    margin-top: 28px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    line-height: 1.65;
}

.ad-detail-description h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.ad-public-meta,
.cabinet-ad-meta {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.cabinet-ad-meta {
    margin-top: 6px;
}

.cabinet-ad-title {
    max-width: 30ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-related {
    margin-top: 28px;
}

.ad-related > h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.ad-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ad-card-image-width, 260px)), 1fr));
    gap: 18px;
    align-items: start;
}

.ad-side-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 14px;
}

.ad-contact-card {
    margin-top: 18px;
}

.ad-contact-inline {
    display: none;
}

.ad-detail-price {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 28px;
    line-height: 1.2;
}

.ad-detail-price svg {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: translateY(1px);
}

.ad-detail-location {
    margin: 4px 0 0;
    font-size: 15px;
    line-height: 1.35;
}

.ad-side-button {
    width: 100%;
    gap: 8px;
}

.ad-side-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ad-admin-actions {
    display: grid;
    grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
    gap: 8px;
}

.ad-admin-actions form {
    margin: 0;
}

.ad-admin-actions .ad-side-button {
    height: 100%;
    gap: 2px;
    padding-inline: 6px;
}

.ad-admin-actions .ad-side-button svg {
    margin-right: 2px;
}

.ad-contact-name {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.ad-category-sidebar {
    box-shadow: none;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .86);
    padding: 18px;
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox img {
    max-width: calc(100vw - 130px);
    max-height: calc(100vh - 70px);
    object-fit: contain;
    display: block;
}

.gallery-lightbox button {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.gallery-lightbox-close {
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 28px;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    top: 50%;
    width: 48px;
    height: 72px;
    transform: translateY(-50%);
    border-radius: 8px;
    font-size: 36px;
}

.gallery-lightbox-prev {
    left: 18px;
}

.gallery-lightbox-next {
    right: 18px;
}

.home-category-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 15px;
}

.home-category-sidebar-title {
    margin: 0 0 12px;
    font-size: 20px;
}

.home-category-list {
    display: grid;
    gap: 2px;
}

.home-category-list a {
    padding: 3px 8px;
    border-radius: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.home-category-list a:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.category-simple-icon {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    flex: 0 0 6px;
    opacity: .72;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 24px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--muted);
}

.empty-state a {
    color: var(--primary);
    font-weight: 700;
}

.empty-state-arrow {
    width: 32px;
    height: 32px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.empty-state-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-wrap {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 40px 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
}

.footer-inner {
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
}

.auth-card {
    width: min(520px, 100%);
    padding: 28px;
}

.install-card {
    width: min(760px, 100%);
}

.auth-card h1 {
    margin-top: 0;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-weight: 400;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.span-2 {
    grid-column: 1 / -1;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: opacity .2s ease, transform .2s ease;
}

.alert.is-hidden {
    opacity: 0;
    transform: translateY(-4px);
}

.alert.error {
    background: #fff1f1;
    color: var(--danger);
    border: 1px solid #ffd2d2;
}

.alert.success {
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert.neutral {
    background: #f3f5f8;
    color: var(--muted);
    border: 1px solid var(--border);
}

.muted {
    color: var(--muted);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.auth-links a {
    color: var(--primary);
    font-weight: 700;
}

.dashboard {
    padding: 8px 0 34px;
}

.cabinet-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.cabinet-side-column {
    display: grid;
    gap: 12px;
}

.cabinet-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 15px;
}

.cabinet-user {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cabinet-user-info {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.cabinet-login {
    color: var(--text);
}

.cabinet-user span {
    color: var(--muted);
    font-size: 14px;
}

.cabinet-user .cabinet-login {
    color: var(--text);
    font-size: 16px;
}

.cabinet-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cabinet-balance a {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cabinet-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--primary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.cabinet-avatar.system-avatar {
    background: #eef4ff;
    color: var(--primary);
}

.cabinet-avatar.small {
    width: 56px;
    height: 56px;
}

.cabinet-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cabinet-avatar svg {
    width: 42%;
    height: 42%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cabinet-sidebar nav {
    display: grid;
    gap: 2px;
}

.cabinet-sidebar nav a {
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cabinet-sidebar-banner {
    margin: 0;
}

.cabinet-sidebar nav a:hover,
.cabinet-sidebar nav a.active {
    background: var(--surface-soft);
    color: var(--primary);
}

.cabinet-sidebar nav a.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.panel {
    padding: 15px;
}

.panel > :first-child,
.profile-block > :first-child,
.stat-card > :first-child,
.ad-card > :first-child,
.cabinet-sidebar > :first-child {
    margin-top: 0;
}

.panel h1,
.panel h2,
.profile-block h1,
.profile-block h2,
.admin-header-inner h1,
.admin-header-inner h2 {
    margin-top: 0;
}

.btn svg {
    width: 18px;
    height: 18px;
    margin-right: 7px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cabinet-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.cabinet-section-head h2 {
    margin: 0;
}

.cabinet-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cabinet-dashboard-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    padding: 16px;
    display: grid;
    gap: 8px;
    min-height: 130px;
}

.cabinet-dashboard-card span {
    color: var(--muted);
    font-size: 14px;
}

.cabinet-dashboard-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.15;
}

.cabinet-dashboard-card a {
    align-self: end;
    color: var(--primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cabinet-dashboard-card a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f5f8;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.status-active {
    background: #ecfdf3;
    color: var(--success);
}

.status-moderation,
.status-draft {
    background: #eef4ff;
    color: var(--primary);
}

.status-blocked {
    background: #fff1f1;
    color: var(--danger);
}

.status-archived {
    background: #f3f5f8;
    color: var(--muted);
}

.profile-grid {
    display: grid;
    gap: 16px;
}

.profile-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
}

.profile-block h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 400;
}

.profile-avatar-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.profile-avatar-row > div:nth-child(2) {
    min-width: 200px;
}

.avatar-form {
    width: min(620px, 100%);
    margin-left: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.avatar-form button {
    min-width: 220px;
}

.avatar-form input[type="file"] {
    padding: 0;
    overflow: hidden;
}

.avatar-form input[type="file"]::file-selector-button {
    height: 44px;
    border: 0;
    border-right: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--primary);
    padding: 0 16px;
    margin-right: 14px;
    cursor: pointer;
    font: inherit;
}

.avatar-form input[type="file"]::file-selector-button:hover {
    background: #dfeaff;
}

.profile-avatar-row p {
    margin: 0 0 6px;
}

.compact-form {
    max-width: none;
    margin-top: 12px;
}

.profile-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-block-head h3 {
    margin: 0;
}

.password-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.text-danger-button {
    border: 0;
    background: transparent;
    color: var(--danger);
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.text-danger-button:hover {
    color: #9f1d1d;
}

.form-grid button.btn-danger,
.btn-danger:hover {
    background: #b42323;
    color: #fff;
}

.ad-create-form input[type="file"] {
    padding: 0;
    overflow: hidden;
}

.ad-create-form input[type="file"]::file-selector-button {
    height: 44px;
    border: 0;
    border-right: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--primary);
    padding: 0 16px;
    margin-right: 14px;
    cursor: pointer;
    font: inherit;
}

.ad-edit-images,
.ad-upload-block {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.ad-edit-images h3,
.ad-upload-head h3 {
    margin: 0;
    font-size: 18px;
}

.ad-edit-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 12px;
}

.ad-edit-image-grid figure {
    position: relative;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.ad-edit-image-grid .new-upload-preview img,
.ad-edit-image-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.form-grid .ad-edit-image-preview,
.form-grid .ad-edit-image-preview:hover {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    display: block;
    color: inherit;
}

.ad-edit-image-grid .new-upload-preview img,
.ad-edit-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-upload-tile {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    border: 1px dashed #b8c5d8;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--primary);
    cursor: pointer;
}

.ad-upload-tile input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ad-upload-tile > span {
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
}

.ad-upload-tile small {
    color: var(--muted);
    font-size: 13px;
}

.ad-upload-tile.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.ad-edit-image-grid .icon-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    min-height: 0;
    padding: 0;
    background: #fff;
    color: var(--danger);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .24);
    z-index: 2;
}

.ad-edit-image-grid .image-remove-button {
    top: 1px;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: var(--danger);
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ad-edit-image-grid .image-remove-button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    line-height: 1;
    margin: 0;
}

.ad-edit-image-grid .image-remove-button:hover {
    background: #d1d5db;
    color: var(--danger);
}

.ad-edit-image-grid .icon-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ad-upload-head {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
}

.ad-upload-head span {
    color: var(--muted);
    font-size: 14px;
}

.image-order-list {
    display: grid;
    gap: 6px;
}

.ad-edit-images .image-order-list {
    display: none;
}

.image-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 10px;
    align-items: center;
}

.image-order-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-grid {
    display: grid;
    gap: 16px;
}

.finance-topup-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 240px;
    column-gap: 8px;
    row-gap: 10px;
    align-items: end;
}

.finance-topup-form label {
    display: grid;
    gap: 6px;
}

.finance-topup-form input,
.finance-topup-form select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
}

.finance-topup-form button {
    min-height: 44px;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tabs a {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.tabs a.active {
    background: var(--surface-soft);
    color: var(--primary);
}

@media (max-width: 980px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .home-layout,
    .cabinet-layout,
    .ad-detail,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-shell.container,
    .dashboard.container {
        width: 100%;
        max-width: 100%;
    }

    .admin-shell,
    .admin-main,
    .cabinet-layout,
    .panel,
    .settings-spoiler,
    .settings-spoiler .settings-form,
    .table-wrap,
    .ads-list-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .admin-shell {
        gap: 10px;
    }

    .header-inner {
        min-height: 0;
        padding: 14px 0;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "brand actions";
        column-gap: 12px;
        row-gap: 8px;
    }

    .brand {
        grid-area: brand;
    }

    .header-search {
        grid-area: auto;
        grid-column: 1 / -1;
        display: none;
        grid-template-columns: minmax(0, 1fr) 116px;
        gap: 8px;
    }

    .header-search.is-open {
        display: grid;
    }

    .mobile-category-menu {
        grid-area: auto;
    }

    .header-actions {
        grid-area: actions;
        justify-content: flex-end;
    }

    .header-icon-button,
    .header-menu-toggle {
        display: inline-flex;
    }

    .header-actions a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }

    .header-search-field > input[type="search"] {
        padding-right: clamp(126px, 28vw, 180px);
    }

    .header-city-select {
        width: clamp(118px, 28vw, 178px);
    }

    .mobile-category-menu {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1100;
        display: flex;
        width: min(360px, 88vw);
        min-height: 100dvh;
        padding: 16px;
        background: #fff;
        border-left: 1px solid var(--border);
        box-shadow: -20px 0 38px rgba(31, 41, 55, .16);
        transform: translateX(100%);
        transition: transform .2s ease;
        flex-direction: column;
        gap: 12px;
        pointer-events: none;
    }

    .mobile-category-menu.is-open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .mobile-category-menu__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
    }

    .mobile-category-menu__head strong {
        font-size: 20px;
    }

    .mobile-category-menu__close {
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 8px;
        background: var(--surface-soft);
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .mobile-category-menu__close:hover {
        background: var(--primary);
        color: #fff;
    }

    .mobile-category-menu__list {
        display: grid;
        gap: 4px;
        padding-right: 2px;
    }

    .mobile-category-menu__list a {
        min-height: 38px;
        padding: 7px 9px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-category-menu__list a:hover {
        background: var(--surface-soft);
        color: var(--primary);
    }

    .home-category-sidebar {
        display: none;
    }

    .home-ad-list,
    .ad-related-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px 18px;
    }

    .home-ad-thumb {
        height: clamp(190px, 26vw, 280px);
        max-height: none;
    }

    .ad-gallery-main {
        height: min(58vh, 460px);
    }

    .ad-contact-inline {
        display: grid;
    }

    .ad-contact-sidebar {
        display: none;
    }

    .gallery-lightbox img {
        max-width: calc(100vw - 34px);
        max-height: calc(100vh - 120px);
    }

    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        top: auto;
        bottom: 18px;
        transform: none;
    }

    .footer-inner,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .ads-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-image-upload-row {
        grid-template-columns: 1fr;
    }

    .settings-card-row {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: var(--shadow);
        padding: 12px;
        overflow: hidden;
    }

    .admin-sidebar nav,
    .cabinet-sidebar nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
        gap: 8px;
        margin-top: 12px;
        overflow: visible;
        padding-bottom: 0;
        max-width: 100%;
    }

    .admin-sidebar nav a,
    .cabinet-sidebar nav a {
        flex: none;
        min-height: 42px;
        white-space: normal;
    }

    .admin-sidebar nav a.active,
    .cabinet-sidebar nav a.active {
        box-shadow: inset 0 -3px 0 var(--primary);
    }

    .admin-main {
        padding: 12px 0 30px;
    }

    .cabinet-side-column {
        min-width: 0;
    }

    .cabinet-sidebar {
        padding: 12px;
    }

    .cabinet-user {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .finance-grid,
    .finance-primary-row,
    .finance-tax-row,
    .finance-filter-form,
    .image-order-row,
    .ads-filter-form,
    .cabinet-dashboard-grid,
    .ticket-admin-filter,
    .advertising-code-label,
    .profile-grid,
    .avatar-form,
    .password-fields,
    .settings-watermark-row,
    .settings-watermark-top,
    .form-grid,
    .settings-form,
    .page-settings-form,
    .ad-create-form,
    .user-edit-form,
    .finance-topup-form,
    .ticket-form,
    .ticket-status-form,
    .details-grid,
    .finance-summary-panel .details-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2,
    .settings-form .span-2 {
        grid-column: 1;
    }

    .settings-form button,
    .form-grid button,
    .finance-topup-form button,
    .finance-filter-form button,
    .ticket-status-form .btn {
        width: 100%;
    }

    .profile-avatar-row,
    .profile-block-head,
    .settings-checkbox-row,
    .finance-methods {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .profile-avatar-row > div:nth-child(2) {
        min-width: 0;
        width: 100%;
    }

    .avatar-form button {
        min-width: 0;
        width: 100%;
    }

    .finance-methods {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .finance-filter-form button {
        width: 100%;
    }

    .table-wrap {
        overflow-x: auto;
    }

    table {
        min-width: 720px;
        table-layout: auto;
    }

    th,
    td {
        white-space: nowrap;
    }

    .ads-list-wrap {
        overflow: visible;
    }

    .ads-list-head {
        display: none;
    }

    .ads-admin-row,
    .cabinet-ads-row,
    .ads-list-row {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 8px 10px;
        min-height: 0;
        padding: 12px 0;
        align-items: start;
    }

    .ads-list-cell,
    .ads-list-actions {
        min-width: 0;
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
    }

    .ads-list-row .ads-list-cell:first-child {
        grid-column: 1 / -1;
        color: var(--muted);
        font-size: 13px;
    }

    .ads-list-row .ads-list-cell:nth-child(2) {
        grid-column: 1;
        grid-row: span 4;
    }

    .ads-list-row .ads-list-cell:nth-child(3) {
        grid-column: 2;
        font-weight: 700;
    }

    .ads-list-actions {
        grid-column: 2;
    }

    .ads-list .row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1000;
    width: min(calc(100% - 32px), 680px);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .18);
    transform: translateX(-50%);
    transition: opacity .18s ease, transform .18s ease;
    backdrop-filter: blur(12px);
}

.cookie-consent.is-hiding {
    opacity: 0;
    transform: translate(-50%, 12px);
}

.cookie-consent__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
}

.cookie-consent__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cookie-consent__body {
    min-width: 0;
}

.cookie-consent__title {
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.cookie-consent__text {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.cookie-consent__text a {
    color: var(--primary);
    font-weight: 600;
}

.cookie-consent__button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-consent__button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

@media (max-width: 560px) {
    .cookie-consent {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 12px;
    }

    .cookie-consent__button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 18px, 1280px);
    }

    .header-inner {
        padding: 9px 0;
        gap: 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .image-order-row,
    .ads-filter-form,
    .cabinet-dashboard-grid,
    .ticket-admin-filter,
    .ticket-status-form,
    .finance-filter-form,
    .advertising-code-label,
    .profile-grid,
    .avatar-form,
    .password-fields,
    .settings-watermark-row,
    .settings-watermark-top {
        grid-template-columns: 1fr;
    }

    .header-search {
        grid-template-columns: 1fr;
    }

    .header-search-field > input[type="search"] {
        padding-right: 12px;
    }

    .header-city-select {
        position: relative;
        width: 100%;
        height: 40px;
        order: -1;
    }

    .header-city-select-toggle {
        border: 1px solid var(--border);
        border-radius: 8px;
    }

    .header-search-field {
        display: grid;
        gap: 8px;
    }

    .header-search button {
        width: 100%;
    }

    .header-actions {
        gap: 7px;
    }

    .header-actions a {
        min-height: 36px;
        padding: 0 10px;
    }

    .header-actions .btn {
        min-height: 36px;
        padding: 0 12px;
    }

    .footer-inner {
        min-height: 0;
        padding: 14px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .footer-inner > span {
        line-height: 1.35;
    }

    .footer-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 16px;
        align-items: start;
    }

    .footer-links a {
        line-height: 1.35;
    }

    .brand {
        font-size: 22px;
    }

    .section {
        padding-top: 24px;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 30px;
        line-height: 1.12;
    }

    .home-ad-list,
    .ad-related-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 14px;
    }

    .home-ad-thumb {
        height: clamp(170px, 45vw, 230px);
        border-radius: 14px;
    }

    .home-ad-card h3 {
        font-size: 15px;
        line-height: 1.22;
    }

    .home-ad-body strong {
        font-size: 15px;
    }

    .home-ad-body span {
        font-size: 13px;
    }

    .city-picker-results {
        grid-template-columns: 1fr;
    }

    .city-picker-modal {
        padding: 24px 16px 16px;
    }

    .city-picker-dialog {
        width: 100%;
        max-height: calc(100vh - 40px);
        padding: 14px;
        gap: 10px;
    }

    .city-picker-close {
        right: 12px;
        top: 12px;
        width: 34px;
        height: 34px;
        max-width: 34px;
        flex-basis: 34px;
        font-size: 22px;
    }

    .header-search .city-picker-close {
        width: 34px;
        height: 34px;
        max-width: 34px;
    }

    .city-picker-title {
        padding-right: 44px;
    }

    .cookie-consent {
        align-items: start;
    }

    .cookie-consent__button {
        grid-column: 1 / -1;
        width: 100%;
        margin-left: 0;
    }

    .dashboard {
        padding-top: 8px;
    }

    .panel,
    .cabinet-sidebar,
    .settings-spoiler summary,
    .settings-spoiler .settings-form {
        padding: 12px;
    }

    .admin-shell.container {
        width: 100%;
    }

    .admin-sidebar nav,
    .cabinet-sidebar nav {
        gap: 6px;
        margin-top: 10px;
    }

    .admin-sidebar nav a,
    .cabinet-sidebar nav a {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 14px;
    }

    .admin-brand {
        font-size: 21px;
    }

    .admin-main {
        padding: 0 0 24px;
    }

    .panel h1,
    .panel h2,
    .cabinet-section-head h2 {
        font-size: 24px;
        line-height: 1.18;
    }

    .cabinet-layout {
        gap: 10px;
    }

    .cabinet-user {
        gap: 10px;
    }

    .cabinet-avatar.small {
        width: 44px;
        height: 44px;
    }

    .profile-avatar-row,
    .profile-block-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .profile-avatar-row > div:nth-child(2) {
        min-width: 0;
        width: 100%;
    }

    .avatar-form button {
        min-width: 0;
        width: 100%;
    }

    .cabinet-section-head,
    .ticket-head,
    .ticket-admin-toolbar,
    .ticket-per-page,
    .admin-pagination.inline {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cabinet-section-head .btn,
    .ticket-head .btn,
    .ticket-admin-toolbar .btn,
    .ticket-status-form .btn {
        width: 100%;
    }

    .ticket-per-page,
    .per-page-select {
        margin-left: 0;
        min-width: 0;
    }

    .ticket-per-page label,
    .per-page-select label,
    .admin-pagination.inline label {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .per-page-select select,
    .admin-pagination.inline select,
    .per-page-control {
        width: 100%;
        flex-basis: auto;
    }

    .form-grid,
    .settings-form,
    .page-settings-form,
    .ad-create-form,
    .user-edit-form,
    .finance-topup-form,
    .ticket-form {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2,
    .settings-form .span-2 {
        grid-column: 1;
    }

    .settings-form button,
    .form-grid button,
    .finance-topup-form button,
    .finance-filter-form button {
        width: 100%;
    }

    .settings-checkbox-row,
    .finance-methods {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .table-wrap {
        margin: 0 -12px;
        padding: 0 12px;
    }

    table {
        min-width: 720px;
        table-layout: auto;
    }

    th,
    td {
        white-space: nowrap;
    }

    .ads-list-wrap {
        overflow: visible;
    }

    .ads-list-head {
        display: none;
    }

    .ads-admin-row,
    .cabinet-ads-row,
    .ads-list-row {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 8px 10px;
        min-height: 0;
        padding: 12px 0;
        align-items: start;
    }

    .ads-list-cell,
    .ads-list-actions {
        min-width: 0;
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
    }

    .ads-list-row .ads-list-cell:first-child {
        grid-column: 1 / -1;
        color: var(--muted);
        font-size: 13px;
    }

    .ads-list-row .ads-list-cell:nth-child(2) {
        grid-column: 1;
        grid-row: span 4;
    }

    .ads-list-row .ads-list-cell:nth-child(3) {
        grid-column: 2;
        font-weight: 700;
    }

    .ads-list-actions {
        grid-column: 2;
    }

    .ads-list .row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .table-ad-thumb {
        width: 52px;
        height: 52px;
    }

    .admin-pagination,
    .public-pagination {
        max-width: 100%;
        overflow-x: auto;
    }

    .admin-pagination.table-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .admin-pagination.table-pagination .per-page-select {
        margin-left: auto;
        min-width: 150px;
    }

    .admin-pagination.table-pagination .per-page-select label {
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }

    .admin-pagination.table-pagination .per-page-control {
        width: 110px;
        flex: 0 0 110px;
    }

    .pagination-carousel {
        min-width: 0;
    }

    .ad-edit-image-grid,
    .admin-ad-edit-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticket-list {
        gap: 8px;
    }

    .ticket-row,
    .admin-ticket-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px;
    }

    .ticket-message {
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .home-ad-list,
    .ad-related-list {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .home-ad-thumb {
        height: clamp(210px, 72vw, 300px);
    }

    .ad-edit-image-grid,
    .admin-ad-edit-images {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .ads-list-wrap {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .ads-admin-list {
        min-width: 1180px;
    }

    .cabinet-ads-list {
        min-width: 960px;
    }

    .ads-list-head {
        display: grid;
    }

    .ads-admin-row,
    .cabinet-ads-row,
    .ads-list-row {
        gap: 0 10px;
        min-height: 72px;
        padding: 0;
        align-items: center;
    }

    .ads-list-head {
        min-height: 48px;
    }

    .ads-admin-row {
        grid-template-columns:
            22px
            34px
            56px
            minmax(0, 1.55fr)
            minmax(0, 1.15fr)
            minmax(0, 1.25fr)
            minmax(0, 1fr)
            120px
            114px;
    }

    .cabinet-ads-row {
        grid-template-columns:
            22px
            34px
            56px
            minmax(0, 1.65fr)
            minmax(0, 1fr)
            minmax(0, 1.15fr)
            132px
            126px;
    }

    .ads-list-cell,
    .ads-list-actions {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .ads-list-row .ads-list-cell:first-child,
    .ads-list-row .ads-list-cell:nth-child(2),
    .ads-list-row .ads-list-cell:nth-child(3),
    .ads-list-actions {
        grid-column: auto;
        grid-row: auto;
        color: inherit;
        font-size: inherit;
        font-weight: inherit;
    }

    .ads-list .row-actions {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
}
