:root {
    --bg-dark: #0f1115;
    --bg-panel: #161b22;
    --bg-card: #1f252e;
    --accent: #e53935;
    /* DayZ Red-ish */
    --accent-hover: #ff5252;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --success: #2ea043;
    --warning: #db6d28;
    --filter-title: #4ade80;
    --filter-item: #ffd84d;
    --legal-bar-height: 44px;
    /* Font scale for in-map labels (location names + tooltips).
       1.0 = current/max, 0.5 = minimum. Adjusted by A+ / A− buttons. */
    --label-scale: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: calc(100vh - var(--legal-bar-height));
}

/* Sidebar */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: min(560px, calc(100vw - 16px));
    max-height: calc(100vh - var(--legal-bar-height));
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

/* Collapsible Sidebar */
.sidebar-collapse {
    width: 100%;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-height: 64px;
    padding: 0.75rem 0.8rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--bg-panel), var(--bg-card));
    border-bottom: 1px solid var(--border);
    list-style: none;
    user-select: none;
}

.sidebar-header::-webkit-details-marker {
    display: none;
}

.sidebar-header h1 {
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    flex: 0 0 auto;
}

.map-search {
    flex: 1 1 190px;
    min-width: 0;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: default;
}

.location-control-box {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.24);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    cursor: default;
}

.header-tool-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    background: rgba(22, 27, 34, 0.92);
    color: var(--text-main);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.header-tool-btn-wide {
    width: 42px;
}

.header-tool-btn:hover,
.header-tool-btn:focus {
    background: rgba(48, 54, 61, 0.95);
    border-color: rgba(229, 57, 53, 0.9);
    outline: none;
}

.header-tool-btn.is-active {
    background: rgba(229, 57, 53, 0.88);
    border-color: rgba(255, 255, 255, 0.34);
    color: #fff;
}

.map-search input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
    outline: none;
}

.map-search input:focus {
    border-color: rgba(229, 57, 53, 0.9);
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.18);
}

.map-search input::placeholder {
    color: rgba(230, 237, 243, 0.45);
}

.map-search button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    background: rgba(229, 57, 53, 0.22);
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}

.map-search button:hover,
.map-search button:focus {
    background: rgba(229, 57, 53, 0.36);
    border-color: rgba(229, 57, 53, 0.9);
}

.search-popup-native {
    margin: 2px 0 4px;
    color: #8b949e;
    font-size: 0.9em;
}

.search-popup-area {
    margin-top: 4px;
    color: #8b949e;
    font-size: 0.85em;
}

.sidebar-toggle-icon {
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.sidebar-collapse[open] .sidebar-toggle-icon {
    transform: rotate(-90deg);
}

.sidebar-content {
    padding: 1rem;
    max-height: calc(100vh - var(--legal-bar-height) - 58px);
    overflow-y: auto;
}

.logo {
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.subtext {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Status Card */
.status-card {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-indicator.active {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-indicator.success {
    background-color: var(--success);
}

.status-indicator.error {
    background-color: var(--accent);
}

.progress-bar-container {
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* Workflow Steps */
.workflow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-card {
    background: var(--bg-dark);
    /* Contrast against panel */
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.step-card.collapsed .step-content {
    display: none;
}

.step-card.collapsed .step-header {
    margin-bottom: 0;
    cursor: pointer;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.step-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--bg-panel);
    background: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 500;
}

.completion-mark {
    margin-left: auto;
    color: var(--success);
    font-weight: bold;
    font-size: 1.2rem;
}

.desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

.action-btn {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--border);
    border-color: var(--text-muted);
}

.action-btn:active {
    transform: translateY(1px);
}

.info-card {
    font-size: 0.75rem;
    word-break: break-all;
    opacity: 0.7;
}

/* Main Map View */
.main-view {
    flex-grow: 1;
    position: relative;
    background-color: #000;
    transition: margin-right 0.3s ease-in-out;
}

.main-view.filters-open {
    margin-right: 300px;
}

/* ... existing map styles moved to compare mode section ... */

.map-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    left: auto;
    z-index: 999;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.site-help-button {
    position: fixed;
    top: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1800;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 216, 77, 0.55);
    border-radius: 50%;
    background: rgba(16, 20, 26, 0.92);
    color: #ffd84d;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.site-help-button:hover,
.site-help-button:focus-visible {
    background: rgba(255, 216, 77, 0.16);
    border-color: rgba(255, 216, 77, 0.9);
    outline: none;
}

.aerial-nav {
    position: absolute;
    inset: 0;
    z-index: 1002;
    display: none;
    pointer-events: none;
}

.aerial-nav.visible {
    display: block;
}

.aerial-nav-btn {
    position: absolute;
    width: 72px;
    height: 72px;
    background: rgba(229, 57, 53, 0.95);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.45);
    transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.aerial-nav-btn:hover {
    background: var(--accent-hover);
    border-color: #fff;
}

.aerial-nav-btn:active {
    filter: brightness(0.9);
}

.aerial-nav-up {
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
}

.aerial-nav-right {
    top: 50%;
    right: 1.25rem;
    transform: translateY(-50%);
}

.aerial-nav-down {
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
}

.aerial-nav-left {
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
}

.primary-btn {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: var(--border);
    border-color: var(--accent);
}

.separator-vertical {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* Old overlay-btn ref kept if needed or replaced */
.overlay-btn {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Leaflet Overrides */
.leaflet-container img.leaflet-tile {
    image-rendering: pixelated;
    /* Chrome / Edge */
    image-rendering: -moz-crisp-edges;
    /* Firefox */
    image-rendering: crisp-edges;
    /* Standard */
}

/* Hide Leaflet zoom controls */
.leaflet-control-zoom {
    display: none !important;
}

/* Permanent Map Label */
.map-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-weight: bold;
    font-size: calc(2em * var(--label-scale, 0.5));
    text-shadow: 1px 1px 2px black, -1px -1px 2px black, 1px -1px 2px black, -1px 1px 2px black;
    pointer-events: none;
}

.map-label:before {
    border: none !important;
}

/* Custom Leaflet Div Icon */
.custom-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Right Sidebar */
.right-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: calc(100vh - var(--legal-bar-height));
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-in-out;
}

.right-sidebar.filters-hidden {
    transform: translateX(100%);
}

.filter-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.filter-pane-header h2 {
    margin: 0;
}

.filter-close-btn {
    flex: 0 0 auto;
    min-width: 64px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: rgba(22, 27, 34, 0.94);
    color: var(--text-main);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.filter-close-btn:hover,
.filter-close-btn:focus-visible {
    background: rgba(48, 54, 61, 0.95);
    border-color: rgba(229, 57, 53, 0.9);
    outline: none;
}

.legal-disclaimer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--legal-bar-height);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    background: rgba(12, 14, 18, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(230, 237, 243, 0.82);
    font-size: 0.76rem;
    line-height: 1.25;
    text-align: center;
}

@media (max-width: 900px) {
    :root {
        --legal-bar-height: 60px;
    }

    .legal-disclaimer {
        font-size: 0.72rem;
    }
}

@media (max-width: 520px) {
    :root {
        --legal-bar-height: 82px;
    }
}

@media (max-width: 680px) {
    .sidebar {
        width: 100vw;
        max-height: calc(100vh - var(--legal-bar-height));
        border-right: 0;
    }

    .sidebar-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand toggle"
            "search search"
            "tools tools";
        align-items: center;
        gap: 0.55rem;
        min-height: 128px;
        padding: 0.65rem 0.75rem;
    }

    .sidebar-header h1 {
        grid-area: brand;
        min-width: 0;
        font-size: 1rem;
    }

    .map-search {
        grid-area: search;
        width: 100%;
        flex: none;
    }

    .map-search input {
        height: 38px;
        font-size: 0.84rem;
    }

    .map-search button {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .location-control-box {
        grid-area: tools;
        justify-self: start;
        max-width: calc(100vw - 5.2rem);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .location-control-box::-webkit-scrollbar {
        display: none;
    }

    .sidebar-toggle-icon {
        grid-area: toggle;
        justify-self: end;
    }

    .sidebar-content {
        max-height: calc(100vh - var(--legal-bar-height) - 128px);
    }

    .site-help-button {
        top: auto;
        right: 0.75rem;
        bottom: calc(var(--legal-bar-height) + 0.75rem);
        left: auto;
        transform: none;
        width: 38px;
        height: 38px;
        z-index: 1800;
    }

    .map-overlay {
        top: 8.75rem;
        right: 0.65rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .main-view.filters-open .map-overlay {
        display: none;
    }

    .map-overlay .primary-btn {
        width: 42px;
        height: 40px;
        padding: 0;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .map-overlay .primary-btn::before {
        content: "Filters";
        font-size: 0.62rem;
        line-height: 1;
    }

    .map-overlay .primary-btn[aria-pressed="true"]::before {
        content: "Close";
    }

    .separator-vertical {
        display: none;
    }

    .measure-btn,
    .mouse-radius-btn {
        width: 42px;
        height: 40px;
        padding: 0;
    }

    .main-view.filters-open {
        margin-right: 0;
    }

    .right-sidebar {
        width: min(320px, calc(100vw - 16px));
        padding: 1rem;
    }
}

.right-sidebar h2 {
    font-size: 1.25rem;
    margin: 0 0 1.5rem;
    color: var(--text-main);
}

.right-sidebar .filter-pane-header h2 {
    margin: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    cursor: pointer;
}

.filter-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.filter-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    user-select: none;
}

/* Collapsible Steps */
.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.step-header:hover {
    opacity: 0.9;
}

/* Arrow indicator */
.step-header::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.step-card.collapsed .step-header::after {
    transform: rotate(-90deg);
}

.step-card.collapsed .step-content {
    display: none;
}

.step-card.collapsed .step-header {
    margin-bottom: 0;
}

/* Tree-Style Filter Hierarchy */
.filter-parent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.25rem;
}

.filter-parent:hover {
    background: rgba(255, 255, 255, 0.12);
}

.filter-parent .chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    width: 12px;
    text-align: center;
}

.filter-parent.collapsed .chevron {
    transform: rotate(-90deg);
}

.filter-parent label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--filter-title);
}

.filter-parent label span,
.filter-section-header h3 {
    color: var(--filter-title) !important;
}

.filter-parent .count-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
}

.filter-child .filter-child-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.12rem 0.45rem;
    border-radius: 10px;
    margin-left: auto;
}

.filter-children {
    display: block;
    margin-left: 0.25rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
    margin-bottom: 0.5rem;
    /* Remove fixed max-height - let content determine size */
    max-height: none;
    overflow-y: visible;
}

.filter-children.collapsed {
    display: none !important;
}

.filter-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-child:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-child label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--filter-item) !important;
}

/* Marker Popup Styles */
.marker-popup {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    min-width: 200px;
}

.marker-popup .popup-title {
    display: block;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.marker-popup .popup-section {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0.3rem 0;
}

.marker-popup .popup-label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.marker-popup .popup-coords {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.marker-popup .popup-loot-section {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.marker-popup .popup-loot-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffa500;
    margin-bottom: 0.5rem;
}

.marker-popup .popup-loot-list {
    max-height: 250px;
    overflow-y: auto;
}

.marker-popup .loot-category-group {
    margin-bottom: 0.5rem;
}

.marker-popup .loot-category-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4ecdc4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

.marker-popup .loot-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.marker-popup .loot-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    transition: background 0.15s;
}

.marker-popup .loot-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.marker-popup .loot-more {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    font-style: italic;
}

/* Leaflet Popup Override */
.leaflet-popup-content-wrapper {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content {
    margin: 0.75rem 1rem;
    color: #e6edf3;
}

.leaflet-popup-tip {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(48, 54, 61, 0.8);
}

.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.5) !important;
}

.leaflet-popup-close-button:hover {
    color: #fff !important;
}

/* Loot Search */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.loot-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px 34px;
    gap: 0.4rem;
    align-items: center;
}

#loot-search-input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: inherit;
}

#loot-search-input:focus {
    border-color: var(--accent);
    outline: none;
}

#loot-search-button,
#loot-search-clear {
    height: 38px;
    min-width: 0;
    border-radius: 4px;
    border: 1px solid rgba(255, 216, 77, 0.45);
    background: rgba(255, 216, 77, 0.12);
    color: var(--filter-item);
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#loot-search-button:hover,
#loot-search-clear:hover {
    background: rgba(255, 216, 77, 0.22);
    border-color: rgba(255, 216, 77, 0.75);
}

#loot-search-clear {
    font-size: 1.1rem;
    line-height: 1;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: var(--text-main);
}

.item-tier-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.loot-search-summary {
    margin-top: 0.45rem;
    min-height: 1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.loot-search-summary strong {
    color: var(--filter-item);
    font-weight: 700;
}

/* ======================================
   MAP COMPARE MODE STYLES
   ====================================== */

/* Container for both maps */
.map-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Primary map - always visible */
#map {
    flex: 1;
    width: 100%;
    height: 100%;
    transition: width 0.3s ease;
}

/* Secondary map - hidden by default */
.map-secondary {
    display: none;
    flex: 1;
    height: 100%;
    position: relative;
    border-left: 2px solid var(--accent);
}

/* When compare mode is active */
.main-view.compare-mode .map-container {
    display: flex;
}

.main-view.compare-mode #map {
    width: 50%;
    flex: none;
}

.main-view.compare-mode .map-secondary {
    display: block;
    width: 50%;
}

/* Map2 Controls Overlay */
#map2-controls {
    position: absolute;
    top: 5rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-panel);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#map2-controls label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

#map2-controls select {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 150px;
}

#map2-controls select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Compare Mode Button States */
#btn-compare-mode.active {
    background: #ff4444 !important;
}

/* Visual indicator showing which map is which */
.main-view.compare-mode #map::before,
.main-view.compare-mode .map-secondary::before {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 999;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

.main-view.compare-mode #map::before {
    content: 'Primary';
    background: var(--accent);
    color: white;
}

.main-view.compare-mode .map-secondary::before {
    content: 'Compare';
    background: #17a2b8;
    color: white;
}

/* Pixel Compare Button */
.pixel-compare-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.pixel-compare-btn:hover {
    background: #ff8c5a;
    transform: scale(1.02);
}

.pixel-compare-btn.active {
    background: #ff4444;
    animation: pulse-glow 1.5s infinite;
}

.pixel-compare-btn.processing {
    background: #888;
    cursor: wait;
}

/* Diff Only Button */
.diff-only-btn {
    background: #5b4fcf;
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.diff-only-btn:hover {
    background: #7b6fe8;
    transform: scale(1.02);
}

.diff-only-btn.active {
    background: linear-gradient(135deg, #ff6b35, #e040fb);
    box-shadow: 0 0 14px rgba(224, 64, 251, 0.55);
    animation: diff-pulse 1.8s ease-in-out infinite;
}

@keyframes diff-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(224, 64, 251, 0.4); }
    50%       { box-shadow: 0 0 20px rgba(224, 64, 251, 0.8); }
}

/* Diff Stats Bar */
.diff-stats-bar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.92);
    border: 1px solid rgba(224, 64, 251, 0.5);
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(224, 64, 251, 0.1);
    font-size: 0.82rem;
    white-space: nowrap;
}

.diff-stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.diff-stat-item strong {
    font-size: 1rem;
    font-weight: 700;
}

.diff-stat-item.map1-only strong { color: #ff6b6b; }
.diff-stat-item.map2-only strong { color: #4fc3f7; }
.diff-stat-item.common strong { color: #81c784; }

.diff-stat-sep {
    color: rgba(255,255,255,0.25);
    font-size: 1rem;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
    }
}

/* Pixel Diff Canvas Container */
#pixel-diff-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    display: none;
}

#pixel-diff-canvas-container.active {
    display: block;
}

#pixel-diff-canvas-container canvas {
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

/* Diff Stats Overlay */
.diff-stats-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 1001;
    border: 1px solid var(--accent);
}

.diff-stats-overlay .stat-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.diff-stats-overlay .stat-value {
    font-weight: 600;
    color: #ff6b6b;
}

/* ======================================
   LIVE MODE FILTERS
   ====================================== */

.live-filters-overlay {
    display: none;
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--accent);
    z-index: 1000;
    gap: 1rem;
    align-items: center;
}

.live-filters-overlay.active {
    display: flex;
}

.live-filter-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.live-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.live-filter-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.live-filter-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.live-filter-toggle .toggle-text {
    font-size: 0.85rem;
    color: var(--text-main);
}

.live-filter-toggle input[type="checkbox"]:not(:checked)+.toggle-text {
    opacity: 0.5;
    text-decoration: line-through;
}

/* ======================================
   IN-GAME DATE/TIME OVERLAY
   ====================================== */

.game-datetime-overlay {
    display: none;
    position: absolute;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(30, 40, 50, 0.9));
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    border: 2px solid #3498db;
    z-index: 1000;
    gap: 0.5rem;
    align-items: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    font-family: 'Outfit', monospace;
}

.game-datetime-overlay.active {
    display: flex;
}

.game-datetime-overlay .datetime-icon {
    font-size: 1.1rem;
}

.game-datetime-overlay #game-datetime-text {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
}

/* ======================================
   MOUSE RADIUS TOOL (OFFLINE)
   ====================================== */

.mouse-radius-btn {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mouse-radius-btn:hover {
    background: var(--border);
    border-color: #00e5ff;
}

.mouse-radius-btn.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: #00e5ff;
    color: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.radius-distance-label {
    background: transparent !important;
    border: 0 !important;
    color: #ffd740;
    pointer-events: none;
    text-align: center;
}

.radius-distance-label span {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid rgba(255, 215, 64, 0.72);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffd740;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

/* ======================================
   TEMPERATURE SURVEY STYLES
   ====================================== */

.temp-survey-btn {
    background: #16a085 !important;
}

.temp-survey-btn:hover {
    background: #1abc9c !important;
}

.temp-survey-btn.active {
    background: #1abc9c !important;
    box-shadow: 0 0 12px rgba(26, 188, 156, 0.6);
    border-color: #1abc9c;
}

.temp-survey-controls {
    display: none;
    position: absolute;
    top: 7rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(22, 160, 133, 0.15));
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 2px solid #16a085;
    z-index: 999;
    gap: 0.5rem;
    align-items: center;
    box-shadow: 0 4px 15px rgba(22, 160, 133, 0.4);
}

.temp-survey-controls.active {
    display: flex;
}

.temp-survey-label {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.temp-survey-select {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.temp-survey-select:focus {
    outline: none;
    border-color: #16a085;
}

.temp-survey-load-btn {
    background: #16a085;
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.temp-survey-load-btn:hover {
    background: #1abc9c;
}

/* Min/Max Temperature Buttons */
.temp-min-btn,
.temp-max-btn {
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.temp-min-btn {
    background: #2980b9;
    color: white;
}

.temp-min-btn:hover {
    background: #3498db;
}

.temp-min-btn.active {
    background: #1abc9c;
    box-shadow: 0 0 10px rgba(41, 128, 185, 0.8);
}

.temp-max-btn {
    background: #c0392b;
    color: white;
}

.temp-max-btn:hover {
    background: #e74c3c;
}

.temp-max-btn.active {
    background: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.8);
}

/* Grid/Heatmap Mode Toggle */
.temp-mode-btn {
    background: #8e44ad;
    color: white;
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.temp-mode-btn:hover {
    background: #9b59b6;
}

.temp-mode-btn.heatmap-mode {
    background: #e67e22;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.6);
}

/* Temperature Survey Grid Labels */
.temp-survey-label-icon {
    background: transparent !important;
    border: none !important;
}

.temp-grid-label {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ======================================
   MEASURE TOOL STYLES
   ====================================== */

.measure-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #2d3748;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.measure-btn:hover {
    background: #3d4758;
    border-color: var(--accent);
}

.measure-btn.active {
    background: #e67e22;
    border-color: #f39c12;
    color: white;
}

.measure-btn svg {
    width: 18px;
    height: 18px;
}

/* Crosshair cursor when measuring */
.measuring-mode {
    cursor: crosshair !important;
}

.measuring-mode .leaflet-container {
    cursor: crosshair !important;
}

/* Measure distance label */
.measure-label {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 24px;
    font-weight: 600;
    white-space: nowrap;
    border: 2px solid var(--accent);
}

/* Measure point markers */
.measure-point {
    width: 12px;
    height: 12px;
    background: #e67e22;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Instruction tooltip when measuring */
.measure-instruction {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #f39c12;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid #e67e22;
}

/* ======================================
   PLAYER RADIUS CIRCLE TOOL
   ====================================== */

.radius-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #2d3748;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.radius-btn:hover {
    background: #3d4758;
    border-color: #3498db;
}

.radius-btn.active {
    background: #3498db;
    border-color: #2980b9;
    color: white;
}

.radius-btn svg {
    width: 18px;
    height: 18px;
}

/* Radius controls in live filters */
.radius-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radius-adjust-btn {
    width: 24px;
    height: 24px;
    background: #3d4758;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.radius-adjust-btn:hover {
    background: #4d5768;
    border-color: var(--accent);
}

.radius-adjust-btn:active {
    background: var(--accent);
}

.radius-value {
    min-width: 50px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3498db;
}

/* ======================================
   COLLAPSIBLE PROCESS GROUP
   ====================================== */

.process-group {
    margin: 0.75rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.process-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--bg-panel), var(--bg-card));
    font-weight: 500;
    color: var(--text-main);
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    list-style: none;
    /* Remove default marker */
}

.process-group-header::-webkit-details-marker {
    display: none;
    /* Hide default arrow in webkit */
}

.process-group-header::before {
    content: '▶';
    font-size: 0.7rem;
    color: var(--accent);
    transition: transform 0.2s;
}

.process-group[open] .process-group-header::before {
    transform: rotate(90deg);
}

.process-group-header:hover {
    background: var(--bg-panel);
}

.process-group-icon {
    font-size: 1rem;
}

.process-group-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: var(--bg-dark);
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.process-group[open] .process-group-header {
    border-bottom: 1px solid var(--border);
}

.process-group-content {
    padding: 0.5rem;
    background: var(--bg-dark);
}

.process-group-content .step-card {
    margin: 0.5rem 0;
}

/* ======================================
   BUILDING FOOTPRINTS STYLES
   ====================================== */

/* Footprints Toggle Button Active State */
#btn-toggle-footprints.active {
    background: #cd853f !important;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.6);
    border-color: #deb887;
}

#btn-toggle-footprints:hover {
    background: #a0522d !important;
}

/* Building footprint polygon styling */
.building-footprint {
    transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.building-footprint:hover {
    stroke-width: 3px !important;
    filter: brightness(1.3);
}

/* Container-specific footprint with checkerboard/stripe pattern */
.container-footprint {
    /* Create a striped pattern effect via filter */
    filter: drop-shadow(0 0 4px rgba(255, 69, 0, 0.8));
}

.container-footprint:hover {
    filter: drop-shadow(0 0 8px rgba(255, 69, 0, 1)) brightness(1.4);
}

/* ======================================
   ITEM MONITOR PANEL STYLES
   ====================================== */

/* Monitor Toggle Button */
.monitor-toggle-btn {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.monitor-toggle-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.monitor-toggle-btn.active {
    background: var(--accent);
    border-color: var(--accent-hover);
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.5);
}

/* Item Monitor Panel */
.item-monitor-panel {
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    width: 350px;
    max-height: 60vh;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.item-monitor-panel.active {
    display: flex;
    flex-direction: column;
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-panel));
    border-bottom: 1px solid var(--border);
}

.monitor-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.monitor-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.monitor-close-btn:hover {
    background: rgba(229, 57, 53, 0.3);
    color: var(--accent);
}

.monitor-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: calc(60vh - 50px);
}

.monitor-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Individual Item Card in Monitor */
.monitor-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.monitor-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.2);
}

.monitor-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.monitor-item-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

.monitor-item-icon {
    font-size: 1.2rem;
}

.monitor-item-health {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.monitor-health-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.monitor-health-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.monitor-health-text {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

.monitor-item-details {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.monitor-detail {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Tree Status Display - Floating Overlay */
.tree-status-overlay {
    position: absolute;
    top: 3.5rem;
    left: 1rem;
    background: linear-gradient(135deg, rgba(0, 50, 0, 0.9), rgba(0, 80, 0, 0.85));
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #00ff00;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-width: 400px;
}

.tree-status-icon {
    font-size: 1rem;
}

#tree-status-text {
    line-height: 1.4;
    color: rgba(0, 255, 0, 0.9);
}

/* ======================================
   GEAR PANEL STYLES
   ====================================== */

.gear-panel {
    display: none;
    position: absolute;
    top: 60px;
    left: 20px;
    width: 1125px;
    max-height: 80vh;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.gear-panel.active {
    display: flex;
    flex-direction: column;
}

.gear-panel.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    border-radius: 0;
    z-index: 2000;
}

.gear-panel.maximized .gear-content {
    max-height: calc(100vh - 50px);
}

.gear-header-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gear-header-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gear-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.gear-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-panel));
    border-bottom: 1px solid var(--border);
}

.gear-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.gear-datetime {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 12px;
}

.gear-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gear-close-btn:hover {
    background: rgba(229, 57, 53, 0.3);
    color: var(--accent);
}

.gear-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: calc(80vh - 50px);
}

.gear-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Player section in gear panel */
.gear-player {
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.gear-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.15), rgba(22, 27, 34, 0.8));
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.gear-player-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

.gear-player-pos {
    font-size: 0.75rem;
    color: #60a5fa;
    font-family: monospace;
}

.gear-player-header:hover {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.25), rgba(22, 27, 34, 0.8));
}

.gear-player-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #4ade80;
}

.gear-player-heat {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* Player stats bar */
.gear-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
}

.gear-stat {
    white-space: nowrap;
}

/* Gear item table */
.gear-table-wrap {
    overflow-x: auto;
}

.gear-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    min-width: 1100px;
}

.gear-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    padding: 4px 5px;
    text-align: left;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

/* Filter row */
.gear-filter-row th {
    padding: 2px 3px;
    text-transform: none;
    background: rgba(0, 0, 0, 0.4);
}

.gear-col-filter {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: var(--text-main);
    font-size: 0.65rem;
    padding: 2px 4px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gear-col-filter::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.6rem;
}

.gear-col-filter:focus {
    border-color: rgba(229, 57, 53, 0.5);
    box-shadow: 0 0 4px rgba(229, 57, 53, 0.3);
}

.gear-table td {
    padding: 3px 5px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(48, 54, 61, 0.4);
    white-space: nowrap;
}

.gear-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.gear-table .health-pristine {
    color: #4ade80;
}

.gear-table .health-worn {
    color: #fbbf24;
}

.gear-table .health-damaged {
    color: #fb923c;
}

.gear-table .health-badly-damaged {
    color: #ef4444;
}

.gear-table .health-ruined {
    color: #ff0000;
    font-weight: 700;
}

.gear-table .qty-nonzero {
    color: #60a5fa;
    font-weight: 600;
}

.gear-table .liquid-water {
    color: #38bdf8;
}

.gear-item-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.gear-table-wrap.collapsed {
    display: none;
}

/* Gear player map marker pulse */
@keyframes gearPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.gear-marker-icon {
    background: #4ade80;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 14px !important;
    height: 14px !important;
    animation: gearPulse 2s infinite;
}

/* ======================================
   FOOD SYSTEM STYLES
   ====================================== */

/* Gear Mode Toggle */
.gear-mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    padding: 2px;
}
.gear-mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
}
.gear-mode-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}
.gear-mode-btn.active {
    background: var(--accent);
    color: var(--text-main);
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.4);
}

/* Food System Canvas */
.food-system-container {
    padding: 20px;
    background: rgba(10, 15, 20, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fs-bucket-wrapper {
    width: 30%;
    min-width: 150px;
    margin: 15px auto 0 auto;
    position: relative;
    z-index: 2;
}

.fs-bucket {
    width: 100%;
    height: 250px;
    background: #050505;
    border: 4px solid #8b4513;
    border-top: 1px dashed rgba(139, 69, 19, 0.5);
    border-radius: 4px 4px 15px 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
}

.fs-bucket-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 0.5s ease-out, background-color 0.5s ease;
}

.fs-bucket-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 3px #000, -1px -1px 3px #000;
    z-index: 2;
    letter-spacing: 1px;
}

.fs-pipes-layer {
    position: relative;
    width: 360px;
    height: 50px;
    margin: -30px auto 0 auto;
    z-index: 1;
}

.fs-pipe-branch {
    position: absolute;
    top: 0;
    width: 180px;
    height: 50px;
}
.fs-pipe-branch.left { left: 0; }
.fs-pipe-branch.right { right: 0; }

.fs-pipe-h, .fs-pipe-v {
    position: absolute;
    background: #666;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    transition: background-color 0.3s;
}

.fs-pipe-h {
    top: 0;
    width: 100%;
    height: 14px;
}
.fs-pipe-branch.left .fs-pipe-h { left: 0; border-radius: 12px 0 0 0; }
.fs-pipe-branch.right .fs-pipe-h { right: 0; border-radius: 0 12px 0 0; }

.fs-pipe-v {
    top: 0;
    width: 14px;
    height: 50px;
}
.fs-pipe-branch.left .fs-pipe-v { left: 0; border-radius: 12px 0 0 0; }
.fs-pipe-branch.right .fs-pipe-v { right: 0; border-radius: 0 12px 0 0; }

.fs-anim-liquid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,0.2),
        rgba(255,255,255,0.2) 10px,
        transparent 10px,
        transparent 20px
    );
    background-size: 28px 28px;
    animation: flow 0.5s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}
@keyframes flow {
    0% { background-position: 0 0; }
    100% { background-position: 28px 28px; }
}

.fs-pipe-branch.pouring-water .fs-pipe-h,
.fs-pipe-branch.pouring-water .fs-pipe-v { background-color: #0284c7; }
.fs-pipe-branch.pouring-water .fs-anim-liquid { opacity: 1; }

.fs-pipe-branch.pouring-food .fs-pipe-h,
.fs-pipe-branch.pouring-food .fs-pipe-v { background-color: #16a34a; }
.fs-pipe-branch.pouring-food .fs-anim-liquid { opacity: 1; }

.fs-cholera-bar-wrapper {
    position: relative;
    width: 14px;
    height: 60px;
    background: rgba(0,0,0,0.6);
    border: 1px solid #555;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.fs-cholera-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 0.5s ease-out, background-color 0.5s ease;
}

.fs-cholera-marker {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 2;
}
.marker-cure { bottom: 5%; background: #4ade80; } /* 50 / 1000 */
.marker-sick { bottom: 25%; background: #ef4444; } /* 250 / 1000 */

.fs-side-stat {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    color: #cbd5e1;
    white-space: nowrap;
    background: rgba(10, 15, 20, 0.9);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
    z-index: 5;
}

.fs-immunity-stat { right: 100%; margin-right: 30px; }
.fs-cholera-stat { left: 100%; margin-left: 30px; }

.fs-bucket-max {
    position: absolute;
    top: -20px;
    right: -5px;
    color: #aaa;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.fs-stats-row {
    position: relative;
    width: 360px;
    height: 90px;
    margin: 0 auto;
}

.fs-stat-box {
    position: absolute;
    background: linear-gradient(135deg, rgba(20,25,30,0.9), rgba(10,15,20,0.9));
    border: 2px solid;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    width: 225px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.box-water {
    left: 7px;
    transform: translateX(-50%);
    border-color: #38bdf8;
    color: #38bdf8;
}

.box-food {
    right: 7px;
    transform: translateX(50%);
    border-color: #4ade80;
    color: #4ade80;
}

/* Server FPS Overlay */
.server-fps-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.fps-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 30px 60px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.1);
}

.fps-label {
    font-size: 2rem;
    font-weight: 800;
    color: #a0aec0;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 10px;
}

.fps-value {
    font-size: 10rem;
    font-weight: 900;
    color: #4ade80;
    line-height: 1;
    text-shadow: 0 4px 15px rgba(0,0,0,0.9), 0 0 40px rgba(74, 222, 128, 0.4);
}

/* ======================================
   HELP MODAL STYLES
   ====================================== */

.help-btn {
    background: #2d5a3d !important;
    border-color: #3d7a5d !important;
    font-weight: 500;
}

.help-btn:hover {
    background: #3d7a5d !important;
    border-color: #5a9a7d !important;
}

.help-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: helpFadeIn 0.2s ease;
}

@keyframes helpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.help-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90vw;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255,255,255,0.1);
    animation: helpSlideIn 0.25s ease;
}

@keyframes helpSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.help-modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.help-modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.help-modal-close:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.help-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.site-about-modal {
    width: min(560px, calc(100vw - 32px));
    max-width: 560px;
}

.site-about-body {
    color: var(--text-main);
    font-size: 0.94rem;
    line-height: 1.5;
}

.site-about-section {
    padding: 0.95rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-about-section:first-child {
    padding-top: 0;
}

.site-about-section h3 {
    margin: 0 0 0.45rem;
    color: #ffd84d;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-about-section p,
.site-about-note {
    margin: 0;
    color: rgba(230, 237, 243, 0.88);
}

.site-about-link {
    display: inline;
    color: #4ade80;
    font-weight: 700;
    text-decoration: none;
}

.site-about-link:hover,
.site-about-link:focus-visible {
    color: #86efac;
    text-decoration: underline;
    outline: none;
}

.site-about-note {
    margin-top: 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(255, 216, 77, 0.18);
    border-radius: 6px;
    background: rgba(255, 216, 77, 0.08);
    font-weight: 600;
}

/* Base dir info */
.help-base-dir {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
}

.help-base-dir .label {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 0.5rem;
}

.help-base-dir .path {
    color: #7ee787;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}

/* Feature cards */
.help-feature-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s;
}

.help-feature-card:hover {
    border-color: rgba(255,255,255,0.15);
}

.help-feature-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
}

.help-feature-header:hover {
    background: rgba(255,255,255,0.03);
}

.help-feature-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    flex: 1;
}

.help-feature-badges {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.help-avail-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.help-avail-badge.available {
    background: rgba(46, 160, 67, 0.25);
    color: #7ee787;
    border: 1px solid rgba(46, 160, 67, 0.4);
}

.help-avail-badge.missing {
    background: rgba(229, 57, 53, 0.15);
    color: #f85149;
    border: 1px solid rgba(229, 57, 53, 0.3);
}

.help-feature-details {
    padding: 0 1rem 0.75rem 1rem;
    display: none;
}

.help-feature-card.expanded .help-feature-details {
    display: block;
}

.help-feature-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.help-feature-path {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: #79c0ff;
    word-break: break-all;
    margin-bottom: 0.4rem;
}

.help-feature-files {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.help-feature-files strong {
    color: var(--text-main);
    font-weight: 500;
}

.help-feature-note {
    font-size: 0.75rem;
    color: #db6d28;
    font-style: italic;
    margin-top: 0.3rem;
}

.help-chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.help-feature-card.expanded .help-chevron {
    transform: rotate(90deg);
}

/* Section headers */
.help-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin: 1.25rem 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(229, 57, 53, 0.2);
}

/* Telemetry status */
.help-telemetry-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.help-telemetry-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.help-telemetry-dot.online {
    background: #2ea043;
    box-shadow: 0 0 6px rgba(46, 160, 67, 0.5);
}

.help-telemetry-dot.offline {
    background: #f85149;
}

/* ======================================================
   IMPORT FOOTPRINTS BUTTON & MODAL
   ====================================================== */

.import-fp-btn {
    background: linear-gradient(135deg, #1a3a5c, #0e2a45) !important;
    border-color: #2a5a8c !important;
    color: #7ab8f5 !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.import-fp-btn:hover {
    background: linear-gradient(135deg, #2a5a8c, #1a4a7c) !important;
    color: #a8d4ff !important;
    box-shadow: 0 0 10px rgba(100, 160, 255, 0.35);
}

/* Backdrop */
.import-fp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: helpFadeIn 0.2s ease;
}

/* Panel */
.import-fp-panel {
    background: linear-gradient(160deg, rgba(15, 25, 40, 0.97), rgba(10, 18, 30, 0.99));
    border: 1px solid rgba(100, 160, 255, 0.2);
    border-radius: 16px;
    width: min(720px, 95vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(100,160,255,0.06);
    animation: helpSlideUp 0.25s ease;
    overflow: hidden;
}

/* Header */
.import-fp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(100, 160, 255, 0.12);
    flex-shrink: 0;
}
.import-fp-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 6px rgba(100,180,255,0.5));
}
.import-fp-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #a8d4ff;
}
.import-fp-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.import-fp-close:hover { background: rgba(255,80,80,0.2); color: #ff6b6b; border-color: rgba(255,80,80,0.4); }

/* Body */
.import-fp-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    min-height: 0;
}

.import-fp-meta {
    font-size: 0.9rem;
    color: rgba(170, 200, 255, 0.75);
    line-height: 1.5;
    min-height: 1.5em;
}

/* Progress bar */
.import-fp-progress-bar-wrap {
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.import-fp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2a7af5, #5ab4ff);
    border-radius: 4px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(90, 180, 255, 0.5);
}
.import-fp-progress-bar.done {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}
.import-fp-progress-bar.error {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Log area */
.import-fp-log {
    flex: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    color: rgba(160, 200, 255, 0.8);
    line-height: 1.6;
    min-height: 120px;
    max-height: 260px;
    scroll-behavior: smooth;
}
.import-fp-log::-webkit-scrollbar { width: 4px; }
.import-fp-log::-webkit-scrollbar-thumb { background: rgba(100,160,255,0.3); border-radius: 2px; }
.import-log-line { padding: 1px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.import-log-line.log-ok  { color: #86efac; }
.import-log-line.log-fail { color: #fca5a5; }
.import-log-line.log-info { color: #7dd3fc; }
.import-log-line.log-done { color: #4ade80; font-weight: 600; }

/* Stats card (shown after completion) */
.import-fp-stats {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.import-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.import-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ade80;
    line-height: 1;
}
.import-stat-value.stat-blue  { color: #60a5fa; }
.import-stat-value.stat-amber { color: #fbbf24; }
.import-stat-value.stat-red   { color: #f87171; }
.import-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Footer */
.import-fp-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.import-fp-run-btn {
    background: linear-gradient(135deg, #1d6fec, #1a5acf);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 22px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.import-fp-run-btn:hover { background: linear-gradient(135deg, #2a80ff, #1d6fec); box-shadow: 0 4px 14px rgba(29,111,236,0.45); }
.import-fp-run-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.import-fp-run-btn.done-btn { background: linear-gradient(135deg, #16a34a, #22c55e); }
.import-fp-hint {
    font-size: 0.78rem;
    color: rgba(150, 180, 220, 0.55);
    line-height: 1.4;
}
.import-fp-hint code {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.75rem;
    color: #93c5fd;
}
/* ───────────────────────────────────────────────────────────────
   Map list (sidebar) — clickable items replacing the dropdown
   ─────────────────────────────────────────────────────────────── */
.map-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.map-list-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.map-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--text-muted);
}
.map-list-item.active {
    background: rgba(229, 57, 53, 0.18);
    border-color: var(--accent);
}
.map-list-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.map-list-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Icon-style overlay buttons (single emoji / short label) */
.map-overlay .icon-btn {
    width: 38px;
    padding: 0.35rem 0;
    text-align: center;
    font-size: 0.95rem;
}
