

    /* Pannello info (sempre sopra la topbar e spostato sotto di essa) */
    #info-panel{
      position: absolute;
      top: calc(var(--topbarHeight, 0px) + var(--panelOffset, 12px)); /* ← ora usa --panelOffset */
      right: 12px;
      z-index: 4003; /* sopra topbar (3000), popup Leaflet (4001) e toggle (4002) */
      max-width: 360px;
      background: var(--panel);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: 0 8px 24px var(--panel-shadow);
      padding: 12px 14px 10px 14px;
    }
    #info-panel.hidden { display: none; }
    @media (max-width: 640px){
      :root{ --panelOffset: 52px; } /* su mobile scende un po’ di più */
    }

    #info-panel h2 { margin: 0 28px 6px 0; font-size: 18px; }
    #info-panel p { margin: 6px 0; color: var(--muted); }
    #info-panel b { color: var(--text); }

    #info-panel.location-panel-compact {
      max-width: 320px;
      padding-bottom: 12px;
    }

    #info-panel.location-panel-compact h2 {
      font-size: 17px;
      margin-bottom: 8px;
    }

    .location-verdict-open {
      padding: 10px;
      border-radius: 8px;
      background: rgba(39, 174, 96, 0.14);
      border: 1px solid rgba(39, 174, 96, 0.35);
    }

    .location-verdict-title {
      color: #27ae60;
      font-size: 15px;
      font-weight: 700;
      line-height: 1.25;
    }

    .location-verdict-subtitle {
      margin-top: 4px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

    .location-compact-grid {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .location-compact-row {
      display: grid;
      grid-template-columns: minmax(94px, auto) 1fr;
      gap: 10px;
      align-items: baseline;
      font-size: 13px;
    }

    .location-compact-row span {
      color: var(--muted);
    }

    .location-compact-row strong {
      color: var(--text);
      font-weight: 700;
      text-align: right;
      word-break: break-word;
    }

    .pilot-workspace-panel {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
    }

    .pilot-workspace-title {
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .pilot-workspace-save-btn {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--panel);
      color: var(--text);
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      opacity: 1;
    }

    .pilot-workspace-save-btn:disabled {
      cursor: not-allowed;
      opacity: 0.72;
    }

    .pilot-workspace-note {
      margin-top: 5px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.3;
    }

    #tools-panel.hidden { display: none; }
    /* Titolo come “maniglia” per trascinare */

    #tool-title{
      padding-right: 22px;         /* spazio per la X */
      border-bottom: 1px solid var(--border);
      margin-bottom: 8px;
    }

    /* 
    .tool-grip {
        pointer-events: none;
    }

    .tool-grip * {
        pointer-events: auto; /* il titolo non blocca nulla 
    }  */


    #tools-close {
        pointer-events: auto; /* forza il click sempre sulla X */
    }

    #tools-hide {
        pointer-events: auto; /* forza il click sempre sulla X */
    }

    #tools-panel {
        position: absolute;
    }

    /*
    .tool-close-btn {
        position: absolute;
        top: 6px;
        right: 6px;
        background: transparent;
        border: none;
        font-size: 20px;
        cursor: pointer;
        z-index: 9999;
    } */

    #close-panel {
        pointer-events: auto; /* forza il click sempre sulla X */
    }

    #close-panel {
      position: absolute;
      top: 6px;
      right: 8px;

      font-size: 20px;
      line-height: 20px;

      padding: 4px 8px;
      border-radius: 6px;

      border: 1px solid rgba(244, 67, 54, 0.5);
      background: transparent;
      color: rgba(244, 67, 54, 0.8);

      cursor: pointer;
    }

    #close-panel:hover {
      background: rgba(244, 67, 54, 0.15);
      color: #f44336;
    }

    #tools-close {
      position: absolute;
      top: 6px;
      right: 8px;

      font-size: 20px;
      line-height: 20px;

      padding: 4px 8px;
      border-radius: 6px;

      border: 1px solid rgba(244, 67, 54, 0.5);
      background: transparent;
      color: rgba(244, 67, 54, 0.8);

      cursor: pointer;
    }

    #tools-close:hover {
      background: rgba(244, 67, 54, 0.15);
      color: #f44336;
    }


    #tools-hide {
      position: absolute;
      top: 6px;
      left: 8px;

      font-size: 14px;
      line-height: 1;

      padding: 6px 10px;
      border-radius: 6px;

      border: 1px solid rgba(33, 150, 243, 0.6);
      background: rgba(33, 150, 243, 0.12);
      color: #2196f3;

      cursor: pointer;
    }

    #tools-hide:hover {
      background: rgba(33, 150, 243, 0.25);
    }

    #tools-reset {
      position: absolute;
      top: 6px;
      left: 50%;
      transform: translateX(calc(-50% + 30px));

      font-size: 14px;
      line-height: 1;

      padding: 6px 10px;
      border-radius: 6px;

      border: 1px solid rgba(76, 175, 80, 0.6);
      background: rgba(76, 175, 80, 0.12);
      color: #4caf50;

      cursor: pointer;
    }

    #tools-reset:hover {
      background: rgba(76, 175, 80, 0.25);
    }

    
    /* Drag utility */
    .draggable { cursor: move; }
    .no-select {
      user-select: none; -webkit-user-select: none; -ms-user-select: none; -moz-user-select: none;
    }


    /* Colori “d–flight like” */
    .c-red      { background:#ff2a2a; border-color:#ff2a2a; }
    .c-red-hz   {
      background:
        repeating-linear-gradient(45deg,
          rgba(255,42,42,0.15) 0 6px,
          rgba(255,42,42,0.60) 6px 12px);
      border-color:#ff2a2a;
    }
    .c-orange   { background:#ff9800; border-color:#ff9800; }
    .c-yellow   { background:#ffeb3b; border-color:#f1d302; }
    .c-celeste  { background:#29b6f6; border-color:#29b6f6; }
    .c-empty    { background:#fff; border-color:#222; }

    /* assicura che il control layers sia visibile */
    .leaflet-control-layers { display: block !important; }
    .leaflet-control { border: 1px solid var(--border) !important; background: var(--panel) !important; color: var(--text) !important; }
    .leaflet-control-layers-expanded { color: var(--text); }
    .leaflet-control a { color: var(--text); }
    .leaflet-popup-content-wrapper, .leaflet-popup-tip{ background: var(--panel); color: var(--text); border:1px solid var(--border); }

    /* Maniglia (grip) del pannello layer */
.lc-grip {
  position: sticky; top: 0;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: move;
  border-top-left-radius: 8px; border-top-right-radius: 8px;
} 

.leaflet-top {
  top: var(--safe-top);
}

.notam-icao {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 8px;
}

.notam-icao div {
  margin-bottom: 4px;
  word-break: break-word;
}

.notam-icao b {
  color: #90caf9; /* o quello che usi nel tema */
  margin-right: 4px;
}



.enr-pre {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 8px;
}

.enr-pre div {
  margin-bottom: 4px;
  word-break: break-word;
}

.enr-pre b {
  color: #90caf9; /* o quello che usi nel tema */
  margin-right: 4px;
}
/*
.leaflet-bottom {
  bottom: var(--safe-bottom);
}

.topbar-toggle {
  bottom: calc(12px + var(--safe-bottom));
} */

/*
.lc-grip {
  position: sticky;
  top: var(--safe-top);
  padding: 6px 10px;  
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  cursor: move;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
} 


@media (max-width:640px){
  .lc-grip {
    top: calc(env(safe-area-inset-top, 0px));
  }
}

*/


#dock-panel {
  position: absolute;
  top: 6px;
  right: 52px;

  font-size: 14px;
  line-height: 1;

  padding: 6px 10px;
  border-radius: 6px;

  border: 1px solid rgba(33, 150, 243, 0.6);
  background: rgba(33, 150, 243, 0.12);
  color: #2196f3;

  cursor: pointer;
}

#dock-panel:hover {
  background: rgba(33, 150, 243, 0.25);
}

#info-panel.docked-left {
  left: 12px !important;
  right: auto !important;
  top: calc(var(--topbarHeight, 0px) + 40px) !important;
  transform: none !important;
}

#info-panel.collapsed {
  transform: translateX(-105%) !important;
}

#info-panel-tab {
  position: absolute;
  right: -30px;
  top: 20px;

  width: 30px;
  height: 60px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 4004;
}

@media (max-width: 899px) {
  #dock-panel,
  #info-panel-tab {
    display: none !important;
  }
}
