/*
 * Future Map Pro
 * Mobile-first app shell for BandoBDS map workflows.
 */

:root {
    --fmp-ink: #0f172a;
    --fmp-muted: #64748b;
    --fmp-night: #08111f;
    --fmp-night-2: #111827;
    --fmp-glass-dark: rgba(8, 17, 31, 0.82);
    --fmp-soft: rgba(255, 255, 255, 0.88);
    --fmp-surface: rgba(255, 255, 255, 0.94);
    --fmp-border: rgba(15, 23, 42, 0.12);
    --fmp-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    --fmp-green: #16a34a;
    --fmp-green-2: #0f9f83;
    --fmp-orange: #f97316;
    --fmp-orange-2: #f59e0b;
    --fmp-cyan: #0891b2;
    --fmp-blue: #2563eb;
    --fmp-danger: #ef4444;
    --fmp-radius-lg: 18px;
    --fmp-radius-md: 14px;
    --fmp-radius-sm: 10px;
    --fmp-safe-bottom: env(safe-area-inset-bottom, 0px);
    --fmp-bottom-nav-height: 76px;
}

html,
body {
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    color: var(--fmp-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.fmp-shell {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 10020;
}

.fmp-shell button,
.fmp-tool-sheet,
.fmp-sheet-backdrop {
    pointer-events: auto;
}

/* Top command bar: restyle the existing search/layer menu without changing JS hooks. */
#custom-layer-menu {
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    width: min(720px, calc(100vw - 190px));
    max-width: calc(100vw - 32px);
}

#custom-layer-menu .layer-group.search-box-container {
    width: 100%;
    padding: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.86)) !important;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.2) !important;
    backdrop-filter: blur(18px) saturate(1.4);
}

#custom-layer-menu .layer-group.search-box-container > div {
    max-width: none !important;
    width: 100% !important;
    min-width: 0 !important;
}

#searchBarRegionBtn,
#btnShowAllOverlay,
#searchBarLocateBtn {
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

#searchBarRegionBtn {
    background: linear-gradient(135deg, var(--fmp-orange-2), var(--fmp-orange)) !important;
}

#btnShowAllOverlay,
#searchBarLocateBtn {
    background: linear-gradient(135deg, var(--fmp-green), var(--fmp-green-2)) !important;
}

#overlayLayerSearch {
    height: 44px !important;
    color: var(--fmp-ink) !important;
    font-size: 15px !important;
    font-weight: 650 !important;
}

#overlayLayerSearch::placeholder {
    color: #6b7280;
    font-weight: 600;
}

/* Right controls and opacity slider become quieter on large screens. */
#quick-action-fabs {
    top: calc(86px + env(safe-area-inset-top, 0px)) !important;
    right: 22px !important;
    gap: 10px !important;
    align-items: stretch !important;
}

body.future-map-pro #quick-action-fabs {
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
}

body.future-map-pro #quick-action-fabs > .tool-btn,
body.future-map-pro #quick-action-fabs > .account-dropdown,
body.future-map-pro #quick-action-fabs > #expandable-tools {
    display: none !important;
}

body.future-map-pro #quick-action-fabs #accountModal {
    pointer-events: auto !important;
}

#quick-action-fabs .tool-btn {
    min-height: 44px;
    border-radius: 999px !important;
    padding: 0 16px !important;
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22) !important;
    color: #fff !important;
    backdrop-filter: blur(14px);
}

#quick-action-fabs #expandToolsBtn {
    background: linear-gradient(135deg, var(--fmp-orange), #c2410c) !important;
}

#quick-action-fabs .btn-banghang,
#quick-action-fabs .btn-source-members {
    background: linear-gradient(135deg, #0f766e, #0891b2) !important;
}

#quick-action-fabs .btn-phu,
#quick-action-fabs .btn-measure,
#quick-action-fabs .btn-location,
#quick-action-fabs .btn-coord,
#quick-action-fabs .btn-favorite {
    background: rgba(15, 23, 42, 0.82) !important;
}

.opacity-slider-wrapper {
    right: 22px !important;
    top: auto !important;
    bottom: 128px !important;
    transform: none !important;
    opacity: 0.9;
}

.opacity-slider-wrapper .opacity-label {
    background: var(--fmp-surface) !important;
    border: 1px solid var(--fmp-border);
    color: var(--fmp-ink) !important;
}

/* Layer drawer: reuse existing #overlayLayerListContainer. */
#overlayLayerListContainer {
    top: calc(82px + env(safe-area-inset-top, 0px)) !important;
    left: auto !important;
    right: 22px !important;
    transform: none !important;
    width: min(420px, calc(100vw - 44px)) !important;
    max-width: min(420px, calc(100vw - 44px)) !important;
    max-height: min(640px, calc(100vh - 150px)) !important;
    padding: 14px !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--fmp-shadow) !important;
    backdrop-filter: blur(20px) saturate(1.25);
}

#overlayLayerList {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    max-width: none !important;
    min-width: 0 !important;
    max-height: calc(min(640px, 100vh - 150px) - 28px) !important;
}

#overlayLayerList button {
    justify-content: flex-start !important;
    min-height: 42px !important;
    border-radius: 12px !important;
    padding: 9px 12px !important;
    font-weight: 750 !important;
    box-shadow: none !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.fmp-layer-active-summary {
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.fmp-layer-summary-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 850;
}

.fmp-layer-summary-title small {
    color: #64748b;
    font-weight: 800;
}

.fmp-layer-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#overlayLayerList .fmp-layer-chip {
    width: auto !important;
    max-width: 100%;
    min-height: 34px !important;
    padding: 7px 10px !important;
    border: none !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #0f766e, #0891b2) !important;
    color: #fff !important;
    box-shadow: none !important;
    font-size: 12px !important;
}

#overlayLayerList .fmp-layer-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmp-layer-empty {
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 750;
}

/* Desktop rail */
.fmp-desktop-rail {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px) saturate(1.3);
    max-height: calc(100vh - 32px);
    overflow: visible;
}

.fmp-rail-btn {
    width: 58px;
    min-height: 58px;
    border: none;
    border-radius: 18px;
    color: #334155;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.05;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.fmp-rail-btn span {
    display: block;
    max-width: 52px;
    overflow: hidden;
    color: inherit;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmp-rail-btn:hover,
.fmp-rail-btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--fmp-green), var(--fmp-cyan));
    transform: translateY(-1px);
}

.fmp-rail-more {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    display: grid;
    grid-template-columns: repeat(2, 58px);
    gap: 8px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translate(8px, -50%) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.fmp-rail-more > .fmp-rail-btn {
    min-height: 58px;
}

.fmp-desktop-rail.is-expanded .fmp-rail-more {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
}

.fmp-rail-more-toggle i {
    transition: transform 0.2s ease;
}

.fmp-rail-more-toggle.is-expanded i {
    transform: rotate(180deg);
}

/* Mobile app controls */
.fmp-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + var(--fmp-safe-bottom));
    height: 64px;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 6px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(20px) saturate(1.35);
}

.fmp-nav-item {
    height: 52px;
    border: none;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #64748b;
    background: transparent;
    font-size: 11px;
    font-weight: 750;
}

.fmp-nav-item i {
    font-size: 17px;
}

.fmp-nav-item.is-active {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(8, 145, 178, 0.14));
    color: #047857;
}

.fmp-mobile-fab {
    position: fixed;
    right: 16px;
    bottom: calc(88px + var(--fmp-safe-bottom));
    width: 56px;
    height: 56px;
    display: none;
    place-items: center;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 20px;
    background: linear-gradient(135deg, var(--fmp-orange), #c2410c);
    box-shadow: 0 16px 42px rgba(249, 115, 22, 0.38);
}

.fmp-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(2px);
}

.fmp-tool-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + var(--fmp-safe-bottom));
    max-height: min(76vh, 620px);
    transform: translateY(calc(100% + 24px));
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 26px;
    padding: 10px 14px 18px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 -24px 60px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(22px) saturate(1.3);
    overflow: auto;
}

.fmp-tool-sheet.is-open {
    transform: translateY(0);
}

body.fmp-sheet-open .fmp-bottom-nav {
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
}

.fmp-sheet-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 12px;
}

.fmp-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 0 2px 14px;
}

.fmp-tool-radial {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(58px, auto);
    gap: 12px;
    padding: 10px 0 2px;
    isolation: isolate;
}

.fmp-spoke {
    position: absolute;
    left: 50%;
    top: 46%;
    z-index: 0;
    width: 46%;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.42), transparent);
    transform-origin: left center;
    pointer-events: none;
}

.fmp-spoke-1 {
    transform: rotate(-132deg);
}

.fmp-spoke-2 {
    transform: rotate(-90deg);
}

.fmp-spoke-3 {
    transform: rotate(-48deg);
}

.fmp-spoke-4 {
    transform: rotate(0deg);
}

.fmp-spoke-5 {
    transform: rotate(48deg);
}

.fmp-spoke-6 {
    transform: rotate(132deg);
}

.fmp-tool-center {
    z-index: 2;
    grid-column: 2;
    grid-row: 3;
    min-height: 72px;
    border: 0;
    border-radius: 26px;
    color: #fff;
    background: linear-gradient(135deg, var(--fmp-green), var(--fmp-cyan));
    box-shadow: 0 18px 42px rgba(8, 145, 178, 0.34);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 20px;
    font-weight: 900;
}

.fmp-tool-center span {
    font-size: 11px;
    line-height: 1;
}

.fmp-tool-radial .fmp-tool-tile {
    position: relative;
    z-index: 1;
}

.fmp-tool-radial button:nth-of-type(2) {
    grid-column: 1;
    grid-row: 1;
}

.fmp-tool-radial button:nth-of-type(3) {
    grid-column: 2;
    grid-row: 1;
}

.fmp-tool-radial button:nth-of-type(4) {
    grid-column: 3;
    grid-row: 1;
}

.fmp-tool-radial button:nth-of-type(5) {
    grid-column: 1;
    grid-row: 2;
}

.fmp-tool-radial button:nth-of-type(6) {
    grid-column: 3;
    grid-row: 2;
}

.fmp-tool-radial button:nth-of-type(7) {
    grid-column: 1;
    grid-row: 3;
}

.fmp-tool-radial button:nth-of-type(8) {
    grid-column: 3;
    grid-row: 3;
}

.fmp-tool-radial button:nth-of-type(9) {
    grid-column: 1;
    grid-row: 4;
}

.fmp-tool-radial button:nth-of-type(10) {
    grid-column: 2;
    grid-row: 4;
}

.fmp-tool-radial button:nth-of-type(11) {
    grid-column: 3;
    grid-row: 4;
}

.fmp-tool-radial button:nth-of-type(12) {
    grid-column: 1;
    grid-row: 5;
}

.fmp-tool-radial button:nth-of-type(13) {
    grid-column: 2;
    grid-row: 5;
}

.fmp-tool-radial button:nth-of-type(14) {
    grid-column: 3;
    grid-row: 5;
}

.fmp-tool-radial button:nth-of-type(15) {
    grid-column: 2;
    grid-row: 6;
}

.fmp-eyebrow {
    margin: 0 0 4px;
    color: var(--fmp-green);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0;
}

.fmp-sheet-header h2 {
    margin: 0;
    color: var(--fmp-ink);
    font-size: 20px;
    font-weight: 850;
    letter-spacing: 0;
}

.fmp-sheet-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 14px;
    color: #475569;
    background: #f1f5f9;
}

.fmp-tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.fmp-tool-section {
    margin: 0;
    min-width: 0;
}

.fmp-tool-section > span {
    display: block;
    margin: 0 2px 8px;
    color: rgba(226, 232, 240, 0.76);
    font-size: 12px;
    font-weight: 850;
}

.fmp-tool-section:last-child {
    margin-bottom: 0;
}

.fmp-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fmp-admin-chip {
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.68);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
}

.fmp-admin-chip i {
    color: #22d3ee;
}

.fmp-tool-tile {
    min-height: 58px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #f8fafc;
    color: var(--fmp-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    font-weight: 800;
    text-align: center;
    font-size: 12px;
}

.fmp-tool-tile i {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--fmp-green), var(--fmp-cyan));
}

.fmp-tool-tile span,
.fmp-admin-chip span {
    min-width: 0;
    overflow-wrap: normal;
    line-height: 1.12;
}

.fmp-tool-tile.fmp-accent-orange i {
    background: linear-gradient(135deg, var(--fmp-orange-2), var(--fmp-orange));
}

/* Address and pin cards leave room for the app nav. */
#mapAddressFloating {
    bottom: calc(16px + var(--fmp-safe-bottom)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 0 !important;
    width: auto !important;
    max-width: min(640px, calc(100vw - 22px)) !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#mapAddressFloating .addr-row {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    width: auto !important;
    max-width: 100% !important;
    line-height: 1.18 !important;
}

#mapAddressFloating .addr-row span {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
}

#mapPinDetailCard {
    bottom: calc(160px + var(--fmp-safe-bottom)) !important;
}

/* Premium modal/table treatment for existing features. */
#banghang-modal {
    backdrop-filter: blur(8px) !important;
}

#banghang-modal > div {
    width: min(1180px, calc(100vw - 28px)) !important;
    max-height: min(82vh, 760px) !important;
    border-radius: 24px !important;
    padding: 24px !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28) !important;
}

#banghang-modal h4 {
    color: var(--fmp-ink);
    font-weight: 850;
}

#banghang-search-input {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    font-weight: 650;
}

.banghang-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.banghang-table th {
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.banghang-table td,
.banghang-table th {
    border-color: #e2e8f0 !important;
}

.pouplodat-popup .leaflet-popup-content-wrapper,
.pouplodat-popup .leaflet-popup-content {
    border-radius: 22px !important;
}

@media (min-width: 769px) and (max-width: 1180px) {
    #custom-layer-menu {
        width: min(620px, calc(100vw - 148px));
        left: 48%;
    }

    #quick-action-fabs {
        right: 18px !important;
        top: 92px !important;
    }
}

@media (min-width: 769px) {
    .fmp-tool-sheet {
        left: 50%;
        right: auto;
        bottom: 22px;
        width: min(760px, calc(100vw - 180px));
        max-height: min(620px, calc(100vh - 44px));
        transform: translate(-50%, calc(100% + 34px)) scale(0.98);
        transform-origin: center bottom;
    }

    .fmp-tool-sheet.is-open {
        transform: translate(-50%, 0) scale(1);
    }

    .fmp-tool-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #custom-layer-menu {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        top: calc(10px + env(safe-area-inset-top, 0px)) !important;
        left: 50% !important;
    }

    #custom-layer-menu .layer-group.search-box-container {
        border-radius: 18px !important;
        padding: 6px !important;
    }

    #custom-layer-menu .layer-group.search-box-container > div {
        gap: 5px !important;
    }

    #searchBarRegionBtn,
    #btnShowAllOverlay,
    #searchBarLocateBtn {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 14px !important;
    }

    #searchBarRegionBtn span,
    #btnShowAllOverlay span {
        display: none;
    }

    #searchBarRegionBtn i,
    #btnShowAllOverlay i {
        margin: 0 !important;
    }

    #searchBarRegionBtn,
    #btnShowAllOverlay {
        width: 42px !important;
        min-width: 42px !important;
        padding: 0 !important;
    }

    #overlayLayerSearch {
        height: 42px !important;
        font-size: 14px !important;
        padding-left: 34px !important;
    }

    #quick-action-fabs {
        display: block !important;
        width: 0 !important;
        height: 0 !important;
        overflow: visible !important;
        pointer-events: none !important;
    }

    #quick-action-fabs > .tool-btn,
    #quick-action-fabs > .account-dropdown,
    #quick-action-fabs > #expandable-tools {
        display: none !important;
    }

    #quick-action-fabs #accountModal {
        pointer-events: auto !important;
    }

    .fmp-desktop-rail {
        display: none;
    }

    .fmp-rail-btn {
        width: 54px;
        min-height: 54px;
        border-radius: 17px;
        font-size: 16px;
    }

    .fmp-rail-btn span {
        max-width: 48px;
        font-size: 8.5px;
    }

    .fmp-rail-more {
        grid-template-columns: repeat(2, 54px);
        right: calc(100% + 8px);
        max-width: calc(100vw - 86px);
        max-height: calc(100vh - 28px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fmp-rail-more > .fmp-rail-btn {
        min-height: 54px;
    }

    .opacity-slider-wrapper {
        right: 12px !important;
        bottom: calc(156px + var(--fmp-safe-bottom)) !important;
        transform: scale(0.86);
        transform-origin: right bottom;
    }

    .leaflet-control-attribution {
        display: none !important;
    }

    .fmp-bottom-nav {
        display: grid;
    }

    .fmp-mobile-fab {
        display: none;
    }

    #base-layer-selector {
        bottom: calc(88px + var(--fmp-safe-bottom)) !important;
        left: 12px !important;
        right: auto !important;
        width: 68px !important;
        height: 68px !important;
    }

    #overlayLayerListContainer {
        top: auto !important;
        left: 10px !important;
        right: 10px !important;
        bottom: calc(88px + var(--fmp-safe-bottom)) !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(58vh, 520px) !important;
        border-radius: 24px !important;
    }

    #overlayLayerList {
        max-height: calc(min(58vh, 520px) - 28px) !important;
    }

    #mapAddressFloating {
        bottom: calc(86px + var(--fmp-safe-bottom)) !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: fit-content !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 999px !important;
    }

    #mapAddressFloating .addr-row {
        font-size: var(--fmp-address-font, 11px) !important;
    }

    #mapPinDetailCard {
        bottom: calc(150px + var(--fmp-safe-bottom)) !important;
        width: calc(100vw - 18px) !important;
    }

    #regionSelectorContainer {
        top: calc(70px + env(safe-area-inset-top, 0px)) !important;
        width: calc(100vw - 20px) !important;
    }

    #banghang-modal {
        align-items: flex-end !important;
    }

    #banghang-modal > div {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: calc(92vh - var(--fmp-safe-bottom)) !important;
        border-radius: 26px 26px 0 0 !important;
        padding: 18px 14px calc(18px + var(--fmp-safe-bottom)) !important;
        margin: 0 !important;
    }

    #banghang-modal table {
        min-width: 0 !important;
        width: 100% !important;
        border: 0 !important;
        font-size: 13px !important;
    }

    #banghang-modal .bh-table-wrap {
        max-height: 58vh !important;
        overflow: auto !important;
    }

    #banghang-modal .bh-table-shell {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #banghang-modal .bh-table thead {
        display: none !important;
    }

    #banghang-modal .bh-table,
    #banghang-modal .bh-table tbody {
        display: block !important;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 12px;
        padding: 12px;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td {
        display: flex !important;
        min-height: 0;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        border: 0 !important;
        padding: 0 !important;
        text-align: right !important;
        word-break: break-word;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td::before {
        content: "";
        color: #64748b;
        font-size: 11px;
        font-weight: 850;
        text-align: left;
        text-transform: uppercase;
        flex: 0 0 auto;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(1) {
        display: none !important;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(2) {
        grid-column: 1 / -1;
        justify-content: flex-start;
        color: #0f172a;
        font-size: 16px;
        font-weight: 900;
        text-align: left !important;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(2)::before {
        content: "Lô";
        margin-right: 8px;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(3)::before { content: "Ghi chú"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(4)::before { content: "Diện tích"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(5)::before { content: "Hướng"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(6)::before { content: "Nhập"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(7)::before { content: "Bán"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(8)::before { content: "Giá"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(9)::before { content: "HĐ"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(10)::before { content: "Sale"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(11)::before { content: "Chênh"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(12)::before { content: "Lãi"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(13)::before { content: "Trạng thái"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(14)::before { content: "Người đăng"; }
    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(15)::before { content: "Ngày"; }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(16) {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
        text-align: left !important;
    }

    #banghang-modal .bh-table tbody tr:not(.bh-group-row):not(.bh-card-row) td:nth-child(16)::before {
        content: "Thao tác";
        width: 100%;
    }

    #banghang-modal .bh-group-row {
        display: block !important;
        margin: 8px 0 10px;
    }

    #banghang-modal .bh-group-row td {
        display: block !important;
        border: 0 !important;
        border-radius: 14px;
        padding: 10px 12px !important;
    }

    .account-modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(94vh - var(--fmp-safe-bottom)) !important;
        border-radius: 26px 26px 0 0 !important;
        align-self: flex-end;
    }

    #searchCoordPanel > div {
        width: calc(100vw - 24px) !important;
        border-radius: 24px !important;
    }
}

@media (max-width: 390px) {
    .fmp-nav-item span {
        font-size: 10px;
    }

    .fmp-tool-grid {
        gap: 8px;
    }

    .fmp-tool-tile {
        min-height: 56px;
        padding: 11px 12px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Future Map Pro v2: closer to the Pro/Mobile App concept while preserving old hooks. */
body.future-map-pro .modern-sidebar {
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.96), rgba(23, 34, 58, 0.92)) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 24px 0 70px rgba(2, 6, 23, 0.34) !important;
    backdrop-filter: blur(22px) saturate(1.2);
}

body.future-map-pro #custom-layer-menu .layer-group.search-box-container {
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    background: linear-gradient(135deg, rgba(8, 17, 31, 0.86), rgba(17, 24, 39, 0.72)) !important;
    box-shadow: 0 18px 52px rgba(2, 6, 23, 0.34) !important;
}

body.future-map-pro #overlayLayerSearch {
    color: #f8fafc !important;
}

body.future-map-pro #overlayLayerSearch::placeholder {
    color: rgba(226, 232, 240, 0.78);
}

body.future-map-pro #custom-layer-menu .fa-search {
    color: #34d399 !important;
}

body.future-map-pro .fmp-desktop-rail,
body.future-map-pro .fmp-rail-more {
    background: linear-gradient(180deg, rgba(8, 17, 31, 0.86), rgba(15, 23, 42, 0.74));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 22px 58px rgba(2, 6, 23, 0.36);
}

body.future-map-pro.has-admin-sidebar.has-sidebar-open .fmp-desktop-rail {
    right: 18px;
    left: auto;
}

body.future-map-pro.has-admin-sidebar.has-sidebar-open .admin-floating-controls {
    top: 94px !important;
}

body.future-map-pro .fmp-rail-btn {
    color: rgba(226, 232, 240, 0.82);
}

body.future-map-pro .fmp-rail-btn:hover,
body.future-map-pro .fmp-rail-btn.is-active {
    background: linear-gradient(135deg, #14b8a6, #22c55e);
    color: #fff;
}

body.future-map-pro .fmp-bottom-nav {
    background: linear-gradient(135deg, rgba(8, 17, 31, 0.92), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.42);
}

body.future-map-pro .fmp-nav-item {
    color: rgba(226, 232, 240, 0.72);
}

body.future-map-pro .fmp-nav-item.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.38), rgba(34, 197, 94, 0.28));
}

body.future-map-pro .fmp-mobile-fab {
    border-radius: 18px;
    background: linear-gradient(135deg, #f97316, #dc2626);
    box-shadow: 0 18px 48px rgba(249, 115, 22, 0.44);
}

body.future-map-pro .fmp-tool-sheet {
    background:
        radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 17, 31, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 -28px 70px rgba(2, 6, 23, 0.5);
}

body.future-map-pro .fmp-tool-sheet::-webkit-scrollbar,
body.future-map-pro #overlayLayerList::-webkit-scrollbar {
    width: 8px;
}

body.future-map-pro .fmp-tool-sheet::-webkit-scrollbar-thumb,
body.future-map-pro #overlayLayerList::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.36);
    border-radius: 999px;
}

body.future-map-pro .fmp-sheet-handle {
    background: rgba(148, 163, 184, 0.5);
}

body.future-map-pro .fmp-eyebrow {
    color: #34d399;
}

body.future-map-pro .fmp-sheet-header h2 {
    color: #f8fafc;
}

body.future-map-pro .fmp-sheet-close {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.16);
}

body.future-map-pro .fmp-tool-tile {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.72));
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.future-map-pro .fmp-tool-tile i {
    background: linear-gradient(135deg, #0f766e, #0891b2);
}

body.future-map-pro .fmp-tool-tile.fmp-accent-orange i {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

body.future-map-pro.fmp-theme-light .modern-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.9)) !important;
    border-right: 1px solid rgba(15, 23, 42, 0.1) !important;
    box-shadow: 22px 0 60px rgba(15, 23, 42, 0.18) !important;
}

body.future-map-pro.fmp-theme-light .modern-sidebar,
body.future-map-pro.fmp-theme-light .modern-sidebar * {
    color: #0f172a !important;
}

body.future-map-pro.fmp-theme-light #custom-layer-menu .layer-group.search-box-container {
    border-color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 18px 52px rgba(15, 23, 42, 0.2) !important;
}

body.future-map-pro.fmp-theme-light #overlayLayerSearch {
    color: #0f172a !important;
}

body.future-map-pro.fmp-theme-light #overlayLayerSearch::placeholder {
    color: #64748b;
}

body.future-map-pro.fmp-theme-light .fmp-desktop-rail,
body.future-map-pro.fmp-theme-light .fmp-rail-more,
body.future-map-pro.fmp-theme-light .fmp-bottom-nav {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

body.future-map-pro.fmp-theme-light .fmp-rail-btn,
body.future-map-pro.fmp-theme-light .fmp-nav-item {
    color: #64748b;
}

body.future-map-pro.fmp-theme-light .fmp-rail-btn:hover,
body.future-map-pro.fmp-theme-light .fmp-rail-btn.is-active,
body.future-map-pro.fmp-theme-light .fmp-nav-item.is-active {
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #0891b2);
}

body.future-map-pro.fmp-theme-light .fmp-tool-sheet {
    background:
        radial-gradient(circle at 16% 0%, rgba(20, 184, 166, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
    border-color: rgba(255, 255, 255, 0.78);
    box-shadow: 0 -28px 70px rgba(15, 23, 42, 0.24);
}

body.future-map-pro.fmp-theme-light .fmp-tool-section > span,
body.future-map-pro.fmp-theme-light .fmp-sheet-header h2 {
    color: #0f172a;
}

body.future-map-pro.fmp-theme-light .fmp-eyebrow {
    color: #047857;
}

body.future-map-pro.fmp-theme-light .fmp-sheet-close {
    color: #475569;
    background: #e2e8f0;
}

body.future-map-pro.fmp-theme-light .fmp-admin-chip,
body.future-map-pro.fmp-theme-light .fmp-tool-tile {
    border-color: rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.86);
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body.future-map-pro.fmp-sheet-open #mapAddressFloating,
body.future-map-pro.fmp-sheet-open #base-layer-selector,
body.future-map-pro.fmp-layer-panel-open #mapAddressFloating,
body.future-map-pro.fmp-layer-panel-open #base-layer-selector {
    opacity: 0;
    pointer-events: none;
}

body.future-map-pro.fmp-account-open #custom-layer-menu,
body.future-map-pro.fmp-account-open .fmp-bottom-nav,
body.future-map-pro.fmp-account-open .fmp-mobile-fab,
body.future-map-pro.fmp-account-open #mapAddressFloating,
body.future-map-pro.fmp-account-open #base-layer-selector,
body.future-map-pro.fmp-account-open .opacity-slider-wrapper {
    opacity: 0 !important;
    pointer-events: none !important;
}

body.future-map-pro.fmp-map-focus #custom-layer-menu,
body.future-map-pro.fmp-map-focus .fmp-desktop-rail,
body.future-map-pro.fmp-map-focus #quick-action-fabs,
body.future-map-pro.fmp-map-focus .opacity-slider-wrapper,
body.future-map-pro.fmp-map-focus #base-layer-selector,
body.future-map-pro.fmp-map-focus #mapAddressFloating {
    opacity: 0 !important;
    pointer-events: none !important;
}

body.future-map-pro.fmp-map-focus .fmp-bottom-nav {
    left: 50%;
    right: auto;
    width: min(220px, calc(100vw - 24px));
    transform: translateX(-50%);
    grid-template-columns: 1fr;
}

body.future-map-pro.fmp-map-focus .fmp-nav-item:not([data-fmp-action="map"]) {
    display: none;
}

body.future-map-pro .admin-modal-container {
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 12px !important;
    background: #f6f8fb !important;
    box-shadow: 0 28px 90px rgba(2, 6, 23, 0.42) !important;
    overflow: hidden !important;
}

body.future-map-pro .admin-modal-header {
    min-height: 58px !important;
    background: linear-gradient(135deg, rgba(8, 17, 31, 0.96), rgba(15, 23, 42, 0.92)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.future-map-pro .admin-modal-header h3 {
    color: #fff !important;
    font-weight: 850 !important;
    letter-spacing: 0 !important;
}

body.future-map-pro .admin-modal-close {
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    box-shadow: none !important;
}

body.future-map-pro .admin-modal-close:hover {
    background: rgba(239, 68, 68, 0.9) !important;
}

body.future-map-pro .admin-modal-body {
    background: #f6f8fb !important;
}

@media (max-width: 768px) {
    body.future-map-pro .admin-floating-controls {
        display: none !important;
    }

    body.future-map-pro #custom-layer-menu {
        z-index: 10030 !important;
    }

    body.future-map-pro #searchBarRegionBtn,
    body.future-map-pro #btnShowAllOverlay,
    body.future-map-pro #searchBarLocateBtn {
        width: 44px !important;
        min-width: 44px !important;
    }

    body.future-map-pro #btnShowAllOverlay {
        font-size: 0 !important;
    }

    body.future-map-pro #btnShowAllOverlay i {
        font-size: 16px !important;
    }

    body.future-map-pro #overlayLayerListContainer {
        background:
            radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.12), transparent 34%),
            linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.94)) !important;
        bottom: calc(84px + var(--fmp-safe-bottom)) !important;
    }

    body.future-map-pro .fmp-bottom-nav {
        left: 8px;
        right: 8px;
        height: 66px;
        padding: 6px;
        border-radius: 20px;
    }

    body.future-map-pro .fmp-nav-item {
        min-width: 0;
        height: 54px;
        border-radius: 15px;
        font-size: 10px;
    }

    body.future-map-pro .fmp-nav-item i {
        font-size: 16px;
    }

    body.future-map-pro .fmp-tool-sheet {
        max-height: min(80vh, 680px);
        padding: 10px 14px 20px;
    }

    body.future-map-pro .fmp-tool-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    body.future-map-pro .fmp-tool-tile {
        min-height: 58px;
        border-radius: 16px;
    }

    body.future-map-pro #mapAddressFloating {
        bottom: calc(92px + var(--fmp-safe-bottom)) !important;
    }
}
