:root {
    --bg: #fbfbfc;
    --surface: #ffffff;
    --surface-subtle: #f6f7f9;
    --text: #0f1424;
    --muted: #71757f;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.08);
    --border: #ececef;
    --border-strong: #e0e1e6;
    --danger: #dc2626;
    --shadow: 0 1px 2px rgba(15, 20, 36, 0.04), 0 4px 16px rgba(15, 20, 36, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 20, 36, 0.05);
    --header-bg: rgba(255, 255, 255, 0.82);
    --radius: 14px;
    --radius-sm: 10px;
    --container-max: 1680px;
    --container-gutter: 24px;
}

html[data-theme="dark"] {
    --bg: #0c0e13;
    --surface: #14171d;
    --surface-subtle: #1b1f27;
    --text: #e7e9ee;
    --muted: #9096a1;
    --primary: #5b8cff;
    --primary-dark: #4f7fef;
    --primary-soft: rgba(91, 140, 255, 0.14);
    --border: #262a33;
    --border-strong: #333845;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(14, 17, 23, 0.82);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: "Inter", "Manrope", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: min(var(--container-max), calc(100% - var(--container-gutter) * 2));
    margin: 0 auto;
}

@media (min-width: 1600px) {
    :root {
        --container-max: 1760px;
        --container-gutter: 32px;
    }
}

.geo-bar {
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
    max-width: 100%;
}

.geo-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 6px 0;
}

.geo-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    padding: 4px 8px;
    margin: 0 -8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.geo-bar-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.geo-bar-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.geo-bar-region,
.geo-bar-city {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geo-bar-region {
    max-width: min(220px, 38vw);
}

.geo-bar-city {
    max-width: min(180px, 32vw);
}

.geo-bar-sep {
    color: var(--muted);
    font-weight: 500;
}

.geo-bar-chevron {
    margin-left: 2px;
    color: var(--muted);
    font-size: 11px;
}

.geo-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.geo-picker-modal[hidden] {
    display: none;
}

.geo-picker-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 36, 0.45);
}

.geo-picker-modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(720px, calc(100% - 24px));
    max-height: min(86vh, 760px);
    margin: 7vh auto 0;
    padding: 18px 18px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.geo-picker-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.geo-picker-modal-close:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.geo-picker-modal-head {
    padding-right: 42px;
}

.geo-picker-modal-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.geo-picker-modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 14px;
}

.geo-picker-browser {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(52vh, 520px);
    overflow: auto;
    margin-top: 14px;
    padding-right: 2px;
}

.geo-picker-browser .region-city-link {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.geo-picker-browser .region-city-link.is-hidden {
    display: none;
}

.geo-picker-browser .region-city-link.is-match {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.geo-picker-browser .geo-region-all {
    font-weight: 700;
}

.home-regions-split {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    min-height: 380px;
}

.home-crm-section {
    padding-top: 0;
    padding-bottom: 32px;
}

.home-crm-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(37, 99, 235, 0.14) 0%, transparent 55%),
        linear-gradient(165deg, var(--surface) 0%, var(--surface-subtle) 100%);
    box-shadow: var(--shadow);
}

.home-crm-panel-glow {
    position: absolute;
    top: -120px;
    left: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.home-crm-panel-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(24px, 4vw, 40px);
    align-items: start;
}

.home-crm-badge {
    display: inline-flex;
    align-items: center;
    margin: 0 0 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-crm-copy h2 {
    margin: 0 0 14px;
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    max-width: 14ch;
}

.home-crm-text {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
    max-width: 46ch;
}

.home-crm-benefits {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.home-crm-benefits li {
    position: relative;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text);
}

.home-crm-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.home-crm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-crm-features-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-crm-features-intro h3 {
    margin: 0 0 8px;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.home-crm-features-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.home-crm-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.home-crm-feature {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    padding: 18px 18px 16px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-crm-feature:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.1);
}

.home-crm-feature-num {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary);
    opacity: 0.85;
}

.home-crm-feature h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.home-crm-feature p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
}

/* --- Главная: Telegram-уведомления --------------------------------------- */
.home-tg-section {
    padding-top: 0;
    padding-bottom: 28px;
}

.home-tg-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        radial-gradient(100% 120% at 100% 0%, rgba(42, 171, 238, 0.14) 0%, transparent 52%),
        linear-gradient(165deg, var(--surface) 0%, var(--surface-subtle) 100%);
    box-shadow: var(--shadow);
}

.home-tg-panel-glow {
    position: absolute;
    top: -80px;
    right: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42, 171, 238, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

.home-tg-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(20px, 3vw, 32px);
    align-items: center;
}

.home-tg-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(42, 171, 238, 0.14);
    color: #229ed9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

html[data-theme="dark"] .home-tg-badge {
    color: #5bc8f5;
    background: rgba(42, 171, 238, 0.18);
}

.home-tg-copy h2 {
    margin: 0 0 10px;
    font-size: clamp(1.2rem, 2.4vw, 1.55rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    max-width: 22ch;
}

.home-tg-text {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.55;
    max-width: 38ch;
}

.home-tg-flow {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(56px, 0.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.home-tg-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: home-tg-search-pulse 3.3s ease-in-out infinite;
}

@keyframes home-tg-search-pulse {
    0%, 72%, 100% { box-shadow: none; }
    10%, 22% { box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.14); }
}

.home-tg-search-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
}

.home-tg-search-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.home-tg-search-query {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.home-tg-stream {
    position: relative;
    height: 24px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 35%, transparent);
    border: 1px dashed color-mix(in srgb, #2aabee 35%, var(--border));
    overflow: hidden;
}

.home-tg-stream::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(42, 171, 238, 0.18), transparent);
    animation: home-tg-stream-shine 2.2s linear infinite;
}

@keyframes home-tg-stream-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.home-tg-packet {
    position: absolute;
    top: 50%;
    left: 2px;
    width: 14px;
    height: 10px;
    margin-top: -5px;
    border-radius: 3px;
    background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
    box-shadow: 0 0 10px rgba(42, 171, 238, 0.45);
    opacity: 0;
    animation: home-tg-packet-flow 3.3s var(--d) infinite ease-in-out;
}

@keyframes home-tg-packet-flow {
    0% { left: 2px; opacity: 0; transform: scale(0.5); }
    10% { opacity: 1; transform: scale(1); }
    88% { opacity: 1; }
    100% { left: calc(100% - 16px); opacity: 0; transform: scale(0.75); }
}

.home-tg-chat {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, #2aabee 28%, var(--border));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.home-tg-chat.is-receiving {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.16), var(--shadow);
}

.home-tg-chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(42, 171, 238, 0.16) 0%, rgba(42, 171, 238, 0.06) 100%);
    border-bottom: 1px solid color-mix(in srgb, #2aabee 18%, var(--border));
}

.home-tg-chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2aabee;
    color: #fff;
}

.home-tg-chat-title {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
}

.home-tg-chat-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: hero-live-pulse 2s ease-in-out infinite;
}

.home-tg-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    min-height: 118px;
}

.home-tg-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px 10px 10px 4px;
    background: color-mix(in srgb, #2aabee 12%, var(--surface-subtle));
    border: 1px solid color-mix(in srgb, #2aabee 16%, transparent);
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    animation: home-tg-msg-in 3.3s calc(0.55s + var(--i) * 1.1s) infinite ease-out;
}

.home-tg-msg strong {
    font-size: 11px;
    line-height: 1.25;
    color: var(--text);
}

.home-tg-msg span {
    font-size: 10px;
    color: var(--muted);
}

@keyframes home-tg-msg-in {
    0%, 6% { opacity: 0; transform: translateY(8px) scale(0.96); }
    14%, 78% { opacity: 1; transform: translateY(0) scale(1); }
    88%, 100% { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

@media (max-width: 960px) {
    .home-tg-grid {
        grid-template-columns: 1fr;
    }

    .home-tg-copy h2 {
        max-width: none;
    }

    .home-tg-flow {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .home-tg-stream {
        order: 2;
        min-height: 24px;
    }

    .home-tg-chat {
        order: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-tg-packet,
    .home-tg-msg,
    .home-tg-search,
    .home-tg-stream::before,
    .home-tg-chat-live {
        animation: none;
    }

    .home-tg-msg {
        opacity: 1;
        transform: none;
    }
}

.home-referrals-section {
    padding-top: 8px;
    padding-bottom: 48px;
}

.home-referrals-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(120% 140% at 0% 100%, rgba(16, 185, 129, 0.14) 0%, transparent 55%),
        linear-gradient(165deg, var(--surface) 0%, var(--surface-subtle) 100%);
    box-shadow: var(--shadow);
}

.home-referrals-panel-glow {
    position: absolute;
    top: -100px;
    right: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.home-referrals-panel-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(24px, 4vw, 40px);
    align-items: start;
}

.home-referrals-badge {
    display: inline-flex;
    align-items: center;
    margin: 0 0 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-referrals-copy h2 {
    margin: 0 0 14px;
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    max-width: 18ch;
}

.home-referrals-text {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
    max-width: 48ch;
}

.home-referrals-benefits {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.home-referrals-benefits li {
    position: relative;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text);
}

.home-referrals-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.home-referrals-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-referrals-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.home-referrals-feature {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    padding: 18px 18px 16px;
    border: 1px solid rgba(16, 185, 129, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-referrals-feature:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.32);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
}

.home-referrals-feature-num {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #059669;
}

.home-referrals-feature h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.home-referrals-feature p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
}

.home-regions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-right: 1px solid var(--border);
    background: var(--surface-subtle);
    overflow-y: auto;
    max-height: 520px;
}

.home-region-pick {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.home-region-pick:hover,
.home-region-pick.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.home-region-pick.is-filtered-out {
    display: none;
}

.home-regions-cities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
    overflow-y: auto;
    max-height: 520px;
    padding: 14px;
}

.home-regions-cities .region-city-link-all {
    grid-column: 1 / -1;
    font-weight: 700;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(180%) blur(16px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    max-width: 100%;
}

.header-inner,
.header-shell {
    padding: 10px 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.header-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.header-notifications {
    position: relative;
    flex: 0 0 auto;
}

.header-notifications--geo-bar {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.header-notifications--geo-bar .header-notifications-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    color: var(--muted);
}

.header-notifications--geo-bar .header-notifications-btn:hover,
.header-notifications--geo-bar .header-notifications-btn[aria-expanded="true"] {
    color: var(--primary);
    background: var(--primary-soft);
}

.header-notifications--geo-bar .header-notifications-panel {
    right: 0;
    left: auto;
}

.header-notifications-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.header-notifications-btn:hover,
.header-notifications-btn[aria-expanded="true"] {
    background: rgba(15, 20, 36, 0.06);
}

.header-notifications-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.header-notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    width: min(360px, calc(100vw - 24px));
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(15, 20, 36, 0.14);
}

.header-notifications-panel[hidden] {
    display: none !important;
}

.header-notifications-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.header-notifications-list {
    overflow: auto;
    padding: 6px;
}

.header-notifications-empty {
    padding: 16px 12px;
    text-align: center;
}

.header-notifications-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}

.header-notifications-item:hover {
    background: rgba(15, 20, 36, 0.05);
}

.header-notifications-item.is-unread {
    background: rgba(37, 99, 235, 0.08);
}

.header-notifications-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
}

.header-notifications-item__meta {
    font-size: 0.75rem;
    color: var(--muted);
}

.site-nav {
    margin-top: 20px;
    margin-bottom: 12px;
    max-width: 100%;
}

.site-nav-inner {
    padding-left: 0;
    padding-right: 0;
    min-width: 0;
}

.header-nav-track {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-link-compact {
    padding: 6px 10px;
    white-space: nowrap;
}

body.page-listing-detail .header-shell {
    padding: 8px 0;
}

body.page-listing-detail .site-nav {
    margin-top: 14px;
    margin-bottom: 8px;
}

.header-subscriptions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
}

.header-sub-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 220px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.header-sub-badge:hover,
.header-sub-badge:focus-visible {
    background: rgba(37, 99, 235, 0.14);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    outline: none;
}

.header-sub-badge--api {
    border-color: color-mix(in srgb, #7c5cff 30%, var(--border));
    background: rgba(124, 92, 255, 0.1);
    color: #6d28d9;
}

.header-sub-badge--api:hover,
.header-sub-badge--api:focus-visible {
    background: rgba(124, 92, 255, 0.16);
}

.header-sub-badge__icon {
    flex-shrink: 0;
}

.header-sub-badge__label {
    display: none;
}

.header-sub-badge__desktop {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.header-sub-badge__mobile {
    display: none;
}

.header-sub-badge__tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 30;
    width: max-content;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    box-shadow: var(--shadow);
}

.header-sub-badge__tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: var(--text);
}

.header-sub-badge:hover .header-sub-badge__tooltip,
.header-sub-badge:focus-visible .header-sub-badge__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

html[data-theme="dark"] .header-sub-badge--api {
    color: #a78bfa;
}

@media (max-width: 720px) {
    .header-sub-badge {
        max-width: none;
        padding: 5px 8px;
        gap: 4px;
    }

    .header-sub-badge__desktop {
        display: none;
    }

    .header-sub-badge__mobile {
        display: inline;
        font-variant-numeric: tabular-nums;
    }
}

body.page-listing-detail .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 11px;
}

body.page-listing-detail .brand-text {
    font-size: 15px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link.active,
.nav-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.hero {
    padding: 72px 0 40px;
}

/* --- Главная: hero с фоном недвижимости справа --------------------------- */
.hero--home {
    padding: clamp(20px, 3vw, 32px) 0 clamp(24px, 4vw, 40px);
}

.hero-home-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    min-height: clamp(420px, 52vh, 560px);
    display: flex;
    align-items: center;
    padding: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 40px);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-bg__media {
    position: absolute;
    inset: 0;
}

.hero-bg__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 72% center;
}

html[data-theme="light"] .hero-bg__media img {
    opacity: 1;
}

html[data-theme="dark"] .hero-bg__media img {
    opacity: 0.62;
    filter: saturate(0.8) brightness(0.65) contrast(1.05);
}

.hero-bg__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        102deg,
        var(--bg) 0%,
        var(--bg) 34%,
        color-mix(in srgb, var(--bg) 94%, transparent) 44%,
        color-mix(in srgb, var(--bg) 72%, transparent) 54%,
        color-mix(in srgb, var(--bg) 28%, transparent) 66%,
        transparent 78%
    );
}

html[data-theme="dark"] .hero-bg__gradient {
    background: linear-gradient(
        102deg,
        var(--bg) 0%,
        var(--bg) 32%,
        color-mix(in srgb, var(--bg) 96%, transparent) 42%,
        color-mix(in srgb, var(--bg) 82%, transparent) 52%,
        color-mix(in srgb, var(--bg) 48%, transparent) 64%,
        color-mix(in srgb, var(--bg) 12%, transparent) 76%,
        transparent 88%
    );
}

.hero-bg__mesh {
    position: absolute;
    right: -8%;
    top: -25%;
    width: 58%;
    height: 150%;
    background:
        radial-gradient(ellipse 80% 60% at 65% 35%, rgba(37, 99, 235, 0.22) 0%, transparent 62%),
        radial-gradient(ellipse 50% 40% at 90% 70%, rgba(99, 102, 241, 0.12) 0%, transparent 55%);
    opacity: 0.9;
}

html[data-theme="dark"] .hero-bg__mesh {
    background:
        radial-gradient(ellipse 80% 60% at 65% 35%, rgba(91, 140, 255, 0.28) 0%, transparent 62%),
        radial-gradient(ellipse 50% 40% at 90% 70%, rgba(129, 140, 248, 0.16) 0%, transparent 55%);
    opacity: 1;
}

.hero-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(102deg, transparent 38%, rgba(0, 0, 0, 0.35) 58%, black 78%);
    -webkit-mask-image: linear-gradient(102deg, transparent 38%, rgba(0, 0, 0, 0.35) 58%, black 78%);
}

html[data-theme="dark"] .hero-bg__grid {
    background-image:
        linear-gradient(rgba(91, 140, 255, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 140, 255, 0.14) 1px, transparent 1px);
}

.hero-bg__scan {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(37, 99, 235, 0.04) 48%,
        rgba(37, 99, 235, 0.08) 50%,
        rgba(37, 99, 235, 0.04) 52%,
        transparent 100%
    );
    background-size: 100% 220%;
    animation: hero-scan 9s ease-in-out infinite;
    mask-image: linear-gradient(102deg, transparent 42%, black 72%);
    -webkit-mask-image: linear-gradient(102deg, transparent 42%, black 72%);
    opacity: 0.55;
}

html[data-theme="dark"] .hero-bg__scan {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(91, 140, 255, 0.06) 48%,
        rgba(91, 140, 255, 0.14) 50%,
        rgba(91, 140, 255, 0.06) 52%,
        transparent 100%
    );
    background-size: 100% 220%;
    opacity: 0.7;
}

@keyframes hero-scan {
    0%, 100% { background-position: 0 -120%; }
    50% { background-position: 0 120%; }
}

.hero-bg__glow {
    position: absolute;
    bottom: -35%;
    right: 0;
    width: 55%;
    height: 75%;
    background: radial-gradient(circle at 60% 40%, rgba(37, 99, 235, 0.16) 0%, transparent 68%);
}

html[data-theme="dark"] .hero-bg__glow {
    background: radial-gradient(circle at 60% 40%, rgba(91, 140, 255, 0.22) 0%, transparent 68%);
}

.hero--home .hero-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0;
}

.hero-copy {
    max-width: none;
}

.hero-glass {
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    border: 1px solid color-mix(in srgb, var(--border) 55%, var(--primary) 18%);
    border-radius: 18px;
    box-shadow:
        var(--shadow),
        inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
}

html[data-theme="dark"] .hero-glass {
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    border-color: color-mix(in srgb, var(--border) 50%, var(--primary) 28%);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
}

.hero-eyebrow {
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero--home h1 {
    text-wrap: balance;
    max-width: none;
}

.hero--home .lead {
    max-width: 36rem;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(16px, 2.5vw, 20px);
}

.hero-ingest {
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-subtle) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.hero-ingest__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.hero-ingest__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-ingest__live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #22c55e;
}

.hero-ingest__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: hero-live-pulse 2s ease-in-out infinite;
}

@keyframes hero-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

.hero-ingest__lane {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.55fr) auto;
    align-items: center;
    gap: 8px;
}

.hero-ingest__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.hero-ingest__pill {
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
    animation: hero-pill-pulse 3.6s calc(var(--i) * 0.9s) infinite ease-in-out;
}

@keyframes hero-pill-pulse {
    0%, 78%, 100% {
        color: var(--muted);
        border-color: color-mix(in srgb, var(--border) 85%, transparent);
        box-shadow: none;
    }
    8%, 18% {
        color: var(--primary);
        border-color: color-mix(in srgb, var(--primary) 45%, transparent);
        box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 25%, transparent);
    }
}

.hero-ingest__track {
    position: relative;
    height: 22px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 40%, transparent);
    border: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
    overflow: hidden;
}

.hero-ingest__track::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 12%, transparent), transparent);
    animation: hero-track-shine 2.4s linear infinite;
}

@keyframes hero-track-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hero-ingest__packet {
    position: absolute;
    top: 50%;
    left: 4px;
    width: 12px;
    height: 8px;
    margin-top: -4px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, #818cf8) 100%);
    box-shadow: 0 0 8px color-mix(in srgb, var(--primary) 45%, transparent);
    opacity: 0;
    animation: hero-packet-flow 3.6s var(--d) infinite ease-in-out;
}

@keyframes hero-packet-flow {
    0% { left: 2px; opacity: 0; transform: scale(0.5); }
    8% { opacity: 1; transform: scale(1); }
    88% { opacity: 1; }
    100% { left: calc(100% - 14px); opacity: 0; transform: scale(0.7); }
}

.hero-ingest__target {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 64px;
    padding: 6px 8px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-soft) 80%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-ingest__target.is-receiving {
    transform: scale(1.04);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.hero-ingest__db-icon {
    display: flex;
    color: var(--primary);
}

.hero-ingest__counter {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    line-height: 1.1;
}

.hero-ingest__caption {
    margin: 10px 0 0;
    font-size: 10px;
    line-height: 1.4;
    color: var(--muted);
    text-align: center;
}

.hero-card--stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.hero-card--stats .hero-stat {
    padding: 12px 10px;
    background: color-mix(in srgb, var(--surface-subtle) 65%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.hero-card--stats .hero-stat-value {
    font-size: 22px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-card--stats .hero-stat-label {
    font-size: 11px;
    line-height: 1.25;
}

@media (max-width: 960px) {
    .hero-ingest__lane {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-ingest__track {
        order: 2;
    }

    .hero-ingest__target {
        order: 3;
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .hero-card--stats {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-ingest__packet,
    .hero-ingest__pill,
    .hero-ingest__track::before,
    .hero-ingest__live-dot {
        animation: none;
    }
}

@media (max-width: 960px) {
    .hero-home-shell {
        min-height: 0;
        padding: 32px 20px 28px;
        border-radius: 20px;
    }

    .hero--home {
        padding-top: 16px;
        padding-bottom: 20px;
    }

    .hero-bg__media img {
        object-position: 68% 28%;
    }

    .hero-bg__gradient {
        background: linear-gradient(
            180deg,
            var(--bg) 0%,
            color-mix(in srgb, var(--bg) 92%, transparent) 38%,
            color-mix(in srgb, var(--bg) 55%, transparent) 58%,
            transparent 100%
        );
    }

    html[data-theme="dark"] .hero-bg__gradient {
        background: linear-gradient(
            180deg,
            var(--bg) 0%,
            color-mix(in srgb, var(--bg) 94%, transparent) 36%,
            color-mix(in srgb, var(--bg) 70%, transparent) 56%,
            transparent 100%
        );
    }

    .hero-bg__grid,
    .hero-bg__scan {
        mask-image: linear-gradient(180deg, transparent 30%, black 65%);
        -webkit-mask-image: linear-gradient(180deg, transparent 30%, black 65%);
    }

    .hero--home h1 {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg__scan {
        animation: none;
        opacity: 0;
    }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
}

h1,
h2 {
    margin: 0 0 12px;
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 700;
}

h1 {
    font-size: clamp(30px, 4.5vw, 46px);
}

h2 {
    font-size: clamp(22px, 3vw, 30px);
}

.lead,
.muted {
    color: var(--muted);
}

.text-error {
    color: var(--danger, #d64545);
}

.lead {
    font-size: 18px;
    line-height: 1.6;
    max-width: 620px;
}

.hero-card {
    display: grid;
    gap: 16px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 12px;
    background: var(--surface-subtle);
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 800;
}

.hero-stat-label,
.small {
    font-size: 13px;
}

.section {
    padding: 24px 0 48px;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.page-head-compact {
    margin-bottom: 20px;
}

.page-head-compact h2 {
    margin: 0 0 6px;
}

.city-search-panel {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.city-search-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.city-search-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
    outline: none;
}

.city-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.city-search-hint {
    margin: 8px 0 0;
    font-size: 13px;
}

.regions-browser {
    display: grid;
    gap: 10px;
}

.region-group {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
}

.region-group.is-filtered-out {
    display: none;
}

.region-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.region-group-head::-webkit-details-marker {
    display: none;
}

.region-group-head::after {
    content: '▾';
    color: var(--muted);
    transition: transform 0.15s ease;
}

.region-group[open] .region-group-head::after {
    transform: rotate(180deg);
}

.region-group-title {
    font-size: 15px;
}

.region-cities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 0 12px 14px;
}

.region-city-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.region-city-link:hover {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.12);
}

.region-city-link.is-match {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
    font-weight: 700;
}

.region-city-link.is-hidden {
    display: none;
}

.region-city-link-empty {
    grid-column: 1 / -1;
    color: var(--muted);
}

.city-search-empty {
    margin-top: 16px;
    text-align: center;
}

.city-chip,
.chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.city-chip:hover,
.chip-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-subtle);
    border-color: var(--border-strong);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.parser-page-head-inner h1,
#parser-seo-headline {
    margin: 0;
    font-size: clamp(1.125rem, 2.4vw, 1.5rem);
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.parser-seo-text {
    margin: 10px 0 0;
    max-width: 72ch;
    font-size: 14px;
    line-height: 1.6;
}

#parser-page-head {
    flex: 1 1 auto;
    min-width: 0;
}

.filters-card,
.table-wrap,
.empty-state,
.alert {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filters-card {
    padding: 20px;
    margin-bottom: 20px;
}

.deal-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.deal-tabs.deal-tabs--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filters-toggle-wrap {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.filters-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Кнопка фильтров на одной строке с разделами «Продажа/Аренда» */
.search-toolbar {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
}

.search-toolbar .deal-tabs {
    flex: 1 1 auto;
    margin-bottom: 0;
}

.search-toolbar .filters-toggle-wrap {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.search-toolbar .filters-toggle-btn {
    height: 100%;
    min-height: 44px;
}

/* Бейдж-счётчик активных фильтров (как у уведомлений) */
.filters-toggle-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--primary);
}

.filters-toggle-badge[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .search-toolbar {
        flex-wrap: wrap;
    }

    .search-toolbar .deal-tabs {
        flex: 1 1 100%;
    }

    .search-toolbar .filters-toggle-wrap {
        flex: 1 1 100%;
    }

    .search-toolbar .filters-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

.filters-toggle-icon {
    font-size: 14px;
    line-height: 1;
}

.filters-collapsible {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filters-collapsible.is-collapsed {
    display: none;
}

.filters-collapsible .filters-actions {
    margin-top: 0;
}

/* ── Фильтры как выезжающее слева меню (как корзина в интернет-магазине) ── */
.filters-toggle-glyph {
    flex-shrink: 0;
}

.filters-card--drawer .filters-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 20, 36, 0.45);
    backdrop-filter: blur(1px);
    animation: filters-drawer-fade 0.2s ease;
}

.filters-card--drawer .filters-drawer-backdrop[hidden] {
    display: none;
}

@keyframes filters-drawer-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.filters-card--drawer .filters-collapsible {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1210;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: min(440px, 92vw);
    height: 100vh;
    height: 100dvh;
    padding: 0;
    background: var(--surface);
    box-shadow: 0 0 50px rgba(15, 20, 36, 0.28);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
}

.filters-card--drawer .filters-collapsible.is-collapsed {
    display: flex;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

.filters-card--drawer .filters-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.filters-card--drawer .filters-drawer-head strong {
    font-size: 1.05rem;
}

.filters-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.filters-drawer-close:hover {
    color: var(--text);
    background: rgba(15, 20, 36, 0.05);
}

.filters-card--drawer .tags-filter-bar,
.filters-card--drawer .filters-grid {
    padding-left: 18px;
    padding-right: 18px;
}

.filters-card--drawer .tags-filter-bar {
    padding-top: 16px;
}

.filters-card--drawer .filters-grid {
    grid-template-columns: 1fr 1fr;
    margin-top: 14px;
}

.filters-card--drawer .filters-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: auto;
    padding: 14px 18px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

body.filters-drawer-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .filters-card--drawer .filters-grid {
        grid-template-columns: 1fr;
    }
}

.deal-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    font-weight: 600;
    cursor: pointer;
}

.deal-tab input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.deal-tab.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--primary);
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.filters-card [data-filter-field][hidden],
.filters-card [data-filter-field].is-filter-hidden,
.filters-card #district-field[hidden],
.filters-card #district-field.is-filter-hidden,
.filters-card #metro-field[hidden],
.filters-card #metro-field.is-filter-hidden {
    display: none !important;
}

.field span {
    color: var(--muted);
    font-weight: 600;
}

.field input,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.field textarea {
    width: 100%;
    min-height: 130px;
    padding: 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea::placeholder {
    color: var(--muted);
}

.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.contact-captcha {
    margin: 4px 0;
}

/* На мобильных iOS зумит при фокусе, если размер шрифта поля < 16px */
@media (max-width: 768px) {
    .field input,
    .field select,
    .field textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    input[type="url"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px;
    }
}

.price-mask-input {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.field-searchable .searchable-select {
    position: relative;
}

.searchable-select {
    position: relative;
    display: block;
    width: 100%;
}

.searchable-select.is-open {
    z-index: 40;
}

.searchable-select-native {
    display: none;
}

.searchable-select-trigger {
    width: 100%;
    min-height: 44px;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.searchable-select-trigger::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.searchable-select.is-open .searchable-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.searchable-select.is-disabled .searchable-select-trigger {
    opacity: 0.55;
    cursor: not-allowed;
}

.searchable-select-dropdown {
    position: absolute;
    z-index: 200;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.searchable-select-search {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    font: inherit;
    outline: none;
}

.searchable-select-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 260px;
    overflow: auto;
}

.searchable-select-list li {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.searchable-select-list li[data-value]:hover,
.searchable-select-list li.is-active {
    background: rgba(37, 99, 235, 0.08);
}

.searchable-select-list li.is-selected {
    color: var(--primary);
    font-weight: 700;
}

.searchable-select-empty {
    padding: 12px;
    cursor: default;
}

.field-metro .metro-multiselect {
    position: relative;
}

.field-metro-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.metro-clear-all-link {
    font-size: 13px;
    padding: 0;
}

.metro-multiselect-trigger {
    width: 100%;
    min-height: 44px;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.metro-multiselect-trigger::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.metro-multiselect.is-open .metro-multiselect-trigger,
.metro-multiselect:has(.metro-multiselect-dropdown:not([hidden])) .metro-multiselect-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.metro-multiselect-dropdown {
    position: absolute;
    z-index: 35;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.metro-multiselect-search {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    font: inherit;
    outline: none;
}

.metro-multiselect-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.02);
}

.metro-multiselect-toolbar .metro-clear-all-btn {
    font-size: 13px;
    padding: 0;
    white-space: nowrap;
}

.metro-multiselect-list {
    max-height: 320px;
    overflow: auto;
    padding: 8px;
}

.metro-line-group + .metro-line-group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.metro-line-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font-size: 13px;
}

.metro-line-head:hover {
    background: rgba(37, 99, 235, 0.06);
}

.metro-line-head.is-selected {
    background: rgba(37, 99, 235, 0.1);
}

.metro-line-head.is-partial {
    background: rgba(37, 99, 235, 0.05);
}

.metro-line-action {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.metro-line-head:hover .metro-line-action,
.metro-line-head.is-selected .metro-line-action,
.metro-line-head.is-partial .metro-line-action {
    opacity: 1;
}

.metro-line-dot,
.metro-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 10px;
}

.metro-station-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.metro-station-option:hover {
    background: rgba(37, 99, 235, 0.06);
}

.metro-station-option.is-selected {
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

.metro-station-option.is-selected::after {
    content: '✓';
    margin-left: auto;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.metro-multiselect-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.metro-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    font-size: 13px;
    font-weight: 600;
}

.metro-chip button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.metro-multiselect-empty {
    padding: 14px;
}

.metro-multiselect-city {
    font-weight: 500;
}

.filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.quick-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.badge,
.badge-muted {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.badge-muted {
    background: var(--surface-subtle);
    color: var(--muted);
}

.alert {
    padding: 16px 18px;
    margin-bottom: 16px;
}

.alert-error {
    border-color: rgba(217, 45, 32, 0.25);
    background: #fff5f5;
    color: #912018;
}

.table-wrap {
    overflow: auto;
}

.listings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.listings-table th,
.listings-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}

.listings-table th {
    position: sticky;
    top: 0;
    background: var(--surface-subtle);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    z-index: 1;
}

.listing-title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.listing-card-body {
    flex: 1;
    min-width: 0;
}

.listing-card-meta,
.listing-mobile-price {
    display: none;
}

@media (min-width: 961px) {
    .listing-card-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: linear-gradient(180deg, var(--surface) 0%, var(--surface-subtle) 100%);
    }

    .listing-card-specs {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .listing-spec-pill {
        display: inline-flex;
        align-items: center;
        padding: 5px 11px;
        border-radius: 999px;
        background: var(--surface);
        border: 1px solid var(--border);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.3;
        white-space: nowrap;
        color: var(--text);
    }

    .listing-spec-pill.area-tip {
        cursor: help;
    }

    .listing-spec-location {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        min-width: 140px;
    }

    .listing-spec-location .location-city {
        font-size: 13px;
    }

    .listing-spec-location .location-sub {
        margin-top: 0;
    }

    .listing-spec-location .location-line {
        font-size: 12px;
    }

    .listing-thumb-wrap {
        width: 280px;
    }

    .listing-desktop-gallery-wrap {
        display: block;
        width: 100%;
    }

    .listing-desktop-gallery-shell {
        position: relative;
    }

    .listing-desktop-gallery {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 2px;
        scrollbar-width: none;
        padding: 2px;
        border-radius: 14px;
        width: 100%;
        min-width: 0;
    }

    .listing-desktop-gallery::-webkit-scrollbar {
        display: none;
    }

    .listing-desktop-gallery-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        position: relative;
        padding: 0;
        border: 0;
        border-radius: 14px;
        overflow: hidden;
        background: var(--surface-subtle);
        aspect-ratio: 4 / 3;
        cursor: pointer;
        box-shadow: 0 10px 28px rgba(15, 20, 36, 0.12);
    }

    .listing-desktop-gallery-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .listing-gallery-arrow {
        position: absolute;
        top: 50%;
        z-index: 2;
        display: inline-grid;
        place-items: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: rgba(21, 32, 51, 0.72);
        color: #fff;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        transform: translateY(-50%);
        box-shadow: 0 4px 14px rgba(15, 20, 36, 0.18);
        transition: background 0.15s ease, opacity 0.15s ease;
    }

    .listing-gallery-arrow:hover:not(:disabled) {
        background: rgba(21, 32, 51, 0.88);
    }

    .listing-gallery-arrow:disabled {
        opacity: 0.35;
        cursor: default;
    }

    .listing-gallery-arrow-prev {
        left: 10px;
    }

    .listing-gallery-arrow-next {
        right: 10px;
    }

    .listing-desktop-gallery-foot {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-top: 8px;
    }

    .listing-desktop-gallery-indicator {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        background: var(--surface-subtle);
        border: 1px solid var(--border);
        font-size: 12px;
        font-weight: 700;
        color: var(--text);
    }

    .listing-desktop-gallery-placeholder {
        display: grid;
        place-items: center;
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 14px;
        background: var(--surface-subtle);
        color: var(--muted);
        font-weight: 600;
        font-size: 13px;
    }

    .listing-contact-cell {
        min-width: 150px;
    }

    .listing-contact-price {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px dashed var(--border);
    }

    .listing-contact-price strong {
        display: block;
        font-size: 20px;
        line-height: 1.25;
        color: var(--text);
    }

    .listing-contact-price .listing-deposit,
    .listing-contact-price .listing-price-per-sqm {
        line-height: 1.35;
    }

    .listing-price-per-sqm {
        display: block;
    }
}

.listing-thumb-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}

.listing-mobile-dates {
    display: none;
}

.listing-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.3;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.listing-dates span {
    white-space: normal;
}

@media (min-width: 961px) {
    .listing-dates {
        font-size: 13px;
        line-height: 1.35;
    }

    .listing-date-created {
        color: var(--text);
    }

    .listing-date-updated {
        color: var(--muted);
    }
}

.location-cell {
    min-width: 140px;
}

.location-city {
    font-weight: 600;
    line-height: 1.35;
}

.location-sub {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.location-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.35;
}

.location-district {
    font-size: 12px;
}

.listing-contact-cell {
    min-width: 120px;
}

.area-cell {
    min-width: 88px;
}

.area-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.area-value {
    border-bottom: 1px dashed var(--border-strong);
}

.area-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 12;
    display: none;
    min-width: 190px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 13px;
    line-height: 1.45;
}

.area-tooltip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.area-tooltip span {
    display: block;
}

.area-tip:hover .area-tooltip,
.area-tip:focus-within .area-tooltip {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.listing-price-cell {
    min-width: 130px;
    white-space: nowrap;
}

.listing-price-cell strong {
    display: block;
    font-size: 16px;
    line-height: 1.3;
}

.listing-deposit {
    line-height: 1.35;
}

.listing-phone {
    font-weight: 600;
    line-height: 1.35;
}

.phone-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.phone-link:hover {
    text-decoration: underline;
}

.listing-phone-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.listing-phone-masked {
    font: inherit;
    color: inherit;
    cursor: pointer;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

.phone-masked-tail {
    display: inline-block;
    padding: 0 2px;
    border-radius: 4px;
    background: var(--border);
    color: transparent;
    text-shadow: 0 0 0 var(--muted);
    letter-spacing: 0.08em;
}

.badge-phone-protected {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.listing-source-phone-link {
    white-space: normal;
    text-align: left;
    line-height: 1.35;
}

.listing-mobile-contact {
    margin-top: 10px;
}

.listing-mobile-map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.source-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

.address-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.address-link:hover {
    text-decoration: underline;
}

.metro-distance-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.metro-distance-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    border: 1px solid #dbe7ff;
}

.metro-distance-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 20;
    display: none;
    min-width: 210px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #152033;
    color: #fff;
    box-shadow: 0 12px 30px rgba(21, 32, 51, 0.24);
    font-size: 12px;
    line-height: 1.45;
}

.metro-distance-tooltip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.metro-distance-tooltip span {
    display: block;
}

.metro-distance-tip:hover .metro-distance-tooltip,
.metro-distance-tip:focus .metro-distance-tooltip,
.metro-distance-tip:focus-within .metro-distance-tooltip {
    display: block;
}

.listing-detail-dates {
    display: flex;
    gap: 16px;
    margin: 10px 0 18px;
}

.listing-contact-inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.location-cell-inline .location-sub {
    margin-top: 2px;
}

.listing-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    flex: 0 0 auto;
    background: var(--surface-subtle);
}

.listing-thumb-btn {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.listing-thumb-empty,
.listing-thumb.is-broken {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.photo-count {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(21, 32, 51, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.listing-mobile-gallery-wrap,
.listing-mobile-summary,
.listing-mobile-actions {
    display: none;
}

.listing-mobile-gallery-wrap {
    margin: 0 0 12px;
}

.listing-mobile-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x pinch-zoom;
    scrollbar-width: none;
    padding: 2px;
}

.listing-mobile-gallery::-webkit-scrollbar {
    display: none;
}

.listing-mobile-gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    position: relative;
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-subtle);
    aspect-ratio: 4 / 3;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 20, 36, 0.1);
}

.listing-mobile-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.listing-mobile-gallery-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.listing-mobile-gallery-links {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.listing-mobile-gallery-indicator {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.listing-mobile-summary {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.listing-mobile-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.listing-mobile-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.listing-mobile-summary-item-wide {
    grid-column: 1 / -1;
}

.listing-mobile-summary-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.listing-mobile-summary-item strong {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}

.listing-mobile-phone {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.listing-mobile-phone:hover {
    background: rgba(37, 99, 235, 0.14);
}

.listing-mobile-gallery-placeholder {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 16px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 600;
}

.listing-preview {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.link-btn,
.icon-btn {
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.expand-btn-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #bfd4ff;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

.expand-btn-card:hover {
    background: rgba(37, 99, 235, 0.14);
    border-color: #93c5fd;
}

.expand-btn-card[aria-expanded="true"] {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.expand-btn-arrow {
    display: inline-flex;
    font-size: 14px;
    line-height: 1;
}

@media (min-width: 961px) {
    .subline {
        align-items: center;
    }
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.listing-actions-cell {
    width: 56px;
    overflow: visible;
}

.listing-action-stack {
    display: grid;
    gap: 8px;
    justify-items: center;
    overflow: visible;
}

.has-tooltip {
    position: relative;
    z-index: 0;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    max-width: min(240px, 72vw);
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 20, 36, 0.94);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(15, 20, 36, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1050;
}

.has-tooltip::before {
    content: "";
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(15, 20, 36, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1050;
}

.has-tooltip:hover,
.has-tooltip:focus-visible {
    z-index: 1051;
}

.listing-row .has-tooltip:hover,
.listing-row .has-tooltip:focus-visible {
    z-index: 1052;
}

.listings-table tr.listing-row:has(.has-tooltip:hover),
.listings-table tr.listing-row:has(.has-tooltip:focus-visible),
.listing-detail-card:has(.has-tooltip:hover),
.listing-detail-card:has(.has-tooltip:focus-visible) {
    position: relative;
    z-index: 30;
    overflow: visible;
}

.has-tooltip:hover::after,
.has-tooltip:hover::before,
.has-tooltip:focus-visible::after,
.has-tooltip:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

.listing-detail-actions .has-tooltip::after {
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
}

.listing-detail-actions .has-tooltip::before {
    left: 50%;
    top: calc(100% + 2px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(15, 20, 36, 0.94);
    border-right-color: transparent;
}

.expand-btn-card.has-tooltip::after {
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
}

.expand-btn-card.has-tooltip::before {
    left: 50%;
    top: calc(100% + 2px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(15, 20, 36, 0.94);
    border-right-color: transparent;
}

.listing-action-stack .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 100%);
    box-shadow: 0 1px 2px rgba(15, 20, 36, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    color: #334155;
    font-size: 18px;
    line-height: 1;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

.listing-action-stack .icon-btn:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 20, 36, 0.08);
}

.listing-action-stack .icon-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 20, 36, 0.06);
}

.listing-action-stack .expand-btn[aria-expanded="true"] {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.listing-action-stack .mark-btn.is-active.favorite-btn {
    background: #ffe4e6;
    border-color: #f43f5e;
    color: #be123c;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.18);
}

.listing-action-stack .mark-btn.is-active.viewed-btn {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.16);
}

.listing-action-stack .mark-btn.is-active.note-btn {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.listing-action-stack .mark-btn.is-active.callback-btn {
    background: #ffedd5;
    border-color: #f97316;
    color: #c2410c;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.16);
}

.listing-action-stack .mark-btn.is-active.callback-btn.is-due {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.listing-action-stack .mark-btn.is-active.tag-btn,
.listing-row.has-tags .listing-action-stack .tag-btn.is-active,
.listing-detail-card.has-tags .tag-btn.is-active {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.listing-detail-actions .mark-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 100%);
    box-shadow: 0 1px 2px rgba(15, 20, 36, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

.listing-detail-actions .mark-btn:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 20, 36, 0.08);
}

.listing-detail-actions .mark-btn.is-active.favorite-btn {
    background: #ffe4e6;
    border-color: #f43f5e;
    color: #be123c;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.18);
}

.listing-detail-actions .mark-btn.is-active.viewed-btn {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.16);
}

.listing-detail-actions .mark-btn.is-active.note-btn {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.listing-detail-actions .mark-btn.is-active.callback-btn {
    background: #ffedd5;
    border-color: #f97316;
    color: #c2410c;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.16);
}

.listing-detail-actions .mark-btn.is-active.callback-btn.is-due {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.listing-detail-actions .mark-btn.is-active.tag-btn {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

/* Legacy selectors kept for non-stack contexts */
.mark-btn.is-active.favorite-btn {
    background: #ffe4e6;
    border-color: #f43f5e;
    color: #be123c;
}

.mark-btn.is-active.viewed-btn {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.mark-btn.is-active.note-btn {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

.mark-btn.is-active.callback-btn {
    background: #ffedd5;
    border-color: #f97316;
    color: #c2410c;
}

.mark-btn.is-active.callback-btn.is-due {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.listing-row.is-expanded {
    background: var(--surface-subtle);
}

.listings-table tr.listing-row {
    position: relative;
}

.listing-expand-panel[hidden] {
    display: none !important;
}

.listing-expand-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    overflow: hidden;
}

.listing-expand {
    padding: 0;
}

.listing-expand-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 20px;
}

.listing-expand-main h3,
.listing-expand-side h3,
.param-section h4 {
    margin: 0 0 12px;
    font-size: 16px;
}

.listing-description {
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 18px;
}

.param-section {
    margin-bottom: 18px;
}

.param-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 16px;
    margin: 0;
}

.param-row {
    display: grid;
    gap: 4px;
}

.param-row dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.param-row dd {
    margin: 0;
    font-weight: 600;
}

.expand-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.expand-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}

.expand-gallery-item {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.expand-gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--surface-subtle);
}

.expand-meta {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.expand-meta strong {
    display: block;
    margin-top: 4px;
}

.expand-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (min-width: 961px) {
    .listing-expand-panel {
        margin-top: 18px;
        padding-top: 18px;
        border-top: 1px solid var(--border-strong);
    }

    .listing-expand-main h3,
    .listing-expand-side h3,
    .map-block-head h3 {
        margin: 0 0 12px;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .listing-description {
        margin-bottom: 20px;
        padding: 16px 18px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .param-section {
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .param-section h4 {
        margin: 0;
        padding: 10px 14px;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
        background: var(--surface-subtle);
        border-bottom: 1px solid var(--border);
    }

    .param-list {
        padding: 12px 14px;
    }

    .param-row {
        padding: 8px 10px;
        border-radius: 8px;
        background: var(--surface-subtle);
        border: 1px solid var(--border);
    }

    .listing-expand-side {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .listing-expand .expand-gallery,
    .listing-expand .map-block {
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        margin-bottom: 0;
    }

    .expand-gallery-head,
    .map-block-head {
        margin-bottom: 12px;
    }

    .expand-meta {
        margin: 0;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .expand-meta > div {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
    }

    .expand-meta > div:last-child {
        border-bottom: 0;
    }

    .expand-meta > div > .muted {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        line-height: 1.35;
    }

    .expand-meta strong {
        margin-top: 0;
        line-height: 1.4;
        word-break: break-word;
    }

    .expand-gallery-item {
        border: 1px solid var(--border);
    }

    .expand-actions {
        margin-top: 4px;
    }
}

.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.photo-modal[hidden] {
    display: none;
}

.photo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.photo-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.photo-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 56px 12px 16px;
    border-bottom: 1px solid var(--border);
}

.photo-modal-head h3 {
    margin: 0;
    font-size: 16px;
}

.photo-modal-body {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 320px;
    background: #0f172a;
}

.photo-modal-body img {
    max-width: 100%;
    max-height: min(70vh, 720px);
    object-fit: contain;
}

.photo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    font-size: 28px;
    cursor: pointer;
}

.photo-nav-prev { left: 12px; }
.photo-nav-next { right: 12px; }

.photo-modal-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
    background: var(--surface);
}

.photo-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.photo-thumb.active {
    border-color: var(--primary);
}

.photo-thumb img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: var(--surface-subtle);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 960px) {
    .photo-modal-dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .photo-modal-body {
        flex: 1;
        min-height: 0;
        touch-action: pan-y pinch-zoom;
    }

    .photo-modal-body img {
        max-height: calc(100vh - 200px);
        width: 100%;
    }

    .photo-nav {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .photo-modal-thumbs {
        flex-shrink: 0;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .photo-modal-head {
        padding-right: 52px;
    }

    .photo-modal-head .btn-sm {
        display: none;
    }
}

.listing-row.callback-due {
    background: #fffafa;
}

.listing-action-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
}

.listing-action-modal[hidden] {
    display: none;
}

.listing-action-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.listing-action-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100% - 24px));
    margin: 10vh auto 0;
    padding: 20px;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.listing-action-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-subtle);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.listing-action-modal-head h3 {
    margin: 0 0 6px;
    font-size: 20px;
    padding-right: 36px;
}

.listing-action-modal-body {
    margin-top: 16px;
}

.listing-action-modal-body textarea,
.listing-action-modal-body input[type="date"],
.listing-action-modal-body input[type="time"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font: inherit;
}

.listing-action-modal-body textarea {
    min-height: 140px;
    resize: vertical;
}

.callback-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.callback-datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.callback-current {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-subtle);
}

.listing-action-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 560px) {
    .callback-datetime-grid {
        grid-template-columns: 1fr;
    }
}

.listing-row.is-favorite {
    box-shadow: inset 4px 0 0 #f43f5e;
    background: rgba(244, 63, 94, 0.05);
}

.listing-row.is-viewed:not(.is-favorite) {
    box-shadow: inset 4px 0 0 #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.listing-row.is-just-returned {
    box-shadow: inset 4px 0 0 var(--primary), 0 0 0 1px rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.1);
    animation: listing-return-pulse 2.6s ease;
}

@keyframes listing-return-pulse {
    0% {
        background: rgba(37, 99, 235, 0.18);
    }
    45% {
        background: rgba(37, 99, 235, 0.08);
    }
    100% {
        background: rgba(59, 130, 246, 0.05);
    }
}

.listing-row.is-favorite.is-viewed {
    box-shadow: inset 4px 0 0 #f43f5e, inset 8px 0 0 #3b82f6;
    background: linear-gradient(90deg, rgba(244, 63, 94, 0.06) 0, rgba(59, 130, 246, 0.04) 100%);
}

.listing-row.is-in-crm:not(.is-favorite):not(.is-viewed) {
    box-shadow: inset 4px 0 0 #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.listing-row.has-new-items {
    box-shadow: inset 4px 0 0 #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    animation: selection-new-row-pulse 2.8s ease-in-out infinite;
}

html[data-theme="dark"] .listing-row.has-new-items {
    box-shadow: inset 4px 0 0 #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

@keyframes selection-new-row-pulse {
    0%, 100% {
        background: rgba(245, 158, 11, 0.06);
    }
    50% {
        background: rgba(245, 158, 11, 0.13);
    }
}

html[data-theme="dark"] .listing-row.has-new-items {
    animation-name: selection-new-row-pulse-dark;
}

@keyframes selection-new-row-pulse-dark {
    0%, 100% {
        background: rgba(251, 191, 36, 0.08);
    }
    50% {
        background: rgba(251, 191, 36, 0.16);
    }
}

.listing-row.has-new-items .crm-selection-new-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

html[data-theme="dark"] .listing-row.has-new-items .crm-selection-new-badge {
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .listing-row.has-new-items {
        animation: none;
    }
}

@media (max-width: 960px) {
    .listings-table tr.listing-row.has-new-items {
        border-color: color-mix(in srgb, #f59e0b 42%, var(--border));
        box-shadow:
            inset 4px 0 0 #f59e0b,
            var(--shadow-sm);
    }

    html[data-theme="dark"] .listings-table tr.listing-row.has-new-items {
        border-color: color-mix(in srgb, #fbbf24 38%, var(--border));
        box-shadow:
            inset 4px 0 0 #fbbf24,
            var(--shadow-sm);
    }
}

.listing-detail-card.is-in-crm {
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.listing-detail-crm-badge {
    display: inline-block;
    margin-bottom: 8px;
    text-decoration: none;
}

.listing-mobile-crm-badge {
    margin-bottom: 8px;
    display: inline-block;
}

.collection-note {
    margin: -4px 0 14px;
    font-size: 13px;
}

.filters-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.collection-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.collection-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

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

.collection-count {
    opacity: 0.85;
    font-weight: 600;
}

.collection-tab--icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    line-height: 1;
    overflow: visible;
}

.collection-tab-icon {
    font-size: 17px;
    line-height: 1;
}

/* Счётчик на иконке — бейдж как у колокольчика уведомлений */
.collection-tab--icon .collection-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}

.collection-tab--icon.active .collection-count {
    box-shadow: 0 0 0 2px var(--primary);
}

.collection-tab--icon .collection-count:empty {
    display: none;
}

/* Тултип под иконкой (вкладки находятся вверху страницы) */
.collection-tab--icon.has-tooltip::after {
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
}

.collection-tab--icon.has-tooltip::before {
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(15, 20, 36, 0.94);
}

/* Пояснение к разделам — выпадающая панель в стиле колокольчика уведомлений */
.collections-help {
    position: relative;
    margin-left: auto;
    align-self: center;
}

.collections-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}

.collections-help-btn::-webkit-details-marker {
    display: none;
}

.collections-help-btn:hover,
.collections-help[open] .collections-help-btn {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary);
}

.collections-help-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    width: min(340px, calc(100vw - 24px));
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(15, 20, 36, 0.14);
}

.collections-help-panel__head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.collections-help-list {
    overflow: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.collections-help-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
}

.collections-help-item:hover {
    background: rgba(15, 20, 36, 0.05);
}

.collections-help-item__icon {
    font-size: 18px;
    line-height: 1.4;
    flex-shrink: 0;
}

.collections-help-item__body {
    display: grid;
    gap: 2px;
}

.collections-help-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
}

.collections-help-item__meta {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
}

@media (max-width: 640px) {
    .collection-tabs {
        gap: 8px;
        align-items: center;
    }

    /* "Все объявления" занимает всю ширину, иконки разделов — строкой под ней */
    .collection-tab[data-collection="all"] {
        flex: 1 1 100%;
        text-align: center;
    }

    .collection-tab--icon {
        flex: 1 1 0;
        padding: 9px 8px;
    }

    .collections-help {
        margin-left: 0;
    }

    /* На мобильной панель показываем по центру экрана, чтобы не обрезалась */
    .collections-help[open] .collections-help-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        width: min(420px, calc(100vw - 24px));
        max-height: calc(100dvh - 48px);
        z-index: 1300;
    }

    .collections-help[open]::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1290;
        background: rgba(15, 20, 36, 0.45);
    }
}

.badge-favorite {
    background: rgba(244, 63, 94, 0.12);
    color: #be123c;
}

.badge-viewed {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.badge-notes {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.badge-callbacks {
    background: rgba(249, 115, 22, 0.16);
    color: #c2410c;
}

.badge-crm {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    text-decoration: none;
}

.badge-crm:hover {
    background: rgba(16, 185, 129, 0.22);
}

.tags-filter-bar {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.tags-filter-bar.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.tags-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tags-filter-label {
    font-weight: 700;
}

.tags-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-filter-chips.is-empty {
    display: block;
}

.listing-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.listing-tag-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.listing-tag-list:not(:empty) {
    flex-basis: 100%;
}

.listing-tag-list-detail {
    margin-bottom: 8px;
}

.tag-filter-chip {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tag-filter-chip.is-selected {
    box-shadow: 0 0 0 2px var(--text), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.tag-filter-chip:not(.is-selected) {
    opacity: 0.72;
}

.tag-picker-chip {
    cursor: pointer;
    margin: 0 8px 8px 0;
}

.tag-picker-chip:not(.is-selected) {
    opacity: 0.55;
}

.tag-picker-chip.is-selected {
    box-shadow: 0 0 0 2px var(--text), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.tags-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-create-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.tags-create-form .field {
    flex: 1 1 200px;
    gap: 6px;
    margin: 0;
}

.tags-create-form .field-color {
    flex: 0 0 auto;
    width: auto;
}

.tags-create-form .btn {
    flex: 0 0 auto;
    min-height: 44px;
}

.field-color input[type="color"] {
    width: 56px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

/* Форма создания тега без обёрток .field (модалка тегов CRM) */
.tags-create-form > input[type="text"] {
    flex: 1 1 200px;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    outline: none;
}

.tags-create-form > input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.tags-create-form > input[type="color"] {
    flex: 0 0 auto;
    width: 56px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.tags-manage-list {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.tag-manage-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.tag-manage-name {
    flex: 1 1 160px;
    min-width: 0;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tag-manage-name:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.tag-manage-color {
    flex: 0 0 auto;
    width: 44px;
    height: 40px;
    padding: 3px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.tag-manage-row .btn-sm {
    flex: 0 0 auto;
    min-height: 40px;
}

.listing-action-modal-dialog-wide {
    max-width: 640px;
}

.listing-row.has-tags .tag-btn.is-active,
.listing-detail-card.has-tags .tag-btn.is-active {
    color: #4338ca;
}

@media (max-width: 720px) {
    .tags-create-form {
        grid-template-columns: 1fr;
    }

    .tag-manage-row {
        grid-template-columns: 1fr;
    }
}

.expand-gallery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.expand-gallery-actions--mobile {
    display: none;
}

.expand-gallery-mobile {
    display: none;
}

.expand-gallery-grid--desktop {
    display: grid;
}

.expand-gallery-title {
    margin: 0;
}

.map-block {
    margin-bottom: 18px;
}

.map-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.map-block-head h3 {
    margin: 0;
    font-size: 16px;
}

.map-address {
    margin: 0;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.listing-detail-page {
    padding-top: 8px;
    padding-bottom: 32px;
}

.listing-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.listing-detail-back:hover {
    color: var(--primary);
}

.listing-contacts-locked-banner {
    margin-bottom: 12px;
}

.listing-contacts-locked-banner a {
    font-weight: 600;
}

.listing-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.listing-detail-card.is-favorite {
    box-shadow: inset 4px 0 0 #f43f5e, var(--shadow);
    background:
        linear-gradient(90deg, rgba(244, 63, 94, 0.06) 0, transparent 140px),
        var(--surface);
}

.listing-detail-card.is-viewed:not(.is-favorite) {
    box-shadow: inset 4px 0 0 #3b82f6, var(--shadow);
    background:
        linear-gradient(90deg, rgba(59, 130, 246, 0.06) 0, transparent 140px),
        var(--surface);
}

.listing-detail-card.is-favorite.is-viewed {
    box-shadow: inset 4px 0 0 #f43f5e, inset 8px 0 0 #3b82f6, var(--shadow);
    background:
        linear-gradient(90deg, rgba(244, 63, 94, 0.06) 0, rgba(59, 130, 246, 0.04) 140px, transparent 180px),
        var(--surface);
}

.listing-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 14px;
}

.listing-detail-head h1 {
    margin: 0 0 6px;
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    line-height: 1.25;
}

.listing-detail-head .lead {
    margin: 0 0 8px;
}

.listing-detail-head .listing-meta {
    margin: 0;
    gap: 8px;
}

.listing-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.listing-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 20px;
    margin-top: 20px;
}

.listing-detail-gallery {
    margin-top: 6px;
}

.listing-detail-gallery .expand-gallery-grid--desktop {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
}

.listing-detail-gallery .expand-gallery-grid--desktop .expand-gallery-item img {
    max-height: 72px;
}

.listing-detail-grid.expand-gallery-grid,
.listing-detail-grid .expand-gallery-grid,
.listing-detail-grid .listing-detail-grid {
    margin-top: 0;
}

.listing-detail-grid + .listing-detail-grid,
.listing-detail-gallery + .listing-detail-grid {
    margin-top: 20px;
}

.listing-detail-grid .listing-detail-grid {
    display: block;
}

.listing-detail-grid .expand-gallery-grid.listing-detail-grid {
    display: grid;
}

.listing-detail-grid .expand-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
}

@media (max-width: 900px) {
    .listing-detail-grid {
        grid-template-columns: 1fr;
    }
}

.auth-page,
.admin-page {
    padding-top: 24px;
}

.footer-legal {
    padding: 12px 0 20px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.footer-inn,
.footer-copyright {
    margin: 0;
    text-align: center;
}

.favicon-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.favicon-preview img {
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
}

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

.guide-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.guide-page-head {
    margin-bottom: 24px;
    max-width: 100%;
    min-width: 0;
}

.guide-page-head h1 {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guide-breadcrumbs {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
}

.guide-breadcrumbs a {
    text-decoration: none;
}

.guide-breadcrumbs a:hover {
    text-decoration: underline;
}

.guide-breadcrumbs span[aria-hidden="true"] {
    margin: 0 6px;
    color: var(--border-strong, #cbd5e1);
}

.seo-breadcrumbs {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
}

.seo-breadcrumbs a {
    text-decoration: none;
}

.seo-breadcrumbs a:hover {
    text-decoration: underline;
}

.seo-breadcrumbs span[aria-hidden="true"] {
    margin: 0 6px;
    color: var(--border-strong, #cbd5e1);
}

.seo-breadcrumbs [aria-current="page"] {
    color: var(--text-muted, #64748b);
}

.listing-detail-page .seo-breadcrumbs {
    margin-bottom: 8px;
}

.guide-page-lead {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    max-width: 62ch;
}

.guide-section-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.guide-section-card h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.guide-article-links {
    margin: 12px 0 0;
    padding-left: 1.1rem;
}

.guide-article-links li {
    margin-bottom: 6px;
}

.guide-article-list {
    display: grid;
    gap: 10px;
}

.guide-article-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.guide-article-list-item:hover {
    border-color: var(--primary, #2563eb);
    box-shadow: var(--shadow);
}

.guide-article-list-title {
    font-weight: 600;
}

.guide-article-list-arrow {
    color: var(--muted);
}

.guide-article-content {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guide-article-content :is(h1, h2, h3, h4, h5, h6) {
    text-align: left;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guide-article-content h2 {
    font-size: 1.35rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.guide-article-content h3 {
    font-size: 1.15rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.guide-article-content h4 {
    font-size: 1.05rem;
    line-height: 1.4;
    letter-spacing: 0;
}

.guide-article-content :is(h1, h2, h3, h4, h5, h6)[class*="ql-indent"] {
    padding-left: 0 !important;
}

.guide-article-content :is(h1, h2, h3, h4, h5, h6).ql-align-right,
.guide-article-content :is(h1, h2, h3, h4, h5, h6).ql-align-center {
    text-align: left;
}

.guide-article-content p,
.guide-article-content li,
.guide-article-content blockquote {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guide-article-content p.ql-indent-1 { padding-left: 1.5em; }
.guide-article-content p.ql-indent-2 { padding-left: 3em; }
.guide-article-content p.ql-indent-3 { padding-left: 4.5em; }
.guide-article-content li.ql-indent-1 { padding-left: 2em; }
.guide-article-content li.ql-indent-2 { padding-left: 3.5em; }
.guide-article-content li.ql-indent-3 { padding-left: 5em; }

.guide-article-content pre,
.guide-article-content table {
    max-width: 100%;
    overflow-x: auto;
}

.guide-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.guide-back-links {
    margin-top: 20px;
}

.sitemap-page {
    padding-bottom: 48px;
}

.sitemap-city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.sitemap-city-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sitemap-city-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.sitemap-city-name {
    font-weight: 600;
}

.sitemap-city-arrow {
    color: var(--muted);
}

.sitemap-sections {
    display: grid;
    gap: 12px;
}

.sitemap-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
}

.sitemap-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.sitemap-section-summary::-webkit-details-marker {
    display: none;
}

.sitemap-section-count {
    font-size: 13px;
    font-weight: 600;
}

.sitemap-link-list {
    margin: 0;
    padding: 0 16px 14px;
    list-style: none;
    columns: 1;
    column-gap: 24px;
    max-height: 420px;
    overflow: auto;
}

.sitemap-link-list li {
    break-inside: avoid;
    margin-bottom: 8px;
}

.sitemap-link-list a {
    font-size: 14px;
    line-height: 1.45;
    text-decoration: none;
}

.sitemap-link-list a:hover {
    text-decoration: underline;
}

@media (min-width: 720px) {
    .sitemap-link-list {
        columns: 2;
    }
}

@media (min-width: 1100px) {
    .sitemap-link-list {
        columns: 3;
    }
}

.admin-user-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.admin-stat-card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.admin-stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.admin-user-sections {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-user-sections .admin-card h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.admin-table-compact th,
.admin-table-compact td {
    font-size: 13px;
    padding: 8px 10px;
}

.text-ok {
    color: #15803d;
    font-weight: 600;
}

.text-danger {
    color: #b42318;
    font-weight: 600;
}

.doc-editor-field {
    display: grid;
    gap: 8px;
}

.doc-editor-host {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.doc-editor-host .ql-toolbar {
    border: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.doc-editor-host .ql-container {
    border: 0;
    font-size: 15px;
}

.doc-content-html {
    line-height: 1.7;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.doc-content-html h2,
.doc-content-html h3,
.doc-content-html h4 {
    margin: 1.2em 0 0.5em;
}

.doc-content-html p,
.doc-content-html ul,
.doc-content-html ol {
    margin: 0 0 0.9em;
}

.doc-content-html ul,
.doc-content-html ol {
    padding-left: 1.4rem;
}

.doc-content-text {
    white-space: pre-wrap;
}

.auth-card-wrap {
    display: grid;
    place-items: center;
}

.auth-card,
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
}

.auth-card:has(#geo-region-select) {
    width: min(480px, 100%);
}

.auth-required-lead {
    margin: 0 0 20px;
    line-height: 1.55;
}

.auth-required-actions {
    display: grid;
    gap: 10px;
}

.cabinet-page {
    padding-top: 24px;
}

.cabinet-layout {
    display: grid;
    gap: 20px;
}

.cabinet-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
}

.cabinet-top-intro h1 {
    margin: 0 0 4px;
}

.cabinet-summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cabinet-summary-card {
    display: grid;
    gap: 4px;
    min-width: 180px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cabinet-summary-card.is-muted {
    background: var(--surface-subtle);
}

.cabinet-summary-label {
    display: block;
}

.cabinet-summary-value {
    font-size: 20px;
    line-height: 1.2;
}

.cabinet-summary-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.cabinet-summary-link:hover {
    text-decoration: underline;
}

.cabinet-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.cabinet-nav {
    display: grid;
    gap: 4px;
    position: sticky;
    top: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cabinet-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.cabinet-nav-link:hover {
    background: var(--surface-subtle);
    color: var(--primary);
}

.cabinet-nav-link.is-active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.cabinet-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.cabinet-content {
    min-width: 0;
}

.cabinet-profile-form {
    max-width: 480px;
}

.cabinet-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cabinet-info-inline {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.cabinet-access-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ——— Cabinet / Access page ——— */

.cabinet-access {
    display: grid;
    gap: 20px;
}

.cabinet-access-hero {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.cabinet-access-balance {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    background:
        radial-gradient(ellipse 120% 80% at 0% 0%, rgba(37, 99, 235, 0.14), transparent 55%),
        linear-gradient(160deg, var(--surface) 0%, var(--surface-subtle) 100%);
    box-shadow: var(--shadow);
}

.cabinet-access-balance__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.cabinet-access-balance__label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.cabinet-access-balance__value {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
}

.cabinet-access-balance__hint {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--muted);
}

.cabinet-access-topup {
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cabinet-access-topup__head {
    display: grid;
    gap: 4px;
}

.cabinet-access-topup__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cabinet-access-topup__lead {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--muted);
}

.cabinet-access-topup-form {
    display: grid;
    gap: 14px;
}

.cabinet-access-field {
    display: grid;
    gap: 8px;
}

.cabinet-access-field__label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cabinet-access-input-wrap {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-subtle);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cabinet-access-input-wrap:focus-within {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.cabinet-access-input {
    flex: 1;
    min-width: 0;
    min-height: 56px;
    padding: 0 16px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    outline: none;
}

.cabinet-access-input::placeholder {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
    font-weight: 500;
}

.cabinet-access-input-suffix {
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border-left: 1px solid var(--border);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--muted);
}

.cabinet-access-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cabinet-access-preset {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.cabinet-access-preset:hover {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    background: var(--primary-soft);
    color: var(--primary);
}

.cabinet-access-preset.is-active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.cabinet-access-preset:active {
    transform: scale(0.98);
}

.cabinet-access-topup-btn {
    min-height: 48px;
    font-size: 1rem;
    font-weight: 700;
}

.cabinet-access-topup__note {
    margin: -4px 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.cabinet-access-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cabinet-access-plan {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cabinet-access-plan.is-active {
    border-color: color-mix(in srgb, #16a34a 35%, var(--border));
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(22, 163, 74, 0.08), transparent),
        var(--surface);
}

.cabinet-access-plan--api.is-active {
    border-color: color-mix(in srgb, #7c5cff 35%, var(--border));
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(124, 92, 255, 0.08), transparent),
        var(--surface);
}

.cabinet-access-plan__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cabinet-access-plan__type {
    display: block;
    margin-bottom: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.cabinet-access-plan__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cabinet-access-plan__badge {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.cabinet-access-plan__badge.is-on {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.25);
    color: #15803d;
}

.cabinet-access-plan--api .cabinet-access-plan__badge.is-on {
    background: rgba(124, 92, 255, 0.12);
    border-color: rgba(124, 92, 255, 0.28);
    color: #6d28d9;
}

.cabinet-access-plan__info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.cabinet-access-plan__info dt {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.cabinet-access-plan__info dd {
    margin: 4px 0 0;
    font-size: 1rem;
    font-weight: 700;
}

.cabinet-access-plan__note {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--muted);
}

.cabinet-access-plan__cta {
    justify-self: start;
}

.cabinet-access-history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cabinet-access-history-card {
    margin: 0;
}

.cabinet-access-history-card .cabinet-card-head {
    margin-bottom: 4px;
}

.cabinet-access-timeline {
    display: grid;
    gap: 8px;
}

.cabinet-access-timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.cabinet-access-timeline-item__main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.cabinet-access-timeline-item__main strong {
    font-size: 0.9375rem;
}

.cabinet-access-empty {
    margin: 0;
    padding: 8px 0;
}

html[data-theme="dark"] .cabinet-access-balance {
    background:
        radial-gradient(ellipse 120% 80% at 0% 0%, rgba(96, 165, 250, 0.16), transparent 55%),
        linear-gradient(160deg, var(--surface) 0%, var(--surface-subtle) 100%);
}

html[data-theme="dark"] .cabinet-access-plan__badge.is-on {
    color: #4ade80;
}

html[data-theme="dark"] .cabinet-access-plan--api .cabinet-access-plan__badge.is-on {
    color: #a78bfa;
}

/* ——— Partners page ——— */

.partners-page {
    padding-bottom: 48px;
}

.partners-container {
    max-width: 960px;
}

.partners-hero {
    margin-bottom: 32px;
    text-align: center;
}

.partners-hero__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.partners-hero__lead {
    margin: 0 auto;
    max-width: 640px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

.partners-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 32px;
}

.partners-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.partners-card__title {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.partners-card__text {
    margin: 0 0 16px;
    line-height: 1.55;
    color: var(--text-muted);
}

.partners-card__note {
    margin: 16px 0 0;
}

.partners-rates {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.partners-rate {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.partners-rate__percent {
    min-width: 52px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.partners-rate__desc {
    color: var(--text-muted);
    line-height: 1.4;
}

.partners-link-box {
    display: grid;
    gap: 12px;
}

.partners-link-box__label {
    margin: 0;
    font-weight: 600;
}

.partners-link-row,
.cabinet-referrals-link-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.partners-link-input,
.cabinet-referrals-link-input {
    flex: 1 1 220px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    font: inherit;
}

.partners-auth-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.partners-join-btn,
.partners-cabinet-btn {
    width: 100%;
    max-width: 280px;
}

.partners-steps {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
}

.partners-steps__title {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.partners-steps-list {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ——— Cabinet referrals ——— */

.cabinet-referrals {
    display: grid;
    gap: 20px;
}

.cabinet-referrals-hero {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 20px;
}

.cabinet-referrals-balance,
.cabinet-referrals-link {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.cabinet-referrals-balance__label,
.cabinet-referrals-link__title {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cabinet-referrals-balance__value {
    display: block;
    font-size: 1.75rem;
    line-height: 1.2;
}

.cabinet-referrals-balance__hint {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cabinet-referrals-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cabinet-referrals-transfer,
.cabinet-referrals-withdraw {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.cabinet-referrals-transfer__title,
.cabinet-referrals-withdraw__title {
    margin: 0 0 8px;
    font-size: 1rem;
}

.cabinet-referrals-section {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

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

.cabinet-referrals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.cabinet-referrals-table th,
.cabinet-referrals-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.cabinet-referrals-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.text-success {
    color: #16a34a;
}

.text-danger {
    color: #dc2626;
}

@media (max-width: 768px) {
    .partners-grid,
    .cabinet-referrals-hero,
    .cabinet-referrals-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ——— Cabinet / API page ——— */

.cabinet-api {
    display: grid;
    gap: 20px;
}

.cabinet-api-hero {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.cabinet-api-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-subtle) 100%);
    box-shadow: var(--shadow-sm);
}

.cabinet-api-status.is-active {
    border-color: color-mix(in srgb, #7c5cff 35%, var(--border));
    background:
        radial-gradient(ellipse 120% 80% at 0% 0%, rgba(124, 92, 255, 0.14), transparent 55%),
        linear-gradient(160deg, var(--surface) 0%, var(--surface-subtle) 100%);
    box-shadow: var(--shadow);
}

.cabinet-api-status__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: rgba(124, 92, 255, 0.12);
    color: #6d28d9;
}

.cabinet-api-status__label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.cabinet-api-status__value {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.cabinet-api-status__meta {
    margin: 4px 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted);
}

.cabinet-api-status__meta strong {
    color: var(--text);
}

.cabinet-api-status__docs {
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.cabinet-api-status__docs:hover {
    text-decoration: underline;
}

.cabinet-api-create {
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cabinet-api-create__head {
    display: grid;
    gap: 4px;
}

.cabinet-api-create__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cabinet-api-create__lead {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--muted);
}

.cabinet-api-create-form {
    display: grid;
    gap: 14px;
}

.cabinet-api-input-wrap {
    min-height: 52px;
}

.cabinet-api-input {
    font-size: 1rem;
    font-weight: 600;
}

.cabinet-api-create-btn {
    min-height: 48px;
    font-weight: 700;
    justify-self: start;
}

.cabinet-api-reveal {
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-radius: 12px;
    background: var(--primary-soft);
}

.cabinet-api-reveal__title {
    margin: 0 0 4px;
}

.cabinet-api-reveal__hint {
    margin: 0 0 10px;
}

.cabinet-api-reveal__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cabinet-api-reveal__code {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    word-break: break-all;
}

.cabinet-api-tokens {
    margin: 0;
}

.cabinet-api-token-item {
    align-items: center;
}

.cabinet-api-token-secret {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    min-width: 0;
}

.cabinet-api-token-value {
    display: inline-block;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    word-break: break-all;
}

.cabinet-api-token-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.cabinet-api-token-eye:hover {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    background: var(--primary-soft);
}

.api-logs-table__time {
    white-space: nowrap;
}

.api-logs-table__request {
    min-width: 180px;
    max-width: 280px;
}

.api-logs-table__query {
    word-break: break-all;
}

.api-logs-table__response {
    min-width: 220px;
    max-width: 360px;
}

.api-logs-status {
    display: inline-flex;
    min-width: 2.5rem;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.api-logs-status--ok {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.api-logs-status--err {
    background: rgba(220, 38, 38, 0.12);
    color: #b42318;
}

.api-logs-details__summary {
    cursor: pointer;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text);
}

.api-logs-details__body {
    margin: 8px 0 0;
    padding: 10px 12px;
    max-height: 220px;
    overflow: auto;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

html[data-theme="dark"] .cabinet-api-status.is-active {
    background:
        radial-gradient(ellipse 120% 80% at 0% 0%, rgba(167, 139, 250, 0.16), transparent 55%),
        linear-gradient(160deg, var(--surface) 0%, var(--surface-subtle) 100%);
}

html[data-theme="dark"] .cabinet-api-status__icon {
    color: #a78bfa;
}

.cabinet-topup-form {
    display: grid;
    gap: 12px;
    max-width: 320px;
}

.cabinet-amount-label {
    font-weight: 700;
    white-space: nowrap;
}

.cabinet-amount-label.is-credit {
    color: #15803d;
}

.cabinet-amount-label.is-debit {
    color: #b42318;
}

.cabinet-transactions-list .cabinet-list-item {
    align-items: center;
}

.cabinet-wrap {
    display: grid;
    gap: 20px;
}

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

.cabinet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: grid;
    gap: 14px;
}

.cabinet-card h2 {
    margin: 0;
    font-size: 18px;
}

.cabinet-info {
    display: grid;
    gap: 10px;
    margin: 0;
}

.cabinet-info dt {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.cabinet-info dd {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 700;
}

.cabinet-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cabinet-grid-wide {
    margin-top: 20px;
}

.cabinet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.cabinet-card-head h2 {
    margin: 0;
}

.cabinet-list {
    display: grid;
    gap: 10px;
}

.cabinet-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.cabinet-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.api-token-create {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.api-token-create input {
    flex: 1;
    min-width: 200px;
}

.api-token-reveal {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.api-token-reveal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.api-token-reveal-row code {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    font-size: 13px;
}

.api-doc {
    display: grid;
    gap: 16px;
}

.api-doc-status {
    padding: 22px 24px;
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 18px;
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(22, 163, 74, 0.1) 0%, transparent 55%),
        linear-gradient(180deg, var(--surface) 0%, var(--surface-subtle) 100%);
    display: grid;
    gap: 16px;
}

.api-doc-status.is-degraded {
    border-color: rgba(234, 179, 8, 0.35);
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(234, 179, 8, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, var(--surface) 0%, var(--surface-subtle) 100%);
}

.api-doc-status__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.api-doc-status__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.api-doc-status__dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.14);
    animation: api-status-pulse 2s ease-in-out infinite;
}

.api-doc-status.is-degraded .api-doc-status__dot {
    background: #ca8a04;
    box-shadow: 0 0 0 6px rgba(234, 179, 8, 0.16);
}

@keyframes api-status-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.82; }
}

.api-doc-status__title {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.api-doc-status__meta {
    margin: 0;
}

.api-doc-status__badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.api-doc-status.is-degraded .api-doc-status__badge {
    background: rgba(234, 179, 8, 0.14);
    color: #a16207;
}

.api-doc-status__bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(15, 20, 36, 0.06);
    overflow: hidden;
}

.api-doc-status__bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    transition: width 0.6s ease;
}

.api-doc-status.is-degraded .api-doc-status__bar-fill {
    background: linear-gradient(90deg, #facc15 0%, #ca8a04 100%);
}

.api-doc-status__history {
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    gap: 4px;
    align-items: end;
    min-height: 56px;
}

.api-doc-status__day {
    display: flex;
    align-items: flex-end;
    height: 48px;
    border-radius: 4px;
    background: rgba(15, 20, 36, 0.05);
    overflow: hidden;
}

.api-doc-status__day-bar {
    display: block;
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    background: #22c55e;
}

.api-doc-status__day.is-degraded .api-doc-status__day-bar {
    background: #facc15;
}

.api-doc-status__day.is-down .api-doc-status__day-bar {
    background: #ef4444;
}

.api-doc-status__day.is-unknown {
    opacity: 0.35;
}

.api-doc-status__day.is-unknown .api-doc-status__day-bar {
    display: none;
}

.api-doc-status__checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.api-doc-status__check {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.api-doc-status__check.is-ok {
    border-color: rgba(22, 163, 74, 0.24);
    color: #15803d;
    background: rgba(22, 163, 74, 0.08);
}

.api-doc-status__footnote {
    margin: 0;
}

.api-doc-card {
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface, #fff);
}

.api-doc-card h2 {
    margin-top: 0;
}

.api-doc-card h3 {
    margin: 18px 0 6px;
}

.api-doc-card code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--surface-subtle, #f1f3f7);
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.api-method {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: 4px;
    flex: 0 0 auto;
}

.api-endpoint {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.api-endpoint:first-of-type {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
}

.api-endpoint-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.api-endpoint-path {
    font-size: 13px;
    word-break: break-all;
}

.api-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.api-doc-table th,
.api-doc-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 14px;
}

.api-doc-card pre {
    margin: 8px 0 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.api-doc-card pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

@media (max-width: 960px) {
    .api-doc-page {
        --container-gutter: 12px;
        overflow-x: hidden;
    }

    .api-doc-page.section {
        padding: 16px 0 28px;
    }

    .api-doc-page .container,
    .api-doc-page .api-doc {
        min-width: 0;
        max-width: 100%;
    }

    .api-doc-page .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .api-doc-page .page-head h1 {
        font-size: 1.25rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .api-doc-page .page-head p {
        font-size: 14px;
        line-height: 1.5;
    }

    .api-doc-page .page-head .btn {
        width: 100%;
        justify-content: center;
    }

    .api-doc {
        gap: 10px;
    }

    .api-doc-status {
        padding: 16px;
    }

    .api-doc-status__head {
        flex-direction: column;
        gap: 10px;
    }

    .api-doc-status__history {
        gap: 2px;
        min-height: 44px;
    }

    .api-doc-status__day {
        height: 40px;
    }

    .api-doc-card {
        padding: 14px 12px;
        border-radius: 12px;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .api-doc-card h2 {
        font-size: 1.05rem;
        line-height: 1.35;
    }

    .api-doc-card h3 {
        margin: 14px 0 6px;
        font-size: 14px;
        line-height: 1.45;
        word-break: break-word;
    }

    .api-doc-card > .muted.small {
        margin-top: 14px;
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .api-endpoint-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .api-endpoint-path {
        display: block;
        width: 100%;
        padding: 8px 10px;
        font-size: 12px;
        line-height: 1.4;
        border-radius: 8px;
        background: var(--surface-subtle);
    }

    .api-doc-base-url code {
        display: block;
        margin-top: 4px;
        padding: 8px 10px;
        font-size: 12px;
        line-height: 1.4;
        word-break: break-all;
    }

    .api-doc-card p,
    .api-doc-card li {
        font-size: 14px;
        line-height: 1.55;
    }

    .api-doc-card ul {
        padding-left: 1.1rem;
        margin: 8px 0 0;
    }

    .api-doc-card li {
        margin-bottom: 6px;
    }

    .api-doc-card li code {
        font-size: 12px;
    }

    .api-doc-card pre {
        margin-top: 10px;
        padding: 10px;
        font-size: 11px;
        line-height: 1.45;
        border-radius: 8px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .api-doc-card pre code {
        font-size: 11px;
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .api-doc-table {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-top: 8px;
        border-collapse: separate;
        border-spacing: 0;
    }

    .api-doc-table thead {
        display: none;
    }

    .api-doc-table tbody {
        display: block;
        width: 100%;
    }

    .api-doc-table tr {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface-subtle);
        box-sizing: border-box;
    }

    .api-doc-table tr:last-child {
        margin-bottom: 0;
    }

    .api-doc-table td {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
        padding: 8px 0 0;
        font-size: 13px;
        line-height: 1.45;
        box-sizing: border-box;
    }

    .api-doc-table td:first-child {
        padding-top: 0;
    }

    .api-doc-table td::before {
        display: block;
        margin-bottom: 4px;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .api-doc-table--params td:nth-child(1)::before { content: "Параметр"; }
    .api-doc-table--params td:nth-child(2)::before { content: "Тип"; }
    .api-doc-table--params td:nth-child(3)::before { content: "Описание"; }
    .api-doc-table--params td:nth-child(4)::before { content: "Пример"; }

    .api-doc-table--pairs td:nth-child(1)::before { content: "Значение"; }
    .api-doc-table--pairs td:nth-child(2)::before { content: "Описание"; }

    .api-doc-table--sources td:nth-child(2)::before { content: "Площадка"; }

    .api-doc-table--fields td:nth-child(1)::before { content: "Поле"; }
    .api-doc-table--fields td:nth-child(2)::before { content: "Описание"; }

    .api-doc-table--subtypes td:nth-child(1)::before { content: "Категория"; }
    .api-doc-table--subtypes td:nth-child(2)::before { content: "Подтипы"; }

    .api-doc-table--subtypes td,
    .api-doc-table td code {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .api-doc-table code {
        font-size: 12px;
    }
}

@media (max-width: 960px) {
    html[data-theme="dark"] .api-doc-table tr {
        background: rgba(255, 255, 255, 0.03);
    }

    html[data-theme="dark"] .api-endpoint-path,
    html[data-theme="dark"] .api-doc-base-url code {
        background: rgba(255, 255, 255, 0.05);
    }

    html[data-theme="dark"] .api-doc-status {
        border-color: rgba(52, 211, 153, 0.22);
        background:
            radial-gradient(120% 120% at 100% 0%, rgba(52, 211, 153, 0.1) 0%, transparent 55%),
            linear-gradient(180deg, var(--surface) 0%, var(--surface-subtle) 100%);
    }

    html[data-theme="dark"] .api-doc-status__badge {
        color: #4ade80;
        background: rgba(52, 211, 153, 0.12);
    }

    html[data-theme="dark"] .api-doc-status__bar {
        background: rgba(255, 255, 255, 0.06);
    }
}

.listings-tools {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.saved-search-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.saved-search-field {
    min-width: 240px;
    flex: 1;
}

.saved-search-select {
    width: 100%;
}

.listings-export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.saved-search-login-hint {
    margin: 0;
}

.saved-search-menu-wrap {
    position: relative;
    display: inline-flex;
}

.saved-search-menu-wrap[hidden],
.saved-search-menu[hidden] {
    display: none;
}

.saved-search-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.saved-search-toggle-caret {
    font-size: 11px;
    line-height: 1;
}

.saved-search-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 240px;
    max-width: 340px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e5ea);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.saved-search-menu-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text, #1f2430);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-search-menu-item:hover {
    background: var(--surface-muted, #f1f3f7);
}

.cabinet-settings-card {
    width: min(480px, 100%);
}

.cabinet-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.cabinet-settings-head h1 {
    margin: 0 0 6px;
}

.alert-success {
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.crm-page .page-head {
    margin-bottom: 20px;
}

.crm-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.crm-subnav-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-subtle, #f8fafc);
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.crm-subnav-link:hover,
.crm-subnav-link.is-active {
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

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

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.crm-table th,
.crm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.crm-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--surface-subtle, #f8fafc);
}

.crm-table-num {
    text-align: center;
    white-space: nowrap;
}

.crm-table-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.crm-table-link:hover {
    color: var(--primary);
}

.crm-table tr.has-new-items,
.listing-row.has-new-items {
    box-shadow: inset 4px 0 0 #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.crm-selection-new-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.crm-selection-filters-card {
    margin-bottom: 16px;
}

.crm-selection-filters-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 20px;
    margin: 0;
}

.crm-selection-filter-row {
    display: grid;
    gap: 2px;
}

.crm-selection-filter-row dt {
    margin: 0;
}

.crm-selection-filter-row dd {
    margin: 0;
    font-weight: 500;
}

.selection-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.selection-item-meta .crm-selection-new-badge {
    margin-left: 0;
}

.listing-action-stack .selection-mark-seen-btn.is-active,
.listing-action-stack .selection-mark-seen-btn:hover {
    color: var(--primary);
}

.listing-action-stack .selection-remove-form {
    display: contents;
}

.listing-action-stack .selection-remove-btn {
    color: #b42318;
}

.listing-action-stack .selection-remove-btn:hover {
    background: rgba(180, 35, 24, 0.08);
    border-color: rgba(180, 35, 24, 0.25);
}

.listing-date-selection {
    color: var(--primary);
}

.crm-selection-meta-card {
    margin-bottom: 16px;
}

.crm-selection-meta-card .form-grid {
    margin-top: 4px;
}

.crm-selection-meta-card .field-searchable .searchable-select {
    width: 100%;
}

.crm-edit-form .field-searchable .searchable-select-trigger {
    border-radius: var(--radius-sm);
    border-color: var(--border-strong, var(--border));
}

.crm-selection-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 4px;
}

.crm-selection-filters-block {
    margin-bottom: 16px;
}

.crm-selection-filters-title {
    margin: 0 0 12px;
    font-size: 18px;
}

.crm-selection-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.crm-selection-stat {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.crm-selection-stat.is-highlight {
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.08);
}

.crm-selection-stat strong {
    font-size: 22px;
    line-height: 1.1;
}

.crm-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.crm-source-badge--crm {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.crm-source-badge--parser {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

@media (max-width: 768px) {
    .crm-selection-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-results-card {
    margin-top: 16px;
}

.crm-results-card .cabinet-card-head {
    align-items: baseline;
}

.crm-object-list {
    display: grid;
    gap: 12px;
}

.crm-object-card {
    display: grid;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-object-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 8px;
}

.crm-object-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.crm-object-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-color, var(--accent)) 14%, transparent);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
}

.crm-object-card.is-favorite {
    border-color: rgba(220, 38, 38, 0.25);
}

.crm-object-card.needs-callback {
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.18);
}

.tags-assign-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.tag-assign-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-object-card.is-on-vitrine {
    border-color: rgba(16, 185, 129, 0.35);
}

.crm-object-card-link {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 14px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.crm-object-card-link:hover .crm-object-card-title {
    color: var(--primary);
}

.crm-object-card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface-subtle, #f8fafc);
}

.crm-vitrine-public-link {
    margin-right: auto;
    text-decoration: none;
}

.crm-vitrine-public-link:hover {
    text-decoration: underline;
}

.crm-vitrine-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.crm-vitrine-switch.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.crm-vitrine-switch-label {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.2;
}

.crm-vitrine-switch.is-active .crm-vitrine-switch-label {
    color: #047857;
    font-weight: 600;
}

.crm-vitrine-switch-control {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.crm-vitrine-toggle-input,
.crm-vitrine-contacts-toggle-input,
.crm-vitrine-form-toggle-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    width: 100%;
    height: 100%;
}

.crm-vitrine-switch-track {
    display: block;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.15s ease;
    pointer-events: none;
}

.crm-vitrine-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.crm-vitrine-toggle-input:checked + .crm-vitrine-switch-track,
.crm-vitrine-contacts-toggle-input:checked + .crm-vitrine-switch-track,
.crm-vitrine-form-toggle-input:checked + .crm-vitrine-switch-track {
    background: #10b981;
}

.crm-vitrine-toggle-input:checked + .crm-vitrine-switch-track::after,
.crm-vitrine-contacts-toggle-input:checked + .crm-vitrine-switch-track::after,
.crm-vitrine-form-toggle-input:checked + .crm-vitrine-switch-track::after {
    transform: translateX(16px);
}

.crm-object-vitrine-toggles {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.crm-object-vitrine-switch {
    width: 100%;
    justify-content: space-between;
}

.crm-vitrine-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    pointer-events: none;
}

.crm-object-card-image {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    flex-shrink: 0;
}

.crm-object-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.crm-object-card-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 12px;
    color: var(--muted);
}

.vitrine-page .page-head {
    margin-bottom: 20px;
}

.vitrine-public {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.vitrine-public-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.vitrine-public-header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

.vitrine-public-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.vitrine-auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vitrine-logout-form {
    margin: 0;
}

.vitrine-auth-user {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vitrine-login-form {
    max-width: 520px;
}

.vitrine-public-brand {
    color: inherit;
    text-decoration: none;
}

.vitrine-public-brand:hover .vitrine-public-title {
    color: var(--accent);
}

.vitrine-public-title {
    margin: 0;
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.2;
    font-weight: 700;
}

.vitrine-public-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vitrine-public-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.vitrine-public-nav-link:hover,
.vitrine-public-nav-link.is-active {
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.vitrine-public-main {
    flex: 1;
}

.vitrine-public-main .section {
    padding-top: 20px;
    padding-bottom: 28px;
}

.vitrine-public-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.vitrine-public-footer-inner {
    display: grid;
    gap: 12px;
    padding: 20px 0 24px;
}

.vitrine-public-footer-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
}

.vitrine-public-footer-item {
    font-size: 14px;
}

.vitrine-public-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    align-items: center;
}

.vitrine-public-footer-meta a {
    color: var(--accent);
    text-decoration: none;
}

.vitrine-public-footer-meta a:hover {
    text-decoration: underline;
}

.vitrine-contacts-card {
    max-width: 640px;
}

.vitrine-contacts-block {
    display: grid;
    gap: 16px;
}

.vitrine-public-contact-name {
    margin: 8px 0 0;
    color: var(--muted);
}

.vitrine-public-contacts {
    display: grid;
    gap: 8px;
    min-width: min(100%, 320px);
}

.vitrine-public-contact-row {
    display: grid;
    gap: 2px;
}

.vitrine-public-contact-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vitrine-public-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.vitrine-public-social-links a {
    color: var(--accent);
    text-decoration: none;
}

.vitrine-public-social-links a:hover {
    text-decoration: underline;
}

.vitrine-results-card .cabinet-card-head {
    margin-bottom: 16px;
}

.vitrine-settings-form {
    display: grid;
    gap: 16px;
}

.crm-vitrine-status-card {
    max-width: 760px;
}

.crm-vitrine-enabled-field {
    margin-bottom: 4px;
}

.crm-vitrine-section-item {
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
}

.crm-vitrine-section-item input[type="checkbox"] {
    margin-top: 3px;
}

.crm-vitrine-section-item span {
    display: grid;
    gap: 2px;
}

.crm-vitrine-url-block {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.crm-vitrine-url-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.crm-vitrine-url {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    font-size: 13px;
    word-break: break-all;
}

.crm-vitrine-sections-list {
    display: grid;
    gap: 10px;
}

.vitrine-settings-grid {
    display: grid;
    gap: 16px;
}

.vitrine-settings-section-note {
    margin: -4px 0 0;
}

.vitrine-settings-form .cabinet-card .form-grid {
    margin-top: 2px;
}

.vitrine-owner-info {
    margin-top: 8px;
    max-width: 720px;
}

.vitrine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.vitrine-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vitrine-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.vitrine-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.vitrine-card-gallery-wrap {
    width: 100%;
}

.vitrine-card-gallery-shell {
    position: relative;
}

.vitrine-card-gallery {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scrollbar-width: none;
    border-radius: var(--radius-sm);
    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
}

.vitrine-card-gallery::-webkit-scrollbar {
    display: none;
}

.vitrine-card-gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100%;
    overflow: hidden;
}

.vitrine-card-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vitrine-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(21, 32, 51, 0.72);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 4px 14px rgba(15, 20, 36, 0.18);
    transition: background 0.15s ease, opacity 0.15s ease;
}

.vitrine-gallery-arrow:hover:not(:disabled) {
    background: rgba(21, 32, 51, 0.88);
}

.vitrine-gallery-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.vitrine-gallery-arrow-prev {
    left: 8px;
}

.vitrine-gallery-arrow-next {
    right: 8px;
}

.vitrine-card-gallery-foot {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.vitrine-card-gallery-indicator {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--surface-subtle);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.vitrine-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
}

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

.vitrine-card-image--empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
}

.vitrine-card-title {
    display: block;
    margin-bottom: 4px;
}

.vitrine-card-price {
    font-weight: 700;
    margin-bottom: 4px;
}

.vitrine-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vitrine-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin: 20px 0;
}

.vitrine-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.crm-object-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.crm-object-card-title {
    display: block;
    margin-bottom: 4px;
}

.crm-object-card-price {
    font-weight: 700;
    margin-bottom: 4px;
}

.crm-object-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.crm-empty {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.crm-edit-grid {
    display: grid;
    gap: 16px;
}

.crm-edit-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
}

.crm-edit-form .cabinet-card {
    overflow: visible;
}

.crm-edit-form .form-field.field-searchable {
    overflow: visible;
}

.crm-edit-form .form-field {
    display: grid;
    gap: 6px;
}

.crm-edit-form .form-field > span:first-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.crm-edit-form .form-field-wide {
    grid-column: 1 / -1;
}

.crm-edit-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.crm-edit-form textarea,
.crm-edit-form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-strong, var(--border));
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-edit-form textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.crm-edit-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.crm-edit-form textarea:focus,
.crm-edit-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-hint {
    margin-top: 2px;
    line-height: 1.4;
}

.crm-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.crm-extra-fields {
    display: grid;
    gap: 8px;
}

.crm-extra-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.crm-preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.crm-preview-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.crm-photos-dropzone {
    position: relative;
    margin-top: 12px;
}

.crm-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.crm-photo-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-subtle, #f1f5f9);
    cursor: grab;
    user-select: none;
}

.crm-photo-tile.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.crm-photo-tile.is-drop-target {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.crm-photo-tile-media,
.crm-photo-tile-media img {
    width: 100%;
    height: 100%;
}

.crm-photo-tile-media img {
    object-fit: cover;
    display: block;
}

.crm-photo-tile-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
}

.crm-photo-cover-badge,
.crm-photo-new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.crm-photo-cover-badge {
    background: rgba(37, 99, 235, 0.92);
    color: #fff;
}

.crm-photo-new-badge {
    top: auto;
    bottom: 28px;
    left: 8px;
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
}

.crm-photo-tile-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 18px 8px 6px;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.72));
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-photo-tile-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.crm-photo-tile:hover .crm-photo-tile-overlay,
.crm-photo-tile:focus-within .crm-photo-tile-overlay {
    opacity: 1;
}

.crm-photo-act {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.crm-photo-act:hover {
    background: #fff;
}

.crm-photo-act-danger {
    color: #b42318;
}

.crm-photo-drag-hint {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    letter-spacing: -2px;
    pointer-events: none;
}

.crm-photo-tile--add {
    display: grid;
    place-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px dashed var(--border);
    background: transparent;
    cursor: default;
    aspect-ratio: 4 / 3;
}

.crm-photo-tile--add:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.04);
}

.crm-photo-add-btn {
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.crm-photo-add-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary-soft, rgba(37, 99, 235, 0.12));
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.crm-photo-add-link {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.crm-photo-url-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    background: var(--surface-subtle, #f8fafc);
}

.crm-photo-url-panel-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

@media (hover: none) {
    .crm-photo-tile-overlay {
        opacity: 1;
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.15), transparent 45%);
    }

    .crm-photo-act {
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    }
}

.crm-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.cabinet-card-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.crm-add-btn.is-active {
    color: #047857;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

@media (max-width: 720px) {
    .crm-object-card-link {
        grid-template-columns: 1fr;
    }

    .crm-object-card-image {
        width: 100%;
        height: 160px;
    }

    .crm-object-card-footer {
        justify-content: stretch;
    }

    .crm-vitrine-switch {
        width: 100%;
        justify-content: space-between;
    }

    .crm-edit-form .form-grid {
        grid-template-columns: 1fr;
    }

    .crm-extra-row {
        grid-template-columns: 1fr;
    }

    .crm-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 720px) {
    .cabinet-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-shell {
        grid-template-columns: 1fr;
    }

    .cabinet-nav {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .cabinet-nav-link {
        justify-content: flex-start;
    }

    .cabinet-access-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-access-hero,
    .cabinet-access-plans,
    .cabinet-access-history,
    .cabinet-api-hero {
        grid-template-columns: 1fr;
    }

    .cabinet-access-plan__info {
        grid-template-columns: 1fr;
    }

    .cabinet-access-timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cabinet-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.auth-form,
.admin-form {
    display: grid;
    gap: 14px;
}

.auth-consent-field {
    margin-top: 4px;
}

.auth-consent-field__text {
    line-height: 1.45;
    color: var(--muted);
}

.auth-consent-field__text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
}

.w-100 {
    width: 100%;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    line-height: 1.1;
}

.admin-db-overview {
    margin-bottom: 18px;
}

.admin-db-overview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.admin-db-total {
    text-align: right;
    min-width: 180px;
}

.admin-db-total-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.admin-db-total-value {
    display: block;
    font-size: 42px;
    line-height: 1;
    color: var(--primary, #2563eb);
}

.admin-db-meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.admin-db-meta-item {
    background: var(--bg, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
}

.admin-db-meta-item strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
}

.admin-db-note {
    margin: 0 0 18px;
}

.admin-db-tables-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.admin-db-tables-grid--wide {
    grid-template-columns: 1.4fr 1fr;
}

.admin-db-table-title {
    margin: 0 0 10px;
    font-size: 15px;
}

@media (max-width: 1100px) {
    .admin-db-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-db-tables-grid,
    .admin-db-tables-grid--wide {
        grid-template-columns: 1fr;
    }

    .admin-db-overview-head {
        flex-direction: column;
    }

    .admin-db-total {
        text-align: left;
    }
}

.admin-card-backfill {
    margin-bottom: 18px;
}

.admin-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.admin-tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    margin-bottom: -1px;
    padding: 10px 14px;
}

.admin-tab.is-active {
    border-bottom-color: var(--primary, #2563eb);
    color: var(--text, inherit);
    font-weight: 600;
}

.admin-tab-panel[hidden] {
    display: none;
}

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

.admin-backfill-form-title {
    margin: 0 0 8px;
    font-size: 16px;
}

.admin-backfill-status {
    margin-top: 12px;
}

.admin-backfill-status-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-backfill-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.admin-backfill-metrics strong {
    display: block;
    font-size: 20px;
    margin-top: 4px;
}

.admin-progress {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.admin-progress-indeterminate span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--primary, #2563eb);
    border-radius: 999px;
    animation: admin-progress-slide 1.2s ease-in-out infinite;
}

@keyframes admin-progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

@media (max-width: 900px) {
    .admin-backfill-forms {
        grid-template-columns: 1fr;
    }

    .admin-backfill-metrics {
        grid-template-columns: 1fr;
    }
}

.admin-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
}

.badge-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.badge-warn {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.badge-error {
    background: rgba(217, 45, 32, 0.12);
    color: #912018;
}

.admin-health-card {
    margin-bottom: 16px;
}

.admin-health-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.admin-health-head h2 {
    margin: 0 0 4px;
}

.admin-health-message {
    margin: 0 0 12px;
}

.admin-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-health-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface-muted, #f9fafb);
}

.admin-health-item-title {
    font-weight: 600;
}

.admin-health-meta {
    margin: 12px 0 0;
}

@media (max-width: 700px) {
    .admin-health-grid {
        grid-template-columns: 1fr;
    }
}

.admin-table {
    min-width: 0;
}

.parser-log-details {
    margin: 0;
}

.parser-log-summary {
    cursor: pointer;
    color: var(--primary, #2563eb);
    font-size: 12px;
    line-height: 1.4;
}

.parser-log-details-body {
    margin-top: 8px;
    display: grid;
    gap: 8px;
    min-width: 280px;
    max-width: 420px;
}

.parser-log-block strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
}

.parser-log-block pre {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
}

.nav-user {
    padding: 6px 4px;
    font-size: 13px;
    max-width: min(220px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout {
    display: inline-flex;
}

.admin-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-inline {
    margin-top: 12px;
}

.admin-form-checkboxes {
    margin-bottom: 14px;
}

.field-label {
    font-size: 0.92rem;
    color: var(--muted);
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    flex: 0 0 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-field input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-soft);
    outline-offset: 2px;
}

.crm-vitrine-enabled-field {
    align-items: center;
}

.crm-vitrine-enabled-field input[type="checkbox"] {
    margin-top: 0;
}

@media (max-width: 960px) {
    .admin-grid-3 {
        grid-template-columns: 1fr;
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .header-auth-register {
        display: none;
    }
}

@media (max-width: 720px) {
    .stats-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .nav {
        flex-wrap: wrap;
    }

    .site-nav {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        margin-top: 16px;
        margin-bottom: 10px;
        padding: 0 var(--container-gutter);
        width: 100%;
        max-width: 100%;
    }

    .site-nav .site-nav-inner {
        display: contents;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .header-nav-track {
        flex-wrap: nowrap;
        width: max-content;
        max-width: none;
        padding-bottom: 2px;
    }

    .site-nav .nav-link {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .header-top {
        gap: 8px;
    }

    .header-user {
        flex: 0 0 auto;
        gap: 4px;
    }

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

    .brand-mark {
        display: none;
    }

    body.page-listing-detail .brand-mark {
        display: none;
    }

    .brand-text {
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
    }

    .header-auth-register {
        display: none;
    }

    .nav-logout {
        display: none;
    }

    .header-user .nav-link-compact {
        padding: 6px 8px;
        font-size: 13px;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    .nav-user {
        display: none;
    }

    .geo-bar-label {
        display: none;
    }

    .geo-bar-region {
        max-width: min(150px, 34vw);
    }

    .geo-bar-city {
        max-width: min(130px, 30vw);
    }

    .geo-bar-btn {
        font-size: 12px;
        gap: 4px;
    }

    .geo-picker-modal-dialog {
        width: calc(100% - 16px);
        margin-top: 5vh;
        max-height: 90vh;
    }

    .home-regions-split {
        grid-template-columns: 1fr;
    }

    .home-crm-panel {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .home-crm-panel-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .home-crm-copy h2 {
        max-width: none;
    }

    .home-crm-features {
        grid-template-columns: 1fr;
    }

    .home-referrals-panel {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .home-referrals-panel-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .home-referrals-copy h2 {
        max-width: none;
    }

    .home-referrals-features {
        grid-template-columns: 1fr;
    }

    .home-regions-list {
        max-height: 180px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .home-regions-cities {
        max-height: 320px;
        grid-template-columns: 1fr;
    }

    .region-cities {
        grid-template-columns: 1fr;
    }

    .region-group-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.admin-nav-link.active,
.admin-nav-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-section {
    margin-bottom: 32px;
}

.admin-section-head {
    margin-bottom: 16px;
}

.admin-section-title {
    margin: 0 0 4px;
    font-size: 1.35rem;
    line-height: 1.2;
}

.admin-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 16px;
    margin: 0;
}

.admin-dl dt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-dl dd {
    margin: 0;
    font-size: 14px;
}

.admin-card h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.admin-form-actions {
    display: flex;
    align-items: flex-end;
}

.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-subnav-link {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.admin-subnav-link.active,
.admin-subnav-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.admin-job-resume-hint {
    margin-top: 8px;
}

.admin-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

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

.admin-db-data-table {
    min-width: 900px;
}

.admin-db-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.admin-db-row-actions {
    white-space: nowrap;
}

.admin-row-details {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px 20px;
    margin: 0;
}

.admin-row-details dt {
    margin: 0;
}

.admin-row-details dd {
    margin: 0;
    word-break: break-word;
}

.admin-json-block {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-subtle);
    overflow-x: auto;
    font-size: 12px;
}

@media (max-width: 900px) {
    .admin-row-details {
        grid-template-columns: 1fr;
    }
}

.admin-card-wide {
    margin-top: 0;
}

.admin-card-danger {
    margin-top: 16px;
    border-color: rgba(220, 38, 38, 0.25);
}

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

.admin-form-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-span-2 {
    grid-column: 1 / -1;
}

/* ——— Tariffs page ——— */

.tariffs-page {
    padding: 40px 0 72px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.08), transparent),
        linear-gradient(180deg, var(--surface-subtle) 0%, var(--bg) 320px);
}

.tariffs-container {
    max-width: 1080px;
}

.tariffs-hero {
    max-width: 640px;
    margin: 0 auto 36px;
    text-align: center;
}

.tariffs-hero__title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--text);
}

.tariffs-hero__lead {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--muted);
}

.tariffs-alert {
    max-width: 720px;
    margin: 0 auto 24px;
}

.tariffs-balance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    max-width: 480px;
    margin: 0 auto 40px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.tariffs-balance__label {
    font-size: 0.875rem;
    color: var(--muted);
}

.tariffs-balance__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.tariffs-balance__link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.tariffs-balance__link:hover {
    text-decoration: underline;
}

.tariffs-section {
    margin-bottom: 48px;
}

.tariffs-section--api {
    margin-bottom: 40px;
}

.tariffs-section--integration {
    margin-bottom: 40px;
}

.tariffs-section__head {
    margin-bottom: 24px;
    text-align: center;
}

.tariffs-section__title {
    margin: 0 0 8px;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.tariffs-section__desc {
    margin: 0 auto;
    max-width: 520px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--muted);
}

.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.tariffs-grid--api {
    margin: 0 auto;
}

@media (min-width: 641px) {
    .tariffs-grid--api {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tariffs-grid--integration {
    max-width: 960px;
    margin: 0 auto;
}

.tariff-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(15, 20, 36, 0.06), 0 8px 24px rgba(15, 20, 36, 0.04);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tariff-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 12px 32px rgba(15, 20, 36, 0.1);
}

.tariff-card--discount {
    border-color: rgba(22, 163, 74, 0.28);
}

.tariff-card--service {
    border-color: rgba(124, 92, 255, 0.28);
}

.tariff-card__head {
    padding: 24px 24px 0;
    text-align: center;
}

.tariff-card__title {
    margin: 0 0 10px;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text);
}

.tariff-card__duration {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface-subtle);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
}

.tariff-card__pricing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 24px 0;
    text-align: center;
}

.tariff-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 4px 6px;
    margin-bottom: 12px;
}

.tariff-card__price-value {
    font-size: clamp(1.75rem, 4.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.tariff-card__price-value--free {
    font-size: 1.5rem;
    color: var(--muted);
}

.tariff-card__price-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.tariff-card__discount {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    font-size: 0.8125rem;
    font-weight: 700;
    color: #15803d;
    letter-spacing: 0.01em;
}

.tariff-card__total {
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-subtle);
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted);
}

.tariff-card__total strong {
    display: block;
    margin-top: 4px;
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tariff-card__cta {
    padding: 20px 24px 0;
    margin-top: auto;
}

.tariff-card__form {
    margin: 0;
}

.tariff-card__btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.tariff-card__features {
    list-style: none;
    margin: 20px 0 0;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.tariff-card__features li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted);
}

.tariff-card__features li:last-child {
    margin-bottom: 0;
}

.tariff-card__features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.85;
}

.tariffs-contacts {
    margin-top: 16px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.tariffs-contacts p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--muted);
}

.tariffs-contacts a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.tariffs-contacts a:hover {
    text-decoration: underline;
}

html[data-theme="dark"] .tariff-card__discount {
    background: rgba(74, 222, 128, 0.14);
    color: #86efac;
}

html[data-theme="dark"] .tariff-card--discount {
    border-color: rgba(74, 222, 128, 0.3);
}

html[data-theme="dark"] .tariff-card--service {
    border-color: rgba(167, 139, 250, 0.35);
}

html[data-theme="dark"] .tariff-card:hover {
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
    .tariffs-page {
        padding: 28px 0 48px;
    }

    .tariffs-hero {
        margin-bottom: 28px;
    }

    .tariffs-hero__lead {
        font-size: 1rem;
    }

    .tariffs-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tariff-card__head,
    .tariff-card__pricing,
    .tariff-card__cta {
        padding-left: 20px;
        padding-right: 20px;
    }

    .tariff-card__features {
        padding: 16px 20px 20px;
    }
}

/* Legacy admin / unused public blocks */
.tariffs-section-label {
    margin: 28px 0 14px;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
}

.tariffs-section-label-api {
    margin-top: 40px;
}

.tariff-card-days {
    margin: 0 0 12px;
    font-size: 14px;
}

.tariff-card-period,
.tariff-card-price,
.tariff-card-discount,
.tariff-card-discount-empty,
.tariff-card-total,
.tariff-card-btn,
.tariff-card-features,
.tariffs-api-note,
.tariff-purchase-form {
    /* deprecated — use tariff-card__* */
}

.tariff-purchase-form {
    /* deprecated */
}

.admin-form-delete {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.admin-users-toolbar {
    margin-bottom: 16px;
    padding: 16px 18px;
}

.admin-users-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.admin-users-search-field {
    flex: 1 1 280px;
    margin: 0;
}

.admin-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.admin-table-actions .inline-form {
    display: inline;
}

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-danger {
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.35);
}

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

.admin-pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.admin-pagination .page-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-tab {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.settings-tab.active,
.settings-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.tariff-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.tariff-admin-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

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

.tariff-admin-hint {
    margin: -4px 0 10px;
}

.doc-page {
    padding-top: 24px;
}

.doc-content-text {
    white-space: pre-wrap;
    line-height: 1.7;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 14px;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.cookie-banner-inner p {
    margin: 0;
}

.cookie-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35em 0.75em;
    min-width: 0;
    flex: 1;
}

.cookie-banner-copy {
    min-width: 0;
}

.cookie-banner-copy p {
    margin: 0;
    display: inline;
}

.cookie-banner-more {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
}

.title-link {
    font-weight: 700;
    color: var(--text);
}

.listing-row-address {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.listings-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
}

.listings-load-more-btn {
    min-width: 220px;
}

.listings-load-more-meta {
    text-align: center;
}

.listings-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.listings-append-table {
    display: none;
}

a.title-link.listing-card-link {
    text-decoration: none;
}

a.title-link.listing-card-link:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.subline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.listing-category-link {
    text-decoration: none;
}

.listing-category-link:hover {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
    text-decoration: none;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
}

.site-footer {
    margin-top: 48px;
    padding: 0 0 24px;
    background: transparent;
    border: none;
}

.site-footer-panel {
    position: relative;
    overflow: hidden;
    margin: 0 calc(var(--container-gutter) * -0.5);
    padding: clamp(32px, 5vw, 52px) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(37, 99, 235, 0.1) 0%, transparent 58%),
        radial-gradient(70% 90% at 100% 100%, rgba(16, 185, 129, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, var(--surface-subtle) 0%, var(--surface) 100%);
}

.site-footer-glow {
    position: absolute;
    right: -80px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.site-footer-inner {
    position: relative;
    z-index: 1;
}

.site-footer-top {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.4fr);
    gap: clamp(28px, 5vw, 56px);
    align-items: start;
}

.site-footer-brand-col {
    display: grid;
    gap: 14px;
    max-width: 420px;
}

.site-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.site-footer-brand:hover {
    color: var(--text);
}

.site-footer-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.site-footer-tagline {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.site-footer-promo {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    align-items: center;
    margin-top: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.site-footer-promo:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.38);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
    color: inherit;
}

.site-footer-promo__label {
    grid-column: 1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #059669;
}

.site-footer-promo__text {
    grid-column: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.site-footer-promo__arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: 1.25rem;
    color: #059669;
    font-weight: 700;
}

.site-footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 40px);
}

.site-footer-nav-title {
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.site-footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

.site-footer-links a:hover {
    color: var(--primary);
    transform: translateX(2px);
}

.site-footer-bottom {
    padding-top: 18px;
}

.site-footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 20px;
}

.site-footer-copy,
.site-footer-inn {
    margin: 0;
}

.site-footer-tg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: 14px;
    border-radius: 50%;
    color: #fff;
    background: #229ed9;
    text-decoration: none;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
}

.footer-nav a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--primary);
}

.analytics-page .page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.analytics-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.analytics-sidebar {
    display: grid;
    gap: 16px;
}

.analytics-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analytics-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.analytics-chip.active,
.analytics-chip:hover {
    border-color: #bfd4ff;
    background: var(--primary-soft);
    color: var(--primary);
}

.analytics-city-browser {
    max-height: 280px;
    overflow: auto;
    margin-top: 10px;
}

.analytics-city-browser .region-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: var(--surface);
}

.analytics-city-browser .region-group.is-filtered-out {
    display: none;
}

.analytics-city-browser .region-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.analytics-city-pick {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.analytics-city-pick:hover {
    border-color: #bfd4ff;
    color: var(--primary);
}

.analytics-city-pick.is-hidden {
    display: none;
}

.analytics-results-card h2 {
    margin: 0;
}

.analytics-results-head {
    margin-bottom: 16px;
}

.analytics-table th,
.analytics-table td {
    min-width: 110px;
}

.analytics-table td strong {
    display: block;
}

@media (max-width: 960px) {
    .analytics-layout {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .site-footer-top {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .site-footer-nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .footer-inner {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .site-footer-nav-grid {
        grid-template-columns: 1fr;
    }

    .site-footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }
}


.htmx-request .table-wrap {
    opacity: 0.55;
}

@media (max-width: 960px) {
    .hero-grid,
    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .deal-tabs {
        grid-template-columns: 1fr 1fr;
    }

    .quick-cities {
        margin-left: 0;
        width: 100%;
    }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.page-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

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

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-dots,
.page-info {
    padding: 0 4px;
}

.filters-grid-wide {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.listing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.listing-hero {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
}

.listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    color: var(--muted);
}

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

@media (max-width: 960px) {
    .filters-grid-wide {
        grid-template-columns: 1fr 1fr;
    }

    .table-wrap {
        overflow-x: clip;
        max-width: 100%;
        min-width: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .parser-page .container,
    #listings-panel {
        min-width: 0;
        max-width: 100%;
    }

    .listings-table {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .listings-table thead {
        display: none;
    }

    .listings-table tbody {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .listings-table tr,
    .listings-table td {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .listings-table tr.listing-row {
        margin-bottom: 14px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        display: flex;
        flex-direction: column;
        overflow: visible;
        position: relative;
    }

    .listings-table tr.listing-row td[data-label="Объявление"] {
        order: 1;
    }

    .listings-table td {
        align-items: stretch;
        gap: 0;
        padding: 7px 0;
        border-bottom: 1px dashed var(--border);
        font-size: 14px;
    }

    .listings-table td:last-child {
        border-bottom: 0;
    }

    .listings-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .listing-title {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .listing-mobile-gallery-wrap,
    .listing-mobile-summary,
    .listing-mobile-actions,
    .listing-mobile-price,
    .listing-card-body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .listing-mobile-gallery-wrap,
    .listing-mobile-summary,
    .listing-mobile-actions,
    .listing-mobile-price {
        display: block;
    }

    .listing-mobile-gallery {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .listing-card-meta {
        display: none !important;
    }

    .listing-actions-cell--desktop {
        display: none !important;
    }

    .listing-mobile-actions {
        margin: 0 0 12px;
        position: relative;
        overflow: visible;
        z-index: 2;
    }

    .listing-mobile-actions::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 28px;
        height: 52px;
        background: linear-gradient(90deg, transparent, var(--surface));
        pointer-events: none;
    }

    .listing-row.is-expanded .listing-mobile-actions::after {
        background: linear-gradient(90deg, transparent, var(--surface-subtle));
    }

    .listing-mobile-actions .listing-action-stack {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scrollbar-width: none;
        padding: 56px 0 4px;
        margin-top: -52px;
    }

    .listing-mobile-actions .listing-action-stack::-webkit-scrollbar {
        display: none;
    }

    .listing-mobile-actions .has-tooltip::after {
        left: 50%;
        top: auto;
        bottom: calc(100% + 8px);
        transform: translateX(-50%);
    }

    .listing-mobile-actions .has-tooltip::before {
        left: 50%;
        top: auto;
        bottom: calc(100% + 2px);
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: rgba(15, 20, 36, 0.94);
        border-right-color: transparent;
    }

    .listing-mobile-actions .listing-action-stack .icon-btn {
        flex: 0 0 52px;
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .listing-thumb-wrap {
        display: none;
    }

    .listing-title {
        flex-direction: column;
        gap: 0;
    }

    .listing-title > .listing-card-body {
        width: 100%;
    }

    /* В свёрнутой карточке скрываем дубли полей — они в summary и mobile-price. */
    .listings-table td[data-label="Контакт"] {
        display: none;
    }

    .listings-table td[data-label="Объявление"]::before,
    .listing-mobile-price::before {
        display: none;
    }

    .listings-table td[data-label="Объявление"] {
        display: block;
        border-bottom: 0;
        padding: 0;
    }

    .listing-preview {
        display: none;
    }

    .listing-row:not(.is-expanded) .subline .photo-open-btn {
        display: none;
    }

    .listing-row:not(.is-expanded) .listing-dates {
        display: none;
    }

    .listing-mobile-dates {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
        margin: 0 0 10px;
        font-size: 11px;
        line-height: 1.35;
        font-weight: 500;
        color: var(--muted);
    }

    .listing-mobile-dates .listing-date-created {
        color: var(--muted);
    }

    .listing-mobile-dates .listing-date-updated {
        color: var(--muted);
    }

    .listing-mobile-dates span + span::before {
        content: '·';
        margin-right: 8px;
        opacity: 0.65;
    }

    .listing-mobile-price {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding-top: 8px;
        grid-template-columns: 1fr;
    }

    .listing-row:not(.is-expanded) .listing-mobile-price .listing-price-per-sqm {
        display: block;
    }

    .listing-row:not(.is-expanded) .listing-mobile-price .listing-deposit {
        display: block;
    }

    .listing-mobile-price strong {
        font-size: 18px;
    }

    .listing-row.is-expanded {
        padding-bottom: 0;
        overflow: visible;
    }

    .listing-row.is-expanded > td[data-label="Объявление"] > .listing-mobile-gallery-wrap,
    .listing-row.is-expanded .listing-mobile-summary-grid,
    .listing-row.is-expanded .listing-mobile-map-actions,
    .listing-row.is-expanded .listing-mobile-dates {
        display: none !important;
    }

    .listing-row.is-expanded .expand-gallery-mobile {
        display: block !important;
    }

    .listing-row.is-expanded .listing-mobile-summary {
        margin-bottom: 8px;
        padding: 10px 12px;
    }

    .listing-row.is-expanded .listing-mobile-price {
        margin-top: 2px;
        padding: 12px 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .listing-row.is-expanded .listing-mobile-price strong {
        font-size: 22px;
        line-height: 1.15;
    }

    .listing-row.is-expanded .listing-card-body .subline {
        margin-top: 4px;
    }

    .listing-expand-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .listing-expand-panel {
        margin: 12px -14px 0;
        padding: 16px 14px 14px;
        border-top: 1px solid var(--border);
        border-radius: 0 0 14px 14px;
        background: var(--surface-subtle);
    }

    .listing-expand-main,
    .listing-expand-side {
        display: flex;
        flex-direction: column;
        gap: 14px;
        min-width: 0;
    }

    .listing-expand-main h3,
    .listing-expand-side h3,
    .map-block-head h3 {
        margin: 0 0 10px;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .listing-expand .expand-gallery,
    .listing-expand .map-block,
    .listing-expand .expand-meta {
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .listing-expand .map-block {
        margin-bottom: 0;
    }

    .listing-mobile-gallery-links {
        display: flex;
    }

    .listing-row.is-expanded .listing-mobile-gallery-links {
        display: none;
    }

    .listing-expand .expand-gallery-head,
    .listing-expand .map-block-head {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }

    .listing-expand .expand-gallery-head .expand-gallery-actions--desktop,
    .listing-detail-gallery .expand-gallery-head .expand-gallery-actions--desktop {
        display: none;
    }

    .expand-gallery-mobile {
        display: block;
        margin-bottom: 0;
    }

    .expand-gallery-mobile .listing-mobile-gallery-slide {
        aspect-ratio: 4 / 3;
        min-height: 220px;
    }

    .expand-gallery-grid--desktop {
        display: none !important;
    }

    .expand-gallery-actions--mobile {
        display: flex;
        justify-content: center;
        gap: 16px;
        margin-top: 10px;
        padding-top: 4px;
    }

    .listing-expand .expand-gallery-actions--mobile,
    .listing-detail-gallery .expand-gallery-actions--mobile {
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }

    .listing-expand .expand-gallery-head h3,
    .listing-expand .map-block-head h3,
    .listing-detail-gallery .expand-gallery-title {
        margin: 0;
        flex: 1 1 auto;
    }

    .listing-expand .expand-gallery-grid {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        grid-template-columns: none;
        padding-bottom: 2px;
        margin: 0 -4px;
    }

    .listing-expand .expand-gallery-grid::-webkit-scrollbar {
        display: none;
    }

    .listing-expand .expand-gallery-item {
        flex: 0 0 calc(100% - 8px);
        scroll-snap-align: start;
        aspect-ratio: 4 / 3;
        border-radius: 12px;
        overflow: hidden;
    }

    .listing-expand .expand-gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .listing-description {
        margin: 0;
        padding: 14px;
        border-radius: 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        font-size: 14px;
        line-height: 1.6;
        box-shadow: var(--shadow-sm);
    }

    .param-section {
        margin: 0;
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .param-section h4 {
        margin: 0;
        padding: 11px 14px;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--muted);
        background: var(--surface-subtle);
        border-bottom: 1px solid var(--border);
    }

    .param-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
        padding: 10px;
    }

    .param-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        padding: 9px 10px;
        border-radius: 10px;
        background: var(--surface-subtle);
        border: 1px solid var(--border);
    }

    .param-row dt {
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        line-height: 1.25;
    }

    .param-row dd {
        margin: 0;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.35;
        word-break: break-word;
    }

    .expand-meta {
        display: grid;
        gap: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .expand-meta > div {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 10px 12px;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
    }

    .expand-meta > div:last-child {
        border-bottom: 0;
    }

    .expand-meta > div > .muted {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        line-height: 1.35;
    }

    .expand-meta strong {
        margin: 0;
        font-size: 14px;
        line-height: 1.4;
        word-break: break-word;
    }

    .map-address {
        margin: 0;
        font-size: 14px;
        line-height: 1.45;
        word-break: break-word;
    }

    .expand-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 2px;
    }

    .expand-actions .btn {
        width: 100%;
        justify-content: center;
    }

    @media (max-width: 420px) {
        .param-list {
            grid-template-columns: 1fr;
        }
    }
}

@media (max-width: 720px) {
    .filters-grid-wide {
        grid-template-columns: 1fr;
    }

    .hero-grid,
    .filters-grid,
    .deal-tabs {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Dark theme refinements ===== */
html[data-theme="dark"] .alert-error {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

html[data-theme="dark"] .badge-favorite {
    background: rgba(251, 113, 133, 0.16);
    color: #fda4af;
}

html[data-theme="dark"] .badge-viewed {
    background: rgba(96, 165, 250, 0.16);
    color: #93c5fd;
}

html[data-theme="dark"] .badge-phone-protected {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

html[data-theme="dark"] .badge-ok {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

html[data-theme="dark"] .badge-warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

html[data-theme="dark"] .badge-error {
    background: rgba(248, 113, 113, 0.16);
    color: #fca5a5;
}

html[data-theme="dark"] .listing-action-stack .icon-btn,
html[data-theme="dark"] .listing-detail-actions .mark-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .listing-action-stack .mark-btn.is-active.favorite-btn,
html[data-theme="dark"] .listing-detail-actions .mark-btn.is-active.favorite-btn,
html[data-theme="dark"] .mark-btn.is-active.favorite-btn {
    background: linear-gradient(180deg, rgba(251, 113, 133, 0.22) 0%, rgba(244, 63, 94, 0.14) 100%);
    border-color: rgba(251, 113, 133, 0.45);
    color: #fda4af;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

html[data-theme="dark"] .listing-action-stack .mark-btn.is-active.viewed-btn,
html[data-theme="dark"] .listing-detail-actions .mark-btn.is-active.viewed-btn,
html[data-theme="dark"] .mark-btn.is-active.viewed-btn {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.22) 0%, rgba(37, 99, 235, 0.14) 100%);
    border-color: rgba(96, 165, 250, 0.45);
    color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

html[data-theme="dark"] .listing-action-stack .mark-btn.is-active.note-btn,
html[data-theme="dark"] .listing-detail-actions .mark-btn.is-active.note-btn,
html[data-theme="dark"] .mark-btn.is-active.note-btn {
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.12) 100%);
    border-color: rgba(251, 191, 36, 0.42);
    color: #fcd34d;
}

html[data-theme="dark"] .listing-action-stack .mark-btn.is-active.callback-btn,
html[data-theme="dark"] .listing-detail-actions .mark-btn.is-active.callback-btn,
html[data-theme="dark"] .mark-btn.is-active.callback-btn {
    background: linear-gradient(180deg, rgba(251, 146, 60, 0.22) 0%, rgba(234, 88, 12, 0.14) 100%);
    border-color: rgba(251, 146, 60, 0.42);
    color: #fdba74;
}

html[data-theme="dark"] .listing-action-stack .mark-btn.is-active.tag-btn,
html[data-theme="dark"] .listing-detail-actions .mark-btn.is-active.tag-btn {
    background: linear-gradient(180deg, rgba(129, 140, 248, 0.22) 0%, rgba(99, 102, 241, 0.14) 100%);
    border-color: rgba(129, 140, 248, 0.42);
    color: #a5b4fc;
}

html[data-theme="dark"] .listing-action-stack .expand-btn[aria-expanded="true"] {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.22) 0%, rgba(37, 99, 235, 0.14) 100%);
    border-color: rgba(96, 165, 250, 0.45);
    color: #93c5fd;
}

html[data-theme="dark"] .metro-distance-badge {
    background: var(--primary-soft);
    border-color: rgba(91, 140, 255, 0.3);
    color: #93b4ff;
}

@media (max-width: 960px) {
    html[data-theme="dark"] .listing-row.is-expanded .listing-mobile-price,
    html[data-theme="dark"] .listing-expand .expand-gallery,
    html[data-theme="dark"] .listing-expand .map-block,
    html[data-theme="dark"] .listing-expand .expand-meta,
    html[data-theme="dark"] .listing-description,
    html[data-theme="dark"] .param-section {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.1);
    }

    html[data-theme="dark"] .listing-row.is-expanded .listing-expand-panel {
        background: rgba(255, 255, 255, 0.02);
    }

    html[data-theme="dark"] .param-section h4,
    html[data-theme="dark"] .param-row {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.08);
    }

    html[data-theme="dark"] .expand-meta > div {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }
}

@media (min-width: 961px) {
    html[data-theme="dark"] .listing-row.is-expanded:not(.is-favorite):not(.is-viewed) {
        background:
            linear-gradient(180deg, rgba(91, 140, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%),
            var(--surface-subtle);
    }

    html[data-theme="dark"] .listing-expand-panel {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    html[data-theme="dark"] .listing-description,
    html[data-theme="dark"] .param-section,
    html[data-theme="dark"] .listing-expand .expand-gallery,
    html[data-theme="dark"] .listing-expand .map-block,
    html[data-theme="dark"] .expand-meta {
        background: rgba(255, 255, 255, 0.035);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    }

    html[data-theme="dark"] .param-section h4 {
        background: rgba(255, 255, 255, 0.045);
        border-bottom-color: rgba(255, 255, 255, 0.08);
        color: #a1a8b3;
    }

    html[data-theme="dark"] .param-row {
        background: rgba(255, 255, 255, 0.025);
        border-color: rgba(255, 255, 255, 0.08);
    }

    html[data-theme="dark"] .param-row dt {
        color: #8b929e;
    }

    html[data-theme="dark"] .expand-meta > div {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    html[data-theme="dark"] .expand-meta > div > .muted {
        color: #8b929e;
    }

    html[data-theme="dark"] .expand-gallery-item {
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.02);
    }

    html[data-theme="dark"] .expand-gallery-item img {
        background: rgba(255, 255, 255, 0.03);
    }

    html[data-theme="dark"] .map-address,
    html[data-theme="dark"] .map-address .address-link {
        color: var(--text);
    }
}

html[data-theme="dark"] .listing-mobile-summary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .listing-card-meta {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .listing-spec-pill {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .expand-btn-card {
    border-color: rgba(91, 140, 255, 0.35);
    background: rgba(91, 140, 255, 0.12);
    color: #93c5fd;
}

html[data-theme="dark"] .expand-btn-card:hover {
    background: rgba(91, 140, 255, 0.18);
    border-color: rgba(91, 140, 255, 0.45);
}

html[data-theme="dark"] .expand-btn-card[aria-expanded="true"] {
    background: linear-gradient(180deg, rgba(91, 140, 255, 0.18) 0%, rgba(91, 140, 255, 0.1) 100%);
    border-color: rgba(91, 140, 255, 0.45);
    color: #bfdbfe;
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

html[data-theme="dark"] .listing-gallery-arrow {
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
}

html[data-theme="dark"] .listing-gallery-arrow:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.94);
}

html[data-theme="dark"] .listing-desktop-gallery-indicator {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .listing-mobile-gallery-indicator {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .listing-mobile-phone {
    background: rgba(91, 140, 255, 0.12);
    color: #93c5fd;
}

html[data-theme="dark"] .has-tooltip::after {
    background: rgba(20, 23, 29, 0.96);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .has-tooltip::before {
    border-right-color: rgba(20, 23, 29, 0.96);
}

html[data-theme="dark"] .listing-detail-actions .has-tooltip::before,
html[data-theme="dark"] .listing-mobile-actions .has-tooltip::before {
    border-right-color: transparent;
    border-bottom-color: rgba(20, 23, 29, 0.96);
    border-top-color: transparent;
}

html[data-theme="dark"] .listing-mobile-actions .has-tooltip::before {
    border-top-color: rgba(20, 23, 29, 0.96);
    border-bottom-color: transparent;
}

html[data-theme="dark"] .listing-row.is-favorite {
    box-shadow: inset 4px 0 0 #fb7185;
    background: rgba(251, 113, 133, 0.1);
}

html[data-theme="dark"] .listing-row.is-viewed:not(.is-favorite) {
    box-shadow: inset 4px 0 0 #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

html[data-theme="dark"] .listing-row.is-just-returned {
    box-shadow: inset 4px 0 0 var(--primary), 0 0 0 1px rgba(91, 140, 255, 0.28);
    background: rgba(91, 140, 255, 0.14);
}

html[data-theme="dark"] .listing-row.is-favorite.is-viewed {
    box-shadow: inset 4px 0 0 #fb7185, inset 8px 0 0 #60a5fa;
    background: linear-gradient(90deg, rgba(251, 113, 133, 0.12) 0, rgba(96, 165, 250, 0.08) 100%);
}

html[data-theme="dark"] .listing-detail-card.is-favorite {
    box-shadow: inset 4px 0 0 #fb7185, var(--shadow);
    background:
        linear-gradient(90deg, rgba(251, 113, 133, 0.12) 0, transparent 140px),
        var(--surface);
}

html[data-theme="dark"] .listing-detail-card.is-viewed:not(.is-favorite) {
    box-shadow: inset 4px 0 0 #60a5fa, var(--shadow);
    background:
        linear-gradient(90deg, rgba(96, 165, 250, 0.12) 0, transparent 140px),
        var(--surface);
}

html[data-theme="dark"] .listing-detail-card.is-favorite.is-viewed {
    box-shadow: inset 4px 0 0 #fb7185, inset 8px 0 0 #60a5fa, var(--shadow);
}

html[data-theme="dark"] .listing-thumb.is-broken,
html[data-theme="dark"] .listing-thumb-empty {
    color: var(--muted);
}

html[data-theme="dark"] img {
    opacity: 0.94;
}

/* Theme toggle button */
.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-left: 4px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
    background: var(--surface-subtle);
    color: var(--primary);
    border-color: var(--border-strong);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
    grid-area: 1 / 1;
}

.theme-toggle .icon-moon {
    display: block;
}

html[data-theme="dark"] .theme-toggle {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.28);
    color: #fbbf24;
}

html[data-theme="dark"] .theme-toggle:hover {
    background: rgba(251, 191, 36, 0.16);
    border-color: rgba(251, 191, 36, 0.42);
    color: #fcd34d;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

html[data-theme="dark"] .home-crm-panel {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(91, 140, 255, 0.16) 0%, transparent 55%),
        linear-gradient(165deg, var(--surface) 0%, var(--surface-subtle) 100%);
}

html[data-theme="dark"] .home-crm-feature {
    background: rgba(20, 23, 29, 0.82);
    border-color: rgba(91, 140, 255, 0.18);
}

html[data-theme="dark"] .home-crm-feature:hover {
    border-color: rgba(91, 140, 255, 0.34);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .home-referrals-panel {
    background:
        radial-gradient(120% 140% at 0% 100%, rgba(52, 211, 153, 0.14) 0%, transparent 55%),
        linear-gradient(165deg, var(--surface) 0%, var(--surface-subtle) 100%);
}

html[data-theme="dark"] .home-referrals-badge {
    color: #34d399;
    background: rgba(52, 211, 153, 0.14);
}

html[data-theme="dark"] .home-referrals-feature {
    background: rgba(20, 23, 29, 0.82);
    border-color: rgba(52, 211, 153, 0.18);
}

html[data-theme="dark"] .home-referrals-feature:hover {
    border-color: rgba(52, 211, 153, 0.34);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .home-referrals-feature-num {
    color: #34d399;
}

html[data-theme="dark"] .site-footer-panel {
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(91, 140, 255, 0.12) 0%, transparent 58%),
        radial-gradient(70% 90% at 100% 100%, rgba(52, 211, 153, 0.1) 0%, transparent 55%),
        linear-gradient(180deg, var(--surface-subtle) 0%, var(--surface) 100%);
}

html[data-theme="dark"] .site-footer-promo {
    background: rgba(20, 23, 29, 0.75);
    border-color: rgba(52, 211, 153, 0.22);
}

html[data-theme="dark"] .site-footer-promo__label,
html[data-theme="dark"] .site-footer-promo__arrow {
    color: #34d399;
}

html[data-theme="dark"] .site-footer-brand-mark {
    box-shadow: 0 8px 24px rgba(91, 140, 255, 0.25);
}

.listing-catalog-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: 0.35rem 0 0.65rem;
    font-size: 0.92rem;
}

.listing-catalog-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.listing-catalog-link:hover {
    text-decoration: underline;
}

.listing-catalog-sep {
    color: var(--text-muted);
    user-select: none;
}

.share-block {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.share-block--sidebar {
    display: block;
    width: 100%;
}

.share-toggle-btn--sidebar {
    width: 100%;
    justify-content: center;
}

.listing-aside-share {
    margin: 0 0 18px;
}

.listing-aside-share .share-block {
    width: 100%;
}

.listing-aside-share .share-menu {
    left: 0;
    right: 0;
    width: 100%;
}

.listing-aside-share .share-copy-toast {
    left: 0;
    right: auto;
}

.share-menu[hidden],
.share-copy-toast[hidden] {
    display: none !important;
}

.share-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: auto;
    z-index: 30;
    min-width: 11rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 0.15rem;
}

.share-menu-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.share-menu-item:hover {
    background: var(--surface-subtle);
}

.share-copy-toast {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 31;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    background: var(--text);
    color: var(--surface);
    font-size: 0.78rem;
    white-space: nowrap;
}

.listing-similar-section {
    margin-top: 2rem;
}

.listing-similar-section h2 {
    margin-bottom: 1rem;
}

.listing-similar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 960px) {
    .listing-similar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.listing-similar-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.listing-similar-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.listing-similar-gallery-wrap {
    position: relative;
}

.listing-similar-gallery-shell {
    position: relative;
}

.listing-similar-gallery {
    display: flex;
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
}

.listing-similar-gallery::-webkit-scrollbar {
    display: none;
}

.listing-similar-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    aspect-ratio: 4 / 3;
    background: var(--surface-subtle);
}

.listing-similar-gallery-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

.listing-similar-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(21, 32, 51, 0.72);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 4px 14px rgba(15, 20, 36, 0.18);
}

.listing-similar-gallery-arrow:hover:not(:disabled) {
    background: rgba(21, 32, 51, 0.88);
}

.listing-similar-gallery-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.listing-similar-gallery-arrow-prev {
    left: 8px;
}

.listing-similar-gallery-arrow-next {
    right: 8px;
}

.listing-similar-gallery-indicator {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(21, 32, 51, 0.78);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    pointer-events: none;
}

.listing-similar-gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.listing-similar-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 0.95rem 1rem;
    color: inherit;
    text-decoration: none;
}

.listing-similar-body:hover .listing-similar-title {
    color: var(--accent);
}

.listing-similar-price {
    font-size: 1rem;
}

.listing-similar-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.35;
    font-weight: 600;
}

.listing-similar-address {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.listing-similar-meta {
    margin-top: 0.1rem;
}

.listing-similar-load-more {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}
