:root {
    --bg: #f5f7fb;
    --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;
}

* {
    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,
.header-city-select-search,
.search-panel input,
.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,
.header-city-select-search,
.search-panel input,
.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,
.search-panel 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-dialog h2 {
    margin: 0;
    font-size: 20px;
}

.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;
}

.header-city-select-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    display: none;
    width: max(100%, 320px);
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.header-city-select.is-open .header-city-select-menu {
    display: grid;
    gap: 2px;
}

.header-city-select-search {
    position: sticky;
    top: 0;
    z-index: 1;
    margin-bottom: 4px;
    min-width: 0;
}

.header-city-select-menu button {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 0 10px;
    justify-content: flex-start;
    font-weight: 400;
    text-align: left;
    white-space: normal;
}

.header-city-select-menu button:hover {
    background: var(--surface-soft);
}

.btn-primary,
.header-search button,
.search-panel button,
.form-grid button {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.header-search button:hover,
.search-panel button:hover,
.form-grid button:hover {
    background: var(--primary-dark);
}

.header-search .header-city-select-toggle,
.header-search .header-city-select-toggle:hover,
.header-search .header-city-select-menu button {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.header-search .header-city-select-menu button:hover {
    background: var(--surface-soft);
    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);
}

.hero-grid {
    min-height: 330px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 46px 0;
}

.hero-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
}

.hero-copy p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 18px;
    max-width: none;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) auto;
    gap: 10px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.hero-card,
.panel,
.auth-card,
.stat-card,
.ad-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 28px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.hero-card strong {
    font-size: 24px;
}

.hero-card span {
    color: var(--muted);
}

.section {
    padding: 34px 0;
}

.section-title,
.page-heading,
.admin-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.section-title h1,
.section-title h2,
.page-heading h1,
.admin-header-inner h1 {
    margin: 0;
}

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

.category-item {
    min-height: 76px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 700;
}

.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) 260px;
    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 h2 {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.22;
    font-weight: 400;
}

.home-ad-card h2 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) 320px;
    gap: 22px;
    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 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-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 h2 {
    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);
}

.home-category-list svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.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;
}

.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,
.hero-card > :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;
}

.cabinet-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.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;
}

.ad-upload-drop {
    position: relative;
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 112px;
    padding: 20px;
    border: 1px dashed #b8c5d8;
    border-radius: 8px;
    background: #f8fbff;
    text-align: center;
    cursor: pointer;
}

.ad-upload-drop input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ad-upload-drop span {
    color: var(--primary);
    font-weight: 800;
}

.ad-upload-drop small {
    color: var(--muted);
}

.ad-upload-drop.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.ad-upload-drop.is-disabled input[type="file"] {
    cursor: not-allowed;
}

.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;
}

.danger-block {
    border-color: #ffd2d2;
}

.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);
}

.finance-filter-form {
    display: grid;
    grid-template-columns: 150px 150px 160px minmax(160px, 1fr) 140px;
    gap: 10px;
    align-items: end;
    margin: 16px 0;
}

.finance-filter-form label,
.finance-methods {
    display: grid;
    gap: 6px;
}

.finance-summary-panel h2 {
    margin-bottom: 18px;
}

.finance-summary-panel .details-grid {
    grid-template-columns: repeat(3, minmax(0, 180px));
    gap: 12px;
    margin-bottom: 18px;
}

.finance-summary-panel .details-grid div {
    min-height: 72px;
}

.finance-filter-form input,
.finance-filter-form select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    font: inherit;
}

.finance-filter-form button {
    width: 100%;
    min-height: 44px;
}

.finance-methods {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
}

.finance-primary-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

.finance-primary-row label {
    display: grid;
    gap: 6px;
}

.finance-tax-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
}

.finance-tax-row label {
    display: grid;
    gap: 6px;
}

.admin-user-profile-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.balance-adjust-form {
    display: grid;
    grid-template-columns: 180px 180px minmax(260px, 1fr) 180px;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.balance-adjust-form label {
    display: grid;
    gap: 6px;
}

.balance-adjust-form input,
.balance-adjust-form select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
}

.balance-adjust-form button {
    min-height: 44px;
}

.user-edit-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) 180px;
    gap: 10px;
    align-items: end;
}

.user-edit-form label {
    display: grid;
    gap: 6px;
}

.user-edit-form input,
.user-edit-form select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
}

.user-edit-form button {
    min-height: 44px;
}

.table-wrap {
    overflow-x: auto;
}

.ads-list-wrap {
    overflow: visible;
}

.ads-list {
    width: 100%;
    display: grid;
}

.ads-admin-list {
    min-width: 0;
}

.cabinet-ads-list {
    min-width: 0;
}

.ads-list-head,
.ads-list-row {
    display: grid;
    align-items: center;
    column-gap: 10px;
    border-bottom: 1px solid var(--border);
}

.ads-list-head {
    min-height: 48px;
    color: var(--muted);
    font-weight: 700;
}

.ads-list-row {
    min-height: 72px;
}

.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;
}

.ads-admin-row > div:nth-child(2) {
    text-align: right;
}

.ads-admin-row > div:nth-child(1),
.ads-admin-row > div:nth-child(3) {
    justify-self: center;
}

.ads-admin-row > div:nth-child(8),
.ads-admin-row > div:nth-child(9),
.ads-admin-row .ads-list-actions {
    justify-self: start;
}

.cabinet-ads-row {
    grid-template-columns:
        22px
        34px
        56px
        minmax(0, 1.65fr)
        minmax(0, 1fr)
        minmax(0, 1.15fr)
        132px
        126px;
}

.cabinet-ads-row > div:nth-child(2) {
    text-align: right;
}

.cabinet-ads-row > div:nth-child(1),
.cabinet-ads-row > div:nth-child(3) {
    justify-self: center;
}

.cabinet-ads-row > div:nth-child(7),
.cabinet-ads-row > div:nth-child(8),
.cabinet-ads-row .ads-list-actions {
    justify-self: start;
}

.ads-check-cell {
    justify-self: center;
}

.ads-list-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ads-list-actions,
.ads-list-pagination {
    justify-self: start;
}

.ads-list-empty {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th:last-child,
td:last-child {
    width: auto;
}

.faq-table th,
.faq-table td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    vertical-align: top;
    line-height: 1.45;
}

.faq-table code {
    white-space: nowrap;
}

.col-id {
    width: 96px;
}

.col-check {
    width: 44px;
}

.col-count {
    width: 96px;
}

.col-name {
    width: 24%;
}

.col-parent {
    width: 22%;
}

.col-slug {
    width: 18%;
}

.col-status {
    width: 120px;
}

.col-actions {
    width: 180px;
}

.cabinet-ads-table .col-id,
.ads-admin-table .col-id {
    width: 46px;
}

.cabinet-ads-table .col-preview,
.ads-admin-table .col-preview {
    width: 68px;
}

.cabinet-ads-table .col-title {
    width: 28%;
}

.cabinet-ads-table .col-category {
    width: 18%;
}

.cabinet-ads-table .col-city {
    width: 24%;
}

.cabinet-ads-table .col-status {
    width: 130px;
}

.cabinet-ads-table .col-actions {
    width: 126px;
}

.ads-admin-table .col-title {
    width: 24%;
}

.ads-admin-table .col-city {
    width: 170px;
}

.ads-admin-table .col-contact {
    width: 90px;
}

.ads-admin-table .col-phone {
    width: 110px;
}

.ads-admin-table .col-count {
    width: 52px;
}

.ads-admin-table .col-status {
    width: 130px;
}

.ads-admin-table .col-actions {
    width: 220px;
}

.table-ad-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: var(--surface-soft);
}

.admin-ad-edit-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}

.admin-ad-edit-images figure {
    position: relative;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.admin-ad-edit-images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.admin-ad-edit-images .image-delete-form {
    position: absolute;
    top: 1px;
    right: 0;
    z-index: 3;
}

.admin-ad-edit-images .image-delete-form .image-remove-button {
    position: static;
}

.admin-image-replace-form {
    position: absolute;
    right: 0;
    bottom: 1px;
    z-index: 3;
}

.admin-image-replace-form label {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    min-height: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: var(--primary);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
}

.admin-image-replace-form label:hover {
    background: #d1d5db;
}

.admin-image-replace-form span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.admin-image-replace-form svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-image-replace-form input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.categories-table .col-id {
    width: 70px;
}

.categories-table .col-name {
    width: 25%;
}

.categories-table .col-parent {
    width: 22%;
}

.categories-table .col-count {
    width: 95px;
}

.categories-table .col-slug {
    width: 22%;
}

.categories-table .col-status {
    width: 110px;
}

.categories-table .col-actions,
.countries-table .col-actions {
    width: 200px;
}

.categories-table .admin-pagination.inline,
.countries-table .admin-pagination.inline,
.ads-admin-table .admin-pagination.inline,
.ads-admin-list .admin-pagination.inline {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    margin: 0;
    min-width: 0;
}

.users-table .col-id {
    width: 70px;
}

.users-table .col-role {
    width: 80px;
}

.users-table .col-login {
    width: 28%;
}

.users-table .col-status {
    width: 140px;
}

.users-table .col-date {
    width: 190px;
}

.users-table .col-actions {
    width: 140px;
}

.role-badge {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.role-badge svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bulk-form {
    display: grid;
    gap: 8px;
}

.admin-live-search {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    margin: 0 0 12px;
}

.admin-live-search label {
    display: grid;
    gap: 5px;
    min-width: min(100%, 340px);
    font-size: 13px;
    color: var(--muted);
}

.admin-live-search input[type="search"],
.admin-live-search select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--panel);
    color: var(--text);
}

[data-admin-live-results].is-loading {
    opacity: .65;
    pointer-events: none;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
}

.bulk-actions .btn-primary {
    margin-left: auto;
}

.bulk-actions .btn {
    min-height: 36px;
}

.ads-bulk-actions {
    margin: 0 0 10px;
}

.ads-bulk-actions .btn-primary {
    margin-left: 0;
}

.ads-bulk-actions .per-page-select,
.ads-bulk-actions .admin-pagination.inline {
    margin-left: auto;
}

.ads-bulk-actions select {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--panel);
    color: var(--text);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 15px;
}

.details-grid div {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg);
}

.details-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.details-grid strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.admin-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.admin-section-head h2 {
    margin: 0;
}

.admin-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.admin-section-head > .btn:only-child {
    margin-left: auto;
}

.row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.ads-list .row-actions {
    justify-content: flex-start;
}

.row-actions form {
    margin: 0;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--surface-soft);
}

.icon-btn.danger {
    color: var(--danger);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ads-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(120px, 160px)) 90px 100px;
    gap: 8px;
    align-items: end;
    margin: 0 0 10px;
}

.ads-filter-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
}

.ads-filter-form input,
.ads-filter-form select {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    font: inherit;
    color: var(--text);
}

.ads-filter-form .btn {
    min-height: 38px;
    padding: 0 12px;
}

.admin-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-pagination.inline {
    margin: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
}

.admin-pagination.table-pagination {
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin: 14px 0 0;
}

.admin-pagination.table-pagination .per-page-select {
    order: 2;
    margin-left: auto;
}

.admin-pagination.table-pagination .pagination-carousel {
    order: 1;
    width: auto;
    flex: 0 1 auto;
    grid-template-columns: 38px minmax(0, auto) 38px;
    margin: 0 auto;
}

.admin-pagination.table-pagination .pagination-carousel .pages {
    flex: 0 1 auto;
    max-width: min(520px, 52vw);
}

.admin-pagination.head {
    margin: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.pages {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-carousel {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.pagination-carousel .pages {
    min-height: 46px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 0 0 8px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.pagination-carousel-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    margin-top: 0;
}

.pagination-carousel-btn:disabled {
    opacity: .35;
    cursor: default;
}

.pages a {
    min-width: 34px;
    min-height: 34px;
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pages a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.per-page-select {
    margin-left: auto;
    min-width: 150px;
}

.per-page-select label,
.admin-pagination.inline label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 400;
    white-space: nowrap;
}

.per-page-select select,
.admin-pagination.inline select,
.per-page-control {
    width: 110px;
    height: 44px;
    flex: 0 0 110px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 0 36px 0 16px;
    font: inherit;
    color: var(--text);
    font-size: 16px;
}

.admin-form-panel {
    max-width: 720px;
}

.admin-form-panel-wide {
    max-width: none;
    width: 100%;
}

.settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
}

.settings-form button {
    grid-column: 1 / -1;
}

.settings-form .ads-seo-heading {
    margin: 18px 0 -6px;
}

.settings-image-upload-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px 24px;
    align-items: end;
}

.settings-card-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 24px;
    align-items: end;
}

.settings-watermark-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 24px;
    align-items: end;
}

.settings-watermark-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 24px;
    align-items: end;
}

.settings-watermark-top .settings-toggle-row {
    grid-column: auto;
    margin-bottom: 0;
}

.settings-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    border-radius: 4px;
    accent-color: var(--primary);
    flex: 0 0 20px;
}

.settings-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.settings-toggle-row {
    grid-column: 1 / -1;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    flex-direction: row;
    white-space: nowrap;
}

.admin-ad-edit-form .settings-toggle-row {
    display: inline-flex;
}

.settings-checkbox-row {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 44px;
}

.settings-checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.finance-methods label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 18px;
}

.settings-spoiler {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    margin-bottom: 15px;
}

.settings-spoiler summary {
    list-style: none;
    cursor: pointer;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-spoiler summary::-webkit-details-marker {
    display: none;
}

.settings-spoiler summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .15s ease;
}

.settings-spoiler[open] summary::after {
    transform: rotate(225deg);
}

.settings-spoiler .settings-form {
    padding: 0 15px 15px;
}

.content-html {
    line-height: 1.65;
}

.content-html > :first-child {
    margin-top: 0;
}

.home-seo-text {
    margin-top: 28px;
}

.settings-pages {
    display: grid;
    gap: 15px;
    padding: 0 15px 15px;
}

.advertising-settings-form {
    grid-template-columns: 1fr;
}

.advertising-settings-block {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.advertising-settings-head {
    display: block;
}

.advertising-settings-head h3 {
    margin: 0;
    font-size: 18px;
}

.advertising-code-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.page-settings-form {
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.page-settings-form h3 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 20px;
    font-weight: 400;
}

.settings-favicon-row {
    display: grid;
    gap: 10px;
}

.settings-favicon-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
}

.settings-favicon-control {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.settings-favicon-preview {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    overflow: visible;
}

.settings-favicon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 7px;
}

.settings-favicon-preview.is-delete-pending {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .22);
}

.settings-favicon-preview.is-delete-pending img {
    opacity: .35;
    filter: grayscale(1);
}

.settings-form label.settings-image-remove:has(input[type="checkbox"]) {
    position: absolute;
    top: -9px;
    right: -9px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    padding: 0;
    gap: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(17, 24, 39, .22);
}

.settings-form .settings-image-remove input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.settings-form .settings-image-remove span {
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
}

.settings-form .settings-image-remove input:checked + span {
    color: #fff;
}

.settings-favicon-preview.is-delete-pending .settings-image-remove {
    background: #991b1b;
}

.settings-favicon-preview.is-empty::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eef4ff, #fff);
}

.settings-favicon-input {
    display: grid;
    gap: 6px;
    min-width: 0;
    align-content: start;
}

.settings-favicon-input input[type="file"] {
    min-height: 44px;
    padding: 7px 12px;
}

.settings-favicon-input span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.settings-hint {
    color: var(--muted);
}

.ticket-head,
.ticket-admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.ticket-head h2,
.ticket-head p {
    margin-bottom: 0;
}

.ticket-admin-filter {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px 140px;
    gap: 10px;
    align-items: end;
    flex: 1;
}

.ticket-list-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 15px;
}

.ticket-list {
    display: grid;
    gap: 8px;
}

.ticket-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 140px 170px;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.admin-ticket-row {
    grid-template-columns: 70px minmax(0, 1fr) minmax(180px, 240px) 140px 170px;
}

.ticket-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-create {
    margin-bottom: 15px;
}

.ticket-create.is-hidden {
    display: none;
}

.ticket-per-page {
    justify-content: flex-end;
    margin-bottom: 15px;
}

.ticket-form {
    margin-top: 15px;
}

.ticket-thread {
    display: grid;
    gap: 10px;
    margin: 15px 0;
}

.ticket-message {
    max-width: 78%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.ticket-message-client {
    margin-left: auto;
    background: var(--surface-soft);
}

.ticket-message-manager {
    margin-right: auto;
}

.ticket-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.ticket-status-form {
    display: grid;
    grid-template-columns: 180px 160px;
    gap: 10px;
}

.ticket-status-form select,
.ticket-admin-filter input,
.ticket-admin-filter select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    font: inherit;
}

.back-link {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary);
}

.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;
    gap: 18px;
    flex-wrap: wrap;
}

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

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 60;
    width: min(calc(100% - 32px), 620px);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .16);
    display: flex;
    align-items: center;
    gap: 10px;
    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: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.cookie-consent__title {
    margin-bottom: 1px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

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

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

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

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

.admin-body {
    min-height: 100vh;
}

.admin-site-header {
    margin-bottom: 8px;
}

.admin-header-inner {
    min-height: 68px;
    margin-bottom: 0;
}

.admin-header-inner h1 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 28px;
    line-height: 1.15;
}

.admin-site-link {
    color: var(--text);
    white-space: nowrap;
}

.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.admin-sidebar {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 15px;
}

.admin-sidebar nav {
    display: grid;
    gap: 2px;
    margin-top: 0;
}

.admin-sidebar nav a {
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar nav a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge {
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: var(--surface-soft);
    color: var(--primary);
}

.admin-sidebar nav a.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.admin-sidebar nav svg,
.cabinet-sidebar nav svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-main {
    min-width: 0;
    padding: 0 0 30px;
}

.admin-main > .panel {
    margin-top: 0;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    font-size: 34px;
    margin-top: 4px;
}

.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.error-box {
    width: min(520px, 100%);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 36px;
}

.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--primary);
}

@media (max-width: 980px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .hero-grid,
    .search-panel,
    .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,
    .admin-topbar,
    .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,
    .page-heading,
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-grid,
    .ads-grid,
    .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;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 18px, 1280px);
    }

    .header-inner {
        padding: 9px 0;
        gap: 8px;
    }

    .category-grid,
    .ads-grid,
    .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 h2 {
        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-dialog h2 {
        padding-right: 44px;
    }

    .hero-grid {
        min-height: auto;
        padding: 30px 0;
    }

    .cookie-consent {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .cookie-consent__button {
        width: auto;
        margin-left: auto;
    }

    .dashboard {
        padding-top: 8px;
    }

    .panel,
    .admin-topbar,
    .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;
    }

    .admin-topbar {
        gap: 8px;
    }

    .admin-topbar h1,
    .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;
    }
}
