/**
 * AgroMaps — UI estilo Google Maps
 * Mapa fullscreen + chrome flotante (buscador, rail, capas, zoom).
 * Todos los IDs de JS/backend se mantienen.
 */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ——— Tokens (Google Maps) ——— */
body.map-gmaps-ui.map-layout {
    --gm-surface: #ffffff;
    --gm-surface-2: #f8f9fa;
    --gm-text: #202124;
    --gm-muted: #5f6368;
    --gm-border: #dadce0;
    --gm-primary: #1a73e8;
    --gm-primary-hover: #1765cc;
    --gm-report: #34a853;
    --gm-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --gm-shadow-lg: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.3);
    --gm-map-bg: #e8eaed;
    --gm-intel-bg: rgba(32, 33, 36, 0.94);
    --gm-intel-text: #e8eaed;
    --gm-radius: 8px;
    --gm-radius-pill: 24px;
    --gm-search-h: 48px;
    --gm-rail-w: 72px;
    --gm-gap: 12px;
    --gm-safe-t: env(safe-area-inset-top, 0px);
    --gm-safe-b: env(safe-area-inset-bottom, 0px);
    --gm-safe-l: env(safe-area-inset-left, 0px);
    --gm-safe-r: env(safe-area-inset-right, 0px);
    --gm-chrome-top: max(12px, var(--gm-safe-t));
    --gm-chrome-left: max(12px, var(--gm-safe-l));
    --gm-chrome-right: max(12px, var(--gm-safe-r));
    --gm-rail-top: calc(var(--gm-chrome-top) + var(--gm-search-h) + 10px);
    --gm-zoom-bottom: max(24px, var(--gm-safe-b));
    --gm-layers-bottom: max(24px, var(--gm-safe-b));

    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    background: var(--gm-map-bg);
    color: var(--gm-text);
    overflow: hidden;
}

/* Tema oscuro (respeta data-theme del sitio) */
[data-theme="dark"] body.map-gmaps-ui.map-layout {
    --gm-surface: #2d2e31;
    --gm-surface-2: #3c4043;
    --gm-text: #e8eaed;
    --gm-muted: #9aa0a6;
    --gm-border: #5f6368;
    --gm-primary: #8ab4f8;
    --gm-primary-hover: #aecbfa;
    --gm-report: #81c995;
    --gm-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
    --gm-shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --gm-map-bg: #1e1e1e;
    --gm-intel-bg: rgba(32, 33, 36, 0.96);
    --gm-intel-text: #e8eaed;
}

[data-theme="light"] body.map-gmaps-ui.map-layout {
    --gm-surface: #ffffff;
    --gm-surface-2: #f8f9fa;
    --gm-text: #202124;
    --gm-muted: #5f6368;
    --gm-border: #dadce0;
    --gm-map-bg: #e8eaed;
    --gm-intel-bg: rgba(255, 255, 255, 0.96);
    --gm-intel-text: #202124;
}

html:has(body.map-gmaps-ui) {
    overflow-x: hidden;
}

body.map-gmaps-ui .map-header-wrap {
    display: none !important;
}

/* ——— App shell: mapa a pantalla completa ——— */
.gmaps-app {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.gmaps-stage {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--gm-map-bg);
}

body.map-gmaps-ui .map-body {
    position: absolute;
    inset: 0;
    background: var(--gm-map-bg);
}

body.map-gmaps-ui #agromaps-map {
    background: var(--gm-map-bg);
}

/* ——— Capa flotante (no bloquea el mapa) ——— */
.gmaps-chrome {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.gmaps-chrome > * {
    pointer-events: auto;
}

/* ——— Buscador (pill blanco, estilo GMaps) ——— */
.gmaps-search-float {
    position: absolute;
    top: var(--gm-chrome-top);
    left: var(--gm-chrome-left);
    display: flex;
    align-items: stretch;
    max-width: min(560px, calc(100vw - var(--gm-chrome-left) - var(--gm-chrome-right) - 8px));
    height: var(--gm-search-h);
    background: var(--gm-surface);
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow-lg);
    overflow: visible;
}

.gmaps-menu-btn {
    flex-shrink: 0;
    width: 48px;
    height: 100%;
    border: none;
    border-right: 1px solid var(--gm-border);
    border-radius: var(--gm-radius) 0 0 var(--gm-radius);
    background: var(--gm-surface);
    color: var(--gm-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gmaps-menu-btn:hover {
    background: var(--gm-surface-2);
}

.gmaps-menu-btn .map-menu-icon,
.gmaps-menu-btn .map-menu-icon::before,
.gmaps-menu-btn .map-menu-icon::after {
    display: block;
}

.gmaps-search-card,
#search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: var(--gm-surface);
}

.gmaps-search-icon {
    color: var(--gm-muted);
    font-size: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.gmaps-search-input,
#search-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--gm-text);
    font-size: 15px;
    line-height: 1.4;
}

.gmaps-search-input::placeholder {
    color: var(--gm-muted);
}

.gmaps-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    max-height: min(360px, 50vh);
    overflow-y: auto;
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow-lg);
    z-index: 300;
}

.gmaps-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--gm-text);
}

.gmaps-search-item:hover,
.gmaps-search-item[aria-selected="true"] {
    background: #e8f0fe;
}

.gmaps-search-item-text {
    flex: 1;
    min-width: 0;
}

.gmaps-search-item-text strong {
    display: block;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmaps-search-item-sub {
    font-size: 12px;
    color: var(--gm-muted);
}

.gmaps-search-item-type {
    font-size: 11px;
    color: var(--gm-muted);
    text-transform: uppercase;
}

/* Botón Reportar = “Directions” GMaps */
.gmaps-directions-btn,
.report-top-btn {
    flex-shrink: 0;
    width: 48px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--gm-border);
    border-radius: 0 var(--gm-radius) var(--gm-radius) 0;
    background: var(--gm-surface);
    color: var(--gm-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gmaps-directions-btn:hover {
    background: #e8f0fe;
}

.gmaps-directions-icon {
    display: block;
    color: var(--gm-primary);
}

.report-btn-text,
.report-top-btn .map-btn-label {
    display: none !important;
}

.report-btn-short {
    display: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--gm-report);
}

.map-refresh-top-btn {
    display: none;
}

/* Alertas + perfil dentro de la barra de búsqueda */
.gmaps-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 0 4px;
    border-left: 1px solid var(--gm-border);
}

.gmaps-header-btn {
    position: relative;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--gm-muted);
    box-shadow: none;
}

.gmaps-header-btn:hover {
    background: var(--gm-surface-2);
    color: var(--gm-primary);
}

.gmaps-header-btn-label {
    display: none;
}

.gmaps-header-profile {
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 11px;
}

/* ——— Rail izquierdo (Saved / Recents style) ——— */
.gmaps-rail,
#map-sidebar {
    position: absolute;
    top: var(--gm-rail-top);
    left: var(--gm-chrome-left);
    bottom: max(80px, calc(24px + var(--gm-safe-b)));
    width: var(--gm-rail-w);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: var(--gm-surface);
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow-lg);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 210;
    transition: width 0.2s ease, box-shadow 0.2s ease;
    -webkit-overflow-scrolling: touch;
}

.gmaps-rail.open,
#map-sidebar.open {
    width: min(220px, calc(100vw - var(--gm-chrome-left) * 2));
    align-items: stretch;
    padding: 8px;
}

.gmaps-rail-item,
.gmaps-rail-item--btn {
    width: 100%;
    max-width: 60px;
    min-height: 52px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--gm-text);
    text-decoration: none;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    flex-shrink: 0;
}

.gmaps-rail.open .gmaps-rail-item,
.gmaps-rail.open .gmaps-rail-item--btn,
#map-sidebar.open .gmaps-rail-item,
#map-sidebar.open .gmaps-rail-item--btn {
    max-width: none;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 44px;
    padding: 8px 10px;
    gap: 12px;
}

.gmaps-rail-item:hover,
.gmaps-rail-item--btn:hover {
    background: var(--gm-surface-2);
}

.gmaps-rail-item.active,
.gmaps-rail-item--btn.active {
    background: #e8f0fe;
    color: var(--gm-primary);
}

.gmaps-rail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gm-surface-2);
    color: var(--gm-muted);
    font-size: 18px;
    flex-shrink: 0;
}

.gmaps-rail-item.active .gmaps-rail-icon,
.gmaps-rail-item--btn.active .gmaps-rail-icon {
    background: #d2e3fc;
    color: var(--gm-primary);
}

.gmaps-rail-icon i {
    font-size: 18px;
    line-height: 1;
}

.gmaps-rail-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--gm-muted);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmaps-rail.open .gmaps-rail-label,
#map-sidebar.open .gmaps-rail-label {
    font-size: 13px;
    text-align: left;
    flex: 1;
}

.gmaps-rail-item.active .gmaps-rail-label,
.gmaps-rail-item--btn.active .gmaps-rail-label {
    color: var(--gm-primary);
    font-weight: 600;
}

.gmaps-rail-spacer {
    flex: 1 1 auto;
    min-height: 8px;
    width: 100%;
}

.gmaps-rail-item--menu {
    display: none;
}

/* ——— Herramientas escritorio (idioma, tema, refresh) ——— */
.gmaps-float-top-right,
.gmaps-desktop-tools,
#topbar-right {
    position: absolute;
    top: var(--gm-chrome-top);
    right: var(--gm-chrome-right);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    max-width: min(50vw, 420px);
    z-index: 210;
}

.gmaps-theme-mount .theme-toggle-btn,
.gmaps-theme-mount .theme-toggle-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--gm-text);
}

.gmaps-pill-btn,
.gmaps-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: var(--gm-radius-pill);
    background: var(--gm-surface);
    color: var(--gm-text);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    box-shadow: var(--gm-shadow);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.gmaps-pill-btn:hover,
.gmaps-icon-btn:hover {
    background: var(--gm-surface-2);
    box-shadow: var(--gm-shadow-lg);
}

.gmaps-icon-btn {
    width: 40px;
    padding: 0;
}

.gmaps-profile-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #34a853);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--gm-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gmaps-alert-badge,
#btn-alerts-badge:not([hidden]) {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 50%;
    background: #d93025;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

#btn-alerts-badge[hidden] {
    display: none !important;
}

/* ——— Capas (abajo izquierda) ——— */
.gmaps-layers-fab,
body.map-gmaps-ui #btn-layers {
    position: absolute;
    left: var(--gm-chrome-left);
    bottom: var(--gm-layers-bottom);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 190;
    box-shadow: none;
    min-height: auto;
}

.gmaps-layers-thumb {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: var(--gm-radius);
    background: linear-gradient(145deg, #81c995 0%, #5bb974 40%, #3d8b5e 100%);
    border: 2px solid var(--gm-surface);
    box-shadow: var(--gm-shadow-lg);
}

.gmaps-layers-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gm-text);
    background: var(--gm-surface);
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: var(--gm-shadow);
}

.gmaps-layers-fab:hover .gmaps-layers-thumb {
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.35);
}

/* ——— Zoom (solo esquina inferior derecha) ——— */
body.map-gmaps-ui .map-controls-stack,
body.map-gmaps-ui .map-controls-stack--zoom {
    position: absolute;
    right: var(--gm-chrome-right);
    bottom: var(--gm-zoom-bottom);
    top: auto;
    left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    z-index: 195;
    pointer-events: none;
}

/* Capas rápidas: en drawer Capas, no en el mapa */
body.map-gmaps-ui .map-quick-layers--drawer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

body.map-gmaps-ui .map-quick-layers--drawer .quick-layer-btn {
    flex: 1 1 calc(33% - 8px);
    min-width: 72px;
    background: var(--gm-surface) !important;
    color: var(--gm-text) !important;
    border: 1px solid var(--gm-border) !important;
    box-shadow: var(--gm-shadow) !important;
}

body.map-gmaps-ui .map-zoom-controls {
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    background: var(--gm-surface);
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow-lg);
    overflow: hidden;
}

body.map-gmaps-ui .map-zoom-btn,
body.map-gmaps-ui .map-geolocate-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border: none;
    border-bottom: 1px solid var(--gm-border);
    background: var(--gm-surface);
    color: var(--gm-muted);
    font-size: 1.25rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    touch-action: manipulation;
}

body.map-gmaps-ui .map-zoom-btn:hover,
body.map-gmaps-ui .map-geolocate-btn:hover {
    background: var(--gm-surface-2);
    color: var(--gm-primary);
}

body.map-gmaps-ui .map-geolocate-btn {
    border-bottom: none;
    color: var(--gm-primary);
}

body.map-gmaps-ui .map-zoom-btn .zoom-glyph {
    pointer-events: none;
    line-height: 1;
}

/* Premium: acceso desde drawer Datos (evita solapamiento abajo-derecha) */
body.map-gmaps-ui .float-right,
body.map-gmaps-ui .premium-controls--desktop {
    display: none !important;
}

.gmaps-attribution {
    position: absolute;
    right: calc(var(--gm-chrome-right) + 52px);
    bottom: var(--gm-zoom-bottom);
    z-index: 50;
    font-size: 10px;
    color: var(--gm-muted);
    background: var(--gm-surface);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--gm-border);
    pointer-events: none;
    opacity: 0.9;
}

/* ——— Panel IA (oscuro, contraste con chrome blanco) ——— */
body.map-gmaps-ui .intel-toggle {
    position: absolute;
    top: var(--gm-rail-top);
    left: calc(var(--gm-chrome-left) + var(--gm-rail-w) + 12px);
    z-index: 180;
    display: none !important;
}

body.map-gmaps-ui .intel-glass {
    position: absolute;
    top: var(--gm-rail-top);
    left: calc(var(--gm-chrome-left) + var(--gm-rail-w) + 12px);
    width: min(280px, calc(100vw - var(--gm-chrome-left) - var(--gm-rail-w) - 48px));
    max-width: 280px;
    z-index: 180;
    background: rgba(32, 33, 36, 0.94);
    color: #e8eaed;
    border: 1px solid #5f6368;
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow-lg);
    backdrop-filter: blur(8px);
}

body.map-gmaps-ui .intel-glass.collapsed {
    transform: translateX(calc(-100% - 20px));
    opacity: 0;
    pointer-events: none;
}

body.map-gmaps-ui .intel-glass:not(.collapsed) {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

body.map-gmaps-ui .intel-glass-head h2 {
    color: var(--gm-primary);
}

body.map-gmaps-ui .intel-metric span {
    color: var(--gm-muted);
}

body.map-gmaps-ui .intel-metric strong {
    color: var(--gm-intel-text);
}

body.map-gmaps-ui .intel-ai-summary {
    color: var(--gm-intel-text);
}

/* ——— Drawer datos ——— */
body.map-gmaps-ui .drawer {
    top: 0;
    bottom: 0;
    z-index: 820;
}

body.map-gmaps-ui .drawer-data#drawer-data {
    left: 0;
    width: min(400px, 100vw);
    background: var(--gm-surface);
    color: var(--gm-text);
}

body.map-gmaps-ui .drawer-header {
    border-bottom: 1px solid var(--gm-border);
}

body.map-gmaps-ui #drawer-data .drawer-header {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--gm-surface);
    padding: 10px 12px;
}

body.map-gmaps-ui #drawer-data .drawer-header h2 {
    font-size: 14px;
    letter-spacing: 0.03em;
}

body.map-gmaps-ui #drawer-data .drawer-close {
    width: 34px;
    height: 34px;
}

body.map-gmaps-ui .drawer-header h2 {
    color: var(--gm-text);
    font-size: 16px;
    font-weight: 500;
}

body.map-gmaps-ui .offline-sync-bar {
    top: calc(var(--gm-chrome-top) + var(--gm-search-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 250;
}

body.map-gmaps-ui .map-mobile-data-btn {
    display: none !important;
}

/* ——— Menú lateral (drawer GMaps) ——— */
body.map-gmaps-ui .map-nav.agro-map-nav,
body.map-gmaps-ui .agro-map-nav {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    padding: max(16px, var(--gm-safe-t)) 12px 16px;
    background: var(--gm-surface);
    box-shadow: var(--gm-shadow-lg);
    z-index: 900;
    flex-direction: column;
    gap: 2px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    pointer-events: auto;
}

body.map-gmaps-ui .map-nav.agro-map-nav.mobile-open,
body.map-gmaps-ui .agro-map-nav.mobile-open {
    display: flex !important;
    transform: translateX(0);
}

body.map-gmaps-ui .map-nav.agro-map-nav a,
body.map-gmaps-ui .agro-map-nav a {
    color: var(--gm-text);
    padding: 12px 14px;
    border-radius: var(--gm-radius);
    text-decoration: none;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

body.map-gmaps-ui .map-nav-close {
    align-self: flex-end;
    width: 34px;
    height: 34px;
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    background: var(--gm-surface);
    color: var(--gm-text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    margin: 0 2px 8px 0;
}

body.map-gmaps-ui .map-nav-close:hover {
    background: var(--gm-surface-2);
}

body.map-gmaps-ui .map-nav.agro-map-nav a:hover,
body.map-gmaps-ui .map-nav.agro-map-nav a.active,
body.map-gmaps-ui .agro-map-nav a:hover,
body.map-gmaps-ui .agro-map-nav a.active {
    background: #e8f0fe;
    color: var(--gm-primary);
}

body.map-gmaps-ui .map-nav-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gm-border);
}

body.map-gmaps-ui .map-nav-theme-row {
    padding: 8px 0;
}

body.map-gmaps-ui .map-nav-theme-row .theme-toggle-wrap {
    width: 100%;
}

body.map-gmaps-ui .map-nav-lang-row {
    width: 100%;
    margin: 2px 0 6px;
}

body.map-gmaps-ui .map-nav-lang-row .lang-dropdown {
    width: 100%;
}

body.map-gmaps-ui .map-nav-lang-row .lang-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
}

body.map-gmaps-ui .map-nav-backdrop.show {
    z-index: 890;
    background: rgba(0, 0, 0, 0.4);
}

/* Ocultar chrome legacy */
.agro-topbar,
.agro-sidebar,
.agro-search-wrap,
.gmaps-float--search,
.gmaps-float--top-right {
    display: none !important;
}

body.map-gmaps-ui .leaflet-control-zoom,
body.map-gmaps-ui .leaflet-control-attribution {
    display: none !important;
}

/* Vista táctica */
body.map-gmaps-ui.map-tactical-view .gmaps-chrome,
body.map-gmaps-ui.map-tactical-view .gmaps-layers-fab,
body.map-gmaps-ui.map-tactical-view #btn-layers {
    opacity: 0;
    pointer-events: none;
}

/* Anular map-radar: etiquetas ocultas en ≤1366px */
@media (max-width: 1366px) {
    body.map-gmaps-ui .map-btn-label {
        display: inline !important;
    }
}

/* ——— Tablet / móvil ——— */
@media (max-width: 768px) {
    body.map-gmaps-ui.map-layout {
        --gm-search-h: 48px;
        --gm-rail-w: 0px;
        --gm-rail-top: calc(var(--gm-chrome-top) + var(--gm-search-h) + 8px);
        --gm-zoom-bottom: max(16px, var(--gm-safe-b));
        --gm-layers-bottom: max(16px, var(--gm-safe-b));
    }

    .gmaps-search-float {
        left: var(--gm-chrome-left);
        right: var(--gm-chrome-right);
        max-width: none;
        width: auto;
    }

    .gmaps-menu-btn {
        width: 44px;
        display: inline-flex !important;
    }

    .gmaps-search-card {
        padding: 0 8px;
    }

    .gmaps-search-input::placeholder {
        font-size: 14px;
    }

    .gmaps-header-actions {
        padding: 0 2px;
    }

    .gmaps-header-btn {
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .gmaps-header-profile {
        width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .gmaps-directions-btn,
    .report-top-btn {
        width: 44px;
    }

    .report-btn-short {
        display: inline !important;
        font-weight: 800;
        color: var(--gm-report);
    }

    .gmaps-directions-icon,
    .report-btn-text {
        display: none !important;
    }

    .gmaps-rail,
    #map-sidebar {
        display: none !important;
    }

    .gmaps-desktop-tools {
        display: none !important;
    }

    body.map-gmaps-ui .map-controls-stack {
        bottom: var(--gm-zoom-bottom);
        right: var(--gm-chrome-right);
    }

    body.map-gmaps-ui .map-zoom-controls {
        box-shadow: var(--gm-shadow-lg);
    }

    body.map-gmaps-ui .map-zoom-controls {
        position: relative;
        overflow: visible;
    }

    body.map-gmaps-ui .intel-glass {
        left: var(--gm-chrome-left);
        right: var(--gm-chrome-right);
        width: auto;
        max-width: none;
        top: calc(var(--gm-chrome-top) + var(--gm-search-h) + 8px);
    }

    body.map-gmaps-ui .intel-glass.collapsed {
        transform: translateY(-120%);
    }

    .gmaps-layers-fab,
    body.map-gmaps-ui #btn-layers {
        left: var(--gm-chrome-left);
        bottom: var(--gm-layers-bottom);
    }

    .gmaps-layers-thumb {
        width: 52px;
        height: 52px;
    }

    .gmaps-attribution {
        display: none;
    }

    /* Espacio: capas (izq) vs zoom (der) */
    body.map-gmaps-ui .map-controls-stack {
        bottom: calc(var(--gm-layers-bottom) + 4px);
    }
}

@media (max-width: 768px) and (min-height: 500px) {
    body.map-gmaps-ui.map-layout {
        --gm-zoom-bottom: max(88px, calc(72px + var(--gm-safe-b)));
    }
}

@media (max-width: 400px) {
    .gmaps-search-input {
        font-size: 14px;
    }

    .gmaps-search-input::placeholder {
        font-size: 13px;
    }
}

/* Escritorio ancho: rail siempre visible */
@media (min-width: 769px) {
    .gmaps-menu-btn {
        display: none !important;
    }

    .gmaps-rail-item--menu {
        display: none !important;
    }

    .gmaps-rail,
    #map-sidebar {
        display: flex !important;
    }
}

/* Anular panel IA inferior de map-radar.css (≤1366px) */
@media (max-width: 1366px) {
    body.map-gmaps-ui .intel-glass {
        position: absolute !important;
        top: var(--gm-rail-top) !important;
        left: calc(var(--gm-chrome-left) + var(--gm-rail-w) + 12px) !important;
        right: auto !important;
        bottom: auto !important;
        width: min(280px, calc(100vw - 120px)) !important;
        max-height: min(70dvh, 420px) !important;
    }

    body.map-gmaps-ui .intel-glass.collapsed {
        transform: translateX(calc(-100% - 24px)) !important;
        opacity: 0 !important;
    }

    body.map-gmaps-ui .intel-glass:not(.collapsed) {
        transform: none !important;
        opacity: 1 !important;
    }

    body.map-gmaps-ui.map-intel-open .intel-glass:not(.collapsed) {
        bottom: auto !important;
    }
}

/* Google Maps home replica polish */
body.map-gmaps-ui.map-layout {
    --gm-surface: #fff;
    --gm-surface-2: #f1f3f4;
    --gm-text: #202124;
    --gm-muted: #5f6368;
    --gm-border: #dadce0;
    --gm-primary: #1a73e8;
    --gm-map-bg: #b9e3ef;
    --gm-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
    --gm-shadow-lg: 0 1px 3px rgba(60, 64, 67, .28), 0 4px 8px rgba(60, 64, 67, .18);
    --gm-rail-w: 70px;
    --gm-chrome-top: max(18px, var(--gm-safe-t));
    --gm-chrome-left: max(16px, var(--gm-safe-l));
    --gm-chrome-right: max(18px, var(--gm-safe-r));
    --gm-search-h: 48px;
    --gm-zoom-bottom: max(48px, calc(40px + var(--gm-safe-b)));
    --gm-layers-bottom: max(18px, var(--gm-safe-b));
}

[data-theme="dark"] body.map-gmaps-ui.map-layout,
body.map-gmaps-ui.map-layout[data-theme="dark"] {
    --gm-surface: #202124;
    --gm-surface-2: #303134;
    --gm-text: #e8eaed;
    --gm-muted: #bdc1c6;
    --gm-border: #3c4043;
    --gm-primary: #8ab4f8;
    --gm-map-bg: #17212b;
}

body.map-gmaps-ui #agromaps-map,
body.map-gmaps-ui .map-body {
    background: var(--gm-map-bg) !important;
}

body.map-gmaps-ui .map-loading {
    background: rgba(248, 249, 250, .72) !important;
    color: #3c4043 !important;
}

body.map-gmaps-ui .spinner {
    border-color: #dadce0 !important;
    border-top-color: #1a73e8 !important;
}

[data-theme="dark"] body.map-gmaps-ui .map-loading {
    background: rgba(23, 33, 43, .78) !important;
    color: #e8eaed !important;
}

[data-theme="dark"] body.map-gmaps-ui .spinner {
    border-color: #3c4043 !important;
    border-top-color: #8ab4f8 !important;
}

@media (min-width: 769px) {
    body.map-gmaps-ui .gmaps-rail,
    body.map-gmaps-ui #map-sidebar {
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--gm-rail-w);
        padding: 18px 8px 14px;
        border-radius: 0;
        box-shadow: none;
        border-right: 1px solid #e0e3e7;
        gap: 12px;
        z-index: 230;
    }

    body.map-gmaps-ui .gmaps-rail.open,
    body.map-gmaps-ui #map-sidebar.open {
        width: var(--gm-rail-w);
        align-items: center;
        padding: 18px 8px 14px;
    }

    body.map-gmaps-ui .gmaps-rail-item,
    body.map-gmaps-ui .gmaps-rail-item--btn,
    body.map-gmaps-ui .gmaps-rail.open .gmaps-rail-item,
    body.map-gmaps-ui .gmaps-rail.open .gmaps-rail-item--btn,
    body.map-gmaps-ui #map-sidebar.open .gmaps-rail-item,
    body.map-gmaps-ui #map-sidebar.open .gmaps-rail-item--btn {
        max-width: 54px;
        min-height: 58px;
        padding: 6px 2px;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        border-radius: 8px;
    }

    body.map-gmaps-ui .gmaps-rail-item--menu {
        display: flex !important;
        order: -20;
        min-height: 40px;
    }

    body.map-gmaps-ui .gmaps-rail-item--menu .gmaps-rail-label {
        display: none;
    }

    body.map-gmaps-ui .gmaps-rail-icon {
        width: 28px;
        height: 28px;
        background: transparent;
        color: var(--gm-text);
        font-size: 21px;
    }

    body.map-gmaps-ui .gmaps-rail-icon i {
        font-size: 21px;
    }

    body.map-gmaps-ui .gmaps-rail-label,
    body.map-gmaps-ui .gmaps-rail.open .gmaps-rail-label,
    body.map-gmaps-ui #map-sidebar.open .gmaps-rail-label {
        max-width: 58px;
        color: var(--gm-text);
        font-size: 12px;
        line-height: 1.18;
        text-align: center;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    body.map-gmaps-ui .gmaps-rail-item.active,
    body.map-gmaps-ui .gmaps-rail-item--btn.active {
        background: transparent;
        color: #1a73e8;
    }

    body.map-gmaps-ui .gmaps-rail-item.active .gmaps-rail-icon,
    body.map-gmaps-ui .gmaps-rail-item--btn.active .gmaps-rail-icon,
    body.map-gmaps-ui .gmaps-rail-item.active .gmaps-rail-label,
    body.map-gmaps-ui .gmaps-rail-item--btn.active .gmaps-rail-label {
        color: #1a73e8;
        background: transparent;
    }

    body.map-gmaps-ui .gmaps-rail-item:hover,
    body.map-gmaps-ui .gmaps-rail-item--btn:hover {
        background: #f1f3f4;
    }

    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item:hover,
    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item--btn:hover {
        background: #2f3641;
    }

    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item.active,
    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item--btn.active {
        background: rgba(138, 180, 248, 0.14);
    }

    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item.active .gmaps-rail-icon,
    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item--btn.active .gmaps-rail-icon,
    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item.active .gmaps-rail-label,
    [data-theme="dark"] body.map-gmaps-ui .gmaps-rail-item--btn.active .gmaps-rail-label {
        color: #a9c7ff;
    }

    body.map-gmaps-ui .gmaps-search-float {
        left: calc(var(--gm-rail-w) + 16px);
        width: min(520px, calc(100vw - var(--gm-rail-w) - 220px));
        max-width: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        gap: 10px;
        overflow: visible;
    }

    body.map-gmaps-ui .gmaps-menu-btn {
        display: none !important;
    }

    body.map-gmaps-ui .gmaps-search-card,
    body.map-gmaps-ui #search-wrap {
        border-radius: 24px;
        padding-left: 22px;
        box-shadow: var(--gm-shadow-lg);
    }

    body.map-gmaps-ui .gmaps-search-icon {
        order: 2;
        margin-left: 8px;
        font-size: 22px;
        color: #5f6368;
    }

    body.map-gmaps-ui .gmaps-search-input {
        order: 1;
        font-size: 15px;
    }

    body.map-gmaps-ui .gmaps-header-actions {
        display: none;
    }

    body.map-gmaps-ui .gmaps-directions-btn,
    body.map-gmaps-ui .report-top-btn {
        width: auto;
        min-width: 122px;
        gap: 8px;
        padding: 0 18px;
        border-left: none;
        border-radius: 24px;
        background: var(--gm-surface);
        color: #00796b;
        box-shadow: var(--gm-shadow-lg);
    }

    body.map-gmaps-ui .gmaps-directions-icon {
        color: #00796b;
        transform: rotate(90deg);
        width: 18px;
        height: 18px;
    }

    body.map-gmaps-ui .report-top-btn .map-btn-label,
    body.map-gmaps-ui .report-top-btn .report-btn-text {
        display: inline !important;
        color: #00796b;
        font-size: 14px;
        font-weight: 600;
    }

    body.map-gmaps-ui .report-btn-short {
        display: none !important;
    }

    body.map-gmaps-ui .gmaps-float-top-right,
    body.map-gmaps-ui .gmaps-desktop-tools,
    body.map-gmaps-ui #topbar-right {
        top: max(22px, var(--gm-safe-t));
        right: max(18px, var(--gm-safe-r));
        gap: 10px;
        max-width: none;
    }

    body.map-gmaps-ui .map-api-trial-btn {
        display: none !important;
    }

    body.map-gmaps-ui .map-plot-btn {
        min-height: 40px;
        padding: 0 14px;
        border-radius: 999px;
        border: 1px solid var(--gm-border);
        background: var(--gm-surface);
        color: #0b7285;
        font-weight: 700;
        box-shadow: var(--gm-shadow);
    }

    body.map-gmaps-ui .map-plot-btn:hover {
        background: #e9f2fb;
        color: #075985;
    }

    [data-theme="dark"] body.map-gmaps-ui .map-plot-btn {
        color: #67e8f9;
        background: #27303a;
        border-color: #45505f;
    }

    [data-theme="dark"] body.map-gmaps-ui .map-plot-btn:hover {
        background: #32404d;
        color: #a5f3fc;
    }

    [data-theme="dark"] body.map-gmaps-ui .gmaps-google-apps-btn:hover,
    [data-theme="dark"] body.map-gmaps-ui .gmaps-theme-mount .theme-toggle-btn:hover {
        background: #2f3641;
        color: #f1f5f9;
    }

    body.map-gmaps-ui .gmaps-theme-mount {
        display: inline-flex !important;
        min-height: 40px;
        padding: 0;
        border-radius: 22px;
        background: var(--gm-surface);
        box-shadow: var(--gm-shadow);
    }

    body.map-gmaps-ui .gmaps-theme-mount:not([data-built="1"]) {
        display: none !important;
    }

    body.map-gmaps-ui .gmaps-theme-mount .theme-toggle-wrap {
        width: auto;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    body.map-gmaps-ui .gmaps-theme-mount .theme-toggle-btn {
        min-height: 40px;
        padding: 0 12px;
        border: none;
        border-radius: 22px;
        background: transparent;
        color: var(--gm-text);
        box-shadow: none;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        font: inherit;
        font-size: 13px;
        cursor: pointer;
    }

    body.map-gmaps-ui .gmaps-theme-mount .theme-toggle-icon {
        font-size: 15px;
        line-height: 1;
    }

    body.map-gmaps-ui .gmaps-google-apps-btn {
        display: inline-flex !important;
        width: 40px;
        min-height: 40px;
        background: transparent;
        box-shadow: none;
        color: var(--gm-text);
        border-radius: 50%;
    }

    body.map-gmaps-ui .gmaps-google-apps-btn i {
        font-size: 22px;
    }

    body.map-gmaps-ui .gmaps-top-profile {
        display: inline-flex;
        width: 32px;
        height: 32px;
        min-height: 32px;
        box-shadow: none;
        background: #263238;
        color: #fff;
        border: 2px solid transparent;
    }

    body.map-gmaps-ui .gmaps-layers-fab,
    body.map-gmaps-ui #btn-layers {
        left: calc(var(--gm-rail-w) + 20px);
        bottom: var(--gm-layers-bottom);
    }

    body.map-gmaps-ui .gmaps-layers-thumb {
        width: 80px;
        height: 80px;
        border-radius: 8px;
        background:
            linear-gradient(rgba(0, 0, 0, .08), rgba(0, 0, 0, .18)),
            url("https://tile.openstreetmap.org/8/54/102.png") center/cover;
        border: 2px solid #fff;
    }

    body.map-gmaps-ui .gmaps-layers-label {
        position: absolute;
        left: 8px;
        bottom: 8px;
        background: rgba(32, 33, 36, .82);
        color: #fff;
        box-shadow: none;
        font-size: 12px;
    }

    body.map-gmaps-ui .map-controls-stack,
    body.map-gmaps-ui .map-controls-stack--zoom {
        right: max(18px, var(--gm-safe-r));
        bottom: var(--gm-zoom-bottom);
    }

    body.map-gmaps-ui .map-zoom-controls {
        border-radius: 8px;
    }

    body.map-gmaps-ui .gmaps-attribution {
        right: calc(max(18px, var(--gm-safe-r)) + 52px);
        bottom: 4px;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        color: var(--gm-text);
        text-shadow: 0 1px 0 rgba(255,255,255,.75);
    }

    body.map-gmaps-ui .leaflet-control-scale,
    body.map-gmaps-ui .leaflet-bottom.leaflet-right {
        right: 72px;
    }
}

@media (max-width: 768px) {
    body.map-gmaps-ui.map-layout {
        --gm-chrome-top: max(10px, var(--gm-safe-t));
        --gm-chrome-left: max(10px, var(--gm-safe-l));
        --gm-chrome-right: max(10px, var(--gm-safe-r));
        --gm-layers-bottom: max(14px, var(--gm-safe-b));
        --gm-zoom-bottom: max(74px, calc(68px + var(--gm-safe-b)));
    }

    body.map-gmaps-ui .gmaps-search-float {
        height: 48px;
        border-radius: 24px;
        left: max(10px, env(safe-area-inset-left, 0px)) !important;
        right: max(10px, env(safe-area-inset-right, 0px)) !important;
        width: auto !important;
        max-width: none !important;
    }

    body.map-gmaps-ui .gmaps-search-card {
        border-radius: 0;
    }

    body.map-gmaps-ui .gmaps-header-actions {
        display: none;
    }

    body.map-gmaps-ui .gmaps-directions-btn,
    body.map-gmaps-ui .report-top-btn {
        display: inline-flex !important;
        width: 40px;
        min-width: 40px;
        height: 100%;
        border: none;
        border-left: 1px solid var(--gm-border);
        border-radius: 0 24px 24px 0;
        background: var(--gm-surface);
        color: #00796b;
        padding: 0;
        box-shadow: none;
    }

    body.map-gmaps-ui .report-top-btn .gmaps-directions-icon {
        width: 16px;
        height: 16px;
        transform: rotate(90deg);
        color: #00796b;
    }

    body.map-gmaps-ui .report-top-btn .map-btn-label,
    body.map-gmaps-ui .report-top-btn .report-btn-text {
        display: none !important;
    }

    body.map-gmaps-ui .report-btn-short {
        display: none !important;
    }

    body.map-gmaps-ui .gmaps-float-top-right {
        display: none !important;
    }

    body.map-gmaps-ui .gmaps-layers-thumb {
        width: 56px;
        height: 56px;
        background:
            linear-gradient(rgba(0, 0, 0, .08), rgba(0, 0, 0, .18)),
            url("https://tile.openstreetmap.org/8/54/102.png") center/cover;
    }

    body.map-gmaps-ui .gmaps-layers-label {
        font-size: 11px;
    }

    body.map-gmaps-ui .map-nav.agro-map-nav,
    body.map-gmaps-ui .agro-map-nav {
        width: min(320px, 92vw);
    }

    body.map-gmaps-ui #drawer-data .drawer-body--dock {
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    body.map-gmaps-ui #drawer-data .map-dock-toolbar {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 8px 10px 6px;
        border-bottom: 1px solid var(--gm-border);
        background: var(--gm-surface);
    }

    body.map-gmaps-ui #drawer-data .map-dock-quick {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    body.map-gmaps-ui #drawer-data .map-dock-summary--drawer {
        display: none;
    }

    body.map-gmaps-ui #drawer-data .map-bottom-panel {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: auto;
        pointer-events: auto;
        flex: 1;
        min-height: 0;
        border-top: none;
        background: transparent;
    }

    body.map-gmaps-ui #drawer-data .map-dock-sheet {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        max-height: none;
        padding: 0;
        border-radius: 0;
        border-top: none;
        box-shadow: none;
        overflow-y: auto;
    }

    body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] .map-crop-bar {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        padding: 8px 10px 10px;
    }

    body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] .crop-filter-chips {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        align-content: start;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 2px;
    }

    body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] .crop-chip {
        min-height: 40px;
        white-space: normal;
        text-align: center;
        justify-content: center;
    }
}
body.map-gmaps-ui .agro-type-heatmap {
    pointer-events: none;
    mix-blend-mode: screen;
}

body.map-gmaps-ui .map-community-callout {
    position: absolute;
    left: 104px;
    bottom: 22px;
    z-index: 65;
    max-width: min(520px, calc(100vw - 220px));
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.22);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

body.map-gmaps-ui .map-community-callout strong {
    font-size: 0.92rem;
    line-height: 1.25;
}

body.map-gmaps-ui .map-community-callout span {
    color: #bae6fd;
    font-size: 0.82rem;
    line-height: 1.25;
}

body.map-gmaps-ui .gmaps-rail-item--btn[aria-pressed="true"] {
    background: rgba(34, 197, 94, 0.16);
}

@media (max-width: 768px) {
    body.map-gmaps-ui .map-community-callout {
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        border-radius: 14px 14px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid rgba(56, 189, 248, 0.55);
        background: linear-gradient(180deg, rgba(8, 47, 73, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
        box-shadow: 0 -8px 24px rgba(2, 132, 199, 0.22);
        padding: 10px 12px calc(10px + var(--gm-safe-b));
    }

    body.map-gmaps-ui .map-community-callout strong {
        font-size: 0.9rem;
        color: #e0f2fe;
    }

    body.map-gmaps-ui .map-community-callout span {
        font-size: 0.78rem;
        color: #7dd3fc;
    }
}

/* Final mobile/drawer overrides to avoid rule collisions above. */
@media (max-width: 768px) {
    body.map-gmaps-ui .gmaps-search-float {
        left: max(10px, env(safe-area-inset-left, 0px)) !important;
        right: max(10px, env(safe-area-inset-right, 0px)) !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 24px;
        display: flex !important;
        align-items: stretch;
        gap: 6px;
    }

    body.map-gmaps-ui .report-top-btn {
        position: relative !important;
        display: inline-flex !important;
        flex: 0 0 auto;
        width: 96px !important;
        min-width: 96px !important;
        height: 48px !important;
        border: 1px solid var(--gm-border) !important;
        border-radius: 10px !important;
        background: var(--gm-surface) !important;
        color: #00796b !important;
        box-shadow: var(--gm-shadow-lg);
        z-index: 2;
        align-items: center;
        justify-content: center;
        margin-left: 0;
    }

    body.map-gmaps-ui .report-top-btn .gmaps-directions-icon {
        display: none !important;
    }

    body.map-gmaps-ui .report-top-btn .report-btn-short,
    body.map-gmaps-ui .report-top-btn .map-btn-label,
    body.map-gmaps-ui .report-top-btn .report-btn-text {
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        color: #00796b;
    }

    body.map-gmaps-ui .report-top-btn .report-btn-short {
        display: none !important;
    }

    body.map-gmaps-ui .report-top-btn .map-btn-label {
        display: none !important;
    }

    body.map-gmaps-ui .report-top-btn .report-btn-text {
        display: inline !important;
        white-space: nowrap;
    }

    body.map-gmaps-ui .map-refresh-top-btn {
        display: inline-flex !important;
        flex: 0 0 auto;
        width: 44px !important;
        min-width: 44px !important;
        height: 48px !important;
        border: 1px solid var(--gm-border) !important;
        border-radius: 10px !important;
        background: var(--gm-surface) !important;
        color: #0f766e !important;
        box-shadow: var(--gm-shadow-lg);
        align-items: center;
        justify-content: center;
        padding: 0 !important;
    }

    body.map-gmaps-ui .map-refresh-top-btn .report-btn-text,
    body.map-gmaps-ui .map-refresh-top-btn .map-btn-label {
        display: none !important;
    }

    body.map-gmaps-ui .map-refresh-top-btn .gmaps-directions-icon {
        display: inline-flex !important;
        width: 18px;
        height: 18px;
    }
}

body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] .map-crop-bar {
    overflow-x: hidden;
    overflow-y: auto;
}

body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] .crop-filter-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    width: 100%;
    max-width: 100%;
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
}

body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="crops"] .crop-chip {
    min-width: 0;
    white-space: normal;
    word-break: break-word;
}

body.map-gmaps-ui #drawer-data .map-dock-section[data-dock-section="plot"] {
    border-top: 1px solid var(--gm-border);
}

body.map-gmaps-ui #drawer-data .plot-risk-panel {
    padding: 10px;
}

body.map-gmaps-ui #drawer-data .plot-risk-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.map-gmaps-ui #drawer-data .plot-risk-btn {
    border: 1px solid var(--gm-border);
    background: var(--gm-surface-2);
    color: var(--gm-text);
    border-radius: 10px;
    min-height: 36px;
    font-weight: 600;
}

body.map-gmaps-ui #drawer-data .plot-risk-btn--primary {
    border-color: #137333;
    color: #137333;
    background: #e6f4ea;
}

body.map-gmaps-ui #drawer-data .plot-risk-panel textarea {
    width: 100%;
    margin-top: 8px;
    min-height: 88px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

body.map-gmaps-ui #drawer-data .plot-risk-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.map-gmaps-ui #drawer-data .plot-risk-result-grid strong {
    display: block;
    font-size: 0.95rem;
}

body.map-gmaps-ui #drawer-data .plot-risk-result-grid span,
body.map-gmaps-ui #drawer-data .plot-risk-status,
body.map-gmaps-ui #drawer-data .plot-risk-help {
    color: var(--gm-muted);
}

[data-theme="dark"] body.map-gmaps-ui #drawer-data .plot-risk-btn--primary {
    border-color: #81c995;
    color: #81c995;
    background: rgba(129, 201, 149, 0.14);
}
