: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;
    --release-announcement-height: 0px;
    /* 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 {
    position: relative;
    display: flex;
    height: calc(100vh - var(--legal-bar-height) - var(--release-announcement-height));
}

.release-announcement {
    position: relative;
    z-index: 1900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 46px;
    padding: 6px 52px 6px 16px;
    border-bottom: 1px solid #765338;
    background: linear-gradient(105deg, #33261e, #211e1b 70%);
    color: #e9ddd0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.release-announcement[hidden] { display: none; }
.release-announcement-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid #85613f;
    border-radius: 4px;
    color: #f1c78e;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.release-announcement p { display: flex; flex-wrap: wrap; column-gap: 8px; }
.release-announcement strong { color: #fff0da; font-weight: 600; }
.release-announcement a {
    color: #f1c78e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.release-announcement a:hover { color: #fff0da; }
.release-announcement a:focus-visible { outline: 2px solid #f1c78e; outline-offset: 2px; border-radius: 2px; }
.release-announcement button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #e9ddd0;
    font: inherit;
    font-size: 1.4rem;
    cursor: pointer;
}
.release-announcement button:hover { background: #ffffff12; }
.release-announcement button:focus-visible { outline: 2px solid #f1c78e; outline-offset: -3px; }
@media (max-width: 680px) {
    .release-announcement { justify-content: flex-start; padding: 9px 48px 9px 12px; gap: 9px; font-size: 0.76rem; }
    .release-announcement-badge { display: none; }
    .release-announcement p { display: block; }
    .release-announcement strong, .release-announcement p span { display: block; }
    .release-announcement button { width: 40px; height: 40px; right: 4px; }
}

/* Sidebar */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: min(560px, calc(100vw - 16px));
    max-height: calc(100vh - var(--legal-bar-height) - var(--release-announcement-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;
    position: relative;
    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: 54px;
}

.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;
}

.header-tool-btn.is-open {
    background: rgba(48, 54, 61, 0.98);
    border-color: rgba(229, 57, 53, 0.95);
}

.location-type-menu {
    position: fixed;
    top: var(--location-type-menu-top, 58px);
    left: var(--location-type-menu-left, 8px);
    width: min(230px, calc(100vw - 16px));
    max-height: var(--location-type-menu-max-height, min(420px, calc(100vh - 96px)));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(18, 23, 30, 0.98);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.44);
    z-index: 3000;
}

.location-type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 5px 6px;
    border-radius: 5px;
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.location-type-option:hover {
    background: rgba(255, 255, 255, 0.07);
}

.location-type-option input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.location-type-name {
    flex: 1 1 auto;
}

.location-type-count {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.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) - var(--release-announcement-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;
}

body.terrain-view-active .leaflet-container {
    cursor: default;
}

/* ... 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;
}

body.terrain-view-active .map-overlay {
    display: none;
}

.terrain-view {
    --terrain-storyteller-timeline-space: 0px;
    position: absolute;
    inset: 0;
    z-index: 1450;
    background: #02060a;
    overflow: hidden;
}

.terrain-view[hidden] {
    display: none !important;
}

.terrain-view-stage {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 38% 18%, rgba(56, 189, 248, 0.12), transparent 38%),
        linear-gradient(180deg, #050b11, #020406 62%, #010203);
}

.terrain-view-stage canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.terrain-view-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: min(330px, calc(100vw - 2rem));
    max-height: max(9rem, calc(100vh - var(--legal-bar-height) - var(--release-announcement-height) - 2rem - var(--terrain-storyteller-timeline-space, 0px)));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    background: rgba(9, 13, 18, 0.88);
    color: #f8fafc;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(14px);
}

.terrain-view-panel.is-collapsed {
    overflow: hidden;
}

.terrain-view-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.terrain-view-panel-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
}

.terrain-view-kicker {
    margin: 0 0 0.15rem;
    color: #85e4ff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.terrain-view-panel h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.12rem;
    line-height: 1.1;
}

.terrain-view-panel-collapse,
.terrain-view-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.92);
    color: #cbd5e1;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    line-height: 1;
}

.terrain-view-panel-collapse:hover,
.terrain-view-panel-collapse:focus-visible {
    border-color: rgba(56, 189, 248, 0.72);
    background: rgba(8, 47, 73, 0.86);
    color: #fff;
    outline: none;
}

.terrain-view-close:hover,
.terrain-view-close:focus-visible {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(127, 29, 29, 0.52);
    color: #fff;
    outline: none;
}

.terrain-view-panel.is-collapsed .terrain-view-panel-head {
    margin-bottom: 0;
}

.terrain-view-panel.is-collapsed .terrain-view-controls,
.terrain-view-panel.is-collapsed .terrain-storyteller-panel,
.terrain-view-panel.is-collapsed .terrain-view-status {
    display: none !important;
}

.terrain-view-controls {
    display: grid;
    gap: 0.75rem;
}

.terrain-view-controls label {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 0.65rem;
    color: rgba(226, 232, 240, 0.84);
    font-size: 0.8rem;
    font-weight: 800;
}

.terrain-view-controls input[type="range"] {
    width: 100%;
    accent-color: #38c6f2;
}

.terrain-view-controls select {
    width: 100%;
    min-height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.86);
    color: #eef7ff;
    font: inherit;
    padding: 4px 8px;
}

.terrain-view-action {
    grid-column: 1 / -1;
    min-height: 30px;
    border: 1px solid rgba(56, 198, 242, 0.44);
    border-radius: 6px;
    background: rgba(8, 47, 73, 0.62);
    color: #dff7ff;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 900;
}

.terrain-view-action:hover,
.terrain-view-action:focus-visible {
    border-color: rgba(125, 211, 252, 0.82);
    background: rgba(14, 116, 144, 0.58);
    outline: none;
}

.terrain-view-action:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.terrain-view-toggle {
    grid-template-columns: auto 1fr !important;
    justify-content: start;
}

.terrain-view-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #38c6f2;
}

.terrain-view-status {
    margin: 0.85rem 0 0;
    color: rgba(203, 213, 225, 0.78);
    font-size: 0.76rem;
    line-height: 1.35;
}

.terrain-storyteller-panel {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.terrain-storyteller-panel[hidden] {
    display: none !important;
}

.terrain-storyteller-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.terrain-storyteller-head > div {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.terrain-storyteller-head h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.9rem;
    line-height: 1.1;
}

.terrain-storyteller-head span {
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 999px;
    color: rgba(186, 230, 253, 0.92);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.terrain-storyteller-collapse {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #e0f2fe;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.terrain-storyteller-collapse:hover,
.terrain-storyteller-collapse:focus-visible {
    border-color: rgba(56, 189, 248, 0.72);
    background: rgba(8, 47, 73, 0.86);
    outline: none;
}

.terrain-storyteller-body {
    display: block;
}

.terrain-storyteller-panel.is-collapsed .terrain-storyteller-head {
    margin-bottom: 0;
}

.terrain-storyteller-panel.is-collapsed .terrain-storyteller-body {
    display: none;
}

.terrain-storyteller-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.terrain-storyteller-grid label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.72rem;
    font-weight: 900;
}

.terrain-storyteller-grid label.is-keyframe-inactive {
    opacity: 0.48;
}

.terrain-storyteller-grid label.is-storyteller-inactive {
    opacity: 0.48;
}

.terrain-storyteller-grid select,
.terrain-storyteller-grid input[type="color"],
.terrain-storyteller-grid input[type="file"] {
    min-height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.88);
    color: #eef7ff;
    font: inherit;
    padding: 4px 8px;
}

.terrain-storyteller-grid select:disabled,
.terrain-storyteller-grid input:disabled {
    cursor: not-allowed;
}

.terrain-storyteller-range {
    grid-column: span 2;
}

.terrain-storyteller-range span,
.terrain-storyteller-color span,
.terrain-storyteller-file span,
.terrain-storyteller-data span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.terrain-storyteller-range output,
.terrain-storyteller-file output {
    color: #bae6fd;
    font-size: 0.68rem;
}

.terrain-storyteller-grid input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: #38bdf8;
}

.terrain-storyteller-grid input[type="color"] {
    width: 100%;
    height: 32px;
    padding: 3px;
    cursor: pointer;
}

.terrain-storyteller-grid input[type="file"] {
    width: 100%;
    min-width: 0;
    cursor: pointer;
}

.terrain-storyteller-data {
    grid-column: 1 / -1;
}

.terrain-storyteller-data textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
    font: 700 0.7rem/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    padding: 0.5rem;
}

.terrain-storyteller-grid input[type="file"]::file-selector-button {
    margin-right: 0.45rem;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 5px;
    background: rgba(8, 47, 73, 0.8);
    color: #e0f2fe;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 0.22rem 0.5rem;
    cursor: pointer;
}

.terrain-storyteller-toggle {
    min-height: 32px;
    align-self: end;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 0.5rem !important;
    padding: 0.38rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.56);
    cursor: pointer;
}

.terrain-storyteller-toggle input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #38bdf8;
}

.terrain-storyteller-toggle span {
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.72rem;
    font-weight: 900;
}

.terrain-storyteller-grid .terrain-view-action {
    min-height: 32px;
}

.terrain-storyteller-grid .terrain-view-action[aria-pressed="true"] {
    border-color: rgba(250, 204, 21, 0.8);
    background: rgba(113, 63, 18, 0.72);
    color: #fef9c3;
}

.terrain-storyteller-grid .terrain-view-action:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.terrain-storyteller-go {
    border-color: rgba(34, 197, 94, 0.54);
    background: rgba(20, 83, 45, 0.72);
    color: #dcfce7;
}

.terrain-storyteller-timeline {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 435;
    display: grid;
    grid-template-columns: minmax(132px, 178px) minmax(340px, 1fr) minmax(560px, 680px);
    align-items: stretch;
    gap: 0.8rem;
    min-height: 164px;
    margin: 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.86);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
}

.terrain-storyteller-timeline[hidden] {
    display: none !important;
}

.terrain-storyteller-timeline-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 0;
    margin: 0;
    padding-right: 0.75rem;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.terrain-storyteller-timeline-head h4 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.86rem;
    line-height: 1;
    text-align: center;
}

.terrain-storyteller-timeline-head span {
    color: rgba(186, 230, 253, 0.84);
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;
}

.terrain-storyteller-timeline-track {
    position: relative;
    min-width: 0;
    min-height: 136px;
    padding: 1.35rem 1.05rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.4);
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.terrain-storyteller-timeline-track:focus-visible {
    border-color: rgba(125, 211, 252, 0.82);
    outline: none;
}

.terrain-storyteller-timeline-rail {
    position: absolute;
    left: 3.5%;
    right: 3.5%;
    top: 50%;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.72), rgba(74, 222, 128, 0.72));
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.2);
    transform: translateY(-50%);
}

.terrain-storyteller-timeline-end {
    position: absolute;
    bottom: 0.28rem;
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.6rem;
    font-weight: 900;
}

.terrain-storyteller-timeline-end.start {
    left: 0.75rem;
}

.terrain-storyteller-timeline-end.finish {
    right: 0.75rem;
}

.terrain-storyteller-timeline-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    color: rgba(203, 213, 225, 0.58);
    font-size: 0.7rem;
    font-weight: 900;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.terrain-storyteller-timeline-empty[hidden] {
    display: none;
}

.terrain-storyteller-timeline-marker {
    --timeline-x: 0%;
    position: absolute;
    left: var(--timeline-x);
    z-index: 2;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(226, 232, 240, 0.78);
    background: rgba(15, 23, 42, 0.96);
    color: #e0f2fe;
    cursor: pointer;
    font: inherit;
    font-size: 0.64rem;
    font-weight: 1000;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
}

.terrain-storyteller-timeline-marker.point {
    top: calc(50% - 16px);
    border-radius: 50%;
    border-color: rgba(74, 222, 128, 0.9);
    color: #dcfce7;
}

.terrain-storyteller-timeline-marker.keyframe {
    top: calc(50% - 44px);
    border-color: rgba(250, 204, 21, 0.92);
    color: #fef9c3;
    transform: translateX(-50%) rotate(45deg);
}

.terrain-storyteller-timeline-marker.keyframe span {
    display: block;
    transform: rotate(-45deg);
}

.terrain-storyteller-timeline-marker.is-selected {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28), 0 10px 24px rgba(0, 0, 0, 0.46);
}

.terrain-storyteller-timeline-marker.is-flashing {
    animation: terrainTimelineFlash 1.15s ease-out;
}

.terrain-storyteller-timeline-marker:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.terrain-storyteller-timeline-selection {
    min-width: 0;
    margin: 0;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(148, 163, 184, 0.16);
}

.terrain-storyteller-timeline-selection p {
    margin: 0 0 0.5rem;
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1.35;
}

.terrain-storyteller-timeline-actions {
    display: grid;
    grid-template-columns: minmax(96px, 0.95fr) minmax(128px, 1.15fr) minmax(216px, 1.8fr) minmax(126px, 1.2fr);
    gap: 0.35rem;
}

.terrain-storyteller-timeline-action-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.34rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.36);
}

.terrain-storyteller-timeline-action-group-wide {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.terrain-storyteller-timeline-action-group > span {
    grid-column: 1 / -1;
    color: rgba(186, 230, 253, 0.82);
    font-size: 0.58rem;
    font-weight: 1000;
    line-height: 1;
    text-transform: uppercase;
}

.terrain-storyteller-timeline-actions button {
    min-height: 27px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.76);
    color: rgba(226, 232, 240, 0.92);
    cursor: pointer;
    font: inherit;
    font-size: 0.6rem;
    font-weight: 950;
    padding: 0 0.3rem;
}

.terrain-storyteller-timeline-actions button:hover,
.terrain-storyteller-timeline-actions button:focus-visible {
    border-color: rgba(125, 211, 252, 0.78);
    background: rgba(8, 47, 73, 0.76);
    outline: none;
}

.terrain-storyteller-timeline-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.terrain-storyteller-timeline-actions button[aria-pressed="true"] {
    border-color: rgba(250, 204, 21, 0.8);
    background: rgba(113, 63, 18, 0.72);
    color: #fef9c3;
}

@keyframes terrainTimelineFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.8), 0 8px 18px rgba(0, 0, 0, 0.4);
    }
    48% {
        box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.22), 0 12px 28px rgba(0, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0), 0 8px 18px rgba(0, 0, 0, 0.4);
    }
}

.terrain-storyteller-points,
.terrain-storyteller-keyframes {
    display: none;
    gap: 0.32rem;
    max-height: 104px;
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.terrain-storyteller-keyframes {
    max-height: 86px;
    margin-top: 0.5rem;
}

.terrain-storyteller-points li,
.terrain-storyteller-keyframes li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.34rem 0.46rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.52);
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.7rem;
    font-weight: 800;
}

.terrain-storyteller-points li span:first-child,
.terrain-storyteller-keyframes li span:first-child {
    color: #bae6fd;
}

.terrain-view-restore-ui {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 440;
    min-height: 34px;
    border: 1px solid rgba(56, 189, 248, 0.58);
    border-radius: 6px;
    background: rgba(8, 47, 73, 0.88);
    color: #e0f2fe;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    padding: 0 0.75rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}

.terrain-view-restore-ui:hover,
.terrain-view-restore-ui:focus-visible {
    border-color: rgba(125, 211, 252, 0.9);
    background: rgba(14, 116, 144, 0.82);
    outline: none;
}

body.terrain-clean-view .terrain-view-panel {
    display: none !important;
}

body.terrain-clean-view .terrain-storyteller-timeline {
    display: none !important;
}

@media (max-width: 980px) {
    .terrain-storyteller-timeline {
        grid-template-columns: 1fr;
        max-height: 46vh;
        overflow-y: auto;
    }

    .terrain-storyteller-timeline-head,
    .terrain-storyteller-timeline-selection {
        padding: 0;
        border: 0;
    }

    .terrain-storyteller-timeline-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .terrain-storyteller-timeline-action-group,
    .terrain-storyteller-timeline-action-group-wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.terrain-storyteller-status {
    margin: 0.55rem 0 0;
    color: rgba(203, 213, 225, 0.78);
    font-size: 0.72rem;
    line-height: 1.3;
}

body.terrain-storyteller-picking .terrain-view-stage {
    cursor: crosshair;
}

.custom-pin-panel {
    position: fixed;
    top: calc(4.8rem + var(--release-announcement-height));
    left: 1rem;
    z-index: 1650;
    width: min(560px, calc(100vw - 2rem));
    max-height: min(620px, calc(100vh - 6.2rem - var(--legal-bar-height) - var(--release-announcement-height)));
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(12, 17, 23, 0.98), rgba(8, 12, 18, 0.96));
    color: #f8fafc;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(14px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.custom-pin-panel[hidden] {
    display: none !important;
}

.custom-pin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.custom-pin-panel h2 {
    margin: 0;
    font-size: 1.22rem;
    line-height: 1.1;
}

.custom-pin-section-title {
    margin: 0;
    padding: 0.15rem 0.05rem 0;
    color: #bae6fd;
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.custom-pin-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.9);
    color: #cbd5e1;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.custom-pin-panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.custom-pin-action,
.custom-pin-action-primary {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 5px;
    background: rgba(20, 28, 38, 0.92);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.custom-pin-action-primary {
    border-color: rgba(251, 191, 36, 0.68);
    background: rgba(251, 191, 36, 0.14);
    color: #fde68a;
}

.custom-pin-action-primary.is-active {
    background: #fbbf24;
    border-color: #fde68a;
    color: #111827;
}

.custom-pin-action.is-active,
.custom-pin-action[aria-pressed="true"] {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.14);
    color: #bae6fd;
}

.custom-pin-action:disabled,
.custom-pin-action-primary:disabled,
.custom-pin-row button:disabled,
.custom-pin-popup-actions button:disabled {
    opacity: 0.44;
    cursor: not-allowed;
}

.custom-pin-import {
    padding: 0 0.72rem;
}

#btn-custom-pin-clear-map {
    grid-column: 1 / -1;
}

.custom-pin-temporary {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
    padding: 0.76rem;
    border: 1px solid rgba(251, 191, 36, 0.54);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(45, 34, 10, 0.72), rgba(28, 22, 9, 0.58));
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.06);
}

.custom-pin-room {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
    padding: 0.78rem;
    border: 1px solid rgba(34, 197, 94, 0.42);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(3, 28, 20, 0.78), rgba(4, 18, 26, 0.66));
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.06);
}

.custom-pin-room-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.42rem;
    align-items: center;
}

.custom-pin-room-recent-row {
    grid-template-columns: 1fr;
}

.custom-pin-room-player-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 68px 124px;
    gap: 0.5rem;
    align-items: end;
}

.custom-pin-room-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    margin: 0;
}

.custom-pin-room-field span {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.custom-pin-room-field-color {
    align-items: stretch;
}

.custom-pin-room-field-color .custom-pin-color-input {
    width: 100%;
}

.custom-pin-room-recent-actions-row {
    grid-template-columns: 1fr 1fr;
}

.custom-pin-room-name-row {
    grid-template-columns: 1fr auto auto;
}

.custom-pin-room-active-row {
    grid-template-columns: 1fr;
}

.custom-pin-room-active-row[hidden],
.custom-pin-room-name-row[hidden],
.custom-pin-room-routes[hidden],
.custom-pin-room-mission[hidden],
.custom-pin-room-notes[hidden],
.custom-pin-room-members-title[hidden],
.custom-pin-room-members[hidden],
.custom-pin-room-pin-list[hidden],
.custom-pin-room-activity[hidden] {
    display: none !important;
}

.custom-pin-room-input,
.custom-pin-room-select {
    min-width: 0;
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 5px;
    background: rgba(4, 10, 17, 0.82);
    color: #f8fafc;
    padding: 0 0.65rem;
    font: inherit;
    font-size: 0.82rem;
}

.custom-pin-color-input {
    width: 42px;
    height: 34px;
    padding: 2px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 5px;
    background: rgba(4, 10, 17, 0.82);
    cursor: pointer;
}

.custom-pin-room-pin-toggle {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 5px;
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 800;
}

.custom-pin-room-notes {
    width: 100%;
    min-height: 72px;
    max-height: 130px;
    resize: vertical;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 5px;
    background: rgba(4, 10, 17, 0.82);
    color: #f8fafc;
    padding: 0.6rem;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.35;
}

.custom-pin-room-members,
.custom-pin-room-activity {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 5px;
    background: rgba(2, 6, 12, 0.45);
    color: #cbd5e1;
    padding: 0.48rem;
    font-size: 0.75rem;
    line-height: 1.35;
}

.custom-pin-room-subtitle {
    margin: 0 0 0.06rem;
    color: #f8fafc;
    font-size: 0.95rem;
    line-height: 1.1;
    font-weight: 900;
}

.custom-pin-room-members-title {
    margin-top: 0.24rem;
}

.custom-pin-room-routes {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    margin-top: 0.12rem;
    padding: 0.7rem;
    border: 1px solid rgba(56, 189, 248, 0.48);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(8, 31, 48, 0.78), rgba(9, 22, 40, 0.64));
}

.custom-pin-room-routes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
}

.custom-pin-room-routes-brief {
    margin: 0.16rem 0 0;
    color: #cbd5e1;
    font-size: 0.74rem;
    line-height: 1.35;
}

.custom-pin-room-route-create-row {
    grid-template-columns: minmax(0, 1fr) 34px auto;
    align-items: center;
}

.custom-pin-room-route-create-row .custom-pin-color-input {
    width: 34px;
    min-width: 34px;
    height: 34px;
}

.custom-pin-room-route-list {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.custom-pin-room-route-card {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding: 0.42rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 3px solid var(--route-color, #38bdf8);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.72);
}

.custom-pin-room-route-card.is-selected,
.custom-pin-room-route-card.is-route-building {
    border-color: color-mix(in srgb, var(--route-color, #38bdf8) 68%, rgba(148, 163, 184, 0.18));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--route-color, #38bdf8) 42%, transparent), 0 12px 26px rgba(0, 0, 0, 0.22);
}

.custom-pin-room-route-top {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
}

.custom-pin-room-route-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--route-color, #38bdf8);
    box-shadow: 0 0 10px var(--route-color, #38bdf8);
}

.custom-pin-room-route-actions,
.custom-pin-room-route-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    align-items: center;
}

.custom-pin-room-route-controls .custom-pin-room-select {
    flex: 1 1 118px;
    min-width: 0;
}

.custom-pin-room-route-summary {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
}

.custom-pin-room-route-card .custom-pin-mission-route-list {
    max-height: 220px;
    overflow: auto;
}

.custom-pin-room-mission {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    margin-top: 0.12rem;
    padding: 0.7rem;
    border: 1px solid rgba(251, 191, 36, 0.46);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(48, 34, 9, 0.72), rgba(30, 23, 10, 0.58));
}

.custom-pin-room-mission-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
}

.custom-pin-room-mission-brief {
    margin: 0.16rem 0 0;
    color: #cbd5e1;
    font-size: 0.74rem;
    line-height: 1.35;
}

.custom-pin-mission-create-row {
    grid-template-columns: 1fr minmax(92px, 0.72fr) auto;
}

.custom-pin-mission-teams,
.custom-pin-mission-team-section {
    display: flex;
    flex-direction: column;
    gap: 0.36rem;
    padding: 0.44rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 5px;
    background: rgba(2, 6, 12, 0.36);
}

.custom-pin-mission-team-section h5 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.custom-pin-mission-team-card {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding: 0.42rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 3px solid var(--mission-color, #fbbf24);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.72);
}

.custom-pin-mission-team-top {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
}

.custom-pin-mission-team-actions {
    display: flex;
    gap: 0.32rem;
    align-items: center;
}

.custom-pin-mission-member-row,
.custom-pin-mission-route-controls,
.custom-pin-mission-task-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.38rem;
    align-items: center;
}

.custom-pin-mission-route-controls {
    display: flex;
    flex-wrap: wrap;
}

.custom-pin-mission-route-controls .custom-pin-room-select {
    flex: 1 1 118px;
    min-width: 0;
}

.custom-pin-mission-route-controls .custom-pin-action {
    flex: 0 0 auto;
}

.custom-pin-mission-team-card.is-route-building {
    border-color: color-mix(in srgb, var(--mission-color, #fbbf24) 68%, rgba(148, 163, 184, 0.18));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mission-color, #fbbf24) 42%, transparent), 0 12px 26px rgba(0, 0, 0, 0.22);
}

.custom-pin-mission-route-list {
    display: flex;
    flex-direction: column;
    gap: 0.34rem;
}

.custom-pin-mission-route-stop {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
    padding: 0.36rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 5px;
    background: rgba(2, 6, 12, 0.36);
}

.custom-pin-route-building .leaflet-container {
    cursor: crosshair;
}

.custom-pin-mission-task {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.42rem;
    align-items: center;
    padding: 0.38rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 5px;
    background: rgba(2, 6, 12, 0.36);
}

.custom-pin-mission-member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.custom-pin-mission-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    min-height: 24px;
    padding: 0 0.42rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.86);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 850;
}

.custom-pin-mission-member-chip button {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    line-height: 1;
    padding: 0;
}

.custom-pin-mission-member-chip button:hover {
    color: #fecaca;
}

.custom-pin-mission-route-summary {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
}

.custom-pin-mission-main {
    min-width: 0;
}

.custom-pin-mission-title {
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-mission-meta {
    margin-top: 0.04rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-mission-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mission-color, #fbbf24);
    box-shadow: 0 0 10px var(--mission-color, #fbbf24);
}

.custom-pin-mission-task.is-done {
    opacity: 0.62;
}

.custom-pin-mission-task.is-done .custom-pin-mission-title {
    text-decoration: line-through;
}

.custom-pin-route-stop-badge {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fbbf24;
    color: #111827;
    font-size: 0.72rem;
    font-weight: 1000;
}

.custom-pin-route-stop-main {
    min-width: 0;
}

.custom-pin-route-stop-title {
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-route-stop-meta {
    color: #94a3b8;
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-route-stop-actions {
    display: flex;
    gap: 0.22rem;
}

.custom-pin-route-stop-actions button,
.custom-pin-route-toggle {
    min-width: 28px;
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: rgba(2, 6, 12, 0.74);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}

.custom-pin-route-toggle.is-active {
    border-color: rgba(251, 191, 36, 0.75);
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
}

.room-route-stop-marker {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border: 2px solid #111827;
    border-radius: 50%;
    background: #fbbf24;
    color: #111827;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.34), 0 8px 18px rgba(0, 0, 0, 0.42);
    font-size: 0.78rem;
    font-weight: 1000;
}

.room-route-stop-marker.is-end {
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.32), 0 8px 18px rgba(0, 0, 0, 0.42);
}

.custom-pin-route-stop-drag-marker {
    cursor: grab;
}

.leaflet-dragging .custom-pin-route-stop-drag-marker {
    cursor: grabbing;
}

.room-route-arrow {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) rotate(var(--route-angle, 0deg));
    color: #fde68a;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
    font-size: 1.2rem;
    font-weight: 1000;
}

.mission-route-arrow {
    color: var(--mission-color, #fde68a);
}

.custom-pin-room-members {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.custom-pin-room-member {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.48rem;
    max-width: 100%;
    padding: 0.44rem 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.78);
    color: #e2e8f0;
    font-weight: 800;
}

.custom-pin-room-member-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--member-color, #4ade80);
    box-shadow: 0 0 10px var(--member-color, #4ade80);
}

.custom-pin-room-self-tag {
    margin-left: 0.22rem;
    color: #fde68a;
    font-size: 0.68rem;
    font-weight: 900;
}

.custom-pin-room-member-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.custom-pin-room-member-main strong,
.custom-pin-room-member-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-room-member-main span {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.custom-pin-room-member.is-idle {
    opacity: 0.58;
}

.custom-pin-room-member-actions {
    display: flex;
    align-items: center;
    gap: 0.32rem;
}

.custom-pin-room-member-actions .custom-pin-action {
    min-height: 30px;
    padding: 0 0.55rem;
    font-size: 0.72rem;
    white-space: nowrap;
}

.custom-pin-action-danger,
.custom-pin-room-leave-action {
    border-color: rgba(239, 68, 68, 0.78);
    background: rgba(127, 29, 29, 0.92);
    color: #fecaca;
}

.custom-pin-room-leave-action {
    min-width: 100px;
    font-weight: 950;
}

.custom-pin-action-danger:hover,
.custom-pin-room-leave-action:hover {
    border-color: rgba(248, 113, 113, 0.95);
    background: rgba(185, 28, 28, 0.94);
    color: #fff1f2;
}

.custom-pin-room-activity {
    max-height: 104px;
    overflow-y: auto;
}

.custom-pin-room-activity-line {
    display: flex;
    gap: 0.34rem;
    padding: 0.12rem 0;
}

.custom-pin-room-activity-line strong {
    color: #f8fafc;
}

.custom-pin-room-status {
    min-height: 1rem;
    margin: 0;
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.35;
}

.custom-pin-room.is-connected {
    border-color: rgba(74, 222, 128, 0.42);
    background: rgba(8, 28, 19, 0.72);
}

.custom-pin-room.is-connected .custom-pin-room-status {
    color: #bbf7d0;
}

.room-cursor-marker {
    position: relative;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.room-cursor-dot {
    width: 13px;
    height: 13px;
    border: 2px solid #020617;
    border-radius: 50%;
    background: var(--member-color, #4ade80);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 16px var(--member-color, #4ade80);
}

.room-cursor-label {
    position: absolute;
    left: 16px;
    top: -7px;
    max-width: 110px;
    padding: 0.12rem 0.36rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 4px;
    background: rgba(2, 6, 12, 0.82);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-ping-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
}

.room-ping-label {
    position: absolute;
    left: 50%;
    bottom: 39px;
    max-width: 120px;
    transform: translateX(-50%);
    padding: 0.12rem 0.38rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 4px;
    background: rgba(2, 6, 12, 0.86);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 950;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

.room-ping-marker {
    width: 34px;
    height: 34px;
    border: 2px solid var(--ping-color, #fbbf24);
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.14);
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.12), 0 0 28px var(--ping-color, #fbbf24);
    animation: room-ping-pulse 1.2s ease-out infinite;
}

@keyframes room-ping-pulse {
    0% { transform: scale(0.82); opacity: 1; }
    100% { transform: scale(1.22); opacity: 0.42; }
}

.custom-pin-mode-hint {
    margin: -0.25rem 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.35;
}

.custom-pin-panel.is-dropping .custom-pin-mode-hint {
    color: #fde68a;
}

.custom-pin-list {
    flex: 0 0 auto;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    overflow-y: visible;
    padding-right: 0.2rem;
}

.custom-pin-list-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.custom-pin-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.12rem 0.08rem 0;
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.custom-pin-list-heading small {
    min-width: 1.4rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #94a3b8;
    font-size: 0.68rem;
    letter-spacing: 0;
}

.custom-pin-empty {
    padding: 1rem 0.2rem;
    color: #94a3b8;
    font-size: 0.86rem;
    line-height: 1.4;
}

.custom-pin-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 0.58rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-left: 3px solid var(--pin-color, #fbbf24);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.72);
}

.custom-pin-row.is-shared {
    border-color: rgba(74, 222, 128, 0.24);
    background: rgba(12, 26, 20, 0.78);
}

.custom-pin-row-main {
    min-width: 0;
}

.custom-pin-row-title {
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-row-meta {
    margin-top: 0.16rem;
    color: #94a3b8;
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-pin-row-actions {
    display: flex;
    gap: 0.28rem;
}

.custom-pin-row button {
    min-width: 32px;
    min-height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: rgba(2, 6, 12, 0.74);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.custom-pin-row button.custom-pin-row-delete-btn {
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(127, 29, 29, 0.32);
    color: #fecaca;
}

.custom-pin-row button.custom-pin-row-delete-btn:hover:not(:disabled) {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(153, 27, 27, 0.48);
    color: #fff1f2;
}

.custom-pin-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pin-color, #fbbf24);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 14px var(--pin-color, #fbbf24);
}

.site-top-actions {
    position: fixed;
    top: calc(0.85rem + var(--release-announcement-height));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1800;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

body.terrain-view-active .site-top-actions {
    display: none;
}

.site-tools-link {
    min-width: 92px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    padding: 0 0.82rem;
    border: 1px solid rgba(56, 198, 242, 0.58);
    border-radius: 999px;
    background: rgba(16, 20, 26, 0.92);
    color: #65d9ff;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.site-tools-link:hover,
.site-tools-link:focus-visible {
    background: rgba(56, 198, 242, 0.16);
    border-color: rgba(56, 198, 242, 0.92);
    outline: none;
}

.site-tools-link-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-icon-button {
    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-icon-button:hover,
.site-icon-button:focus-visible {
    background: rgba(255, 216, 77, 0.16);
    border-color: rgba(255, 216, 77, 0.9);
    outline: none;
}

.site-tracker-button {
    border-color: rgba(74, 222, 128, 0.56);
    color: #4ade80;
}

.site-tracker-button:hover,
.site-tracker-button:focus-visible {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.92);
}

.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%);
}

@media (max-width: 720px) {
    .aerial-nav-btn {
        width: 56px;
        height: 56px;
        font-size: 2rem;
    }
}

body.ortho-preview-active::before {
    content: "ORTHO PREVIEW";
    position: fixed;
    left: 50%;
    bottom: calc(var(--footer-height) + 12px);
    transform: translateX(-50%);
    z-index: 2500;
    padding: 0.42rem 0.7rem;
    background: rgba(17, 24, 32, 0.92);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.7);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.marker-projection-preview-active::before {
    content: "MARKER PROJECTION";
    position: fixed;
    left: 50%;
    bottom: calc(var(--footer-height) + 12px);
    transform: translateX(-50%);
    z-index: 2500;
    padding: 0.42rem 0.7rem;
    background: rgba(17, 24, 32, 0.92);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.7);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.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));
    line-height: 1.05;
    text-shadow: 1px 1px 2px black, -1px -1px 2px black, 1px -1px 2px black, -1px 1px 2px black;
    pointer-events: none;
}

#map.high-res-base-active .map-label {
    color: #071013 !important;
    font-weight: 900;
    font-size: calc(2.12em * var(--label-scale, 0.5));
    letter-spacing: 0;
    -webkit-text-stroke: 0.38px rgba(255, 255, 255, 0.94);
    text-shadow:
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(255, 255, 255, 0.96),
        0 0 7px rgba(255, 255, 255, 0.82),
        1px 1px 0 rgba(255, 255, 255, 0.88),
        -1px -1px 0 rgba(255, 255, 255, 0.88),
        1px -1px 0 rgba(255, 255, 255, 0.88),
        -1px 1px 0 rgba(255, 255, 255, 0.88);
}

.map-label-native {
    display: block;
    font-size: 0.72em;
    font-weight: 700;
    opacity: 0.92;
    line-height: 1.05;
}

.map-label-native:lang(fa),
.map-label bdi:lang(fa),
.search-popup-native:lang(fa) {
    font-family: Tahoma, Arial, sans-serif;
    letter-spacing: 0;
    line-height: 1.4;
}

.map-label-native:lang(fa) {
    font-size: 0.92em;
}

.search-popup-native:lang(fa) {
    font-size: 1.1em;
    color: #c9d1d9;
}

#map.high-res-base-active .map-label-native {
    font-weight: 800;
    opacity: 0.98;
}

.map-label:before {
    border: none !important;
}

.custom-server-map-label {
    transform: translateY(-4px);
    z-index: 760 !important;
}

/* Custom Leaflet Div Icon */
.custom-div-icon {
    background: transparent !important;
    border: none !important;
}

.filter-symbol-div-icon {
    background: transparent !important;
    border: 0 !important;
}

.filter-symbol-marker {
    --marker-size: 20px;
    width: var(--marker-size);
    height: var(--marker-size);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--marker-color, #ffd84d);
    border: 2px solid rgba(8, 10, 14, 0.95);
    color: #071018;
    font-size: max(9px, calc(var(--marker-size) * 0.48));
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.24);
    text-shadow: none;
    transform-origin: center;
    user-select: none;
}

.filter-symbol-marker > span {
    display: block;
    transform-origin: center;
}

.filter-symbol-marker > svg {
    display: block;
    width: calc(var(--marker-size) * 0.78);
    height: calc(var(--marker-size) * 0.78);
    fill: currentColor;
}

.filter-symbol-circle {
    border-radius: 50%;
}

.filter-symbol-square {
    border-radius: 4px;
}

.filter-symbol-diamond {
    border-radius: 4px;
    transform: rotate(45deg);
}

.filter-symbol-diamond > span {
    transform: rotate(-45deg);
}

.filter-symbol-diamond > svg {
    transform: rotate(-45deg);
}

.filter-symbol-triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: calc(var(--marker-size) * 0.52) solid transparent;
    border-right: calc(var(--marker-size) * 0.52) solid transparent;
    border-bottom: var(--marker-size) solid var(--marker-color, #ffd84d);
    border-top: 0;
    box-shadow: none;
    position: relative;
}

.filter-symbol-triangle > span {
    position: absolute;
    left: calc(var(--marker-size) * -0.22);
    top: calc(var(--marker-size) * 0.34);
    width: calc(var(--marker-size) * 0.44);
    color: #071018;
    text-align: center;
    font-size: max(8px, calc(var(--marker-size) * 0.42));
}

.filter-symbol-triangle > svg {
    position: absolute;
    left: calc(var(--marker-size) * -0.39);
    top: calc(var(--marker-size) * 0.26);
}

.filter-symbol-hex {
    clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.filter-symbol-swatch {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.filter-symbol-swatch .filter-symbol-marker {
    --marker-size: 16px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
}

/* Right Sidebar */
.right-sidebar {
    position: fixed;
    top: var(--release-announcement-height);
    right: 0;
    width: 300px;
    height: calc(100vh - var(--legal-bar-height) - var(--release-announcement-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;
    contain: layout paint;
    overscroll-behavior: contain;
}

.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) {
    .filter-symbol-marker {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
    }

    .sidebar {
        width: 100vw;
        max-height: calc(100vh - var(--legal-bar-height) - var(--release-announcement-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: visible;
        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) - var(--release-announcement-height) - 128px);
    }

    .site-top-actions {
        top: auto;
        right: 0.75rem;
        bottom: calc(var(--legal-bar-height) + 0.75rem);
        left: auto;
        transform: none;
        flex-direction: column;
        gap: 0.45rem;
        z-index: 1800;
    }

    .site-icon-button {
        width: 38px;
        height: 38px;
    }

    .site-tools-link {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 50%;
    }

    .site-tools-link span:not(.site-tools-link-icon) {
        display: none;
    }

    .map-overlay {
        top: 8.75rem;
        right: 0.65rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
        max-height: calc(100% - 8.75rem - 0.65rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .map-overlay > * { flex-shrink: 0; }

    .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,
.custom-pins-btn,
.custom-server-btn,
.streetview-btn,
.terrain-view-btn,
.mouse-radius-btn,
.base-map-mode-btn,
.footprints-btn {
    width: 42px;
    height: 40px;
    padding: 0;
}

    .terrain-view-btn {
        width: 42px;
        height: 42px;
    }

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

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

.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;
}

.all-loot-map-visibility {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(74, 222, 128, 0.48);
    border-radius: 50%;
    background: rgba(6, 10, 12, 0.9);
    color: #bbf7d0;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.all-loot-map-visibility[hidden] {
    display: none !important;
}

.all-loot-map-visibility:hover,
.all-loot-map-visibility:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(74, 222, 128, 0.92);
    background: rgba(20, 83, 45, 0.68);
    color: #dcfce7;
    outline: none;
}

.all-loot-map-visibility svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.all-loot-map-visibility.is-visible {
    border-color: rgba(74, 222, 128, 0.78);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 4px 14px rgba(0, 0, 0, 0.58);
}

.all-loot-map-visibility.is-mixed {
    opacity: 0.72;
}

.all-loot-map-visibility:not(.is-visible):not(.is-mixed) {
    border-color: rgba(148, 163, 184, 0.42);
    background: rgba(15, 23, 42, 0.62);
    color: #94a3b8;
}

.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-subgroup-parent {
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.035);
    border-radius: 8px;
}

.filter-subgroup-children {
    margin-left: 1.15rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.filter-subgroup-child {
    padding-left: 0.25rem;
}

.foraging-filter-parent {
    border: 1px solid rgba(74, 222, 128, 0.28);
    background: rgba(20, 83, 45, 0.18);
}

.foraging-filter-children {
    padding-top: 0.2rem;
    padding-bottom: 0.15rem;
}

.foraging-filter-note {
    margin: 0.45rem 0.45rem 0.2rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.foraging-map-canvas {
    pointer-events: none;
    image-rendering: auto;
}

.foraging-popup-note {
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.territory-inventory-only-note {
    color: var(--text-muted);
    cursor: default;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.territory-inventory-only-child {
    cursor: default;
    opacity: 0.74;
}

.territory-inventory-only-child input {
    cursor: not-allowed;
}

.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;
}

.filter-color-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
    flex: 0 0 auto;
}

/* Marker Popup Styles */
.water-source-marker--shared {
    pointer-events: none !important;
}
.water-source-marker--shared svg {
    pointer-events: auto;
    cursor: pointer;
    transform: translate(13px, -11px) scale(0.78);
}
.marker-popup .popup-water-source {
    padding: 0.5rem 0.6rem;
    border-left: 2px solid #38bdf8;
    background: rgba(56, 189, 248, 0.09);
    border-radius: 3px;
    line-height: 1.45;
}
.water-location-building {
    margin-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 0.5rem;
}
.water-location-building summary {
    color: #dbeafe;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0;
}
.water-location-building[open] > .marker-popup {
    margin-top: 0.5rem;
}
.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;
}

.object-preview-card {
    margin: 0.7rem 0 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(7, 16, 24, 0.96));
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.object-preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: #f8fafc;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
}

.object-preview-card-header small {
    color: rgba(203, 213, 225, 0.72);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.object-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.42rem 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    color: rgba(203, 213, 225, 0.68);
    font-size: 0.68rem;
    font-weight: 700;
}

.object-preview-zoom-controls {
    display: inline-grid;
    grid-template-columns: 28px 46px 28px;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.object-preview-zoom-controls button {
    min-height: 24px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.82);
    color: rgba(248, 250, 252, 0.88);
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
}

.object-preview-zoom-controls button:hover {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(14, 165, 233, 0.2);
}

.object-preview-loading,
.object-preview-empty {
    padding: 0.8rem 0.7rem;
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.76rem;
}

.object-preview-media {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 150px;
    max-height: 210px;
    overflow: hidden;
    cursor: default;
    touch-action: none;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25% 50%, rgba(255,255,255,0.035) 50% 75%, transparent 75%),
        radial-gradient(circle at 50% 38%, rgba(56, 189, 248, 0.12), transparent 58%),
        #050a10;
    background-size: 20px 20px, 100% 100%, 100% 100%;
}

.object-preview-media.is-zoomed {
    cursor: grab;
}

.object-preview-media.is-panning {
    cursor: grabbing;
}

.object-preview-image {
    display: block;
    width: 100%;
    max-height: 210px;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 90ms ease;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.object-preview-media.is-panning .object-preview-image {
    transition: none;
}

.object-preview-image-error {
    display: none;
    position: absolute;
    inset: 0;
    place-items: center;
    padding: 0.8rem;
    color: rgba(248, 250, 252, 0.72);
    text-align: center;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.86);
}

.object-preview-media.is-error .object-preview-image {
    opacity: 0;
}

.object-preview-media.is-error .object-preview-image-error {
    display: grid;
}

.object-preview-actions {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.object-preview-actions button {
    flex: 1;
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.object-preview-actions button.is-active {
    border-color: rgba(56, 189, 248, 0.85);
    background: rgba(14, 165, 233, 0.2);
    color: #f8fafc;
}

.marker-popup.territory-popup {
    min-width: 300px;
    max-width: 500px;
}

.custom-pin-marker-hitbox {
    position: relative;
    width: 150px;
    height: 54px;
    cursor: grab;
}

.custom-pin-div-icon.leaflet-drag-target .custom-pin-marker-hitbox {
    cursor: grabbing;
}

.custom-pin-marker {
    position: absolute;
    left: 60px;
    top: 0;
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7));
}

.custom-pin-marker-pin {
    width: 30px;
    height: 30px;
    color: var(--pin-color, #fbbf24);
}

.custom-pin-marker.is-locked .custom-pin-marker-pin {
    opacity: 0.82;
}

.custom-pin-marker-lock {
    position: absolute;
    right: -3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(15, 23, 42, 0.8);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.96);
    color: #fde68a;
    font-size: 0.55rem;
    line-height: 1;
}

.custom-pin-marker-label {
    position: absolute;
    left: 50%;
    top: 28px;
    max-width: 150px;
    transform: translateX(-50%);
    padding: 0.12rem 0.34rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(2, 6, 12, 0.74);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.custom-pin-popup {
    min-width: 260px;
}

.custom-pin-leaflet-popup .leaflet-popup-content-wrapper {
    max-width: min(320px, calc(100vw - 28px));
}

.custom-pin-screen-popup .leaflet-popup-tip-container {
    display: none;
}

.custom-pin-screen-popup .leaflet-popup-content-wrapper {
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.62);
}

.custom-pin-popup-form {
    display: grid;
    gap: 0.54rem;
}

.custom-pin-popup-form label {
    display: grid;
    gap: 0.22rem;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.custom-pin-popup-form input,
.custom-pin-popup-form select,
.custom-pin-popup-form textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    padding: 0.42rem 0.5rem;
    font: inherit;
    font-size: 0.82rem;
    text-transform: none;
}

.custom-pin-popup-form textarea {
    min-height: 64px;
    resize: vertical;
}

.custom-pin-popup-grid {
    display: grid;
    grid-template-columns: 1fr 0.75fr;
    gap: 0.44rem;
}

.custom-pin-popup-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 0.45rem !important;
    color: #e2e8f0 !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.custom-pin-popup-check input {
    width: auto;
}

.custom-pin-popup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
    margin-top: 0.1rem;
}

.map-location-popup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
    margin-top: 0.65rem;
}

.map-location-popup-actions .custom-pin-add-here-btn {
    grid-column: 1 / -1;
}

.custom-pin-popup-actions button,
.custom-pin-add-here-btn,
.map-location-copy-btn,
.map-location-share-btn,
.map-location-3d-btn {
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 4px;
    background: rgba(30, 41, 59, 0.92);
    color: #e2e8f0;
    padding: 0.42rem 0.62rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.map-location-copy-btn,
.map-location-share-btn,
.map-location-3d-btn {
    min-height: 38px;
}

.custom-pin-popup-actions .custom-pin-save-btn,
.custom-pin-add-here-btn {
    border-color: rgba(251, 191, 36, 0.62);
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
}

.map-location-share-btn {
    border-color: rgba(74, 222, 128, 0.58);
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
}

.map-location-3d-btn {
    border-color: rgba(248, 113, 113, 0.62);
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.map-location-popup-actions button.is-success {
    border-color: rgba(74, 222, 128, 0.86);
    background: rgba(34, 197, 94, 0.26);
    color: #dcfce7;
}

.custom-pin-popup-actions .custom-pin-open-groundview-btn {
    border-color: rgba(74, 222, 128, 0.58);
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
}

.custom-pin-popup-actions .custom-pin-delete-btn {
    border-color: rgba(248, 113, 113, 0.54);
    color: #fecaca;
}

.territory-zone-summary {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.86rem;
    line-height: 1.42;
}

.infected-inventory-section {
    margin-top: 0.8rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.infected-section-title,
.infected-subtitle {
    color: #4ade80;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.infected-subtitle {
    color: #ffd84d;
    margin-top: 0.65rem;
    margin-bottom: 0.35rem;
}

.infected-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.infected-stat-grid > div {
    min-width: 0;
    padding: 0.32rem 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.055);
}

.infected-stat-grid span,
.infected-item-stat span,
.infected-class-row div > span {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.68rem;
    line-height: 1.2;
}

.infected-stat-grid strong,
.infected-item-stat strong,
.infected-class-row strong {
    display: block;
    min-width: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.76rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.infected-note,
.infected-empty {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.74rem;
    line-height: 1.35;
}

.infected-item-list,
.infected-class-list {
    display: grid;
    gap: 0.35rem;
}

.infected-item-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    align-items: stretch;
    padding: 0.42rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.045);
}

.infected-item-main {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 0.48rem;
    align-items: center;
}

.infected-item-copy {
    min-width: 0;
}

.infected-item-preview {
    position: relative;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    align-self: center;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 6px;
    background:
        radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.12), transparent 58%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 12, 0.92));
}

.infected-item-preview-loading {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(148, 163, 184, 0.24);
    border-top-color: rgba(74, 222, 128, 0.82);
    border-radius: 999px;
    animation: preview-spin 850ms linear infinite;
}

@keyframes preview-spin {
    to {
        transform: rotate(360deg);
    }
}

.infected-item-preview-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.infected-item-preview-error,
.infected-item-preview.is-unavailable span {
    display: none;
    padding: 0.35rem;
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.infected-item-preview.is-unavailable span,
.infected-item-preview.is-error .infected-item-preview-error {
    display: block;
}

.infected-item-preview.is-error .infected-item-preview-image {
    display: none;
}

.infected-item-name {
    display: block;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.infected-item-class,
.infected-item-source {
    display: block;
    margin-top: 0.12rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.68rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.infected-item-stat {
    min-width: 0;
    align-self: stretch;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.infected-details {
    margin-top: 0.65rem;
}

.infected-details summary {
    cursor: pointer;
    color: #ffd84d;
    font-size: 0.78rem;
    font-weight: 650;
    margin-bottom: 0.35rem;
}

.infected-class-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 3.8rem 3.6rem 3.6rem minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.32rem;
    padding: 0.38rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
}

.infected-class-main {
    min-width: 0;
}

.infected-class-main span:first-child {
    display: block;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.infected-class-main span:last-child {
    display: block;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.66rem;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .marker-popup.territory-popup {
        min-width: 250px;
        max-width: 82vw;
    }

    .infected-stat-grid,
    .infected-item-row,
    .infected-class-row {
        grid-template-columns: 1fr;
    }

    .infected-item-stat {
        padding-left: 0;
        padding-top: 0.3rem;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .infected-item-main {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .infected-item-preview {
        width: 96px;
        height: 96px;
    }
}

/* Leaflet Popup Override */
.leaflet-popup-pane {
    z-index: 1900;
}

.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;
    gap: 0.7rem;
}

.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);
}

.search-result-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.search-result-detail {
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

.loot-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.loot-search-actions button {
    min-height: 28px;
    padding: 0 0.55rem;
    border: 1px solid rgba(255, 216, 77, 0.42);
    border-radius: 4px;
    background: rgba(255, 216, 77, 0.1);
    color: var(--filter-item);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.loot-search-actions button:hover,
.loot-search-actions button:focus-visible {
    background: rgba(255, 216, 77, 0.2);
    border-color: rgba(255, 216, 77, 0.72);
    outline: none;
}

.loot-search-highlight-marker {
    filter:
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.95))
        drop-shadow(0 0 7px rgba(255, 43, 214, 0.9));
}

/* ======================================
   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);
}

.streetview-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;
}

.streetview-btn[hidden] {
    display: none !important;
}

.streetview-btn:hover {
    background: var(--border);
    border-color: #22c55e;
}

.streetview-btn.active {
    background: rgba(34, 197, 94, 0.16);
    border-color: #22c55e;
    color: #4ade80;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.36);
}

.terrain-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(20, 12, 35, 0.92);
    color: #f4e8ff;
    border: 1px solid rgba(216, 180, 254, 0.7);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.terrain-view-btn:hover {
    transform: translateY(-1px);
    background: rgba(126, 34, 206, 0.38);
    border-color: rgba(216, 180, 254, 0.74);
}

.terrain-view-btn:disabled,
.terrain-view-btn[aria-disabled="true"],
.base-map-mode-btn:disabled,
.base-map-mode-btn[aria-disabled="true"] {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.terrain-view-btn:disabled:hover,
.terrain-view-btn[aria-disabled="true"]:hover,
.base-map-mode-btn:disabled:hover,
.base-map-mode-btn[aria-disabled="true"]:hover {
    transform: none;
}

.terrain-view-btn.active,
.terrain-view-btn[aria-pressed="true"] {
    background: rgba(126, 34, 206, 0.62);
    border-color: rgba(233, 213, 255, 0.9);
    color: #fff;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.terrain-view-btn-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    pointer-events: none;
    transform: translateY(0.5px);
}

.terrain-view-btn svg {
    pointer-events: none;
}

.streetview-route-popup {
    min-width: 190px;
}

.streetview-open-btn {
    margin-top: 0.6rem;
    width: 100%;
    border: 1px solid rgba(74, 222, 128, 0.62);
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.14);
    color: #d9ffe8;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.42rem 0.55rem;
    cursor: pointer;
}

.streetview-open-btn:hover,
.streetview-open-btn:focus-visible {
    background: rgba(34, 197, 94, 0.24);
    border-color: #4ade80;
    outline: none;
}

.mouse-radius-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(15, 20, 28, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mouse-radius-controls[hidden] {
    display: none !important;
}

.mouse-radius-step-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 215, 64, 0.48);
    border-radius: 4px;
    background: rgba(255, 215, 64, 0.12);
    color: #ffd740;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.mouse-radius-step-btn:hover,
.mouse-radius-step-btn:focus {
    border-color: #ffd740;
    background: rgba(255, 215, 64, 0.22);
    outline: none;
}

.mouse-radius-step-btn:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.mouse-radius-value {
    min-width: 58px;
    text-align: center;
    color: #ffd740;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.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;
}

.custom-pins-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #1f2937;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fbbf24;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.custom-pins-btn:hover {
    background: #2f3a4b;
    border-color: #fbbf24;
}

.custom-pins-btn.active,
.custom-pins-btn[aria-pressed="true"] {
    background: rgba(251, 191, 36, 0.18);
    border-color: #fbbf24;
    color: #fde68a;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.36);
}

.custom-pins-btn svg {
    width: 18px;
    height: 18px;
}

.custom-server-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #10232d;
    border: 1px solid rgba(45, 212, 191, 0.38);
    border-radius: 6px;
    color: #67e8f9;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.custom-server-btn[hidden] {
    display: none !important;
}

.custom-server-btn:hover {
    background: #17313d;
    border-color: #22d3ee;
}

.custom-server-btn.active,
.custom-server-btn[aria-pressed="true"] {
    background: rgba(34, 211, 238, 0.16);
    border-color: #22d3ee;
    color: #cffafe;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.32);
}

.custom-server-btn svg {
    width: 18px;
    height: 18px;
}

.custom-server-panel {
    position: fixed;
    top: calc(4.8rem + var(--release-announcement-height));
    right: 1rem;
    z-index: 1640;
    width: min(440px, calc(100vw - 2rem));
    max-height: min(720px, calc(100vh - 6rem - var(--legal-bar-height) - var(--release-announcement-height)));
    padding: 0.95rem;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 8px;
    background: rgba(10, 18, 24, 0.95);
    color: #ecfeff;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(14px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.custom-server-panel[hidden] {
    display: none !important;
}

.custom-server-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.custom-server-kicker {
    margin: 0 0 0.16rem;
    color: #67e8f9;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.custom-server-panel h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.08rem;
    line-height: 1.2;
}

.custom-server-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.78);
    color: #cbd5e1;
    cursor: pointer;
    font-weight: 800;
}

.custom-server-close:hover {
    border-color: #22d3ee;
    color: #f8fafc;
}

.custom-server-select-label {
    display: block;
    margin-bottom: 0.32rem;
    color: #a5f3fc;
    font-size: 0.74rem;
    font-weight: 700;
}

.custom-server-access,
.custom-server-controls {
    padding: 0.76rem;
    border: 1px solid rgba(45, 212, 191, 0.32);
    border-radius: 6px;
    background: rgba(8, 26, 32, 0.72);
}

.custom-server-access {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.custom-server-access[hidden],
.custom-server-controls[hidden] {
    display: none !important;
}

.custom-server-access-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.custom-server-access-key {
    min-width: 0;
    min-height: 38px;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    font: inherit;
    font-size: 0.9rem;
}

.custom-server-access-key:focus {
    outline: none;
    border-color: #22d3ee;
}

.custom-server-access-submit {
    min-height: 38px;
    padding: 0 0.78rem;
    border: 1px solid rgba(45, 212, 191, 0.52);
    border-radius: 6px;
    background: rgba(20, 184, 166, 0.18);
    color: #ccfbf1;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
}

.custom-server-access-submit:hover:not(:disabled) {
    border-color: rgba(103, 232, 249, 0.76);
}

.custom-server-access-submit:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.custom-server-access-status {
    min-height: 1.05rem;
    margin: 0.52rem 0 0;
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.35;
}

.custom-server-access-status.is-error {
    color: #fecaca;
}

.custom-server-access-status.is-ok {
    color: #bbf7d0;
}

.custom-server-create {
    padding-top: 0.72rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.custom-server-created-key {
    margin: 0.68rem 0;
    padding: 0.58rem 0.66rem;
    border: 1px solid rgba(250, 204, 21, 0.48);
    border-radius: 6px;
    background: rgba(113, 63, 18, 0.28);
    color: #fef3c7;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.custom-server-created-key[hidden] {
    display: none !important;
}

.custom-server-select {
    width: 100%;
    min-height: 38px;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.9rem;
}

.custom-server-select:focus {
    outline: none;
    border-color: #22d3ee;
}

.custom-server-room-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.72rem;
    align-items: center;
    margin-top: 0.62rem;
    padding: 0.62rem 0.68rem;
    border: 1px solid rgba(250, 204, 21, 0.38);
    border-radius: 6px;
    background: rgba(113, 63, 18, 0.18);
}

.custom-server-room-link[hidden] {
    display: none !important;
}

.custom-server-room-link.is-linked {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(20, 83, 45, 0.18);
}

.custom-server-room-link-main {
    min-width: 0;
}

.custom-server-room-link-kicker {
    display: block;
    margin-bottom: 0.14rem;
    color: #fde68a;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.custom-server-room-link.is-linked .custom-server-room-link-kicker {
    color: #86efac;
}

.custom-server-room-link strong {
    display: block;
    color: #f8fafc;
    font-size: 0.78rem;
    line-height: 1.25;
}

.custom-server-room-link p {
    margin: 0.2rem 0 0;
    color: #cbd5e1;
    font-size: 0.72rem;
    line-height: 1.35;
}

.custom-server-room-link button {
    min-height: 32px;
    padding: 0 0.62rem;
    border: 1px solid rgba(250, 204, 21, 0.46);
    border-radius: 6px;
    background: rgba(113, 63, 18, 0.24);
    color: #fef3c7;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.custom-server-room-link.is-linked button {
    border-color: rgba(74, 222, 128, 0.48);
    background: rgba(22, 101, 52, 0.22);
    color: #dcfce7;
}

.custom-server-room-link button:hover:not(:disabled) {
    border-color: rgba(103, 232, 249, 0.74);
}

.custom-server-room-link button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.custom-server-open-designer {
    width: 100%;
    min-height: 34px;
    margin-top: 0.58rem;
    border: 1px solid rgba(250, 204, 21, 0.36);
    border-radius: 6px;
    background: rgba(113, 63, 18, 0.26);
    color: #fef3c7;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 850;
}

.custom-server-open-designer:hover:not(:disabled) {
    border-color: rgba(250, 204, 21, 0.68);
}

.custom-server-open-designer:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.custom-server-summary,
.custom-server-status {
    margin: 0.7rem 0 0;
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.4;
}

.custom-server-status {
    color: #94a3b8;
}

.custom-server-zone-popup strong,
.custom-server-location-source {
    color: #67e8f9;
}

.custom-server-location-div-icon {
    background: transparent;
    border: 0;
}

.custom-server-location-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 3px solid rgba(248, 250, 252, 0.94);
    border-radius: 12px 12px 12px 3px;
    background: var(--custom-server-location-color, #22d3ee);
    color: #020617;
    box-shadow: 0 0 0 2px rgba(2, 6, 12, 0.9), 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 18px var(--custom-server-location-color, #22d3ee);
    font-size: 0.9rem;
    font-weight: 1000;
    line-height: 1;
    overflow: hidden;
    transform: rotate(-45deg);
}

.custom-server-location-icon span,
.custom-server-location-icon img {
    transform: rotate(45deg);
}

.custom-server-location-icon img {
    width: 35px;
    height: 35px;
    border-radius: 9px;
    object-fit: cover;
}

body.custom-server-active::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 4000;
    pointer-events: none;
    border: 5px solid rgba(34, 211, 238, 0.92);
    box-shadow:
        inset 0 0 0 1px rgba(248, 250, 252, 0.38),
        inset 0 0 32px rgba(34, 211, 238, 0.35),
        0 0 24px rgba(34, 211, 238, 0.35);
}

body.custom-server-active::after {
    content: "CUSTOM SERVER";
    position: fixed;
    top: 0.45rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4001;
    pointer-events: none;
    padding: 0.28rem 0.58rem;
    border: 1px solid rgba(103, 232, 249, 0.62);
    border-radius: 6px;
    background: rgba(8, 18, 24, 0.9);
    color: #cffafe;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

body.custom-server-designer-active::after {
    content: "CUSTOM SERVER DESIGNER";
    border-color: rgba(250, 204, 21, 0.72);
    color: #fef3c7;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(250, 204, 21, 0.22);
}

body.custom-server-faction-designer-active::after {
    content: "FACTION MAP DRAFT";
    border-color: rgba(168, 85, 247, 0.72);
    color: #f5d0fe;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(168, 85, 247, 0.22);
}

body.custom-server-preview-active::after {
    content: "CUSTOM SERVER PREVIEW";
    border-color: rgba(74, 222, 128, 0.72);
    color: #dcfce7;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(74, 222, 128, 0.2);
}

body.custom-server-editing .leaflet-container {
    cursor: crosshair !important;
}

.custom-server-editor {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.custom-server-designer-sidebar {
    position: fixed;
    top: 4.8rem;
    right: 1rem;
    z-index: 1660;
    width: min(860px, calc(100vw - 2rem));
    height: min(760px, calc(100vh - 6rem - var(--legal-bar-height)));
    margin: 0;
    padding: 0;
    border: 1px solid rgba(250, 204, 21, 0.34);
    border-radius: 8px;
    background: rgba(7, 12, 18, 0.95);
    color: #ecfeff;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(34, 211, 238, 0.12);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}

.custom-server-designer-sidebar.is-collapsed {
    width: min(380px, calc(100vw - 2rem));
    height: auto;
    max-height: none;
    overflow: hidden;
}

.custom-server-designer-sidebar.is-collapsed .custom-server-editor-body {
    display: none !important;
}

.custom-server-designer-sidebar.is-collapsed .custom-server-designer-subtitle {
    display: none;
}

.custom-server-editor[hidden] {
    display: none !important;
}

.custom-server-editor-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.78rem 0.82rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(7, 12, 18, 0.98);
}

.custom-server-designer-sidebar.is-collapsed .custom-server-editor-head {
    border-bottom: 0;
}

.custom-server-editor-head > div:first-child {
    min-width: 0;
}

.custom-server-editor-head-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.custom-server-editor h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.9rem;
}

.custom-server-designer-subtitle {
    margin: 0.18rem 0 0;
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.3;
}

.custom-server-save-state {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.custom-server-save-state.saving {
    color: #facc15;
}

.custom-server-save-state.saved {
    color: #86efac;
}

.custom-server-save-state.error {
    color: #fca5a5;
}

.custom-server-submit-map {
    min-height: 32px;
    border: 1px solid rgba(74, 222, 128, 0.55);
    border-radius: 6px;
    background: rgba(22, 101, 52, 0.28);
    color: #dcfce7;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 850;
    white-space: nowrap;
}

.custom-server-submit-map[hidden] {
    display: none !important;
}

.custom-server-submit-map:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.custom-server-submit-map.is-submitted {
    border-color: rgba(74, 222, 128, 0.74);
    background: rgba(22, 101, 52, 0.42);
    color: #bbf7d0;
    opacity: 1;
    cursor: default;
}

.custom-server-submit-map:not(:disabled):hover {
    border-color: #86efac;
}

.custom-server-collapse-designer,
.custom-server-close-designer {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
}

.custom-server-close-designer {
    color: #fecaca;
}

.custom-server-collapse-designer:hover,
.custom-server-collapse-designer:focus-visible,
.custom-server-close-designer:hover,
.custom-server-close-designer:focus-visible {
    border-color: #22d3ee;
    color: #cffafe;
    outline: none;
}

.custom-server-close-designer:hover,
.custom-server-close-designer:focus-visible {
    border-color: rgba(248, 113, 113, 0.72);
    color: #fee2e2;
}

.custom-server-collapse-designer[hidden],
.custom-server-close-designer[hidden] {
    display: none !important;
}

.custom-server-editor-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.75rem;
}

.custom-server-workbench {
    display: grid;
    grid-template-columns: minmax(270px, 0.82fr) minmax(430px, 1.18fr);
    align-items: start;
    gap: 0.75rem;
    min-width: 0;
}

.custom-server-workbench-left {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.custom-server-canvas {
    min-width: 0;
    padding: 0.68rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 7px;
    background: rgba(2, 6, 12, 0.38);
}

.custom-server-scope-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.custom-server-scope-title {
    flex: 0 0 auto;
    color: #a5f3fc;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.custom-server-scope-row button {
    flex: 0 0 auto;
    min-height: 30px;
    border: 1px solid rgba(103, 232, 249, 0.38);
    border-radius: 6px;
    background: rgba(8, 47, 73, 0.34);
    color: #cffafe;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 850;
}

.custom-server-scope-row button[hidden] {
    display: none !important;
}

.custom-server-scope-row span {
    min-width: 0;
    color: #cbd5e1;
    font-size: 0.72rem;
    line-height: 1.25;
}

.custom-server-scope-row .custom-server-scope-title {
    color: #a5f3fc;
}

.custom-server-tool-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
}

.custom-server-tool-btn {
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #dbeafe;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
}

.custom-server-tool-btn:hover {
    border-color: #22d3ee;
}

.custom-server-tool-btn.active {
    background: rgba(34, 211, 238, 0.18);
    border-color: #22d3ee;
    color: #cffafe;
}

.custom-server-tool-btn:disabled,
.custom-server-history-actions button:disabled,
.custom-server-editor-actions button:disabled,
.custom-server-selection-actions button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.custom-server-history-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.custom-server-history-actions button,
.custom-server-selection-actions button {
    min-height: 32px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
}

.custom-server-history-actions button:not(:disabled):hover,
.custom-server-selection-actions button:not(:disabled):hover {
    border-color: #22d3ee;
}

.custom-server-history-actions button.is-active {
    border-color: rgba(74, 222, 128, 0.72);
    background: rgba(74, 222, 128, 0.14);
    color: #bbf7d0;
}

.custom-server-preview-bar {
    position: fixed;
    top: 4.8rem;
    right: 1rem;
    z-index: 1660;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: min(430px, calc(100vw - 2rem));
    padding: 0.6rem 0.68rem;
    border: 1px solid rgba(74, 222, 128, 0.42);
    border-radius: 8px;
    background: rgba(7, 12, 18, 0.94);
    color: #ecfeff;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(74, 222, 128, 0.12);
    backdrop-filter: blur(14px);
}

.custom-server-preview-bar[hidden] {
    display: none !important;
}

.custom-server-preview-bar span {
    min-width: 0;
    overflow: hidden;
    color: #bbf7d0;
    font-size: 0.74rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-server-preview-bar button {
    flex: 0 0 auto;
    min-height: 32px;
    border: 1px solid rgba(74, 222, 128, 0.55);
    border-radius: 6px;
    background: rgba(22, 101, 52, 0.28);
    color: #dcfce7;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 850;
}

.custom-server-preview-bar button:hover {
    border-color: #86efac;
}

.custom-server-layer-browser,
.custom-server-inspector,
.custom-server-submissions {
    margin: 0;
}

.custom-server-submissions[hidden] {
    display: none !important;
}

.custom-server-submissions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.custom-server-submission-meta {
    margin-top: 0.12rem;
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.25;
}

.custom-server-submissions-head button,
.custom-server-submission-actions button {
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 800;
}

.custom-server-submission-list {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    max-height: min(260px, 28vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.12rem;
}

.custom-server-submission-group-title {
    padding: 0.24rem 0.1rem 0;
    color: #fde68a;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.custom-server-submission-group-title.is-reviewed {
    margin-top: 0.28rem;
    color: #94a3b8;
}

.custom-server-submission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.52);
}

.custom-server-submission-row.is-pending {
    border-color: rgba(250, 204, 21, 0.42);
}

.custom-server-submission-row.is-approved {
    border-color: rgba(74, 222, 128, 0.34);
}

.custom-server-submission-row.is-rejected {
    border-color: rgba(248, 113, 113, 0.3);
}

.custom-server-submission-main {
    min-width: 0;
    flex: 1 1 auto;
}

.custom-server-submission-main strong {
    display: block;
    color: #f8fafc;
    font-size: 0.76rem;
}

.custom-server-submission-main span {
    display: block;
    margin-top: 0.12rem;
    color: #94a3b8;
    font-size: 0.68rem;
    line-height: 1.25;
}

.custom-server-submission-objects {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin-top: 0.45rem;
}

.custom-server-submission-object {
    width: 100%;
    min-height: 32px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 0.42rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    background: rgba(2, 6, 12, 0.32);
    color: #e2e8f0;
    cursor: pointer;
    padding: 0.34rem 0.42rem;
    text-align: left;
}

.custom-server-submission-object-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.78);
    color: #cffafe;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
    overflow: hidden;
}

.custom-server-submission-object-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-server-submission-object-icon.is-empty {
    opacity: 0.42;
}

.custom-server-submission-object:hover,
.custom-server-submission-object.is-selected {
    border-color: rgba(251, 146, 60, 0.82);
    background: rgba(251, 146, 60, 0.14);
}

.custom-server-submission-object-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.12rem;
}

.custom-server-submission-object-label,
.custom-server-submission-object-meta {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-server-submission-object-label {
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 850;
}

.custom-server-submission-object-meta {
    color: #fed7aa;
    font-size: 0.64rem;
    font-style: normal;
    font-weight: 800;
}

.custom-server-submission-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.32rem;
}

.custom-server-submission-actions button[data-custom-server-review="approve"] {
    border-color: rgba(74, 222, 128, 0.45);
    color: #bbf7d0;
}

.custom-server-submission-actions button[data-custom-server-review="reject"] {
    border-color: rgba(248, 113, 113, 0.42);
    color: #fecaca;
}

.custom-server-submission-actions button[data-custom-server-review="delete"] {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.custom-server-section-title,
.custom-server-inspector-kind {
    margin-bottom: 0.34rem;
    color: #a5f3fc;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#custom-server-layer-filter {
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    padding: 0.38rem 0.5rem;
    font-size: 0.78rem;
}

.custom-server-layer-list {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    max-height: min(300px, 32vh);
    margin-top: 0.55rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.12rem;
}

.custom-server-layer-section {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.custom-server-layer-section-title {
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.custom-server-layer-row {
    width: 100%;
    min-height: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.66);
    color: #e2e8f0;
    padding: 0.38rem 0.46rem;
    text-align: left;
    cursor: pointer;
}

.custom-server-layer-row:hover,
.custom-server-layer-row.is-selected {
    border-color: rgba(34, 211, 238, 0.78);
    background: rgba(34, 211, 238, 0.12);
}

.custom-server-layer-row span,
.custom-server-layer-row em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-server-layer-row span {
    font-size: 0.78rem;
    font-weight: 850;
}

.custom-server-layer-row em {
    color: #94a3b8;
    font-size: 0.68rem;
    font-style: normal;
}

.custom-server-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.35;
}

.custom-server-inspector-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.custom-server-inspector h4 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.94rem;
    line-height: 1.2;
}

.custom-server-selected-coords {
    flex: 0 0 auto;
    color: #facc15;
    font-size: 0.72rem;
    font-weight: 900;
}

.custom-server-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.custom-server-field-grid label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
    color: #a5f3fc;
    font-size: 0.68rem;
    font-weight: 800;
}

.custom-server-field-grid input,
.custom-server-field-grid select,
.custom-server-field-grid textarea {
    min-width: 0;
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    padding: 0.38rem 0.45rem;
}

.custom-server-field-grid textarea {
    min-height: 68px;
    resize: vertical;
    line-height: 1.35;
}

.custom-server-wide-field {
    grid-column: 1 / -1;
}

.custom-server-field-main {
    grid-column: 1 / -1;
}

.custom-server-image-field input[type="file"] {
    min-height: 0;
    padding: 0.42rem;
    font-size: 0.68rem;
}

.custom-server-image-preview {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 0.45rem;
    border: 1px dashed rgba(148, 163, 184, 0.38);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.62);
    color: #cbd5e1;
    padding: 0.38rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
}

.custom-server-image-preview img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(226, 232, 240, 0.44);
}

.custom-server-field-grid input[type="color"] {
    padding: 0.14rem;
}

.custom-server-field-grid .custom-server-check-field {
    justify-content: space-between;
}

.custom-server-inline-check {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    padding: 0.38rem 0.5rem;
}

.custom-server-inline-check input {
    width: 16px;
    height: 16px;
    min-height: 0;
    flex: 0 0 auto;
    margin: 0;
    accent-color: #22d3ee;
}

.custom-server-inline-check span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-server-field-grid input:disabled,
.custom-server-field-grid select:disabled,
.custom-server-field-grid textarea:disabled {
    color: #64748b;
    opacity: 0.7;
}

.custom-server-field-grid option:disabled {
    color: #64748b;
}

.custom-server-field-hint {
    min-height: 1rem;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.25;
}

.custom-server-field-hint.is-warning {
    color: #fde68a;
}

.custom-server-selection-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.custom-server-editor-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.custom-server-editor-actions button {
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
}

.custom-server-editor-actions button:hover {
    border-color: #22d3ee;
}

.custom-server-editor-status {
    margin: 0;
    min-height: 1rem;
    color: #cbd5e1;
    font-size: 0.74rem;
    line-height: 1.35;
}

.custom-server-designer-icon {
    width: 20px;
    height: 20px;
    border: 0;
    background: transparent;
}

.custom-server-designer-icon span {
    display: block;
    width: 16px;
    height: 16px;
    margin: 2px;
    border: 2px solid #f8fafc;
    border-radius: 50%;
    background: var(--custom-server-designer-color, #22d3ee);
    box-shadow: 0 0 0 2px rgba(2, 6, 12, 0.88), 0 0 16px var(--custom-server-designer-color, #22d3ee);
}

.custom-server-designer-icon.official span {
    width: 14px;
    height: 14px;
    margin: 3px;
    border-color: rgba(248, 250, 252, 0.85);
    background: rgba(103, 232, 249, 0.82);
    box-shadow: 0 0 0 2px rgba(2, 6, 12, 0.86), 0 0 10px rgba(103, 232, 249, 0.54);
}

.custom-server-designer-icon.official.renamed span {
    background: var(--custom-server-designer-color, #facc15);
    box-shadow: 0 0 0 2px rgba(2, 6, 12, 0.86), 0 0 12px var(--custom-server-designer-color, rgba(250, 204, 21, 0.68));
}

.custom-server-designer-icon.official.hidden span {
    background: #f87171;
    box-shadow: 0 0 0 2px rgba(2, 6, 12, 0.86), 0 0 12px rgba(248, 113, 113, 0.68);
}

.custom-server-designer-icon.poi span {
    border-radius: 5px 5px 5px 0;
    transform: rotate(-45deg);
}

.custom-server-designer-icon.is-selected span {
    width: 20px;
    height: 20px;
    margin: 0;
    border-color: #facc15;
}

.custom-server-designer-icon.review span {
    border-color: #ffedd5;
    box-shadow: 0 0 0 3px rgba(2, 6, 12, 0.9), 0 0 0 6px rgba(251, 146, 60, 0.38), 0 0 22px rgba(251, 146, 60, 0.85);
}

.custom-server-review-highlight-shape {
    filter: drop-shadow(0 0 7px rgba(251, 146, 60, 0.75));
}

.custom-server-designer-handle {
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
}

.custom-server-designer-handle span {
    display: block;
    width: 18px;
    height: 18px;
    margin: 4px;
    border: 2px solid #0f172a;
    border-radius: 50%;
    background: #f8fafc;
    box-shadow: 0 0 0 3px #facc15, 0 0 18px rgba(250, 204, 21, 0.82);
}

.custom-server-designer-handle.radius span {
    background: #22d3ee;
}

.custom-server-designer-handle.center span {
    background: #facc15;
}

.custom-server-designer-tooltip {
    border: 1px solid rgba(34, 211, 238, 0.38);
    background: rgba(8, 18, 24, 0.92);
    color: #ecfeff;
    font-weight: 800;
}

@media (max-width: 900px) {
    .custom-server-designer-sidebar {
        top: auto;
        left: 0.6rem;
        right: 0.6rem;
        bottom: calc(var(--legal-bar-height) + 0.6rem);
        width: auto;
        height: min(68vh, 620px);
        max-height: none;
    }

    .custom-server-designer-sidebar.is-collapsed {
        width: auto;
        height: auto;
        max-height: none;
    }

    .custom-server-editor-head {
        align-items: flex-start;
    }

    .custom-server-workbench {
        grid-template-columns: 1fr;
    }

    .custom-server-layer-list,
    .custom-server-submission-list {
        max-height: 220px;
    }

    .custom-server-preview-bar {
        top: auto;
        left: 0.6rem;
        right: 0.6rem;
        bottom: calc(var(--legal-bar-height) + 0.6rem);
        width: auto;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .custom-server-editor-head {
        flex-direction: column;
    }

    .custom-server-editor-head-actions {
        width: 100%;
    }

    .custom-server-save-state {
        margin-right: auto;
    }

    .custom-server-tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .custom-server-field-grid,
    .custom-server-selection-actions,
    .custom-server-editor-actions {
        grid-template-columns: 1fr;
    }
}

body.custom-pin-dropping .leaflet-container,
body.custom-pin-pinging .leaflet-container {
    cursor: crosshair !important;
}

.base-map-mode-control {
    position: relative;
    display: inline-flex;
}

.base-map-mode-control[hidden] {
    display: none !important;
}

.base-map-mode-control:has(#map-style-select) {
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 7px;
    background: rgba(12, 18, 23, 0.94);
    border: 1px solid #3a424b;
    border-radius: 7px;
    color: #e8edf1;
}
.base-map-mode-control label { font-size: 11px; white-space: nowrap; color: #b9c4cc; }
#map-style-select {
    font: 600 12px Outfit, Arial, sans-serif;
    color: #f2f5f7;
    background: #111a22;
    border: 0;
    border-radius: 4px;
    min-height: 30px;
    width: 91px;
    cursor: pointer;
    color-scheme: dark;
}
#map-style-select:focus-visible { outline: 2px solid #38bdf8; outline-offset: 1px; }
#map-style-select option:disabled { color: #82909c; }
@media (min-width: 681px) {
    .base-map-mode-control:has(#map-style-select) {
        position: absolute;
        top: 44px;
        right: 0;
    }
}
@media (max-width: 700px) {
    .base-map-mode-control label { display: none; }
    .base-map-mode-control:has(#map-style-select) { padding: 0 4px; }
    #map-style-select { width: 82px; }
}

.base-map-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(6, 10, 12, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.82);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.base-map-mode-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(226, 232, 240, 0.72);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.62);
}

.base-map-mode-btn.active {
    border-color: rgba(125, 211, 252, 0.9);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.26), 0 4px 14px rgba(0, 0, 0, 0.58);
}

.base-map-mode-orb {
    position: relative;
    width: 29px;
    height: 29px;
    overflow: hidden;
    border: 2px solid #050708;
    border-radius: 50%;
    background: #1b271a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    pointer-events: none;
}

.base-map-mode-orb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(5, 7, 8, 0.76) 50%, transparent calc(50% + 0.5px)),
        radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.22), transparent 22%),
        radial-gradient(circle at 64% 72%, rgba(0, 0, 0, 0.22), transparent 34%);
}

.base-map-mode-orb-half {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    transition: filter 0.16s ease, opacity 0.16s ease;
}

.base-map-mode-orb-half.classic {
    left: 0;
    background:
        linear-gradient(28deg, transparent 43%, rgba(215, 208, 139, 0.7) 45%, transparent 48%),
        radial-gradient(circle at 34% 28%, #84904b 0 15%, transparent 16%),
        radial-gradient(circle at 62% 62%, #9da45f 0 22%, transparent 24%),
        radial-gradient(circle at 42% 76%, #394d27 0 24%, transparent 26%),
        linear-gradient(145deg, #586c35, #1d311e 64%, #6c7442);
}

.base-map-mode-orb-half.new {
    right: 0;
    background:
        linear-gradient(150deg, transparent 39%, rgba(188, 196, 168, 0.72) 42%, transparent 46%),
        radial-gradient(circle at 74% 30%, #9a9f68 0 19%, transparent 21%),
        radial-gradient(circle at 54% 70%, #38522f 0 26%, transparent 28%),
        radial-gradient(circle at 86% 78%, #b7b07a 0 17%, transparent 19%),
        linear-gradient(160deg, #8b9061, #4f6a35 58%, #263820);
}

.base-map-mode-btn:not(.active) .base-map-mode-orb-half.new,
.base-map-mode-btn.active .base-map-mode-orb-half.classic {
    filter: saturate(0.72) brightness(0.72);
    opacity: 0.78;
}

.footprints-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.footprints-btn:hover {
    background: var(--border);
    border-color: #deb887;
}

.footprints-btn:disabled,
.footprints-btn[aria-disabled="true"] {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.footprints-btn:disabled:hover,
.footprints-btn[aria-disabled="true"]:hover {
    background: var(--bg-panel);
    border-color: var(--border);
    transform: none;
}

.footprints-btn.active {
    background: rgba(205, 133, 63, 0.22);
    border-color: #deb887;
    color: #f7d7ad;
    box-shadow: 0 0 12px rgba(139, 69, 19, 0.48);
}

.footprints-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);
}

.streetview-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: block;
    background: #05080c;
    color: #f8fafc;
    overflow: hidden;
}

.streetview-modal-backdrop[hidden] {
    display: none !important;
}

.streetview-modal-backdrop::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24vmin;
    height: 24vmin;
    border: 2px solid rgba(74, 222, 128, 0.62);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
    pointer-events: none;
}

.streetview-modal-backdrop.is-entering::before {
    animation: streetviewDropRing 0.65s ease-out;
}

.streetview-modal {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #05080c;
    overflow: hidden;
}

.streetview-modal-backdrop.is-entering .streetview-modal {
    animation: streetviewDropIn 0.52s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes streetviewDropIn {
    from {
        transform: scale(0.82) translateY(-24px);
        opacity: 0.28;
        filter: blur(5px);
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes streetviewDropRing {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
    28% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4.8);
    }
}

.streetview-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem 1.2rem 4.2rem;
    background: linear-gradient(180deg, rgba(5, 8, 12, 0.92), rgba(5, 8, 12, 0.56) 52%, rgba(5, 8, 12, 0));
    pointer-events: none;
}

.streetview-location-readout {
    min-width: 0;
}

.streetview-location-label {
    display: block;
    margin: 0 0 0.12rem;
    color: #4ade80;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.streetview-modal-header h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.05rem, 1.35vw, 1.35rem);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.streetview-kicker {
    display: none;
}

.streetview-position-status {
    display: none;
}

.streetview-zoom-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    pointer-events: auto;
}

.streetview-zoom-btn {
    width: 38px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 4px;
    background: rgba(229, 57, 53, 0.95);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.streetview-zoom-btn:hover,
.streetview-zoom-btn:focus-visible {
    background: var(--accent-hover);
    border-color: #fff;
    outline: none;
}

.streetview-zoom-btn:disabled {
    opacity: 0.38;
    cursor: default;
}

.streetview-zoom-value {
    min-width: 44px;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.streetview-pin-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(251, 191, 36, 0.58);
    border-radius: 6px;
    background: rgba(5, 8, 12, 0.72);
    color: #fbbf24;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.streetview-pin-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: currentColor;
}

.streetview-pin-btn:hover,
.streetview-pin-btn:focus-visible {
    border-color: #fde68a;
    color: #fde68a;
    outline: none;
}

.streetview-pin-btn.is-active,
.streetview-pin-btn[aria-pressed="true"] {
    background: rgba(251, 191, 36, 0.18);
    border-color: #fbbf24;
    color: #fde68a;
}

.streetview-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(226, 232, 240, 0.35);
    border-radius: 6px;
    background: rgba(5, 8, 12, 0.72);
    color: #f8fafc;
    cursor: pointer;
    font-size: 1.1rem;
    pointer-events: auto;
}

.streetview-close:hover,
.streetview-close:focus-visible {
    border-color: #4ade80;
    color: #fff;
    outline: none;
}

.streetview-frame-shell {
    flex: 1;
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #05080c;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.streetview-frame-shell img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #05080c;
    transform: scale(var(--streetview-zoom, 1));
    transform-origin: 50% 50%;
    transition: transform 0.16s ease;
    will-change: transform;
    cursor: zoom-in;
}

.streetview-frame-shell img.is-zoomed {
    cursor: zoom-out;
}

.streetview-pin-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.streetview-image-pin {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -100%);
    color: var(--pin-color, #fbbf24);
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.8));
    pointer-events: auto;
    cursor: pointer;
}

.streetview-image-pin svg {
    width: 28px;
    height: 28px;
}

.streetview-frame-shell.custom-pin-dropping img {
    cursor: crosshair;
}

.streetview-frame-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.92rem;
    background: repeating-linear-gradient(45deg, #0f1720 0 12px, #111b25 12px 24px);
}

.streetview-frame-empty[hidden] {
    display: none !important;
}

.streetview-side-control,
.streetview-step-control {
    position: absolute;
    z-index: 6;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 4px;
    background: rgba(229, 57, 53, 0.95);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    transition: background 0.14s ease, border-color 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
}

.streetview-side-control {
    top: 50%;
    width: 62px;
    height: 112px;
    transform: translateY(-50%);
}

.streetview-side-left {
    left: 1rem;
}

.streetview-side-right {
    right: 1rem;
}

.streetview-side-control svg {
    width: 44px;
    height: 44px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
}

.streetview-step-control {
    left: 50%;
    right: auto;
    min-width: 126px;
    height: 44px;
    gap: 0.45rem;
    padding: 0 0.8rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    transform: translateX(-50%);
}

.streetview-step-prev {
    bottom: 1rem;
}

.streetview-step-next {
    top: 1rem;
}

.streetview-step-control svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
}

.streetview-step-prev svg,
.streetview-step-next svg {
    transform: rotate(-90deg);
}

.streetview-side-control:hover,
.streetview-side-control:focus-visible,
.streetview-step-control:hover,
.streetview-step-control:focus-visible {
    background: var(--accent-hover);
    border-color: #fff;
    outline: none;
}

.streetview-side-control:active,
.streetview-step-control:active,
.streetview-zoom-btn:active {
    filter: brightness(1.1);
}

.streetview-step-control:disabled,
.streetview-zoom-btn:disabled {
    opacity: 0.34;
    cursor: default;
}

.streetview-frame-buttons {
    display: none;
}

@media (max-width: 720px) {
    .streetview-modal-header {
        padding: 0.75rem 0.85rem 3.5rem;
    }

    .streetview-zoom-controls {
        gap: 0.25rem;
    }

    .streetview-zoom-btn {
        width: 34px;
        height: 34px;
    }

    .streetview-zoom-value {
        min-width: 38px;
        font-size: 0.8rem;
    }

    .streetview-side-control {
        width: 48px;
        height: 86px;
    }

    .streetview-side-left {
        left: 0.5rem;
    }

    .streetview-side-right {
        right: 0.5rem;
    }

    .streetview-step-control {
        bottom: 0.75rem;
        min-width: 96px;
        height: 38px;
        font-size: 0.72rem;
    }

    .streetview-step-next {
        top: 5.25rem;
        bottom: auto;
    }
}

.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;
}

.site-about-guide {
    padding-top: 1rem;
}

.site-guide-launch {
    width: 100%;
    min-height: 66px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 0.18rem;
    padding: 0.92rem 1rem;
    border: 1px solid rgba(74, 222, 128, 0.46);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(74, 222, 128, 0.14), rgba(56, 189, 248, 0.1)),
        rgba(9, 13, 18, 0.9);
    color: #f8fafc;
    font: inherit;
    font-size: 1rem;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.site-guide-launch:hover,
.site-guide-launch:focus-visible {
    border-color: rgba(255, 216, 77, 0.92);
    background:
        linear-gradient(135deg, rgba(74, 222, 128, 0.18), rgba(255, 216, 77, 0.13)),
        rgba(12, 18, 24, 0.94);
    outline: none;
    transform: translateY(-1px);
}

.site-guide-launch-kicker {
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.first-time-guide[hidden] {
    display: none !important;
}

.first-time-guide {
    position: fixed;
    inset: 0;
    z-index: 12000;
    overflow: hidden;
    color: #f8fafc;
    pointer-events: auto;
}

.first-time-guide-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 7, 12, 0.18), rgba(3, 7, 12, 0.32)),
        rgba(2, 5, 9, 0.18);
    backdrop-filter: none;
}

.first-time-guide::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

body.first-time-guide-active,
body.first-time-guide-active .leaflet-container {
    cursor: default !important;
}

.first-time-guide-arrows,
.first-time-guide-targets,
.first-time-guide-callouts {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.first-time-guide-arrows {
    z-index: 2;
    overflow: visible;
}

.first-time-guide-marker {
    position: absolute;
    z-index: 3;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(7, 16, 24, 0.72);
    border-radius: 50%;
    background: var(--guide-accent, #4ade80);
    color: #071018;
    font-size: 0.82rem;
    font-weight: 950;
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--guide-accent, #4ade80) 36%, transparent),
        0 8px 20px rgba(0, 0, 0, 0.38);
}

.first-time-guide-arrow-line {
    fill: none;
    stroke: rgba(255, 216, 77, 0.92);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px rgba(255, 216, 77, 0.42));
}

.first-time-guide-callout {
    position: absolute;
    width: max-content;
    min-width: 150px;
    max-width: min(230px, calc(100vw - 32px));
    min-height: 50px;
    padding: 0.58rem 0.68rem;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-top: 3px solid var(--guide-accent, #4ade80);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(17, 24, 34, 0.96), rgba(8, 13, 20, 0.94));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), 0 0 24px rgba(56, 189, 248, 0.08);
    transform: none;
    opacity: 1;
}

.first-time-guide-callout-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0;
}

.first-time-guide-index {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--guide-accent, #4ade80);
    color: #071018;
    font-size: 0.76rem;
    font-weight: 950;
    box-shadow: 0 0 16px color-mix(in srgb, var(--guide-accent, #4ade80) 44%, transparent);
}

.first-time-guide-callout h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.96rem;
    font-weight: 850;
    line-height: 1.15;
}

.first-time-guide-callout p {
    display: none;
    margin: 0;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.82rem;
    line-height: 1.36;
}

.first-time-guide-legend {
    position: absolute;
    left: 18px;
    top: 126px;
    bottom: calc(var(--legal-bar-height) + 132px);
    z-index: 3;
    width: min(360px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(10, 16, 25, 0.96), rgba(5, 10, 17, 0.94));
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.56);
    pointer-events: none;
}

.first-time-guide-legend-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.08rem;
    font-weight: 900;
}

.first-time-guide-legend-list {
    min-height: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.62rem;
    overflow: auto;
    list-style: none;
}

.first-time-guide-legend-list li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 0.58rem;
}

.first-time-guide-legend-list strong,
.first-time-guide-legend-list em {
    display: block;
}

.first-time-guide-legend-list strong {
    color: #f8fafc;
    font-size: 0.84rem;
    line-height: 1.15;
}

.first-time-guide-legend-list em {
    margin-top: 0.12rem;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.76rem;
    font-style: normal;
    line-height: 1.28;
}

.first-time-guide-command {
    position: absolute;
    left: 50%;
    bottom: calc(var(--legal-bar-height) + 18px);
    z-index: 4;
    width: min(720px, calc(100vw - 32px));
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(7, 11, 18, 0.92);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.58);
    transform: translateX(-50%);
    pointer-events: auto;
}

.first-time-guide-kicker {
    margin: 0 0 0.18rem;
    color: #38bdf8;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.first-time-guide-command h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.18rem;
    font-weight: 900;
}

.first-time-guide-command p:not(.first-time-guide-kicker) {
    margin: 0.32rem 0 0;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.86rem;
    line-height: 1.35;
}

.first-time-guide-close {
    flex: 0 0 auto;
    min-width: 112px;
    height: 42px;
    border: 1px solid rgba(255, 216, 77, 0.72);
    border-radius: 7px;
    background: rgba(255, 216, 77, 0.14);
    color: #fff6c9;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 850;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.first-time-guide-close:hover,
.first-time-guide-close:focus-visible {
    background: rgba(229, 57, 53, 0.82);
    border-color: rgba(255, 255, 255, 0.72);
    color: #fff;
    outline: none;
}

@media (max-width: 1100px) {
    .first-time-guide-callout {
        width: max-content;
        min-width: 128px;
        max-width: min(190px, calc(100vw - 24px));
        min-height: 54px;
        padding: 0.58rem 0.64rem;
    }

    .first-time-guide-callout p {
        display: none;
    }

    .first-time-guide-callout-head {
        gap: 0.44rem;
        margin-bottom: 0;
    }

    .first-time-guide-index {
        width: 25px;
        height: 25px;
        font-size: 0.72rem;
    }

    .first-time-guide-callout h3 {
        font-size: 0.86rem;
    }
}

@media (max-width: 900px) {
    .first-time-guide-legend {
        top: 112px;
        bottom: calc(var(--legal-bar-height) + 92px);
        width: min(310px, calc(100vw - 24px));
        padding: 0.72rem;
    }

    .first-time-guide-legend-list {
        gap: 0.48rem;
    }

    .first-time-guide-legend-list em {
        display: none;
    }

    .first-time-guide-marker {
        width: 26px;
        height: 26px;
        font-size: 0.72rem;
    }

    .first-time-guide-callout {
        width: max-content;
        min-width: 120px;
        max-width: min(170px, calc(100vw - 24px));
        min-height: 52px;
        padding: 0.58rem 0.62rem;
    }

    .first-time-guide-callout p {
        display: none;
    }

    .first-time-guide-callout-head {
        gap: 0.42rem;
        margin-bottom: 0;
    }

    .first-time-guide-index {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .first-time-guide-callout h3 {
        font-size: 0.82rem;
    }

    .first-time-guide-command {
        min-height: 72px;
        padding: 0.72rem 0.82rem;
        bottom: calc(var(--legal-bar-height) + 8px);
    }

    .first-time-guide-command p:not(.first-time-guide-kicker) {
        display: none;
    }

    .first-time-guide-close {
        min-width: 104px;
        height: 38px;
    }
}

@media (max-width: 620px) {
    .first-time-guide-legend {
        left: 10px;
        top: 108px;
        width: min(250px, calc(100vw - 20px));
    }

    .first-time-guide-callout {
        width: max-content;
        min-width: 116px;
        max-width: min(188px, calc(100vw - 18px));
    }

    .first-time-guide-callout p {
        display: none;
    }

    .first-time-guide-command h2 {
        font-size: 1rem;
    }
}

.update-tracker-modal {
    width: min(1040px, calc(100vw - 32px));
    max-width: 1040px;
    overflow: hidden;
    contain: layout paint;
    isolation: isolate;
}

#tracker-modal {
    background: rgba(3, 7, 10, 0.94);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.tracker-modal-header {
    border-bottom-color: rgba(74, 222, 128, 0.22);
    background: #111820;
}

.tracker-eyebrow {
    margin: 0 0 0.2rem;
    color: #4ade80;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tracker-modal-body {
    padding: 0;
    background: #0b1016;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.tracker-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f151c;
}

.tracker-summary h3 {
    margin: 0 0 0.25rem;
    color: var(--text-main);
    font-size: 1rem;
}

.tracker-summary p {
    margin: 0;
    max-width: 590px;
    color: rgba(230, 237, 243, 0.78);
    line-height: 1.45;
}

.tracker-summary-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(104px, 1fr));
    gap: 0.5rem;
    min-width: 238px;
}

.tracker-summary-stats span {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: #171d24;
    color: rgba(230, 237, 243, 0.7);
    font-size: 0.74rem;
    text-align: center;
}

.tracker-summary-stats strong {
    color: #ffd84d;
    font-size: 1.25rem;
    line-height: 1;
}

.tracker-release-list {
    position: relative;
    display: grid;
    gap: 0;
    padding: 0.35rem 1.15rem 1.15rem;
}

.tracker-release-list::before {
    content: "";
    position: absolute;
    top: 1.4rem;
    bottom: 1.6rem;
    left: 114px;
    width: 1px;
    background: rgba(74, 222, 128, 0.28);
}

.tracker-release {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 1.4rem;
    padding: 0.8rem 0;
}

.tracker-release::before {
    content: "";
    position: absolute;
    top: 1.7rem;
    left: 92px;
    width: 9px;
    height: 9px;
    border: 3px solid #0b1016;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.46);
    z-index: 1;
}

.tracker-release-date {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.35rem;
}

.tracker-release-date time {
    color: #ffd84d;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: right;
}

.tracker-release-date time span {
    display: block;
    color: rgba(230, 237, 243, 0.52);
    font-size: 0.7rem;
    font-weight: 700;
}

.tracker-release-panel {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 3px solid #4ade80;
    border-radius: 6px;
    background: #141a21;
}

.tracker-release-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.65rem;
}

.tracker-release-head h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.3;
}

.tracker-release-tag {
    flex: 0 0 auto;
    padding: 0.22rem 0.46rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.08);
    color: #7dd3fc;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.tracker-release-panel ul {
    display: grid;
    gap: 0.48rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tracker-release-panel li {
    position: relative;
    padding-left: 0.9rem;
    color: rgba(230, 237, 243, 0.78);
    font-size: 0.84rem;
    line-height: 1.45;
}

.tracker-release-panel li::before {
    content: "";
    position: absolute;
    top: 0.58em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffd84d;
}

.tracker-release-panel strong {
    color: #f4f7fa;
}

@media (max-width: 920px) {
    .tracker-summary {
        flex-direction: column;
    }

    .tracker-summary-stats {
        min-width: 0;
    }
}

@media (max-width: 620px) {
    .update-tracker-modal {
        width: calc(100vw - 20px);
    }

    .tracker-modal-body {
        padding: 0;
    }

    .tracker-summary-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tracker-release-list {
        padding: 0.35rem 0.75rem 0.85rem;
    }

    .tracker-release-list::before {
        left: 11px;
    }

    .tracker-release {
        grid-template-columns: 1fr;
        gap: 0.45rem;
        padding: 0.75rem 0 0.75rem 1rem;
    }

    .tracker-release::before {
        top: 1.25rem;
        left: 6px;
    }

    .tracker-release-date {
        justify-content: flex-start;
        padding: 0;
    }

    .tracker-release-date time {
        text-align: left;
    }

    .tracker-release-date time span {
        display: inline;
        margin-left: 0.25rem;
    }

    .tracker-release-head {
        display: grid;
        gap: 0.45rem;
    }

    .tracker-release-tag {
        justify-self: start;
    }

    .tracker-release-panel {
        padding: 0.8rem;
    }
}

/* 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;
}
.infected-spawn-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 4px 10px;
    color: #cbd5e1;
    font-size: 0.72rem;
}
.infected-spawn-legend > span::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
}
.infected-legend-static::before { background: #ef4444; color: #ef4444; }
.infected-legend-dynamic::before { background: #32CD32; color: #32CD32; }
.infected-legend-mixed::before { background: #f59e0b; color: #f59e0b; }
.infected-legend-unverified::before { color: #94a3b8; border-style: dashed !important; }
.infected-spawn-legend small { flex-basis: 100%; line-height: 1.5; color: #94a3b8; }
.infected-spawn-disabled { opacity: 0.55; }
.infected-spawn-disabled, .infected-spawn-disabled label { cursor: not-allowed !important; }
.infected-spawn-note { display: inline-block; margin: 7px 0 0; color: #aebed0; font-size: 0.8rem; line-height: 1.45; }
