/* AtlasMAP RC13: flat category strips, release and shared footer. */
#atlasVisibleLayersPanel > details.layer-cat {
  position:relative!important;
  border-left:0!important;
  border-radius:7px!important;
  overflow:hidden!important;
}
#atlasVisibleLayersPanel > details.layer-cat::before {
  content:"";position:absolute;left:0;top:0;bottom:0;width:4px;
  background:var(--rc9-accent,#20bceb);border-radius:0!important;
  pointer-events:none;z-index:2;
}
#atlasVisibleLayersPanel > details.layer-cat > summary {
  padding-left:54px!important;
}
/* This badge belongs to the actual WordPress-rendered brand, not the discarded static header. */
body .atlasmap-brand, body .atlas-hdr__brand {position:relative!important;overflow:visible!important;}
body.atlas-shell-on .atlasmap-brand {min-height:42px!important;height:42px!important;padding:0!important;align-items:center!important;}
body .atlas-rc13-release {
  display:block!important;position:absolute!important;left:0!important;top:31px!important;
  z-index:20!important;margin:0!important;padding:0!important;
  font-family:Montserrat,Arial,sans-serif!important;font-size:9px!important;line-height:1.2!important;
  letter-spacing:.35px!important;font-weight:600!important;color:#d4e0ed!important;
  white-space:nowrap!important;visibility:visible!important;opacity:1!important;pointer-events:none!important;
}
body .atlas-rc9-release {display:none!important;}
body.staking-ui-7 .atlas-hdr__brand {height:42px!important;min-height:42px!important;align-items:center!important;}
@media(max-width:900px) {body .atlas-rc13-release{font-size:8px!important;top:30px!important;}}
/* RC13 FIX2: preserve the original AtlasMAP technical status bar. */
body.atlas-shell-on footer.treseizero-footer.atlas-shared-footer,
body.atlas-shell-staking footer.treseizero-footer.atlas-shared-footer,
body.atlas-mobile-ui-ready footer.treseizero-footer.atlas-shared-footer {
  display:none!important;
}
/* Credits use exactly the status bar's existing typography. */
.atlas-shell-status .atlas-status-credits {
  background:transparent!important;border:0!important;color:inherit!important;
  font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important;
  margin:0!important;padding:0!important;cursor:pointer!important;
  text-decoration:underline;text-underline-offset:2px;white-space:nowrap;
}
.atlas-shell-status .atlas-status-credits:focus-visible {
  outline:2px solid currentColor;outline-offset:2px;
}
/* The technical bar remains in sole control of bottom positioning, height, and font. */

/* FIX3: dedicated footer credits panel, independent of hidden map-attribution controls. */
.atlas-footer-credits-panel[hidden]{display:none!important}
.atlas-footer-credits-panel{
  position:fixed!important;bottom:56px!important;right:14px!important;
  z-index:50020!important;width:min(430px,calc(100vw - 28px))!important;
  max-height:min(360px,calc(100dvh - 100px))!important;overflow:auto!important;
  box-sizing:border-box!important;padding:14px 16px!important;
  border-radius:10px!important;border:1px solid #394657!important;
  background:#171d25!important;color:#e9f0f8!important;
  font:12px/1.55 Montserrat,Arial,sans-serif!important;
  box-shadow:0 10px 34px rgba(0,0,0,.3)!important;
}
.atlas-footer-credits-panel .atlas-credits-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.atlas-footer-credits-panel .atlas-credits-heading strong{font-size:13px;font-weight:700}
.atlas-footer-credits-panel .atlas-credits-close{background:transparent;border:0;color:inherit;font-size:22px;line-height:1;cursor:pointer;padding:0 4px}
.atlas-footer-credits-panel .atlas-credits-content{overflow-wrap:anywhere}
.atlas-footer-credits-panel .atlas-credits-content a{color:#69d2f2!important;text-decoration:underline!important}
@media(max-width:900px){.atlas-footer-credits-panel{bottom:calc(85px + env(safe-area-inset-bottom,0px))!important;right:8px!important;}}

/* RC13 FIX4: Picchettamento credits are accessed exclusively from the technical footer.
   Keep the original attribution controller available to maintain Leaflet credits,
   but do not show duplicate © tools in desktop/mobile rails. */
body #railAttributionToggle,
body #stakingAttributionToggle {
  display:none!important;
}

/* FIX5: make credits link reliably interactive above map hit layers */
.atlas-shell-status .atlas-status-credits{pointer-events:auto!important;position:relative!important;z-index:1!important;flex:0 0 auto!important;touch-action:manipulation!important;}
.atlas-footer-credits-panel{pointer-events:auto!important;}


/* RC13 FIX6 — Scrollbar chiara nel pannello layer nei temi scuri.
   Limitazione ai contenitori dei livelli: nessun cambiamento allo scroll della mappa. */
html[data-atlas-theme="dark"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body),
html[data-atlas-theme="field"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body),
body.atlas-shell-on :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body) {
  scrollbar-width:thin;
  scrollbar-color:#F3F7FC #252C34;
}
html[data-atlas-theme="dark"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar,
html[data-atlas-theme="field"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar,
body.atlas-shell-on :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar {
  width:9px;
}
html[data-atlas-theme="dark"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar-thumb,
html[data-atlas-theme="field"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar-thumb,
body.atlas-shell-on :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar-thumb {
  background:#F3F7FC;
  border:2px solid #252C34;
  border-radius:10px;
}
html[data-atlas-theme="dark"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar-track,
html[data-atlas-theme="field"] :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar-track,
body.atlas-shell-on :is(#atlasVisibleLayersPanel, .atlas-layers-scroll, .atlas-layer-list, .atlas-layers-body, .atlas-layers-panel, .atlas-sidebar-body)::-webkit-scrollbar-track {
  background:#252C34;
}
/* La barra di categoria resta a filo, mentre testi e controlli interni
   hanno una distanza minima dalla barra colorata. */
#atlasVisibleLayersPanel > details.layer-cat > :not(summary) {
  box-sizing:border-box!important;
  max-width:100%;
}
#atlasVisibleLayersPanel > details.layer-cat > :is(.hint, .istat-boundaries-note, .toggle-row, .atlas-catasto-mode, .catasto-bracket, .atlas-catasto-mode-footnote) {
  padding-left:14px!important;
  padding-right:12px!important;
}
#atlasVisibleLayersPanel > details.layer-cat > .hint {
  overflow-wrap:anywhere;
}
@media (max-width:600px){
  #atlasVisibleLayersPanel > details.layer-cat > :is(.hint, .istat-boundaries-note, .toggle-row, .atlas-catasto-mode, .catasto-bracket, .atlas-catasto-mode-footnote) {
    padding-left:13px!important;
    padding-right:10px!important;
  }
}

/* RC13 FIX8: versione allineata al margine destro del logo, in tutti i temi e in Picchettamento. */
body .atlasmap-brand .atlas-rc13-release,
body .atlas-hdr__brand .atlas-rc13-release {
  left:auto!important;
  right:0!important;
  text-align:right!important;
  width:max-content!important;
  max-width:100%!important;
}

/* RC13 FIX10 — no duplicate copyright/credits button in application toolbars.
   Footer technical credits and Leaflet attribution must remain intact. */
.atlas-shell-rail #railAttributionToggle,
.atlas-shell-rail #stakingAttributionToggle,
#desktopModuleRail #railAttributionToggle,
#mobileDock #stakingAttributionToggle,
#mobileDock #railAttributionToggle,
body.atlas-shell-staking #stakingAttributionToggle,
body.atlas-shell-staking #railAttributionToggle {
  display:none!important;
  visibility:hidden!important;
}

/* RC13 FIX11: quick actions at the bottom of the main desktop tool rail. */
@media (min-width:901px){
  #atlasShellRail.atlas-shell-rail {
    bottom:calc(var(--shell-status-h, 43px) + 12px);
    max-height:calc(100dvh - var(--shell-header-h, 58px) - var(--shell-status-h, 43px) - 28px);
    box-sizing:border-box;
    overflow-y:auto;
    overflow-x:visible;
    scrollbar-width:thin;
  }
  #atlasShellRail .atlas-quick-actions-divider {
    margin-top:auto;
    flex-shrink:0;
  }
  #atlasShellRail > button {flex-shrink:0;}
}
/* White scrollbar thumb on black track in dark themes; Light remains native. */
html[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body),
html[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body),
body[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body),
body[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body){
  scrollbar-width:thin!important;
  scrollbar-color:#fff #080808!important;
}
html[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar,
html[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar,
body[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar,
body[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar{width:9px;}
html[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-thumb,
html[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-thumb,
body[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-thumb,
body[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-thumb{background:#fff!important;border:2px solid #080808!important;border-radius:9px;}
html[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-track,
html[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-track,
body[data-atlas-theme="dark"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-track,
body[data-atlas-theme="field"] :is(#atlasLayersDockBody,#atlasVisibleLayersPanel,#atlasShellRail,.atlas-shell-flyout,.atlas-quick-actions,.atlas-shell-layers__body)::-webkit-scrollbar-track{background:#080808!important;}
