/* Barra di navigazione del viewer: ◄ · pallini numerati dei pannelli del gruppo · ► (+ barra della modalità kiosk).
   Pressione prolungata: sui pallini (o la zona attorno) apre l'elenco dal basso (.nav-sheet), sulle frecce avvia il kiosk. */
.nav {
  position: fixed;
  inset: auto 0 0 0;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--surface-solid);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(148, 163, 184, .15);
  z-index: 50;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.nav button {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, .25);
  background: transparent; color: inherit;
  font-size: 20px; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .2s ease;
  touch-action: manipulation;
}
.nav button:hover:not(:disabled) { background: rgba(148, 163, 184, .12); transform: scale(1.08); }
.nav button:disabled { opacity: .3; cursor: not-allowed; }
/* pressione in corso: anello che si riempie (la pressione prolungata scatta a 550 ms) */
.nav .nav-prev.is-pressing, .nav .nav-next.is-pressing { box-shadow: 0 0 0 3px rgba(59, 130, 246, .45); transition: box-shadow .55s linear; }

/* zona dei pallini: occupa lo spazio tra le frecce (anche la parte vuota accetta la pressione prolungata) */
.nav-center { position: relative; flex: 1 1 auto; min-width: 0; align-self: stretch; display: flex; align-items: center; justify-content: center; touch-action: pan-x; }
.nav-center.is-pressing .nav-dots { opacity: .7; transition: opacity .55s linear; }
.nav-dots { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.nav-dots::-webkit-scrollbar { display: none; }
/* pallino con il numero del pannello: diametro per due cifre, carattere come la legenda dei grafici radar */
.nav .nav-dot {
  flex: 0 0 auto;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(148, 163, 184, .22);
  color: var(--text-muted);
  font: 600 11px/22px system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  text-align: center;
  cursor: pointer;
}
.nav .nav-dot:hover:not(:disabled) { background: rgba(148, 163, 184, .45); color: var(--text); transform: scale(1.12); }
.nav .nav-dot.is-active { background: #3b82f6; color: #fff; }
.nav .nav-dot:focus-visible { outline: 2px solid var(--accent, #3b82f6); outline-offset: 2px; }

/* popup con il nome del pannello sopra il pallino */
.nav-tip {
  position: absolute; bottom: calc(100% + 4px); left: 0;
  max-width: 280px; padding: 5px 9px;
  border: 1px solid var(--border, rgba(148, 163, 184, .3)); border-radius: 6px;
  background: var(--surface-solid); color: var(--text);
  box-shadow: 0 6px 18px var(--shadow-color, rgba(0, 0, 0, .25));
  font: 500 12px system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; z-index: 60;
}
.nav-tip[hidden] { display: none; }

/* modalità kiosk: frecce evidenziate e barra di avanzamento sul bordo superiore */
.nav.is-kiosk .nav-prev, .nav.is-kiosk .nav-next { border-color: #3b82f6; color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .25); }
.nav-kiosk { position: absolute; left: 0; right: 0; top: -1px; height: 3px; pointer-events: none; display: none; }
.nav.is-kiosk .nav-kiosk { display: block; }
.nav-kiosk i { display: block; height: 100%; width: 0; background: #3b82f6; }
.nav-kiosk.is-run i { animation: nav-kiosk-run var(--kiosk-ms, 3000ms) linear forwards; }
@keyframes nav-kiosk-run { from { width: 0; } to { width: 100%; } }

/* elenco dei pannelli dal basso (pressione prolungata sui pallini) */
.nav-sheet { position: fixed; inset: 0; z-index: 200; }
.nav-sheet__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .45); opacity: 0; transition: opacity .2s ease; }
.nav-sheet__panel {
  position: absolute; left: 50%; bottom: 0; width: min(520px, 100%); max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  background: var(--surface-solid); color: var(--text);
  border: 1px solid var(--border, rgba(148, 163, 184, .3)); border-bottom: 0; border-radius: 14px 14px 0 0;
  box-shadow: 0 -10px 30px var(--shadow-color, rgba(0, 0, 0, .3));
  transform: translate(-50%, 100%); transition: transform .22s ease-out;
}
.nav-sheet.is-open .nav-sheet__backdrop { opacity: 1; }
.nav-sheet.is-open .nav-sheet__panel { transform: translate(-50%, 0); }
.nav-sheet__head { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px 44px 10px; font-size: 14px; }
.nav-sheet__grip { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(148, 163, 184, .45); }
.nav-sheet__close { position: absolute; right: 10px; top: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.nav-sheet__close:hover { background: var(--hover, rgba(148, 163, 184, .12)); }
.nav-sheet__list { list-style: none; margin: 0; padding: 0 10px 14px; overflow-y: auto; overscroll-behavior: contain; }
.nav-sheet__item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2, var(--text)); font-size: 14px; text-align: left; cursor: pointer;
}
.nav-sheet__item:hover, .nav-sheet__item:focus-visible { background: var(--hover, rgba(148, 163, 184, .12)); outline: none; }
.nav-sheet__item.is-active { background: rgba(59, 130, 246, .16); color: var(--accent-text, #3b82f6); }
.nav-sheet__num { flex: 0 0 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(148, 163, 184, .2); font: 600 11px system-ui, sans-serif; }
.nav-sheet__item.is-active .nav-sheet__num { background: #3b82f6; color: #fff; }
.nav-sheet__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .nav-sheet__panel, .nav-sheet__backdrop { transition: none; }
}

/* notifiche non lette del pannello sul pallino */
.nav-dot { position: relative; }
.nav-dot-badge { position: absolute; top: -5px; right: -5px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px; background: var(--badge, #dc2626); color: #fff; font: 700 9px/14px system-ui, sans-serif; box-sizing: border-box; pointer-events: none; box-shadow: 0 0 0 2px var(--surface); }
