.mappressor-map-wrapper {
    position: relative;
}

.mappressor-compare-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 400px;
    min-height: 240px;
    gap: 2px;
}

.mappressor-compare-pane {
    position: relative;
    min-height: 0;
    height: 100%;
}

.mappressor-compare-pane .mappressor-map {
    height: 100%;
    min-height: 0;
}

.mappressor-compare-split__label {
    position: absolute;
    z-index: 500;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(15, 18, 28, 0.78);
    color: #f8fafc;
    font-size: 11px;
    pointer-events: none;
}

.mappressor-map {
    width: 100%;
    height: 400px;
    min-height: 240px;
    position: relative;
    --mp-fx-intensity: 0.6;
}

.mappressor-map--still {
    overflow: hidden;
    background: #020617;
}

.mappressor-map__still,
.mappressor-map__still-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mappressor-map[data-scroll="off"] {
    overscroll-behavior: none;
}

.mappressor-map[class*="mappressor-map--fx-"]::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 450;
    box-shadow: none;
    background-image: none;
}

.mappressor-map--fx-grain::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
    background-size: 160px 160px;
    opacity: calc(0.16 + (var(--mp-fx-intensity, 0.6) * 0.38));
}

.mappressor-map--fx-noise::after {
    background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.08) 0 1px, transparent 1px 4px);
    opacity: calc(0.2 + (var(--mp-fx-intensity, 0.6) * 0.35));
}

.mappressor-map--fx-grain.mappressor-map--fx-noise::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>"),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.08) 0 1px, transparent 1px 4px);
    opacity: calc(0.22 + (var(--mp-fx-intensity, 0.6) * 0.4));
}

.mappressor-map--fx-vignette::after {
    box-shadow: inset 0 0 calc(40px + (var(--mp-fx-intensity, 0.6) * 90px)) calc(12px + (var(--mp-fx-intensity, 0.6) * 28px)) rgba(0, 0, 0, calc(0.35 + (var(--mp-fx-intensity, 0.6) * 0.45)));
}

.mappressor-map--fx-blur-edges::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 440;
    backdrop-filter: blur(calc(2px + (var(--mp-fx-intensity, 0.6) * 10px)));
    -webkit-backdrop-filter: blur(calc(2px + (var(--mp-fx-intensity, 0.6) * 10px)));
    mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, transparent 42%, #000 100%);
    -webkit-mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, transparent 42%, #000 100%);
}

.mappressor-map--wash-night .leaflet-tile-pane,
.mappressor-map--wash-night .maplibregl-canvas,
.mappressor-map--wash-night canvas {
    filter: brightness(calc(1 - (var(--mp-fx-intensity, 0.6) * 0.38))) saturate(calc(1 - (var(--mp-fx-intensity, 0.6) * 0.2))) hue-rotate(14deg);
}

.mappressor-map--wash-ink .leaflet-tile-pane,
.mappressor-map--wash-ink .maplibregl-canvas,
.mappressor-map--wash-ink canvas {
    filter: grayscale(calc(var(--mp-fx-intensity, 0.6))) contrast(calc(1 + (var(--mp-fx-intensity, 0.6) * 0.22)));
}

.mappressor-map--wash-contrast .leaflet-tile-pane,
.mappressor-map--wash-contrast .maplibregl-canvas,
.mappressor-map--wash-contrast canvas {
    filter: contrast(calc(1 + (var(--mp-fx-intensity, 0.6) * 0.38))) saturate(calc(1 + (var(--mp-fx-intensity, 0.6) * 0.12)));
}

.mappressor-map--wash-paper .leaflet-tile-pane,
.mappressor-map--wash-paper .maplibregl-canvas,
.mappressor-map--wash-paper canvas {
    filter: sepia(calc(var(--mp-fx-intensity, 0.6) * 0.45)) contrast(calc(1 - (var(--mp-fx-intensity, 0.6) * 0.06))) brightness(calc(1 + (var(--mp-fx-intensity, 0.6) * 0.06)));
}

.mappressor-map-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 240px;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    background: #0b1120;
}

.mappressor-basemap-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.mappressor-basemap-bar > .pressor-field-hint {
    flex: 1 0 100%;
    margin: 0;
}

.mappressor-map-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.mappressor-ink-switch {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 3px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.45);
}

.mappressor-ink-switch__btn {
    appearance: none;
    margin: 0;
    padding: 4px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.mappressor-ink-switch__btn.is-active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

.mappressor-ink-switch.is-disabled,
.mappressor-ink-switch.is-disabled .mappressor-ink-switch__btn {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.mappressor-view-switch,
.mappressor-view-switch.is-disabled,
.mappressor-view-switch.is-disabled .mappressor-ink-switch__btn {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.mappressor-names-switch .mappressor-ink-switch__btn {
    min-width: 4.4em;
}

.mappressor-map-type-btn {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.35);
    color: inherit;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.mappressor-map-type-btn.is-active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-color: transparent;
}

.mappressor-query-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.mappressor-query-row[hidden] {
    display: none !important;
}

.mappressor-attribution {
    position: absolute;
    right: 8px;
    bottom: 4px;
    background: rgba(0,0,0,0.6);
    color: #e5e7eb;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
}

.mappressor-attribution.is-empty,
.mappressor-attribution[hidden] {
    display: none;
}

.maplibregl-ctrl-attrib,
.leaflet-control-attribution,
.cesium-viewer-bottom,
.cesium-widget-credits,
.cesium-credit-logoContainer,
.cesium-credit-expand-link {
    display: none !important;
}

.mappressor-map--mapcn {
    height: min(70vh, 640px);
    min-height: 320px;
}

.mappressor-map--cesium {
    height: min(70vh, 640px);
    min-height: 320px;
    overflow: hidden;
}

.mappressor-map--cesium .cesium-viewer,
.mappressor-map--cesium .cesium-widget {
    width: 100%;
    height: 100%;
}

.mappressor-build-hint {
    opacity: 0.85;
}

.mappressor-viewer-module {
    border: 2px solid rgba(99, 102, 241, 0.55);
    border-radius: 8px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 360px;
}

.pressor-workspace-panel[data-view="ext-mappressor"] .pressor-panel-chrome-body,
.pressor-workspace-panel[data-view="ext-mappressor-viewer"] .pressor-panel-chrome-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.pressor-workspace-panel[data-view="ext-mappressor"] .mappressor-viewer-module #mappressor_workspace_map,
.pressor-workspace-panel[data-view="ext-mappressor-viewer"] .mappressor-viewer-module #mappressor_workspace_map {
    flex: 1 1 auto;
    min-height: 280px;
}

.mappressor-app {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
}

.mappressor-app__stage {
    flex: 1 1 62%;
    min-width: 0;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.mappressor-app__inspector {
    flex: 0 0 min(380px, 40%);
    min-width: 260px;
    max-width: 420px;
    overflow: auto;
    border-left: 1px solid rgba(148, 163, 184, 0.28);
    padding: 10px 12px;
}

@media (max-width: 900px) {
    .mappressor-app {
        flex-direction: column;
    }

    .mappressor-app__inspector {
        flex: 0 0 auto;
        max-width: none;
        border-left: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.28);
    }
}

.mappressor-mapcn-host {
    min-height: 240px;
    height: 100%;
    width: 100%;
}

.mappressor-viewer-panel .mappressor-viewer-module {
    border-width: 2px;
}

.mappressor-chrome-btn--maximize {
    font-size: 11px;
}

/* Map params module — TaskPressor-style side tabs */
.mappressor-params-tabs {
    display: flex;
    flex-direction: row;
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
    align-self: stretch;
    padding: 0;
}

.mappressor-params-tabs .mappressor-params-tabs__nav {
    flex-shrink: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.4);
}

.mappressor-params-tabs .mappressor-params-tabs__main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    overflow: auto;
}

.mappressor-params-tabs .pressor-task-panel {
    display: none;
}

.mappressor-params-tabs .pressor-task-panel.is-active {
    display: block;
}

.mappressor-params-tabs .pressor-subsection-title {
    margin-top: 0;
}

.mappressor-tile-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 10px;
}

.mappressor-tile-url-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}

.mappressor-tile-url-row .pressor-input {
    flex: 1;
    min-width: 0;
}

.mappressor-tile-url-row .pressor-btn-inline {
    flex-shrink: 0;
    white-space: nowrap;
}

.mappressor-tile-browse-modal {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
}

.mappressor-tile-browse-modal[hidden] {
    display: none !important;
}

.mappressor-tile-browse-inner {
    width: min(420px, calc(100vw - 24px));
    max-height: min(70vh, 520px);
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

.mappressor-tile-browse-inner h4 {
    margin: 0 0 10px;
    font-size: 14px;
}

.mappressor-tile-browse-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.mappressor-tile-browse-list li {
    margin: 0 0 6px;
}

.mappressor-tile-browse-list button {
    width: 100%;
    text-align: left;
    font-size: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
}

.mappressor-tile-browse-list button:hover {
    background: #eef2ff;
    border-color: rgba(99, 102, 241, 0.45);
}

.mappressor-tile-browse-url {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: #475569;
    word-break: break-all;
    margin-top: 2px;
}

.mappressor-tile-browse-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mappressor-tile-preset-btn {
    font-size: 11px;
    padding: 4px 8px;
}

.mappressor-tile-zoom-row {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 8px 10px;
    align-items: center;
    margin: 8px 0;
}

.mappressor-tile-zoom-input {
    max-width: 5rem;
}

.mappressor-tile-status {
    min-height: 1.2em;
    margin-top: 8px;
}

.mappressor-tile-preview {
    display: block;
    max-width: 256px;
    margin-top: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 6px;
}

.mappressor-tile-preview.is-error {
    opacity: 0.45;
    border-color: #f87171;
}

.mappressor-share-panel {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.mappressor-share-panel__title {
    margin: 0 0 6px;
    font-size: 13px;
}

.mappressor-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 10px;
}

.mappressor-share-token-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 10px;
}

.mappressor-share-token-row .pressor-input {
    flex: 1;
    min-width: 0;
}

.mappressor-share-import {
    width: 100%;
    min-height: 72px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    margin-bottom: 8px;
}

.mappressor-share-merge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
}

.mappressor-share-status {
    min-height: 1.2em;
    margin-top: 6px;
}

.mappressor-boundary-legend[hidden] {
    display: none !important;
}

.mappressor-boundary-legend {
    position: absolute;
    left: 10px;
    bottom: 30px;
    z-index: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #b91c1c;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    pointer-events: none;
}

.mappressor-boundary-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(220, 38, 38, 0.28);
    border: 2px solid #dc2626;
}

.mappressor-leaflet-marker {
    background: none !important;
    border: none !important;
}

.mappressor-leaflet-marker--ghost,
.mappressor-leaflet-marker--ghost .mappressor-map-marker {
    opacity: 0.4;
}

.mappressor-map-marker-content {
    pointer-events: auto;
}

.mappressor-map-marker {
    position: relative;
    display: block;
    width: 28px;
    height: 28px;
    cursor: pointer;
    filter: drop-shadow(0 1px 2px rgba(15, 18, 28, 0.45));
}

.mappressor-map-marker img,
.mappressor-map-marker svg {
    display: block;
    width: 28px;
    height: 28px;
}

.mappressor-map-marker-chip {
    position: absolute;
    left: calc(100% + 4px);
    bottom: 18px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 18, 28, 0.86);
    color: #f8fafc;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.mappressor-map-marker-chip--flag {
    padding: 0 2px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(15, 18, 28, 0.55));
}

.mappressor-card__flag {
    font-size: 1.05em;
    line-height: 1;
}

.mappressor-pin-flag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 4px;
}

.mappressor-pin-flag-row input {
    width: 4.5em;
    text-transform: uppercase;
}

.mappressor-pin-flag-preview {
    font-size: 1.35em;
    line-height: 1;
    min-width: 1.4em;
}

.mappressor-flag-atlas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.mappressor-flag-mark {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(15, 18, 28, 0.5));
    white-space: nowrap;
}

.mappressor-flag-mark--state,
.mappressor-flag-mark--city {
    font-size: 18px;
}

.mappressor-flag-mark--place {
    font-size: 20px;
}

.mappressor-flag-mark img {
    display: block;
    height: 16px;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 18, 28, 0.2);
}

.mappressor-leaflet-flag {
    background: none !important;
    border: none !important;
}

.mappressor-card {
    min-width: 180px;
    max-width: 240px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    color: var(--mp-card-ink, #0f172a);
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.mappressor-card__title,
.mappressor-card__row,
.mappressor-card a {
    color: var(--mp-card-ink, #0f172a);
    opacity: 1;
}

.mappressor-card__row--address {
    font-weight: 600;
}

.mappressor-card__image {
    display: block;
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 8px;
}

.mappressor-card__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 650;
}

.mappressor-card__row {
    margin: 0 0 4px;
}

.mappressor-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mappressor-card__btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    border: 0;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.mappressor-card__btn--ghost {
    background: transparent;
    color: inherit;
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}

.mappressor-card-popup {
    background: transparent;
    color: var(--mp-card-ink, #0f172a);
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

.leaflet-popup.mappressor-card-popup .leaflet-popup-content-wrapper,
.maplibregl-popup.mappressor-card-popup .maplibregl-popup-content,
.maplibregl-popup-content:has(.mappressor-card) {
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: var(--mp-card-ink, #0f172a);
}

.leaflet-popup.mappressor-card-popup .leaflet-popup-content {
    margin: 0;
    color: inherit;
}

.leaflet-popup.mappressor-card-popup .leaflet-popup-tip,
.maplibregl-popup.mappressor-card-popup .maplibregl-popup-tip {
    background: #fff;
}

.mappressor-cesium-card {
    position: absolute;
    z-index: 40;
    transform: translate(-50%, calc(-100% - 12px));
    max-width: 280px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: auto;
}

.mappressor-cesium-card--map {
    z-index: 36;
}

.mappressor-leaflet-marker--ghost {
    background: none !important;
    border: none !important;
}

.mappressor-map-marker--ghost {
    display: block;
    width: 8px;
    height: 8px;
}
