/* ============================================================================
   ATLAS MAP — SHELL APP (rework strutturale desktop, mockup-faithful)
   Caricare DOPO atlas-restyle.css. Attivo solo con body.atlas-shell-on (>=901px).
   Riorganizza header (ricerca centrata), rail sinistra a icone + flyout,
   pannello "Livelli cartografici" flottante a destra, status bar tecnica,
   bussola Nord. Nessun cambio alla logica JS: i nodi vengono spostati
   (appendChild) preservando id/handler.
   ========================================================================== */

:root{
  --shell-rail-w: 60px;
  --shell-header-h: 52px;
  --shell-status-h: 32px;
  --shell-navy: #1e3a5f;
  --shell-navy-2: #17304e;
  --shell-orange: #f39200;
  --shell-cyan: #1ba6e8;
  --shell-green: #7cb342;
  --shell-panel-dark: rgba(18,24,32,.92);
}

/* ---- Attivazione: nascondi la vecchia impalcatura desktop ---------------- */
body.atlas-shell-on .layout > aside{ display:none !important; }
body.atlas-shell-on #atlasRightDock{ display:none !important; }
body.atlas-shell-on .treseizero-footer{ display:none !important; }

body.atlas-shell-on .layout{ display:block !important; height:calc(100dvh - var(--shell-header-h) - var(--shell-status-h)) !important; margin:0 !important; }
body.atlas-shell-on #map{ position:absolute !important; inset:var(--shell-header-h) 0 var(--shell-status-h) 0 !important; width:auto !important; height:auto !important; }

/* =========================================================================
   HEADER
   ========================================================================= */
body.atlas-shell-on > header{
  height:var(--shell-header-h) !important;
  min-height:var(--shell-header-h) !important;
  max-height:var(--shell-header-h) !important;
  padding:0 18px !important;
  display:flex !important; align-items:center !important; gap:16px !important;
  background:linear-gradient(115deg,var(--shell-navy-2),var(--shell-navy)) !important;
  border-bottom:2px solid var(--shell-orange) !important;
  position:relative !important; z-index:9000 !important;
}
body.atlas-shell-on .atlasmap-header-left{ flex:0 0 auto !important; gap:12px !important; height:auto !important; }
/* brand: wordmark SVG pulito direttamente sull'header (niente targhetta) */
.atlas-shell-brandmark, .atlas-shell-brandtag{ display:none; }
body.atlas-shell-on .atlasmap-brand{ display:inline-flex !important; align-items:center !important; gap:10px !important; background:transparent !important; border:0 !important; border-radius:0 !important; padding:0 !important; box-shadow:none !important; width:auto !important; height:auto !important; }
body.atlas-shell-on .atlasmap-brand-logo{ display:none !important; }
body.atlas-shell-on .atlas-shell-brandmark{ display:block !important; height:28px !important; width:auto !important; }
body.atlas-shell-on .atlas-shell-brandtag{ display:inline-block !important; color:rgba(226,236,247,.68) !important; font-size:11px !important; font-weight:700 !important; letter-spacing:1.4px !important; text-transform:uppercase !important; white-space:nowrap !important; padding-left:12px !important; border-left:1px solid rgba(255,255,255,.14) !important; }
body.atlas-shell-on .atlasmap-header-descriptor{ display:none !important; }
@media(max-width:1100px){ body.atlas-shell-on .atlas-shell-brandtag{ display:none !important; } }

.atlas-shell-search{
  flex:1 1 auto; max-width:620px; margin:0 auto;
  display:flex; align-items:center;
}
.atlas-shell-search .field-group{ width:100%; margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important; }
.atlas-shell-search .atlas-desktop-fold__summary,
.atlas-shell-search summary,
.atlas-shell-search .label,
.atlas-shell-search .hint{ display:none !important; }
.atlas-shell-search .address-search-wrap{ position:relative; display:flex; align-items:center; width:100%; }
.atlas-shell-search input#addressInput{
  width:100% !important; height:40px !important;
  padding:0 96px 0 40px !important; margin:0 !important;
  border-radius:999px !important;
  border:1px solid rgba(255,255,255,.16) !important;
  background:rgba(255,255,255,.10) !important;
  color:#fff !important; font-size:13.5px !important;
  box-shadow:none !important;
}
.atlas-shell-search input#addressInput::placeholder{ color:rgba(255,255,255,.6) !important; }
.atlas-shell-search input#addressInput:focus{ outline:none !important; border-color:var(--shell-cyan) !important; background:rgba(255,255,255,.16) !important; }
.atlas-shell-search .address-search-wrap::before{
  content:""; position:absolute; left:14px; top:50%; width:16px; height:16px; transform:translateY(-50%);
  background:no-repeat center/contain;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cfe0f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  pointer-events:none;
}
.atlas-shell-search .address-search-actions{ position:absolute; right:5px; top:50%; transform:translateY(-50%); display:flex; gap:4px; }
.atlas-shell-search .address-search-actions button{
  height:30px !important; padding:0 12px !important; border-radius:999px !important;
  font-size:12px !important; font-weight:700 !important; line-height:1 !important; border:0 !important;
}
.atlas-shell-search #searchBtn{ background:var(--shell-orange) !important; color:#1a1205 !important; }
.atlas-shell-search #clearAddressBtn{ width:30px !important; padding:0 !important; background:rgba(255,255,255,.14) !important; color:#fff !important; }
.atlas-shell-search .address-results{
  position:absolute !important; top:46px !important; left:0 !important; right:0 !important; z-index:9500 !important;
  background:#fff !important; color:#1a1d24 !important; border-radius:12px !important;
  box-shadow:0 18px 40px rgba(10,25,45,.28) !important; overflow:hidden !important; max-height:320px !important; overflow-y:auto !important;
}
[data-atlas-theme="dark"] .atlas-shell-search .address-results{ background:#161a1f !important; color:#f2f2f0 !important; }

/* header right cluster */
body.atlas-shell-on .header-right{ flex:0 0 auto !important; display:flex !important; align-items:center !important; gap:10px !important; }
body.atlas-shell-on .atlasmap-header-actions{ display:flex !important; align-items:center !important; gap:10px !important; }
body.atlas-shell-on .atlas-header-status-disabled{ display:none !important; }

.atlas-shell-bell{
  width:38px; height:38px; border-radius:10px; border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06); color:#eaf1f8; display:grid; place-items:center; cursor:pointer;
  position:relative; transition:background-color .15s ease;
}
.atlas-shell-bell:hover{ background:rgba(255,255,255,.14); }
.atlas-shell-bell svg{ width:19px; height:19px; }
.atlas-shell-bell .dot{ position:absolute; top:7px; right:8px; width:7px; height:7px; border-radius:50%; background:var(--shell-orange); border:2px solid var(--shell-navy); }
.atlas-shell-user-wrap{ position:relative; }
.atlas-shell-user{ display:flex; align-items:center; gap:8px; padding:4px 8px 4px 4px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); cursor:pointer; transition:background-color .18s ease; }
.atlas-shell-user:hover{ background:rgba(255,255,255,.12); }
.atlas-shell-user.is-anon{ padding:4px; }
.atlas-shell-user .avatar{ width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,var(--shell-cyan),var(--shell-navy)); color:#fff; display:grid; place-items:center; font-weight:800; font-size:12px; letter-spacing:.5px; flex:0 0 auto; }
.atlas-shell-user .uname{ display:inline; color:#eaf1f8; font-size:12.5px; font-weight:700; white-space:nowrap; max-width:130px; overflow:hidden; text-overflow:ellipsis; }
.atlas-shell-user.is-anon .uname{ display:none; }
.atlas-shell-user .uchev{ display:inline-flex; color:rgba(226,236,247,.7); width:14px; transition:transform .2s ease; }
.atlas-shell-user-wrap.open .uchev{ transform:rotate(90deg); }
/* dropdown menu account */
.atlas-shell-usermenu{ position:absolute; top:calc(100% + 8px); right:0; min-width:220px; background:#12161b; border:1px solid rgba(255,255,255,.10); border-radius:14px; box-shadow:0 24px 60px rgba(8,18,32,.5); padding:8px; opacity:0; transform:translateY(-6px); pointer-events:none; transition:opacity .16s ease, transform .16s ease; z-index:9500; }
.atlas-shell-user-wrap.open .atlas-shell-usermenu{ opacity:1; transform:translateY(0); pointer-events:auto; }
.atlas-shell-usermenu .usermenu-head{ display:flex; align-items:center; gap:10px; padding:8px 8px 10px; border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:6px; }
.atlas-shell-usermenu .usermenu-head .avatar{ width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--shell-cyan),var(--shell-navy)); color:#fff; display:grid; place-items:center; font-weight:800; font-size:13px; }
.atlas-shell-usermenu .usermenu-id{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.atlas-shell-usermenu .usermenu-id strong{ color:#f2f2f0; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.atlas-shell-usermenu .usermenu-tier{ font-size:10px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--shell-orange); }
.atlas-shell-usermenu .usermenu-item{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:9px; color:#d6dee7; font-size:13px; font-weight:600; text-decoration:none; transition:background-color .14s ease; }
.atlas-shell-usermenu .usermenu-item:hover{ background:rgba(255,255,255,.07); color:#fff; }
.atlas-shell-usermenu .usermenu-item--danger{ color:#ff8080; }
.atlas-shell-usermenu .usermenu-item--danger:hover{ background:rgba(214,69,69,.16); color:#ff9a9a; }
/* consolidati nel menu: nascondi i bottoni separati Home/Logout dell'header */
body.atlas-shell-on .atlasmap-header-btn--home,
body.atlas-shell-on .atlasmap-header-btn--logout{ display:none !important; }

/* =========================================================================
   LEFT RAIL + FLYOUT
   ========================================================================= */
.atlas-shell-rail{
  position:fixed; left:12px; top:calc(var(--shell-header-h) + 14px); z-index:8000;
  display:flex; flex-direction:column; gap:6px; padding:8px;
  background:var(--shell-panel-dark); backdrop-filter:blur(14px);
  border:1px solid rgba(255,255,255,.10); border-radius:16px;
  box-shadow:0 16px 40px rgba(8,18,32,.32);
}
.atlas-shell-rail .rail-sep{ height:1px; margin:3px 6px; background:rgba(255,255,255,.10); }
.atlas-shell-rail button{
  width:42px; height:42px; border-radius:11px; border:0; cursor:pointer;
  background:transparent; color:#c7d3e0; display:grid; place-items:center;
  transition:background-color .15s ease, color .15s ease, transform .1s ease;
  position:relative;
}
.atlas-shell-rail button:hover{ background:rgba(255,255,255,.10); color:#fff; }
.atlas-shell-rail button:active{ transform:scale(.94); }
.atlas-shell-rail button.is-active{ background:var(--shell-orange); color:#1a1205; }
.atlas-shell-rail button svg{ width:20px; height:20px; }
.atlas-shell-rail button::after{
  content:attr(data-label); position:absolute; left:52px; top:50%; transform:translateY(-50%);
  background:#0f1620; color:#eaf1f8; font-size:11px; font-weight:600; white-space:nowrap;
  padding:5px 9px; border-radius:7px; opacity:0; pointer-events:none; transition:opacity .12s ease;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
}
.atlas-shell-rail button:hover::after{ opacity:1; }

.atlas-shell-flyout{
  position:fixed; left:70px; top:calc(var(--shell-header-h) + 14px); z-index:7900;
  width:340px; max-height:calc(100dvh - var(--shell-header-h) - var(--shell-status-h) - 30px);
  overflow-y:auto; display:none;
  background:#fff; color:#1a1d24; border-radius:16px;
  box-shadow:0 22px 55px rgba(8,18,32,.32); border:1px solid rgba(20,40,66,.10);
}
.atlas-shell-flyout.is-open{ display:block; animation:atlasFlyIn .18s ease; }
@keyframes atlasFlyIn{ from{ opacity:0; transform:translateX(-8px); } to{ opacity:1; transform:none; } }
.atlas-shell-flyout__head{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #eef1f5; }
.atlas-shell-flyout__head strong{ font-size:14px; color:var(--shell-navy); }
.atlas-shell-flyout__head button{ border:0; background:#f1f4f8; width:28px; height:28px; border-radius:8px; cursor:pointer; color:#5a6270; font-size:16px; }
.atlas-shell-flyout__body{ padding:12px 16px 16px; }
.atlas-shell-flyout__body .field-group{ margin:0 !important; border:0 !important; padding:0 !important; background:transparent !important; }
.atlas-shell-flyout__body summary,
.atlas-shell-flyout__body .atlas-desktop-fold__summary{ display:none !important; }
[data-atlas-theme="dark"] .atlas-shell-flyout{ background:#161a1f !important; color:#f2f2f0 !important; border-color:rgba(255,255,255,.08); }
[data-atlas-theme="dark"] .atlas-shell-flyout__head{ border-color:rgba(255,255,255,.08); }
[data-atlas-theme="dark"] .atlas-shell-flyout__head strong{ color:#eaf1f8; }
[data-atlas-theme="dark"] .atlas-shell-flyout__head button{ background:rgba(255,255,255,.08); color:#c7d3e0; }

/* =========================================================================
   RIGHT LAYERS DOCK ("Livelli cartografici")
   ========================================================================= */
.atlas-shell-layers{
  position:fixed; right:14px; top:calc(var(--shell-header-h) + 14px); z-index:8000;
  width:340px; max-height:calc(100dvh - var(--shell-header-h) - var(--shell-status-h) - 28px);
  display:flex; flex-direction:column;
  background:#fff !important; color:#1a1d24 !important; border-radius:16px;
  box-shadow:0 22px 55px rgba(8,18,32,.30); border:1px solid rgba(20,40,66,.10);
  overflow:hidden;
}
.atlas-shell-layers.is-collapsed{ height:52px; }
.atlas-shell-layers__head{
  flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:14px 16px; border-bottom:1px solid #eef1f5;
}
.atlas-shell-layers__head strong{ font-size:15px; color:var(--shell-navy); display:flex; align-items:center; gap:8px; }
.atlas-shell-layers__head strong svg{ width:18px; height:18px; color:var(--shell-orange); }
.atlas-shell-layers__collapse{ border:0; background:#f1f4f8; width:28px; height:28px; border-radius:8px; cursor:pointer; color:#5a6270; display:grid; place-items:center; }
.atlas-shell-layers__collapse svg{ width:16px; height:16px; }
.atlas-shell-layers__body{ flex:1 1 auto; overflow-y:auto; padding:6px 14px 10px; }
.atlas-shell-layers.is-collapsed .atlas-shell-layers__body,
.atlas-shell-layers.is-collapsed .atlas-shell-layers__foot{ display:none; }
.atlas-shell-layers__foot{ flex:0 0 auto; padding:12px 14px; border-top:1px solid #eef1f5; background:#fafbfc; }
.atlas-shell-layers__body #atlasVisibleLayersPanel{ margin:0 !important; border:0 !important; padding:0 !important; background:transparent !important; }
.atlas-shell-layers__body .field-group{ margin:0 0 10px !important; border:0 !important; padding:0 !important; background:transparent !important; }
/* la relazione: pulsante verde pieno, in fondo */
.atlas-shell-layers__foot #generatePointReport{
  width:100% !important; border-radius:11px !important; font-weight:800 !important;
  background:var(--shell-green) !important; color:#122b09 !important; border:0 !important;
  box-shadow:0 6px 16px rgba(124,179,66,.35) !important;
}
.atlas-shell-layers__foot #generatePointReport:disabled{ opacity:.55 !important; box-shadow:none !important; }
.atlas-shell-layers__foot .atlas-work-tools{ margin-bottom:8px !important; }
[data-atlas-theme="dark"] .atlas-shell-layers{ background:#12161b !important; color:#f2f2f0 !important; border-color:rgba(255,255,255,.08); }
[data-atlas-theme="dark"] .atlas-shell-layers__head{ border-color:rgba(255,255,255,.08); }
[data-atlas-theme="dark"] .atlas-shell-layers__head strong{ color:#eaf1f8; }
[data-atlas-theme="dark"] .atlas-shell-layers__collapse{ background:rgba(255,255,255,.08); color:#c7d3e0; }
[data-atlas-theme="dark"] .atlas-shell-layers__foot{ background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.08); }

.atlas-shell-layers__reopen{
  position:fixed; right:14px; top:calc(var(--shell-header-h) + 14px); z-index:8000;
  display:none; align-items:center; gap:8px; padding:10px 14px; cursor:pointer;
  background:var(--shell-panel-dark); color:#eaf1f8; border:1px solid rgba(255,255,255,.10);
  border-radius:12px; font-size:12.5px; font-weight:700; box-shadow:0 12px 30px rgba(8,18,32,.3);
}
.atlas-shell-layers__reopen svg{ width:17px; height:17px; color:var(--shell-orange); }
body.atlas-shell-layers-hidden .atlas-shell-layers{ display:none; }
body.atlas-shell-layers-hidden .atlas-shell-layers__reopen{ display:inline-flex; }

/* =========================================================================
   BOTTOM STATUS BAR + ZOOM + COMPASS
   ========================================================================= */
.atlas-shell-status{
  position:fixed; left:0; right:0; bottom:0; height:var(--shell-status-h); z-index:8500;
  display:flex; align-items:center; gap:18px; padding:0 16px;
  background:var(--shell-navy-2); color:#cfe0f2; border-top:1px solid rgba(255,255,255,.08);
  font-size:11px; font-family:var(--atlas-font-mono, "JetBrains Mono", monospace);
  white-space:nowrap; overflow:hidden;
}
.atlas-shell-status .sep{ width:1px; height:14px; background:rgba(255,255,255,.14); }
.atlas-shell-status .spacer{ flex:1 1 auto; }
.atlas-shell-status b{ color:#fff; font-weight:600; }
.atlas-shell-status .ok{ color:var(--shell-green); font-weight:700; }
.atlas-shell-status .muted{ color:rgba(207,224,242,.6); }
@media(max-width:1200px){ .atlas-shell-status .hide-md{ display:none; } }

.atlas-shell-zoom{
  position:fixed; right:20px; bottom:calc(var(--shell-status-h) + 18px); z-index:8000;
  display:flex; flex-direction:column; border-radius:12px; overflow:hidden;
  box-shadow:0 12px 30px rgba(8,18,32,.32); border:1px solid rgba(255,255,255,.10);
}
.atlas-shell-zoom button{ width:42px; height:42px; border:0; cursor:pointer; background:var(--shell-navy); color:#fff; font-size:20px; display:grid; place-items:center; transition:background-color .15s ease; }
.atlas-shell-zoom button:first-child{ border-bottom:1px solid rgba(255,255,255,.12); }
.atlas-shell-zoom button:hover{ background:var(--shell-cyan); }

.atlas-shell-compass{
  position:fixed; right:20px; bottom:calc(var(--shell-status-h) + 112px); z-index:8000;
  width:46px; height:46px; border-radius:50%;
  background:var(--shell-panel-dark); border:1px solid rgba(255,255,255,.12);
  box-shadow:0 10px 26px rgba(8,18,32,.3); display:grid; place-items:center; cursor:pointer;
}
.atlas-shell-compass svg{ width:26px; height:26px; }
.atlas-shell-compass .n{ position:absolute; top:4px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:800; color:var(--shell-orange); letter-spacing:.5px; }

/* topo button inside basemap bar */
#atlasBasemapBar .atlas-shell-topo-btn.is-active{ color:var(--shell-orange) !important; }

/* riposiziona la basemap bar accanto alla rail (evita collisione con la rail) */
body.atlas-shell-on #atlasBasemapBar{
  position:absolute !important; top:14px !important; left:72px !important; right:auto !important; bottom:auto !important;
  flex-direction:row !important; z-index:6500 !important;
  background:var(--shell-panel-dark) !important; backdrop-filter:blur(14px);
  border:1px solid rgba(255,255,255,.10) !important; border-radius:12px !important; padding:5px !important; gap:4px !important;
  box-shadow:0 12px 30px rgba(8,18,32,.3) !important;
}
/* declutter header: lo zoom e' gia' nella status bar */
body.atlas-shell-on .map-zoom-badge{ display:none !important; }

/* la rail e i dock spariscono sotto 901px: torna la UI mobile nativa */
@media(max-width:900px){
  .atlas-shell-rail, .atlas-shell-flyout, .atlas-shell-layers, .atlas-shell-layers__reopen,
  .atlas-shell-status, .atlas-shell-zoom, .atlas-shell-compass, .atlas-shell-search{ display:none !important; }
}

/* ============================================================================
   FASE 2 — MODALI A CARD (solo CSS, gated a body.atlas-shell-on)
   Ridisegno di Profilo altimetrico, Picchettamento, Misura, Stampa come card
   arrotondate coerenti con i mockup. Nessuna modifica al DOM/JS.
   ============================================================================ */
:root{
  --atlas-glyph-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z'/%3E%3Cpath d='M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12'/%3E%3Cpath d='M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17'/%3E%3C/svg%3E");
}

/* ---- Card container comune -------------------------------------------- */
body.atlas-shell-on .atlas-profile-panel,
body.atlas-shell-on .atlas-stake-panel,
body.atlas-shell-on .atlas-measure-panel,
body.atlas-shell-on .atlas-print-card{
  border-radius:18px !important;
  box-shadow:0 26px 70px rgba(8,18,32,.34) !important;
  border:1px solid rgba(20,40,66,.12) !important;
  background:#ffffff !important; color:#1a1d24 !important;
  overflow:hidden !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-profile-panel,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-stake-panel,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-measure-panel,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-print-card{
  background:#12161b !important; color:#f2f2f0 !important; border-color:rgba(255,255,255,.09) !important;
}

/* ---- Head comune: chip icona brand + titolo + sottotitolo ------------- */
body.atlas-shell-on .atlas-profile-head,
body.atlas-shell-on .atlas-stake-head,
body.atlas-shell-on .atlas-measure-window-head,
body.atlas-shell-on .atlas-print-head{
  display:flex !important; align-items:center !important; gap:12px !important;
  padding:14px 16px !important;
  background:linear-gradient(115deg,var(--shell-navy-2),var(--shell-navy)) !important;
  border-bottom:2px solid var(--shell-orange) !important;
  color:#fff !important;
}
body.atlas-shell-on .atlas-profile-head::before,
body.atlas-shell-on .atlas-stake-head::before,
body.atlas-shell-on .atlas-print-head::before{
  content:''; flex:0 0 auto; width:36px; height:36px; border-radius:10px;
  background-image:var(--atlas-glyph-layers), linear-gradient(135deg,#2b6cb0,var(--shell-orange));
  background-size:20px, cover; background-position:center, center; background-repeat:no-repeat, no-repeat;
  box-shadow:0 4px 12px rgba(8,18,32,.4);
}
body.atlas-shell-on .atlas-profile-head strong,
body.atlas-shell-on .atlas-stake-head strong,
body.atlas-shell-on .atlas-measure-window-head strong,
body.atlas-shell-on .atlas-print-head strong{
  color:#fff !important; font-weight:800 !important; letter-spacing:.2px; font-size:15px !important;
}
body.atlas-shell-on .atlas-profile-head small,
body.atlas-shell-on .atlas-stake-head .atlas-stake-note,
body.atlas-shell-on .atlas-print-head small{
  color:rgba(226,236,247,.72) !important; font-size:11px !important;
}
/* i mac-dot restano funzionali ma spostati a destra */
body.atlas-shell-on .atlas-profile-head > div:first-of-type,
body.atlas-shell-on .atlas-print-head > div:first-of-type,
body.atlas-shell-on .atlas-stake-titleblock{ flex:1 1 auto !important; min-width:0 !important; }

/* ---- Body ------------------------------------------------------------- */
body.atlas-shell-on .atlas-profile-body,
body.atlas-shell-on .atlas-measure-window-body,
body.atlas-shell-on .atlas-stake-quick,
body.atlas-shell-on .atlas-stake-expanded{ padding:14px 16px !important; }

/* ---- Stat cards (Profilo altimetrico) --------------------------------- */
body.atlas-shell-on .atlas-profile-summary{ display:grid !important; grid-template-columns:repeat(4,1fr) !important; gap:10px !important; }
body.atlas-shell-on .atlas-profile-stat{
  background:rgba(20,40,66,.05) !important; border:1px solid rgba(20,40,66,.09) !important;
  border-radius:12px !important; padding:10px 12px !important; display:flex !important; flex-direction:column !important; gap:4px !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-profile-stat{ background:rgba(255,255,255,.04) !important; border-color:rgba(255,255,255,.08) !important; }
body.atlas-shell-on .atlas-profile-stat b{ font-size:10px !important; text-transform:uppercase !important; letter-spacing:.6px !important; color:#6b7a8d !important; font-weight:700 !important; }
body.atlas-shell-on .atlas-profile-stat span{ font-family:'JetBrains Mono',ui-monospace,monospace !important; font-size:17px !important; font-weight:600 !important; color:var(--shell-orange) !important; }
@media(max-width:640px){ body.atlas-shell-on .atlas-profile-summary{ grid-template-columns:repeat(2,1fr) !important; } }

/* ---- Bottoni azioni: pill, primary verde, danger/stop rosso ----------- */
body.atlas-shell-on .atlas-profile-actions button,
body.atlas-shell-on .atlas-measure-actions button,
body.atlas-shell-on .atlas-stake-actions button,
body.atlas-shell-on .atlas-stake-coord-actions button{
  border-radius:999px !important; padding:9px 16px !important; font-weight:700 !important; font-size:12.5px !important;
  border:1px solid rgba(20,40,66,.16) !important; background:rgba(20,40,66,.04) !important; color:#1a1d24 !important;
  transition:background-color .18s ease, transform .12s ease, box-shadow .18s ease !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-profile-actions button,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-measure-actions button,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-stake-actions button{ background:rgba(255,255,255,.06) !important; color:#f2f2f0 !important; border-color:rgba(255,255,255,.12) !important; }
body.atlas-shell-on .atlas-profile-actions button:hover,
body.atlas-shell-on .atlas-measure-actions button:hover,
body.atlas-shell-on .atlas-stake-actions button:hover{ transform:translateY(-1px) !important; }
body.atlas-shell-on .atlas-profile-actions button.primary,
body.atlas-shell-on .atlas-stake-coord-actions button.save{
  background:var(--shell-green) !important; color:#0f1a08 !important; border-color:transparent !important;
  box-shadow:0 6px 16px rgba(124,179,66,.35) !important;
}
body.atlas-shell-on .atlas-profile-actions button.danger,
body.atlas-shell-on .atlas-stake-actions button.stop,
body.atlas-shell-on .atlas-profile-actions button#atlasProfileStop{
  background:rgba(214,69,69,.12) !important; color:#d64545 !important; border-color:rgba(214,69,69,.3) !important;
}

/* ---- Tabella picchettamento ------------------------------------------- */
body.atlas-shell-on .atlas-stake-table thead th{ font-size:10px !important; text-transform:uppercase !important; letter-spacing:.5px !important; color:#6b7a8d !important; }
body.atlas-shell-on .atlas-stake-table td{ font-family:'JetBrains Mono',ui-monospace,monospace !important; font-size:12px !important; }

/* ---- Print modal backdrop --------------------------------------------- */
body.atlas-shell-on .atlas-print-modal{ backdrop-filter:blur(4px) !important; background:rgba(8,18,32,.42) !important; }
body.atlas-shell-on .atlas-print-card{ border-radius:18px !important; }

/* ---- elimina il vecchio toggle pannello (rimpiazzato dallo shell) ----- */
body.atlas-shell-on #atlasLeftPanelToggle{ display:none !important; }

/* ---- Modali residui: rendi coerenti (card + dark) --------------------- */
body.atlas-shell-on .wms-info-card,
body.atlas-shell-on .point-report-card,
body.atlas-shell-on .atlas-stake-coord-card,
body.atlas-shell-on .atlas-access-card,
body.atlas-shell-on .atlas-3d-controls{
  border-radius:18px !important;
  box-shadow:0 26px 70px rgba(8,18,32,.34) !important;
  border:1px solid rgba(20,40,66,.12) !important;
  background:#ffffff !important; color:#1a1d24 !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .wms-info-card,
[data-atlas-theme="dark"] body.atlas-shell-on .point-report-card,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-stake-coord-card,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-access-card,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-3d-controls{
  background:#12161b !important; color:#f2f2f0 !important; border-color:rgba(255,255,255,.09) !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .wms-info-card p,
[data-atlas-theme="dark"] body.atlas-shell-on .point-report-text,
[data-atlas-theme="dark"] body.atlas-shell-on .point-report-text *,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-3d-controls small,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-stake-coord-card label{ color:#d6dee7 !important; }
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-stake-coord-card input,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-3d-controls select{ background:rgba(255,255,255,.06) !important; color:#f2f2f0 !important; border-color:rgba(255,255,255,.14) !important; }
/* head coerenti (navy) per i modali residui con titolo */
body.atlas-shell-on .wms-info-head,
body.atlas-shell-on .point-report-head{
  background:linear-gradient(115deg,var(--shell-navy-2),var(--shell-navy)) !important;
  color:#fff !important; border-bottom:2px solid var(--shell-orange) !important;
}
body.atlas-shell-on .point-report-head strong{ color:#fff !important; }
body.atlas-shell-on .wms-info-popup,
body.atlas-shell-on .point-report-modal,
body.atlas-shell-on .atlas-stake-coord-modal,
body.atlas-shell-on .atlas-access-modal{ backdrop-filter:blur(4px) !important; background:rgba(8,18,32,.42) !important; }
/* CTA verde coerente nei modali residui */
body.atlas-shell-on .point-report-actions button.report-print,
body.atlas-shell-on .wms-info-actions button.wms-info-ok{
  background:var(--shell-green) !important; color:#0f1a08 !important; border-color:transparent !important; border-radius:999px !important; font-weight:700 !important;
}

/* ---- Popup tematici + popup Leaflet (dark) ---------------------------- */
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-urbanistica-popup,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-taf-popup,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-3d-popup,
[data-atlas-theme="dark"] body.atlas-shell-on .leaflet-popup-content-wrapper,
[data-atlas-theme="dark"] body.atlas-shell-on .leaflet-popup-content-wrapper *{
  background:#12161b !important; color:#e6edf5 !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .leaflet-popup-content-wrapper{ border:1px solid rgba(255,255,255,.10) !important; }
[data-atlas-theme="dark"] body.atlas-shell-on .leaflet-popup-content-wrapper a{ color:var(--shell-orange) !important; }
[data-atlas-theme="dark"] body.atlas-shell-on .leaflet-popup-tip{ background:#12161b !important; }
[data-atlas-theme="dark"] body.atlas-shell-on .leaflet-popup-close-button{ color:#9fb0c2 !important; }
body.atlas-shell-on .atlas-urbanistica-popup,
body.atlas-shell-on .atlas-taf-popup,
body.atlas-shell-on .atlas-3d-popup,
body.atlas-shell-on .leaflet-popup-content-wrapper{ border-radius:14px !important; }

/* ============================================================================
   FIX dark: box descrittivi/legende dentro "Livelli cartografici" e flyout
   ============================================================================ */
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .hint,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .istat-boundaries-note,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-results,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-results__head,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-analysis,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-analysis__head,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-analysis__item,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-analysis__summary,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .hint,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .istat-boundaries-note,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .point-results,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .point-results__head,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .point-analysis,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .point-analysis__head,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .point-analysis__item,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .point-analysis__summary{
  background:rgba(255,255,255,.045) !important;
  border-color:rgba(255,255,255,.10) !important;
  color:#c9d4df !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .hint strong,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .istat-boundaries-note strong,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .point-analysis__head,
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-flyout .hint strong{ color:#eef4fb !important; }
/* nomi layer + testi vari piu' leggibili in dark */
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .name,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .toggle-row,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock summary,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .cat-hint{ color:#dbe4ee !important; }
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDock .cat-hint{ opacity:.75; }

/* legenda pericolosita' (bottom-right) coerente */
[data-atlas-theme="dark"] body.atlas-shell-on .treseizero-legend{
  background:rgba(18,22,27,.96) !important; color:#e6edf5 !important;
  border:1px solid rgba(255,255,255,.10) !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on .treseizero-legend__title,
[data-atlas-theme="dark"] body.atlas-shell-on .treseizero-legend__source{ color:#c9d4df !important; }
body.atlas-shell-on .treseizero-legend{ border-radius:14px !important; box-shadow:0 16px 40px rgba(8,18,32,.3) !important; }

/* ============================================================================
   BASEMAP BAR integrata: icone-only, coerente con la rail
   ============================================================================ */
body.atlas-shell-on #atlasBasemapBar .atlas-map-action-label{ display:none !important; }
body.atlas-shell-on #atlasBasemapBar .atlas-basemap-dock-btn,
body.atlas-shell-on #atlasBasemapBar .atlas-shell-topo-btn{
  width:38px !important; height:38px !important; padding:0 !important; border-radius:10px !important;
  background:transparent !important; border:1px solid transparent !important; color:#cdd8e4 !important;
  display:grid !important; place-items:center !important; box-shadow:none !important;
  transition:background-color .16s ease, color .16s ease !important;
}
body.atlas-shell-on #atlasBasemapBar .atlas-basemap-dock-btn:hover,
body.atlas-shell-on #atlasBasemapBar .atlas-shell-topo-btn:hover{ background:rgba(255,255,255,.08) !important; color:#fff !important; }
body.atlas-shell-on #atlasBasemapBar .atlas-basemap-dock-btn[aria-pressed="true"],
body.atlas-shell-on #atlasBasemapBar .atlas-shell-topo-btn.is-active{
  background:rgba(243,146,0,.16) !important; color:var(--shell-orange) !important; border-color:rgba(243,146,0,.4) !important;
}
body.atlas-shell-on #atlasBasemapBar .atlas-tool-glyph{ width:20px; height:20px; }
body.atlas-shell-on #atlasBasemapBar .atlas-tool-glyph svg{ width:20px; height:20px; }

/* --- basemap SPOSTATA nel pannello livelli: segmented control a card --- */
body.atlas-shell-on .atlas-shell-basemaps{ padding:12px 14px 4px; }
body.atlas-shell-on .atlas-shell-basemaps__label{ display:block; font-size:10px; font-weight:800; letter-spacing:.6px; text-transform:uppercase; color:#6b7a8d; margin-bottom:7px; }
[data-atlas-theme="dark"] body.atlas-shell-on .atlas-shell-basemaps__label{ color:#8b98a8; }
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar{
  position:static !important; inset:auto !important; top:auto !important; left:auto !important;
  display:flex !important; gap:6px !important; padding:0 !important;
  background:transparent !important; border:none !important; box-shadow:none !important; backdrop-filter:none !important;
}
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-basemap-dock-btn,
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-shell-topo-btn{
  flex:1 1 0 !important; width:auto !important; height:auto !important;
  display:flex !important; flex-direction:column !important; align-items:center !important; gap:5px !important;
  padding:9px 4px !important; border-radius:11px !important;
  border:1px solid rgba(20,40,66,.14) !important; background:rgba(20,40,66,.04) !important; color:#3a4b5e !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-basemap-dock-btn,
[data-atlas-theme="dark"] body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-shell-topo-btn{
  border-color:rgba(255,255,255,.10) !important; background:rgba(255,255,255,.05) !important; color:#c9d4df !important;
}
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-map-action-label{ display:block !important; font-size:10px !important; font-weight:700 !important; }
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-basemap-dock-btn:hover,
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-shell-topo-btn:hover{ border-color:var(--shell-orange) !important; }
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-basemap-dock-btn[aria-pressed="true"],
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar .atlas-shell-topo-btn.is-active{
  background:rgba(243,146,0,.14) !important; color:var(--shell-orange) !important; border-color:rgba(243,146,0,.45) !important;
}

/* ============================================================================
   Header residui iniettati dal plugin: elimina meta + maplink
   ============================================================================ */
body.atlas-shell-on .atlasmap-header-meta,
body.atlas-shell-on #atlasmapHeaderMeta,
body.atlas-shell-on .atlasmap-header-map-link,
body.atlas-shell-on .atlasmap-header-maplink,
body.atlas-shell-on #atlasmapHeaderMapLink,
body.atlas-shell-on #atlasmapHeaderMaplink,
body.atlas-shell-on .header-meta,
body.atlas-shell-on .header-maplink{ display:none !important; }


/* Desktop: geometria e superfici del prototipo, sui controlli GIS reali. */
:root {
  --shell-surface: #fff;
  --shell-text: #1a1d24;
  --shell-muted: #5a6270;
  --shell-border: #e5e5e0;
  --shell-hover: #f2f2ee;
}
[data-atlas-theme="dark"] {
  --shell-surface: #161a1f;
  --shell-text: #f2f2f0;
  --shell-muted: #a7b0bd;
  --shell-border: #2a2f36;
  --shell-hover: #1f242b;
}
body.atlas-shell-on > header {
  background: #1e3a5f !important;
  border-bottom: 1px solid #17304e !important;
  padding: 0 16px !important;
  box-shadow: none !important;
}
[data-atlas-theme="dark"] body.atlas-shell-on > header { background: #10161f !important; border-color: #22303f !important; }
body.atlas-shell-on #map { left: var(--shell-rail-w) !important; }
body.atlas-shell-on .atlasmap-brand { flex: 0 0 auto !important; max-width: none !important; }
body.atlas-shell-on .atlas-shell-brandtag { font-size: 10px !important; font-weight: 500 !important; }
body.atlas-shell-on .atlasmap-header-tools { display: none !important; }
body.atlas-shell-on .atlas-access-tier-badge { display: none !important; }
body.atlas-shell-on .header-right { min-width: 0 !important; width: auto !important; }
body.atlas-shell-on .atlas-shell-search { min-width: 180px; max-width: 420px; margin: 0 auto 0 0; }
body.atlas-shell-on .atlas-shell-search input#addressInput { height: 34px !important; border-radius: 4px !important; font-family: var(--atlas-font-ui) !important; }
body.atlas-shell-on .atlas-shell-search .address-search-actions button { height: 26px !important; border-radius: 3px !important; }
body.atlas-shell-on .atlas-shell-search .address-results { top: 40px !important; border-radius: 6px !important; }
.atlas-theme-toggle button { width: auto; min-width: 30px; gap: 5px; padding: 0 8px; font-size: 12px; font-weight: 500; }
.atlas-theme-toggle { flex-shrink: 0; }
body.atlas-shell-on .atlas-shell-user { background: transparent; border-color: transparent; }
body.atlas-shell-on .atlas-shell-user .avatar { width: 28px; height: 28px; background: #f39200; color: #1a1d24; }
body.atlas-shell-on .atlas-shell-user .uname { font-size: 13px; font-weight: 500; }
.atlas-shell-usermenu { visibility: hidden; }
.atlas-shell-user-wrap.open .atlas-shell-usermenu { visibility: visible; }
.atlas-shell-usermenu .usermenu-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.shell-project-label { display: none; }
#atlasShellUserMenu #atlasUserProjects {
  display: flex !important; align-items: center; gap: 10px; width: 100% !important;
  height: auto !important; min-height: 38px; padding: 9px 10px !important; margin: 0;
  background: transparent !important; color: #d6dee7 !important; border: 0 !important;
  border-radius: 9px !important; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
#atlasShellUserMenu #atlasUserProjects:hover { background: rgba(255,255,255,.07) !important; }
#atlasShellUserMenu .shell-project-label { display: inline; }
body.atlas-shell-on #atlasNotificationWrap { margin: 0 !important; }
body.atlas-shell-on #atlasNotificationBell { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.atlas-shell-user:focus-visible { outline: 2px solid var(--shell-cyan); outline-offset: 2px; }
.atlas-shell-rail {
  left: 0; top: var(--shell-header-h); bottom: var(--shell-status-h); width: var(--shell-rail-w);
  box-sizing: border-box; align-items: center; gap: 4px; padding: 12px 0;
  background: var(--shell-surface); border: 0; border-right: 1px solid var(--shell-border);
  border-radius: 0; box-shadow: none; backdrop-filter: none; overflow-y: auto;
}
.atlas-shell-rail button { width: 40px; height: 40px; flex: 0 0 40px; color: var(--shell-muted); border-radius: 4px; }
.atlas-shell-rail button:hover { background: var(--shell-hover); color: var(--shell-cyan); }
.atlas-shell-rail button.is-active { background: rgba(243,146,0,.14); color: #b36a00; }
[data-atlas-theme="dark"] .atlas-shell-rail button.is-active { color: #ff9e12; }
.atlas-shell-rail .rail-sep { width: 28px; min-height: 1px; background: var(--shell-border); margin: 6px 0; }
.atlas-shell-layers, .atlas-shell-flyout { border-radius: 6px; box-shadow: 0 4px 14px rgba(15,33,55,.14); }
.atlas-shell-layers__reopen { background: var(--shell-surface); color: var(--shell-text); border-color: var(--shell-border); border-radius: 4px; box-shadow: 0 1px 2px rgba(15,33,55,.08); }
.atlas-shell-status { background: var(--shell-surface); color: var(--shell-muted); border-color: var(--shell-border); gap: 16px; }
.atlas-shell-status b, .atlas-shell-status .muted { color: var(--shell-text); }
.atlas-shell-status .sep { background: var(--shell-border); }
.atlas-shell-zoom { border-color: var(--shell-border); border-radius: 4px; box-shadow: 0 1px 2px rgba(15,33,55,.08); }
.atlas-shell-zoom button { background: var(--shell-surface); color: var(--shell-text); }
.atlas-shell-zoom button:first-child { border-color: var(--shell-border); }
.atlas-shell-zoom button:hover { background: var(--shell-hover); color: var(--shell-cyan); }
@media (max-width: 1300px) { body.atlas-shell-on .atlas-shell-brandtag { display: none !important; } }
@media (max-width: 900px) {
  .atlas-theme-label { display: none; }
  .atlas-theme-toggle button { padding: 0; width: 26px; min-width: 26px; }
  .atlas-shared-header .atlas-theme-toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-shell-rail *, .atlas-shell-user-wrap *, .atlas-shell-flyout { animation: none !important; transition: none !important; }
}


/* Mobile outdoor: stessi nodi e servizi, superfici e controlli per il campo. */
.atlas-mobile-link-label { display: none; }
@media screen and (max-width: 900px) {
  :root {
    --atlas-mobile-header-h: calc(56px + env(safe-area-inset-top, 0px));
    --atlas-mobile-toolbar-h: 64px;
  }
  body.atlas-mobile-ui-ready { overflow: hidden !important; padding: 0 !important; }
  body.atlas-mobile-ui-ready > header {
    position: fixed !important; inset: 0 0 auto !important; z-index: 9000 !important;
    box-sizing: border-box !important; display: flex !important; justify-content: space-between !important;
    height: var(--atlas-mobile-header-h) !important; min-height: var(--atlas-mobile-header-h) !important;
    padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px)) !important;
    background: var(--shell-navy) !important; border: 0 !important; gap: 8px !important;
  }
  html[data-atlas-theme="dark"] body.atlas-mobile-ui-ready > header { background: #10161f !important; }
  body.atlas-mobile-ui-ready .atlasmap-header-left { width: auto !important; min-width: 0 !important; flex: 0 1 auto !important; }
  body.atlas-mobile-ui-ready .atlasmap-brand { display: flex !important; width: auto !important; height: auto !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; border: 0 !important; }
  body.atlas-mobile-ui-ready .atlas-shell-brandmark { display: block !important; width: 140px !important; height: auto !important; }
  body.atlas-mobile-ui-ready .atlasmap-brand-logo,
  body.atlas-mobile-ui-ready .atlasmap-header-descriptor,
  body.atlas-mobile-ui-ready .atlasmap-header-meta,
  body.atlas-mobile-ui-ready .atlas-shell-brandtag,
  body.atlas-mobile-ui-ready .treseizero-footer { display: none !important; }
  body.atlas-mobile-ui-ready .header-right,
  body.atlas-mobile-ui-ready .atlasmap-header-actions,
  body.atlas-mobile-ui-ready .atlasmap-header-tools,
  body.atlas-mobile-ui-ready .atlasmap-header-account {
    display: flex !important; flex: 0 0 auto !important; width: auto !important; min-width: 0 !important;
    height: auto !important; gap: 6px !important; padding: 0 !important; margin: 0 !important;
  }
  body.atlas-mobile-ui-ready > header button { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
  body.atlas-mobile-ui-ready #map {
    position: fixed !important; inset: var(--atlas-mobile-header-h) 0 calc(var(--atlas-mobile-toolbar-h) + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important; height: auto !important; min-height: 0 !important; max-height: none !important;
    margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-toolbar {
    z-index: 120030 !important; box-sizing: border-box !important; height: calc(var(--atlas-mobile-toolbar-h) + env(safe-area-inset-bottom, 0px)) !important;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)) !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px !important;
    background: var(--atlas-surface) !important; color: var(--atlas-ink) !important;
    border-top: 1px solid var(--atlas-line) !important; box-shadow: none !important; backdrop-filter: none !important;
  }
  .atlas-mobile-toolbar [data-atlas-sheet="layers"] { order: 1; }
  .atlas-mobile-toolbar [data-atlas-sheet="point"] { order: 2; }
  .atlas-mobile-toolbar [data-atlas-sheet="tools"] { order: 3; }
  .atlas-mobile-toolbar [data-atlas-sheet="legends"] { order: 4; }
  body.atlas-mobile-ui-ready .atlas-mobile-tool {
    height: 52px !important; min-height: 44px !important; min-width: 44px !important; padding: 4px !important;
    border-radius: 6px !important; background: transparent !important; color: var(--atlas-muted) !important;
    font: 600 11px/1.25 var(--atlas-font-ui) !important; gap: 4px !important; touch-action: manipulation;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-tool.is-active { background: var(--atlas-surface-2) !important; color: var(--atlas-ink) !important; box-shadow: inset 0 3px var(--atlas-orange) !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-tool__icon { display: grid !important; place-items: center; width: 24px !important; height: 24px !important; padding: 0 !important; background: transparent !important; color: inherit !important; box-shadow: none !important; }
  .atlas-mobile-tool__icon svg { width: 22px; height: 22px; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet {
    box-sizing: border-box !important; background: var(--atlas-surface) !important; color: var(--atlas-ink) !important;
    border-color: var(--atlas-line) !important; border-radius: 16px 16px 0 0 !important;
    max-height: calc(100dvh - var(--atlas-mobile-toolbar-h) - env(safe-area-inset-bottom, 0px) - 12px) !important;
    backdrop-filter: none !important;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__head {
    background: var(--atlas-surface) !important; border-color: var(--atlas-line) !important;
    padding: 12px 16px !important; gap: 12px !important;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__head strong { color: var(--atlas-ink) !important; font: 700 18px/1.3 var(--atlas-font-ui) !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__eyebrow { color: var(--atlas-muted) !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__close {
    width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; flex: 0 0 44px !important;
    background: var(--atlas-surface-2) !important; color: var(--atlas-ink) !important; border-color: var(--atlas-line) !important;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__body { padding: 12px 16px 24px !important; scroll-padding: 16px; color: var(--atlas-ink) !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .field-group,
  body.atlas-mobile-ui-ready .atlas-mobile-empty { background: var(--atlas-surface) !important; color: var(--atlas-muted) !important; border-color: var(--atlas-line) !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .label,
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .atlas-desktop-fold__summary { color: var(--atlas-ink) !important; font-size: 14px !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .hint { color: var(--atlas-muted) !important; font-size: 12px !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet button,
  body.atlas-mobile-ui-ready .atlas-mobile-sheet select,
  body.atlas-mobile-ui-ready .atlas-mobile-sheet input:not([type="checkbox"]):not([type="radio"]),
  body.atlas-mobile-ui-ready .atlas-mobile-sheet summary,
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .toggle-row {
    min-height: 44px !important; box-sizing: border-box !important; touch-action: manipulation;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet button { min-width: 44px !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet :is(input, select, textarea) { font-size: 16px !important; max-width: 100%; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet input[type="checkbox"] { width: 24px !important; height: 24px !important; flex: 0 0 24px; accent-color: var(--atlas-orange); }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .toggle-row > label { display: flex; align-items: center; min-height: 44px; flex: 1; font-size: 14px !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .toggle-row { align-items: center; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet .field-group > input { width: 100% !important; }
  body.atlas-mobile-ui-ready #atlasMobileToolsMount button {
    background: var(--atlas-surface-2) !important; color: var(--atlas-ink) !important; border-color: var(--atlas-line) !important;
    min-height: 56px !important; font-size: 14px !important; border-radius: 8px !important;
  }
  body.atlas-mobile-ui-ready #atlasMobileToolsMount button :is(span,svg) { color: inherit !important; }
  body.atlas-mobile-ui-ready #atlasMobileToolsMount button.active { border-color: var(--atlas-orange) !important; box-shadow: inset 3px 0 var(--atlas-orange) !important; }
  .atlas-mobile-appearance { margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--atlas-line); border-bottom: 1px solid var(--atlas-line); }
  .atlas-mobile-appearance > strong { display: block; margin-bottom: 12px; font-size: 14px; color: var(--atlas-ink); }
  #atlasMobileThemeMount .atlas-theme-toggle { display: flex !important; width: 100%; box-sizing: border-box; gap: 4px; padding: 4px; border: 1px solid var(--atlas-line); background: var(--atlas-surface-2); border-radius: 8px; }
  #atlasMobileThemeMount .atlas-theme-toggle button { flex: 1; width: auto !important; height: 48px !important; min-width: 44px !important; padding: 0 8px !important; color: var(--atlas-muted) !important; background: transparent !important; font-size: 14px !important; }
  #atlasMobileThemeMount .atlas-theme-toggle button[aria-pressed="true"] { color: var(--atlas-ink) !important; background: var(--atlas-surface) !important; box-shadow: inset 0 -3px var(--atlas-orange) !important; }
  #atlasMobileThemeMount .atlas-theme-label { display: inline !important; }
  #atlasMobileLinksMount { display: grid; gap: 8px; }
  #atlasMobileLinksMount a { display: flex !important; align-items: center; justify-content: flex-start; gap: 10px; width: 100% !important; min-height: 48px !important; padding: 10px 12px !important; box-sizing: border-box; background: var(--atlas-surface-2) !important; color: var(--atlas-ink) !important; border: 1px solid var(--atlas-line) !important; border-radius: 8px !important; font-size: 14px !important; text-decoration: none; }
  #atlasMobileLinksMount .atlas-mobile-link-label, #atlasMobileLinksMount a > span { display: inline !important; }
  #atlasMobileLinksMount a > svg { width: 20px; height: 20px; }
  body.atlas-mobile-ui-ready #atlasMobileNavRail { width: 54px !important; padding: 4px !important; right: max(8px, env(safe-area-inset-right, 0px)) !important; bottom: calc(var(--atlas-mobile-toolbar-h) + env(safe-area-inset-bottom, 0px) + 16px) !important; background: var(--atlas-surface) !important; border-color: var(--atlas-line) !important; }
  body.atlas-mobile-ui-ready #atlasMobileNavRail .atlas-mobile-nav-rail__body { width: 44px !important; gap: 4px !important; }
  body.atlas-mobile-ui-ready #atlasMobileNavRail .atlas-mobile-nav-rail__body > button,
  body.atlas-mobile-ui-ready .atlas-custom-zoom > button,
  body.atlas-mobile-ui-ready #atlasLocateBtn,
  body.atlas-mobile-ui-ready #atlasAttributionToggle {
    width: 44px !important; min-width: 44px !important; max-width: none !important; height: 44px !important; min-height: 44px !important; max-height: none !important;
    background: var(--atlas-surface-2) !important; color: var(--atlas-ink) !important; border-color: var(--atlas-line) !important;
  }
  body.atlas-mobile-ui-ready #atlasMobileNavRail #atlasLocateBtn { background: var(--atlas-green) !important; color: #102012 !important; }
  body.atlas-mobile-ui-ready #atlasMobileNavRail #atlasLocateBtn .atlas-tool-glyph svg { color: inherit !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar { background: var(--atlas-surface) !important; border-color: var(--atlas-line) !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar > .atlas-basemap-dock-btn { width: 44px !important; min-width: 44px !important; max-width: none !important; height: 44px !important; min-height: 44px !important; max-height: none !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar .atlas-basemap-opacity--mobile { top: 54px !important; background: var(--atlas-surface) !important; color: var(--atlas-ink) !important; }
  body.atlas-mobile-ui-ready .atlas-attribution-drawer { background: var(--atlas-surface) !important; color: var(--atlas-ink) !important; }
  body.atlas-mobile-ui-ready :is(button, a, input, select, summary):focus-visible { outline: 3px solid var(--atlas-cyan) !important; outline-offset: 2px !important; }
  body.atlas-mobile-ui-ready :is(.atlas-measure-panel, .atlas-stake-panel) {
    left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(var(--atlas-mobile-toolbar-h) + env(safe-area-inset-bottom, 0px) + 8px) !important;
    width: auto !important; max-width: none !important; max-height: 40dvh !important; overflow-y: auto !important; transform: none !important;
  }
  body.atlas-mobile-ui-ready :is(.atlas-measure-panel, .atlas-stake-panel) button { min-width: 44px !important; min-height: 44px !important; touch-action: manipulation; }
  body.atlas-mobile-ui-ready :is(.atlas-measure-panel, .atlas-stake-panel) .atlas-mac-dot { width: 44px !important; height: 44px !important; flex: 0 0 44px !important; }
  body.atlas-mobile-ui-ready .atlas-measure-window-body { max-height: 26dvh; overflow-y: auto; }
}
@media screen and (max-width: 767px) {
  body.atlas-mobile-ui-ready .atlas-mobile-sheet {
    inset: 0 !important; width: 100% !important; height: 100dvh !important; max-height: none !important; border: 0 !important; border-radius: 0 !important;
  }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__handle { display: none !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__head { padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important; }
  body.atlas-mobile-ui-ready .atlas-mobile-sheet__body {
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(var(--atlas-mobile-toolbar-h) + env(safe-area-inset-bottom, 0px) + 24px) max(16px, env(safe-area-inset-left, 0px)) !important;
  }
  body.atlas-mobile-ui-ready :is(.atlas-print-modal, .point-report-modal) { inset: 0 !important; padding: 0 !important; }
  body.atlas-mobile-ui-ready :is(.atlas-print-card, .point-report-card) {
    width: 100% !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; box-sizing: border-box !important; overflow-y: auto !important;
    padding-top: env(safe-area-inset-top, 0px) !important; padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
  body.atlas-mobile-ui-ready :is(.atlas-print-card, .point-report-card) button { min-width: 44px !important; min-height: 44px !important; }
}


/* Opacità: il controllo segue la basemap anche fuori dal vecchio #map. */
body.atlas-shell-on #atlasLayersDockBase #atlasBasemapBar { flex-wrap: wrap !important; }
body.atlas-shell-on #atlasLayersDockBase .atlas-basemap-opacity,
body.atlas-mobile-ui-ready #atlasBasemapBar .atlas-basemap-opacity {
  display: block !important; box-sizing: border-box !important; padding: 12px !important;
  background: var(--atlas-surface) !important; color: var(--atlas-ink) !important;
  border: 1px solid var(--atlas-line) !important; border-radius: 8px !important; box-shadow: none !important;
}
body.atlas-shell-on #atlasLayersDockBase .atlas-basemap-opacity {
  position: static !important; inset: auto !important; transform: none !important;
  flex: 0 0 100% !important; width: 100% !important; order: 5;
}
body.atlas-shell-on #atlasLayersDockBase .atlas-basemap-opacity.is-dock-hidden,
body.atlas-mobile-ui-ready #atlasBasemapBar .atlas-basemap-opacity.is-dock-hidden { display: none !important; }
#atlasBasemapBar .atlas-basemap-opacity__head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin: 0 !important; }
#atlasBasemapBar .atlas-basemap-opacity__toggle { display: flex !important; align-items: center; gap: 8px; min-height: 44px; border: 0 !important; padding: 0 !important; background: transparent !important; color: var(--atlas-ink) !important; font: 600 13px/1.3 var(--atlas-font-ui) !important; }
#atlasBasemapBar .atlas-basemap-opacity__toggle svg { width: 18px !important; height: 18px !important; fill: none; stroke: currentColor; stroke-width: 2px; }
#atlasBasemapBar .atlas-basemap-opacity output { display: inline !important; color: var(--atlas-ink) !important; font-size: 14px !important; white-space: nowrap; }
#atlasBasemapBar .atlas-basemap-opacity__body { display: flex !important; flex-wrap: wrap; gap: 8px; align-items: center; max-height: none !important; opacity: 1 !important; overflow: visible !important; pointer-events: auto !important; padding: 4px 0 0 !important; }
#atlasBasemapBar .atlas-basemap-opacity.is-collapsed .atlas-basemap-opacity__body { display: none !important; }
#atlasBasemapOpacityRange { flex: 1 1 120px; width: 100% !important; min-width: 80px; min-height: 44px !important; margin: 0 !important; padding: 0 !important; accent-color: var(--atlas-orange); touch-action: pan-x; }
#atlasBasemapOpacityReset { min-height: 44px !important; padding: 8px 12px !important; border-radius: 6px !important; background: var(--atlas-surface-2) !important; color: var(--atlas-ink) !important; border: 1px solid var(--atlas-line) !important; font-size: 12px !important; }
@media screen and (max-width: 900px) {
  body.atlas-mobile-ui-ready #atlasBasemapBar {
    display: flex !important; position: absolute !important; left: 10px !important; top: 10px !important; right: auto !important; bottom: auto !important;
    z-index: 1200 !important; gap: 4px !important; padding: 4px !important; margin: 0 !important; border: 1px solid var(--atlas-line) !important; border-radius: 8px !important; overflow: visible !important;
  }
  body.atlas-mobile-ui-ready #atlasBasemapBar > .atlas-basemap-dock-btn { display: flex !important; align-items: center; justify-content: center; position: static !important; margin: 0 !important; padding: 0 !important; background: var(--shell-navy) !important; color: white !important; border: 0 !important; border-radius: 6px !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar > .atlas-basemap-dock-btn.is-active { box-shadow: inset 0 -3px var(--atlas-orange) !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar .atlas-map-action-label { display: none !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar .atlas-tool-glyph svg { width: 22px !important; height: 22px !important; }
  body.atlas-mobile-ui-ready #atlasBasemapBar .atlas-basemap-opacity { position: absolute !important; inset: 56px auto auto 0 !important; transform: none !important; width: min(280px, calc(100vw - 24px)) !important; }
  body.atlas-mobile-ui-ready #atlasMobileNavRail { display: flex !important; position: fixed !important; top: auto !important; left: auto !important; z-index: 50000 !important; border-radius: 8px !important; border: 1px solid var(--atlas-line) !important; }
  body.atlas-mobile-ui-ready #atlasMobileNavRail .atlas-mobile-nav-rail__body { display: flex !important; flex-direction: column !important; }
}
