/* Mentions soft-nav: iframe a tutta l’area sotto l’header */
.sm-mentions-embed {
  display: block;
  width: 100%;
  min-height: calc(100dvh - var(--app-header-h, 4.5rem));
  height: calc(100dvh - var(--app-header-h, 4.5rem));
  border: 0;
  background: #f8f9fa;
}
body.sm-mentions-host #spa-view,
html.bl-html body.sm-mentions-host #spa-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
body.sm-mentions-host .fab-stack[data-chrome-fab] {
  /* Mentions ha il suo UX: nascondi fab Carica brano */
  display: none !important;
}

/* Soft-nav SPA — uscita/ingresso condivisi tra le viste */
.spa-view {
  min-width: 0;
  opacity: 1;
  /* Sopra il loader (z-index basso): il contenuto lo copre appena appare. */
  position: relative;
  z-index: 1;
  /* Niente transform/will-change a riposo: altrimenti i tile board
     (position:fixed in .tracks-layer) si agganciano allo spa-view e spariscono. */
}
body.spa-on-board #spa-view {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
body.spa-loading,
html.sm-ui-busy,
body.sm-ui-busy {
  cursor: progress;
}
body.spa-loading #spa-view {
  pointer-events: none;
}

/* Loader: logo B/N, fade in/out + pulse mentre è mostrato */
.spa-loader {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: transparent;
  transition:
    opacity 0.42s ease,
    visibility 0.42s ease;
}
body.spa-loading .spa-loader {
  /* Sopra #spa-view (z-index:1), sotto header/modal */
  z-index: 40;
  opacity: 1;
  visibility: visible;
}
/* Overlay busy (es. replace audio): sopra i modal */
body.spa-loading-overlay .spa-loader {
  z-index: 2000;
  background: color-mix(in srgb, var(--bg, #f6f7f9) 50%, transparent);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: auto;
}
.spa-loader-mark {
  position: relative;
  width: clamp(9rem, 48vw, 15rem);
  height: clamp(9rem, 48vw, 15rem);
  display: grid;
  place-items: center;
}
.spa-loader-icon {
  display: block;
  width: 50%;
  height: 50%;
  max-width: 7.5rem;
  max-height: 7.5rem;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  filter: grayscale(1) brightness(1.5);
  opacity: 0.92;
  user-select: none;
  -webkit-user-drag: none;
  transform: scale(1);
  transform-origin: center center;
  will-change: transform, opacity;
}
.spa-loader.is-animating .spa-loader-icon {
  animation: spa-logo-pulse 1.35s ease-in-out infinite;
}

@keyframes spa-logo-pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}
/* Uscita: fade + leggero sollevamento */
.spa-view.is-leave {
  opacity: 0;
  transform: translate3d(0, -12px, 0);
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ingresso: fade + salita morbida (stessa animazione per tutte le pagine) */
.spa-view.is-enter {
  animation: spa-view-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes spa-view-in {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

body.spa-on-sheet {
  /* allinea a bl-page: scroll verticale ok */
}

@media (prefers-reduced-motion: reduce) {
  .spa-view,
  .spa-view.is-leave {
    transition: none;
    transform: none;
  }
  .spa-view.is-enter {
    animation: none;
  }
  .spa-loader.is-animating .spa-loader-icon {
    animation: none;
  }
}

/* Drag&drop file ovunque (Board + List): overlay «Rilascia per caricare» */
.sm-drop-hint {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
body.is-file-drag .sm-drop-hint {
  display: grid;
  animation: sm-drop-hint-in 0.16s ease both;
}
.sm-drop-hint-box {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: min(92vw, 22rem);
  box-sizing: border-box;
  padding: clamp(1.1rem, 4vw, 1.6rem) clamp(1.1rem, 5vw, 1.8rem);
  border: 2px dashed var(--accent);
  border-radius: 1.25rem;
  background: #fff;
  color: var(--ink, #1f1f1f);
  text-align: center;
  font: 600 1rem var(--font, system-ui, sans-serif);
  box-shadow: 0 18px 48px rgba(31, 31, 31, 0.16);
}
.sm-drop-hint-ico {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.sm-drop-hint-box small {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted, #6b7280);
}
@keyframes sm-drop-hint-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.is-file-drag .sm-drop-hint {
    animation: none;
  }
}
