
/* R3.2 approved Map First shell. Existing Leaflet/application handlers remain intact. */
:root{--header:62px;--footer:28px} .topbar{background:#fff;color:#174b38;border-bottom:1px solid #dfe9e2}.brand strong{color:#15583a}.brand small{color:#396950;letter-spacing:0;text-transform:none;font-size:12px}.topbar button{background:#f8faf8}.workspace{display:block;position:relative;height:calc(100dvh - var(--header) - var(--footer));min-height:320px}.mapwrap{position:absolute;inset:0;height:100%;width:100%}.side{position:absolute;top:0;bottom:0;z-index:650;width:min(330px,37vw);height:100%;box-shadow:0 10px 25px #173e2c20;transition:transform .2s ease;overflow:hidden}.layer-panel{left:0;transform:translateX(-105%)}.info-panel{right:0;transform:translateX(105%);width:min(380px,38vw)}.layer-panel.atlas-open,.info-panel.atlas-open{transform:translateX(0)}.panel-heading{gap:9px}.panel-heading h2{flex:1}.desktop-close{display:inline-flex;align-items:center;justify-content:center;border:none;font-size:22px;padding:4px 8px}.atlas-map-search{position:absolute;top:14px;left:62px;width:min(480px,calc(100% - 240px));display:flex;z-index:720;align-items:center;background:#fff;border-radius:10px;box-shadow:0 2px 12px #1c42242b;border:1px solid #dee7df}.atlas-map-search>button{height:43px;width:46px;border:0;border-right:1px solid #e3eae5;border-radius:10px 0 0 10px;font-size:22px}.atlas-map-search>input{min-width:0;flex:1;height:43px;border:0;outline:0;background:transparent;padding:0 12px;font-size:14px}.atlas-results{position:absolute;top:48px;left:0;right:0;background:#fff;box-shadow:0 6px 20px #0002;border-radius:9px;max-height:300px;overflow:auto}.atlas-result{display:block;border:0;border-bottom:1px solid #edf0ec;border-radius:0;text-align:left;width:100%;font-size:13px}.atlas-result small{display:block;color:#64786e}.map-tools{top:72px}.map-top-right{top:14px}.panel-foot{background:white}.group-title{cursor:pointer;user-select:none;display:flex;justify-content:space-between}.layer-hidden-group{display:none}.feature-scroll{font-size:14px}.props{font-size:13px}.footer,footer{background:#f8faf8;color:#597362;border-top:1px solid #e0e9e2}.mobile-tabbar{display:none} 
@media(max-width:800px){:root{--header:58px;--footer:0px}.topbar{height:var(--header)}.brand small{font-size:10px}.workspace{height:calc(100dvh - var(--header));min-height:320px}.side{position:fixed;left:0;right:0;top:auto;bottom:0;width:100%;height:min(78dvh,690px);border-radius:18px 18px 0 0;transform:translateY(110%);z-index:1200}.side.open,.side.atlas-open{transform:translateY(0)}.info-panel{width:100%}.atlas-map-search{top:10px;left:10px;right:10px;width:calc(100% - 20px)}.map-tools{top:68px;left:10px}.map-top-right{top:72px}.map-bottom{bottom:12px}.map-scale{bottom:65px}.mobile-tabbar{display:none!important}.desktop-close{display:inline-flex}.panel-heading{min-height:53px}.side:not(.atlas-open) {pointer-events:none}.side.atlas-open{pointer-events:auto}.feature-scroll{padding-bottom:38px}.topbar .header-actions #settingsBtn{display:none}}

.raw-gis{border:1px solid #e4eae5;border-radius:8px;margin-top:12px;overflow:hidden}.raw-gis>summary{cursor:pointer;padding:11px 12px;font-size:12px;font-weight:600;color:#57715f;background:#f6f9f6}.raw-gis>.props{margin:0;padding:0 8px}.group-title.atlas-collapsed{border-bottom:1px solid #e3ebe4}
/* R3.3 Drive integration */
#driveBtn{font-size:12px;font-weight:650;white-space:nowrap}#driveBtn.drive-active{color:#1b7950;border-color:#8bbb9e}
.drive-backdrop{position:fixed;inset:0;z-index:99999;background:#14251d92;display:grid;place-items:center;padding:16px}.drive-dialog{background:#fff;color:#233a2d;border-radius:16px;padding:22px;max-width:520px;width:100%;max-height:90vh;overflow:auto;box-shadow:0 12px 65px #0004;font-size:14px;line-height:1.55}.drive-title{display:flex;justify-content:space-between;align-items:center;font-size:19px}.drive-title button{border:0;background:none;font-size:25px;cursor:pointer}.drive-dialog label{display:block;font-weight:600}.drive-dialog input{display:block;width:100%;margin-top:8px;padding:12px;border:1px solid #b9cdc0;border-radius:8px;font-size:14px}.drive-dialog button{padding:10px 15px;border-radius:9px;cursor:pointer}.drive-primary{background:#155a3d;color:#fff;border:0}.drive-help{color:#596e61;font-size:12px}.drive-success{padding:9px;background:#e6f4eb;color:#165b3a;border-radius:8px}

/* VietGreenGIS Atlas - Mobile UI correction */
@media (max-width: 800px) {
  body.atlas-viewer-mode .mobile-tabbar {
    display: flex !important;
  }

  body.atlas-viewer-mode #layerPanel .closeMobile,
  body.atlas-viewer-mode #infoPanel .closeMobile {
    display: none !important;
  }
}

/* VietGreenGIS Atlas - Mobile brand visibility */
@media (max-width: 800px) {
  body.atlas-viewer-mode .brand-identity {
    width: 174px !important;
    min-width: 174px !important;
    overflow: visible !important;
  }
}

/* VietGreenGIS Atlas - Mobile GIS status layout */
@media (max-width: 800px) {
  body.atlas-viewer-mode .map-bottom {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 3px;
    position: fixed !important;
    bottom: 53px !important;
    left: 0;
    right: 90px;
    overflow: hidden;
    min-height: 38px;
    height: auto;
    padding: 4px 8px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.97);
    z-index: 700;
  }

  body.atlas-viewer-mode .map-bottom .status-left,
  body.atlas-viewer-mode .map-bottom .status-right {
    display: flex !important;
    align-items: center;
    min-width: 0;
    gap: 6px;
  }

  body.atlas-viewer-mode .map-bottom .status-left {
    justify-content: space-between;
  }

  body.atlas-viewer-mode .map-bottom .status-right {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  body.atlas-viewer-mode #coordinates {
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
  }

  body.atlas-viewer-mode #atlasAttributionSlot {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    font-size: 9px;
    line-height: 1.2;
  }

  body.atlas-viewer-mode #statusScale,
  body.atlas-viewer-mode #statusZoom {
    display: inline !important;
    font-size: 10px;
    white-space: nowrap;
  }

  body.atlas-viewer-mode #coordMode {
    flex-shrink: 0;
    font-size: 10px;
    padding: 3px 6px;
  }
}

@media (max-width: 800px) {
  body.atlas-viewer-mode .topbar #mobileLayers {
    display: none !important;
  }
}

/* Mobile: Basemap 80%, bottom-left */
@media (max-width: 800px) {
  body.atlas-viewer-mode #basemapSwitch {
    position: fixed !important;
    left: 10px !important;
    right: auto !important;
    bottom: 130px !important;
    transform: scale(0.8) !important;
    transform-origin: bottom left;
    z-index: 750;
  }
}

/* Mobile: Compass bottom-right */
@media (max-width: 800px) {
  body.atlas-viewer-mode #northBtn {
    position: fixed !important;
    right: 10px !important;
    left: auto !important;
    bottom: 130px !important;
    transform: none !important;
    z-index: 750;
  }
}
