/* =============================================================================
   Medivia mapper — design tokens (edit here for global UI tweaks)
   ============================================================================= */
:root {
    --font-sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;

    /* Typography scale */
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 15px;
    --fs-xl: 16px;
    --fs-2xl: clamp(1.25rem, 2.5vw, 1.75rem);
    --fs-zone-title: xx-large;

    /* Surfaces & backgrounds (map chrome — neutral, accent is not a fill) */
    --ui-bg: rgba(0, 0, 0, 0.72);
    --ui-panel: rgba(24, 26, 30, 0.92);
    --ui-panel-solid: rgba(20, 22, 26, 0.96);
    --ui-panel-elevated: rgba(32, 34, 40, 0.96);
    --ui-surface-inset: rgba(0, 0, 0, 0.35);
    --ui-overlay-dark: rgba(0, 0, 0, 0.88);

    /* Zone panel (left) — gray-first; accent only for highlights */
    --zone-bg: #1c1e22;
    --zone-bg-raised: #25282e;
    --zone-bg-inset: #1f2126;
    --zone-border: rgba(255, 255, 255, 0.1);
    --zone-border-faint: rgba(255, 255, 255, 0.06);
    --zone-table-head: #2f3239;
    --zone-text-muted: #b4b9c2;
    --zone-row-hover: rgba(255, 255, 255, 0.05);
    --zone-row-selected: rgba(255, 255, 255, 0.07);

    /* Borders & outlines (global UI — subtle neutral + green hint) */
    --ui-border: rgba(255, 255, 255, 0.12);
    --ui-border-accent: rgba(120, 224, 143, 0.35);
    --ui-border-subtle: rgba(255, 255, 255, 0.06);
    --ui-ring-focus: rgba(141, 255, 179, 0.45);

    /* Brand / text */
    --ui-accent: #8dffb3;
    --ui-accent-strong: #5fd68a;
    --ui-text: #f4fbf7;
    --ui-text-2: #b9e3c9;
    --ui-muted: #9dc4ae;
    --ui-success: #3dab66;
    --ui-gold: #e8c547;
    --ui-gold-bright: #ffe566;
    --ui-exp-blue: #7ec8ff;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Layout */
    --right-rail-w: 300px;
    --panel-pad-x: 20px;
    --panel-pad-y: 16px;
    --z-map-ui: 1001;
    --z-side-panel: 1100;
    --z-zone-panel: 1200;
    --z-toast: 10000;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =============================================================================
   Base
   ============================================================================= */
html,
body {
    height: 100%;
    margin: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   Leaflet & map shell
   ============================================================================= */
.leaflet-container {
    height: 100%;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    color: var(--ui-text) !important;
}

/* Marker popups: Leaflet defaults to white wrapper + tip — match map / panel chrome */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--ui-panel-elevated);
    color: var(--ui-text);
    box-shadow: var(--shadow-md);
}

.leaflet-popup-content-wrapper {
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    padding: 0;
}

.leaflet-popup-tip {
    border: none;
    box-shadow: none;
}

.leaflet-popup-content {
    margin: 8px 28px 8px 10px;
    line-height: 1.35;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--ui-muted);
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 28px;
    padding: 0;
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
    color: var(--ui-text);
}

.leaflet-control-mouseposition {
    color: var(--ui-text) !important;
    left: 12px !important;
    bottom: 12px !important;
}

.slider-pips {
    height: 600px;
    margin-top: 0 !important;
    margin-left: 18px !important;
}

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

.leaflet-bar a,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    font-size: 22px !important;
}

.leaflet-top,
.leaflet-bottom {
    filter: drop-shadow(var(--shadow-sm));
}

.leaflet-control {
    background: var(--ui-panel) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 4px !important;
}

.leaflet-bar a,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-bar a:hover,
.leaflet-bar a:focus,
.leaflet-bar a.leaflet-disabled {
    background: var(--ui-panel);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm) !important;
    transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.leaflet-top.leaflet-left {
    left: 10px !important;
}

.mainContainer {
    display: flex;
    width: 100%;
    height: 100%;
}

.right-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--right-rail-w);
    height: 100%;
    background: var(--ui-bg);
    pointer-events: none;
}

.right-panel > * {
    pointer-events: auto;
}

.hidden {
    display: none;
}

/* Performance indicator */
.performance-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--ui-panel);
    color: var(--ui-text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    border: 1px solid var(--ui-border);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-map-ui);
}

/* =============================================================================
   Toast notification
   ============================================================================= */
.notification {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--ui-panel-elevated);
    color: var(--ui-text);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--ui-border);
    z-index: var(--z-toast);
    font-size: var(--fs-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
    pointer-events: none;
}

.notification.show {
    opacity: 1;
}

.cluster-tooltip,
.leaflet-tooltip {
    background: var(--ui-panel);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.cluster-tooltip {
    padding: 8px;
    font-size: var(--fs-sm);
    max-width: 200px;
}

.cluster-tooltip::before {
    border-top-color: var(--ui-panel);
}

/* =============================================================================
   Search
   ============================================================================= */
.search-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: var(--z-toast);
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-md);
    min-width: 300px;
    max-width: 380px;
}

.search-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-md);
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    color: var(--ui-text);
    transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.search-input::placeholder {
    color: var(--ui-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 2px var(--ui-ring-focus);
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px solid var(--ui-border-subtle);
    padding-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--ui-border) transparent;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--ui-border);
    border-radius: 4px;
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: background 0.15s var(--ease-out);
    border: 1px solid transparent;
    color: var(--ui-text);
}

.search-result-item:hover {
    background: rgba(141, 255, 179, 0.08);
    border-color: var(--ui-border-subtle);
}

.search-result-item.selected {
    background: rgba(141, 255, 179, 0.16);
    border-color: var(--ui-border);
}

.search-result-name {
    font-weight: 600;
    font-size: var(--fs-md);
}

.search-result-count {
    font-size: var(--fs-sm);
    color: var(--ui-muted);
    margin-top: 2px;
}

.search-result-item.selected .search-result-count {
    color: var(--ui-text-2);
}

.no-results,
.search-loading {
    padding: 10px;
    text-align: center;
    color: var(--ui-muted);
    font-style: italic;
    font-size: var(--fs-sm);
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--ui-muted);
    transition: color 0.15s;
}

.search-clear:hover {
    color: var(--ui-text);
}

.search-input:disabled {
    background: rgba(0, 0, 0, 0.4);
    color: var(--ui-muted);
    cursor: not-allowed;
}

.search-container.disabled {
    opacity: 0.6;
    position: absolute;
}

.search-container.disabled .search-input {
    text-decoration: line-through;
}

.search-container.disabled::after {
    content: "Loading zones...";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ui-overlay-dark);
    color: var(--ui-text);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: var(--z-map-ui);
    margin-bottom: 5px;
}

.search-container.disabled::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ui-overlay-dark);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: var(--z-map-ui);
    margin-bottom: -5px;
}

.search-container.disabled:hover::after,
.search-container.disabled:hover::before {
    opacity: 1;
}

/* =============================================================================
   Right rail: shared “chip” style for toggles
   ============================================================================= */
.search-container,
.monster-toggle,
.ore-toggle,
.zone-toggle,
.zone-legend,
.zone-names-toggle,
.zone-exp-toggle,
.zone-boost-price-toggle,
.leaflet-control-layers {
    background: var(--ui-panel) !important;
    border: 1px solid var(--ui-border-accent) !important;
    border-radius: var(--radius-md) !important;
    color: var(--ui-text);
    box-shadow: var(--shadow-md);
}

.monster-toggle,
.ore-toggle,
.zone-toggle {
    position: absolute;
    right: 15px;
    z-index: var(--z-map-ui);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-md);
    max-width: 160px;
}

.monster-toggle {
    top: 80px;
    min-width: 120px;
}

.ore-toggle {
    top: 120px;
}

.zone-toggle {
    top: 160px;
}

.zone-names-toggle {
    position: absolute;
    top: 200px;
    right: 15px;
    z-index: var(--z-map-ui);
    padding: 8px 12px;
    min-width: 120px;
    max-width: 160px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-md);
}

.zone-exp-toggle {
    position: absolute;
    top: 240px;
    right: 15px;
    z-index: var(--z-map-ui);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-md);
}

.zone-boost-price-toggle {
    position: absolute;
    top: 293px;
    right: 15px;
    z-index: var(--z-map-ui);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-base);
    max-width: 220px;
}

.monster-toggle input,
.ore-toggle input,
.zone-toggle input,
.zone-names-toggle input,
.zone-exp-toggle input,
.zone-boost-price-toggle input {
    margin: 0;
    cursor: pointer;
    accent-color: var(--ui-accent-strong);
}

.monster-toggle label,
.ore-toggle label,
.zone-toggle label,
.zone-names-toggle label,
.zone-exp-toggle label,
.zone-boost-price-toggle label {
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.zone-names-toggle.disabled {
    opacity: 0.6;
    position: absolute;
}

.zone-names-toggle.disabled label {
    text-decoration: line-through;
    cursor: not-allowed;
    color: var(--ui-muted);
}

.zone-names-toggle.disabled input[type="checkbox"] {
    cursor: not-allowed;
    opacity: 0.5;
}

.zone-names-toggle.disabled::after {
    content: "Check Show Zones first";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ui-overlay-dark);
    color: var(--ui-text);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: var(--z-map-ui);
    margin-bottom: 5px;
}

.zone-names-toggle.disabled::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ui-overlay-dark);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: var(--z-map-ui);
    margin-bottom: -5px;
}

.zone-names-toggle.disabled:hover::after,
.zone-names-toggle.disabled:hover::before {
    opacity: 1;
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid var(--ui-accent-strong);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

.monster-toggle.loading,
.zone-toggle.loading {
    opacity: 0.7;
    pointer-events: none;
}

.leaflet-control-layers {
    display: none;
}

.leaflet-control-layers.show {
    display: block;
}

/* Toggle stack layout */
.toggle-stack {
    z-index: var(--z-side-panel);
    display: flex;
    flex-direction: column-reverse;
    gap: 28px !important;
    height: auto;
    width: 100%;
}

@media (max-width: 768px) {
    .toggle-stack {
        gap: 6px;
    }
}

/* =============================================================================
   Zone map labels (Leaflet divIcon)
   ============================================================================= */
.zone-label {
    background: transparent !important;
    border: none !important;
    z-index: var(--z-map-ui) !important;
    pointer-events: auto;
    cursor: pointer;
    padding: 0;
}

.zone-label-text {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--ui-text);
    border-radius: var(--radius-sm);
    font-size: var(--fs-md);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: var(--shadow-md);
    z-index: calc(var(--z-map-ui) + 1) !important;
    position: relative;
    width: 100%;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.zone-label-name {
    color: #fff;
    font-size: var(--fs-xl);
    font-weight: 700;
    line-height: 1.2;
    padding: 2px 4px 0;
}

.zone-label-stats {
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.25;
    padding: 2px 4px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

.zone-label-exp {
    font-size: var(--fs-sm);
    color: var(--ui-exp-blue);
    text-shadow: 0 1px 3px rgba(0, 40, 80, 0.9);
}

.zone-label-bullet {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.zone-label-price {
    font-size: var(--fs-sm);
    color: var(--ui-gold-bright);
    text-shadow: 0 1px 3px rgba(60, 40, 0, 0.85);
}

.zone-label-line {
    width: 100%;
    display: block;
}

/* =============================================================================
   Zone info panel (left) — gray surfaces, accent only on focus/selection
   ============================================================================= */
.zone-info-panel {
    top: 12px;
    left: 12px;
    min-width: 200px;
    max-width: 480px;
    width: 30%;
    height: 100vh;
    max-height: 100vh;
    overflow: auto;
    background: var(--zone-bg);
    border: 1px solid var(--zone-border);
    border-left: none;
    border-top: none;
    border-bottom: none;
    color: var(--ui-text);
    padding: var(--panel-pad-y) var(--panel-pad-x) 18px;
    box-sizing: border-box;
    z-index: var(--z-zone-panel);
    box-shadow: var(--shadow-lg);
}

.zone-info-panel.collapsed {
    width: 0;
    padding: 0;
    border-color: transparent;
    overflow: hidden;
    display: none;
}

.zone-info-panel h3 {
    margin: 4px 0 6px;
    font-size: var(--fs-xl);
    line-height: 1.2;
}

.zone-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.zone-info-title {
    margin: 0;
    font-size: var(--fs-zone-title);
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.35);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.zone-info-close {
    border: 1px solid var(--zone-border);
    background: var(--zone-bg-raised);
    color: var(--ui-text);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 6px 10px;
    font-weight: 700;
    transition: background 0.15s var(--ease-out);
}

.zone-info-close:hover {
    background: var(--zone-bg-inset);
}

.zone-info-hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--zone-border), transparent);
    margin: 8px 0 10px;
}

.zone-info-meta {
    font-size: var(--fs-md);
    color: var(--ui-muted);
    margin-bottom: 10px;
}

.zone-info-actions {
    display: flex;
    gap: 8px;
    margin: 10px 0 12px;
}

.zone-info-list {
    margin: 0;
    padding-left: 18px;
}

.zone-info-empty {
    font-size: var(--fs-md);
    color: var(--ui-muted);
}

.zone-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-md);
    table-layout: auto;
}

.monster-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 8px;
}

.monster-image {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.monster-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.monster-name a {
    word-break: break-word;
}

.zone-info-panel .team-size-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--zone-border);
    background: var(--zone-bg-raised);
    color: var(--ui-text);
    margin-bottom: 8px;
    font-size: var(--fs-base);
}

.zone-info-panel .team-size-select:focus {
    outline: none;
    border-color: var(--ui-border-accent);
    box-shadow: 0 0 0 2px var(--ui-ring-focus);
}

/* Tables: horizontal dividers only (no vertical column rules) */
.zone-info-panel .exp-rates-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
    font-size: var(--fs-base);
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--zone-bg-raised);
}

.zone-info-panel .exp-rates-table th,
.zone-info-panel .exp-rates-table td {
    padding: 8px 12px;
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--zone-border-faint);
    vertical-align: middle;
}

.zone-info-panel .exp-rates-table thead th {
    background: var(--zone-table-head);
    color: var(--zone-text-muted);
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: 0.02em;
    text-transform: none;
    border-bottom: 1px solid var(--zone-border);
}

.zone-info-panel .exp-rates-table tbody tr:last-child td {
    border-bottom: none;
}

.zone-info-panel .exp-rates-table tr {
    cursor: pointer;
    transition: background 0.12s ease;
}

.zone-info-panel .exp-rates-table tbody tr:hover {
    background: var(--zone-row-hover);
}

.zone-info-panel .exp-rates-table tr.selected {
    background: var(--zone-row-selected);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--ui-accent);
}

.zone-info-panel .spawn-time {
    color: var(--ui-text);
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-sm) !important;
    font-size: var(--fs-base) !important;
    padding: 3px 8px;
    background: var(--zone-bg-inset);
}

/* Zone boost block in panel */
.zone-info-panel .zone-info-boost-section {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--zone-border);
}

.zone-info-boost-head {
    margin-bottom: 12px;
}

.zone-info-boost-title {
    margin: 0 0 8px 0;
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--ui-text);
}

.zone-info-panel .zone-info-boost-help {
    margin: 0;
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-md);
    background: var(--zone-bg-inset);
    overflow: hidden;
}

.zone-info-boost-help-summary {
    padding: 10px 14px;
    cursor: pointer;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--ui-accent);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.zone-info-boost-help-summary::-webkit-details-marker {
    display: none;
}

.zone-info-boost-help-summary::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid var(--ui-accent);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.15s var(--ease-out);
    opacity: 0.85;
}

.zone-info-boost-help[open] .zone-info-boost-help-summary::before {
    transform: rotate(90deg);
}

.zone-info-panel .zone-info-boost-help-body {
    padding: 0 14px 14px;
    font-size: var(--fs-md);
    line-height: 1.55;
    color: var(--ui-text);
    border-top: 1px solid var(--zone-border-faint);
}

.zone-info-boost-help-body p {
    margin: 10px 0 0;
}

.zone-info-boost-help-body p:first-child {
    margin-top: 12px;
}

.zone-info-panel .zone-info-boost-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: var(--zone-bg-raised);
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inset);
}

.zone-info-boost-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--ui-accent-strong);
    border-radius: 4px;
}

.zone-info-boost-toggle label {
    cursor: pointer;
    margin: 0;
    user-select: none;
    font-size: var(--fs-md);
    font-weight: 500;
    color: var(--ui-text);
}

.zone-info-panel .zone-info-world-loot-group {
    margin-bottom: 16px;
    padding: 10px 12px 12px;
    background: var(--zone-bg-raised);
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inset);
}

.zone-info-world-loot-title {
    display: block;
    margin-bottom: 8px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--zone-text-muted);
    letter-spacing: 0.02em;
}

.zone-info-world-loot-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.zone-info-world-loot-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.zone-info-world-loot-option {
    display: block;
    padding: 8px 10px;
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-sm);
    background: var(--zone-bg-inset);
    color: var(--ui-text);
    font-size: var(--fs-md);
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.zone-info-world-loot-option:hover {
    background: var(--zone-row-hover);
}

.zone-info-world-loot-options input[type="radio"]:checked + .zone-info-world-loot-option {
    background: var(--zone-row-selected);
    border-color: var(--ui-accent);
    box-shadow: inset 3px 0 0 var(--ui-accent);
    font-weight: 600;
}

.zone-info-world-loot-options input[type="radio"]:focus-visible + .zone-info-world-loot-option {
    outline: 2px solid var(--ui-ring-focus);
    outline-offset: 1px;
}

.zone-info-boost-row {
    margin-bottom: 14px;
}

.zone-info-boost-label {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    width: 100%;
    cursor: pointer;
}

.zone-info-boost-label-name {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ui-text);
    letter-spacing: 0.02em;
}

.zone-info-boost-label-value {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--ui-accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.zone-info-panel .zone-info-boost-slider {
    width: 100%;
    height: 10px;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    accent-color: var(--ui-accent-strong);
}

.zone-info-panel .zone-info-boost-slider:focus {
    outline: none;
}

.zone-info-panel .zone-info-boost-slider:focus-visible {
    outline: 2px solid var(--ui-ring-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.zone-info-panel .zone-info-boost-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--zone-border);
}

.zone-info-panel .zone-info-boost-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -5px;
    border-radius: 50%;
    background: linear-gradient(145deg, #a8ffc4 0%, #5fd68a 45%, #3dab66 100%);
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: var(--shadow-sm);
}

.zone-info-panel .zone-info-boost-slider:hover::-webkit-slider-thumb {
    filter: brightness(1.08);
}

.zone-info-panel .zone-info-boost-slider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--zone-border);
}

.zone-info-panel .zone-info-boost-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(145deg, #a8ffc4 0%, #5fd68a 45%, #3dab66 100%);
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.zone-info-panel .zone-info-boost-costs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding: 12px 14px;
    font-size: var(--fs-md);
    line-height: 1.4;
    color: var(--ui-text);
    background: var(--zone-bg-raised);
    border: 1px solid var(--zone-border);
    border-radius: var(--radius-md);
}

.zone-info-boost-cost-label {
    font-weight: 600;
    color: var(--ui-text);
    flex-shrink: 0;
}

.zone-info-panel .zone-info-boost-cost-value {
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--ui-gold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    font-variant-numeric: tabular-nums;
    text-align: right;
    margin: 0;
}

/* =============================================================================
   Monster popup card (leaflet)
   ============================================================================= */
.monster-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    padding: 6px 8px;
}

/* Single surface with themed popup wrapper (avoid nested dark box on white frame) */
.leaflet-popup-content .monster-card {
    background: transparent;
    border: none;
    padding: 4px 0;
}

.monster-card img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.monster-card .mc-title {
    font-weight: 700;
    color: #fff;
    font-size: var(--fs-base);
}

.monster-card .mc-sub {
    font-size: var(--fs-sm);
    color: var(--ui-muted);
}

/* =============================================================================
   Zone category legend
   ============================================================================= */
.zone-legend {
    z-index: 1300;
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 10px;
    font-size: var(--fs-sm);
    display: none;
    max-width: 200px;
}

.zone-legend.show {
    display: block;
}

.zone-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.zone-legend-color {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 1px solid var(--ui-border);
}

/* =============================================================================
   noUiSlider (floor)
   ============================================================================= */
.noUi-target {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    border-radius: var(--radius-sm);
}

.noUi-connect {
    background: var(--ui-accent);
}

.noUi-handle {
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    box-shadow: none;
    border-radius: var(--radius-sm);
}

.noUi-handle:before,
.noUi-handle:after {
    background: var(--ui-muted);
}

.noUi-vertical .noUi-handle {
    margin-right: -5px;
}

.noUi-value-sub {
    color: var(--ui-text);
    -webkit-text-stroke: 0.8px rgba(0, 0, 0, 0.2);
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.7);
    font-size: var(--fs-lg) !important;
}

.noUi-tooltip {
    background: var(--ui-panel) !important;
    color: var(--ui-accent-strong);
    font-size: 20px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
}

/* =============================================================================
   Generic UI
   ============================================================================= */
.ui-btn {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-bg);
    color: var(--ui-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-size: var(--fs-sm);
    transition: filter 0.15s ease;
}

.ui-btn:hover {
    filter: brightness(1.1);
}

a {
    color: var(--ui-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:visited {
    color: var(--ui-accent);
}

a:hover,
a:focus {
    color: var(--ui-text-2);
    text-decoration: underline;
}
