﻿body.devmap-modal-open {
    overflow: hidden;
}

.devmap-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(9, 14, 23, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.devmap-modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.devmap-modal-panel {
    position: relative;
    width: min(var(--devmap-modal-width, 960px), calc(100vw - 24px));
    height: min(var(--devmap-modal-height, 700px), calc(100vh - 24px));
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-panel-radius);
    overflow: hidden;
    background: var(--devmap-surface-secondary);
    box-shadow: var(--devmap-table-shadow, 0 24px 56px rgba(15, 23, 42, 0.22));
}

.devmap-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-control-radius);
    background: color-mix(in srgb, var(--devmap-surface-primary) 96%, transparent);
    color: var(--devmap-text-primary);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.devmap-modal-close:hover {
    background: var(--devmap-surface-hover);
    border-color: var(--devmap-panel-border);
    transform: none;
}

.devmap-modal-content {
    height: 100%;
    overflow: auto;
}

.devmap-modal-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: 100%;
}

.devmap-modal-section {
    min-width: 0;
    min-height: 0;
    padding: 30px;
}

.devmap-modal-section-media {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    border-right: 1px solid var(--devmap-panel-border);
    background: linear-gradient(180deg, var(--devmap-surface-muted) 0%, var(--devmap-surface-secondary) 100%);
}

.devmap-modal-section-details {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 28px;
    min-height: 0;
    background: linear-gradient(180deg, var(--devmap-surface-primary) 0%, var(--devmap-surface-secondary) 100%);
}

.devmap-modal-details-body {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 20px;
    overflow: auto;
    padding-right: 8px;
}

.devmap-modal-section-media.is-history-open {
    background: linear-gradient(180deg, var(--devmap-surface-secondary) 0%, var(--devmap-surface-muted) 100%);
}

.devmap-modal-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--devmap-panel-border);
    background: var(--devmap-surface-primary);
}

.devmap-modal-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-right: 1px solid var(--devmap-panel-border);
    background: var(--devmap-surface-primary);
    color: var(--devmap-text-muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: background 0.18s ease, color 0.18s ease;
}

.devmap-modal-tab:last-child {
    border-right: 0;
}

.devmap-modal-tab:hover {
    background: var(--devmap-surface-hover);
    color: var(--devmap-text-primary);
}

.devmap-modal-tab.is-active {
    background: var(--devmap-accent-strong);
    color: var(--devmap-text-contrast);
}

.devmap-modal-media-view {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.devmap-modal-media-frame {
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--devmap-panel-border);
    border-radius: 0;
    overflow: hidden;
    background: var(--devmap-surface-primary);
}

.devmap-modal-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: devmapModalPhotoIn 0.28s ease;
}

.devmap-modal-photo-trigger {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.devmap-modal-photo-trigger .devmap-modal-media-frame {
    height: 100%;
}

@keyframes devmapModalPhotoIn {
    from {
        opacity: 0;
        transform: scale(0.985);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.devmap-modal-media-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.devmap-modal-media-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-control-radius);
    background: var(--devmap-surface-primary);
    color: var(--devmap-text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.devmap-modal-media-btn:hover {
    border-color: var(--devmap-panel-border);
    background: var(--devmap-surface-hover);
}

.devmap-modal-media-btn.is-active {
    border-color: var(--devmap-accent-strong);
    background: var(--devmap-accent-strong);
    color: var(--devmap-text-contrast);
}

.devmap-modal-attachments {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.devmap-modal-attachments li {
    color: var(--devmap-text-muted);
    font-size: 15px;
}

.devmap-modal-attachment-link {
    color: var(--devmap-text-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.18s ease;
}

.devmap-modal-attachment-link:hover {
    color: var(--devmap-text-muted);
}

.devmap-modal-history-view {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 0;
    height: 100%;
}

.devmap-modal-history-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

.devmap-modal-history-title {
    color: var(--devmap-text-primary);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.devmap-modal-history-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: var(--devmap-surface-primary);
    color: var(--devmap-text-primary);
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    box-shadow: var(--devmap-table-shadow, 0 10px 18px rgba(15, 23, 42, 0.08));
    transition: background 0.18s ease, transform 0.18s ease;
}

.devmap-modal-history-close:hover {
    background: var(--devmap-surface-hover);
    transform: rotate(90deg);
}

.devmap-modal-history-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-control-radius);
    background: var(--devmap-surface-muted);
    color: var(--devmap-text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.devmap-modal-history-back:hover {
    background: var(--devmap-surface-hover);
    border-color: var(--devmap-panel-border);
    color: var(--devmap-text-primary);
}

.devmap-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 15, 24, 0.88);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.devmap-lightbox-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.devmap-lightbox-panel {
    position: relative;
    width: min(100%, 1400px);
    height: min(100%, calc(100vh - 32px));
    border-radius: 28px;
    overflow: hidden;
    background: rgba(8, 15, 25, 0.72);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
}

.devmap-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--devmap-text-contrast);
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease;
}

.devmap-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg);
}

.devmap-lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 32px;
}

.devmap-lightbox-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.devmap-modal-history-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow: auto;
}

.devmap-modal-history-item {
    padding: 16px 18px;
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-panel-radius);
    background: color-mix(in srgb, var(--devmap-surface-primary) 92%, transparent);
}

.devmap-modal-history-date {
    color: var(--devmap-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.devmap-modal-history-price {
    margin-top: 6px;
    color: var(--devmap-text-primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.devmap-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-right: 52px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--devmap-panel-border);
}

.devmap-modal-head-copy {
    min-width: 0;
}

.devmap-modal-title {
    margin: 0;
    color: var(--devmap-text-primary);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.04;
}

.devmap-modal-title-symbol {
    display: inline-block;
    margin-left: 5px;
    color: var(--devmap-text-muted);
    font-size: 0.42em;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    vertical-align: super;
    text-transform: uppercase;
}

.devmap-modal-subtitle {
    margin-top: 8px;
    color: var(--devmap-text-muted);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.devmap-modal-price-block {
    text-align: right;
    flex-shrink: 0;
}

.devmap-modal-price {
    color: #0e4334;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
}

.devmap-modal-price-currency {
    margin-left: 6px;
    font-size: 0.45em;
    vertical-align: super;
}

.devmap-modal-price-sub {
    margin-top: 6px;
    color: var(--devmap-text-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.devmap-modal-price-muted {
    color: var(--devmap-text-muted);
}

.devmap-modal-meta-stack {
    display: grid;
    gap: 12px;
}

.devmap-modal-price-history {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-panel-radius);
    background: var(--devmap-surface-muted);
}

.devmap-modal-price-history-note {
    color: var(--devmap-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.devmap-modal-price-history-note strong {
    color: var(--devmap-text-primary);
    font-weight: 800;
}

.devmap-modal-history-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--devmap-text-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    border-bottom: 1px solid currentColor;
}

.devmap-modal-history-trigger:hover {
    color: var(--devmap-text-primary);
}

.devmap-modal-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.devmap-modal-detail-sections {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.devmap-modal-fact {
    padding: 14px 16px;
    border: 1px solid var(--devmap-panel-border);
    border-radius: var(--devmap-panel-radius);
    background: var(--devmap-surface-muted);
}

.devmap-modal-fact-label {
    color: var(--devmap-text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.devmap-modal-fact-value {
    margin-top: 6px;
    color: var(--devmap-text-primary);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.devmap-modal-status-big {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 10px 16px;
    border-radius: var(--devmap-control-radius);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.devmap-modal-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid var(--devmap-accent-strong);
    border-radius: var(--devmap-control-radius);
    background: var(--devmap-accent-strong);
    color: var(--devmap-text-contrast);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.devmap-modal-call:hover {
    background: var(--devmap-text-primary);
    border-color: var(--devmap-text-primary);
}

.devmap-modal-call.is-disabled,
.devmap-modal-call:disabled {
    background: var(--devmap-surface-muted);
    color: var(--devmap-text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.devmap-modal-empty {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px dashed var(--devmap-panel-border);
    border-radius: var(--devmap-panel-radius);
    background: color-mix(in srgb, var(--devmap-surface-primary) 76%, transparent);
    color: var(--devmap-text-muted);
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

.devmap-modal-empty-history {
    min-height: 180px;
    background: color-mix(in srgb, var(--devmap-surface-primary) 88%, transparent);
}

@media (max-width: 720px) {

    .devmap-modal-overlay {
        padding: 8px;
    }

    .devmap-modal-panel {
        width: min(var(--devmap-modal-width, 96vw), calc(100vw - 16px));
        height: min(var(--devmap-modal-height, 90vh), calc(100vh - 16px));
        border-radius: 0;
    }

    .devmap-modal-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .devmap-modal-content {
        overflow: hidden;
    }

    .devmap-modal-split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 44%) minmax(0, 56%);
        height: 100%;
    }

    .devmap-modal-section {
        padding: 18px;
    }

    .devmap-modal-section-media {
        gap: 12px;
        border-right: 0;
        border-bottom: 1px solid #dde5ee;
        overflow: hidden;
    }

    .devmap-modal-tabs {
        width: 100%;
    }

    .devmap-modal-tab {
        flex: 1 1 0;
        justify-content: center;
        min-height: 48px;
    }

    .devmap-modal-media-view {
        min-height: 0;
        gap: 12px;
    }

    .devmap-modal-media-frame {
        min-height: 0;
        border-radius: 0;
    }

    .devmap-modal-photo {
        object-position: center;
    }

    .devmap-modal-media-buttons {
        flex-wrap: nowrap;
        gap: 8px;
        margin-top: 12px;
        padding-bottom: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .devmap-modal-media-btn {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 12px;
        font-size: 12px;
    }

    .devmap-modal-history-view {
        gap: 12px;
    }

    .devmap-modal-history-list {
        gap: 10px;
    }

    .devmap-modal-history-item {
        padding: 13px 14px;
        border-radius: 0;
    }

    .devmap-modal-history-date {
        font-size: 11px;
    }

    .devmap-modal-history-price {
        font-size: 17px;
    }

    .devmap-modal-head {
        width: 100%;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding-right: 0;
    }

    .devmap-modal-head-copy {
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 10px;
    }

    .devmap-modal-title {
        font-size: clamp(23px, 6.8vw, 30px);
        line-height: 1.08;
    }

    .devmap-modal-price-block {
        margin-left: auto;
        text-align: right;
        flex: 0 0 auto;
        align-self: flex-start;
    }

    .devmap-modal-price {
        font-size: clamp(22px, 6.5vw, 30px);
    }

    .devmap-modal-price-sub {
        margin-top: 3px;
        font-size: 11px;
        white-space: nowrap;
    }

    .devmap-modal-price-history {
        gap: 6px;
        padding: 12px 13px;
        border-radius: 0;
    }

    .devmap-modal-price-history-note {
        font-size: 13px;
    }

    .devmap-modal-history-trigger {
        font-size: 10px;
    }

    .devmap-modal-section-details {
        gap: 16px;
        overflow: hidden;
        padding-top: 54px;
    }

    .devmap-modal-details-body {
        gap: 14px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 2px;
    }

    .devmap-modal-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .devmap-modal-fact {
        padding: 10px 12px;
        border-radius: 0;
    }

    .devmap-modal-fact-label {
        font-size: 9px;
    }

    .devmap-modal-fact-value {
        margin-top: 3px;
        font-size: 14px;
    }

    .devmap-modal-status-big {
        width: 100%;
        justify-content: center;
        padding: 9px 14px;
        font-size: 12px;
    }

    .devmap-modal-call {
        min-height: 50px;
        font-size: 14px;
    }

    .devmap-modal-history-back {
        min-height: 42px;
        font-size: 13px;
    }

    .devmap-modal-attachments {
        gap: 10px;
        padding-left: 18px;
    }

    .devmap-modal-attachments li {
        font-size: 14px;
    }

    .devmap-lightbox-overlay {
        padding: 10px;
    }

    .devmap-lightbox-panel {
        height: min(100%, calc(100vh - 20px));
        border-radius: 22px;
    }

    .devmap-lightbox-content {
        padding: 22px 14px 14px;
    }

    .devmap-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 26px;
    }

}
