/**
 * FaceMap - Стили маркеров и попапов (красивый дизайн)
 */

:root {
    --facemap-action-height: 40px;
    --facemap-action-radius: 10px;
    --facemap-action-font-size: 12.5px;
    --facemap-action-font-weight: 750;
    --facemap-action-primary-bg: linear-gradient(135deg, #667eea, #764ba2);
    --facemap-action-primary-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

/* ==========================================
   МАРКЕРЫ ОБЪЕКТОВ - КРУГЛЫЕ С ФОТО
   ========================================== */

.prop-marker {
    background: transparent !important;
    border: none !important;
}

.prop-marker-shell {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prop-marker--featured {
    z-index: 420 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.prop-marker-shell-featured {
    width: 96px;
    height: 96px;
    overflow: visible;
    contain: layout style;
    isolation: isolate;
}

.prop-marker-shell-featured.is-compact {
    width: 96px;
    height: 96px;
}

.prop-marker-shell-featured.featured-style-frame {
    filter: none;
}

.prop-marker-shell-featured.featured-style-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #fff7cc,
        #fde68a,
        #facc15,
        #f59e0b,
        #d97706,
        #fbbf24,
        #fff3b0,
        #fff7cc
    );
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.24),
        0 0 16px rgba(250, 204, 21, 0.46),
        0 0 30px rgba(245, 158, 11, 0.36);
    animation: facemap-electric-ring-spin 3.2s linear infinite;
    will-change: transform;
}

.prop-marker-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.prop-marker-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.prop-marker-shell.is-viewed:not(.prop-marker-shell-featured) .prop-marker-photo,
.prop-marker-shell.is-viewed:not(.prop-marker-shell-featured) .prop-marker-noimg {
    border-color: #9ee6bf;
    opacity: 1;
    filter: none;
}

.prop-marker-shell.is-viewed:not(.prop-marker-shell-featured) {
    transform: none;
}

.prop-marker-photo.is-featured,
.prop-marker-noimg.is-featured {
    position: relative;
    z-index: 2;
    width: 84px;
    height: 84px;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    box-shadow:
        0 6px 14px rgba(15, 23, 42, 0.28);
}

.prop-marker-photo.is-featured,
.prop-marker-photo.is-featured img,
.prop-marker-noimg.is-featured {
    border-radius: 50%;
}

.prop-marker-noimg.is-featured {
    background: linear-gradient(135deg, #10b981, #059669);
}

.prop-marker-noimg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

/* Кластеры */
.property-cluster {
    background: transparent !important;
}

.cluster-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    position: relative;
    isolation: isolate;
}

.cluster-icon.is-featured {
    border-color: transparent;
    background:
        linear-gradient(135deg, #667eea, #764ba2) padding-box,
        conic-gradient(
            from var(--facemap-cluster-ring-angle, 0deg),
            #fff7cc,
            #fde68a,
            #facc15,
            #f59e0b,
            #d97706,
            #fbbf24,
            #fff3b0,
            #fff7cc
        ) border-box;
    animation: facemap-electric-cluster-border 3.2s linear infinite;
}

@keyframes facemap-electric-ring-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@property --facemap-cluster-ring-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes facemap-electric-cluster-border {
    from { --facemap-cluster-ring-angle: 0deg; }
    to { --facemap-cluster-ring-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    .prop-marker-shell-featured.featured-style-frame::before,
    .cluster-icon.is-featured {
        animation: none;
    }
}

/* ==========================================
   ПОПАП ОБЪЕКТА (на карте)
   ========================================== */

.leaflet-popup-content-wrapper {
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 340px !important;
}

.popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 340px;
}

.popup-photo {
    width: 340px;
    height: 180px;
    overflow: hidden;
    background: #1e293b;
}

.popup-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-body {
    padding: 14px;
}

.popup-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.popup-address {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.popup-comment {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

.popup-description {
    margin-bottom: 10px;
    color: #334155;
    font-size: 12px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}

.popup-agents {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
}

.popup-agents-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.popup-agent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.popup-agent-item:hover {
    border-color: #667eea;
}

.popup-agent-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.popup-agent-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.popup-agent-badge {
    font-size: 11px;
    color: #64748b;
}

.popup-btn-badge {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
}

.popup-badge-placed {
    padding: 10px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
}

.popup-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.popup-buttons-single {
    grid-template-columns: minmax(0, 1fr);
}

.popup-buttons-white-label {
    grid-template-columns: var(--facemap-action-height) minmax(0, 1fr) minmax(0, 1fr);
}

.popup-btn-share-icon {
    width: var(--facemap-action-height);
    min-width: var(--facemap-action-height);
    padding: 0;
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
}

.popup-btn-share-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.popup-btn {
    flex: 1;
    min-height: var(--facemap-action-height);
    padding: 11px 14px;
    border: none;
    border-radius: var(--facemap-action-radius);
    font-size: var(--facemap-action-font-size);
    font-weight: var(--facemap-action-font-weight);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    text-align: center;
}

.popup-btn-primary {
    background: var(--facemap-action-primary-bg);
    color: white;
}

.popup-btn-edit {
    grid-column: 1 / -1;
    background: var(--facemap-action-primary-bg);
    color: #fff;
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.24);
}

.popup-btn-client-request {
    grid-column: 1 / -1;
    min-height: var(--facemap-action-height);
    border-radius: var(--facemap-action-radius);
    font-size: 15px;
    font-weight: var(--facemap-action-font-weight);
    background: var(--facemap-action-primary-bg);
    color: #fff;
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.24);
}

.popup-btn-secondary {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.18);
}

.property-location-pin-marker {
    background: transparent !important;
    border: 0 !important;
}

.popup-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.popup-title-row .popup-title {
    margin-bottom: 0;
}

.popup-map-pin-action {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.popup-map-pin-action:hover {
    transform: translateY(-1px);
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.popup-map-pin-icon {
    width: 18px;
    height: 24px;
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 3px 4px rgba(127, 29, 29, 0.28));
}

.popup-map-pin-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 1px;
    width: 17px;
    height: 17px;
    border-radius: 50% 50% 50% 0;
    transform: translateX(-50%) rotate(-45deg);
    background: linear-gradient(145deg, #ef3b35 0%, #dc2626 58%, #b91c1c 100%);
    border: 1px solid rgba(153, 27, 27, 0.5);
}

.popup-map-pin-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a90f12;
    transform: translateX(-50%);
}

.property-location-pin {
    width: 36px;
    height: 52px;
    position: relative;
    filter: drop-shadow(0 7px 9px rgba(15, 23, 42, 0.35));
}

.property-location-pin::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: translateX(-50%) rotate(-45deg);
    background: linear-gradient(145deg, #ef3b35 0%, #dc2626 58%, #b91c1c 100%);
    border: 2px solid rgba(153, 27, 27, 0.55);
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.2), 0 2px 5px rgba(127, 29, 29, 0.3);
}

.property-location-pin::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 12px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #a90f12;
    transform: translateX(-50%);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.16);
}

.popup-btn-ai {
    position: relative;
    z-index: 0;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.94), rgba(67, 20, 7, 0.98));
    color: #ffffff;
    border: 1px solid rgba(254, 240, 138, 0.34);
    box-shadow: 0 14px 30px rgba(245, 158, 11, 0.34), 0 0 30px rgba(250, 204, 21, 0.24), inset 0 1px 0 rgba(255,255,255,0.28);
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.25);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    animation: popup-ai-button-breathe 2.9s ease-in-out infinite;
}

.popup-btn-ai::before {
    content: "";
    position: absolute;
    inset: -96%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #facc15 0deg,
        #fff7b3 56deg,
        #fde68a 102deg,
        #fb7185 174deg,
        #f59e0b 252deg,
        #ffe27a 320deg,
        #facc15 360deg
    );
    filter: blur(30px) saturate(200%);
    opacity: 1;
    transform: rotate(0deg) scale(0.98);
    transform-origin: 50% 50%;
    transition: transform 0.45s ease, filter 0.3s ease, opacity 0.3s ease;
    animation: popup-ai-button-aura 4.6s linear infinite;
    z-index: -2;
}

.popup-btn-ai::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 18% 24%, rgba(255,255,255,0.38), transparent 28%),
        radial-gradient(circle at 78% 26%, rgba(255,245,157,0.34), transparent 24%),
        linear-gradient(120deg, rgba(255, 234, 136, 0.98) 0%, rgba(250, 204, 21, 0.96) 22%, rgba(249, 115, 22, 0.90) 48%, rgba(120, 53, 15, 0.96) 78%, rgba(251, 191, 36, 0.96) 100%);
    background-size: 180% 180%;
    background-position: 0% 50%;
    animation: popup-ai-button-sheen 3.8s ease-in-out infinite alternate;
    z-index: -1;
}

.popup-btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(245, 158, 11, 0.42), 0 0 38px rgba(253, 224, 71, 0.30), inset 0 1px 0 rgba(255,255,255,0.30);
}

.popup-btn-ai:hover::before {
    transform: rotate(26deg) scale(1.06);
    filter: blur(34px) saturate(220%);
}

.popup-btn-ai:hover::after {
    animation-duration: 2.2s;
}

.popup-btn-ai.is-loading {
    color: #ffffff;
    pointer-events: none;
    box-shadow: 0 20px 42px rgba(245, 158, 11, 0.48), 0 0 48px rgba(250, 204, 21, 0.36), inset 0 1px 0 rgba(255,255,255,0.30);
    animation-duration: 1.35s;
}

.popup-btn-ai.is-loading::before {
    animation: popup-ai-button-spin 1.2s linear infinite;
    filter: blur(36px) saturate(230%);
    opacity: 1;
}

.popup-btn-ai.is-loading::after {
    background:
        radial-gradient(circle at 24% 28%, rgba(255,255,255,0.28), transparent 34%),
        radial-gradient(circle at 80% 30%, rgba(255,249,196,0.22), transparent 22%),
        linear-gradient(135deg, rgba(253, 224, 71, 0.98), rgba(249, 115, 22, 0.92) 56%, rgba(146, 64, 14, 0.98) 100%);
    background-size: 200% 200%;
    animation-duration: 1.35s;
}

.popup-btn-ai.is-generated {
    background: #dfe8c4;
    color: #3f6212;
    border: 1px solid rgba(101, 163, 13, 0.24);
    box-shadow: 0 8px 18px rgba(132, 204, 22, 0.18);
    text-shadow: none;
}

.popup-btn-ai.is-generated::before,
.popup-btn-ai.is-generated::after {
    display: none;
}

@keyframes popup-ai-button-spin {
    from {
        transform: rotate(0deg) scale(0.98);
    }
    to {
        transform: rotate(360deg) scale(0.98);
    }
}

@keyframes popup-ai-button-aura {
    0% {
        transform: rotate(0deg) scale(0.98);
        filter: blur(30px) saturate(200%);
    }
    50% {
        transform: rotate(180deg) scale(1.05);
        filter: blur(34px) saturate(220%);
    }
    100% {
        transform: rotate(360deg) scale(0.98);
        filter: blur(30px) saturate(200%);
    }
}

@keyframes popup-ai-button-sheen {
    0% {
        background-position: 0% 50%;
        filter: saturate(1);
    }
    50% {
        background-position: 55% 38%;
        filter: saturate(1.08);
    }
    100% {
        background-position: 100% 55%;
        filter: saturate(1);
    }
}

@keyframes popup-ai-button-breathe {
    0%, 100% {
        filter: brightness(1) saturate(1);
    }
    50% {
        filter: brightness(1.06) saturate(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .popup-btn-ai,
    .popup-btn-ai::before,
    .popup-btn-ai::after {
        animation: none !important;
    }
}

.popup-btn-fav {
    width: 46px;
    padding: 9px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}

.popup-btn-fav.active {
    background: #fee2e2;
    color: #dc2626;
}

.popup-btn-fav.is-favorite {
    color: #dc2626;
}

/* ==========================================
   МОДАЛЬНОЕ ОКНО ОБЪЕКТА - КРАСИВЫЙ ДИЗАЙН
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.client-request-card,
.client-welcome-card {
    width: min(420px, calc(100vw - 32px));
    border-radius: 24px;
    background: #ffffff;
    padding: 26px;
    position: relative;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.34);
}

.client-request-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 20px;
    cursor: pointer;
}

.client-request-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-request-title,
.client-welcome-title {
    margin-top: 14px;
    color: #0f172a;
    font-size: 26px;
    line-height: 1.14;
    font-weight: 900;
}

.client-request-object,
.client-welcome-text {
    margin-top: 10px;
    color: #64748b;
    font-size: 15px;
    line-height: 1.45;
}

.client-request-form {
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.client-request-label {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.client-request-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 14px;
    color: #0f172a;
    background: #f8fafc;
    font-size: 16px;
    outline: none;
}

.client-request-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.14);
}

.client-request-submit,
.client-welcome-actions .btn {
    min-height: 48px;
}

.client-request-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 14px;
    background: #f8fafc;
}

.client-request-consent input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: #4f46e5;
}

.client-request-consent a {
    color: #4f46e5;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.client-request-actions {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 10px;
    margin-top: 22px;
}

.client-request-actions.is-single {
    grid-template-columns: 1fr;
}

.client-request-actions .btn {
    min-height: 48px;
}

.client-welcome-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 10px;
    margin-top: 22px;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 560px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
}

.modal-content.property-ai-modal-shell {
    width: min(980px, calc(100vw - 24px));
}

.property-modal {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    min-height: 0;
}

/* Карусель */
.property-carousel {
    position: relative;
    width: 100%;
    height: 320px;
    background: #0f172a;
    flex-shrink: 0;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.property-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    touch-action: pan-y pinch-zoom;
}

.property-carousel-image-ambient {
    transform: scale(1.06);
    animation: propertyHeroAmbientPan 4s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes propertyHeroAmbientPan {
    0% {
        transform: scale(1.06) translateX(-1.8%);
    }
    100% {
        transform: scale(1.06) translateX(1.8%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .property-carousel-image-ambient {
        animation: none;
        transform: none;
    }
}

.property-swipe-hint {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 10px auto 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
    z-index: 1;
    animation: propertySwipeHintFade 2.8s ease forwards;
}

.property-swipe-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: #7c3aed;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
}

.property-swipe-arrow-left {
    animation: propertySwipeArrowLeft 1s ease-in-out infinite;
}

.property-swipe-arrow-right {
    animation: propertySwipeArrowRight 1s ease-in-out infinite;
}

.property-swipe-label {
    white-space: nowrap;
}

@keyframes propertySwipeHintFade {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    12%, 72% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
}

@keyframes propertySwipeArrowLeft {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-8px);
    }
}

@keyframes propertySwipeArrowRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

.carousel-btn {
    position: absolute;
    top: auto;
    bottom: 12px;
    transform: none;
    width: 40px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    box-shadow: none;
    text-shadow: 0 3px 12px rgba(0,0,0,0.62);
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 4;
}

.carousel-btn:hover {
    background: transparent;
    transform: scale(1.12);
    opacity: 0.95;
}

.carousel-btn.prev { left: 18px; }
.carousel-btn.next { right: 18px; }

.carousel-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.photo-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: rgba(2, 6, 23, 0.96);
    cursor: zoom-out;
    overscroll-behavior: contain;
    touch-action: none;
}

.property-photo-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 96vw;
    max-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.28);
    touch-action: none;
    user-select: none;
}

.photo-viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    transform-origin: center center;
    will-change: transform;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-viewer-close {
    position: fixed;
    top: max(16px, calc(env(safe-area-inset-top) + 14px));
    right: max(16px, calc(env(safe-area-inset-right) + 14px));
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    z-index: 10003;
    transform: none !important;
    transition: background 0.2s ease;
    touch-action: manipulation;
}

.photo-viewer-close:hover,
.photo-viewer-nav:hover {
    background: rgba(255, 255, 255, 0.28);
}

.photo-viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.photo-viewer-prev {
    left: max(18px, env(safe-area-inset-left));
}

.photo-viewer-next {
    right: max(18px, env(safe-area-inset-right));
}

.photo-viewer-counter {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.05);
}

@media (min-width: 769px) {
    .modal-overlay {
        align-items: flex-start;
        padding-top: 36px;
        padding-bottom: 24px;
    }
}

/* Миниатюры */
.property-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    overflow-x: auto;
}

.property-thumbnail {
    width: 60px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.property-thumbnail:hover {
    opacity: 0.9;
}

.property-thumbnail.active {
    opacity: 1;
    border-color: #667eea;
}

/* Контент модала */
.property-modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
}

.property-modal-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.property-modal-address {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.property-modal-price {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}

.property-modal-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.property-spec {
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-weight: 500;
}

.property-modal-description {
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 20px;
}

/* Секция агентов */
.property-agents-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.property-agents-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
}

.property-agent-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.property-agent-card:last-child {
    margin-bottom: 0;
}

.property-agent-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.property-agent-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
    flex-shrink: 0;
}

.property-agent-info {
    flex: 1;
    min-width: 0;
}

.property-agent-name {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.property-agent-company {
    font-size: 12px;
    color: #64748b;
}

.modal-presence-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.modal-presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.modal-presence-dot.is-online {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.modal-presence-dot.is-away {
    background: #facc15;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

.modal-presence-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.modal-presence-text.compact {
    font-size: 11px;
    font-weight: 500;
}

.property-agent-info .modal-presence-text {
    color: #64748b;
}

.property-agent-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

/* Секция создания бейджа */
.create-badge-section {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.create-badge-section h4 {
    font-size: 15px;
    font-weight: 700;
    color: #166534;
    margin: 0 0 6px 0;
}

.create-badge-section p {
    font-size: 13px;
    color: #15803d;
    margin: 0 0 12px 0;
}

.create-badge-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.create-badge-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Кнопки внизу */
.btn {
    padding: 9px 14px;
    border: none;
    border-radius: var(--facemap-action-radius);
    min-height: var(--facemap-action-height);
    font-size: var(--facemap-action-font-size);
    font-weight: var(--facemap-action-font-weight);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    text-align: center;
}

.btn-primary {
    background: var(--facemap-action-primary-bg);
    color: white;
    box-shadow: var(--facemap-action-primary-shadow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
}

.btn-secondary:hover {
    background: var(--facemap-action-primary-bg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.property-modal-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    margin-top: 20px;
}

.property-modal-actions.is-client-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.property-modal-actions.is-client-mode .property-action-btn,
.property-modal-actions.is-client-mode .property-favorite-action-shell {
    flex: none;
    width: 100%;
    min-width: 0;
}

.property-modal-actions.is-client-mode .property-online-request-btn {
    grid-column: auto;
    order: initial;
}

.property-modal-actions.is-client-mode .property-share-btn {
    order: initial;
}

.property-modal-actions.is-client-mode .property-favorite-action-shell {
    order: initial;
    align-self: stretch;
    height: 100%;
}

.property-modal-actions.is-client-mode .property-favorite-btn {
    width: 100%;
}

.map-invite-join-bar {
    position: fixed;
    left: 50%;
    bottom: calc(14px + var(--safe-area-bottom));
    transform: translateX(-50%) translateY(24px);
    width: min(520px, calc(100vw - 24px));
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.map-invite-join-bar.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.map-invite-join-btn {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
}

.property-invite-join-bar {
    position: sticky;
    bottom: 0;
    margin-top: 14px;
    padding-top: 10px;
    padding-bottom: calc(8px + var(--safe-area-bottom));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 28%);
    z-index: 2;
}

.property-invite-join-btn {
    width: 100%;
    min-height: var(--facemap-action-height);
    border-radius: var(--facemap-action-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.property-share-btn {
    flex: 1 1 0;
    min-width: 0;
}

.property-action-btn,
.property-share-btn {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: var(--facemap-action-height);
    padding: 9px 12px;
    font-size: var(--facemap-action-font-size);
    font-weight: var(--facemap-action-font-weight);
    border-radius: var(--facemap-action-radius);
}

.property-modal-headline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    margin-bottom: 14px;
}

.property-modal-heading-text {
    min-width: 0;
}

.property-modal-headline .property-modal-title,
.property-modal-headline .property-modal-address {
    overflow-wrap: anywhere;
}

.property-modal-icon-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.property-icon-action {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border: 0;
    border-radius: 15px;
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.property-icon-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.26);
}

.property-icon-action svg {
    width: 25px;
    height: 25px;
    display: block;
    fill: currentColor;
}

.property-icon-action.property-favorite-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    flex: 0 0 48px;
    padding: 0;
    border-radius: 15px;
    min-height: 48px;
    gap: 0;
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
}

.property-icon-action .property-favorite-btn-heart {
    width: 27px;
    height: 27px;
    min-width: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transform: none;
}

.property-icon-action .property-favorite-svg svg {
    width: 27px;
    height: 27px;
    display: block;
    overflow: visible;
}

.property-icon-action .property-heart-path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.95;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.18s ease, stroke 0.18s ease, filter 0.18s ease;
}

.property-icon-action.is-favorite .property-favorite-btn-heart {
    color: #ef4444;
    text-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

.property-icon-action.is-favorite .property-heart-path {
    fill: #ef4444;
    stroke: #ef4444;
    filter: drop-shadow(0 3px 7px rgba(239, 68, 68, 0.32));
}

.property-agents-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.property-modal-actions .property-partners-btn {
    width: 100%;
    flex: 1 1 100%;
    grid-column: 1 / -1;
    min-height: var(--facemap-action-height);
    border-radius: var(--facemap-action-radius);
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
}

.property-ai-actions .property-partners-btn {
    min-height: var(--facemap-action-height);
    border-radius: var(--facemap-action-radius);
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
}

.property-client-request-btn {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
}

.property-online-request-btn.btn-secondary {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
}

.property-presentation-request-btn.btn-secondary {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
}

.property-client-request-btn.btn-secondary:hover {
    background: var(--facemap-action-primary-bg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.property-favorite-action-shell {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    justify-content: center;
    min-height: var(--facemap-action-height);
    padding: 0;
    border-radius: var(--facemap-action-radius);
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.property-favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 100%;
    width: 100%;
    min-height: var(--facemap-action-height);
    padding: 9px 12px;
    font-size: var(--facemap-action-font-size);
    font-weight: var(--facemap-action-font-weight);
    white-space: nowrap;
    border-radius: var(--facemap-action-radius);
    box-shadow: var(--facemap-action-primary-shadow);
}

.property-action-icon {
    width: 15px;
    min-width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 15px;
    font-size: 15px;
    line-height: 1;
}

.property-favorite-btn.btn-secondary {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    border: none;
}

.property-favorite-btn.is-favorite {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
}

.property-favorite-btn.btn-secondary:hover {
    background: var(--facemap-action-primary-bg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.property-modal-actions .property-share-btn,
.property-modal-actions .property-favorite-btn {
    min-height: var(--facemap-action-height);
    padding: 9px 12px;
    border: 0;
    border-radius: var(--facemap-action-radius);
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    box-shadow: var(--facemap-action-primary-shadow);
    overflow: hidden;
}

.property-modal-actions .property-share-btn:hover,
.property-modal-actions .property-favorite-btn:hover {
    background: var(--facemap-action-primary-bg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.property-private-note {
    margin-top: 16px;
    max-width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.property-private-note-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
}

.property-private-note-text {
    display: block;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.property-private-note-text a {
    color: #4f46e5;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.property-share-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.property-share-btn-icon svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.property-favorite-btn-heart {
    font-family: inherit;
    width: 20px;
    min-width: 20px;
    height: 20px;
    flex: 0 0 20px;
    font-size: 20px;
    color: currentColor;
    transition: transform 0.2s ease;
}

.property-favorite-btn.is-favorite .property-favorite-btn-heart {
    color: #ef4444;
    text-shadow: 0 1px 8px rgba(239, 68, 68, 0.28);
}

.property-favorite-btn:hover .property-favorite-btn-heart {
    transform: scale(1.06);
}

.property-icon-action.property-favorite-btn:hover .property-favorite-btn-heart {
    transform: none;
}

.property-subview-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.property-subview-back {
    flex: 0 0 auto;
    white-space: nowrap;
}

.property-subview-subtitle {
    color: #64748b;
    font-size: 14px;
    margin-top: 4px;
}

.property-agents-page {
    margin-top: 0;
}

.property-subview-empty {
    padding: 28px 0 8px;
}

.property-ai-modal {
    width: min(980px, calc(100vw - 24px));
    max-height: 92vh;
}

.property-ai-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 24px 0;
    position: relative;
}

.property-ai-title-block {
    min-width: 0;
    flex: 1 1 auto;
}

.property-ai-logo {
    width: min(210px, 28vw);
    max-height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
    margin: -4px 52px 0 auto;
}

.property-ai-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.property-ai-content {
    padding: 18px 24px 24px;
}

.property-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}

.property-ai-badge.is-generated {
    background: #ecfccb;
    color: #3f6212;
}

.property-ai-badge.is-cached {
    background: #e0f2fe;
    color: #0f4c81;
}

.property-ai-badge.is-error {
    background: #fee2e2;
    color: #991b1b;
}

.property-ai-body p,
.property-ai-body li,
.property-ai-body h2,
.property-ai-body h3 {
    color: #334155;
    line-height: 1.7;
    font-size: 14px;
    font-weight: 400;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0 0 14px;
}

.property-ai-section {
    margin: 0 0 16px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.property-ai-section.property-ai-section-plain {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.property-ai-body .property-ai-section-title {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
}

.property-ai-body .property-ai-section-body {
    display: block;
}

.property-ai-body .property-ai-inline-label {
    font-weight: 700;
    color: #0f172a;
}

.property-ai-body .property-ai-list {
    margin: 0 0 12px;
    padding-left: 18px;
}

.property-ai-body ul {
    padding-left: 18px;
    margin: 0 0 14px;
}

.property-ai-error {
    padding: 16px 18px;
    border-radius: 16px;
    background: #fff7f7;
    border: 1px solid #fecaca;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.property-ai-hint {
    text-align: center;
    color: #64748b;
    margin: 18px 0 0;
}

.property-ai-gallery {
    margin-top: 22px;
}

.property-ai-gallery-title {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.property-ai-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.property-ai-gallery-item {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.property-ai-gallery-item img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.property-ai-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding-bottom: calc(8px + var(--safe-area-bottom));
}

.property-ai-actions.has-1-actions {
    grid-template-columns: minmax(0, 1fr);
}

.property-ai-actions.has-2-actions:not(.has-client-plan) {
    grid-template-columns: minmax(0, 1fr) 48px;
}

.property-ai-actions.has-2-actions {
    grid-template-columns: minmax(0, 1fr) 48px;
}

.property-ai-actions.has-3-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px;
}

.property-ai-actions .btn {
    min-width: 0;
    width: 100%;
    min-height: var(--facemap-action-height);
    border-radius: var(--facemap-action-radius);
    font-size: 15px;
    font-weight: var(--facemap-action-font-weight);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.property-ai-actions.has-client-plan {
    align-items: stretch;
}

.property-ai-actions .btn:only-child {
    grid-column: 1 / -1;
}

.property-ai-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
}

.property-ai-plans-btn {
    width: 100%;
    margin-top: 0;
    min-height: var(--facemap-action-height);
    border-radius: var(--facemap-action-radius);
    font-size: 15px;
    font-weight: var(--facemap-action-font-weight);
    box-shadow: 0 14px 28px rgba(102, 126, 234, 0.18);
}

.property-ai-actions .property-ai-action-btn,
.property-ai-share-btn {
    background: var(--facemap-action-primary-bg);
    color: #ffffff;
    border: 0;
}

.property-ai-icon-btn {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px;
    padding: 0 !important;
}

.property-ai-icon-btn svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
}

.property-ai-share-btn:hover {
    background: var(--facemap-action-primary-bg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

@media (max-width: 560px) {
    .map-invite-join-bar {
        width: calc(100vw - 16px);
        bottom: calc(10px + var(--safe-area-bottom));
    }

    .map-invite-join-btn {
        min-height: var(--facemap-action-height);
        border-radius: var(--facemap-action-radius);
    }

    .property-modal-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 16px;
    }

    .property-modal-headline {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        margin-bottom: 12px;
    }

    .property-modal-icon-actions {
        gap: 8px;
    }

    .property-icon-action {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 14px;
    }

    .property-icon-action svg {
        width: 23px;
        height: 23px;
    }

    .property-icon-action.property-favorite-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        flex-basis: 44px;
        min-height: 44px;
        border-radius: 14px;
    }

    .property-icon-action .property-favorite-btn-heart {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }

    .property-icon-action .property-favorite-svg svg {
        width: 24px;
        height: 24px;
    }

    .property-modal-actions.is-client-mode {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .property-invite-join-bar {
        margin-top: 12px;
        padding-top: 8px;
    }

    .property-action-btn,
    .property-share-btn,
    .property-favorite-btn,
    .property-favorite-action-shell {
        min-height: var(--facemap-action-height);
        border-radius: var(--facemap-action-radius);
    }

    .property-favorite-btn {
        padding: 9px 12px;
        font-size: var(--facemap-action-font-size);
    }

    .property-share-btn {
        padding: 9px 12px;
        font-size: var(--facemap-action-font-size);
    }

    .property-action-btn,
    .property-share-btn {
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    }

    .property-favorite-action-shell {
        grid-column: 1 / -1;
        box-shadow: none;
    }

    .property-modal-actions.is-client-mode .property-client-request-btn {
        order: initial;
        grid-column: auto;
        min-height: var(--facemap-action-height);
    }

    .property-modal-actions.is-client-mode .property-share-btn {
        order: initial;
        min-height: var(--facemap-action-height);
        padding: 9px 12px;
        font-size: var(--facemap-action-font-size);
    }

    .property-modal-actions.is-client-mode .property-favorite-action-shell {
        order: initial;
        grid-column: auto;
        min-height: var(--facemap-action-height);
        height: 100%;
    }

    .property-modal-actions.is-client-mode .property-favorite-btn {
        min-height: var(--facemap-action-height);
        padding: 9px 12px;
        font-size: var(--facemap-action-font-size);
    }

    .property-action-label {
        font-size: 13px;
    }

    .property-subview-header {
        flex-direction: column;
        align-items: stretch;
    }

    .property-ai-header {
        padding: 20px 18px 0;
    }

    .property-ai-section {
        padding: 14px 14px;
        border-radius: 16px;
    }

    .property-ai-section-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .property-ai-actions {
        gap: 9px;
        margin-top: 20px;
    }

    .property-ai-actions.has-1-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .property-ai-actions.has-2-actions {
        grid-template-columns: minmax(0, 1fr) 46px;
    }

    .property-ai-actions.has-3-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
    }

    .property-ai-actions .btn {
        min-height: var(--facemap-action-height);
        border-radius: var(--facemap-action-radius);
        font-size: 14px;
        box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14);
    }

    .property-ai-icon-btn {
        width: 46px !important;
        min-width: 46px !important;
        max-width: 46px;
    }

    .property-ai-gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 820px), (max-height: 820px) {
    .property-modal-content {
        min-height: 0;
        padding-bottom: max(96px, calc(34px + var(--safe-area-bottom)));
        -webkit-overflow-scrolling: touch;
    }

    .property-modal-actions {
        margin-bottom: max(22px, var(--safe-area-bottom));
    }

    .property-carousel {
        height: clamp(220px, 36dvh, 320px);
    }

    .property-ai-logo {
        width: min(150px, 30vw);
        max-height: 44px;
        margin-right: 48px;
    }
}

@media (max-width: 560px) {
    .property-ai-modal {
        width: calc(100vw - 10px);
        max-height: 100dvh;
    }

    .property-ai-header {
        display: block;
        padding: max(14px, var(--safe-area-top)) 14px 0;
        min-height: 96px;
    }

    .property-ai-title-block {
        width: 100%;
        padding-top: 52px;
    }

    .property-ai-header .property-modal-title,
    .property-ai-header .property-modal-address {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .property-ai-logo {
        position: absolute;
        top: max(18px, calc(var(--safe-area-top) + 8px));
        right: 62px;
        width: min(148px, calc(100vw - 136px));
        max-height: 42px;
        margin: 0;
    }

    .property-ai-content {
        padding: 14px 14px 18px;
    }
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* ==========================================
   МОДАЛЬНОЕ ОКНО БЕЙДЖА
   ========================================== */

.full-badge-modal {
    background: white;
    border-radius: 24px;
    width: 480px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
}

.badge-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.badge-modal-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    flex-shrink: 0;
}

.badge-modal-photo-action {
    cursor: zoom-in;
}

.badge-modal-name {
    font-size: 20px;
    font-weight: 700;
}

.badge-modal-company {
    font-size: 14px;
    opacity: 0.9;
}

.badge-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.badge-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.badge-modal-address {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}

.badge-modal-why {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.badge-modal-why-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.badge-modal-why-text {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.badge-modal-contacts {
    display: grid;
    gap: 10px;
}

.badge-modal-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.badge-modal-contact-btn:hover {
    transform: translateY(-1px);
}

/* ==========================================
   АДАПТИВ
   ========================================== */

@media (max-width: 600px) {
    .leaflet-popup-content {
        width: 300px !important;
    }
    
    .popup-content,
    .popup-photo {
        width: 300px;
    }
    
    .popup-photo {
        height: 160px;
    }

    .popup-buttons {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px;
    }

    .popup-btn {
        min-height: var(--facemap-action-height);
        padding: 11px 12px;
        border-radius: var(--facemap-action-radius);
    }

    .popup-btn-client-request {
        grid-column: 1 / -1;
    }

    .popup-btn-fav {
        width: 42px;
        min-height: var(--facemap-action-height);
        padding: 8px;
        border-radius: var(--facemap-action-radius);
    }

    .carousel-btn {
        display: none;
    }

    .carousel-counter {
        bottom: 12px;
    }
    
    .modal-overlay {
        padding: var(--safe-area-top) 0 var(--safe-area-bottom);
    }

    .photo-viewer-close {
        top: max(78px, calc(env(safe-area-inset-top) + 42px));
        right: max(18px, calc(env(safe-area-inset-right) + 14px));
        width: 46px;
        height: 46px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: calc(100dvh - var(--safe-area-top) - var(--safe-area-bottom));
        max-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .property-modal {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: none;
    }
    
    .property-carousel {
        height: 280px;
        flex-shrink: 0;
    }
    
    .property-modal-content {
        padding: 20px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding-bottom: max(96px, calc(34px + var(--safe-area-bottom)));
    }
    
    .property-modal-title {
        font-size: 20px;
    }
    
    .full-badge-modal {
        width: 100%;
        max-width: 100%;
        height: calc(100dvh - var(--safe-area-top) - var(--safe-area-bottom));
        max-height: 100%;
        border-radius: 0;
    }

    .full-badge-modal .modal-close {
        top: calc(10px + var(--safe-area-top));
        right: 12px;
        width: 42px;
        height: 42px;
        background: rgba(15, 23, 42, 0.76);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
        z-index: 6;
    }

    .badge-modal-header {
        padding-top: calc(24px + var(--safe-area-top));
    }
}

/* ==========================================
   МОДАЛКА СОЗДАНИЯ БЕЙДЖА
   ========================================== */

.badge-creation-modal {
    background: white;
    border-radius: 24px;
    width: 500px;
    max-width: calc(100vw - 40px);
    max-height: min(90vh, calc(100dvh - 16px));
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    overflow: hidden;
}

.badge-creation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-creation-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.badge-creation-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.badge-creation-property {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 14px;
    margin-bottom: 16px;
}

.property-icon {
    font-size: 32px;
}

.property-name {
    font-weight: 700;
    font-size: 16px;
    color: #166534;
}

.property-addr {
    font-size: 13px;
    color: #15803d;
}

.badge-creation-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #eff6ff;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #1e40af;
}

.badge-funds-warning {
    margin-top: 8px;
    display: none;
    align-items: center;
    gap: 8px;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
}

.badge-funds-warning.show {
    display: inline-flex;
}

.btn-inline-topup {
    border: 1px solid #93c5fd;
    background: #ffffff;
    color: #1d4ed8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-inline-topup:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}

.info-icon {
    font-size: 24px;
}

/* Секция ссылок - как на скриншоте */
.badge-creation-section {
    display: flex;
    gap: 14px;
    padding: 20px;
    background: #1e293b;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.section-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.section-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.section-desc {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.badge-links-list {
    margin-bottom: 12px;
}

.badge-links-list .link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.badge-links-list .link-row input {
    min-width: 0;
    padding: 12px 14px;
    border: 2px solid #334155;
    border-radius: 10px;
    background: #0f172a;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.badge-links-list .link-row input::placeholder {
    color: #64748b;
}

.badge-links-list .link-row input:focus {
    outline: none;
    border-color: #10b981;
}

.badge-links-list .link-name { 
    flex: 1;
    max-width: 120px;
}

.badge-links-list .link-url { 
    flex: 2;
}

.badge-links-list .btn-x {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.badge-links-list .btn-x:hover {
    background: #ef4444;
    color: white;
}

.btn-add-link {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px dashed #475569;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-link:hover {
    border-color: #10b981;
    color: #10b981;
}

/* Превью профиля */
.badge-creation-profile {
    background: #f8fafc;
    border-radius: 14px;
    padding: 18px;
}

.profile-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

.profile-preview-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #475569;
}

.profile-preview-item.why-me {
    font-style: italic;
    color: #64748b;
}

.profile-preview-item.warning {
    color: #f59e0b;
    font-weight: 500;
}

.profile-mini-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.badge-creation-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    padding-bottom: calc(20px + var(--safe-area-bottom));
}

.badge-creation-footer .btn {
    flex: 1;
    padding: 14px 20px;
}

/* ==========================================
   МОДАЛКА ВСЕХ БЕЙДЖЕЙ АГЕНТА
   ========================================== */

.agent-badges-modal {
    background: white;
    border-radius: 24px;
    width: 500px;
    max-width: calc(100vw - 40px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    overflow: hidden;
    min-height: 0;
}

.agent-badges-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.agent-badges-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
}

.agent-badges-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
}

.agent-badges-info p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.agent-badges-info .modal-presence-text {
    color: rgba(255, 255, 255, 0.92);
}

.agent-badges-list {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.agent-badges-footer {
    padding: 16px 20px calc(20px + var(--safe-area-bottom));
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.agent-badges-join-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    text-decoration: none;
}

.agent-badge-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.agent-badge-item:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.agent-offer-photo {
    width: 72px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
}

.badge-item-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.badge-item-info {
    flex: 1;
    min-width: 0;
}

.badge-item-title {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-item-address {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-item-stats {
    font-size: 12px;
    color: #94a3b8;
}

.badge-item-arrow {
    font-size: 20px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* ==========================================
   МОДАЛКА БЕЙДЖА - КРАСИВЫЙ ДИЗАЙН
   ========================================== */

.full-badge-modal {
    background: white;
    border-radius: 24px;
    width: 480px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.badge-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex-shrink: 0;
}

.badge-modal-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.badge-modal-info h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
}

.badge-modal-info .company {
    font-size: 14px;
    opacity: 0.9;
}

.badge-modal-info .modal-presence-text {
    color: rgba(255, 255, 255, 0.92);
}

.badge-modal-info .company a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.badge-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.badge-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.badge-modal-address {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-modal-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.badge-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.badge-stat-action {
    cursor: pointer;
}

.badge-modal-section {
    background: #f8fafc;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.badge-modal-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}

.badge-modal-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

.badge-modal-contacts {
    display: grid;
    gap: 10px;
}

.badge-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
}

.badge-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.badge-contact-btn.phone {
    background: linear-gradient(135deg, #10b981, #059669);
}

.badge-contact-btn.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.badge-contact-btn.telegram {
    background: linear-gradient(135deg, #0088cc, #0077b5);
}

.badge-modal-links {
    margin-top: 16px;
}

.badge-link-item {
    display: block;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    transition: all 0.2s;
}

.badge-link-item:hover {
    border-color: #667eea;
    color: #667eea;
}

.badge-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    padding-bottom: calc(20px + var(--safe-area-bottom));
}

@media (max-width: 820px), (max-height: 820px) {
    .agent-badges-modal {
        width: min(100%, 640px);
        max-width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }

    .agent-badges-header {
        padding: 16px 18px;
    }

    .agent-badges-list {
        padding: 14px;
    }

    .agent-badges-footer {
        padding: 14px 16px calc(16px + var(--safe-area-bottom));
    }

    .agent-badges-modal .modal-close {
        top: calc(10px + var(--safe-area-top));
        right: 12px;
        width: 42px;
        height: 42px;
        background: rgba(15, 23, 42, 0.76);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
        z-index: 6;
    }

    .agent-badges-header {
        padding-top: calc(16px + var(--safe-area-top));
    }
}

.badge-modal-footer .btn {
    flex: 1;
}

@media (max-width: 600px) {
    #badgeCreationModal.modal-overlay {
        align-items: center;
        padding: calc(8px + var(--safe-area-top)) 8px calc(8px + var(--safe-area-bottom));
    }

    .badge-creation-modal,
    .full-badge-modal {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 16px);
    }

    .badge-creation-modal {
        border-radius: 16px;
        display: block;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .badge-creation-body {
        padding: 16px;
        overflow: visible;
        flex: none;
    }

    .badge-modal-body {
        padding: 16px;
    }

    .full-badge-modal .modal-close {
        top: calc(10px + var(--safe-area-top));
        right: 12px;
    }

    .badge-creation-footer {
        gap: 8px;
        position: static;
        padding: 12px 16px calc(12px + var(--safe-area-bottom));
    }

    .badge-creation-footer .btn {
        padding: 12px 10px;
        font-size: 14px;
    }
}

/* Секция - бейдж уже размещён */
.create-badge-section.badge-placed {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1px solid #34d399;
}

.create-badge-section.badge-placed h4 {
    color: #047857;
}

.create-badge-section.badge-placed p {
    color: #059669;
}

/* ==========================================
   ЦЕНА С ВАЛЮТОЙ
   ========================================== */

.popup-price {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.property-modal-price {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
}

/* ==========================================
   ГОСТЕВЫЕ ДЕЙСТВИЯ И ПРИВЕТСТВИЯ АГЕНТОВ
   ========================================== */

.guest-action-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.guest-action-overlay.show {
    opacity: 1;
}

.guest-action-card {
    width: min(460px, calc(100vw - 28px));
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background:
        radial-gradient(circle at 15% 0%, rgba(102, 126, 234, 0.34), transparent 34%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
    color: #fff;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.guest-action-overlay.show .guest-action-card {
    transform: translateY(0) scale(1);
}

.guest-action-kicker {
    display: inline-flex;
    padding: 7px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.18);
    color: #c7d2fe;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
}

.guest-action-title {
    font-size: 24px;
    line-height: 1.12;
    font-weight: 900;
    margin-bottom: 10px;
}

.guest-action-text {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 20px;
}

.guest-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.guest-action-buttons.is-single {
    grid-template-columns: 1fr;
}

.guest-action-primary,
.guest-action-secondary,
.agent-guest-lead-btn,
.guest-claimed-agent-chat,
.guest-claimed-agent-remove {
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 850;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.guest-action-primary {
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #7f45b8);
    box-shadow: 0 14px 28px rgba(102, 126, 234, 0.28);
}

.guest-action-secondary {
    padding: 14px 16px;
    color: #dbeafe;
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.guest-action-primary:hover,
.guest-action-secondary:hover,
.agent-guest-lead-btn:hover,
.guest-claimed-agent-chat:hover,
.guest-claimed-agent-remove:hover {
    transform: translateY(-1px);
}

.agent-guest-lead-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 11900;
    width: min(390px, calc(100vw - 28px));
    padding: 20px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 0%, rgba(251, 191, 36, 0.28), transparent 32%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
    border: 1px solid rgba(251, 191, 36, 0.24);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.agent-guest-lead-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.agent-guest-lead-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: rgba(148, 163, 184, 0.18);
    cursor: pointer;
    font-size: 20px;
}

.agent-guest-lead-kicker {
    color: #fde68a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.agent-guest-lead-title {
    padding-right: 32px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 900;
    margin-bottom: 8px;
}

.agent-guest-lead-text {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 14px;
}

.agent-guest-lead-btn {
    width: 100%;
    padding: 13px 16px;
    color: #111827;
    background: linear-gradient(135deg, #fef08a, #f59e0b);
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.22);
}

.guest-claimed-agents-card {
    width: min(620px, calc(100vw - 28px));
}

.guest-claimed-agents-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    max-height: min(420px, 52vh);
    overflow-y: auto;
}

.guest-claimed-agent-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.guest-claimed-agent-card img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.guest-claimed-agent-info {
    min-width: 0;
}

.guest-claimed-agent-info strong,
.guest-claimed-agent-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guest-claimed-agent-info span {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 3px;
}

.guest-claimed-agent-chat {
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #7f45b8);
}

.guest-claimed-agent-remove {
    padding: 10px 12px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.14);
}

.guest-claimed-close {
    width: 100%;
}

@media (max-width: 640px) {
    .guest-action-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .guest-action-card {
        width: 100%;
        padding: 20px;
        border-radius: 22px;
    }

    .guest-action-title {
        font-size: 21px;
    }

    .guest-action-buttons {
        grid-template-columns: 1fr;
    }

    .agent-guest-lead-toast {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: auto;
    }

    .guest-claimed-agent-card {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .guest-claimed-agent-chat,
    .guest-claimed-agent-remove {
        grid-column: 1 / -1;
        width: 100%;
    }
}
