#map {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100%;
}

.maplibregl-popup-content {
    background: rgba(17, 17, 17, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #eee;
    font-family: "Asap", "Segoe UI", sans-serif;
    min-width: 280px;
    border-radius: 15px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    padding: 0;
    overflow: hidden;
}

.maplibregl-popup-tip {
    background: rgba(17, 17, 17, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tas-popup-shell {
    padding: 14px 16px 12px;
}

.tas-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tas-popup-badge {
    display: inline-block;
    background: #b72714;
    color: white;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.tas-popup-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-color, #eee);
}

.tas-popup-meta {
    color: #d7d7d7;
    line-height: 1.5;
    font-size: 0.86rem;
}

.tas-popup-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.tas-popup-button,
.tas-dialog-close,
.tas-dialog-button {
    border: none;
    border-radius: 10px;
    background: #b72714;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.tas-popup-button {
    padding: 8px 12px;
}

.tas-popup-button:hover,
.tas-dialog-close:hover,
.tas-dialog-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.tas-dialog {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(9, 9, 9, 0.72);
    z-index: 1000;
    padding: 20px;
}

.tas-dialog.visible {
    display: flex;
}

.tas-dialog-panel {
    width: min(760px, 100%);
    max-height: 82vh;
    overflow: auto;
    background: #1d1d1d;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.tas-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #333;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tas-dialog-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
}

.tas-dialog-close {
    padding: 6px 10px;
    background: #b72714;
}

.tas-dialog-body {
    padding: 18px;
    color: #eee;
}

.tas-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 18px;
    margin: 16px 0;
    font-size: 0.92rem;
}

.tas-detail-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.tas-detail-label {
    display: block;
    margin-bottom: 4px;
    color: #d9d9d9;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tas-detail-value {
    font-weight: 700;
    color: white;
    line-height: 1.4;
}

.tas-product-text {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    white-space: pre-wrap;
    color: #f4f4f4;
    line-height: 1.6;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.82rem;
}

@media (max-width: 700px) {
    .topbar {
        flex-wrap: wrap;
    }

    .status {
        width: 100%;
        order: 3;
    }
}

.map-ctrls {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 1000;
}

.map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid #888;
    background-color: rgba(0, 0, 0, 0.3);
    color: #eee;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.map-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.map-search-panel {
    position: fixed;
    right: 10px;
    bottom: 62px;
    z-index: 1000;
    width: min(430px, calc(100% - 20px));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #888;
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
    padding: 12px;
    display: none;
}

.map-search-panel.visible {
    display: block;
}

.map-search-form {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
}

.map-search-icon {
    font-size: 1rem;
    color: #ddd;
}

.map-search-input {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.32);
    color: #eee;
    font: inherit;
    padding: 10px 12px;
}

.map-search-input::placeholder {
    color: #b8b8b8;
}

.map-search-input:focus,
.map-search-submit:focus,
.map-search-result:focus,
.map-btn:focus {
    outline: 2px solid rgba(183, 39, 20, 0.75);
    outline-offset: 1px;
}

.map-search-submit {
    border: none;
    border-radius: 10px;
    background: #b72714;
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 10px 12px;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.map-search-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.map-search-results {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(42vh, 310px);
    overflow: auto;
}

.map-search-msg {
    margin: 4px 0;
    font-size: 0.88rem;
    color: #d7d7d7;
}

.map-search-result {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #eee;
    text-align: left;
    font: inherit;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.map-search-result:hover {
    background: rgba(183, 39, 20, 0.2);
    border-color: rgba(183, 39, 20, 0.8);
}

.map-search-result-title {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.35;
}

.map-search-result-meta {
    color: #bcbcbc;
    font-size: 0.78rem;
    text-transform: capitalize;
}

@media (max-width: 700px) {
    .map-search-panel {
        bottom: 68px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .map-search-form {
        grid-template-columns: 1fr;
    }

    .map-search-icon {
        display: none;
    }
}