.tlspopup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 25, 47, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tlspopup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tlspopup-overlay.active .tlspopup-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.tlspopup-card {
    position: relative;
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 24px;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.tlspopup-card.theme-dark {
    background: #0D1117;
    color: #FFFFFF;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --tls-text-primary: #FFFFFF;
    --tls-text-secondary: rgba(255, 255, 255, 0.6);
    --tls-text-muted: rgba(255, 255, 255, 0.4);
    --tls-btn-primary-bg: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    --tls-btn-primary-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    --tls-btn-primary-hover-shadow: 0 6px 20px rgba(22, 163, 74, 0.45);
    --tls-btn-secondary-bg: rgba(255, 255, 255, 0.08);
    --tls-btn-secondary-color: #CBD5E1;
    --tls-btn-secondary-hover-bg: rgba(255, 255, 255, 0.14);
    --tls-close-bg: rgba(255, 255, 255, 0.1);
    --tls-close-color: rgba(255, 255, 255, 0.6);
    --tls-close-hover-bg: rgba(255, 255, 255, 0.18);
}

.tlspopup-card.theme-light {
    background: #FFFFFF;
    color: #1A1A1A;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --tls-text-primary: #1A1A1A;
    --tls-text-secondary: #717171;
    --tls-text-muted: #999999;
    --tls-btn-primary-bg: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    --tls-btn-primary-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
    --tls-btn-primary-hover-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
    --tls-btn-secondary-bg: #F1F5F9;
    --tls-btn-secondary-color: #334155;
    --tls-btn-secondary-hover-bg: #E2E8F0;
    --tls-close-bg: #F1F5F9;
    --tls-close-color: #64748B;
    --tls-close-hover-bg: #E2E8F0;
}

.tlspopup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--tls-close-bg);
    color: var(--tls-close-color);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.tlspopup-close:hover {
    background: var(--tls-close-hover-bg);
    transform: scale(1.1);
}

.tlspopup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tlspopup-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.tlspopup-card.theme-dark .tlspopup-avatar {
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tlspopup-card.theme-light .tlspopup-avatar {
    border: 2px solid #E2E8F0;
}

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

.tlspopup-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.tlspopup-agent-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--tls-text-primary);
    line-height: 1.2;
}

.tlspopup-card.theme-dark .tlspopup-agent-name {
    color: #FFFFFF;
}

.tlspopup-since {
    font-size: 12px;
    color: var(--tls-text-secondary);
    font-weight: 400;
    line-height: 1.2;
}

.tlspopup-header-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    text-decoration: none;
}

.tlspopup-card.theme-dark .tlspopup-header-action {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.tlspopup-card.theme-dark .tlspopup-header-action:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: scale(1.08);
}

.tlspopup-card.theme-light .tlspopup-header-action {
    background: #F1F5F9;
    color: #64748B;
}

.tlspopup-card.theme-light .tlspopup-header-action:hover {
    background: #E2E8F0;
    transform: scale(1.08);
}

.tlspopup-hero {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 16px;
    overflow: hidden;
    max-height: 220px;
    aspect-ratio: 16 / 10;
    position: relative;
}

.tlspopup-card.theme-dark .tlspopup-hero {
    background: linear-gradient(135deg, #1E3A5F 0%, #0F2744 100%);
}

.tlspopup-card.theme-light .tlspopup-hero {
    background: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 100%);
}

.tlspopup-card.theme-light .tlspopup-hero img {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
}

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

.tlspopup-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.tlspopup-title-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.tlspopup-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tls-text-primary);
    line-height: 1.25;
    margin: 0;
}

.tlspopup-card.theme-dark .tlspopup-title {
    color: #FFFFFF;
}

.tlspopup-location {
    font-size: 12px;
    color: var(--tls-text-secondary);
    font-weight: 400;
    line-height: 1.3;
}

.tlspopup-card.theme-dark .tlspopup-location {
    color: rgba(255, 255, 255, 0.6);
}

.tlspopup-price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.tlspopup-price-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tls-text-muted);
    font-weight: 500;
}

.tlspopup-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--tls-text-primary);
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.tlspopup-card.theme-dark .tlspopup-price {
    color: #FFFFFF;
    font-size: 20px;
}

.tlspopup-card.theme-dark .tlspopup-price-label {
    display: none;
}

.tlspopup-grid {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tlspopup-card.theme-dark .tlspopup-grid {
    background: #161B22;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.tlspopup-card.theme-light .tlspopup-grid {
    background: transparent;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    position: relative;
}

.tlspopup-card.theme-light .tlspopup-grid::before,
.tlspopup-card.theme-light .tlspopup-grid::after {
    content: '';
    position: absolute;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: #E5E7EB;
}

.tlspopup-card.theme-light .tlspopup-grid::before {
    left: 33.33%;
}

.tlspopup-card.theme-light .tlspopup-grid::after {
    left: 66.66%;
}

.tlspopup-grid-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.tlspopup-card.theme-dark .tlspopup-grid-item {
    padding: 8px 4px;
}

.tlspopup-card.theme-light .tlspopup-grid-item {
    padding: 12px 8px;
}

.tlspopup-grid-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--tls-text-muted);
    font-weight: 600;
}

.tlspopup-grid-value {
    font-size: 14px;
    color: var(--tls-text-primary);
    font-weight: 700;
    word-break: break-word;
}

.tlspopup-card.theme-dark .tlspopup-grid-value {
    color: #FFFFFF;
}

.tlspopup-card.theme-light .tlspopup-grid-label {
    color: #717171;
    font-size: 10px;
}

.tlspopup-card.theme-light .tlspopup-grid-value {
    color: #1A1A1A;
}

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

.tlspopup-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    line-height: 1;
}

.tlspopup-btn-primary {
    background: var(--tls-btn-primary-bg);
    color: #FFFFFF;
    box-shadow: var(--tls-btn-primary-shadow);
}

.tlspopup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--tls-btn-primary-hover-shadow);
    color: #FFFFFF;
}

.tlspopup-btn-secondary {
    background: var(--tls-btn-secondary-bg);
    color: var(--tls-btn-secondary-color);
}

.tlspopup-btn-secondary:hover {
    background: var(--tls-btn-secondary-hover-bg);
}

@keyframes tlspopupOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tlspopupCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .tlspopup-card {
        width: 100%;
        max-width: calc(100vw - 24px);
        padding: 16px;
        max-height: calc(100vh - 24px);
    }

    .tlspopup-title {
        font-size: 16px;
    }

    .tlspopup-price {
        font-size: 16px;
    }

    .tlspopup-card.theme-dark .tlspopup-price {
        font-size: 18px;
    }

    .tlspopup-hero {
        max-height: 180px;
    }

    .tlspopup-grid-item {
        padding: 8px 6px;
    }

    .tlspopup-grid-value {
        font-size: 13px;
    }

    .tlspopup-actions {
        flex-direction: column;
    }
}