/* Digital geology & stratification — ossidiana / placche / lama sidebar — 2026-05-09
   ────────────────────────────────────────────────────────────────────────────
   NOTA: i design tokens (:root, mood, cockpit-mode aliases) sono stati estratti
   in styles/tokens.css (Fase 2.7 Modularizzazione Mirata). I @keyframes sono
   stati estratti in styles/keyframes.css. Quei file vanno linkati PRIMA di
   questo in index_4.html.
   ──────────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body.app-shell {
  position: relative;
  isolation: isolate;
  background-color: #030306;
  background-image:
    radial-gradient(ellipse 125% 90% at 50% 42%, rgba(10, 22, 34, 0.55) 0%, transparent 58%),
    radial-gradient(circle at 50% 46%, rgba(4, 8, 14, 0.15) 0%, rgba(0, 0, 0, 0.82) 58%, #010102 100%),
    linear-gradient(168deg, rgba(12, 26, 38, 0.22) 0%, transparent 38%, rgba(3, 6, 12, 0.65) 100%);
  color: var(--text-pure);
  font-family: var(--font-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ═══════════════════════════════════════════
   BOOTSTRAP CHROME · Fase 3.0.1-polish iter 4 (12 Maggio 2026, sera)
   ───────────────────────────────────────────
   Eliminazione del flash visivo all'avvio della pagina cockpit.

   Causa originale: HTML statico inizia in mode='welcome' con #player-placeholder
   visibile (T1 logo + scritte centrate). Quando JS legge ?id=... dall'URL, fetch
   il profilo da Supabase e chiama setAppMode('analysis'), la transizione provoca:
     1. Flash 100-300ms del welcome-state prima del video
     2. Slittamento "glow + scritte" sulla rail (live-dot is-lit, data-session-state,
        rail-quadrant-label opacity 0.42 → 0.72) perché tutte le transition CSS
        (0.32s cubic-bezier) si avviano sul cambio di stato post-paint.

   Soluzione:
     a) Inline script in <head> (vedi index_4.html) setta data-bootstrapping=""
        su <html> PRIMA del CSS, e data-app-mode-hint="analysis" se URL ha ?id=.
     b) Qui sotto disabilitiamo transition/animation per tutto durante bootstrap.
        Quando JS finisce init() + loadProfiles + initProfileLoader, rimuove
        data-bootstrapping → le transition tornano attive per le interazioni reali.
     c) Welcome-state nascosto su hint=analysis: T1 logo non flasha.
   ─────────────────────────────────────────── */

/* ═══════════════════════════════════════════
   T1 DEPTH SYSTEM · Livello 1 (tasti) e 2 (pannelli)
   Luci/ombre native — no texture. Glow solo su .is-on / .is-active.
   ═══════════════════════════════════════════ */
.t1-panel-3d {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    var(--t1-depth-highlight),
    var(--t1-depth-contact),
    var(--t1-depth-lift);
}

/* Sottopannello incassato (dettaglio impostazioni, well) */
.t1-panel-3d--well {
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    var(--t1-depth-well),
    var(--t1-depth-btn-highlight);
}

.t1-btn-3d {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.45);
  box-shadow:
    var(--t1-depth-btn-highlight),
    var(--t1-depth-btn-contact);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    filter 0.2s ease;
}

.t1-btn-3d:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    var(--t1-depth-btn-highlight),
    var(--t1-depth-btn-hover);
}

.t1-btn-3d:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    var(--t1-depth-btn-pressed),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Energia neon — solo stato attivo (non su :hover né :focus da soli) */
.t1-btn-3d.is-on,
.t1-btn-3d.is-active {
  box-shadow:
    var(--t1-depth-btn-highlight),
    var(--t1-depth-btn-contact),
    0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 22%, transparent);
}

/* Pendant: durante bootstrap niente transition/animation visibili.
   La sintassi html[data-bootstrapping] colpisce TUTTI i discendenti tramite *. */
html[data-bootstrapping] *,
html[data-bootstrapping] *::before,
html[data-bootstrapping] *::after {
  transition: none !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* Profilo con id in URL → mode finale sarà 'analysis': nascondi welcome-state
   subito, prima ancora che JS chiami setAppMode. Il #player-placeholder resta
   visibile fino a quando JS monta il video o mostra analysis-empty (no flash). */
html[data-app-mode-hint='analysis'] .welcome-state {
  visibility: hidden;
}

/* Scudo universale iter 5 (13 Maggio 2026): body invisibile durante bootstrap.
   Nasconde il layout shift "player centrato → player ridimensionato" che accade
   quando JS rimuove .is-startup da .notes-panel (~100-300ms dopo il paint).
   opacity:0 ≠ display:none → DOM/observer/getBoundingClientRect funzionano
   normalmente: Annotations, Drawing, Timeline si inizializzano correttamente.
   Il fade-in (0.18s) parte dopo il doppio rAF finale in init(), quando tutto
   il layout è già stabile. */
html[data-bootstrapping] body {
  opacity: 0;
  pointer-events: none;
}

/* Palco → Analizza (Fase 1): niente pagina nera — shell Studio + overlay player subito. */
html[data-cockpit-media-boot][data-bootstrapping] body {
  opacity: 1;
  pointer-events: none;
}

html[data-cockpit-media-boot][data-bootstrapping] .player-loading-overlay__pulse {
  animation-name: player-loading-spin !important;
  animation-duration: 0.85s !important;
  animation-timing-function: linear !important;
  animation-iteration-count: infinite !important;
  animation-delay: 0s !important;
}

html[data-cockpit-media-boot][data-bootstrapping] .player-loading-overlay:not([hidden]) {
  animation-name: player-loading-overlay-in !important;
  animation-duration: 0.35s !important;
  animation-fill-mode: both !important;
  animation-delay: 0s !important;
}

/* Palco → Analizza (?media_history=): no flash note profilo-wide prima della sessione. */
html[data-cockpit-notes-defer] .notes-feed-list {
  visibility: hidden;
}

body.app-shell {
  transition: opacity 0.18s ease-out;
}

/* Hint analysis: pre-mostra la notes-panel nonostante .is-startup.
   Senza questo, al first paint la notes-panel è display:none → il workspace
   occupa tutta la larghezza → player-wrapper è centrato e grande. Quando JS
   rimuove is-startup, notes appare, workspace si restringe, player si sposta.
   Con questa regola il layout è già nella geometria "post-sidebar" al first paint. */
html[data-app-mode-hint='analysis'] .notes-panel.is-startup {
  display: flex;
}

/* Tab resume protection iter 5 (13 Maggio 2026):
   Al ritorno foreground, Chrome fa 3 cose che producono flash visibili:
   1) Ricomputa backdrop-filter/filter GPU (notes-panel, rail, player)
   2) Riavvia animation infinite dal frame 0 (notes-led-sync, monorail-pulse, shape-pulse)
   3) Ripristina transition CSS per tutti gli elementi che cambiano al resume

   Strategia a 3 livelli per coprire tutti e tre:

   Livello 1 — Disable transitions (nessuna animazione per cambio stato al resume). */
html[data-tab-resuming] *,
html[data-tab-resuming] *::before,
html[data-tab-resuming] *::after {
  transition: none !important;
}

/* Livello 2 — Pause animation infinite: mantiene l'ultimo frame renderizzato
   invece di ricominciare da capo. Miriamo solo le animation continue che
   producono flash visibili (non le one-shot come notes-purge-veil-in). */
html[data-tab-resuming] .notes-feed-item.is-active-highlight .notes-feed-item__rail,
html[data-tab-resuming] .notes-feed-item.is-hover-link .notes-feed-item__rail,
html[data-tab-resuming] .shape-pending,
html[data-tab-resuming] .notes-panel.is-recording .notes-panel-header::after,
html[data-tab-resuming] .cockpit-transport[data-playing='1']::before,
html[data-tab-resuming] .sidebar-edge-blade::before {
  animation-play-state: paused !important;
}

/* Livello 3 — contain: paint su notes-panel: isola il layer GPU della panel
   così il browser non ridipinge il backdrop-filter nell'area visibile al resume.
   Rimosso insieme a data-tab-resuming dopo 500ms. */
html[data-tab-resuming] .notes-panel {
  contain: paint;
}

/* Livello 3b — solo media stage (non .player-wrapper: bordo vetro + contain = cornice visibile). */
html[data-tab-resuming] .player-media-stage {
  contain: paint;
}

/* Tab resume: niente ring focus browser su shell player (focus va al sentinel). */
#player-wrapper:focus {
  outline: none;
}

/* Ingresso cockpit con vein da Gateway (?vein= / sessionStorage) */
html[data-t1-entry-vein] body.app-shell {
  box-shadow: inset 0 0 min(120px, 22vw) color-mix(in srgb, var(--t1-entry-accent, transparent) 7%, transparent);
}

/* Texture tipo ossidiana / ghiaccio vulcanico — grain SVG + velo stratificato */
body.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: var(--t1-glass-noise-blend, soft-light);
  background-image: var(--t1-glass-noise-svg);
}

/* Grain globale più soft sotto la lastra rail+drawer (evita triplo gain col blur) */
body.app-shell:has(#sidebar.is-open):not(.is-zen)::before {
  opacity: var(--t1-glass-noise-body-muted, 0.018);
}

body.app-shell::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent 0,
      transparent 3px,
      rgba(255, 255, 255, 0.018) 3px,
      rgba(255, 255, 255, 0.018) 4px
    );
}

/* ═══════════════════════════════════════════
   LAYOUT — rail (z 200) | drawer profili (fixed z 150) | notes-panel (z 155 ↔ 120 se drawer aperto) | workspace
   ═══════════════════════════════════════════ */

/* ── Rail · Centro comando Santuario (857): profilo | 5 funzioni | contesto ── */
.sidebar-rail.rail-sidebar {
  width: var(--t1-rail-width);
  min-width: var(--t1-rail-width);
  max-width: var(--t1-rail-width);
  flex-shrink: 0;
  height: 100vh;
  position: relative;
  z-index: 200;
  isolation: isolate;
  background: rgba(6, 8, 14, 0.62);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-top: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 32%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 24%, transparent);
  border-right: none;
  border-bottom: none;
  box-shadow:
    var(--geo-plate-inset-cyan),
    var(--geo-plate-well),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(4vh, 2.35rem) 6px 14px;
  gap: 0;
}

/* Grain condiviso rail + drawer — tile fisso al viewport per continuità seam */
.sidebar-rail.rail-sidebar::after,
.sidebar-drawer.is-open::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: var(--t1-glass-noise-blend, soft-light);
  background-image: var(--t1-glass-noise-svg);
  background-size: 256px 256px;
  background-attachment: fixed;
}

.sidebar-rail.rail-sidebar::after {
  opacity: var(--t1-glass-noise-opacity-rail, 0.026);
}

.sidebar-drawer.is-open::after {
  opacity: var(--t1-glass-noise-opacity-drawer, 0.010);
}

/* Rail chiusa: ritaglia il pixel-edge destro del grain. */
body:not(:has(#sidebar.is-open)) .sidebar-rail.rail-sidebar::after {
  inset: 0 1px 0 0;
}

/* Slab aperto: stesso gain noise su rail e drawer */
body:has(#sidebar.is-open):not(.is-zen) .sidebar-rail.rail-sidebar::after,
body:has(#sidebar.is-open):not(.is-zen) .sidebar-drawer.is-open::after {
  opacity: var(--t1-glass-slab-noise-opacity, 0.024);
}

/* Cucitura rail → drawer — stesso materiale cristallo, seam quasi invisibile */
body:has(#sidebar.is-open):not(.is-zen) .sidebar-rail.rail-sidebar {
  background:
    linear-gradient(
      160deg,
      var(--t1-drawer-glass-pearl, rgba(232, 240, 250, 0.06)) 0%,
      var(--t1-drawer-glass-mid, rgba(10, 14, 22, 0.72)) 55%,
      var(--t1-drawer-glass-deep, rgba(6, 8, 14, 0.78)) 100%
    );
  backdrop-filter: blur(var(--t1-drawer-glass-blur, 18px)) saturate(var(--t1-drawer-glass-saturate, 1.16));
  -webkit-backdrop-filter: blur(var(--t1-drawer-glass-blur, 18px)) saturate(var(--t1-drawer-glass-saturate, 1.16));
  border-right: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body:has(#sidebar.is-glass-ready):not(.is-zen) .sidebar-rail.rail-sidebar {
  backdrop-filter: blur(var(--t1-drawer-glass-blur-ready, 20px)) saturate(1.18);
  -webkit-backdrop-filter: blur(var(--t1-drawer-glass-blur-ready, 20px)) saturate(1.18);
}

/* Slab aperto: wash drawer senza chiazze sul seam sinistro */
body:has(#sidebar.is-open):not(.is-zen) .sidebar-drawer.is-open::before {
  background: var(--t1-glass-wash-drawer-slab);
}

body:has(#sidebar.is-open):not(.is-zen) .sidebar-rail .rail-quadrant.is-active {
  filter: none;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.55),
    inset 1px 1px 0 rgba(0, 229, 255, 0.22),
    inset 0 -2px 10px rgba(0, 229, 255, 0.08);
}

body:has(#sidebar.is-open):not(.is-zen) .sidebar-rail .rail-quadrant.is-active .rail-quadrant-icon-cell {
  filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--t1-cyan) 28%, transparent));
}

.rail-command-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  contain: layout style;
  position: relative;
  z-index: 1;
}

.rail-zone--profile {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.rail-zone--functions {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2px;
  min-height: 0;
  width: 100%;
}

.rail-zone--context {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
}

/* ── Portal Context Gateway (icona compatta in rail) ─────────────────────── */
.rail-context-portal-wrap {
  flex-direction: column;
  align-items: center;
}

.rail-context-portal {
  position: relative;
  width: 100%;
  max-width: 52px;
  min-height: auto;
  padding: 4px 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-color: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(8, 10, 18, 0.65) 42%, rgba(4, 6, 12, 0.85) 100%);
  color: rgba(156, 163, 175, 0.82);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  outline: none;
  box-shadow:
    var(--geo-gem-inset),
    0 6px 14px rgba(0, 0, 0, 0.42),
    0 0 14px color-mix(in srgb, var(--t1-cyan) 12%, transparent);
  transition:
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Focus mode allineato ai quadranti: portale calmo a riposo */
.rail-context-portal:not(:disabled):not(:hover) .rail-context-portal__icon {
  opacity: 0.48;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-context-portal:not(:disabled):not(:hover) .rail-context-portal-inner .rail-quadrant-label {
  opacity: 0.48;
}

.rail-context-portal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  pointer-events: none;
}

.rail-context-portal-icon-cell {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-context-portal:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.rail-context-portal:not(:disabled):hover {
  color: var(--t1-cyan);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.1) 0%, rgba(8, 14, 22, 0.76) 55%, rgba(4, 8, 14, 0.9) 100%);
  border-color: rgba(0, 229, 255, 0.28);
  box-shadow:
    var(--geo-gem-inset),
    0 0 48px color-mix(in srgb, var(--t1-cyan) 18%, transparent),
    0 0 80px color-mix(in srgb, var(--t1-cyan) 8%, transparent),
    0 6px 16px rgba(0, 0, 0, 0.44);
  transform: translateY(-0.5px);
}

.rail-context-portal:not(:disabled):hover .rail-context-portal__icon {
  opacity: 1;
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--t1-cyan) 28%, transparent))
    drop-shadow(0 0 40px color-mix(in srgb, var(--t1-cyan) 12%, transparent));
}

.rail-context-portal:not(:disabled):hover .rail-context-portal-inner .rail-quadrant-label {
  opacity: 0.92;
}

.rail-context-portal:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--t1-cyan) 45%, transparent);
}

.rail-context-portal__icon {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-context-live-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transition:
    background var(--t-santuario-total),
    box-shadow var(--t-santuario-total);
}

.rail-context-live-dot.is-lit {
  background: var(--t1-cyan);
  box-shadow:
    0 0 8px color-mix(in srgb, var(--t1-cyan) 65%, transparent),
    0 0 14px color-mix(in srgb, var(--t1-cyan) 35%, transparent);
}

/* Gateway aperto: niente scroll sul documento; cockpit sfocato sotto (vedi regola .workspace). */
html.context-gateway-scroll-lock,
body.context-gateway-scroll-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.context-gateway-scroll-lock .workspace,
body.context-gateway-scroll-lock .notes-panel {
  filter: blur(15px);
  pointer-events: none;
  user-select: none;
  transition: filter var(--t-santuario-total);
}

/* §4.8 — anti multi-fetch switch profilo (Search / Archive → applyProfileSelection) */
body.is-profile-switch-loading main.workspace.is-loading,
body.is-profile-switch-loading #notes-panel.is-loading {
  pointer-events: none;
  cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
  body.context-gateway-scroll-lock .workspace,
  body.context-gateway-scroll-lock .notes-panel {
    transition-duration: 0.01ms !important;
  }
}

/* ── Context Gateway overlay ─────────────────────────────────────────────── */
/* ════════════════════════════════════════════════════════════════════════
   COSTELLAZIONE REBORN — Global Search (Fase 2.4.1)

   La modale Search non e' piu' una scatola: e' un Void cinematografico
   (filter blur+brightness sul workspace, identico all'Identity Hub) sopra
   cui fluttuano:
     • la pillola Search (titolo + input, glass cyan-tenue) in alto-centro
     • la X cristallina in alto-destra
     • le card cristallo, distribuite su ancore fisse N=1..4 o griglia
       ondulata per N>4 (vedi .count-1/2/3/4 / .count-many in Cantiere 3).
   ════════════════════════════════════════════════════════════════════════ */

.context-gateway-overlay {
  position: fixed;
  inset: 0;
  z-index: 11800;
  /* Niente shell: il "contenitore" e' tutto il viewport. Le coordinate delle
     card sono percentuali del viewport stesso. */
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--t-santuario-total),
    visibility var(--t-santuario-total);
}

.context-gateway-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* Sopra sipario clinico (12050) e HUD idle (168) — chrome chiudibile sempre */
  z-index: 12100;
}

/* ─── Pillola Search fluttuante (alto-centro, glass cyan-tenue) ─── */
.context-gateway-fly-bar {
  position: absolute;
  z-index: 3;
  top: 14%;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  width: min(820px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  /* Vetro pearl + accent cyan SOLO sul bordo/glow, niente background cyan. */
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.07) 0%,
      rgba(10, 14, 22, 0.55) 60%,
      rgba(6, 8, 14, 0.62) 100%);
  border: 1px solid rgba(0, 229, 255, 0.18);
  backdrop-filter: blur(12px) saturate(1.14);
  -webkit-backdrop-filter: blur(12px) saturate(1.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 22px color-mix(in srgb, var(--t1-cyan) 6%, transparent),
    0 14px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition:
    opacity var(--t-santuario-total),
    transform var(--t-santuario-total);
}

.context-gateway-overlay.is-open .context-gateway-fly-bar {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.context-gateway-fly-title {
  margin: 0 2px;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: color-mix(in srgb, var(--t1-cyan) 55%, var(--t1-helm-frost-muted));
  flex-shrink: 0;
  white-space: nowrap;
}

.context-gateway-fly-hint {
  margin: 0 2px;
  width: auto;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--t1-helm-frost-muted);
}

.context-gateway-fly-input {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(248, 250, 252, 0.94);
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.85rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color var(--t-santuario-total),
    box-shadow var(--t-santuario-total),
    background var(--t-santuario-total);
}

.context-gateway-fly-input::-webkit-search-cancel-button,
.context-gateway-fly-input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.context-gateway-fly-input::placeholder {
  color: rgba(156, 163, 175, 0.65);
  font-style: normal;
}

.context-gateway-fly-input:focus {
  border-color: color-mix(in srgb, var(--t1-cyan) 38%, transparent);
  background: rgba(0, 0, 0, 0.32);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--t1-cyan) 22%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--t1-cyan) 5%, transparent);
}

.context-gateway-fly-status {
  margin: 0;
  min-height: 0;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.58rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 90%, var(--t1-cyan) 10%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-gateway-fly-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 1.75rem;
  margin: 0 2px;
}

.context-gateway-fly-meta__start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.context-gateway-fly-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.context-gateway-fly-link {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--t1-cyan) 68%, var(--t1-helm-frost) 32%);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--t1-cyan) 24%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.context-gateway-fly-link:hover,
.context-gateway-fly-link:focus-visible {
  outline: none;
  color: var(--t1-cyan);
}

.context-gateway-fly-link[hidden],
.context-gateway-pager[hidden] {
  display: none !important;
}

.context-gateway-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

.context-gateway-pager__btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--t1-silver, #9aa5b1) 22%, transparent);
  background: color-mix(in srgb, rgba(0, 0, 0, 0.28) 100%, transparent);
  color: var(--t1-helm-frost);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.context-gateway-pager__btn:hover:not(:disabled),
.context-gateway-pager__btn:focus-visible:not(:disabled) {
  outline: none;
  border-color: color-mix(in srgb, var(--t1-cyan) 35%, transparent);
  color: var(--t1-cyan);
}

.context-gateway-pager__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.context-gateway-pager__label {
  min-width: 3.2rem;
  text-align: center;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 88%, var(--t1-cyan) 12%);
}

/* ─── X cristallina fluttuante (alto-destra) ─── */
.context-gateway-fly-close {
  position: absolute;
  z-index: 4;
  /* Allineata verticalmente alla pillola (top 9.5% — Fase 2.4.2). */
  top: 14%;
  right: 5%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 240, 250, 0.16);
  border-radius: 50%;
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.10) 0%,
      rgba(10, 14, 22, 0.55) 100%);
  backdrop-filter: blur(20px) saturate(1.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 8px 20px rgba(0, 0, 0, 0.5);
  color: color-mix(in srgb, var(--t1-pearl) 75%, var(--t1-helm-frost-muted));
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition:
    color var(--t-santuario-total),
    background var(--t-santuario-total),
    border-color var(--t-santuario-total),
    box-shadow var(--t-santuario-total),
    opacity var(--t-santuario-total),
    transform var(--t-santuario-total);
}

.context-gateway-overlay.is-open .context-gateway-fly-close {
  opacity: 1;
  transform: scale(1);
}

.context-gateway-fly-close:hover,
.context-gateway-fly-close:focus-visible {
  outline: none;
  color: var(--t1-pearl);
  border-color: color-mix(in srgb, var(--t1-pearl) 45%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 calc(20px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 24%, transparent),
    0 8px 20px rgba(0, 0, 0, 0.55);
}

/* ─── Grid canvas posizionale: niente padding visivo, riempie tutto il viewport ─── */
.context-gateway-grid {
  position: relative;
  inset: auto;
  z-index: 1;
  pointer-events: auto;
}
.context-gateway-grid > * {
  pointer-events: auto;
}

.context-gateway-fly-bar .context-gateway-grid {
  margin-top: 2px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
  padding: 2px;
  overflow: visible;
}

.context-gateway-fly-bar.context-gateway-fly-bar--3x3 {
  width: min(860px, 96vw);
}

.context-gateway-fly-bar .context-gateway-grid.context-gateway-grid--3x3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.context-gateway-fly-bar .context-gateway-grid--3x3 .context-gateway-card--compact {
  min-height: 142px;
  padding: 10px 11px 8px;
}

.context-gateway-fly-bar .context-gateway-grid--3x3 .context-gateway-card--compact .context-gateway-card__avatar {
  width: 40px;
  height: 40px;
  font-size: 0.74rem;
}

.context-gateway-fly-bar .context-gateway-grid--3x3 .context-gateway-card--compact .context-gateway-card__name {
  font-size: 0.8rem;
}

.context-gateway-fly-bar .context-gateway-grid--3x3 .context-gateway-card--compact .context-gateway-card__session {
  font-size: 0.62rem;
  -webkit-line-clamp: 1;
}

.context-gateway-empty {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  margin: 0;
  padding: 12px 10px 6px;
  text-align: left;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: rgba(156, 163, 175, 0.85);
}

.context-gateway-empty.context-gateway-empty--dock {
  grid-column: 1 / -1;
}

/* ────────────────────────────────────────────────────────────────────────
   AVATAR · Peek card (anteprima identità) — hover-driven
     • Compare a destra del rail, allineata alla zona profile
     • Glass semitrasparente, accent PERLA (coerente con avatar)
     • Z-index sotto agli overlay sidebar (Settings/AI) ma sopra al cockpit
   ──────────────────────────────────────────────────────────────────────── */
/* ────────────────────────────────────────────────────────────────────────
   LINGUAGGIO DEL VETRO · .t1-glass-peek
     Utility riusabile per anteprime "sola lettura" semitrasparenti.
     Oggi applicata a: avatar peek (rail-profile-peek).
     Pronta per: hover preview Vault sessioni, hover STAMP export queue,
                 tooltip ricchi su badge cartelle cliniche.
     Regola di sistema: vetro = informazione / pannello solido = azione.
   ──────────────────────────────────────────────────────────────────────── */
.t1-glass-peek {
  position: fixed;
  z-index: 62;
  opacity: 0;
  /* Slide più ampio: parte da "dietro la rail" (-40px) e scivola fuori, come
     se la barra laterale generasse la glass — "luce che esce dalla rail". */
  transform: translateX(-40px);
  pointer-events: none;
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.04) 0%,
      rgba(10, 14, 22, 0.55) 50%,
      rgba(6, 8, 14, 0.65) 100%);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 14%, rgba(255, 255, 255, 0.05));
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.45),
    0 0 calc(32px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--cockpit-focus-ease, 320ms cubic-bezier(0.22, 1, 0.36, 1));
}
.t1-glass-peek.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* AVATAR · Mini peek — tooltip ricco hover-driven (livello 1 di 3).
   Solo identità essenziale (avatar+nome+sub). Click sull'avatar apre il vero
   Identity Hub centrale, dove vivono i dati estesi. */
.rail-profile-peek {
  top: 70px;
  left: 96px;
  width: 220px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid color-mix(in srgb, var(--t1-pearl) 28%, rgba(255, 255, 255, 0.08));
}

/* Linea di luce sul bordo sinistro: gradient perla che simula la rail che
   "fa luce" sul tooltip. Discreta, da tooltip non da pannello. */
.rail-profile-peek::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 14px 0 0 14px;
  background:
    linear-gradient(180deg,
      transparent 0%,
      color-mix(in srgb, var(--t1-pearl) 22%, transparent) 50%,
      transparent 100%);
  pointer-events: none;
}

/* Mini-tooltip: nascondo le sezioni dettagliate (rows + cta).
   I dati estesi vivono adesso nell'Identity Hub centrale (click avatar). */
.rail-profile-peek .rail-profile-peek__rows,
.rail-profile-peek .rail-profile-peek__cta {
  display: none;
}

.rail-profile-peek[hidden] {
  display: none !important;
}

.rail-profile-peek.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.rail-profile-peek__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 0;
  border-bottom: none;
  flex-shrink: 0;
}

.rail-profile-peek__avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--t1-pearl);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 35%, rgba(255, 255, 255, 0.18));
}

.rail-profile-peek__id {
  flex: 1;
  min-width: 0;
}

.rail-profile-peek__name {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--t1-pearl);
  margin: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-profile-peek__sub {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--t1-helm-frost-muted);
  margin: 2px 0 0;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rail-profile-peek__rows {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.rail-profile-peek__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rail-profile-peek__row dt {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  flex-shrink: 0;
}

.rail-profile-peek__row dd {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--t1-helm-frost);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.rail-profile-peek__cta {
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--t1-pearl) 45%, var(--t1-helm-frost-muted));
  text-align: center;
  flex-shrink: 0;
}

.rail-profile-peek[data-peek-mode='idle'] .rail-profile-peek__cta {
  color: var(--t1-helm-frost-muted);
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  .t1-glass-peek,
  .rail-profile-peek {
    transition-duration: 0.01ms !important;
  }
}

/* ────────────────────────────────────────────────────────────────────────
   ENGINE · Source Hub — divider tra campo URL e drop-zone
     "oppure trascina qui" come terza via d'ingresso (drag&drop URL)
   ──────────────────────────────────────────────────────────────────────── */
.engine-source-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  user-select: none;
}

.engine-source-divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
}

.engine-source-divider__label {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  flex-shrink: 0;
}

.engine-ephemeral-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.engine-clear-btn {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--t1-amber-ghost, #ffbf00) 28%, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--t1-amber-ghost, #ffbf00) 6%, rgba(8, 12, 20, 0.65));
  color: color-mix(in srgb, var(--t1-amber-ghost, #ffbf00) 75%, var(--t1-pearl));
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.engine-clear-btn:hover {
  border-color: color-mix(in srgb, var(--t1-amber-ghost, #ffbf00) 45%, rgba(255, 255, 255, 0.12));
  color: var(--t1-pearl);
  background: color-mix(in srgb, var(--t1-amber-ghost, #ffbf00) 12%, rgba(12, 14, 22, 0.75));
}

.engine-clear-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--t1-amber-ghost, #ffbf00) 55%, transparent);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════
   COSTELLAZIONE REBORN — Card cristallo (Fase 2.4.1)

   Riscrittura totale del linguaggio card per la Search:
     • Dimensioni Hub-like (250×min-220, padding 22 24 18), avatar 64px
     • Linguaggio del Vetro: backdrop-filter blur 22 saturate 1.18, edge
       highlight zenitale, inset glow, shadow 18×48 (galleggiamento).
     • Palette riequilibrata sul perla (warm = scintilla, non vernice):
         - .glass-crystal → ATTIVO: pearl puro, ring perla avatar
         - .glass-ice     → RECENTI: pearl base + highlight cyan zenitale
         - .glass-warm    → ARCHIVIO VUOTO: pearl muted + accent ambra solo
                            sul counter e su un puntino dell'avatar.
     • Layout: position absolute con ancore fisse per N=1..4 (.count-1/2/3/4),
       fallback griglia ondulata ±14px per .count-many.
   ════════════════════════════════════════════════════════════════════════ */

/* ─── BASE CARD · cristallo Hub-like (Fase 2.4.2: respiro + profondita) ─── */
.context-gateway-card {
  position: absolute;
  /* 276×244 (Fase 2.4.2.1): width ridotta da 288 → 276 (-4.2%) per dare ~+5% di
     "margine di sicurezza" laterale tra card adiacenti SENZA toccare le ancore
     percentuali (count-N). Cosi' i vetri non si sfiorano anche con nomi atleti
     molto lunghi (Tizianbenedetto, etc.). Scale uniforme 1.00 anche su warm —
     la differenza fra varianti vive solo in accent/glow/opacity, non in size. */
  width: 276px;
  min-height: 244px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 26px 22px 20px;
  border-radius: 18px;
  /* Fase 2.7-polish — Costellazione visibility tweak.
     border 0.16 → 0.22  (+37%) e pearl stop 0.06 → 0.09 (+50%) ora vivono
     come token semantici in styles/tokens.css (--gateway-card-border /
     --gateway-card-pearl-top): cambiarli in un solo posto retariera
     l'intero "spessore" delle card. Background lower-stop e box-shadow
     invariati per non alterare la gerarchia di profondita' (3D feel intatto). */
  border: 1px solid var(--gateway-card-border);
  background:
    linear-gradient(160deg,
      var(--gateway-card-pearl-top) 0%,
      rgba(10, 14, 22, 0.55) 60%,
      rgba(6, 8, 14, 0.65) 100%);
  /* Blur 28 + saturate 1.22 (Fase 2.4.2): "spessore 5mm" — non piu' fogli di
     carta trasparenti, oggetti di vetro tangibili. */
  backdrop-filter: blur(28px) saturate(1.22);
  -webkit-backdrop-filter: blur(28px) saturate(1.22);
  /* Layered shadow stratificata (Fase 2.4.2):
       • edge highlight zenitale rinforzato a 0.26 (era 0.18) → "vetro grosso"
       • inset glow morbido pearl 6% → bagliore interno
       • shadow esterna ampia: 0 28×64 (stacco profondo) + 0 8×20 (ombra
         ravvicinata sul "tavolo"). Doppia ombra = oggetto fisico vero. */
  box-shadow:
    var(--t1-depth-highlight),
    inset 0 0 26px color-mix(in srgb, var(--t1-pearl) 6%, transparent),
    var(--t1-depth-contact),
    var(--t1-depth-lift);
  color: var(--t1-helm-frost);
  cursor: pointer;
  outline: none;
  transition:
    color var(--t-santuario-total),
    background var(--t-santuario-total),
    border-color var(--t-santuario-total),
    box-shadow var(--t-santuario-total),
    transform var(--t-santuario-total),
    filter var(--t-santuario-total),
    opacity var(--t-santuario-total);
}

/* Specular highlight diagonale (Fase 2.4.2): l'angolo alto-sx riflette
   "luce" come un cristallo lucidato. Riproduce il vocabolario dell'Hub. */
.context-gateway-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--t1-pearl) 14%, transparent) 0%,
    color-mix(in srgb, var(--t1-pearl) 4%, transparent) 20%,
    transparent 45%);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity var(--t-santuario-total);
}
.context-gateway-card:hover::after,
.context-gateway-card:focus-visible::after {
  opacity: 1;
}

.context-gateway-card.is-selected {
  /* Legacy class — Reborn la mantiene per coerenza con DOM esistente */
  border-color: color-mix(in srgb, var(--t1-pearl) 35%, rgba(255, 255, 255, 0.14));
}

/* ─── SOTTO-ELEMENTI · dimensioni Hub-like ─── */
.context-gateway-card__avatar {
  position: relative;
  /* Fase 2.4.2: 76px (era 64) — presenza del "soggetto", senza diventare
     una seconda Identity Hub (180px sarebbe troppo). */
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  background: rgba(10, 14, 22, 0.78);
  color: rgba(248, 250, 252, 0.94);
  border: 1px solid rgba(232, 240, 250, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
  margin-top: 6px;
  /* z-index sopra ::after, cosi' lo specular highlight non lo copre */
  z-index: 1;
}

/* Tutti i sotto-elementi: position relative + z-index 1 per stare SOPRA il
   ::after specular della card (altrimenti il gradient diagonale li copre). */
.context-gateway-card__name {
  position: relative;
  z-index: 1;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
  word-break: break-word;
  color: var(--t1-helm-frost);
}

.context-gateway-card__session {
  position: relative;
  z-index: 1;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(180, 188, 196, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.context-gateway-card__archive-empty {
  position: relative;
  z-index: 1;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(212, 208, 200, 0.66);
  letter-spacing: 0.02em;
}

.context-gateway-card__cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(180, 188, 196, 0.85);
}

.context-gateway-card__cta-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  border-radius: 4px;
  font-size: 1em;
  line-height: 1;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.context-gateway-card__kind {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--t1-silver, #9aa5b1) 25%, transparent);
  background: color-mix(in srgb, rgba(0, 0, 0, 0.22) 100%, transparent);
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 92%, transparent);
}

.context-gateway-card--project .context-gateway-card__kind {
  border-color: color-mix(in srgb, var(--gw-world-accent, #3dcc9a) 32%, transparent);
  color: color-mix(in srgb, var(--gw-world-accent, #3dcc9a) 72%, rgba(248, 250, 252, 0.86));
}

/* Lente Search — conserva il linguaggio card, ridotto in formato mini. */
.context-gateway-fly-bar .context-gateway-card--compact {
  position: relative;
  inset: auto;
  width: auto;
  min-height: 168px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  backdrop-filter: blur(12px) saturate(1.14);
  -webkit-backdrop-filter: blur(12px) saturate(1.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 18px color-mix(in srgb, var(--t1-pearl) 4%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.42);
}

.context-gateway-fly-bar .context-gateway-card--compact .context-gateway-card__avatar {
  width: 44px;
  height: 44px;
  margin-top: 0;
  font-size: 0.8rem;
}

.context-gateway-fly-bar .context-gateway-card--compact .context-gateway-card__name {
  font-size: 0.84rem;
  line-height: 1.24;
}

.context-gateway-fly-bar .context-gateway-card--compact .context-gateway-card__session {
  font-size: 0.66rem;
  line-height: 1.32;
  -webkit-line-clamp: 2;
}

.context-gateway-fly-bar .context-gateway-card--compact .context-gateway-card__counter {
  margin-top: 2px;
  padding-top: 6px;
  font-size: 0.52rem;
  letter-spacing: 0.11em;
}

.context-gateway-fly-bar .context-gateway-card--compact.context-gateway-card--project .context-gateway-card__avatar {
  border-radius: 11px;
}

/* ─── COUNTER MONO · accent point variante-specifico ─── */
.context-gateway-card__counter {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 400;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 88%, transparent);
  opacity: 0.85;
  transition: color var(--t-santuario-total), opacity var(--t-santuario-total);
}

/* ════════════════════════════════════════════════════════════════════════
   VARIANTI · "Scintille, non vernici" — palette pearl-dominated
   ════════════════════════════════════════════════════════════════════════ */

/* ─── CRYSTAL · profilo ATTIVO (pearl puro + ring perla) ─── */
.context-gateway-card.glass-crystal {
  border-color: color-mix(in srgb, var(--t1-pearl) 30%, rgba(255, 255, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 24px color-mix(in srgb, var(--t1-pearl) 10%, transparent),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 calc(24px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 18%, transparent);
  z-index: 3;
}
.context-gateway-card.glass-crystal .context-gateway-card__avatar {
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--t1-pearl) 62%, transparent),
    0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 24%, transparent);
  border-color: color-mix(in srgb, var(--t1-pearl) 52%, rgba(255, 255, 255, 0.18));
}
.context-gateway-card.glass-crystal .context-gateway-card__counter {
  color: color-mix(in srgb, var(--t1-pearl) 58%, var(--t1-helm-frost-muted));
  opacity: 0.95;
}

/* ─── ICE · profili con SESSIONI (pearl base + highlight cyan zenitale) ─── */
.context-gateway-card.glass-ice {
  /* Stesso background del crystal: la differenza vive nei bordi e nell'edge top */
  border-color: color-mix(in srgb, var(--geo-ice-cyan) 22%, rgba(232, 240, 250, 0.10));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--geo-ice-cyan) 35%, rgba(255, 255, 255, 0.20)),
    inset 0 0 22px color-mix(in srgb, var(--geo-ice-cyan) 6%, transparent),
    0 18px 48px rgba(0, 0, 0, 0.52);
  z-index: 2;
}
.context-gateway-card.glass-ice .context-gateway-card__counter {
  color: color-mix(in srgb, var(--geo-ice-cyan) 32%, var(--t1-helm-frost-muted));
}

/* ─── WARM · ARCHIVIO VUOTO (pearl muted + accent ambra come scintilla) ─── */
.context-gateway-card.glass-warm {
  /* IMPORTANTE: niente background ambra. Manteniamo il pearl base, solo muted. */
  border-color: rgba(232, 240, 250, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 18px rgba(232, 240, 250, 0.04),
    0 14px 40px rgba(0, 0, 0, 0.48);
  opacity: 0.88;
  z-index: 1;
}
/* Puntino ambra sull'avatar (badge in alto-dx, 8px) — UNICO segno cromatico warm */
.context-gateway-card.glass-warm .context-gateway-card__avatar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t1-amber-ghost);
  box-shadow: 0 0 8px color-mix(in srgb, var(--t1-amber-ghost) 60%, transparent);
}
.context-gateway-card.glass-warm .context-gateway-card__counter,
.context-gateway-card.glass-warm .context-gateway-card__archive-empty {
  /* Counter "ARCHIVIO VUOTO" in ambra → l'unico accent cromatico della card */
  color: color-mix(in srgb, var(--t1-amber-ghost) 60%, var(--t1-helm-frost-muted));
  opacity: 0.88;
}
.context-gateway-card.glass-warm .context-gateway-card__cta {
  color: color-mix(in srgb, var(--t1-amber-ghost) 50%, var(--t1-helm-frost-muted));
}

/* ════════════════════════════════════════════════════════════════════════
   HOVER · saturate + scale +0.04 + glow del proprio accent
   (Le ancore fisse continuano a determinare top/left; hover modifica solo
    transform tramite scale via custom property --gw-scale.)
   ════════════════════════════════════════════════════════════════════════ */

.context-gateway-card.glass-crystal:hover,
.context-gateway-card.glass-crystal:focus-visible {
  filter: saturate(1.18);
  z-index: 6;
  border-color: color-mix(in srgb, var(--t1-pearl) 48%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 0 28px color-mix(in srgb, var(--t1-pearl) 14%, transparent),
    0 22px 56px rgba(0, 0, 0, 0.62),
    0 0 calc(40px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 32%, transparent);
}

.context-gateway-card.glass-ice:hover,
.context-gateway-card.glass-ice:focus-visible {
  filter: saturate(1.18);
  z-index: 6;
  border-color: color-mix(in srgb, var(--geo-ice-cyan) 48%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--geo-ice-cyan) 50%, rgba(255, 255, 255, 0.28)),
    inset 0 0 26px color-mix(in srgb, var(--geo-ice-cyan) 14%, transparent),
    0 22px 56px rgba(0, 0, 0, 0.58),
    0 0 calc(34px * var(--neon-glow-intensity)) color-mix(in srgb, var(--geo-ice-cyan) 32%, transparent);
}
.context-gateway-card.glass-ice:hover .context-gateway-card__counter {
  color: color-mix(in srgb, var(--geo-ice-cyan) 55%, var(--t1-helm-frost));
}

.context-gateway-card.glass-warm:hover,
.context-gateway-card.glass-warm:focus-visible {
  filter: saturate(1.18);
  z-index: 6;
  opacity: 1;
  border-color: color-mix(in srgb, var(--t1-amber-ghost) 38%, rgba(232, 240, 250, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 22px color-mix(in srgb, var(--t1-amber-ghost) 8%, transparent),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 calc(28px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-amber-ghost) 22%, transparent);
}
.context-gateway-card.glass-warm:hover .context-gateway-card__counter,
.context-gateway-card.glass-warm:hover .context-gateway-card__archive-empty {
  color: color-mix(in srgb, var(--t1-amber-ghost) 78%, var(--t1-helm-frost));
  opacity: 1;
}

.context-gateway-card:hover .context-gateway-card__counter,
.context-gateway-card:focus-visible .context-gateway-card__counter {
  opacity: 1;
}
.context-gateway-card:hover .context-gateway-card__cta,
.context-gateway-card:focus-visible .context-gateway-card__cta {
  color: var(--t1-pearl);
}
.context-gateway-card:hover .context-gateway-card__cta-plus,
.context-gateway-card:focus-visible .context-gateway-card__cta-plus {
  border-color: color-mix(in srgb, var(--t1-pearl) 40%, transparent);
  background: color-mix(in srgb, var(--t1-pearl) 6%, transparent);
}

/* ════════════════════════════════════════════════════════════════════════
   ANCORE FISSE · dispersione asimmetrica N=1..4 nel Void

   Le coordinate sono percentuali del viewport (.context-gateway-grid e' inset:0).
   Ogni card e' centrata sul suo punto con translate(-50%, -50%) e include
   uno scale base (.scale-active 1.04, ghost 0.94).
   ════════════════════════════════════════════════════════════════════════ */

.context-gateway-grid.count-1 .context-gateway-card:nth-child(1),
.context-gateway-grid.count-2 .context-gateway-card:nth-child(1),
.context-gateway-grid.count-2 .context-gateway-card:nth-child(2),
.context-gateway-grid.count-3 .context-gateway-card:nth-child(1),
.context-gateway-grid.count-3 .context-gateway-card:nth-child(2),
.context-gateway-grid.count-3 .context-gateway-card:nth-child(3),
.context-gateway-grid.count-4 .context-gateway-card:nth-child(1),
.context-gateway-grid.count-4 .context-gateway-card:nth-child(2),
.context-gateway-grid.count-4 .context-gateway-card:nth-child(3),
.context-gateway-grid.count-4 .context-gateway-card:nth-child(4) {
  transform: translate(-50%, -50%);
}

/* Fase 2.4.2 — "Sparso studiato": coordinate piu' aperte (~50% di spread,
   non piu' ~40%) e SIMMETRIA SPEZZATA con micro-offset 4% tra coppie.
   Risultato: "disordine progettato" che l'occhio percepisce come naturale. */

/* N=1 — card centrale, scala maggiore */
.context-gateway-grid.count-1 .context-gateway-card:nth-child(1) {
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.06);
}

/* N=2 — diagonale aperta (spread ~38% in piu' rispetto a 2.4.1) */
.context-gateway-grid.count-2 .context-gateway-card:nth-child(1) { top: 36%; left: 26%; }
.context-gateway-grid.count-2 .context-gateway-card:nth-child(2) { top: 64%; left: 74%; }

/* N=3 — triangolo aperto con apice basso-centro */
.context-gateway-grid.count-3 .context-gateway-card:nth-child(1) { top: 30%; left: 22%; }
.context-gateway-grid.count-3 .context-gateway-card:nth-child(2) { top: 34%; left: 76%; }
.context-gateway-grid.count-3 .context-gateway-card:nth-child(3) { top: 74%; left: 48%; }

/* N=4 — rombo asimmetrico SPEZZATO (la formula del "respiro"):
     Card 1 (crystal):  top 30 / left 19   ← perno alto-sinistro
     Card 2 (ice):      top 26 / left 73   ← INTENZIONALMENTE piu' alta di card 1
     Card 3 (warm):     top 72 / left 25   ← INTENZIONALMENTE piu' a dx di card 1
     Card 4 (warm):     top 76 / left 78   ← INTENZIONALMENTE piu' bassa di card 3
   Spread orizzontale ~54%, verticale ~48%. Vuoto centrale generoso.
   Gli offset di 4% rompono la perfetta simmetria del rombo → naturale. */
.context-gateway-grid.count-4 .context-gateway-card:nth-child(1) { top: 30%; left: 19%; }
.context-gateway-grid.count-4 .context-gateway-card:nth-child(2) { top: 26%; left: 73%; }
.context-gateway-grid.count-4 .context-gateway-card:nth-child(3) { top: 72%; left: 25%; }
.context-gateway-grid.count-4 .context-gateway-card:nth-child(4) { top: 76%; left: 78%; }

/* Ghost card (sempre l'ULTIMA) — Fase 2.4.2.2 "centro-bocca":
   La ghost si ancora al punto focale naturale dello sguardo (~60% verticale,
   altezza visiva di bocca/barba del soggetto nel video master), non piu' in
   basso. Bilancia spazialmente la "Costellazione" quando l'utente cerca un
   profilo e non lo trova: l'azione di creazione e' al centro, dove l'occhio
   gia' si trova.
     • count-1 (search vuota / nessun match): ghost SOLA al centro-bocca
     • count-2: ghost al centro-bocca, fra le 2 card in diagonale
     • count-3: ghost in alto-destra (eccezione: count-3 ha gia' card3 al
       centro-basso, il centro e' occupato. Mantenuta posizione alto-dx).
     • count-4: ghost al centro perfetto (i 4 angoli sono liberi al centro). */
.context-gateway-grid.count-1 .context-gateway-card--ghost,
.context-gateway-grid.count-2 .context-gateway-card--ghost,
.context-gateway-grid.count-3 .context-gateway-card--ghost,
.context-gateway-grid.count-4 .context-gateway-card--ghost {
  transform: translate(-50%, -50%);
}
/* B4 — ghost parzialmente visibile sotto la card profilo a riposo (hover: scale/glow globale gateway) */
.context-gateway-grid.count-1 .context-gateway-card--ghost { top: 74%; left: 50%; }
.context-gateway-grid.count-2 .context-gateway-card--ghost { top: 72%; left: 50%; }
.context-gateway-grid.count-3 .context-gateway-card--ghost { top: 22%; left: 64%; }
.context-gateway-grid.count-4 .context-gateway-card--ghost { top: 56%; left: 50%; }

/* Scale base per crystal (Fase 2.4.2: warm non si rimpicciolisce piu' —
   la dignita visiva e' uguale per tutti, la differenza vive in accent/glow). */
.context-gateway-grid.count-2 .context-gateway-card.glass-crystal:nth-child(1),
.context-gateway-grid.count-3 .context-gateway-card.glass-crystal:nth-child(1),
.context-gateway-grid.count-4 .context-gateway-card.glass-crystal:nth-child(1) {
  transform: translate(-50%, -50%) scale(1.04);
}

/* Hover su ancora fissa: scala uniforme +0.04 (crystal +0.06 per il primato) */
.context-gateway-grid[class*="count-"] .context-gateway-card:hover,
.context-gateway-grid[class*="count-"] .context-gateway-card:focus-visible {
  transform: translate(-50%, -50%) scale(1.04);
}
.context-gateway-grid[class*="count-"] .context-gateway-card.glass-crystal:hover,
.context-gateway-grid[class*="count-"] .context-gateway-card.glass-crystal:focus-visible {
  transform: translate(-50%, -50%) scale(1.08);
}

/* ════════════════════════════════════════════════════════════════════════
   FALLBACK · count-many (N > 4): griglia ordinata con onde marcate ±14px
   ════════════════════════════════════════════════════════════════════════ */

.context-gateway-grid.count-many {
  position: absolute;
  inset: 14% 8% 12% 8%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px 18px;
  align-content: start;
  overflow-y: auto;
  padding: 16px 4px;
}
.count-many .context-gateway-card {
  position: relative;
  inset: auto;
  width: auto;
  /* Il grid auto-fit gestisce la larghezza. min-height resta per coerenza Hub-like. */
}
.count-many .context-gateway-card:nth-child(odd) {
  transform: translateY(-14px);
}
.count-many .context-gateway-card:nth-child(even) {
  transform: translateY(14px);
}
.count-many .context-gateway-card.glass-crystal:nth-child(odd) {
  transform: translateY(-14px) scale(1.04);
}
.count-many .context-gateway-card.glass-crystal:nth-child(even) {
  transform: translateY(14px) scale(1.04);
}
/* Fase 2.4.2: warm non si rimpicciolisce, mantiene la dignita delle altre */
.count-many .context-gateway-card:hover,
.count-many .context-gateway-card:focus-visible {
  transform: translateY(0) scale(1.06);
}

/* Overflow soglia (N > 12): griglia pulita, niente onde — scansione veloce */
.context-gateway-grid.count-many.is-overflow .context-gateway-card,
.context-gateway-grid.count-many.is-overflow .context-gateway-card:nth-child(odd),
.context-gateway-grid.count-many.is-overflow .context-gateway-card:nth-child(even) {
  transform: none;
}
.context-gateway-grid.count-many.is-overflow .context-gateway-card.glass-crystal {
  transform: scale(1.02);
}
.context-gateway-grid.count-many.is-overflow .context-gateway-card:hover,
.context-gateway-grid.count-many.is-overflow .context-gateway-card:focus-visible {
  transform: scale(1.04);
}

/* ════════════════════════════════════════════════════════════════════════
   GHOST CARD · "+ Profilo" (cristallo dashed, dimensioni Hub-like)
   ════════════════════════════════════════════════════════════════════════ */

.context-gateway-card.context-gateway-card--ghost {
  width: 200px;
  min-height: 180px;
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.04) 0%,
      rgba(10, 14, 22, 0.45) 100%);
  /* Bordo dashed pearl a 15% (Fase 2.4.2.1): "invito" — perimetro tratteggiato,
     non vetro pieno. Suggerisce che la card e' pronta ad essere "riempita"
     dall'azione di creazione. Differenzia visivamente l'AZIONE dall'IDENTITA'. */
  border: 1px dashed color-mix(in srgb, var(--t1-pearl) 15%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(1.10);
  -webkit-backdrop-filter: blur(18px) saturate(1.10);
  justify-content: center;
  gap: 8px;
  opacity: 0.74;
  color: color-mix(in srgb, var(--t1-pearl) 55%, var(--t1-helm-frost-muted));
  z-index: 1;
}
.context-gateway-card.context-gateway-card--ghost:hover,
.context-gateway-card.context-gateway-card--ghost:focus-visible {
  opacity: 1;
  filter: saturate(1.18);
  /* Hover: bordo dashed sale da 15% a 55% — l'invito "si accende" quando
     l'utente ci si avvicina, mantenendo il pattern tratteggiato. */
  border-color: color-mix(in srgb, var(--t1-pearl) 55%, transparent);
  background:
    linear-gradient(160deg,
      color-mix(in srgb, var(--t1-pearl) 5%, rgba(10, 14, 22, 0.55)) 0%,
      rgba(10, 14, 22, 0.55) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    inset 0 0 22px color-mix(in srgb, var(--t1-pearl) 8%, transparent),
    0 0 calc(26px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 24%, transparent),
    0 14px 36px rgba(0, 0, 0, 0.5);
  color: var(--t1-pearl);
  z-index: 6;
}

.context-gateway-fly-bar .context-gateway-card.context-gateway-card--ghost.context-gateway-card--compact {
  width: auto;
  min-height: 132px;
  padding: 10px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.context-gateway-card__plus {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 2.2rem;
  font-weight: 200;
  line-height: 1;
  color: inherit;
}
.context-gateway-card__ghost-label {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: inherit;
}

/* ─── Reduced motion: ancore restano (sono layout, non animazione),
       niente scale dynamics in hover/onde. ─── */
@media (prefers-reduced-motion: reduce) {
  .count-many .context-gateway-card,
  .count-many .context-gateway-card:nth-child(odd),
  .count-many .context-gateway-card:nth-child(even) {
    transform: none !important;
  }
  .context-gateway-card,
  .context-gateway-fly-bar,
  .context-gateway-fly-close {
    transition-duration: 0.01ms !important;
  }
}

.rail-profile-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.rail-profile-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.rail-profile-icon-cell {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-profile-meta {
  width: 100%;
  /* Fase 3.0.1-polish iter 3 (12 Maggio 2026, sera): riserva spazio per il link
     YouTube anche quando l'<a> è hidden. Senza questo, JS popola updateRailCommandChrome
     dopo il primo paint, l'<a hidden> diventa visibile (~10px) e l'intera rail
     ridistribuisce le icone via flex:1 + justify-content:center del rail-zone--functions.
     Effetto percepito: "le icone si spaziano e poi ritornano". min-height riservato
     elimina il CLS (Cumulative Layout Shift). 10px = font-size 0.48rem × line-height 1.3. */
  min-height: 10px;
}

.rail-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  /* Sigillo: un gradino sopra le icone rail spente (soggetto sessione) */
  background: rgba(255, 255, 255, 0.1);
  color: rgba(252, 252, 253, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 14px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-profile-anchor[data-session-state='live'] .rail-profile-avatar {
  border-color: color-mix(in srgb, var(--t1-cyan) 72%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 0 1px color-mix(in srgb, var(--t1-cyan) 22%, transparent),
    0 0 20px color-mix(in srgb, var(--t1-cyan) 12%, transparent);
}

.rail-profile-anchor[data-session-state='archive'] .rail-profile-avatar,
.rail-profile-anchor[data-session-state='idle'] .rail-profile-avatar {
  border-color: rgba(255, 255, 255, 0.42);
}

.rail-profile-anchor[data-session-state='idle'] .rail-profile-stack > .rail-quadrant-label {
  opacity: 0.42;
}

.rail-profile-anchor[data-session-state='live'] .rail-profile-stack > .rail-quadrant-label,
.rail-profile-anchor[data-session-state='archive'] .rail-profile-stack > .rail-quadrant-label {
  opacity: 0.72;
}

.rail-profile-youtube {
  display: block;
  width: 100%;
  font-size: 0.48rem;
  line-height: 1.3;
  color: var(--t1-text-holo-muted);
  text-decoration: none;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
  transition: color 0.18s ease;
}

.rail-profile-youtube:hover {
  color: var(--t1-cyan);
}

.rail-sep {
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.rail-sep--zone {
  /* margin 14 → 20: amplia il respiro tra zone--functions e zone--system
     (AI ↔ SETTINGS) per allinearlo al "respiro" tra cluster del primary group. */
  margin: 20px 0;
  width: 28px;
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.rail-group--primary {
  width: 100%;
}

.rail-group--bottom {
  margin-top: auto;
  padding-top: 12px;
}

.rail-group--system {
  width: 100%;
  align-items: center;
}

.rail-system-label {
  font-family: var(--font-tech);
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-dim);
  text-align: center;
  margin-bottom: 8px;
  user-select: none;
}

/* Icone strumento: cella 48px + SVG 32px + label aeronautica grigio seta */
.rail-quadrant-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* Fase 3.0.1-polish iter 2 (12 Maggio 2026, sera): gap 5 → 4 e icon-cell 48 → 42.
     Iter 1 portava cell a 44; iter 2 (-2px ulteriori) recupera altri 16px totali
     necessari ad assorbire i +16px di Strada 1 (sep--zone 14→20, system gap 14→18).
     Senza questa riduzione, su viewport 720p il flex:1 di rail-zone--functions
     entra in overflow e il calcolo iniziale di justify-content:center "slitta"
     al primo paint (web font swap + ricalcolo vh con scrollbar). Look ancora più
     denso, touch target 42px (sotto HIG 44 di 2px, accettabile su desktop con
     mouse — Cursor stesso usa ~38px nella activity bar). SVG inline 32x32 invariati. */
  gap: 4px;
  width: 100%;
  pointer-events: none;
}

.rail-quadrant-icon-cell {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-quadrant-label {
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  text-align: center;
  max-width: 100%;
  user-select: none;
  transition:
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-quadrant {
  position: relative;
  width: 100%;
  max-width: 52px;
  min-height: auto;
  padding: 4px 0 6px;
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(8, 10, 18, 0.65) 42%, rgba(4, 6, 12, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-color: rgba(0, 0, 0, 0.45);
  color: var(--t1-helm-frost-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  box-shadow: var(--geo-gem-inset), 0 6px 14px rgba(0, 0, 0, 0.42);
  transition:
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Focus mode: elementi spenti → icona attiva + riverbero cyan bilanciati col pannello note */
.rail-quadrant:not(:hover):not(.is-active):not(:disabled) .rail-quadrant-icon {
  opacity: 0.46;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-quadrant:not(:hover):not(.is-active):not(:disabled) .rail-quadrant-label {
  opacity: 0.48;
}

.rail-quadrant:hover:not(.is-active):not(:disabled) .rail-quadrant-icon {
  opacity: 0.94;
}

.rail-quadrant:hover:not(.is-active):not(:disabled) .rail-quadrant-label {
  opacity: 0.92;
}

.rail-quadrant.is-active .rail-quadrant-icon,
.rail-quadrant.is-active .rail-quadrant-label {
  opacity: 1;
}

.rail-quadrant:hover {
  color: var(--t1-cyan, var(--cyan-accent));
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.12) 0%, rgba(8, 14, 22, 0.72) 55%, rgba(4, 8, 14, 0.88) 100%);
  border-color: rgba(0, 229, 255, 0.32);
  transform: translateY(-1px);
  /* Proiezione: aura azzurra sulla cella (oltre al box-shadow) */
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--t1-cyan) 32%, transparent))
    drop-shadow(0 0 42px color-mix(in srgb, var(--t1-cyan) 14%, transparent));
  box-shadow:
    var(--geo-gem-inset),
    0 0 26px color-mix(in srgb, var(--t1-cyan) 26%, transparent),
    0 0 48px color-mix(in srgb, var(--t1-cyan) 10%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.48);
}

.rail-quadrant:hover .rail-quadrant-icon {
  filter: none;
}

.rail-quadrant:hover .rail-quadrant-label {
  color: color-mix(in srgb, var(--t1-cyan) 38%, var(--t1-helm-frost));
}

.rail-quadrant.is-active {
  color: var(--t1-cyan, var(--cyan-accent));
  border-color: rgba(0, 229, 255, 0.42);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.14) 0%, rgba(6, 12, 22, 0.78) 45%, rgba(4, 8, 16, 0.92) 100%);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--t1-cyan) 22%, transparent));
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.55),
    inset 1px 1px 0 rgba(0, 229, 255, 0.22),
    inset 0 -2px 10px rgba(0, 229, 255, 0.08),
    0 0 22px color-mix(in srgb, var(--t1-cyan) 22%, transparent);
}

.rail-quadrant.is-active .rail-quadrant-icon {
  filter: none;
}

.rail-quadrant.is-active .rail-quadrant-label {
  color: color-mix(in srgb, var(--t1-cyan) 35%, var(--t1-helm-frost));
}

.rail-quadrant.is-active::before {
  content: none;
}

.rail-quadrant.is-active .rail-quadrant-icon-cell {
  filter:
    drop-shadow(0 6px 26px color-mix(in srgb, var(--t1-cyan) 42%, transparent))
    drop-shadow(0 0 52px color-mix(in srgb, var(--t1-cyan) 16%, transparent));
  transition: filter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-quadrant.is-active:hover .rail-quadrant-icon {
  filter: none;
}

.rail-quadrant.is-active:hover {
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--t1-cyan) 34%, transparent))
    drop-shadow(0 0 40px color-mix(in srgb, var(--t1-cyan) 16%, transparent));
}

@media (prefers-reduced-motion: reduce) {
  .rail-quadrant:hover,
  .rail-quadrant.is-active,
  .rail-quadrant.is-active:hover {
    filter: none;
  }

  .rail-quadrant.is-active .rail-quadrant-icon-cell {
    filter: none;
  }
}

/* ────────────────────────────────────────────────────────────────────────
   SIDEBAR · Nuova architettura Fase 1
     • Avatar cliccabile  → trigger Global Search (rima visiva col piede)
     • Separatore gruppi  → respiro tra famiglie operative
     • Zona system        → Settings + Search ai piedi
     • Quadrant insight   → AI (accent ametista, evita rumore col cyan)
     • Quadrant ghost     → STAMP (disabilitato esplicito ma leggibile)
     • Quadrant system    → Settings (cyan calmo, no laser bar attiva)
     • Quadrant search    → Search (cyan, dot live già esistente)
   ──────────────────────────────────────────────────────────────────────── */

/* Avatar come "sigillo d'identità" → accent PERLA. Cliccabile (Edit profilo) ma sottile. */
.rail-profile-anchor[role='button'] {
  cursor: pointer;
  border-radius: 14px;
  padding: 4px 0;
  transition:
    background 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-profile-anchor[role='button'][aria-disabled='true'] {
  cursor: default;
  opacity: 0.55;
}

.rail-profile-anchor[role='button']:not([aria-disabled='true']):hover .rail-profile-avatar {
  /* Perla calda: nessun cyan, identità separata dall'azione operativa. */
  border-color: color-mix(in srgb, var(--t1-pearl) 70%, rgba(255, 255, 255, 0.22));
  background: color-mix(in srgb, var(--t1-pearl) 6%, rgba(255, 255, 255, 0.1));
  color: var(--t1-pearl);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 calc(16px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 28%, transparent);
}

.rail-profile-anchor[role='button']:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--t1-pearl) 55%, transparent);
}

/* Anello neon perla+cyan: feedback persistente "Stai modificando questo profilo".
   Acceso da JS via data-edit-mode='true' quando il drawer punta a panel-anagrafica. */
.rail-profile-anchor[data-edit-mode='true'] .rail-profile-avatar {
  border-color: color-mix(in srgb, var(--t1-pearl) 75%, var(--t1-cyan) 25%);
  background: color-mix(in srgb, var(--t1-pearl) 8%, rgba(255, 255, 255, 0.06));
  color: var(--t1-pearl);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 2px color-mix(in srgb, var(--t1-pearl) 45%, transparent),
    0 0 calc(18px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 35%, transparent),
    0 0 calc(36px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 18%, transparent);
}

/* In edit mode l'hover sull'avatar non aggiunge altro glow: lo stato è già "acceso". */
.rail-profile-anchor[data-edit-mode='true']:hover .rail-profile-avatar {
  /* eredita lo stato edit, niente override */
}

/* Separatore tra famiglie di tool (Engine/Lab ─ Vault/AI ─ Stamp) */
.rail-sep--group {
  width: 22px;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 6px 0;
  flex-shrink: 0;
}

/* Zona system (piede rail): Settings + Search */
.rail-zone--system {
  flex-shrink: 0;
  margin-top: auto;
  /* padding-top 10 → 18 (Fase 3.0.1-polish iter 4): allinea il "respiro" AI↔SETTINGS
     al respiro intra-cluster del primary group (gap 20 + sep--group 13 + gap 20 = 53px).
     Senza questo, gap effettivo AI↔SETTINGS ~45px, percepito stretto rispetto a tutto
     il resto della rail. Costo: +8px sull'altezza totale, assorbiti dalla riduzione
     icone iter 2 (cell 44→42, -16px). */
  padding-top: 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* gap 14 → 18: distanzia SETTINGS e SEARCH per coerenza col ritmo del primary
     group (gap 20) — gap di zona leggermente più stretto per "raggrupparle". */
  gap: 18px;
  position: relative;
}

/* AI Insight — accent ametista (in coerenza col token --accent-solid,
   tono "predittivo" che non compete col cyan operativo) */
.rail-quadrant--insight:hover {
  color: color-mix(in srgb, var(--accent-solid) 65%, var(--t1-cyan) 35%);
  background:
    linear-gradient(165deg, rgba(109, 40, 168, 0.13) 0%, rgba(8, 14, 22, 0.74) 55%, rgba(4, 8, 14, 0.9) 100%);
  border-color: color-mix(in srgb, var(--accent-solid) 35%, transparent);
  filter:
    drop-shadow(0 0 calc(16px * var(--neon-glow-intensity)) color-mix(in srgb, var(--accent-solid) 32%, transparent))
    drop-shadow(0 0 calc(38px * var(--neon-glow-intensity)) color-mix(in srgb, var(--accent-solid) 12%, transparent));
  box-shadow:
    var(--geo-gem-inset),
    0 0 calc(24px * var(--neon-glow-intensity)) color-mix(in srgb, var(--accent-solid) 24%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.48);
}

.rail-quadrant--insight:hover .rail-quadrant-label {
  color: color-mix(in srgb, var(--accent-solid) 38%, var(--t1-helm-frost));
}

/* STAMP — output documentale → accent AMBRA GHOST (metafora "timbro/stampa")
   Ghost esplicito: opacità ridotta + tinta ambra visibile sull'hue (anche disabled). */
.rail-quadrant--ghost,
.rail-quadrant--ghost[disabled] {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(0.25);
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--t1-amber-ghost) 4%, rgba(255, 255, 255, 0.02)) 0%,
      rgba(8, 10, 18, 0.55) 42%,
      rgba(4, 6, 12, 0.78) 100%);
  border-color: color-mix(in srgb, var(--t1-amber-ghost) 18%, rgba(255, 255, 255, 0.04));
  box-shadow: none;
}

.rail-quadrant--ghost .rail-quadrant-icon {
  color: color-mix(in srgb, var(--t1-amber-ghost) 55%, var(--t1-helm-frost-muted));
  opacity: 0.7 !important;
}

.rail-quadrant--ghost .rail-quadrant-label {
  color: color-mix(in srgb, var(--t1-amber-ghost) 38%, var(--t1-helm-frost-muted));
  opacity: 0.7 !important;
}

/* SETTINGS — configurazione di sistema → accent ARGENTO (neutro freddo, non azione) */
.rail-quadrant--system:hover {
  color: var(--t1-silver);
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--t1-silver) 8%, transparent) 0%,
      rgba(8, 12, 18, 0.72) 55%,
      rgba(4, 8, 14, 0.88) 100%);
  border-color: color-mix(in srgb, var(--t1-silver) 35%, transparent);
  filter:
    drop-shadow(0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-silver) 28%, transparent));
}

.rail-quadrant--system:hover .rail-quadrant-label {
  color: color-mix(in srgb, var(--t1-silver) 45%, var(--t1-helm-frost));
}

.rail-quadrant--system.is-active::before,
.rail-quadrant--search.is-active::before,
.rail-quadrant--insight.is-active::before {
  /* No laser-bar laterale per gli strumenti di sistema/insight/search:
     respirano fuori dal flusso operativo (riservato a Engine/Lab/Vault). */
  display: none;
}

/* Stato attivo persistente per gli strumenti system: l'icona resta illuminata
   con la sua tinta (argento/ametista/cyan-soft) finché l'overlay corrispondente
   è aperto. Erediteranno l'aspetto dell'hover anche senza puntatore sopra. */
.rail-quadrant--insight.is-active {
  color: color-mix(in srgb, var(--accent-solid) 65%, var(--t1-cyan) 35%);
  background:
    linear-gradient(165deg, rgba(109, 40, 168, 0.13) 0%, rgba(8, 14, 22, 0.74) 55%, rgba(4, 8, 14, 0.9) 100%);
  border-color: color-mix(in srgb, var(--accent-solid) 35%, transparent);
  filter:
    drop-shadow(0 0 calc(16px * var(--neon-glow-intensity)) color-mix(in srgb, var(--accent-solid) 32%, transparent))
    drop-shadow(0 0 calc(38px * var(--neon-glow-intensity)) color-mix(in srgb, var(--accent-solid) 12%, transparent));
  box-shadow:
    var(--geo-gem-inset),
    0 0 calc(24px * var(--neon-glow-intensity)) color-mix(in srgb, var(--accent-solid) 24%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.48);
}
.rail-quadrant--insight.is-active .rail-quadrant-label {
  color: color-mix(in srgb, var(--accent-solid) 38%, var(--t1-helm-frost));
}

.rail-quadrant--system.is-active {
  color: var(--t1-silver);
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--t1-silver) 8%, transparent) 0%,
      rgba(8, 12, 18, 0.72) 55%,
      rgba(4, 8, 14, 0.88) 100%);
  border-color: color-mix(in srgb, var(--t1-silver) 35%, transparent);
  filter:
    drop-shadow(0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-silver) 28%, transparent));
}
.rail-quadrant--system.is-active .rail-quadrant-label {
  color: color-mix(in srgb, var(--t1-silver) 45%, var(--t1-helm-frost));
}

/* ARCHIVIO (casting mode) — accent CYAN standard, stato pressed gestito in t1_rail_slim.css */
.rail-quadrant--casting {
  position: relative;
}

.rail-quadrant--casting:hover {
  color: var(--t1-helm-frost);
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--t1-cyan) 8%, transparent) 0%,
      rgba(8, 14, 22, 0.72) 55%,
      rgba(4, 8, 14, 0.88) 100%);
  border-color: color-mix(in srgb, var(--t1-cyan) 28%, transparent);
}

.rail-quadrant--casting:hover .rail-quadrant-label {
  color: var(--t1-cyan, #00e5ff);
  opacity: 1;
}

/* SEARCH — passaggio dimensionale → accent CYAN SOFT (attenuato vs tools operativi) */
.rail-quadrant--search {
  position: relative;
}

.rail-quadrant--search:disabled,
.rail-quadrant--search[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.rail-quadrant--search:not(:disabled):hover {
  color: var(--t1-cyan-soft);
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--t1-cyan-soft) 8%, transparent) 0%,
      rgba(8, 14, 22, 0.72) 55%,
      rgba(4, 8, 14, 0.88) 100%);
  border-color: color-mix(in srgb, var(--t1-cyan-soft) 28%, transparent);
  filter:
    drop-shadow(0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan-soft) 22%, transparent))
    drop-shadow(0 0 calc(32px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan-soft) 10%, transparent));
}

.rail-quadrant--search:not(:disabled):hover .rail-quadrant-label {
  color: color-mix(in srgb, var(--t1-cyan-soft) 38%, var(--t1-helm-frost));
}

/* Live-dot ereditato (mostrava profilo agganciato): resta in alto-dx della SEARCH */

.rail-quadrant-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
  width: 32px;
  height: 32px;
  transition:
    filter 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Nav hub: ritorno al Gateway (navigazione pura — non invalida la sessione) ── */
.cockpit-back-gateway {
  position: fixed;
  top: 25px;
  left: 25px;
  z-index: 1100;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--t1-cyan);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.12) 0%, rgba(12, 14, 20, 0.88) 100%);
  border: 1px solid color-mix(in srgb, var(--t1-cyan) 32%, transparent);
  border-bottom-color: rgba(0, 0, 0, 0.48);
  box-shadow:
    var(--geo-gem-inset),
    0 0 14px var(--t1-cyan-glow),
    0 6px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0.7;
  transition:
    opacity var(--t-fast),
    box-shadow var(--t-fast),
    border-color var(--t-fast),
    background var(--t-fast);
}

.cockpit-back-gateway:hover {
  opacity: 1;
  border-color: color-mix(in srgb, var(--t1-cyan) 52%, transparent);
  box-shadow:
    var(--geo-gem-inset),
    0 0 22px var(--t1-cyan-glow),
    0 0 38px var(--t1-cyan-glow-faint),
    0 8px 18px rgba(0, 0, 0, 0.48);
}

.cockpit-back-gateway:focus-visible {
  outline: 2px solid var(--t1-cyan);
  outline-offset: 2px;
}

.cockpit-back-gateway__icon {
  display: block;
  flex-shrink: 0;
}

/* Link Progetti: quadrante rail #rail-project-space-link — vedi t1_rail_slim.css */

/* ── Drawer: overlay fluido — non ruba spazio al workspace / santuario ───
   Fixed dopo la rail: slitta sopra notes+video senza restringere il player.
   Cantiere B: transition limitata a transform; blur e ombre solo dopo .is-glass-ready. */
.sidebar-drawer {
  position: fixed;
  left: var(--t1-rail-width);
  top: 0;
  bottom: 0;
  width: var(--t1-sidebar-width);
  height: 100vh;
  background: rgba(10, 11, 17, 0.42);
  /* Blur off-screen: nessun costo GPU quando il drawer è nascosto fuori schermo. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 38%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 30%, transparent);
  border-right: none;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
  box-shadow: none;
  filter: none;
  transform: translateX(-100%);
  /* Solo transform: compositor-only, zero Paint durante lo slide. */
  transition: transform var(--t-santuario-total);
  pointer-events: none;
}

/* Placca tettonica — drawer espanso.
   Livello A: slide leggero (trasparenza + bordi, niente vetro pesante durante il movimento). */
/* B2_FIX — contenuto interno invisibile durante slide-out (evita residui testo in basso). */
.sidebar-drawer:not(.is-open) .sidebar-top,
.sidebar-drawer:not(.is-open) .sidebar-main {
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0ms, visibility 0ms;
}

/* Drawer chiuso: layer completamente neutro (evita cuciture residue sulla rail). */
.sidebar-drawer:not(.is-open) {
  background: transparent;
  border-top: none;
  border-left: none;
  box-shadow: none;
}
.sidebar-drawer.is-open .sidebar-top,
.sidebar-drawer.is-open .sidebar-main {
  opacity: 1;
  visibility: visible;
  transition: opacity 140ms ease;
}

.sidebar-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
  will-change: transform;
  isolation: isolate;
  background:
    linear-gradient(
      160deg,
      var(--t1-drawer-glass-pearl, rgba(232, 240, 250, 0.06)) 0%,
      var(--t1-drawer-glass-mid, rgba(10, 14, 22, 0.66)) 55%,
      var(--t1-drawer-glass-deep, rgba(6, 8, 14, 0.74)) 100%
    );
  border-top: 1px solid color-mix(in srgb, var(--t1-silver, #9aa5b1) 18%, rgba(232, 240, 250, 0.1));
  border-left: none;
  border-right: 1px solid color-mix(in srgb, var(--t1-cyan, #00e5ff) 22%, rgba(232, 240, 250, 0.12));
  backdrop-filter: blur(var(--t1-drawer-glass-blur, 18px)) saturate(var(--t1-drawer-glass-saturate, 1.16));
  -webkit-backdrop-filter: blur(var(--t1-drawer-glass-blur, 18px)) saturate(var(--t1-drawer-glass-saturate, 1.16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 color-mix(in srgb, var(--t1-cyan, #00e5ff) 7%, transparent),
    inset 0 0 20px rgba(232, 240, 250, 0.028),
    var(--t1-depth-contact),
    0 0 calc(18px * var(--neon-glow-intensity, 1)) color-mix(in srgb, var(--t1-cyan, #00e5ff) 7%, transparent);
  filter: none;
}

/* Wash a chiazze — stesso linguaggio rail, un filo più presente */
.sidebar-drawer.is-open::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--t1-glass-wash-drawer);
}

/* A regime (.is-glass-ready = slide finita): cristallo più profondo. */
.sidebar-drawer.is-open.is-glass-ready {
  backdrop-filter: blur(var(--t1-drawer-glass-blur-ready, 24px)) saturate(1.18);
  -webkit-backdrop-filter: blur(var(--t1-drawer-glass-blur-ready, 24px)) saturate(1.18);
  filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 color-mix(in srgb, var(--t1-cyan, #00e5ff) 9%, transparent),
    inset 0 0 24px rgba(232, 240, 250, 0.032),
    var(--t1-depth-contact),
    var(--t1-depth-lift),
    0 0 calc(22px * var(--neon-glow-intensity, 1)) color-mix(in srgb, var(--t1-cyan, #00e5ff) 9%, transparent);
  will-change: auto;
}

/* Header drawer — fascia settings-like */
.sidebar-drawer.is-open .sidebar-top {
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--t1-silver, #9aa5b1) 12%, rgba(255, 255, 255, 0.04));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--t1-pearl, #e8f0fa) 3%, rgba(255, 255, 255, 0.02)),
      transparent
    );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Edge highlight zenitale — stesso vocabolario settings/search */
.sidebar-drawer.is-open .sidebar-top::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--t1-pearl, #e8f0fa) 58%, transparent),
    color-mix(in srgb, var(--t1-cyan, #00e5ff) 26%, transparent),
    color-mix(in srgb, var(--t1-pearl, #e8f0fa) 58%, transparent),
    transparent
  );
}

/* Hover sulla lama: riflesso magnetico — solo a regime */
.sidebar-drawer.is-open.is-glass-ready:has(.sidebar-edge-hitbox:hover),
.sidebar-drawer.is-open.is-glass-ready:has(.sidebar-edge-hitbox:focus-visible) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 0 26px rgba(232, 240, 250, 0.038),
    var(--t1-depth-contact),
    var(--t1-depth-lift),
    inset -10px 0 32px -12px color-mix(in srgb, var(--t1-cyan, #00e5ff) 10%, transparent),
    0 0 calc(26px * var(--neon-glow-intensity, 1)) color-mix(in srgb, var(--t1-cyan, #00e5ff) 11%, transparent);
  filter: none;
}

/* ── Lama di luce — bordo destro sidebar (chiudi al click) ───────────────── */
.sidebar-edge-hitbox {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 20;
  display: none;
  overflow: visible;
}

.sidebar-drawer.is-open .sidebar-edge-hitbox {
  display: block;
}

.sidebar-edge-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: auto;
  width: 2px;
  pointer-events: none;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--geo-ice-cyan) 45%, transparent) 0%,
    var(--geo-ice-cyan) 48%,
    color-mix(in srgb, var(--geo-ice-cyan) 55%, transparent) 100%
  );
  opacity: 0.88;
  box-shadow:
    0 0 14px color-mix(in srgb, var(--geo-ice-cyan) 55%, transparent),
    -3px 0 22px color-mix(in srgb, var(--geo-ice-cyan) 28%, transparent);
  transition:
    box-shadow 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    filter 0.28s ease;
  animation: t1-sidebar-blade-pulse var(--geo-blade-pulse) ease-in-out infinite;
}

.sidebar-edge-hitbox:hover .sidebar-edge-glow,
.sidebar-edge-hitbox:focus-visible .sidebar-edge-glow {
  opacity: 1;
  filter: brightness(1.12);
  box-shadow:
    -6px 0 28px color-mix(in srgb, var(--geo-ice-cyan) 45%, transparent),
    -20px 0 52px color-mix(in srgb, var(--geo-ice-cyan) 32%, transparent),
    0 0 36px color-mix(in srgb, var(--geo-ice-cyan) 55%, transparent),
    -2px 0 14px color-mix(in srgb, var(--geo-ice-cyan) 72%, transparent);
}

/* @keyframes t1-sidebar-blade-pulse — estratto in styles/keyframes.css */

.sidebar-edge-hitbox:focus-visible {
  outline: none;
}

.sidebar-edge-hitbox:focus-visible .sidebar-edge-glow {
  opacity: 1;
}

/* Glow chiuso: translateX(-100%) porta right:0 esattamente sul bordo destro della rail — nascondi. */
.sidebar-drawer:not(.is-open) .sidebar-edge-glow {
  display: none;
}

.sidebar-top,
.sidebar-main {
  position: relative;
  z-index: 1;
}

/* ── COLONNA 2: Notes feed — default sopra il drawer chiuso; con drawer aperto vedi regola ~ .notes-panel */
.notes-panel {
  position: relative;
  width: calc(var(--t1-sidebar-width, 360px) - 4px);
  flex-shrink: 0;
  height: 100vh;
  background: rgba(10, 11, 18, 0.42);
  backdrop-filter: blur(var(--geo-panel-blur-deep)) saturate(1.1);
  -webkit-backdrop-filter: blur(var(--geo-panel-blur-deep)) saturate(1.1);
  border-top: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 42%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 34%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 22%, transparent);
  border-bottom: none;
  box-shadow:
    var(--geo-plate-drop),
    var(--geo-plate-inset-cyan),
    var(--geo-plate-well),
    0 0 0 1px color-mix(in srgb, var(--geo-ice-cyan) 12%, transparent),
    0 0 40px color-mix(in srgb, var(--geo-ice-cyan) 7%, transparent);
  filter: drop-shadow(8px 16px 34px rgba(0, 0, 0, 0.58));
  display: flex;
  flex-direction: column;
  overflow: hidden;           /* no scrollbar sul contenitore — scorre solo il feed */
  transform: scale(1);
  transform-origin: left center;
  opacity: 1;
  transition:
    width var(--t-smooth),
    max-width var(--t-smooth),
    flex-grow var(--t-smooth),
    opacity var(--t-fast),
    transform var(--t-smooth);
  z-index: 155;
}

/* Drawer aperto: note fuori vista al frame 0 (niente testo/annotazioni feed sotto il vetro). */
.sidebar-drawer.is-open ~ .notes-panel {
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.99);
  transition: none;
}

/* Stato di boot: il pannello Note Operative è nascosto finché l'utente
   non seleziona esplicitamente un profilo. Questo garantisce che al refresh
   l'interfaccia mostri solo la Profile List View, con il canvas pulito e pronto.
   Viene rimossa in selectProfile() e re-aggiunta dal tasto Nuovo / delete profilo. */
.notes-panel.is-startup {
  display: none;
}

/* Cambio profilo: micro-transizione sul feed (dati già filtrati per activeProfileId) */
.notes-panel.is-profile-transition .notes-feed-list {
  animation: t1-cockpit-context-fade 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* @keyframes t1-cockpit-context-fade — estratto in styles/keyframes.css */

.notes-panel-header {
  flex-shrink: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative; /* ancoraggio ::after indicatore acquisizione */
  z-index: 1;
  overflow: visible;
  background: rgba(10, 11, 18, 0.52);
  backdrop-filter: blur(var(--geo-panel-blur));
  -webkit-backdrop-filter: blur(var(--geo-panel-blur));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--geo-ice-cyan) 22%, transparent),
    inset 1px 0 0 color-mix(in srgb, var(--geo-ice-cyan) 14%, transparent),
    inset 0 -1px 0 rgba(0, 229, 255, 0.06);
}

.notes-panel-feed-stack {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Purge header — visibilità da syncNotesHeaderChrome; stile in t1_action_icons.css */

/* ────────────────────────────────────────────────────────────────────────
   CESTINO ATOMICO — modal di conferma eliminazione massiva note
   Layout: card centrata, header con glyph, lista scope come radio-card,
           azioni allineate a destra. Accent rosso terra (#cc4400).
   ──────────────────────────────────────────────────────────────────────── */
.notes-purge-confirm {
  --purge-accent: #cc4400;
  --purge-accent-soft: color-mix(in srgb, #cc4400 60%, #ff8a3d 40%);
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(204, 68, 0, 0.08), transparent 60%),
    rgba(2, 4, 8, 0.78);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  animation: notes-purge-veil-in 220ms cubic-bezier(0.33, 1, 0.32, 1);
}

.notes-purge-confirm[hidden] {
  display: none !important;
}

.notes-purge-confirm__panel {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(18, 20, 28, 0.96), rgba(10, 12, 18, 0.96));
  border: 1px solid color-mix(in srgb, var(--purge-accent) 24%, rgba(255, 255, 255, 0.06));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 0 28px color-mix(in srgb, var(--purge-accent) 14%, transparent);
  animation: notes-purge-panel-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notes-purge-confirm__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--purge-accent) 55%, transparent),
    transparent
  );
  border-radius: 14px 14px 0 0;
  pointer-events: none;
  opacity: 0.7;
}

/* HEADER ───────────────────────────────────────────── */
.notes-purge-confirm__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notes-purge-confirm__glyph {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--purge-accent) 14%, rgba(0, 0, 0, 0.5));
  border: 1px solid color-mix(in srgb, var(--purge-accent) 36%, transparent);
  color: var(--purge-accent-soft);
  box-shadow: inset 0 0 10px color-mix(in srgb, var(--purge-accent) 18%, transparent);
}

.notes-purge-confirm__head-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notes-purge-confirm__title {
  margin: 0;
  font-family: var(--font-tech);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-bright);
}

.notes-purge-confirm__hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* SCOPE — radio-cards verticali ────────────────────── */
.notes-purge-scope {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.notes-purge-scope[hidden] {
  display: none !important;
}

.notes-purge-scope__label {
  margin: 0 0 2px;
  font-family: var(--font-tech);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.notes-purge-scope__opt {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 200ms ease,
    transform 160ms ease;
}

.notes-purge-scope__opt:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.12);
}

.notes-purge-scope__opt:focus-within {
  outline: none;
  border-color: color-mix(in srgb, var(--purge-accent) 40%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--purge-accent) 22%, transparent);
}

.notes-purge-scope__opt.is-checked,
.notes-purge-scope__opt:has(input:checked) {
  background: color-mix(in srgb, var(--purge-accent) 10%, rgba(0, 0, 0, 0.32));
  border-color: color-mix(in srgb, var(--purge-accent) 42%, transparent);
  box-shadow:
    inset 0 0 10px color-mix(in srgb, var(--purge-accent) 14%, transparent),
    0 0 14px color-mix(in srgb, var(--purge-accent) 14%, transparent);
}

.notes-purge-scope__opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.notes-purge-scope__mark {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.45);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 200ms ease;
}

.notes-purge-scope__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--purge-accent-soft);
  transform: scale(0);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.notes-purge-scope__opt.is-checked .notes-purge-scope__mark,
.notes-purge-scope__opt:has(input:checked) .notes-purge-scope__mark {
  border-color: color-mix(in srgb, var(--purge-accent) 75%, transparent);
  background: color-mix(in srgb, var(--purge-accent) 18%, rgba(0, 0, 0, 0.55));
  box-shadow: 0 0 8px color-mix(in srgb, var(--purge-accent) 32%, transparent);
}

.notes-purge-scope__opt.is-checked .notes-purge-scope__mark::after,
.notes-purge-scope__opt:has(input:checked) .notes-purge-scope__mark::after {
  transform: scale(1);
  opacity: 1;
}

.notes-purge-scope__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notes-purge-scope__title {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.018em;
  color: rgba(232, 238, 248, 0.96);
  line-height: 1.2;
}

.notes-purge-scope__sub {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: rgba(180, 190, 205, 0.62);
  line-height: 1.35;
}

.notes-purge-legacy-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
}

.notes-purge-legacy-opt[hidden] {
  display: none;
}

.notes-purge-legacy-opt:focus-within {
  outline: 1px solid rgba(94, 207, 255, 0.45);
  outline-offset: 2px;
}

.notes-purge-legacy-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.notes-purge-legacy-opt__mark {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
}

.notes-purge-legacy-opt:has(input:checked) .notes-purge-legacy-opt__mark {
  border-color: rgba(94, 207, 255, 0.55);
  background: rgba(94, 207, 255, 0.16);
}

.notes-purge-legacy-opt:has(input:checked) .notes-purge-legacy-opt__mark::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid rgba(232, 238, 248, 0.96);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.notes-purge-legacy-opt__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notes-purge-legacy-opt__title {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(232, 238, 248, 0.96);
}

.notes-purge-legacy-opt__sub {
  font-size: 0.6rem;
  line-height: 1.35;
  color: rgba(180, 190, 205, 0.62);
}

/* AZIONI ───────────────────────────────────────────── */
.notes-purge-confirm__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 2px;
}

.notes-purge-confirm__cancel,
.notes-purge-confirm__confirm {
  min-width: 96px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 200ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.notes-purge-confirm__cancel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(220, 226, 235, 0.82);
}

.notes-purge-confirm__cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(232, 238, 248, 0.96);
}

.notes-purge-confirm__cancel:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.18);
  outline-offset: 2px;
}

.notes-purge-confirm__confirm {
  border: 1px solid color-mix(in srgb, var(--purge-accent) 55%, transparent);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--purge-accent) 22%, rgba(0, 0, 0, 0.45)),
      color-mix(in srgb, var(--purge-accent) 14%, rgba(0, 0, 0, 0.55))
    );
  color: color-mix(in srgb, var(--purge-accent-soft) 88%, #fff 12%);
  box-shadow:
    inset 0 0 14px color-mix(in srgb, var(--purge-accent) 16%, transparent),
    0 0 0 0 transparent;
}

.notes-purge-confirm__confirm:hover {
  box-shadow:
    inset 0 0 18px color-mix(in srgb, var(--purge-accent) 26%, transparent),
    0 0 18px color-mix(in srgb, var(--purge-accent) 34%, transparent);
  transform: translateY(-1px);
}

.notes-purge-confirm__confirm:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--purge-accent) 60%, transparent);
  outline-offset: 2px;
}

.notes-purge-confirm__confirm:active {
  transform: translateY(0);
}

/* Animazioni ───────────────────────────────────────── */
/* @keyframes notes-purge-veil-in / notes-purge-panel-in — estratti in styles/keyframes.css */

@media (prefers-reduced-motion: reduce) {
  .notes-purge-confirm,
  .notes-purge-confirm__panel {
    animation: none !important;
  }
}

/* @keyframes notes-feed-incinerate — estratto in styles/keyframes.css */

.notes-feed-list.is-incinerating .notes-feed-item {
  animation: notes-feed-incinerate 0.78s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.notes-feed-list.is-incinerating .notes-feed-item:nth-child(1) {
  animation-delay: 0ms;
}
.notes-feed-list.is-incinerating .notes-feed-item:nth-child(2) {
  animation-delay: 35ms;
}
.notes-feed-list.is-incinerating .notes-feed-item:nth-child(3) {
  animation-delay: 70ms;
}
.notes-feed-list.is-incinerating .notes-feed-item:nth-child(4) {
  animation-delay: 105ms;
}
.notes-feed-list.is-incinerating .notes-feed-item:nth-child(5) {
  animation-delay: 140ms;
}
.notes-feed-list.is-incinerating .notes-feed-item:nth-child(n + 6) {
  animation-delay: 175ms;
}

/* Acquisizione nota: leggero innalzamento sopra lo stack note base (155) */
.notes-panel.is-recording {
  position: relative;
  z-index: 165;
}

/* Linea / impulso visivo — non eredita overflow clip dal feed; vive nella testata */
.notes-panel.is-recording .notes-panel-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 229, 255, 0.25) 25%,
    var(--cyan-accent) 50%,
    rgba(0, 229, 255, 0.25) 75%,
    transparent 100%
  );
  box-shadow:
    0 0 10px rgba(0, 229, 255, 0.55),
    0 0 22px rgba(0, 229, 255, 0.35);
  opacity: 1;
  pointer-events: none;
  z-index: 2;
  animation: notes-recording-pulse 1.1s ease-in-out infinite alternate;
}

/* @keyframes notes-recording-pulse — estratto in styles/keyframes.css */

/* Master toggle — spostato nel drawer (.sidebar-top); qui solo titolo note */
.notes-panel-info {
  min-width: 0;   /* permette a text-overflow di funzionare */
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
}

/* Titolo sempre leggibile a pieno contrasto (anche a pannello vuoto / stato boot) */
.notes-panel-title,
.notes-panel.is-startup .notes-panel-title {
  filter: none;
  opacity: 1;
  -webkit-font-smoothing: antialiased;
}

/* h2 = titolo sezione note (profilo in sidebar centrale cockpit) */
.notes-panel-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.35;
}

.notes-panel-title-text {
  font-family: var(--font-tech);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-bright);
  text-shadow: none;
}

/* North star — note operative: titolo blueprint ghiaccio */
.notes-panel .notes-panel-title-text {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--t1-helm-frost);
  text-shadow: none;
}

.notes-panel-profile {
  display: none;
}


.sidebar-top {
  flex-shrink: 0;
  padding: 22px 18px 0;
}

.sidebar-header-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
}

.sidebar-header-minimal-label {
  flex: 1;
  min-width: 0;
  font-family: var(--font-tech);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.3;
}

/* North star — drawer profili: Inter 300 + tracking (titoli / etichette) */
#sidebar .sidebar-header-minimal-label {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--t1-helm-frost-muted);
}

#sidebar .panel-title {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.018em;
  text-transform: none;
  color: var(--t1-helm-frost);
  text-shadow: var(--t1-drawer-gem-text-highlight);
  line-height: 1.25;
  margin-bottom: 6px;
}

#sidebar .field-label {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--t1-helm-frost-muted);
}

#sidebar .panel-hint-t1 {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 400;
  letter-spacing: 0.018em;
  color: var(--t1-helm-frost-muted);
  font-size: 0.68rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

#sidebar .panel-title + .panel-hint-t1 {
  margin-top: 0;
}

#sidebar .panel {
  background: color-mix(in srgb, var(--t1-silver) 4%, transparent);
  border: 1px solid var(--t1-drawer-gem-border-row-color);
  border-top-color: var(--t1-drawer-gem-border-row-top);
  border-bottom-color: var(--t1-drawer-gem-border-bottom);
  border-radius: 10px;
  box-shadow: var(--t1-drawer-gem-row-inset), var(--t1-drawer-gem-row-shadow);
  padding: 14px 14px 16px;
  margin-bottom: 12px;
}

#sidebar .panel:last-child {
  margin-bottom: 0;
}

/* Sessioni: niente doppio box — vetro drawer + lista righe (t1_panel_vault_glass.css) */
#sidebar #panel-data-sync.panel {
  border: none;
  padding: 0;
}

#sidebar .large-button {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  background: var(--t1-drawer-gem-surface);
  border: 1px solid var(--t1-drawer-gem-border-color);
  border-top-color: var(--t1-drawer-gem-border-top);
  border-bottom-color: var(--t1-drawer-gem-border-bottom);
  box-shadow: var(--t1-drawer-gem-inset), var(--t1-drawer-gem-shadow);
  text-shadow: var(--t1-drawer-gem-text-highlight);
}

#sidebar .large-button:hover {
  background: var(--t1-drawer-gem-surface-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 16px color-mix(in srgb, var(--t1-cyan) 14%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.5);
}

#panel-anagrafica[data-anagrafica-mode="edit"] #newProfileBtn {
  display: none;
}

#sidebar .new-profile-btn {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--t1-helm-frost-muted);
  background:
    linear-gradient(165deg, rgba(232, 240, 250, 0.05) 0%, rgba(8, 10, 16, 0.62) 100%);
  border-color: color-mix(in srgb, var(--t1-silver) 24%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 10px rgba(0, 0, 0, 0.38);
}

#sidebar .new-profile-btn:hover {
  color: var(--t1-helm-frost);
  border-color: color-mix(in srgb, var(--t1-cyan) 24%, transparent);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.08) 0%, rgba(8, 12, 18, 0.72) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 12px color-mix(in srgb, var(--t1-cyan) 12%, transparent),
    0 5px 12px rgba(0, 0, 0, 0.4);
}

.sidebar-main {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}
.sidebar-main::-webkit-scrollbar { width: 2px; }
.sidebar-main::-webkit-scrollbar-track { background: transparent; }
.sidebar-main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════
   PANELS
   ═══════════════════════════════════════════ */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 15px;
}

.panel-title {
  font-family: var(--font-tech);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-ice);           /* Grigio Ghiaccio — alta leggibilità */
  text-shadow: 0 0 10px rgba(224, 224, 224, 0.12);
  margin-bottom: 15px;
}

.panel-hint-t1 {
  font-family: var(--font-main);
  font-size: 0.68rem;
  line-height: 1.38;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  font-weight: 400;
  margin: -10px 0 14px;
}

/* ═══════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════ */
.field-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 10px;
  display: block;
}

input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-pure);
  margin-top: 4px;
  font-family: var(--font-main);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

input:focus {
  outline: none;
  border-color: var(--cyan-accent);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.35);
}

textarea.t1-field-textarea {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-pure);
  margin-top: 4px;
  font-family: var(--font-main);
  line-height: 1.45;
}

textarea.t1-field-textarea:focus {
  outline: none;
  border-color: var(--cyan-accent);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.35);
}

/* ════════════════════════════════════════════════════════════════════════
   SIDEBAR INPUT GLASS (Vetro Operativo)
   I campi di testo nella sidebar sono "frammenti di vetro incastonati":
   sfondo leggermente più chiaro, bordo più visibile rispetto al globale.
   Al focus: pulse ciano tenue (non solido) — zona operativa, non decorativa.
   ════════════════════════════════════════════════════════════════════════ */
.sidebar-drawer input:not([type="range"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]) {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-drawer .t1-field-select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 34px 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(5, 10, 18, 0.72));
  color: var(--text-pure);
  font-family: var(--font-main);
  font-size: 0.72rem;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(205, 244, 255, 0.82) 50%),
    linear-gradient(135deg, rgba(205, 244, 255, 0.82) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.sidebar-drawer .t1-field-select:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.40);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.24);
}

/* @keyframes t1-sidebar-input-pulse — estratto in styles/keyframes.css */

.sidebar-drawer input:not([type="range"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.40);
  box-shadow: none;
  animation: t1-sidebar-input-pulse 2s ease infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-drawer input:not([type="range"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus {
    animation: none;
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.30);
  }
}

/* ── URL Video con tasto Sfoglia ── */
.url-video-group {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.url-video-group input {
  margin-top: 0;
  flex: 1;
}
.url-video-group.drag-over input {
  border-color: var(--cyan-accent);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.35), 0 0 14px var(--cyan-glow);
}

/* Drop zone URL (Data Sync / futuri layout): data-master-video-url-drop */
.url-drop-target {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.url-drop-target.drag-over {
  border-color: var(--cyan-accent);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.25), 0 0 12px var(--cyan-glow-faint);
}
.url-drop-target__title {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-ice);
}
.url-drop-target__hint {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.browse-button {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(6, 8, 14, 0.72) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-color: rgba(0, 0, 0, 0.48);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--geo-gem-inset), 0 4px 10px rgba(0, 0, 0, 0.42);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.browse-button:hover {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.12) 0%, rgba(6, 10, 18, 0.82) 100%);
  box-shadow:
    var(--geo-gem-inset),
    0 0 12px var(--cyan-glow),
    0 6px 12px rgba(0, 0, 0, 0.45);
}
.browse-button:active {
  transform: translateY(1px) scale(0.97);
}

.large-button {
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.1) 0%, rgba(10, 12, 18, 0.78) 48%, rgba(6, 8, 14, 0.88) 100%);
  color: var(--text-pure);
  border: 1px solid var(--cyan-accent);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(0, 0, 0, 0.62);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 15px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateY(0) scale(1);
  box-shadow:
    var(--geo-gem-inset),
    0 8px 18px rgba(0, 0, 0, 0.58),
    0 2px 4px rgba(0, 0, 0, 0.45);
  transition:
    box-shadow var(--t-fast),
    background var(--t-fast),
    transform 0.1s ease,
    filter 0.3s ease;
}
.large-button:hover {
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.18) 0%, rgba(10, 14, 22, 0.72) 100%);
  box-shadow:
    var(--geo-gem-inset),
    0 0 22px var(--cyan-glow),
    0 10px 22px rgba(0, 0, 0, 0.58);
}
.large-button:active {
  transform: translateY(2px) scale(0.98);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 1px 3px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Glow condizionale — si attiva quando il form è compilato */
.large-button.has-content {
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.35));
}
.large-button.has-content:hover {
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
}

/* Tasto "Nuovo" — compatto, a fianco di Salva Profilo */
.new-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 15px;
  margin-left: 8px;
  padding: 8px 12px;
  font-family: var(--font-tech);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, rgba(8, 10, 16, 0.65) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--geo-gem-inset), 0 4px 10px rgba(0, 0, 0, 0.38);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  vertical-align: middle;
}
.new-profile-btn:hover {
  color: var(--cyan-accent);
  border-color: rgba(0, 229, 255, 0.4);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.1) 0%, rgba(8, 12, 18, 0.78) 100%);
  box-shadow:
    var(--geo-gem-inset),
    0 0 14px var(--cyan-glow-faint),
    0 6px 12px rgba(0, 0, 0, 0.42);
}
.new-profile-btn:active {
  transform: translateY(1px);
}

.sidebar-status {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 15px;
  display: block;
}

/* ═══════════════════════════════════════════
   PROFILE PANEL — componente indipendente
   ═══════════════════════════════════════════ */
.profile-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Riga titolo con toggle note — sostituisce il semplice .panel-title */
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title-row .panel-title { margin-bottom: 0; }

/* Bottone toggle Note/Archivio */
.notes-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-family: var(--font-tech);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.notes-toggle-btn:hover {
  color: var(--accent-solid);
  border-color: rgba(109, 40, 168, 0.4);
}
.notes-toggle-btn.is-notes-active {
  color: var(--accent-solid);
  border-color: var(--accent-solid);
  background: rgba(109, 40, 168, 0.1);
}

/* ── Notes feed dentro .notes-panel (3-column layout) ── */
.notes-panel .notes-feed-list {
  flex: 1 1 auto;
  min-height: 0; /* fondamentale per flex + overflow-y: scroll del feed lungo */
  overflow-y: auto;
  padding: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.32) transparent;
}
.notes-panel .notes-feed-list::-webkit-scrollbar {
  width: 4px;
}
.notes-panel .notes-feed-list::-webkit-scrollbar-track {
  background: transparent;
}
.notes-panel .notes-feed-list::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.28);
  border-radius: 3px;
}

/* Coach intro — sintesi sotto feed note (3.3-D) */
.coach-package-intro {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 10px 14px 14px;
  border-top: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 14%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--t1-deep-black) 92%, var(--geo-ice-cyan) 8%) 0%,
    var(--t1-deep-black) 100%
  );
}
.coach-package-intro[hidden] {
  display: none !important;
}
.coach-package-intro__label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--geo-ice-cyan) 72%, var(--text-muted));
}
.coach-package-intro__input {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  margin: 0;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--t1-deep-black) 88%, rgba(0, 229, 255, 0.06));
  border: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 18%, transparent);
  border-radius: 0.35rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.coach-package-intro__input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 78%, transparent);
}
.coach-package-intro__input:focus {
  border-color: color-mix(in srgb, var(--geo-ice-cyan) 42%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--geo-ice-cyan) 12%, transparent);
}
.coach-package-intro__input:read-only {
  opacity: 0.72;
  cursor: default;
}

/* Fallback generico (non dentro .notes-panel) */
.notes-feed-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  flex: 1;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.28) transparent;
}
.notes-feed-list::-webkit-scrollbar {
  width: 4px;
}
.notes-feed-list::-webkit-scrollbar-track {
  background: transparent;
}
.notes-feed-list::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.26);
  border-radius: 3px;
}

/* ── Singola nota — carotaggio / ghiacciaio fratturato (strati + hover reperto) ── */
.notes-feed-item {
  --note-lumen-dur: 0.2s;
  --note-lumen-ease: cubic-bezier(0.38, 0.02, 0.22, 1);
  display: grid;
  grid-template-columns: 3px 32px minmax(0, 1fr);
  column-gap: 16px;
  align-items: stretch;
  /* Respiro tipo 857: padding ≥ 1rem, fondo extra per cestino assoluto */
  padding: 16px 16px 44px 16px;
  background: var(--t1-drawer-gem-surface-row, linear-gradient(165deg, rgba(232, 240, 250, 0.05) 0%, rgba(10, 14, 22, 0.48) 62%, rgba(6, 8, 14, 0.58) 100%));
  border: 1px solid var(--t1-drawer-gem-border-row-color, color-mix(in srgb, var(--t1-silver, #9aa5b1) 18%, rgba(232, 240, 250, 0.08)));
  border-top-color: var(--t1-drawer-gem-border-row-top, color-mix(in srgb, var(--t1-pearl, #e8f0fa) 22%, transparent));
  border-bottom-color: var(--t1-drawer-gem-border-bottom, rgba(0, 0, 0, 0.5));
  border-radius: 6px;
  cursor: pointer;
  isolation: isolate;
  transition:
    background var(--note-lumen-dur) var(--note-lumen-ease),
    border-color var(--note-lumen-dur) var(--note-lumen-ease),
    box-shadow var(--note-lumen-dur) var(--note-lumen-ease),
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    z-index 0s linear;
  position: relative;
  box-sizing: border-box;
  box-shadow:
    var(--t1-drawer-gem-row-inset, inset 0 1px 0 rgba(255, 255, 255, 0.1)),
    0 4px 10px rgba(0, 0, 0, 0.32);
}

.notes-feed-item::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, var(--geo-ice-cyan) 48%, transparent),
    transparent 62%
  );
  filter: blur(8px);
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stratificazione “scalini” — z e micro-offset per rotazione lista */
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 1) {
  z-index: 1;
  transform: translate3d(0, 0, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 2) {
  z-index: 2;
  transform: translate3d(3px, 2px, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 3) {
  z-index: 3;
  transform: translate3d(-2px, 4px, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 4) {
  z-index: 4;
  transform: translate3d(4px, 1px, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 5) {
  z-index: 5;
  transform: translate3d(-3px, 3px, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 6) {
  z-index: 6;
  transform: translate3d(2px, 5px, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 7) {
  z-index: 7;
  transform: translate3d(-4px, 2px, 0);
}
.notes-panel .notes-feed-list > .notes-feed-item:nth-child(8n + 8) {
  z-index: 8;
  transform: translate3d(1px, 4px, 0);
}

/* Override specificità 0-4-0: batte i selettori nth-child sopra (0-4-0, stessa spec, cascade wins)
   Necessario per far funzionare l'elevazione z-index su hover/highlight/hint */
.notes-panel .notes-feed-list > .notes-feed-item:is(:hover, :focus-within),
.notes-panel .notes-feed-list > .notes-feed-item.is-active-highlight,
.notes-panel .notes-feed-list > .notes-feed-item.is-hover-link {
  z-index: 40;
}

.notes-feed-item:is(:hover, :focus-within),
.notes-feed-item.is-active-highlight,
.notes-feed-item.is-hover-link {
  z-index: 40;
  background: rgba(10, 11, 16, 0.96);
  border-color: color-mix(in srgb, var(--geo-ice-cyan) 28%, transparent);
  border-top-color: color-mix(in srgb, var(--geo-ice-cyan) 42%, transparent);
  border-left-color: color-mix(in srgb, var(--geo-ice-cyan) 36%, transparent);
  transform: translate3d(0, -7px, 0) scale(1.012);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, var(--geo-ice-cyan) 22%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, var(--geo-ice-cyan) 52%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, var(--geo-ice-cyan) 42%, transparent);
}

/* Hover / highlight / link marker: tinte attenuate (mix verso cyan UI), sync tipo forma */
.notes-feed-item[data-feed-type='point']:is(:hover, :focus-within),
.notes-feed-item[data-feed-type='point'].is-active-highlight,
.notes-feed-item[data-feed-type='point'].is-hover-link {
  border-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 58%, var(--cyan-accent) 42%) 22%, transparent);
  border-top-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 58%, var(--cyan-accent) 42%) 34%, transparent);
  border-left-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 58%, var(--cyan-accent) 42%) 28%, transparent);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 52%, var(--cyan-accent) 48%) 34%, transparent),
    0 0 26px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 50%, var(--cyan-accent) 50%) 14%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 52%, var(--cyan-accent) 48%) 28%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 52%, var(--cyan-accent) 48%) 22%, transparent);
}
.notes-feed-item[data-feed-type='rect']:is(:hover, :focus-within),
.notes-feed-item[data-feed-type='rect'].is-active-highlight,
.notes-feed-item[data-feed-type='rect'].is-hover-link {
  border-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 58%, var(--cyan-accent) 42%) 22%, transparent);
  border-top-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 58%, var(--cyan-accent) 42%) 34%, transparent);
  border-left-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 58%, var(--cyan-accent) 42%) 28%, transparent);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 52%, var(--cyan-accent) 48%) 34%, transparent),
    0 0 26px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 50%, var(--cyan-accent) 50%) 14%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 52%, var(--cyan-accent) 48%) 28%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 52%, var(--cyan-accent) 48%) 22%, transparent);
}
.notes-feed-item[data-feed-type='circle']:is(:hover, :focus-within),
.notes-feed-item[data-feed-type='circle'].is-active-highlight,
.notes-feed-item[data-feed-type='circle'].is-hover-link {
  border-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 56%, var(--cyan-accent) 44%) 22%, transparent);
  border-top-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 56%, var(--cyan-accent) 44%) 34%, transparent);
  border-left-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 56%, var(--cyan-accent) 44%) 28%, transparent);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 50%, var(--cyan-accent) 50%) 34%, transparent),
    0 0 28px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 48%, var(--cyan-accent) 52%) 15%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 50%, var(--cyan-accent) 50%) 29%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 50%, var(--cyan-accent) 50%) 23%, transparent);
}
.notes-feed-item[data-feed-type='line']:is(:hover, :focus-within),
.notes-feed-item[data-feed-type='line'].is-active-highlight,
.notes-feed-item[data-feed-type='line'].is-hover-link {
  border-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 58%, var(--cyan-accent) 42%) 22%, transparent);
  border-top-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 58%, var(--cyan-accent) 42%) 34%, transparent);
  border-left-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 58%, var(--cyan-accent) 42%) 28%, transparent);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 52%, var(--cyan-accent) 48%) 34%, transparent),
    0 0 26px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 50%, var(--cyan-accent) 50%) 14%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 52%, var(--cyan-accent) 48%) 28%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 52%, var(--cyan-accent) 48%) 22%, transparent);
}
.notes-feed-item[data-feed-type='text']:is(:hover, :focus-within),
.notes-feed-item[data-feed-type='text'].is-active-highlight,
.notes-feed-item[data-feed-type='text'].is-hover-link {
  border-color: color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 52%, var(--cyan-accent) 48%) 26%, transparent);
  border-top-color: color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 52%, var(--cyan-accent) 48%) 38%, transparent);
  border-left-color: color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 52%, var(--cyan-accent) 48%) 32%, transparent);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 48%, var(--cyan-accent) 52%) 30%, transparent),
    0 0 24px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 45%, var(--cyan-accent) 55%) 13%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 48%, var(--cyan-accent) 52%) 26%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 48%, var(--cyan-accent) 52%) 21%, transparent);
}
.notes-feed-item[data-feed-type='freehand']:is(:hover, :focus-within),
.notes-feed-item[data-feed-type='freehand'].is-active-highlight,
.notes-feed-item[data-feed-type='freehand'].is-hover-link {
  border-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 46%, var(--cyan-accent) 54%) 20%, transparent);
  border-top-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 46%, var(--cyan-accent) 54%) 32%, transparent);
  border-left-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 46%, var(--cyan-accent) 54%) 26%, transparent);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 42%, var(--cyan-accent) 58%) 28%, transparent),
    0 0 24px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 40%, var(--cyan-accent) 60%) 11%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 42%, var(--cyan-accent) 58%) 26%, transparent),
    inset 1px 0 0 0 color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 42%, var(--cyan-accent) 58%) 21%, transparent);
}

.notes-feed-item:is(:hover, :focus-within)::before,
.notes-feed-item.is-active-highlight::before,
.notes-feed-item.is-hover-link::before {
  opacity: 1;
}

.notes-feed-item[data-feed-type='point']:is(:hover, :focus-within)::before,
.notes-feed-item[data-feed-type='point'].is-active-highlight::before,
.notes-feed-item[data-feed-type='point'].is-hover-link::before {
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 55%, var(--cyan-accent) 45%) 30%, transparent),
    transparent 62%
  );
}
.notes-feed-item[data-feed-type='rect']:is(:hover, :focus-within)::before,
.notes-feed-item[data-feed-type='rect'].is-active-highlight::before,
.notes-feed-item[data-feed-type='rect'].is-hover-link::before {
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 55%, var(--cyan-accent) 45%) 30%, transparent),
    transparent 62%
  );
}
.notes-feed-item[data-feed-type='circle']:is(:hover, :focus-within)::before,
.notes-feed-item[data-feed-type='circle'].is-active-highlight::before,
.notes-feed-item[data-feed-type='circle'].is-hover-link::before {
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 52%, var(--cyan-accent) 48%) 30%, transparent),
    transparent 62%
  );
}
.notes-feed-item[data-feed-type='line']:is(:hover, :focus-within)::before,
.notes-feed-item[data-feed-type='line'].is-active-highlight::before,
.notes-feed-item[data-feed-type='line'].is-hover-link::before {
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 55%, var(--cyan-accent) 45%) 30%, transparent),
    transparent 62%
  );
}
.notes-feed-item[data-feed-type='text']:is(:hover, :focus-within)::before,
.notes-feed-item[data-feed-type='text'].is-active-highlight::before,
.notes-feed-item[data-feed-type='text'].is-hover-link::before {
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 48%, var(--cyan-accent) 52%) 28%, transparent),
    transparent 62%
  );
}
.notes-feed-item[data-feed-type='freehand']:is(:hover, :focus-within)::before,
.notes-feed-item[data-feed-type='freehand'].is-active-highlight::before,
.notes-feed-item[data-feed-type='freehand'].is-hover-link::before {
  background: radial-gradient(
    ellipse 95% 72% at 50% 108%,
    color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 42%, var(--cyan-accent) 58%) 26%, transparent),
    transparent 62%
  );
}

.notes-feed-item__glyph-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1px;
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: stretch;
}

/* Barra SX: riposo grigio; hover/highlight = più cyan, glow attenuato (mix tool + cyan) */
.notes-feed-item__rail {
  grid-column: 1;
  grid-row: 1 / -1;
  width: 3px;
  min-height: 100%;
  align-self: stretch;
  border-radius: 2px;
  background: #9ca3af;
  /* filter aggiunto iter 8 (13 Maggio 2026): transition invece di @keyframes infinite
     per il "respiro" del LED attivo. Una transition non ha un frame-0 da cui il
     compositor può ripartire al tab resume → zero flash al cambio tab. */
  transition:
    background var(--note-lumen-dur) var(--note-lumen-ease),
    box-shadow 0.26s var(--note-lumen-ease),
    filter 0.35s ease;
}
.notes-feed-item[data-feed-type='point']:is(:hover, :focus-within) .notes-feed-item__rail,
.notes-feed-item[data-feed-type='point'].is-active-highlight .notes-feed-item__rail,
.notes-feed-item[data-feed-type='point'].is-hover-link .notes-feed-item__rail {
  background: color-mix(in srgb, rgb(var(--tool-point-rgb)) 28%, var(--cyan-accent) 72%);
  box-shadow:
    -4px 0 14px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 55%, var(--cyan-accent) 45%) 38%, transparent),
    -10px 0 32px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 50%, var(--cyan-accent) 50%) 26%, transparent),
    -2px 0 10px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 52%, var(--cyan-accent) 48%) 22%, transparent);
}
.notes-feed-item[data-feed-type='rect']:is(:hover, :focus-within) .notes-feed-item__rail,
.notes-feed-item[data-feed-type='rect'].is-active-highlight .notes-feed-item__rail,
.notes-feed-item[data-feed-type='rect'].is-hover-link .notes-feed-item__rail {
  background: color-mix(in srgb, rgb(var(--tool-rect-rgb)) 28%, var(--cyan-accent) 72%);
  box-shadow:
    -4px 0 14px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 55%, var(--cyan-accent) 45%) 38%, transparent),
    -10px 0 32px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 50%, var(--cyan-accent) 50%) 26%, transparent),
    -2px 0 10px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 52%, var(--cyan-accent) 48%) 22%, transparent);
}
.notes-feed-item[data-feed-type='circle']:is(:hover, :focus-within) .notes-feed-item__rail,
.notes-feed-item[data-feed-type='circle'].is-active-highlight .notes-feed-item__rail,
.notes-feed-item[data-feed-type='circle'].is-hover-link .notes-feed-item__rail {
  background: color-mix(in srgb, rgb(var(--tool-circle-rgb)) 30%, var(--cyan-accent) 70%);
  box-shadow:
    -4px 0 15px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 52%, var(--cyan-accent) 48%) 40%, transparent),
    -12px 0 34px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 48%, var(--cyan-accent) 52%) 28%, transparent),
    -2px 0 11px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 50%, var(--cyan-accent) 50%) 24%, transparent);
}
.notes-feed-item[data-feed-type='line']:is(:hover, :focus-within) .notes-feed-item__rail,
.notes-feed-item[data-feed-type='line'].is-active-highlight .notes-feed-item__rail,
.notes-feed-item[data-feed-type='line'].is-hover-link .notes-feed-item__rail {
  background: color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 28%, var(--cyan-accent) 72%);
  box-shadow:
    -4px 0 14px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 55%, var(--cyan-accent) 45%) 38%, transparent),
    -10px 0 32px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 50%, var(--cyan-accent) 50%) 26%, transparent),
    -2px 0 10px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 52%, var(--cyan-accent) 48%) 22%, transparent);
}
.notes-feed-item[data-feed-type='text']:is(:hover, :focus-within) .notes-feed-item__rail,
.notes-feed-item[data-feed-type='text'].is-active-highlight .notes-feed-item__rail,
.notes-feed-item[data-feed-type='text'].is-hover-link .notes-feed-item__rail {
  background: color-mix(in srgb, var(--accent-solid) 26%, var(--cyan-accent) 74%);
  box-shadow:
    -4px 0 14px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 48%, var(--cyan-accent) 52%) 34%, transparent),
    -10px 0 30px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 42%, var(--cyan-accent) 58%) 24%, transparent),
    -2px 0 10px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 45%, var(--cyan-accent) 55%) 20%, transparent);
}
.notes-feed-item[data-feed-type='freehand']:is(:hover, :focus-within) .notes-feed-item__rail,
.notes-feed-item[data-feed-type='freehand'].is-active-highlight .notes-feed-item__rail,
.notes-feed-item[data-feed-type='freehand'].is-hover-link .notes-feed-item__rail {
  background: color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 24%, var(--cyan-accent) 76%);
  box-shadow:
    -4px 0 14px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 45%, var(--cyan-accent) 55%) 34%, transparent),
    -10px 0 30px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 40%, var(--cyan-accent) 60%) 22%, transparent),
    -2px 0 10px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 42%, var(--cyan-accent) 58%) 19%, transparent);
}

/* LED striscia SX: brightness elevata su nota attiva / hover-link.
   Iter 8 (13 Maggio 2026): rimosso @keyframes infinite alternate (notes-feed-rail-led-sync).
   Il loop infinito causava un restart dal frame-0 (brightness:1 = LED spento) ogni volta
   che il browser riportava la tab in foreground — flash visibile e inaccettabile.
   Sostituito con filter:brightness statico + transition 0.35s: l'effetto "accensione"
   avviene solo al cambio di classe DOM (click nota), non ha un frame-0 da cui ripartire
   → zero flash garantito al tab resume. L'animation one-shot note-rail-sync-pulse
   (non infinite) non è toccata: continua a funzionare correttamente. */
.notes-feed-item.is-active-highlight .notes-feed-item__rail,
.notes-feed-item.is-hover-link .notes-feed-item__rail {
  filter: brightness(1.18);
}

/* Corpo: testo a sinistra (aria dal blocco rail+icona); telemetria in alto a destra; cestino fuori griglia (absolute) */
.notes-feed-item__shell {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  column-gap: 14px;
  align-items: start;
  min-width: 0;
  padding-left: 22px;
}
.notes-feed-item__telemetry {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.note-cloud-badge:not([hidden]) {
  margin-right: auto;
}

/* Matita / cestino riga nota — ghost in t1_action_icons.css; solo posizionamento */
.note-edit-btn,
.note-delete-btn {
  z-index: 3;
}

/* Posizionamento assoluto sul wrapper hint-host (il bottone è relativo al wrapper) */
.notes-feed-item > .note-action-hint-host.notes-feed-item__edit {
  position: absolute;
  bottom: 8px;
  right: 48px;
  z-index: 4;
}

.notes-feed-item > .note-action-hint-host.notes-feed-item__trash {
  position: absolute;
  bottom: 8px;
  right: 16px;
  z-index: 4;
}

.notes-feed-item::after {
  display: none;
}

/* Feedback sync cloud (mostrato brevemente dopo insert Supabase) */
.note-cloud-badge {
  font-size: 0.72rem;
  line-height: 1;
  color: rgba(0, 229, 255, 0.82);
  flex-shrink: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.notes-feed-item.note-sync-flash {
  border-color: rgba(52, 211, 153, 0.65);
  outline: 2px solid rgba(52, 211, 153, 0.75);
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px rgba(52, 211, 153, 0.35),
    0 4px 22px rgba(52, 211, 153, 0.22);
}
.notes-feed-item.note-sync-flash .notes-feed-item__rail {
  animation: note-rail-sync-pulse 1.15s ease-out;
}
/* @keyframes note-rail-sync-pulse — estratto in styles/keyframes.css */

/* Chip tempo — gemello visivo ai quadranti rail */
.note-timestamp-chip {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  margin: 0;
  padding: 6px 10px;
  min-height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cyan-accent);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color var(--t-fast),
    background var(--t-fast),
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}
.note-timestamp-chip:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.45);
  color: var(--cyan-accent);
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1);
}
.note-timestamp-chip:active {
  transform: scale(0.98);
}

/* Nel feed note: Timing più netto del corpo testo */
.notes-feed-item .note-timestamp-chip {
  color: var(--cyan-accent);
  font-weight: 700;
  letter-spacing: 0.1em;
  -webkit-font-smoothing: antialiased;
  font-synthesis: weight;
  border-color: rgba(0, 229, 255, 0.22);
  background: rgba(0, 229, 255, 0.06);
  box-shadow: none;
  transition:
    color var(--note-lumen-dur) var(--note-lumen-ease),
    background var(--note-lumen-dur) var(--note-lumen-ease),
    border-color var(--note-lumen-dur) var(--note-lumen-ease),
    box-shadow var(--note-lumen-dur) var(--note-lumen-ease);
}

.notes-feed-item:is(:hover, :focus-within) .note-timestamp-chip,
.notes-feed-item.is-active-highlight .note-timestamp-chip,
.notes-feed-item.is-hover-link .note-timestamp-chip {
  border-color: rgba(0, 229, 255, 0.48);
  background: rgba(0, 229, 255, 0.12);
  box-shadow:
    0 0 16px rgba(0, 229, 255, 0.28),
    inset 0 0 12px rgba(0, 229, 255, 0.08);
}

.notes-feed-item-text {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 400;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 48%, var(--t1-helm-frost) 52%);
  line-height: 1.55;
  word-break: break-word;
  min-width: 0;
  transition:
    color var(--note-lumen-dur) var(--note-lumen-ease),
    text-shadow var(--note-lumen-dur) var(--note-lumen-ease);
}
.notes-feed-item__shell > .notes-feed-item-text {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}
.notes-feed-item:is(:hover, :focus-within) .notes-feed-item-text:not(.notes-feed-item-text--empty),
.notes-feed-item.is-active-highlight .notes-feed-item-text:not(.notes-feed-item-text--empty),
.notes-feed-item.is-hover-link .notes-feed-item-text:not(.notes-feed-item-text--empty) {
  color: var(--cyan-accent);
  text-shadow:
    0 0 14px rgba(0, 229, 255, 0.38),
    0 0 26px rgba(0, 229, 255, 0.12);
}
.notes-feed-item-placeholder {
  color: var(--t1-helm-frost-muted);
  opacity: 0.82;
  font-style: normal;
  transition:
    opacity var(--note-lumen-dur) var(--note-lumen-ease),
    color var(--note-lumen-dur) var(--note-lumen-ease),
    text-shadow var(--note-lumen-dur) var(--note-lumen-ease);
}
.notes-feed-item:is(:hover, :focus-within) .notes-feed-item-text--empty .notes-feed-item-placeholder,
.notes-feed-item.is-active-highlight .notes-feed-item-text--empty .notes-feed-item-placeholder,
.notes-feed-item.is-hover-link .notes-feed-item-text--empty .notes-feed-item-placeholder {
  color: var(--cyan-accent);
  opacity: 1;
  text-shadow:
    0 0 12px rgba(0, 229, 255, 0.35),
    0 0 22px rgba(0, 229, 255, 0.12);
}

/* North star — feed note: Inter 300 + ghiaccio (gerarchia; hover senza “neon pieno” sul corpo) */
.notes-panel .notes-feed-item-text {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.042em;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 40%, var(--t1-helm-frost) 60%);
}

.notes-panel .notes-feed-item:is(:hover, :focus-within) .notes-feed-item-text:not(.notes-feed-item-text--empty),
.notes-panel .notes-feed-item.is-active-highlight .notes-feed-item-text:not(.notes-feed-item-text--empty),
.notes-panel .notes-feed-item.is-hover-link .notes-feed-item-text:not(.notes-feed-item-text--empty) {
  color: color-mix(in srgb, var(--t1-helm-frost) 82%, var(--geo-ice-cyan) 18%);
  text-shadow:
    0 0 18px color-mix(in srgb, var(--geo-ice-cyan) 24%, transparent),
    0 0 36px color-mix(in srgb, var(--geo-ice-cyan) 8%, transparent);
}

.notes-panel .notes-feed-item-placeholder {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--t1-helm-frost-dim);
  opacity: 0.88;
}

.notes-panel .notes-feed-item:is(:hover, :focus-within) .notes-feed-item-text--empty .notes-feed-item-placeholder,
.notes-panel .notes-feed-item.is-active-highlight .notes-feed-item-text--empty .notes-feed-item-placeholder,
.notes-panel .notes-feed-item.is-hover-link .notes-feed-item-text--empty .notes-feed-item-placeholder {
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 52%, var(--geo-ice-cyan) 48%);
  opacity: 1;
  text-shadow: 0 0 16px color-mix(in srgb, var(--geo-ice-cyan) 20%, transparent);
}

.notes-panel .notes-feed-item .note-timestamp-chip {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.068em;
  font-synthesis: none;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 35%, var(--cyan-accent) 65%);
  border-color: color-mix(in srgb, var(--geo-ice-cyan) 28%, transparent);
  background: color-mix(in srgb, var(--geo-ice-cyan) 7%, rgba(255, 255, 255, 0.02));
}

.notes-panel .notes-feed-item:is(:hover, :focus-within) .note-timestamp-chip,
.notes-panel .notes-feed-item.is-active-highlight .note-timestamp-chip,
.notes-panel .notes-feed-item.is-hover-link .note-timestamp-chip {
  color: color-mix(in srgb, var(--t1-helm-frost) 22%, var(--cyan-accent) 78%);
  border-color: color-mix(in srgb, var(--geo-ice-cyan) 42%, transparent);
  background: color-mix(in srgb, var(--geo-ice-cyan) 12%, rgba(0, 0, 0, 0.2));
  box-shadow:
    0 0 14px color-mix(in srgb, var(--geo-ice-cyan) 22%, transparent),
    inset 0 0 10px color-mix(in srgb, var(--geo-ice-cyan) 8%, transparent);
}

.notes-panel .notes-feed-empty {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--t1-helm-frost-dim);
  text-transform: uppercase;
  line-height: 1.75;
}

.notes-panel .notes-feed-type-icon {
  color: var(--t1-helm-frost-muted);
}

.notes-panel .notes-feed-item:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item.is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item.is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 35%, var(--cyan-accent) 65%);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--geo-ice-cyan) 35%, transparent));
}

.notes-panel .notes-feed-item[data-feed-type='point']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='point'].is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='point'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 26%, color-mix(in srgb, rgb(var(--tool-point-rgb)) 68%, var(--cyan-accent) 32%) 74%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 55%, var(--cyan-accent) 45%) 34%, transparent));
}
.notes-panel .notes-feed-item[data-feed-type='rect']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='rect'].is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='rect'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 26%, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 68%, var(--cyan-accent) 32%) 74%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 55%, var(--cyan-accent) 45%) 34%, transparent));
}
.notes-panel .notes-feed-item[data-feed-type='circle']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='circle'].is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='circle'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 26%, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 66%, var(--cyan-accent) 34%) 74%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 52%, var(--cyan-accent) 48%) 34%, transparent));
}
.notes-panel .notes-feed-item[data-feed-type='line']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='line'].is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='line'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 26%, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 68%, var(--cyan-accent) 32%) 74%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 55%, var(--cyan-accent) 45%) 34%, transparent));
}
.notes-panel .notes-feed-item[data-feed-type='text']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='text'].is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='text'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 28%, color-mix(in srgb, var(--accent-solid) 62%, var(--cyan-accent) 38%) 72%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 48%, var(--cyan-accent) 52%) 30%, transparent));
}
.notes-panel .notes-feed-item[data-feed-type='freehand']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='freehand'].is-active-highlight .notes-feed-type-icon,
.notes-panel .notes-feed-item[data-feed-type='freehand'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--t1-helm-frost) 24%, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 58%, var(--cyan-accent) 42%) 76%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 45%, var(--cyan-accent) 55%) 28%, transparent));
}

.notes-panel .note-cloud-badge {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--t1-helm-frost-muted) 28%, var(--cyan-accent) 72%);
}

.notes-panel .notes-purge-confirm__title {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--t1-helm-frost);
}

.notes-panel .notes-purge-confirm__hint {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.028em;
  color: var(--t1-helm-frost-muted);
}

.notes-panel .notes-purge-scope__label {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--t1-helm-frost-dim);
}

.notes-panel .notes-purge-scope__title {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 400;
  letter-spacing: 0.022em;
  color: var(--t1-helm-frost);
}

.notes-panel .notes-purge-scope__sub {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 300;
  letter-spacing: 0.022em;
  color: var(--t1-helm-frost-muted);
}

.notes-panel .notes-purge-confirm__cancel,
.notes-panel .notes-purge-confirm__confirm {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-weight: 500;
  letter-spacing: 0.07em;
}

.notes-feed-empty {
  text-align: center;
  padding: 28px 10px;
  font-family: var(--font-tech);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1.8;
}

/* Icona tipo: riposo grigio; hover/highlight = colore forma + drop-shadow (sync con rail/card) */
.notes-feed-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #9ca3af;
  line-height: 0;
  filter: none;
  transition:
    color var(--note-lumen-dur) var(--note-lumen-ease),
    filter var(--note-lumen-dur) var(--note-lumen-ease);
}
.notes-feed-type-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}
.notes-feed-item:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item.is-active-highlight .notes-feed-type-icon,
.notes-feed-item.is-hover-link .notes-feed-type-icon {
  color: var(--cyan-accent);
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.55));
}

.notes-feed-item[data-feed-type='point']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item[data-feed-type='point'].is-active-highlight .notes-feed-type-icon,
.notes-feed-item[data-feed-type='point'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, rgb(var(--tool-point-rgb)) 72%, var(--cyan-accent) 28%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-point-rgb)) 58%, var(--cyan-accent) 42%) 38%, transparent));
}
.notes-feed-item[data-feed-type='rect']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item[data-feed-type='rect'].is-active-highlight .notes-feed-type-icon,
.notes-feed-item[data-feed-type='rect'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, rgb(var(--tool-rect-rgb)) 72%, var(--cyan-accent) 28%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-rect-rgb)) 58%, var(--cyan-accent) 42%) 38%, transparent));
}
.notes-feed-item[data-feed-type='circle']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item[data-feed-type='circle'].is-active-highlight .notes-feed-type-icon,
.notes-feed-item[data-feed-type='circle'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, rgb(var(--tool-circle-rgb)) 70%, var(--cyan-accent) 30%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-circle-rgb)) 55%, var(--cyan-accent) 45%) 38%, transparent));
}
.notes-feed-item[data-feed-type='line']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item[data-feed-type='line'].is-active-highlight .notes-feed-type-icon,
.notes-feed-item[data-feed-type='line'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 72%, var(--cyan-accent) 28%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-arrow-rgb)) 58%, var(--cyan-accent) 42%) 38%, transparent));
}
.notes-feed-item[data-feed-type='text']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item[data-feed-type='text'].is-active-highlight .notes-feed-type-icon,
.notes-feed-item[data-feed-type='text'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, var(--accent-solid) 68%, var(--cyan-accent) 32%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, var(--accent-solid) 52%, var(--cyan-accent) 48%) 34%, transparent));
}
.notes-feed-item[data-feed-type='freehand']:is(:hover, :focus-within) .notes-feed-type-icon,
.notes-feed-item[data-feed-type='freehand'].is-active-highlight .notes-feed-type-icon,
.notes-feed-item[data-feed-type='freehand'].is-hover-link .notes-feed-type-icon {
  color: color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 62%, var(--cyan-accent) 38%);
  filter: drop-shadow(0 0 9px color-mix(in srgb, color-mix(in srgb, rgb(var(--tool-ghost-rgb)) 48%, var(--cyan-accent) 52%) 32%, transparent));
}

/* Search bar — predisposta, attiva quando serve */
.profile-search {
  position: relative;
  margin-bottom: 12px;
}
.profile-search::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9bb4' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}
.profile-search input {
  padding-left: 30px;
  font-size: 0.75rem;
  margin-top: 0;
}

.profile-list {
  overflow-y: auto;
  overflow-x: hidden;   /* il translateX(3px) sull'hover non causa scrollbar orizzontale */
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}
.profile-list::-webkit-scrollbar { width: 3px; }
.profile-list::-webkit-scrollbar-track { background: transparent; }
.profile-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
}

/* ── Skeleton loading & empty state ──────────────────────────────────── */
.profile-list-loading,
.profile-list-empty {
  padding: 14px 10px;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 7px;
}
.profile-list-loading-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-accent);
  opacity: 0.7;
  animation: loading-pulse 1.1s ease-in-out infinite alternate;
}
/* @keyframes loading-pulse — estratto in styles/keyframes.css */

.profile-card {
  position: relative;
  box-sizing: border-box;           /* larghezza stabile — padding e border inclusi */
  background: var(--panel-bg);
  /* Tutti i bordi a larghezza FISSA e mai cambiano dimensione sull'hover:
     border-left è 2px transparent di default → diventa colorato ma resta 2px.
     Questo è il pattern corretto per evitare il tremolio da aggiunta di bordo. */
  border: 1px solid var(--panel-border);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  max-height: 80px;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  will-change: transform;           /* hint al browser: usa GPU, evita reflow */
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color var(--t-fast),
    background var(--t-fast),
    transform var(--t-fast),
    box-shadow var(--t-fast),
    opacity 0.28s ease,
    max-height 0.32s ease,
    margin-bottom 0.32s ease,
    padding 0.32s ease;
}

/* Flash rosso prima dell'eliminazione */
.profile-card.is-delete-flash {
  border-color: rgba(239, 68, 68, 0.7) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3), inset 0 0 8px rgba(239, 68, 68, 0.1) !important;
}

/* Inner glow radiale — illuminazione dall'interno all'hover */
.profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% -10%, rgba(109, 40, 168, 0.22) 0%, transparent 68%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.profile-card:hover::before { opacity: 1; }
.profile-card.is-active::before { opacity: 0.6; }

.profile-card:hover {
  border-color: var(--accent-solid);
  border-left-color: var(--accent-solid);
  background: var(--accent-hover-bg);
  transform: translateX(3px);
  box-shadow: 0 4px 16px var(--accent-shadow-sm);
}
.profile-card.is-active {
  border-color: var(--accent-solid);
  border-left-color: var(--accent-solid);
  background: var(--accent-active-bg);
  box-shadow: 0 4px 20px var(--accent-shadow-md);
}
.profile-card.is-active:hover { transform: translateX(3px); }

/* Pressione fisica — stessa sensazione dei tasti */
.profile-card:active {
  transform: translateX(2px) translateY(1px) scale(0.99);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Animazione di uscita */
.profile-card.is-deleting {
  opacity: 0;
  transform: translateX(-10px);
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* Testo card — lasciamo spazio a destra per il tasto delete */
.profile-card-name {
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 26px;
}
/* La freccia ▶ è SEMPRE nel DOM (content fisso) ma invisibile di default.
   Usare opacity invece di aggiungere/rimuovere content evita il reflow
   che causa il tremolio della sidebar al click della card. */
.profile-card-name::after {
  content: '▶';
  font-size: 0.55rem;
  color: var(--accent-solid);
  line-height: 1;
  opacity: 0;
  transition: opacity var(--t-fast);
  flex-shrink: 0;
}
.profile-card.is-active .profile-card-name::after {
  opacity: 1;
}

.profile-card-url {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 26px;
}

/* Bottone elimina — posizionato in assoluto, non sposta il testo */
.profile-card-delete {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
  z-index: 2;
}
.profile-card:hover .profile-card-delete { opacity: 1; }
.profile-card-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.profile-card-delete:disabled {
  cursor: wait;
  opacity: 1;
  color: var(--text-muted);
  background: transparent;
  pointer-events: none;
}

/* Sofia Conti — card espandibile con lista sessioni (Data Sync) */
.profile-card.profile-card--sofia {
  cursor: default;
  max-height: 88px;
}
.profile-card.profile-card--sofia.is-expanded {
  max-height: 320px;
  overflow-y: auto;
}
.profile-card.profile-card--sofia .profile-card-head {
  cursor: pointer;
  outline: none;
}
.profile-card.profile-card--sofia .profile-card-head:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.45);
  border-radius: var(--radius-sm);
}
.profile-card.profile-card--sofia .profile-card-chevron {
  display: inline-block;
  margin-right: 4px;
  font-size: 0.65rem;
  color: var(--cyan-accent);
  transition: transform 0.22s ease;
  vertical-align: middle;
}
.profile-card.profile-card--sofia.is-expanded .profile-card-chevron {
  transform: rotate(90deg);
}
.profile-card.profile-card--sofia .profile-card-name {
  display: inline;
  padding-right: 26px;
}
.profile-card.profile-card--sofia .profile-card-url--sofia-hint {
  font-size: 0.62rem;
  color: rgba(0, 229, 255, 0.55);
}
.profile-card.profile-card--sofia .profile-card-session-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-card.profile-card--sofia .profile-card-session-list[hidden] {
  display: none !important;
}
.profile-session-row {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-pure);
  font-family: var(--font-tech);
  font-size: 0.72rem;
  cursor: pointer;
  transition:
    border-color var(--t-fast),
    background var(--t-fast),
    color var(--t-fast);
}
.profile-session-row:hover {
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.06);
  color: var(--cyan-accent);
}

/* ═══════════════════════════════════════════
   WORKSPACE & PLAYER
   ═══════════════════════════════════════════ */
.workspace {
  flex: 1 1 0%;   /* cresce illimitato, si restringe se serve, base 0 */
  min-width: 0;   /* fix flexbox: senza questo il browser usa min-width:auto
                     e il container non cede spazio al player */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.player-wrapper {
  width: 95%;
  max-width: 1300px;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 1 auto;
  min-height: 0;
  /* Cromatura esterna traslucida: texture cockpit intravedibile (stage video resta coperta dal nero interno) */
  background: rgba(4, 6, 12, 0.46);
  backdrop-filter: blur(var(--geo-panel-blur)) saturate(1.05);
  -webkit-backdrop-filter: blur(var(--geo-panel-blur)) saturate(1.05);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 48%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 38%, transparent);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.42);
  box-shadow:
    var(--geo-plate-drop),
    var(--geo-plate-inset-cyan),
    var(--geo-plate-well);
  transition: box-shadow var(--t-smooth), opacity 0.18s ease, border-color var(--t-smooth);
}

/* Fullscreen sullo shell #player-wrapper: media stage riempie tutto il viewport;
   #cockpit-transport in overlay fisso in basso (niente flex che riserva spazio / slitta). */
#player-wrapper:fullscreen,
#player-wrapper:-webkit-full-screen,
#player-wrapper:-moz-full-screen {
  max-height: none !important;
  height: 100%;
  width: 100%;
  border-radius: 0;
  display: block;
  position: relative;
  overflow: hidden;
}

#player-wrapper:fullscreen .player-media-stage,
#player-wrapper:-webkit-full-screen .player-media-stage,
#player-wrapper:-moz-full-screen .player-media-stage {
  position: absolute;
  inset: 0;
  flex: none;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: unset;
  min-height: 0;
}

#player-wrapper:fullscreen #cockpit-transport,
#player-wrapper:-webkit-full-screen #cockpit-transport,
#player-wrapper:-moz-full-screen #cockpit-transport {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  flex-shrink: 0;
  flex-wrap: nowrap;
  min-height: 52px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Video locale: centrato con letterboxing se il rapporto non coincide col monitor */
#player-wrapper:fullscreen #local-player,
#player-wrapper:-webkit-full-screen #local-player,
#player-wrapper:-moz-full-screen #local-player,
#player-wrapper:fullscreen #local-player-ref,
#player-wrapper:-webkit-full-screen #local-player-ref,
#player-wrapper:-moz-full-screen #local-player-ref {
  object-fit: contain;
}

/* Area video 16:9 singolo Master · 32:9 duello dentro altezza fissa cockpit */
.player-media-stage {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  transform-origin: center center;
}

/* Overlay caricamento Master — sopra il canvas video, sotto popup annotazione (z 60) */
.player-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
  background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: player-loading-overlay-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.player-loading-overlay[hidden] {
  display: none !important;
}

.player-loading-overlay__pulse {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--t1-cyan) 55%, transparent);
  border-top-color: transparent;
  animation: player-loading-spin 0.85s linear infinite;
  box-shadow: 0 0 22px color-mix(in srgb, var(--t1-cyan) 35%, transparent);
}

.player-loading-overlay__label {
  font-family: var(--t1-font-ui, var(--font-main, sans-serif));
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(212, 208, 200, 0.78);
}

/* @keyframes player-loading-overlay-in / player-loading-spin — estratti in styles/keyframes.css */

.player-wrapper.has-reference .player-media-stage {
  aspect-ratio: 32 / 9;
}

.dual-split {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-wrap: nowrap;
  background: #000;
  min-width: 0;
  min-height: 0;
}

.dual-slot {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.player-wrapper:not(.has-reference) .dual-slot--master {
  flex: 1 1 100%;
  width: 100%;
}

.player-wrapper:not(.has-reference) .dual-slot--reference {
  flex: 0 0 0%;
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.player-wrapper.has-reference .dual-slot--reference {
  visibility: visible;
}

.player-wrapper.has-reference .dual-slot--master,
.player-wrapper.has-reference .dual-slot--reference {
  flex: 1 1 50%;
  width: 50%;
}

.player-wrapper.has-reference .dual-slot--master {
  border-right: 1px solid rgba(0, 229, 255, 0.15);
}


/* ════════════════════════════════════════════════════════════════════════
   GLASS MONORAIL · Cockpit Transport (Fase 2.5.0)
   ════════════════════════════════════════════════════════════════════════
   Il fondo del cockpit diventa un "binario di cristallo sospeso":
     • margin laterale 12px → il vetro NON e' incollato ai bordi viewport
     • border-radius SOLO angoli superiori (18px/18px/0/0) → il binario
       emerge dal fondo dello schermo, non galleggia nel vuoto.
     • backdrop-filter blur(24px) saturate(1.20) → vetro spesso (era
       15px/1.05, "pannello opaco").
     • Doppio edge highlight (pearl zenitale + cyan inferiore) → spessore
       fisico del cristallo.
     • Edge top luminoso pulsante quando data-playing='1' (animation a
       2200ms, leggero respiro cyan).
     • Sopra overlay annotazione nel wrapper (z-index interni ≤ ~60).
   ──────────────────────────────────────────────────────────────────────── */
.cockpit-transport {
  position: relative;
  z-index: 9999;
  isolation: isolate;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
  min-height: 52px;
  /* Monorail sospeso (raffinamento Gemini): margin laterale + radius top-only */
  margin: 0 12px;
  border-radius: 18px 18px 0 0;
  background: rgba(6, 8, 12, 0.42);
  backdrop-filter: blur(24px) saturate(1.20);
  -webkit-backdrop-filter: blur(24px) saturate(1.20);
  border-top: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow:
    /* Edge highlight zenitale pearl (spessore vetro top) */
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    /* Edge highlight cyan in alto-interno (gemello dell'identita del cockpit) */
    inset 0 2px 0 rgba(0, 229, 255, 0.10),
    /* Inset glow morbido cyan diffuso */
    inset 0 -1px 0 rgba(0, 229, 255, 0.14),
    /* Shadow superiore ampia: il binario "stacca" dal fondo */
    0 -18px 48px rgba(0, 0, 0, 0.55),
    0 -4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

/* T0.16a-S1 — transport desktop Santuario: core + system su una riga (mode-tools vuoto) */
@media (min-width: 768px) {
  .cockpit-transport:not(:has(.cockpit-zone--mode-tools:not(:empty))) {
    flex-wrap: nowrap;
  }
  .cockpit-transport .cockpit-zone--core {
    flex-wrap: nowrap;
  }
}

/* Edge superiore pulsante quando si sta riproducendo — respiro cyan ~2.2s.
   La barra di luce e' clippata al 76% centrale per non toccare gli angoli. */
.cockpit-transport[data-playing='1']::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 229, 255, 0.65) 50%,
    transparent 100%);
  filter: blur(0.3px);
  animation: t1-monorail-pulse 2200ms ease-in-out infinite;
  pointer-events: none;
  border-radius: 1px;
}

/* @keyframes t1-monorail-pulse — estratto in styles/keyframes.css */

/* Reduced motion: niente pulsazione, ma manteniamo la linea statica visibile */
@media (prefers-reduced-motion: reduce) {
  .cockpit-transport[data-playing='1']::before {
    animation: none;
    opacity: 0.7;
  }
}

.cockpit-playpause {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-bottom-color: rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(circle at 30% 28%, rgba(0, 229, 255, 0.22), transparent 52%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.08) 0%, rgba(4, 10, 18, 0.88) 100%);
  color: #00e5ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.45),
    inset 1px 1px 0 rgba(0, 229, 255, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.5);
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.cockpit-playpause:hover {
  filter: brightness(1.12);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.45),
    inset 1px 1px 0 rgba(0, 229, 255, 0.26),
    0 0 18px color-mix(in srgb, var(--t1-cyan) 35%, transparent),
    0 6px 14px rgba(0, 0, 0, 0.55);
}

.cockpit-playpause:focus {
  outline: none;
}

.cockpit-playpause:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--t1-cyan) 65%, transparent);
  outline-offset: 2px;
}

.cockpit-transport[data-playing='1'] .ico-play {
  display: none;
}
.cockpit-transport[data-playing='1'] .ico-pause {
  display: block !important;
}
.cockpit-transport:not([data-playing='1']) .ico-play {
  display: block;
}
.cockpit-transport:not([data-playing='1']) .ico-pause {
  display: none !important;
}

.cockpit-progress-wrap {
  flex: 1 1 200px;
  min-width: 120px;
  position: relative;
  /* VIS-STU-SCRUB P2-C3: hit area verticale ampia senza spostare la track visiva */
  padding: 9px 0;
  margin: -9px 0;
  cursor: pointer;
  touch-action: none;
  /* Aggancio Ametista Needle (Fase 2.5.1): la lama legge --playhead-pct
     come left-offset, aggiornato dal ticker JS. */
  --playhead-pct: 0%;
}

/* ────────────────────────────────────────────────────────────────────────
   PROGRESS BAR · range nativo trasformato in track di cristallo (Fase 2.5.0)
     • track: gradient pearl-cyan-pearl invece di accent-color flat
     • thumb nativo nascosto: lo sostituisce il pseudo-thumb DOM .t1-playhead
       (Fase 2.5.1). Lo scrubbing nativo continua a funzionare perche'
       l'input range resta in DOM e mantiene pointer-events.
   ──────────────────────────────────────────────────────────────────────── */
.cockpit-progress {
  width: 100%;
  height: 8px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  /* accent-color come fallback per browser senza ::-webkit-slider-* */
  accent-color: #00e5ff;
}

.cockpit-progress::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--t1-pearl) 38%, transparent),
    rgba(0, 229, 255, 0.55) 50%,
    color-mix(in srgb, var(--t1-pearl) 38%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.cockpit-progress::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--t1-pearl) 38%, transparent),
    rgba(0, 229, 255, 0.55) 50%,
    color-mix(in srgb, var(--t1-pearl) 38%, transparent));
}

/* Thumb nativo nascosto ma con hit-target generoso (P2-C3):
   18×18px — zona cliccabile più ampia; seek da clientX in timeline.js. */
.cockpit-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  opacity: 0;
  background: transparent;
  border: none;
  margin-top: -7px;
  cursor: pointer;
}
.cockpit-progress::-moz-range-thumb {
  width: 18px;
  height: 18px;
  opacity: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ────────────────────────────────────────────────────────────────────────
   AMETISTA NEEDLE + LENS (Fase 2.5.1)
     • position absolute con left:var(--playhead-pct) sincronizzato dal JS
     • pointer-events:none → lo scrub nativo dell'input range resta intatto
     • lama: 2px×26px gradient ametista→trasparente con glow ametista
     • lente: tondino 10px ametista con highlight bianco interno (perla
       di luce sospesa che taglia il tempo)
   ──────────────────────────────────────────────────────────────────────── */
.t1-playhead {
  position: absolute;
  top: 50%;
  left: 0;
  /* Polish 2.5.1.2: posizione via transform (GPU compositing) invece di
     left. Il browser ottimizza translate via compositor — niente layout
     pass, latenza minore su drag veloce.
     --playhead-x: px assoluti (calcolati dal JS dalla rect del wrap).
     translate(-50%,-50%) centra l'elemento sulla X target. */
  transform: translate(-50%, -50%) translateX(var(--playhead-x, 0px));
  /* will-change dinamico: rimosso da qui, promosso solo durante is-scrubbing
     e su progress-wrap:hover (pre-emptive GPU layer). Evita il layer GPU
     permanente che causa l'"attrito iniziale" percepito al primo click. */
  width: 12px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
  /* Transizione leggera per addolcire il movimento al ticker 120ms durante
     la riproduzione normale (la lama segue il clock in step di 120ms). */
  transition: transform 90ms linear, filter 200ms ease;
  /* Refactor Gancio A: --accent-solid → --needle-color (alias semantico).
     In Santuario risolve identico; in Casting diventa verde/rating. */
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--needle-color) 45%, transparent));
}

/* Durante uno scrub manuale: la lama deve seguire il pointer al pixel,
   senza easing residuo. Mantieni solo la transizione del filter.
   will-change attivo QUI (solo quando serve) → GPU layer on-demand. */
.cockpit-transport.is-scrubbing .t1-playhead {
  transition: filter 200ms ease;
  will-change: transform;
}

/* Pre-emptive GPU layer appena l'utente si avvicina alla progress-wrap:
   anticipa il drag di ~200ms (tempo di hover→click umano medio).
   Rimuove l'"attrito iniziale" senza tenere il layer attivo tutto il tempo. */
.cockpit-progress-wrap:hover .t1-playhead {
  will-change: transform;
}

.t1-playhead-time {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-tech);
  font-size: 0.67rem;
  letter-spacing: 0.06em;
  color: var(--t1-pearl);
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(6, 8, 14, 0.84);
  border: 1px solid color-mix(in srgb, var(--needle-color) 22%, transparent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 120ms ease;
}

.cockpit-progress-wrap:hover .t1-playhead-time,
.cockpit-transport.is-scrubbing .t1-playhead-time {
  opacity: 1;
}

.t1-playhead-blade {
  position: absolute;
  width: 2px;
  height: 26px;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--needle-color) 55%, transparent) 22%,
    color-mix(in srgb, var(--needle-color) 95%, white) 50%,
    color-mix(in srgb, var(--needle-color) 55%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(6px * var(--neon-glow-intensity)) var(--needle-color),
    0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--needle-color) 50%, transparent);
  border-radius: 1px;
}

.t1-playhead-lens {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.92) 0%,
    color-mix(in srgb, var(--needle-color) 90%, white) 35%,
    var(--needle-color) 70%,
    transparent 100%);
  box-shadow:
    0 0 calc(10px * var(--neon-glow-intensity)) var(--needle-color),
    0 0 calc(22px * var(--neon-glow-intensity)) color-mix(in srgb, var(--needle-color) 40%, transparent),
    inset 0 0 3px rgba(255, 255, 255, 0.7);
}

/* Quando si sta riproducendo: la lente "respira" leggermente (1.2x sub-second) */
.cockpit-transport[data-playing='1'] .t1-playhead-lens {
  animation: t1-lens-breathe 1900ms ease-in-out infinite;
}
/* @keyframes t1-lens-breathe — estratto in styles/keyframes.css */
@media (prefers-reduced-motion: reduce) {
  .cockpit-transport[data-playing='1'] .t1-playhead-lens { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   DATA SHARDS · marker annotazioni sulla timeline (Fase 2.5.2)
   ────────────────────────────────────────────────────────────────────────
   Ogni annotazione del coach diventa un cristallo verticale sulla timeline,
   posizionato in % della duration. Il colore eredita la "mood" del tool
   usato per disegnarla, mantenendo la coerenza chromatic del Cockpit:
     • point  / line  / freehand     → ICE      (cyan)
     • arrow  / rect                 → WARM     (amber/rosa)
     • circle                        → AMETISTA (viola)
     • ghost (default fallback)      → ICE      (arctic)
   Hover: scaleY/X aumenta, opacita' a 1.0, glow del tool si espande.
   Click: seek diretto al timestamp della nota.
   ──────────────────────────────────────────────────────────────────────── */
.t1-shard {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 14px;
  border-radius: 1.5px;
  pointer-events: auto;
  z-index: 2;
  cursor: pointer;
  opacity: 0.62;
  /* Base neutral fallback — Gancio A: usa alias semantico --shard-neutral */
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-neutral, #e0f7ff) 75%, transparent) 22%,
    color-mix(in srgb, var(--shard-neutral, #e0f7ff) 100%, transparent) 50%,
    color-mix(in srgb, var(--shard-neutral, #e0f7ff) 75%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-neutral, #e0f7ff) 75%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-neutral, #e0f7ff) 35%, transparent);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 200ms ease,
    filter 200ms ease;
}

/* ── Gancio A/B: token tecnici → alias semantici granulari (Opzione B).
   In Santuario: point/line/freehand → cyan, ghost → arctic, arrow → rosa,
   rect → amber, circle → ametista. In Casting: i blocchi body[data-cockpit-mode]
   remappano gli alias senza toccare il CSS seguente. ──────────────────── */

/* ── ICE: point (cyan) ─────────────────────────────────────────────────── */
.t1-shard[data-tool='point'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-point) 70%, transparent) 22%,
    var(--shard-point) 50%,
    color-mix(in srgb, var(--shard-point) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-point) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-point) 40%, transparent);
}

/* ── ICE: line (cyan) ──────────────────────────────────────────────────── */
.t1-shard[data-tool='line'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-line) 70%, transparent) 22%,
    var(--shard-line) 50%,
    color-mix(in srgb, var(--shard-line) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-line) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-line) 40%, transparent);
}

/* ── ICE: freehand (cyan) ──────────────────────────────────────────────── */
.t1-shard[data-tool='freehand'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-freehand) 70%, transparent) 22%,
    var(--shard-freehand) 50%,
    color-mix(in srgb, var(--shard-freehand) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-freehand) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-freehand) 40%, transparent);
}

/* ── ICE: ghost-pen (arctic) ───────────────────────────────────────────── */
.t1-shard[data-tool='ghost'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-ghost) 70%, transparent) 22%,
    var(--shard-ghost) 50%,
    color-mix(in srgb, var(--shard-ghost) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-ghost) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-ghost) 40%, transparent);
}

/* ── WARM: arrow (rosa crimson — indicazione direzionale) ──────────────── */
.t1-shard[data-tool='arrow'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-arrow) 70%, transparent) 22%,
    var(--shard-arrow) 50%,
    color-mix(in srgb, var(--shard-arrow) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-arrow) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-arrow) 35%, transparent);
}

/* ── WARM: rect (amber — area di interesse) ────────────────────────────── */
.t1-shard[data-tool='rect'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-rect) 70%, transparent) 22%,
    var(--shard-rect) 50%,
    color-mix(in srgb, var(--shard-rect) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-rect) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-rect) 35%, transparent);
}

/* ── AMETISTA: circle ──────────────────────────────────────────────────── */
.t1-shard[data-tool='circle'] {
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--shard-circle) 70%, transparent) 22%,
    var(--shard-circle) 50%,
    color-mix(in srgb, var(--shard-circle) 70%, transparent) 78%,
    transparent 100%);
  box-shadow:
    0 0 calc(5px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-circle) 80%, transparent),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--shard-circle) 40%, transparent);
}

/* Hover/focus: si gonfia e si accende. Largo abbastanza da essere afferrabile.
   Glow Sync (Fase 2.7-polish): `.is-linked-hover` riusa esattamente lo stesso
   stato visivo del :hover diretto. La classe e' applicata da JS quando l'utente
   passa sopra la forma corrispondente nel player (ponte di luce reciproco
   shard ↔ forma). Stesso vocabolario `is-linked-hover` di feed/marker → no
   nuova retorica visiva. */
.t1-shard:hover,
.t1-shard:focus-visible,
.t1-shard.is-linked-hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.65, 1.5);
  filter: brightness(1.12);
  outline: none;
}
.t1-shard:hover,
.t1-shard.is-linked-hover { z-index: 4; }

/* La lama Ametista DEVE poter passare sopra i shard: la lama ha z-index 3,
   shard 2 di base e 4 in hover. Quando NON in hover, la lama li attraversa. */

/* BUG FIX: durante lo scrub gli shard catturavano i pointer events rompendo
   la continuità del drag sul range input (cursore "bloccato" tra shard).
   Durante is-scrubbing disabilitiamo pointer-events su tutti gli shard:
   il drag del range torna fluido, lo shard click è comunque disponibile
   al rilascio (pointerup) tramite il seek che già avviene nel normale click.
   P2-C3: pointerdown su shard resta escluso in timeline.js (seek nota). */
.cockpit-transport.is-scrubbing .t1-shard {
  pointer-events: none;
}

.cockpit-progress-highlight {
  pointer-events: none;
}

/* In dual-reference mode gli shard della sessione attiva non devono
   comparire: il confronto e' tra video diversi, non tra annotazioni. */
.player-wrapper.has-reference .t1-shard {
  display: none;
}

/* ════════════════════════════════════════════════════════════════════════
   THUMBNAIL PREVIEW (Fase 2.5.3) · card vetro che galleggia sopra la
   lama ametista durante hover/scrub. Locale = canvas frame catturato
   via <video> nascosto. YouTube = placeholder con logo + label.
   ──────────────────────────────────────────────────────────────────────
   Posizionamento: absolute dentro .cockpit-progress-wrap (position:relative).
   X → --thumb-x (px dall'origine sinistra del wrap), centrata via translateX.
   Il wrap ha overflow:visible per permettere l'uscita verso l'alto.
   ════════════════════════════════════════════════════════════════════════ */

/* Overflow visible: la card preview deve uscire verso l'alto dal wrap */
.cockpit-progress-wrap {
  overflow: visible;
}

.t1-thumb-preview {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  transform: translateX(calc(var(--thumb-x, 80px) - 50%));
  width: 160px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(6, 8, 14, 0.76);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 18%, transparent);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  scale: 0.93;
  transition: opacity 130ms ease, scale 130ms ease;
}

.t1-thumb-preview.is-visible {
  opacity: 1;
  scale: 1;
}

/* Canvas frame locale */
.t1-thumb-canvas {
  display: block;
  width: 160px;
  height: 90px;
  background: rgba(0, 0, 0, 0.5);
}

/* Placeholder YouTube */
.t1-thumb-yt {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 160px;
  height: 90px;
  background: rgba(0, 0, 0, 0.35);
}

.t1-thumb-yt-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--t1-pearl) 55%, transparent);
}

/* Switcher locale ↔ YouTube */
.t1-thumb-preview.is-yt .t1-thumb-canvas { display: none; }
.t1-thumb-preview.is-yt .t1-thumb-yt     { display: flex; }

/* Label tempo in fondo alla card */
.t1-thumb-time {
  display: block;
  text-align: center;
  font-size: 0.67rem;
  letter-spacing: 0.07em;
  color: var(--t1-pearl);
  padding: 4px 0 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

/* Nascosta in dual-reference: stesso pattern degli shards */
.player-wrapper.has-reference .t1-thumb-preview {
  display: none;
}

/* ════════════════════════════════════════════════════════════════════════
   DUAL LAB CHIPS · rettangoli glass che mostrano i nomi file caricati
   nel pannello Dual Analysis (Master + Reference).
   ════════════════════════════════════════════════════════════════════════ */
.dual-lab-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.dual-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 12%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 0;
}

.dual-chip[hidden] { display: none; }

.dual-chip__slot {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 5px 2px;
  border-radius: 4px;
  line-height: 1.4;
}

.dual-chip--master .dual-chip__slot {
  background: color-mix(in srgb, var(--t1-pearl) 18%, transparent);
  color: var(--t1-pearl);
}

.dual-chip--reference .dual-chip__slot {
  background: color-mix(in srgb, var(--t1-cyan-soft) 22%, transparent);
  color: var(--t1-cyan-soft);
}

.dual-chip__name {
  flex: 1 1 0;
  font-size: 0.69rem;
  color: color-mix(in srgb, var(--t1-pearl) 72%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.dual-chip__clear {
  flex-shrink: 0;
  background: none;
  border: none;
  color: color-mix(in srgb, var(--t1-pearl) 40%, transparent);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 160ms ease;
}

.dual-chip__clear:hover {
  color: var(--t1-pearl);
}

/* ════════════════════════════════════════════════════════════════════════
   GANCIO D · Cockpit Zone Layout (Sez.7 — Footer slot-based)
   ────────────────────────────────────────────────────────────────────────
   Il footer e' ora partizionato in 3 zone semantiche. In Santuario il
   layout e' identico al pre-partizionamento (stesso gap, stessa direzione).
   In Casting, --mode-tools sara' popolato da mountCockpitToolsForMode().
   ──────────────────────────────────────────────────────────────────────── */
.cockpit-zone {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cockpit-zone--core {
  flex: 1 1 auto;
  min-width: 0;
}
.cockpit-zone--mode-tools {
  flex: 0 0 auto;
}
/* Nasconde lo slot mode-tools quando e' vuoto (Santuario default) */
.cockpit-zone--mode-tools:empty {
  display: none;
}
.cockpit-zone--system {
  flex: 0 0 auto;
  /* flex-wrap: il cockpit-mixer (dual reference) e' flex:1 1 100% — va a capo
     dentro questa zona quando e' visibile, come faceva prima nel footer flat. */
  flex-wrap: wrap;
  justify-content: center;
}

.cockpit-volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 130px;
  min-width: 72px;
  max-width: 160px;
  /* Range nativo: in contesti RTL il pollice può apparire invertito rispetto al valore. */
  direction: ltr;
  unicode-bidi: isolate;
}

.cockpit-volume-label {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(0, 229, 255, 0.55);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.cockpit-volume {
  flex: 1;
  min-width: 0;
  height: 8px;
  accent-color: #00e5ff;
  cursor: pointer;
}

/* ────────────────────────────────────────────────────────────────────────
   COCKPIT TIME · timestamp pearl (Fase 2.5.0) + Lens Magnifier "scansione
   laser" (Fase 2.5.1, raffinamento Gemini)
     • Base: pearl invece di cyan piatto. Letterspacing leggero per look
       cinematografico (font tech sempre).
     • is-laser-scan: quando la lama Ametista passa sopra il testo, una
       "finestra" di ~22px attorno alla X della lama (--time-laser-x) cambia
       il colore in cyan/ametista via background-clip:text. Le cifre restanti
       restano pearl. Effetto: scansione laser che illumina solo il numero
       sotto la lama.
   ──────────────────────────────────────────────────────────────────────── */
.cockpit-time {
  font-family: var(--font-tech);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--t1-pearl);
  white-space: nowrap;
  position: relative;
  transition: color 180ms ease;
}

.cockpit-time.is-laser-scan {
  /* Sostituisce il color pearl con un gradient che ha una "finestra"
     ametista→cyan→ametista nel punto di intersezione con la lama (-22 → +22 px).
     Le cifre fuori dalla finestra restano pearl. Background-clip:text
     "scolpisce" il gradient sulle sole glyph (testo trasparente, sfondo
     visibile solo dentro le forme delle cifre). */
  /* Gancio A: --accent-solid → --needle-color. In Santuario = ametista,
     in Casting = colore needle del mode attivo. */
  background: linear-gradient(90deg,
    var(--t1-pearl) 0,
    var(--t1-pearl) calc(var(--time-laser-x, -99px) - 22px),
    color-mix(in srgb, var(--needle-color) 85%, white) calc(var(--time-laser-x) - 6px),
    rgba(0, 229, 255, 1) var(--time-laser-x),
    color-mix(in srgb, var(--needle-color) 85%, white) calc(var(--time-laser-x) + 6px),
    var(--t1-pearl) calc(var(--time-laser-x) + 22px),
    var(--t1-pearl) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--needle-color) 32%, transparent));
}

/* ── Playback Rate (Fase 3.0.x — Supervisione video) ──────────────────
   Micro-controllo velocità + abilitazione frame-step. Stile coerente
   con .cockpit-volume-wrap e .enhancer-chip di timeline. */
.cockpit-playback-rate-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: opacity 160ms ease;
  cursor: default;
}
.cockpit-playback-rate-wrap.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.cockpit-playback-rate-label {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(0, 229, 255, 0.55);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.cockpit-playback-rate {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--t1-pearl);
  background: color-mix(in srgb, var(--t1-pearl) 6%, rgba(8, 12, 20, 0.72));
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 18%, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  padding: 3px 6px 3px 5px;
  cursor: pointer;
  min-width: 3.6em;
  accent-color: var(--cyan-accent);
  transition: border-color 160ms ease, color 160ms ease;
}
.cockpit-playback-rate:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--cyan-accent) 38%, rgba(255, 255, 255, 0.08));
  color: var(--t1-pearl);
}
.cockpit-playback-rate:disabled {
  cursor: not-allowed;
}
.cockpit-playback-rate:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cyan-accent) 55%, transparent);
  outline-offset: 2px;
}
/* Zen: Vel resta sul transport (supervisione); solo select compatto */
body.is-zen .cockpit-playback-rate-label { display: none; }
body.is-zen .cockpit-playback-rate-wrap { gap: 0; }

.player-wrapper:not(.video-ready) #cockpit-transport {
  opacity: 0.52;
}

.player-wrapper:not(.video-ready) #cockpit-transport #fullscreenBtn {
  opacity: 1;
}

.cockpit-mixer {
  display: none;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: center;
  direction: ltr;
  unicode-bidi: isolate;
}

.player-wrapper.has-reference .cockpit-mixer {
  display: flex;
}

.cockpit-mixer-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.cockpit-mixer-row input[type='number'] {
  width: 4rem;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.cockpit-mixer-fade {
  display: grid;
  grid-template-columns: minmax(1.25rem, auto) 1fr minmax(1.25rem, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: min(360px, 92vw);
  margin-inline: auto;
  min-width: 0;
}

.cockpit-mixer-fade input[type='range'] {
  width: 100%;
  min-width: 0;
  flex: unset;
  accent-color: #00e5ff;
}

.cockpit-mixer-fade span {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cockpit-mixer-label {
  font-family: var(--font-tech);
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  color: rgba(0, 229, 255, 0.7);
}

.cockpit-clear-ref {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: transparent;
  color: #fca5a5;
  cursor: pointer;
  font-size: 1rem;
}

.panel-dual-lab .dual-lab-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════
   VIDEO ENHANCER · Fase 3.0.1
   Pannello Luce: slider brightness/contrast/saturate + preset chips.
   ─────────────────────────────────────────────────────────────────────
   Token semantici in styles/tokens.css: --video-brightness / -contrast / -saturate.
   Il filtro viene applicato inline su el.localPlayer/localPlayerRef da JS;
   .video-enhancer-filter è la classe applicata agli <video> quando il modulo e' attivo.
   ═══════════════════════════════════════════════════════════════════════ */

.video-enhancer-filter {
  transition: filter 0.25s ease;
}

/* Guardia YouTube */
.enhancer-yt-guard {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 191, 0, 0.06);
  border: 1px solid rgba(255, 191, 0, 0.18);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.enhancer-yt-guard__icon {
  flex-shrink: 0;
  color: var(--t1-amber-ghost);
  opacity: 0.82;
  margin-top: 1px;
}

.enhancer-yt-guard__msg {
  font-family: var(--font-main);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* Preset chips */
.enhancer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.enhancer-chip {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--btn-border);
  background: var(--panel-bg);
  color: var(--text-dim);
  font-family: var(--font-tech);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.enhancer-chip:hover {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  background: rgba(0, 229, 255, 0.06);
}

.enhancer-chip.is-active {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  background: rgba(0, 229, 255, 0.10);
}

/* Slider rows */
.enhancer-slider-row {
  display: grid;
  grid-template-columns: 72px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.enhancer-label {
  font-family: var(--font-main);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.enhancer-value {
  font-family: var(--font-tech);
  font-size: 0.6rem;
  color: var(--text-dim);
  text-align: right;
  letter-spacing: 0.04em;
}

.enhancer-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.10);
  outline: none;
  cursor: pointer;
  margin: 0;
  border: none;
  transition: background var(--t-fast);
}

.enhancer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan-accent);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
  cursor: pointer;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.enhancer-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  background: var(--cyan-accent);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
  cursor: pointer;
}

.enhancer-slider:hover::-webkit-slider-thumb,
.enhancer-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.65);
  transform: scale(1.2);
}

.enhancer-slider:focus {
  outline: none;
}

.player-wrapper iframe,
.dual-slot iframe,
.dual-slot video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  border: none;
  object-fit: contain;
  background: #000;
}

/* Montaggio YT.Player Master: il div riempie lo slot; l’iframe creato dall’API è figlio */
.dual-slot .yt-api-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: hidden;
  background: #000;
  pointer-events: auto;
}
.dual-slot .yt-api-mount iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border: none !important;
  background: #000;
}

#player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;          /* resetPlayer() usa display:flex per riaprire questo */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  user-select: none;
  pointer-events: none;
}

/* Welcome — monogramma T1 centrato nel player */
.welcome-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  max-width: 94%;
}

.welcome-brand-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(32rem, 92%);
  gap: 0;
}

.t1-centre-mark {
  height: 120px;
  width: auto;
  max-width: 100%;
  display: block;
  overflow: visible;
  flex-shrink: 0;
}

.welcome-hint {
  margin-top: 1.5rem;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0.55;
  max-width: 22rem;
  line-height: 1.45;
}

/* Profilo senza URL (modalità Analysis): niente watermark, solo testo neutro */
.analysis-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  max-width: 90%;
  gap: 0.5rem;
}
.analysis-empty-msg {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.75;
}
.analysis-empty-hint {
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-muted);
  opacity: 0.9;
  max-width: 18rem;
  line-height: 1.4;
}

.player-wrapper:hover {
  border-top-color: color-mix(in srgb, var(--geo-ice-cyan) 62%, transparent);
  border-left-color: color-mix(in srgb, var(--geo-ice-cyan) 52%, transparent);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.82),
    var(--geo-plate-inset-cyan),
    var(--geo-plate-well),
    0 0 52px color-mix(in srgb, var(--geo-ice-cyan) 16%, transparent);
}

/* ═══════════════════════════════════════════
   T0.16 — cluster alto dx P4 (pill vetro · wrapper fixed)
   Zen mode + guida cockpit sotto
   ═══════════════════════════════════════════ */
.cockpit-cluster-hint-host {
  position: fixed;
  top: 18px;
  z-index: 20120;
  display: inline-flex;
  overflow: visible;
}

.cockpit-cluster-hint-host--guide {
  right: 132px;
}

.cockpit-cluster-hint-host--zen {
  right: 60px;
}

.cockpit-cluster-hint-host--fs {
  right: 18px;
}

/* TABLET-S2 — Studio P0 layout sotto 900px (allineato share @899): note più strette;
   rail/LUCE/STAMP invariati (fase_3.0.x). Toolbox touch → S2b sotto. */
@media (max-width: 899px) {
  body.app-shell {
    overflow: hidden;
    max-width: 100vw;
    --t1-sidebar-width: 264px; /* .notes-panel → 260px (calc −4) */
  }
}

/* TABLET-S2b: portrait gestito dall'overlay "ruota dispositivo" (t1_coach_mobile_disclaimer).
   Nessun layout portrait in style_4.css — desktop invariato. */

/* TABLET-S3b/S3c — Studio landscape tablet (900–1280): toolbox orizzontale sotto player;
   cluster ?/Zen compatto (FS assente). Desktop ≥1281 invariato.
   COACH-LAPTOP-S1: mouse ≤1500 → stesso in-flow (sotto). Tier C ≤1100: t1_share_cockpit.css. */
@media (min-width: 900px) and (max-width: 1280px) and (orientation: landscape) {
  /* TABLET-S3d — note ~25% viewport @1180 (allineato desktop); player guadagna ~56px */
  body.app-shell {
    --t1-sidebar-width: 300px;
  }

  .workspace {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    padding: 20px 16px;
    min-width: 0;
  }

  .cockpit-player-chrome {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
  }

  .player-wrapper {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .drawing-toolbox {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    flex-direction: row !important;
    flex: 0 0 auto;
    align-self: center;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 4px;
    max-width: 100%;
    padding: 6px 8px;
    margin-top: 2px;
    z-index: 10001;
  }

  .drawing-toolbox .toolbox-drag-handle,
  .drawing-toolbox .toolbox-group-label {
    display: none;
  }

  .drawing-toolbox .tool-sep {
    width: 6px;
    height: 22px;
    margin: 0 2px;
  }

  .drawing-toolbox > .tool-btn.t1-btn-3d,
  .drawing-toolbox > .tool-annotate-mode-toggle,
  .drawing-toolbox > .tool-ghost-toggle,
  .drawing-toolbox > .tool-show-all-toggle,
  .drawing-toolbox > .tool-ephemeral-toggle {
    width: 44px;
    height: 44px;
  }

  /* S3c — FS nascosto (S1c): accoppia Guida + Zen a destra */
  .cockpit-cluster-hint-host--guide {
    right: 72px;
  }

  .cockpit-cluster-hint-host--zen {
    right: 18px;
  }
}

/* COACH-LAPTOP-S1 — Studio mouse ≤1500: toolbox in-flow sotto player (≥1501 overlay desktop invariato).
   iPad touch resta su TABLET-S3b sopra (pointer: coarse · 900–1280). */
@media (hover: hover) and (pointer: fine) and (min-width: 901px) and (max-width: 1500px) {
  body.app-shell {
    --t1-sidebar-width: 300px;
  }

  .workspace {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    padding: 20px 16px;
    min-width: 0;
  }

  .cockpit-player-chrome {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
  }

  .player-wrapper {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .drawing-toolbox {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    flex-direction: row !important;
    flex: 0 0 auto;
    align-self: center;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 4px;
    max-width: 100%;
    padding: 6px 8px;
    margin-top: 2px;
    z-index: 10001;
  }

  .drawing-toolbox .toolbox-drag-handle,
  .drawing-toolbox .toolbox-group-label {
    display: none;
  }

  .drawing-toolbox .tool-sep {
    width: 6px;
    height: 22px;
    margin: 0 2px;
  }

  .drawing-toolbox > .tool-btn.t1-btn-3d,
  .drawing-toolbox > .tool-annotate-mode-toggle,
  .drawing-toolbox > .tool-ghost-toggle,
  .drawing-toolbox > .tool-show-all-toggle,
  .drawing-toolbox > .tool-ephemeral-toggle {
    width: 44px;
    height: 44px;
  }

  .cockpit-cluster-hint-host--guide {
    right: 72px;
  }

  .cockpit-cluster-hint-host--zen {
    right: 18px;
  }
}

/* TABLET-S1c — fullscreen browser solo desktop; Zen (#cockpit-hint-host-zen) resta su tablet */
@media not ((min-width: 1280px) and (hover: hover) and (pointer: fine)) {
  #cockpit-hint-host-fs {
    display: none !important;
  }
}

.cockpit-guide-toggle,
.fullscreen-browser-toggle,
.zen-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-sizing: border-box;
  opacity: 0.42;
  color: rgba(255, 255, 255, 0.65);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.07) 0%, rgba(10, 12, 18, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-color: rgba(0, 0, 0, 0.5);
  box-shadow: var(--geo-gem-inset), 0 6px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    opacity var(--t-fast),
    color var(--t-fast),
    background var(--t-fast),
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}

.cockpit-guide-toggle {
  font-family: var(--font-ui, Inter, system-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
}

.cockpit-guide-toggle:hover,
.cockpit-guide-toggle:focus-visible,
.fullscreen-browser-toggle:hover,
.fullscreen-browser-toggle:focus-visible,
.zen-toggle:hover,
.zen-toggle:focus-visible {
  opacity: 0.9;
  color: var(--cyan-accent);
  border-color: rgba(0, 229, 255, 0.38);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.1) 0%, rgba(10, 12, 20, 0.9) 55%, rgba(6, 8, 14, 0.92) 100%);
  box-shadow:
    var(--geo-gem-inset),
    0 0 16px color-mix(in srgb, var(--t1-cyan) 22%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.48);
  outline: none;
}

.cockpit-guide-toggle:focus-visible,
.fullscreen-browser-toggle:focus-visible,
.zen-toggle:focus-visible {
  outline: 2px solid var(--cyan-accent);
  outline-offset: 2px;
}

.cockpit-guide-toggle[aria-expanded="true"],
.fullscreen-browser-toggle.is-active {
  opacity: 0.92;
  color: var(--cyan-accent);
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow:
    var(--geo-gem-inset),
    0 0 16px color-mix(in srgb, var(--t1-cyan) 22%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.48);
}

.fullscreen-browser-toggle svg {
  display: block;
  flex-shrink: 0;
}

.cockpit-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 20125;
  pointer-events: none;
}
.cockpit-guide-overlay[hidden] {
  display: none !important;
}
body.cockpit-guide-active {
  overflow: hidden;
}
.cockpit-guide-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
  cursor: pointer;
}
.cockpit-guide-panel {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 20126;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: min(92vw, 340px);
  max-height: min(72vh, 420px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-color: rgba(0, 0, 0, 0.48);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.08) 0%, rgba(10, 12, 18, 0.94) 100%);
  box-shadow: var(--geo-gem-inset), 0 12px 28px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}
.cockpit-guide-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.cockpit-guide-panel__titles {
  min-width: 0;
}
.cockpit-guide-panel__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(220, 235, 252, 0.95);
}
.cockpit-guide-panel__sub {
  margin: 6px 0 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: rgba(188, 208, 232, 0.72);
}
.cockpit-guide-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(200, 215, 230, 0.7);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.cockpit-guide-panel__close:hover,
.cockpit-guide-panel__close:focus-visible {
  color: rgba(220, 235, 252, 0.95);
  border-color: var(--cyan-accent);
  outline: none;
}
.cockpit-guide-panel__list {
  margin: 0;
  padding: 14px 18px 8px 2.1rem;
  list-style: disc;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(210, 224, 242, 0.88);
}
.cockpit-guide-panel__list li + li {
  margin-top: 0.55rem;
}
.cockpit-guide-panel__more {
  margin: 0;
  padding: 10px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.cockpit-guide-panel__full-link {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(0, 229, 255, 0.82);
  text-decoration: none;
  transition: color var(--t-fast);
}
.cockpit-guide-panel__full-link:hover,
.cockpit-guide-panel__full-link:focus-visible {
  color: var(--cyan-accent);
  outline: none;
  text-decoration: underline;
}

/* Zen attivo — gemma cluster resta visibile (FS browser nascosto sotto) */
body.is-zen .zen-toggle {
  opacity: 0.92;
  color: var(--cyan-accent);
  border-color: rgba(0, 229, 255, 0.45);
}

/* STAMP · genera PDF — header note operative (t1_action_icons.css) */

body.is-zen #sidebar-rail,
body.is-zen #sidebar,
body.is-zen #notes-panel,
body.is-zen .cockpit-back-gateway,
body.is-zen .coach-label,
body.is-zen #fullscreen-browser-btn,
body.is-zen #cockpit-hint-host-fs {
  display: none !important;
}

/* Zen mode: la toolbox di disegno resta visibile per permettere annotazioni a
   tutto schermo senza dover uscire dalla modalità immersiva. Il drag usa
   offsetParent (player-wrapper in Santuario; workspace in edge case). */
body.is-zen #drawing-toolbox {
  z-index: 10002; /* leggermente sopra il default per galleggiare sul player ingrandito */
}

body.is-zen .workspace {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  justify-content: center;
  align-items: center;
}

body.is-zen .player-wrapper {
  width: 100%;
  max-width: none;
  max-height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

body.is-zen .player-media-stage {
  /* Mantiene 16:9 single o 32:9 dual come da .has-reference */
  max-height: calc(100vh - 54px); /* fascia trasporto cockpit */
}

/* Annotazioni gestite solo sul Master: interfaccia Drawing nascosta sul reference */
.dual-slot--reference .annotation-overlay,
.dual-slot--reference .drawing-overlay,
.dual-slot--reference .drawing-shapes-layer,
.dual-slot--reference .pending-preview-layer {
  display: none !important;
}

/* FULLSCREEN — icona in barra trasporto (basso-destra); sopra layer invisibili sul video */
#fullscreenBtn.fullscreen-button,
.fullscreen-button.cockpit-fullscreen {
  position: relative;
  top: auto;
  left: auto;
  bottom: auto;
  right: auto;
  flex-shrink: 0;
  margin-left: auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  color: rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.1) 0%, rgba(10, 12, 18, 0.88) 55%, rgba(6, 8, 14, 0.9) 100%);
  border: 1px solid rgba(0, 229, 255, 0.38);
  border-bottom-color: rgba(0, 0, 0, 0.52);
  box-shadow: var(--geo-gem-inset), 0 4px 12px rgba(0, 0, 0, 0.48);
  transition:
    opacity var(--t-fast),
    color var(--t-fast),
    background var(--t-fast),
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}
.fullscreen-button:hover {
  opacity: 1;
  color: var(--cyan-accent);
  border-color: rgba(0, 229, 255, 0.45);
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.16) 0%, rgba(10, 14, 22, 0.82) 100%);
  box-shadow:
    var(--geo-gem-inset),
    0 0 18px color-mix(in srgb, var(--t1-cyan) 30%, transparent),
    0 6px 14px rgba(0, 0, 0, 0.52);
}
.fullscreen-button.is-active {
  opacity: 1;
  color: var(--cyan-accent);
  border-color: var(--cyan-accent);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    inset 0 0 14px rgba(0, 229, 255, 0.14),
    0 0 16px color-mix(in srgb, var(--t1-cyan) 22%, transparent);
}
.fullscreen-button.is-active:hover {
  opacity: 1;
  color: var(--cyan-accent);
  border-color: var(--cyan-accent);
}

/* ═══════════════════════════════════════════
   LAYER 1: SANTUARIO — Sistema Annotazioni
   ═══════════════════════════════════════════ */

/* Coach label */
.coach-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e0e0e0;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* Timeline bar — filo orizzontale con dots dei secondi annotati.
   Height 10px: i dot da 8px stanno interamente dentro senza uscire
   dal player-wrapper (overflow: hidden). pointer-events: none sul
   contenitore, all sui singoli dot figli. */
.annotation-timeline-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: rgba(255, 255, 255, 0.03);
  z-index: 12;
  pointer-events: none;
  overflow: visible; /* i dot non vengono clippati dal contenitore */
}

/* Risveglio tab: evita transition background su overlay (meno flash repaint) */
.tab-wake-no-overlay-transition .annotation-overlay {
  transition: none;
}

/* Overlay cockpit: niente chrome nativo video — fascia piena sopra trasport footer */
.annotation-overlay {
  position: absolute;
  top: 10px;      /* sotto la timeline bar (height: 10px) */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  cursor: default;
  pointer-events: none;
  transition: background 0.3s ease;
}
.annotation-overlay.is-active {
  pointer-events: all;
  /* cursor: impostato da Drawing.applyAnnotationCursors (point → pointer) */
  cursor: default;
  background: rgba(109, 40, 168, 0.04);
}

/* Badge modalità annotazione — appare in alto a destra solo quando in pausa */
.annotation-mode-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 16;
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0;                            /* opacity gestita dal toggle .is-visible */
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 3px 10px;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(6px);
}
.annotation-mode-badge.is-visible { opacity: 0.8; }
.annotation-mode-badge.is-solo-visione {
  opacity: 0.92;
  color: #ffe8dc;
  border-color: color-mix(in srgb, #f59e0b 55%, rgba(255, 255, 255, 0.22));
  background: color-mix(in srgb, #7c2d12 42%, rgba(0, 0, 0, 0.62));
  box-shadow:
    0 0 14px color-mix(in srgb, #f59e0b 28%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #fbbf24 18%, transparent);
}

body[data-annotate-intent='off'] .drawing-toolbox > .tool-btn,
body[data-annotate-intent='off'] .drawing-toolbox > .tool-ghost-toggle,
body[data-annotate-intent='off'] .drawing-toolbox > .tool-show-all-toggle,
body[data-annotate-intent='off'] .drawing-toolbox > .tool-ephemeral-toggle {
  opacity: 0.42;
}

/* Quando il video è in play e uno strumento di disegno è selezionato,
   l’overlay non riceve pointer → banner chiaro sul solo Master. */
.annotation-draw-blocked-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 35;
  max-width: min(94%, 22rem);
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-tech);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(8, 8, 12, 0.82);
  border: 1px solid rgba(251, 146, 60, 0.45);
  border-radius: 6px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(251, 146, 60, 0.12);
  pointer-events: none;
  user-select: none;
}

/* Glow sul player quando modalità annotazione attiva */
.player-wrapper.annotation-active {
  box-shadow:
    0 20px 60px var(--shadow-deep),
    0 0 0 2px rgba(109, 40, 168, 0.5),
    0 0 30px rgba(109, 40, 168, 0.2);
}

/* LAYER C: marker circolari sul frame video.
   Copre l'intero player-wrapper (inset:0).
   z-index sopra drawing-overlay: le forme intercettano hover/tooltip; le aree vuote
   (pointer-events:none sul layer) lasciano passare i eventi verso il sottostante overlay. */
.video-markers-layer {
  position: absolute;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  overflow: visible;
}

/* Ordine dipinto: geometrie sotto; tratto freehand sopra rect/frecce; punto X e note testo sopra. */
#video-markers-layer-master > .shape-rect.shape-note,
#video-markers-layer-reference > .shape-rect.shape-note,
#video-markers-layer-master > .shape-circle.shape-note,
#video-markers-layer-reference > .shape-circle.shape-note {
  z-index: 2;
}
#video-markers-layer-master > .shape-freehand-wrap.shape-note,
#video-markers-layer-reference > .shape-freehand-wrap.shape-note {
  z-index: 8;
}
#video-markers-layer-master > .annotation-marker,
#video-markers-layer-reference > .annotation-marker,
#video-markers-layer-master > .shape-text-label.shape-note,
#video-markers-layer-reference > .shape-text-label.shape-note {
  z-index: 14;
}

/* Con stesso z-index le note successive coprono interamente le precedenti (tooltip incluso).
   Alza l’intera radice mentre è hover / focus / link feed / pulse → etichetta sempre leggibile. */
#video-markers-layer-master > .annotation-marker:hover,
#video-markers-layer-reference > .annotation-marker:hover,
#video-markers-layer-master > .annotation-marker:focus-within,
#video-markers-layer-reference > .annotation-marker:focus-within,
#video-markers-layer-master > .annotation-marker.is-linked-hover,
#video-markers-layer-reference > .annotation-marker.is-linked-hover,
#video-markers-layer-master > .annotation-marker.is-linked-pulse,
#video-markers-layer-reference > .annotation-marker.is-linked-pulse,
#video-markers-layer-master > .shape-note:hover,
#video-markers-layer-reference > .shape-note:hover,
#video-markers-layer-master > .shape-note:focus-within,
#video-markers-layer-reference > .shape-note:focus-within,
#video-markers-layer-master > .shape-note.is-linked-hover,
#video-markers-layer-reference > .shape-note.is-linked-hover,
#video-markers-layer-master > .shape-note.is-linked-pulse,
#video-markers-layer-reference > .shape-note.is-linked-pulse {
  z-index: 80;
}

/* Linee note: clip solo in pausa Santuario (stessa fascia degli overlay). Fuori modalità annotate
   le forme restano sopra il video durante la riproduzione (.shape-note usa pointer-events: none in play).
   Clip applicato solo quando serve a non bloccare i controlli nativi mentre il layer marker è sopra il video. */
.player-wrapper.annotation-active .dual-slot .video-markers-layer {
  clip-path: inset(10px 0 0 0);
  -webkit-clip-path: inset(10px 0 0 0);
}

/* LAYER B: dot sulla timeline — DISABILITATO (paradigma Frame.io).
   La navigazione avviene dal #notes-feed a sinistra, non dai dot sulla barra.
   Il layer esiste nel DOM ma è nascosto via CSS; renderTimeline() è una no-op. */
.timeline-dots-layer {
  display: none;
}

/* Marker — Hybrid Precision: X luminosa + nucleo centrale (stroke nero sottile per contrasto) */
.annotation-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: all;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.18s ease;
}
.annotation-marker:hover,
.annotation-marker.is-linked-hover {
  transform: translate(-50%, -50%) scale(1.08);
}
.annotation-marker-reticle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.annotation-marker-reticle .ret-x1,
.annotation-marker-reticle .ret-x2 {
  stroke: #00f2ff;
  stroke-width: 2.8;
  stroke-linecap: butt;
  paint-order: stroke fill;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 0 0.5px #000)
    drop-shadow(0 0 0.5px #000)
    drop-shadow(0 0 4px rgba(0, 242, 255, 0.65));
}
.annotation-marker-reticle .ret-core {
  fill: transparent;
  stroke: rgba(0, 242, 255, 0.95);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(0, 242, 255, 0.85));
}

/* Coach pref: nasconde fumetti testo+tempo sul player (forme + link feed/timeline).
   Include .is-visible: la freccia attiva il tooltip via JS, regola #video-markers-layer-* più specifica. */
body.t1-shape-hover-labels-off .player-wrapper .annotation-marker-tooltip,
body.t1-shape-hover-labels-off #video-markers-layer-master .annotation-marker-tooltip.is-visible,
body.t1-shape-hover-labels-off #video-markers-layer-reference .annotation-marker-tooltip.is-visible {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Tooltip — timestamp + testo nota, visibile SOLO su hover.
   Posizionato a sinistra del marker (offset negativo) così non copre
   il dettaglio del video che si sta analizzando nel punto X,Y.
   Se il marker è troppo a sinistra, il tooltip scivola verso destra
   tramite la classe .tip-right aggiunta da JS. */
.annotation-marker-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  min-width: 160px;
  max-width: 240px;
  background: rgba(2, 3, 8, 0.93);
  border: 1px solid rgba(8, 12, 20, 0.86);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-tech);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms cubic-bezier(0.22, 0.8, 0.3, 1), transform 150ms cubic-bezier(0.22, 0.8, 0.3, 1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(109, 40, 168, 0.32);
  backdrop-filter: blur(6px);
  white-space: normal;
  word-break: break-word;
  z-index: 50;
}

/* Timestamp dentro il tooltip */
.annotation-marker-tooltip .tip-ts {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: #7cf6ff;
  text-shadow: 0 0 6px rgba(0, 242, 255, 0.28);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

/* Testo nota dentro il tooltip */
.annotation-marker-tooltip .tip-text {
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 400;
  color: #f5f7ff;
  line-height: 1.5;
  display: block;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(0, 0, 0, 0.2);
}

.annotation-marker:hover .annotation-marker-tooltip,
.annotation-marker.is-linked-hover .annotation-marker-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modalità annotazione operativa:
   il fumetto nota deve essere sempre leggibile in modo uniforme su tutti i marker
   (point/rect/circle/line/freehand/text), indipendentemente dal tool attivo. */
/* Tooltip: chiusi quando non in modalità annotazione (evita rumore sul layout player) */
.player-wrapper:not(.annotation-active) .annotation-marker-tooltip {
  opacity: 0 !important;
  visibility: hidden;
}

/*
 * Solo sul layer marker del video (non nella sidebar notes-feed): hover sulla forma
 * mostra etichetta anche durante play / senza modalità annotazione.
 */
.player-wrapper:not(.annotation-active) #video-markers-layer-master .annotation-marker:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .annotation-marker:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .annotation-marker.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .annotation-marker.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-rect.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-circle.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-rect.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-circle.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-rect.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-circle.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-rect.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-circle.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-freehand-hotspot:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-freehand-hotspot:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-freehand-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-freehand-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-text-label.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-text-label.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-text-label.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-text-label.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-arrow-wrap.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-arrow-wrap.shape-note:hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-arrow-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-arrow-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-arrow-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-arrow-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .annotation-marker.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .annotation-marker.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-rect.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-rect.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-circle.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-circle.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-text-label.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-text-label.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-master .shape-freehand-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip,
.player-wrapper:not(.annotation-active) #video-markers-layer-reference .shape-freehand-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Tipografia etichetta solo sul player (marker layer), non nel pannello note */
#video-markers-layer-master .annotation-marker-tooltip .tip-text,
#video-markers-layer-reference .annotation-marker-tooltip .tip-text {
  font-family: 'Urbanist', 'Lato', var(--font-main), system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.45;
  text-shadow:
    0 0 1px #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 2px 8px rgba(0, 0, 0, 0.85);
}

/* Variante: tooltip a destra del marker (classe aggiunta da JS) */
.annotation-marker-tooltip.tip-right {
  left: calc(100% + 10px);
  bottom: auto;
  top: 50%;
  transform: translateY(calc(-50% + 2px));
}
/* Variante: tooltip verso il basso (marker molto in alto) */
.annotation-marker-tooltip.tip-below {
  bottom: auto;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
}

/* Popup inserimento nota — sopra pending + marker layer */
.annotation-popup {
  position: absolute;
  z-index: 60;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 224px;
  pointer-events: none;
  background: rgba(6, 10, 18, 0.72);
  border: 1px solid rgba(0, 242, 255, calc(0.28 * var(--glow-intensity)));
  border-radius: var(--radius-md);
  padding: 12px;
  backdrop-filter: blur(18px) saturate(118%);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(0, 242, 255, calc(0.18 * var(--glow-intensity)));
}
.annotation-popup-timestamp {
  font-family: 'Courier New', monospace !important;
  font-size: 1.2rem !important;
  font-weight: 300 !important;
  letter-spacing: 1px;
  color: var(--cyan-accent) !important;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--cyan-glow);
}
.annotation-popup textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-pure);
  font-family: var(--font-main);
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 8px;
  resize: none;
  width: 100%;
  margin-top: 0;
  transition: border-color var(--t-fast);
}
.annotation-popup textarea:focus {
  border-color: var(--accent-solid);
  outline: none;
}
.annotation-popup-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.annotation-btn {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-tech);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  transition: background var(--t-fast), transform 0.1s ease;
}
.annotation-btn:active { transform: translateY(1px) scale(0.97); }
.annotation-btn-save {
  background: rgba(109, 40, 168, 0.72);
  color: var(--text-pure);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    background var(--t-fast),
    transform 0.1s ease,
    filter var(--t-fast),
    opacity var(--t-fast);
}
.annotation-btn-save:hover:not(:disabled) {
  background: rgba(109, 40, 168, 0.82);
}
.annotation-btn-save:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}
.annotation-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}
.annotation-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); }

/* Dot timeline — 8px, centrato nella barra da 10px.
   top:50% = 5px dal bordo superiore del layer.
   transform: separato in X e Y per chiarezza:
     translateX(-50%) → centra orizzontalmente sul left:% del timestamp
     translateY(-50%) → centra verticalmente nella barra da 10px
   Il riferimento è SEMPRE .timeline-dots-layer (height:10px), non il player intero.
   NESSUN left di default: impostato esclusivamente da JS. */
.annotation-dot {
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.annotation-dot:hover {
  transform: translateX(-50%) translateY(-50%) scale(1.6);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Tooltip del dot — appare SOTTO la barra perché la barra è a top:0
   e player-wrapper ha overflow:hidden (tooltip sopra verrebbe clippato). */
.annotation-dot-tooltip {
  position: absolute;
  top: calc(100% + 7px);   /* sotto il dot, dentro il player */
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 8, 12, 0.95);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  font-family: var(--font-main);
  font-size: 0.65rem;
  color: var(--text-pure);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.annotation-dot:hover .annotation-dot-tooltip { opacity: 1; }

/* Annotation marker: fade gestito via inline style da renderMarkers() */

/* Rail + Drawer: stili definiti nella sezione LAYOUT in cima al file */

/* ═══════════════════════════════════════════
   DRAWING TOOLBOX — Arctic glass + tactile push (overlay draggable z 10001)
   ═══════════════════════════════════════════ */
/* Penna effimera: tratto svanisce in ~3s (2.5s visibile + 0.5s fade sul path, animationend + setTimeout 4s fallback in JS).
   Usata da ephemeralPenMode (toggle dedicato) — NON dal ghost-clean.
   @keyframes fadeOut — estratto in styles/keyframes.css */

.is-ghosting {
  pointer-events: none !important; /* guard cleanup: animation è su path.is-ghosting nel selettore specifico */
}

/* Alias retro-compatibilità */
.shape-ghost-ephemeral {
  animation: fadeOut 0.5s ease 2.5s forwards;
  pointer-events: none !important;
}

/* ── Ghost "pagina pulita" (ghostCleanMode): nasconde SOLO i marker già salvati
   (video-markers-layer) senza cancellare i dati da items/Supabase.
   Il pending-preview-layer NON viene nascosto: l'utente deve sempre vedere
   il preview della forma che sta disegnando, anche in ghost-clean mode.
   Rimuovendo la classe i marker riappaiono immediatamente. ── */
.player-wrapper.is-ghost-clean .video-markers-layer {
  visibility: hidden;
}
/* Badge modalità in ghost-clean: testo aggiuntivo per indicare lo stato */
.player-wrapper.is-ghost-clean #annotation-mode-badge::before {
  content: '◌ ';
  color: rgba(0, 242, 255, 0.6);
}

.drawing-toolbox {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 7px 10px;
  background: rgba(10, 14, 24, 0.42);
  border: 1px solid rgba(0, 242, 255, 0.28);
  border-top: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 38%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--geo-ice-cyan) 32%, transparent);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--geo-panel-blur)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--geo-panel-blur)) saturate(1.08);
  box-shadow:
    var(--geo-plate-drop),
    var(--geo-plate-inset-cyan),
    inset 0 -10px 28px rgba(0, 0, 0, 0.35);
  z-index: 10001;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  overflow: visible;
}

.drawing-toolbox.is-dragging {
  opacity: 0.95;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(0, 242, 255, 0.28),
    var(--geo-plate-inset-cyan),
    inset 0 -10px 28px rgba(0, 0, 0, 0.35);
}

.toolbox-drag-handle {
  width: 100%;
  height: 14px;
  margin: 0 0 2px;
  border-radius: 4px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(148, 163, 184, 0.45);
  flex-shrink: 0;
  pointer-events: auto;
}
.toolbox-drag-handle::before {
  content: '';
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 2px,
    transparent 2px 5px
  );
  opacity: 0.85;
}
.drawing-toolbox.is-dragging .toolbox-drag-handle {
  cursor: grabbing;
}

.drawing-toolbox > .tool-btn,
.drawing-toolbox > .tool-ghost-toggle,
.drawing-toolbox > .tool-sep,
.drawing-toolbox > .toolbox-group-label,
.drawing-toolbox > .tool-annotate-mode-toggle {
  pointer-events: auto;
}

.tool-btn.t1-btn-3d {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 34%, rgba(2, 6, 23, 0.56) 100%),
    rgba(255, 255, 255, 0.025);
  color: rgba(226, 232, 240, 0.72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-btn svg {
  width: 12px;
  height: 12px;
}
.tool-btn:hover {
  color: #f1f5f9;
  background: rgba(0, 242, 255, 0.08);
  border-color: rgba(0, 242, 255, 0.38);
}
/* Hover toolbox: alone del colore del tool (solo se non già attivo) */
.tool-btn[data-tool='point']:hover:not(.is-active) {
  color: var(--tool-point-solid);
  background: rgba(var(--tool-point-rgb), 0.1);
  border-color: rgba(var(--tool-point-rgb), 0.42);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, calc(0.1 * var(--btn-depth-intensity))),
    0 4px 6px rgba(0, 0, 0, calc(0.3 * var(--btn-depth-intensity))),
    0 0 14px rgba(var(--tool-point-rgb), 0.28);
}
.tool-btn[data-tool='circle']:hover:not(.is-active) {
  color: var(--tool-circle-solid);
  background: rgba(var(--tool-circle-rgb), 0.11);
  border-color: rgba(var(--tool-circle-rgb), 0.48);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, calc(0.1 * var(--btn-depth-intensity))),
    0 4px 6px rgba(0, 0, 0, calc(0.3 * var(--btn-depth-intensity))),
    0 0 14px rgba(var(--tool-circle-rgb), 0.28);
}
.tool-btn[data-tool='rect']:hover:not(.is-active) {
  color: var(--tool-rect-solid);
  background: rgba(var(--tool-rect-rgb), 0.11);
  border-color: rgba(var(--tool-rect-rgb), 0.48);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, calc(0.1 * var(--btn-depth-intensity))),
    0 4px 6px rgba(0, 0, 0, calc(0.3 * var(--btn-depth-intensity))),
    0 0 14px rgba(var(--tool-rect-rgb), 0.26);
}
.tool-btn[data-tool='line']:hover:not(.is-active) {
  color: var(--tool-arrow-solid);
  background: rgba(var(--tool-arrow-rgb), 0.12);
  border-color: rgba(var(--tool-arrow-rgb), 0.48);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, calc(0.1 * var(--btn-depth-intensity))),
    0 4px 6px rgba(0, 0, 0, calc(0.3 * var(--btn-depth-intensity))),
    0 0 14px rgba(var(--tool-arrow-rgb), 0.28);
}
.tool-btn[data-tool='pen']:hover:not(.is-active) {
  color: var(--tool-point-solid);
  background: rgba(var(--tool-point-rgb), 0.1);
  border-color: rgba(var(--tool-point-rgb), 0.42);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, calc(0.1 * var(--btn-depth-intensity))),
    0 4px 6px rgba(0, 0, 0, calc(0.3 * var(--btn-depth-intensity))),
    0 0 14px rgba(var(--tool-point-rgb), 0.28);
}
.tool-btn.t1-btn-3d:active:not(:disabled) {
  transform: scale(0.94) translateY(1px);
}
.tool-btn.is-active {
  color: #00f2ff;
  background:
    linear-gradient(180deg, rgba(0, 242, 255, 0.14) 0%, rgba(0, 242, 255, 0.06) 100%);
  border-color: rgba(0, 242, 255, 0.58);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    inset 0 0 12px rgba(0, 242, 255, var(--btn-active-inner-glow)),
    0 0 10px rgba(0, 242, 255, calc(0.5 * var(--glow-intensity)));
  filter: drop-shadow(0 0 5px rgba(0, 242, 255, 0.7));
}
.tool-btn.is-active:active {
  filter: drop-shadow(0 0 4px #00f2ff);
}

.tool-btn[data-tool='point'].is-active {
  color: var(--tool-point-solid);
  background:
    linear-gradient(180deg, rgba(var(--tool-point-rgb), 0.16) 0%, rgba(var(--tool-point-rgb), 0.06) 100%);
  border-color: rgba(var(--tool-point-rgb), 0.62);
  border-top-color: rgba(var(--tool-point-rgb), 0.9);
  box-shadow:
    inset 0 1px 0 rgba(var(--tool-point-rgb), 0.8),
    inset 0 0 12px rgba(var(--tool-point-rgb), var(--btn-active-inner-glow)),
    0 0 10px rgba(var(--tool-point-rgb), calc(0.45 * var(--glow-intensity)));
  filter: drop-shadow(0 0 6px rgba(var(--tool-point-rgb), 0.58));
}
.tool-btn[data-tool='circle'].is-active {
  color: var(--tool-circle-solid);
  background:
    linear-gradient(180deg, rgba(var(--tool-circle-rgb), 0.2) 0%, rgba(var(--tool-circle-rgb), 0.06) 100%);
  border-color: rgba(var(--tool-circle-rgb), 0.64);
  border-top-color: rgba(var(--tool-circle-rgb), 0.9);
  box-shadow:
    inset 0 1px 0 rgba(var(--tool-circle-rgb), 0.8),
    inset 0 0 12px rgba(var(--tool-circle-rgb), var(--btn-active-inner-glow)),
    0 0 12px rgba(var(--tool-circle-rgb), calc(0.48 * var(--glow-intensity)));
  filter: drop-shadow(0 0 7px rgba(var(--tool-circle-rgb), 0.52));
}
.tool-btn[data-tool='rect'].is-active {
  color: var(--tool-rect-solid);
  background:
    linear-gradient(180deg, rgba(var(--tool-rect-rgb), 0.22) 0%, rgba(var(--tool-rect-rgb), 0.07) 100%);
  border-color: rgba(var(--tool-rect-rgb), 0.62);
  border-top-color: rgba(var(--tool-rect-rgb), 0.9);
  box-shadow:
    inset 0 1px 0 rgba(var(--tool-rect-rgb), 0.8),
    inset 0 0 12px rgba(var(--tool-rect-rgb), var(--btn-active-inner-glow)),
    0 0 12px rgba(var(--tool-rect-rgb), calc(0.46 * var(--glow-intensity)));
  filter: drop-shadow(0 0 7px rgba(var(--tool-rect-rgb), 0.48));
}
.tool-btn[data-tool='line'].is-active {
  color: var(--tool-arrow-solid);
  background:
    linear-gradient(180deg, rgba(var(--tool-arrow-rgb), 0.22) 0%, rgba(var(--tool-arrow-rgb), 0.07) 100%);
  border-color: rgba(var(--tool-arrow-rgb), 0.64);
  border-top-color: rgba(var(--tool-arrow-rgb), 0.9);
  box-shadow:
    inset 0 1px 0 rgba(var(--tool-arrow-rgb), 0.8),
    inset 0 0 12px rgba(var(--tool-arrow-rgb), var(--btn-active-inner-glow)),
    0 0 12px rgba(var(--tool-arrow-rgb), calc(0.48 * var(--glow-intensity)));
  filter: drop-shadow(0 0 7px rgba(var(--tool-arrow-rgb), 0.5));
}
.tool-btn[data-tool='pen'].is-active {
  color: var(--tool-point-solid);
  background:
    linear-gradient(180deg, rgba(var(--tool-point-rgb), 0.16) 0%, rgba(var(--tool-point-rgb), 0.06) 100%);
  border-color: rgba(var(--tool-point-rgb), 0.62);
  border-top-color: rgba(var(--tool-point-rgb), 0.9);
  box-shadow:
    inset 0 1px 0 rgba(var(--tool-point-rgb), 0.8),
    inset 0 0 12px rgba(var(--tool-point-rgb), var(--btn-active-inner-glow)),
    0 0 10px rgba(var(--tool-point-rgb), calc(0.45 * var(--glow-intensity)));
  filter: drop-shadow(0 0 6px rgba(var(--tool-point-rgb), 0.58));
}

/* Tasto Ghost-clean (pagina pulita) — bordo tratteggiato di default */
.tool-ghost-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.04) 34%, rgba(2, 6, 23, 0.54) 100%),
    rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.tool-ghost-toggle:hover {
  color: #94a3b8;
  border-color: rgba(0, 242, 255, 0.42);
  background: rgba(0, 242, 255, 0.06);
}
.tool-ghost-toggle:active {
  transform: scale(0.92) translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
/* Attivo: marker nascosti — tono cyan come gli altri tool attivi */
.tool-ghost-toggle.is-on {
  color: #00f2ff;
  border-style: solid;
  border-color: rgba(0, 242, 255, 0.62);
  background: rgba(0, 242, 255, 0.12);
  filter: drop-shadow(0 0 5px #00f2ff);
}

/* Semaforino Annota / Solo visione — 36×36, lampada grande, label al hover (P3 · T0.16a-S2) */
.tool-annotate-mode-toggle {
  position: relative;
  overflow: visible;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 38%, rgba(2, 6, 23, 0.58) 100%),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.tool-annotate-mode-toggle:active {
  transform: scale(0.92) translateY(2px);
}
.tool-annotate-mode-toggle__lamp {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.42);
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.tool-annotate-mode-toggle.is-annotate-on {
  border-color: color-mix(in srgb, #34d399 48%, rgba(148, 163, 184, 0.28));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #34d399 22%, transparent),
    0 0 10px color-mix(in srgb, #34d399 18%, transparent);
}
.tool-annotate-mode-toggle.is-annotate-on .tool-annotate-mode-toggle__lamp {
  background: radial-gradient(circle at 32% 28%, #a7f3d0 0%, #34d399 42%, #059669 72%, #064e3b 100%);
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.28),
    0 0 16px rgba(52, 211, 153, 0.72),
    0 0 4px rgba(110, 231, 183, 0.9);
}
.tool-annotate-mode-toggle.is-solo-visione {
  border-color: color-mix(in srgb, #ef4444 52%, rgba(148, 163, 184, 0.28));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #ef4444 24%, transparent),
    0 0 10px color-mix(in srgb, #ef4444 20%, transparent);
}
.tool-annotate-mode-toggle.is-solo-visione .tool-annotate-mode-toggle__lamp {
  background: radial-gradient(circle at 32% 28%, #fecaca 0%, #ef4444 42%, #dc2626 72%, #7f1d1d 100%);
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.22),
    0 0 16px rgba(239, 68, 68, 0.72),
    0 0 4px rgba(252, 165, 165, 0.85);
}
/* Tasto "penna effimera" — Arctic Ice (LED sincronizzato col tratto) */
.tool-ephemeral-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.04) 34%, rgba(2, 6, 23, 0.54) 100%),
    rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(var(--tool-ghost-rgb), 0.52);
  color: rgba(var(--tool-ghost-rgb), 0.82);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.26s cubic-bezier(0.22, 0.8, 0.3, 1),
    filter 0.26s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.tool-ephemeral-toggle:hover {
  color: var(--tool-ghost-solid);
  border-color: rgba(var(--tool-ghost-rgb), 0.72);
  background: rgba(var(--tool-ghost-rgb), 0.12);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.22), 0 0 28px rgba(var(--tool-ghost-rgb), 0.28);
  filter:
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.65))
    drop-shadow(0 0 14px rgba(var(--tool-ghost-rgb), 0.42));
}
.tool-ephemeral-toggle:active {
  transform: scale(0.92) translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.tool-ephemeral-toggle.is-on {
  color: var(--tool-ghost-solid);
  border-style: solid;
  border-color: rgba(var(--tool-ghost-rgb), 0.82);
  background: rgba(var(--tool-ghost-rgb), 0.15);
  filter:
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.88))
    drop-shadow(0 0 14px rgba(var(--tool-ghost-rgb), 0.48));
}
.tool-ephemeral-toggle.is-on:hover {
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.28), 0 0 36px rgba(var(--tool-ghost-rgb), 0.35);
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 20px rgba(var(--tool-ghost-rgb), 0.55));
}

/* Tasto "mostra tutte le note" — accento ametista per distinguersi */
.tool-show-all-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.04) 34%, rgba(2, 6, 23, 0.54) 100%),
    rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(109, 40, 168, 0.45);
  color: rgba(196, 181, 253, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.tool-show-all-toggle:hover {
  color: #c4b5fd;
  border-color: rgba(109, 40, 168, 0.65);
  background: rgba(109, 40, 168, 0.08);
}
.tool-show-all-toggle:active {
  transform: scale(0.92) translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.tool-show-all-toggle.is-on {
  color: #c4b5fd;
  border-style: solid;
  border-color: rgba(109, 40, 168, 0.75);
  background: rgba(109, 40, 168, 0.14);
  filter: drop-shadow(0 0 5px rgba(109, 40, 168, 0.55));
}

/* Pointer-events dei nuovi tasti nel drawing-toolbox */
.drawing-toolbox > .tool-ephemeral-toggle,
.drawing-toolbox > .tool-show-all-toggle,
.drawing-toolbox > .tool-annotate-mode-toggle,
.drawing-toolbox > .toolbox-group-label {
  pointer-events: auto;
}

/* Etichetta gruppo vista nel toolbox */
.toolbox-group-label {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.42);
  text-align: center;
  line-height: 1;
  padding: 2px 0 1px;
  user-select: none;
  pointer-events: none;
}

/* Penna persistente (data-tool=pen) + ghost pen (toggle effimero) sono complementari. */

.tool-sep {
  width: 22px;
  height: 6px;
  background: transparent;
  margin: 1px 0;
}

/* Tratti ghost: fade sul path (.is-ghosting) — vedi sezione toolbox sopra */

/* ─────────────────────────────────────────────────────────────────────────────
   DRAWING ACTIVE STATE
   Quando è selezionato uno strumento di disegno (≠ punto) e il player è in pausa,
   il drawing-overlay viene portato sopra il layer marker così gli eventi mouse
   raggiungono sempre il disegno — anche con molte annotazioni sul frame.
   ───────────────────────────────────────────────────────────────────────────── */
.player-wrapper.is-drawing-active .drawing-overlay {
  z-index: 25;  /* sopra video-markers-layer(21) e pending-preview-layer(22) */
}
/* Disabilita pointer-events sui marker mentre si disegna: evita che forme
   salvate intercettino i pointer events prima del drawing-overlay */
.player-wrapper.is-drawing-active .video-markers-layer {
  pointer-events: none !important;
}
/* Tool point: i marker devono restare hoverable (tooltip on-hover).
   La cattura del click point viene gestita in JS in fase capture. */
/* ═══════════════════════════════════════════
   DRAWING SHAPES LAYER v2.0
   ═══════════════════════════════════════════ */
.drawing-shapes-layer {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: visible;   /* preview forme durante il disegno non devono essere clippati */
}
.drawing-overlay {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 19; /* sotto video-markers(21): hover annotazioni passa prima ai marker */
  pointer-events: none;
  cursor: crosshair;
}

/* ── LAYER E: pending-preview-layer ──────────────────────────────────────
   Sopra i marker salvati così il draft resta visibile; sotto annotation-popup. */
.pending-preview-layer {
  position: absolute;
  inset: 0;
  z-index: 22;
  pointer-events: none;
  overflow: visible;
}

/* Punto focus */
.shape-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-solid);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--accent-glow), 0 0 24px rgba(109, 40, 168, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Rettangolo / cerchio — layout base (bloom + key: styles/t1_canvas_hud.css) */
.shape-rect {
  position: absolute;
  border-radius: 4px;
  background: rgba(var(--tool-rect-rgb), calc(0.07 * var(--tool-fill-opacity)));
  overflow: visible;
}

.shape-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(var(--tool-circle-rgb), calc(0.16 * var(--tool-fill-opacity)));
  overflow: visible;
}

/* Freehand salvato — posizione via JS sul content rect (9:16 pillarbox); non inset:0 */
.shape-freehand-wrap.shape-note {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.shape-freehand-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.shape-freehand-svg .shape-freehand-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 0.022;
  pointer-events: stroke;
  cursor: pointer;
}
.shape-freehand-wrap.shape-note:has(.shape-freehand-hit:hover) .annotation-marker-tooltip {
  opacity: 1;
}
.shape-freehand-svg .shape-freehand-path {
  fill: none;
  stroke: #00f2ff;
  stroke-width: 0.0045;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 3px rgba(0, 242, 255, 0.75))
    drop-shadow(0 0 10px rgba(0, 242, 255, 0.35));
  pointer-events: none;
}
.shape-freehand-hotspot {
  pointer-events: all;
}
.shape-freehand-hotspot:hover .annotation-marker-tooltip,
.shape-freehand-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.shape-freehand-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip {
  opacity: 1;
}

/* ── Arrow tool (freccia, type: line) ────────────────────────────── */
/* Shaft and arrowhead rendered in a single SVG — one coordinate system,
   no DOM-offset mismatch possible. Geometry is computed in pixel space. */

.shape-arrow-wrap.shape-note {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

/* SVG covers the full annotation layer; individual elements control pointer-events */
.shape-arrow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.shape-arrow-shaft {
  stroke: var(--tool-arrow-solid);
  stroke-width: 2.75;
  stroke-linecap: round;
  fill: none;
  opacity: 0.93;
  /* Laser: nucleo caldo + bloom magenta/rosa anche senza hover */
  filter:
    drop-shadow(0 0 calc(1px * var(--shape-bloom-scale)) rgba(255, 255, 255, 0.45))
    drop-shadow(0 0 calc(4px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(1 * var(--glow-intensity))))
    drop-shadow(0 0 calc(14px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.82 * var(--glow-intensity))))
    drop-shadow(0 0 calc(28px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.46 * var(--glow-intensity))))
    drop-shadow(0 0 calc(48px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.22 * var(--glow-intensity))));
}

.shape-arrow-head-poly {
  fill: var(--tool-arrow-solid);
  stroke: none;
  filter:
    drop-shadow(0 0 calc(1px * var(--shape-bloom-scale)) rgba(255, 255, 255, 0.42))
    drop-shadow(0 0 calc(4px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(1 * var(--glow-intensity))))
    drop-shadow(0 0 calc(12px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.78 * var(--glow-intensity))))
    drop-shadow(0 0 calc(26px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.42 * var(--glow-intensity))))
    drop-shadow(0 0 calc(44px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.2 * var(--glow-intensity))));
}

/* Transparent hit area: covers the arrow for hover detection.
   Rotated by screen-space angle, vertically centered on the arrow path.
   top: calc(y1% - 9px) + transform-origin: 0 9px → pivot lands exactly on (x1%, y1%).
   width: plen/cw*100% → pixel width equals actual screen-space arrow length. */
.shape-arrow-hit {
  position: absolute;
  height: 18px;
  background: transparent;
  pointer-events: all;
  /* Il wrap ha pointer-events:none → :hover sul genitore non si attiva; cursore qui. */
  cursor: pointer;
}

/* Tooltip anchor: zero-dimension div positioned at arrow midpoint, never rotated.
   The .annotation-marker-tooltip inside uses bottom/translateX(-50%) so it appears
   horizontally above the midpoint regardless of the arrow's direction. */
.shape-arrow-tip-host {
  position: absolute;
  pointer-events: none;
  transform: translateX(-50%);
}

/* Tooltip visibility toggled by JS (mouseenter/leave on hit area).
   ID-based selector (specificity 1,1,0) overrides the opacity: 0 !important
   from .player-wrapper:not(.annotation-active) .annotation-marker-tooltip (0,3,0). */
#video-markers-layer-master .annotation-marker-tooltip.is-visible,
#video-markers-layer-reference .annotation-marker-tooltip.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Preview bar shown while dragging to draw an arrow */
.shape-arrow-preview {
  position: absolute;
  height: 3px;
  transform-origin: 0 50%;
  background: var(--tool-arrow-solid);
  opacity: 0.88;
  border-radius: 999px;
  pointer-events: none;
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.5))
    drop-shadow(0 0 6px rgba(var(--tool-arrow-rgb), 0.95))
    drop-shadow(0 0 16px rgba(var(--tool-arrow-rgb), 0.55))
    drop-shadow(0 0 32px rgba(var(--tool-arrow-rgb), 0.28));
}

/* Preview di trascinamento — resa alone in t1_canvas_hud.css */
.shape-rect.shape-preview {
  pointer-events: none;
  opacity: 1;
  border-style: dashed;
  background: rgba(var(--tool-rect-rgb), 0.09);
  border-color: rgba(var(--tool-rect-rgb), 0.55);
}
.shape-circle.shape-preview {
  pointer-events: none;
  opacity: 1;
  border-style: dashed;
  background: rgba(var(--tool-circle-rgb), 0.09);
  border-color: rgba(var(--tool-circle-rgb), 0.52);
}

.shape-line-svg.shape-preview line {
  stroke-opacity: 0.65;
  stroke: #00f2ff;
  filter:
    drop-shadow(0 0 4px rgba(0, 242, 255, 0.55))
    drop-shadow(0 0 10px rgba(0, 242, 255, 0.28));
}
/* Pen preview live — wrapper su content rect (parity rect/circle); SVG riempie il wrap. */
.shape-pen-preview-wrap {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.shape-pen-preview-wrap .shape-pen-preview-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.shape-pen-preview-wrap .shape-pen-preview-svg:not(.shape-pen-ephemeral) path {
  stroke: var(--tool-point-solid, #00f2ff);
  /* T0.10: niente glow in drag — filter ricalcolato ogni pointermove = lag percepito.
     Glow su forma salvata/pending (.shape-freehand-path). */
  filter: none;
}
.shape-pen-preview-wrap .shape-pen-preview-svg.shape-pen-ephemeral path {
  stroke: var(--tool-ghost-solid);
  filter: none;
}
.shape-pen-preview-wrap .shape-pen-preview-svg.shape-pen-ephemeral-glow path {
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 4px rgba(var(--tool-ghost-rgb), 0.6));
}
.shape-pen-preview-wrap .shape-pen-preview-svg.shape-pen-ephemeral-glow path.is-ghosting {
  animation: fadeOut 0.5s ease 2.5s forwards;
}

/* Legacy pen preview (shape-line-svg diretto) — mantenuto per compat; preferire wrap sopra. */
.shape-line-svg.shape-pen-preview:not(.shape-pen-ephemeral) path {
  stroke: var(--tool-point-solid, #00f2ff);
  filter: none;
}

/* Pen preview durante disegno: posizionato via inline style (content rect), no inset:0 full-frame. */
.shape-line-svg.shape-pen-preview {
  inset: auto;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
}

/* Penna effimera — drag: Arctic Ice piatto (filter:none esplicito, no eredità drop-shadow penna). */
.shape-line-svg.shape-pen-preview.shape-pen-ephemeral path {
  stroke: var(--tool-ghost-solid);
  filter: none;
}
/* Dopo rilascio: alone leggero per fase visibile + fade (~3s). */
.shape-line-svg.shape-pen-preview.shape-pen-ephemeral.shape-pen-ephemeral-glow path {
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 4px rgba(var(--tool-ghost-rgb), 0.6));
}
.shape-line-svg.shape-pen-preview.shape-pen-ephemeral.shape-pen-ephemeral-glow path.is-ghosting {
  animation: fadeOut 0.5s ease 2.5s forwards;
}

/* Linea SVG direttrice (legacy preview line) */
.shape-line-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Note salvata: hit solo sulla linea (stroke), senza intercettare l’intero frame SVG) */

/* Input testo inline */
.shape-text-input {
  position: absolute;
  background: rgba(4, 4, 8, 0.85);
  border: 1px solid var(--accent-solid);
  color: var(--text-pure);
  font-family: var(--font-tech);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  transform: translate(0, -50%);
  min-width: 90px;
  max-width: 220px;
  z-index: 30;
  box-shadow: 0 0 12px var(--accent-glow-faint);
}

/* Label testo */
.shape-text-label {
  position: absolute;
  color: var(--cyan-accent);
  font-family: var(--font-tech);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px var(--cyan-glow), 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  transform: translate(0, -50%);
  pointer-events: none;
}

/* ── v3.0: Forme persistenti nel video-markers-layer ──────────────────────
   Le forme con classe .shape-note sono gestite da Annotations.updateVisibleShapes().
   Devono essere hoverable (pointer-events:all) e non clippare il tooltip.        */

/* Rettangolo / Cerchio annotazioni permanenti — interazione + fill (alone: t1_canvas_hud.css) */
.shape-rect.shape-note,
.shape-circle.shape-note {
  pointer-events: all;
  cursor: pointer;
  overflow: visible;
  transition:
    box-shadow 0.28s cubic-bezier(0.22, 0.8, 0.3, 1),
    background-color 0.28s cubic-bezier(0.22, 0.8, 0.3, 1),
    border-color 0.28s cubic-bezier(0.22, 0.8, 0.3, 1),
    filter 0.28s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.shape-rect.shape-note {
  background: rgba(var(--tool-rect-rgb), calc(0.16 * var(--tool-fill-opacity)));
}
.shape-circle.shape-note {
  background: rgba(var(--tool-circle-rgb), calc(0.16 * var(--tool-fill-opacity)));
}
.shape-rect.shape-note:hover,
.shape-rect.shape-note.is-linked-hover,
.shape-rect.shape-note.is-linked-pulse {
  background: rgba(var(--tool-rect-rgb), calc(0.18 * var(--tool-fill-opacity)));
}
.shape-circle.shape-note:hover,
.shape-circle.shape-note.is-linked-hover,
.shape-circle.shape-note.is-linked-pulse {
  background: rgba(var(--tool-circle-rgb), calc(0.26 * var(--tool-fill-opacity)));
}
.shape-arrow-shaft,
.shape-arrow-head-poly {
  transition:
    filter 0.28s cubic-bezier(0.22, 0.8, 0.3, 1),
    opacity 0.28s cubic-bezier(0.22, 0.8, 0.3, 1);
}
/* Wrap con pointer-events:none non riceve :hover sul genitore; :has segue l’hover sulla hit-strip */
.shape-arrow-wrap.shape-note:has(.shape-arrow-hit:hover) .shape-arrow-shaft,
.shape-arrow-wrap.shape-note.is-linked-hover .shape-arrow-shaft,
.shape-arrow-wrap.shape-note.is-linked-pulse .shape-arrow-shaft {
  opacity: 1;
  filter:
    drop-shadow(0 0 calc(2px * var(--shape-bloom-scale)) rgba(255, 255, 255, 0.78))
    drop-shadow(0 0 calc(6px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(1 * var(--glow-intensity))))
    drop-shadow(0 0 calc(18px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.95 * var(--glow-intensity))))
    drop-shadow(0 0 calc(38px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.56 * var(--glow-intensity))))
    drop-shadow(0 0 calc(64px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.3 * var(--glow-intensity))));
}
.shape-arrow-wrap.shape-note:has(.shape-arrow-hit:hover) .shape-arrow-head-poly,
.shape-arrow-wrap.shape-note.is-linked-hover .shape-arrow-head-poly,
.shape-arrow-wrap.shape-note.is-linked-pulse .shape-arrow-head-poly {
  filter:
    drop-shadow(0 0 calc(2px * var(--shape-bloom-scale)) rgba(255, 255, 255, 0.74))
    drop-shadow(0 0 calc(6px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(1 * var(--glow-intensity))))
    drop-shadow(0 0 calc(17px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.92 * var(--glow-intensity))))
    drop-shadow(0 0 calc(36px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.52 * var(--glow-intensity))))
    drop-shadow(0 0 calc(58px * var(--shape-bloom-scale)) rgba(var(--tool-arrow-rgb), calc(0.28 * var(--glow-intensity))));
}
.shape-rect.shape-note:hover .annotation-marker-tooltip,
.shape-circle.shape-note:hover .annotation-marker-tooltip,
.shape-rect.shape-note.is-linked-hover .annotation-marker-tooltip,
.shape-circle.shape-note.is-linked-hover .annotation-marker-tooltip,
.shape-rect.shape-note.is-linked-pulse .annotation-marker-tooltip,
.shape-circle.shape-note.is-linked-pulse .annotation-marker-tooltip,
.shape-arrow-wrap.shape-note:hover .annotation-marker-tooltip,
.shape-arrow-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.shape-arrow-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip,
.shape-freehand-wrap.shape-note:hover .annotation-marker-tooltip,
.shape-freehand-wrap.shape-note.is-linked-hover .annotation-marker-tooltip,
.shape-freehand-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Testo label come annotazione permanente */
.shape-text-label.shape-note {
  pointer-events: all;
  cursor: pointer;
  overflow: visible;
}
.shape-text-label.shape-note:hover .annotation-marker-tooltip,
.shape-text-label.shape-note.is-linked-hover .annotation-marker-tooltip,
.shape-text-label.shape-note.is-linked-pulse .annotation-marker-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.annotation-marker:hover .annotation-marker-tooltip.tip-right,
.annotation-marker.is-linked-hover .annotation-marker-tooltip.tip-right,
.shape-rect.shape-note:hover .annotation-marker-tooltip.tip-right,
.shape-circle.shape-note:hover .annotation-marker-tooltip.tip-right,
.shape-text-label.shape-note:hover .annotation-marker-tooltip.tip-right,
.shape-rect.shape-note.is-linked-hover .annotation-marker-tooltip.tip-right,
.shape-circle.shape-note.is-linked-hover .annotation-marker-tooltip.tip-right,
.shape-text-label.shape-note.is-linked-hover .annotation-marker-tooltip.tip-right,
.shape-rect.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-right,
.shape-circle.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-right,
.shape-text-label.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-right,
.annotation-marker.is-linked-pulse .annotation-marker-tooltip.tip-right,
.shape-arrow-wrap.shape-note:hover .annotation-marker-tooltip.tip-right,
.shape-arrow-wrap.shape-note.is-linked-hover .annotation-marker-tooltip.tip-right,
.shape-arrow-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-right,
.shape-freehand-wrap.shape-note:hover .annotation-marker-tooltip.tip-right,
.shape-freehand-wrap.shape-note.is-linked-hover .annotation-marker-tooltip.tip-right,
.shape-freehand-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-right {
  transform: translateY(-50%);
}

.annotation-marker:hover .annotation-marker-tooltip.tip-below,
.annotation-marker.is-linked-hover .annotation-marker-tooltip.tip-below,
.shape-rect.shape-note:hover .annotation-marker-tooltip.tip-below,
.shape-circle.shape-note:hover .annotation-marker-tooltip.tip-below,
.shape-text-label.shape-note:hover .annotation-marker-tooltip.tip-below,
.shape-rect.shape-note.is-linked-hover .annotation-marker-tooltip.tip-below,
.shape-circle.shape-note.is-linked-hover .annotation-marker-tooltip.tip-below,
.shape-text-label.shape-note.is-linked-hover .annotation-marker-tooltip.tip-below,
.shape-rect.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-below,
.shape-circle.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-below,
.shape-text-label.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-below,
.annotation-marker.is-linked-pulse .annotation-marker-tooltip.tip-below,
.shape-arrow-wrap.shape-note:hover .annotation-marker-tooltip.tip-below,
.shape-arrow-wrap.shape-note.is-linked-hover .annotation-marker-tooltip.tip-below,
.shape-arrow-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-below,
.shape-freehand-wrap.shape-note:hover .annotation-marker-tooltip.tip-below,
.shape-freehand-wrap.shape-note.is-linked-hover .annotation-marker-tooltip.tip-below,
.shape-freehand-wrap.shape-note.is-linked-pulse .annotation-marker-tooltip.tip-below {
  transform: translateX(-50%) translateY(0);
}

/* Fuori modalità annotazione (play): wrap senza hit-area dedicata non intercettano il video.
   Rect/circle: pointer-events da .shape-rect/.shape-circle.shape-note (hover triade + tooltip sul player).
   Freccia: wrap none + .shape-arrow-hit all. Freehand: wrap none + .shape-freehand-hotspot all.
   Punto / testo: .annotation-marker / .shape-text-label restano interattivi. */
.player-wrapper:not(.annotation-active) .video-markers-layer .shape-arrow-wrap.shape-note,
.player-wrapper:not(.annotation-active) .video-markers-layer .shape-freehand-wrap.shape-note {
  pointer-events: none;
}

/* Ancora: solo punto visivo sul centro (eventi → hit-line SVG) */
.shape-line-anchor.shape-line-anchor--visual {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-accent);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 6px var(--cyan-glow);
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: visible;
}

/* Preview immediato (pendingShapeEl): visibile mentre il popup è aperto.
   Opacità ridotta, nessun pointer-events, tooltip nascosto (testo ancora vuoto). */
/* Preview immediato (popup aperto): visibilità alta per non dare l'impressione
   che il disegno sia "sparito". Il pulse aiuta a distinguerlo da una forma
   già salvata (che non pulsa). */
.shape-pending {
  opacity: 0.88;
  pointer-events: none !important;
  animation: shape-pending-pulse 0.9s ease-in-out infinite alternate;
}
/* Nasconde il tooltip sul preview: il testo non è ancora stato digitato */
.shape-pending .annotation-marker-tooltip { display: none !important; }

/* @keyframes shape-pending-pulse — estratto in styles/keyframes.css */

/* Stub retrocompatibilità (non più usato da JS inline) */
.shape-fading { opacity: 0; }

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS v2.0
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 12050;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: rgba(8, 8, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-family: var(--font-tech);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-ice);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast.toast-success { border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.toast.toast-error   { border-color: rgba(239, 68, 68,  0.35); color: #fca5a5; }
.toast.toast-info    { border-color: var(--accent-solid); color: #c4b5fd; }
.toast.toast-warn    { border-color: rgba(245, 158, 11, 0.4); color: #fcd34d; }

button.is-locked[aria-disabled='true'] {
  opacity: 0.48;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   LOGIN OVERLAY
   ═══════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  background-image: radial-gradient(circle at 50% 40%, var(--accent-glow-faint) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.38s ease;
}

.login-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background: var(--sidebar-glass);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-shadow: 0 24px 64px var(--shadow-deeper), 0 0 48px var(--accent-glow);
  backdrop-filter: blur(20px);
}

.login-logo h1 {
  font-family: var(--font-tech);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-pure);
  letter-spacing: -0.5px;
}

.login-logo p {
  font-family: var(--font-tech);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 5px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-error {
  font-family: var(--font-tech);
  font-size: 11px;
  color: #e05c6a;
  min-height: 16px;
  text-align: center;
  letter-spacing: 0.2px;
}

#login-btn {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

#login-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .notes-panel.is-profile-transition .notes-feed-list {
    animation: none !important;
  }

  .player-loading-overlay,
  .player-loading-overlay__pulse {
    animation: none !important;
  }

  .sidebar-edge-glow {
    animation: none !important;
  }

  .sidebar-drawer.is-open,
  .notes-panel {
    filter: none !important;
  }

  .notes-panel .notes-feed-list > .notes-feed-item:nth-child(n) {
    transform: none !important;
  }

  .notes-feed-item:is(:hover, :focus-within),
  .notes-feed-item.is-active-highlight,
  .notes-feed-item.is-hover-link {
    transform: translate3d(0, -3px, 0) scale(1.004) !important;
  }

  .notes-feed-item.is-active-highlight .notes-feed-item__rail,
  .notes-feed-item.is-hover-link .notes-feed-item__rail {
    animation: none !important;
    filter: none !important;
  }

  .rail-quadrant,
  .rail-quadrant-icon,
  .rail-profile-avatar,
  .rail-context-portal,
  .context-gateway-overlay,
  .context-gateway-shell,
  .context-gateway-card {
    transition-duration: 0.01ms !important;
  }

  .sidebar-drawer,
  .sidebar-edge-glow {
    transition-duration: 0.01ms !important;
  }

  /* Reduced-motion: cristallo immediato (niente attesa transitionend dal JS). */
  .sidebar-drawer.is-open:not(.is-glass-ready) {
    backdrop-filter: blur(var(--t1-drawer-glass-blur-ready, 24px)) saturate(1.18);
    -webkit-backdrop-filter: blur(var(--t1-drawer-glass-blur-ready, 24px)) saturate(1.18);
    filter: none;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      inset 0 0 32px rgba(232, 240, 250, 0.05),
      var(--t1-depth-contact),
      var(--t1-depth-lift),
      0 0 calc(22px * var(--neon-glow-intensity, 1)) color-mix(in srgb, var(--t1-cyan, #00e5ff) 9%, transparent);
  }
}

/* Overlay vetro centrato → styles/t1_sidebar_overlay.css */

/* ── Settings: righe preferenze ── */
.settings-body {
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.settings-body--visual {
  flex: 1;
  min-height: 0;
  padding: 10px 14px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-visual-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 14px;
  min-height: 0;
  flex: 1;
  align-items: stretch;
}

.settings-visual-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.settings-zone__label {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  margin: 0 0 6px 2px;
}

.settings-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-tile.t1-btn-3d {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 8px 8px;
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 32%, rgba(2, 6, 14, 0.5) 100%);
  color: var(--t1-helm-frost-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.settings-tile.t1-btn-3d:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--t1-cyan) 22%, rgba(255, 255, 255, 0.1));
  color: var(--t1-helm-frost);
}

/* Pannello aperto a destra — alone argento, non “pref attiva” */
.settings-tile.t1-btn-3d.is-selected:not(.is-on) {
  border-color: color-mix(in srgb, var(--t1-silver) 38%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--t1-pearl) 8%, rgba(255, 255, 255, 0.03)),
      rgba(0, 0, 0, 0.26));
  color: var(--t1-helm-frost);
  box-shadow:
    var(--t1-depth-btn-highlight),
    var(--t1-depth-btn-contact);
}

/* Toggle ON — verde tenue (energia), indipendente dalla selezione */
.settings-tile.t1-btn-3d.is-on {
  border-color: color-mix(in srgb, var(--rating-green-solid) 42%, transparent);
  color: color-mix(in srgb, var(--rating-green-solid) 72%, var(--t1-helm-frost));
  box-shadow:
    var(--t1-depth-btn-highlight),
    var(--t1-depth-btn-contact),
    0 0 calc(14px * var(--neon-glow-intensity)) color-mix(in srgb, var(--rating-green-solid) 22%, transparent);
}

.settings-tile.t1-btn-3d.is-selected.is-on {
  border-color: color-mix(in srgb, var(--rating-green-solid) 48%, var(--t1-silver) 12%);
}

.settings-tile.t1-btn-3d.is-on .settings-tile__icon {
  filter: drop-shadow(0 0 calc(6px * var(--neon-glow-intensity)) color-mix(in srgb, var(--rating-green-solid) 38%, transparent));
}

.settings-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.settings-tile__label {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.2;
}

.settings-tile__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--t1-cyan) 50%, var(--t1-helm-frost-muted));
  pointer-events: none;
}

.settings-visual-foot {
  margin: 4px 2px 0;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.58rem;
  line-height: 1.4;
  color: var(--t1-helm-frost-muted);
}

.settings-detail.t1-panel-3d--well {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.24));
}

.settings-detail-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.settings-detail-panel.is-active {
  display: flex;
}

.settings-detail__title {
  margin: 0;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--t1-helm-frost);
  line-height: 1.25;
}

.settings-detail__sub {
  margin: 0;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.66rem;
  line-height: 1.45;
  color: var(--t1-helm-frost-muted);
}

.settings-detail__action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
}

.settings-detail__action--wide {
  width: 100%;
}

.settings-detail__hint {
  font-size: 0.58rem;
  color: var(--t1-helm-frost-muted);
  letter-spacing: 0.02em;
}

.settings-switch--large {
  width: 56px;
  height: 30px;
}

.settings-switch--large .settings-switch__thumb {
  width: 22px;
  height: 22px;
}

.settings-switch--large input:checked ~ .settings-switch__track .settings-switch__thumb {
  left: calc(100% - 24px);
}

.settings-stamp-select--large {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 10px 12px;
  font-size: 0.72rem;
  border-radius: 10px;
}

.settings-slider--large {
  width: 100%;
  min-width: 0;
  align-items: stretch;
}

.settings-slider--large input[type='range'] {
  width: 100%;
  height: 6px;
}

.settings-slider--large input[type='range']::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
}

.settings-slider--large input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
}

.settings-slider--large .settings-slider__value {
  align-self: flex-end;
  font-size: 0.64rem;
}

@media (max-width: 560px) {
  .settings-visual-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-overlay .t1-sidebar-overlay__shell.settings-shell,
  .settings-overlay .t1-sidebar-overlay__shell {
    width: min(96vw, 420px);
    max-height: min(88vh, 720px);
  }
}

/* T1.1 — CRUD frasi rapide (Impostazioni) */
.settings-feedback-snippets__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(42vh, 280px);
  overflow-y: auto;
  margin: 8px 0 12px;
  padding-right: 4px;
}

.settings-feedback-snippets__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.settings-feedback-snippets__label-input,
.settings-feedback-snippets__body-input {
  width: 100%;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-pure, #f8faff);
  font-family: var(--font-main, system-ui, sans-serif);
  font-size: 0.78rem;
  padding: 8px 10px;
}

.settings-feedback-snippets__body-input {
  resize: vertical;
  min-height: 56px;
  line-height: 1.4;
}

.settings-feedback-snippets__row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.settings-feedback-snippets__save-btn,
.settings-feedback-snippets__delete-btn,
.settings-feedback-snippets__add-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-tech, system-ui, sans-serif);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.settings-feedback-snippets__save-btn,
.settings-feedback-snippets__add-btn {
  border: 1px solid rgba(0, 242, 255, 0.22);
  background: rgba(0, 242, 255, 0.08);
  color: var(--text-pure, #f8faff);
}

.settings-feedback-snippets__delete-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: color-mix(in srgb, var(--text-dim, #8894ae) 90%, #fff 10%);
}

.settings-feedback-snippets__add {
  display: grid;
  gap: 8px;
}

.settings-feedback-snippets__empty,
.settings-feedback-snippets__limit {
  margin: 0;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--text-dim, #8894ae) 92%, #fff 8%);
}

.settings-feedback-snippets__save-btn.is-saved-flash,
.settings-feedback-snippets__delete-btn.is-saved-flash,
.settings-feedback-snippets__add-btn.is-saved-flash {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.14);
  color: color-mix(in srgb, #6ee7b7 88%, #fff 12%);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.22s ease, background 0.22s ease;
}

.settings-row:hover:not(.settings-row--ghost) {
  border-color: color-mix(in srgb, var(--t1-cyan) 22%, rgba(255, 255, 255, 0.06));
}

.settings-row--ghost {
  opacity: 0.55;
}

.settings-row__text {
  flex: 1;
  min-width: 0;
}

.settings-row__title {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--t1-helm-frost);
  margin: 0;
  line-height: 1.25;
}

.settings-row__sub {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--t1-helm-frost-muted);
  margin: 3px 0 0;
  line-height: 1.35;
}

.settings-stamp-select {
  flex-shrink: 0;
  min-width: 11rem;
  max-width: 42%;
  padding: 7px 10px;
  border-radius: 8px;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--t1-helm-frost);
  background: rgba(8, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  outline: none;
}

.settings-stamp-select:focus-visible {
  border-color: color-mix(in srgb, var(--t1-cyan) 45%, rgba(255, 255, 255, 0.12));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--t1-cyan) 35%, transparent);
}

/* Switch (Auto-play) */
.settings-switch {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.settings-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.settings-switch__track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.settings-switch__thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s ease, box-shadow 0.22s ease;
}

.settings-switch input:checked ~ .settings-switch__track {
  background: color-mix(in srgb, var(--t1-cyan) 28%, rgba(255, 255, 255, 0.06));
  border-color: color-mix(in srgb, var(--t1-cyan) 45%, transparent);
  box-shadow: 0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 35%, transparent);
}

.settings-switch input:checked ~ .settings-switch__track .settings-switch__thumb {
  left: calc(100% - 18px);
  background: color-mix(in srgb, var(--t1-cyan) 65%, white);
  box-shadow: 0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 55%, transparent);
}

.settings-switch input:focus-visible ~ .settings-switch__track {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--t1-cyan) 45%, transparent);
}

/* Slider (Glow Intensity) */
.settings-slider {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 130px;
}

.settings-slider input[type='range'] {
  width: 130px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--t1-cyan) 45%, transparent),
      color-mix(in srgb, var(--t1-cyan) 18%, rgba(255, 255, 255, 0.08)));
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.settings-slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--t1-cyan) 55%, white);
  border: 1px solid color-mix(in srgb, var(--t1-cyan) 65%, transparent);
  box-shadow: 0 0 calc(8px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 55%, transparent);
  cursor: grab;
}

.settings-slider input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--t1-cyan) 55%, white);
  border: 1px solid color-mix(in srgb, var(--t1-cyan) 65%, transparent);
  box-shadow: 0 0 calc(8px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 55%, transparent);
  cursor: grab;
}

.settings-slider__value {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--t1-cyan) 38%, var(--t1-helm-frost-muted));
}

.settings-ghost-flag {
  flex-shrink: 0;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .t1-sidebar-overlay,
  .t1-sidebar-overlay__shell,
  .settings-switch__track,
  .settings-switch__thumb {
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   LINGUAGGIO DEL VETRO ESTESO (Fase 2.4.1 — Cantiere 6)

   AI Insight e Settings ora vivono nel Void cinematografico (data-glass-state
   'deep' attivato da syncCockpitFocus). I loro shell diventano cristalli sospesi,
   coerenti con l'Identity Hub e la Costellazione Reborn.

   Differenziazione cromatica per codifica cognitiva:
     • AI Insight → AMETISTA (intuizione, rivelazione predittiva)
     • Settings  → CYAN/SILVER (vetro tecnico, precisione chirurgica)

   Token: --accent-solid (#6d28a8) e --accent-glow esistono gia' come
   "ametista cinematic". Riuso totale.
   ════════════════════════════════════════════════════════════════════════ */

/* z-index sopra Search (11800) NON necessario: AI/Settings non si aprono mai
   contemporaneamente alla Search (mutual exclusion via closeAllSystemOverlays).
   Bumpiamo solo sopra l'Hub (90) → no, stessa logica: mutual exclusion. Restano 80. */

/* ─── Backdrop trasparente per Settings → lascia operare #cockpit-deep-dim ─── */
.settings-overlay .t1-sidebar-overlay__backdrop {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Lo shell base usa overflow:hidden — taglia il ::before zenitale. Apriamolo. */
.settings-overlay .t1-sidebar-overlay__shell {
  overflow: visible;
}

/* ════════════════════════════════════════════════════════════════════════
   SETTINGS · vetro TECNICO (cyan tenue + silver, precisione chirurgica)
   ════════════════════════════════════════════════════════════════════════ */
.settings-overlay .t1-sidebar-overlay__shell.settings-shell,
.settings-overlay .t1-sidebar-overlay__shell {
  width: min(640px, 96vw);
  max-height: min(82vh, 560px);
}

.settings-overlay .t1-sidebar-overlay__shell.t1-panel-3d {
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.06) 0%,
      rgba(10, 14, 22, 0.62) 60%,
      rgba(6, 8, 14, 0.7) 100%);
  border: 1px solid color-mix(in srgb, var(--t1-silver) 25%, rgba(232, 240, 250, 0.12));
  backdrop-filter: blur(26px) saturate(1.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 26px rgba(232, 240, 250, 0.04),
    var(--t1-depth-contact),
    var(--t1-depth-lift),
    0 0 calc(20px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 8%, transparent);
}

/* Edge highlight zenitale per Settings (pearl + cyan tenue) */
.settings-overlay .t1-sidebar-overlay__shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--t1-pearl) 60%, transparent),
    color-mix(in srgb, var(--t1-cyan) 30%, transparent),
    color-mix(in srgb, var(--t1-pearl) 60%, transparent),
    transparent);
  pointer-events: none;
}

/* Glyph header → tecnico, silver/cyan tenue */
.settings-overlay .t1-sidebar-overlay__glyph {
  color: color-mix(in srgb, var(--t1-silver) 70%, var(--t1-pearl));
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.08) 0%,
      rgba(8, 10, 16, 0.7) 100%);
  border-color: color-mix(in srgb, var(--t1-silver) 30%, rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 calc(10px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-cyan) 14%, transparent);
}

.settings-overlay .settings-guide-link {
  color: color-mix(in srgb, var(--t1-cyan) 78%, var(--t1-pearl));
  text-decoration: none;
  font-weight: 500;
}

.settings-overlay .settings-guide-link:hover,
.settings-overlay .settings-guide-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.settings-overlay .t1-sidebar-overlay__head {
  border-bottom-color: rgba(232, 240, 250, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

/* ────────────────────────────────────────────────────────────────────────
   IDENTITY HUB — "Dossier Soggetto" centrale (Fase 2.3)
     Glass card sospesa al centro del cockpit. Coerente con il Linguaggio del
     Vetro: anteprima/lettura. Apre con dimmer DEEP ("The Void"): blur 10 +
     brightness 0.7 sul resto.
     Layout: foto sx (180px) | griglia 2 colonne dati a dx, footer con CTA.
   ──────────────────────────────────────────────────────────────────────── */
.identity-hub-overlay.is-open {
  z-index: 12100;
}

/* L'Hub NON ha bisogno di un backdrop proprio: il vero oscuramento lo fa
   #cockpit-deep-dim (z-index 75, livello document). Senza questa override,
   il backdrop hub (78% nero opaco) coprirebbe il deep-dim e il "Void" non
   opererebbe mai visivamente. Il div resta cliccabile per chiudere l'Hub. */
.identity-hub-overlay .t1-sidebar-overlay__backdrop {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.identity-hub-overlay .identity-hub-shell,
.identity-hub-shell {
  width: min(640px, 96vw);
  max-height: min(85vh, 720px);
  height: fit-content;
  /* Override del look pannello-solido: l'Hub e VETRO (lettura) */
  background:
    linear-gradient(160deg,
      rgba(232, 240, 250, 0.05) 0%,
      rgba(10, 14, 22, 0.7) 45%,
      rgba(6, 8, 14, 0.78) 100%);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 18%, rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 0 calc(48px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 18%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Microaccent perla sul glyph dell'header per dire "identita" senza scrivere */
.identity-hub-head .t1-sidebar-overlay__glyph {
  color: var(--t1-pearl);
  background: color-mix(in srgb, var(--t1-pearl) 12%, rgba(255, 255, 255, 0.02));
  border-color: color-mix(in srgb, var(--t1-pearl) 28%, rgba(255, 255, 255, 0.08));
}

/* Con overflow: visible sul shell, il background del head puo sbordare oltre
   il border-radius arrotondato. Proteggo il top con un radius esplicito che
   matcha il shell (16px). Stessa cosa al footer per il bottom. */
.identity-hub-head {
  border-radius: 16px 16px 0 0;
}

.identity-hub-foot {
  border-radius: 0 0 16px 16px;
}

.identity-hub-hint {
  margin: 0 24px 14px;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.67rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--t1-helm-frost-muted);
}

.identity-hub-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 6px 24px 18px;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  max-height: min(calc(85vh - 132px), 580px);
  scrollbar-width: thin;
  scrollbar-color:
    color-mix(in srgb, var(--t1-pearl) 28%, rgba(255, 255, 255, 0.12))
    color-mix(in srgb, var(--t1-pearl) 6%, rgba(4, 8, 14, 0.45));
}

.identity-hub-body::-webkit-scrollbar {
  width: 8px;
}

.identity-hub-body::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--t1-pearl) 5%, rgba(4, 8, 14, 0.5));
  border-radius: 8px;
  margin: 4px 2px;
}

.identity-hub-body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--t1-pearl) 22%, rgba(255, 255, 255, 0.08)) 0%,
    color-mix(in srgb, var(--t1-pearl) 10%, rgba(8, 12, 20, 0.75)) 100%
  );
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 14%, rgba(255, 255, 255, 0.06));
}

.identity-hub-body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--t1-pearl) 32%, rgba(255, 255, 255, 0.12));
}

/* Foto soggetto · placeholder iniziali + silhouette stilizzata */
.identity-hub-photo {
  position: relative;
  margin: 0;
  width: 180px;
  height: 200px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 38%,
      color-mix(in srgb, var(--t1-pearl) 22%, transparent) 0%,
      rgba(8, 12, 20, 0.7) 60%,
      rgba(4, 6, 12, 0.85) 100%);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 20%, rgba(255, 255, 255, 0.06));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.identity-hub-photo__placeholder {
  position: absolute;
  bottom: 18px;
  color: color-mix(in srgb, var(--t1-pearl) 28%, transparent);
  pointer-events: none;
}

.identity-hub-photo__initials {
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 3.2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--t1-pearl);
  text-shadow:
    0 0 calc(20px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 35%, transparent);
  z-index: 1;
}

.identity-hub-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  min-width: 0;
}

.identity-hub-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.identity-hub-col__title {
  margin: 0;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--t1-pearl) 12%, rgba(255, 255, 255, 0.05));
}

.identity-hub-rows {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.identity-hub-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.identity-hub-row dt {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
}

.identity-hub-row dd {
  margin: 0;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: var(--t1-helm-frost);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Campi con hint P4: ellipsis sul valore interno, dd non clip hint */
.identity-hub-row dd.identity-hub-dd--hintable {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.identity-hub-value-hint-host {
  display: block;
  min-width: 0;
}

.identity-hub-value-hint-host > .identity-hub-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-hub-value-hint-host > .identity-hub-value .identity-hub-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-hub-row:has(.identity-hub-value-hint-host[data-t1-hint]:hover),
.identity-hub-row:has(.identity-hub-value-hint-host[data-t1-hint]:focus-within) {
  position: relative;
  z-index: 3;
}

/* Descrizione dossier — testo intero a capo (no troncamento a una riga) */
.identity-hub-dd--prose,
#identity-hub-obiettivo.identity-hub-dd--prose {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

/* Date e metriche corte: niente clip discendenti (g/y/p). Ellipsis resta su email/descrizione. */
#identity-hub-last,
#identity-hub-count,
#identity-hub-notes,
#identity-hub-snapshots {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* Fase 3.1 — Evoluzione video (details Zen: chiuso di default) */
.identity-hub-evolution {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--t1-pearl) 10%, rgba(255, 255, 255, 0.04));
}

.identity-hub-evolution__summary {
  cursor: pointer;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  list-style: none;
}

.identity-hub-evolution__summary::-webkit-details-marker {
  display: none;
}

.identity-hub-evolution__hint {
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
  opacity: 0.65;
}

.identity-hub-evolution__body {
  margin-top: 10px;
}

.identity-hub-video-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.identity-hub-video-compare__label {
  display: block;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  margin-bottom: 4px;
}

.identity-hub-video-compare__value {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--t1-helm-frost);
  word-break: break-word;
  white-space: normal;
}

.identity-hub-evolution-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.identity-hub-evolution-list__item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  color: var(--t1-helm-frost);
}

.identity-hub-evolution-list__type {
  font-weight: 600;
}

.identity-hub-evolution-list__desc {
  margin-top: 4px;
  opacity: 0.85;
  font-size: 0.68rem;
}

.identity-hub-evolution-list__url {
  margin-top: 4px;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.62rem;
  opacity: 0.75;
  word-break: break-all;
}

.identity-hub-evolution-list__empty {
  padding: 8px;
  font-size: 0.72rem;
  color: var(--t1-helm-frost-muted);
}

.identity-hub-evolution-list__project-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  color: rgba(180, 210, 235, 0.92);
  background: rgba(120, 170, 210, 0.14);
  border: 1px solid rgba(180, 210, 235, 0.18);
  vertical-align: middle;
}

.rail-project-space-cta {
  display: block;
  margin-top: 6px;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(180, 210, 235, 0.85);
  text-decoration: none;
  padding: 4px 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rail-project-space-cta:hover {
  color: rgba(220, 240, 255, 0.95);
  border-color: rgba(94, 231, 223, 0.35);
}

/* Tag profilo · Identity Hub sola lettura (Fase 3.0.2) */
.identity-hub-tags-wrap {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--t1-pearl) 10%, rgba(255, 255, 255, 0.04));
}

.identity-hub-tags-label {
  margin: 0 0 8px;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
}

.identity-hub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.identity-hub-tag-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--t1-hub-tag-accent, var(--cyan-accent)) 45%, var(--btn-border));
  background: color-mix(in srgb, var(--t1-hub-tag-accent, var(--cyan-accent)) 12%, rgba(8, 14, 22, 0.5));
  color: var(--t1-hub-tag-accent, var(--cyan-accent));
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: var(--t1-hub-tag-pill-font-size, 0.58rem);
  font-weight: 500;
  letter-spacing: var(--t1-tag-chip-letter-spacing, 0.03em);
  text-transform: none;
  max-width: 100%;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.identity-hub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 24px 18px;
  border-top: 1px solid color-mix(in srgb, var(--t1-pearl) 10%, rgba(255, 255, 255, 0.04));
}

.identity-hub-foot[data-casting-preview='true'] {
  justify-content: flex-end;
}

.identity-hub-foot__legend {
  margin: 0;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
  opacity: 0.7;
}

/* Matita compile — icona discreta + tooltip vetro (allineata a Galleria showcase). */
.identity-hub-edit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--t1-cyan) 16%, rgba(255, 255, 255, 0.06));
  background: color-mix(in srgb, var(--t1-cyan) 4%, rgba(255, 255, 255, 0.03));
  color: color-mix(in srgb, var(--t1-cyan) 72%, var(--t1-helm-frost));
  cursor: pointer;
  opacity: 0.48;
  box-shadow: none;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.identity-hub-edit:hover,
.identity-hub-edit:focus-visible {
  opacity: 1;
  transform: scale(1.12);
  border-color: color-mix(in srgb, var(--t1-cyan) 42%, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--t1-cyan) 12%, rgba(0, 0, 0, 0.28));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--t1-cyan) 12%, transparent);
}

.identity-hub-edit:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--t1-cyan) 38%, transparent),
    0 4px 14px color-mix(in srgb, var(--t1-cyan) 12%, transparent);
}

.identity-hub-edit__hint {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  left: auto;
  transform: translateY(5px);
  white-space: nowrap;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(248, 252, 255, 0.95);
  background: color-mix(in srgb, rgba(0, 0, 0, 0.72) 100%, transparent);
  border: 1px solid color-mix(in srgb, var(--t1-cyan) 18%, rgba(255, 255, 255, 0.06));
  border-radius: 6px;
  padding: 0.24rem 0.6rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 2;
}

.identity-hub-edit:hover .identity-hub-edit__hint,
.identity-hub-edit:focus-visible .identity-hub-edit__hint {
  opacity: 1;
  transform: translateY(0);
}

.identity-hub-edit__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* CTA Galleria Casting → cockpit operativo (solo con Hub in anteprima) */
.identity-hub-work-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(12, 10, 6, 0.92);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--rating-yellow-solid, #ffc233) 88%, rgba(255, 255, 255, 0.35)) 0%,
    color-mix(in srgb, var(--rating-yellow-solid, #ffc233) 55%, rgba(40, 28, 8, 0.25)) 100%
  );
  border: 1px solid color-mix(in srgb, var(--rating-yellow-solid, #ffc233) 42%, rgba(0, 0, 0, 0.35));
  border-radius: 10px;
  cursor: pointer;
  transition:
    background var(--cockpit-focus-ease),
    border-color var(--cockpit-focus-ease),
    box-shadow var(--cockpit-focus-ease),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.identity-hub-work-profile:hover {
  box-shadow:
    0 0 calc(18px * var(--neon-glow-intensity, 1)) color-mix(in srgb, var(--rating-yellow-solid, #ffc233) 35%, transparent);
}

.identity-hub-work-profile:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .identity-hub-edit,
  .identity-hub-edit__hint {
    transition-duration: 0.01ms !important;
  }
}

/* Dopo tutte le regole `display: inline-flex` sui bottoni Hub: altrimenti [hidden] non nasconde. */
.identity-hub-video-compare[hidden],
.identity-hub-edit[hidden],
.identity-hub-work-profile[hidden],
.identity-hub-watch-casting[hidden],
.identity-hub-foot__legend[hidden] {
  display: none !important;
}

.identity-hub-foot[data-casting-preview='true'] .identity-hub-edit {
  display: none !important;
}

/* ────────────────────────────────────────────────────────────────────────
   COCKPIT DIMMER — "Velo Cinematografico" (Fase 2 + 2.2)
     Quando un pannello sidebar è aperto, workspace e notes-panel "recedono":
     blur + dimming + leggera desaturazione, come depth-of-field in un film.
     Due intensità coordinate:
       • STRONG (data-sidebar-state="open")  → click su tool, drawer o overlay aperti
       • SOFT   (data-glass-state="hover")   → solo hover su Glass card peek
     Esclusioni:
       • body in Zen mode (focus immersivo gestisce già il proprio scuro)
       • papiro clinico aperto (sipario centrale ha il suo velo)
     z-index: 200 — necessario per coprire le note (`.notes-feed-item`) che
     hanno `isolation: isolate` e creerebbero stacking context locali.
   ──────────────────────────────────────────────────────────────────────── */
.workspace::before,
.notes-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  background: rgba(2, 4, 8, 0.18);
  backdrop-filter:
    blur(var(--cockpit-focus-blur))
    brightness(var(--cockpit-focus-brightness))
    saturate(var(--cockpit-focus-saturate));
  -webkit-backdrop-filter:
    blur(var(--cockpit-focus-blur))
    brightness(var(--cockpit-focus-brightness))
    saturate(var(--cockpit-focus-saturate));
  transition: opacity var(--cockpit-focus-ease);
}

/* STRONG — drawer/overlay aperti (azione esplicita) */
body[data-sidebar-state='open']:not(.is-zen) .workspace::before,
body[data-sidebar-state='open']:not(.is-zen) .notes-panel::before {
  opacity: 1;
}

/* Drawer coprente: sipario zen — sfocatura sotto il cristallo (come settings/search). */
body:has(#sidebar.is-open):not(.is-zen) .workspace::before {
  background: rgba(2, 4, 8, 0.32);
  backdrop-filter:
    blur(8px)
    brightness(0.62)
    saturate(0.84);
  -webkit-backdrop-filter:
    blur(8px)
    brightness(0.62)
    saturate(0.84);
}

/* SOFT — solo hover Glass card, nessun overlay strong attivo.
   Stesso pseudo-elemento, intensità ridotta sui filtri: l'utente percepisce
   "il cockpit si fa più discreto" senza venire schiacciato come per un click. */
body[data-glass-state='hover']:not([data-sidebar-state='open']):not(.is-zen) .workspace::before,
body[data-glass-state='hover']:not([data-sidebar-state='open']):not(.is-zen) .notes-panel::before {
  opacity: 1;
  backdrop-filter:
    blur(var(--cockpit-focus-blur-soft))
    brightness(var(--cockpit-focus-brightness-soft))
    saturate(var(--cockpit-focus-saturate-soft));
  -webkit-backdrop-filter:
    blur(var(--cockpit-focus-blur-soft))
    brightness(var(--cockpit-focus-brightness-soft))
    saturate(var(--cockpit-focus-saturate-soft));
}

/* DEEP / "The Void" — vedi #cockpit-deep-dim per la versione promossa a
   overlay reale a livello document. I pseudo locali NON vanno usati per il
   deep: il .notes-panel ha un proprio backdrop-filter che crea uno stacking
   context isolato, impedendo al velo di oscurare davvero le note. */

/* Soppressione se il papiro clinico è aperto: il sipario ha già il suo velo. */
body:has(#holographic-overlay-root.is-clinical-lock) .workspace::before,
body:has(#holographic-overlay-root.is-clinical-lock) .notes-panel::before {
  opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .workspace::before,
  .notes-panel::before {
    transition: none !important;
  }
}

/* ────────────────────────────────────────────────────────────────────────
   DRAWER BACKDROP — sicurezza operativa per drawer Engine/Lab/Vault.
   Invisibile ma cliccabile: replica per il drawer cio che il backdrop modale
   fa gia per AI/Settings/Hub. Click → chiude il drawer.

   Z-index stack (cockpit base):
     • notes-panel "elevato" (drawer aperto): 120
     • DRAWER BACKDROP: 130          ← intercetta click su workspace+note
     • sidebar-drawer.is-open: 140    ← drawer sopra al backdrop, cliccabile
     • COCKPIT DEEP DIM: 75           ← Void layer (sotto t1-sidebar-overlay)
     • t1-sidebar-overlay (AI/Settings): 80
     • identity-hub-overlay: 90
   ──────────────────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: transparent;
  pointer-events: none;
  /* Quando attivo, click intercettato e propagato a SidebarManager.close. */
}

/* Attivo solo quando il drawer e aperto E non c'e un overlay system in primo
   piano (Hub/AI/Settings hanno gia il loro backdrop). La doppia condizione
   con :has evita un'imposizione superflua sul drawer-backdrop quando un
   overlay piu alto e gia in coabitazione (raro, ma possibile in transizioni). */
body:has(#sidebar.is-open):not(:has(.t1-sidebar-overlay.is-open)) .drawer-backdrop {
  pointer-events: auto;
  background: var(--t1-drawer-backdrop, rgba(2, 4, 8, 0.34));
  backdrop-filter: blur(8px) saturate(0.9);
  -webkit-backdrop-filter: blur(8px) saturate(0.9);
  transition: background var(--cockpit-focus-ease), backdrop-filter var(--cockpit-focus-ease);
}

/* Sidebar drawer aperto: z-index esplicito per restare sopra al backdrop. */
.sidebar-drawer.is-open {
  z-index: 140;
}

/* ────────────────────────────────────────────────────────────────────────
   COCKPIT DEEP DIM — "The Void" (Fase 2.3.3 · refinement chirurgico)

   Architettura del Void su due strati che si sommano:

   STRATO 1 · filter diretto sui pannelli (workspace + notes-panel)
     Usato per blur+brightness+saturate. Identico al pattern del Context
     Gateway (vedi righe 417-423 .context-gateway-scroll-lock). NON usiamo
     backdrop-filter sul deep-dim perche, con `body { isolation: isolate }`
     + .notes-panel { backdrop-filter } sibling, due backdrop-filter non si
     compongono come ci si aspetta (no-op silenzioso).
     `filter` agisce sull'elemento stesso prima del compositing: sempre
     visibile, indipendente da stacking context.

   STRATO 2 · #cockpit-deep-dim come velo nero piatto
     Solo background semitrasparente, niente backdrop-filter. Aggiunge la
     tinta di "vacuum" sopra al blur. Z-index 75 per coabitare con la rail
     (200) e stare sotto AI/Settings (80) / Hub (90).
   ──────────────────────────────────────────────────────────────────────── */

/* STRATO 1 · filter diretto sui pannelli (l'effettivo blur+dimming).
   Soppressione automatica in Zen (l'utente vuole il video pulito). */
body[data-glass-state='deep']:not(.is-zen) .workspace,
body[data-glass-state='deep']:not(.is-zen) .notes-panel {
  filter:
    blur(var(--cockpit-focus-blur-deep))
    brightness(var(--cockpit-focus-brightness-deep))
    saturate(var(--cockpit-focus-saturate-deep));
  transition: filter var(--cockpit-focus-ease);
}

/* Filter resettato in chiusura → smooth fade. La stessa transition viene
   ereditata anche quando data-glass-state viene rimosso. */
.workspace,
.notes-panel {
  transition: filter var(--cockpit-focus-ease);
}

/* STRATO 2 · velo "grading temporale" cinematografico (Fase 2.3.4).
   Non un nero piatto: una vignetta radiale al centro + tinta blu-notte ai bordi
   che simula il color-grading "cool" tipico del cinema (Blade Runner 2049,
   thriller psicologici). Il centro mantiene un'apertura piu chiara perche il
   soggetto e li, i bordi vanno in profondita di campo blu/nero. */
.cockpit-deep-dim {
  position: fixed;
  inset: 0;
  z-index: 75;
  pointer-events: none;
  opacity: 0;
  background:
    /* Vignetta radiale: piu morbida al centro (dove c'e l'Hub), piu pesante ai bordi */
    radial-gradient(
      140% 100% at 50% 50%,
      rgba(2, 4, 12, 0.5) 0%,
      rgba(1, 3, 10, 0.78) 100%
    ),
    /* Tinta cinema: sfumatura blu-notte top→bottom, pochissima saturazione */
    linear-gradient(
      180deg,
      rgba(6, 12, 24, 0.18) 0%,
      transparent 35%,
      rgba(2, 6, 16, 0.22) 100%
    );
  transition: opacity var(--cockpit-focus-ease);
}

/* Attivo solo quando l'Identity Hub e aperto. */
body[data-glass-state='deep'] .cockpit-deep-dim {
  opacity: 1;
}

/* Soppressione sipario clinico (coerente con i pseudo locali). */
body:has(#holographic-overlay-root.is-clinical-lock) .cockpit-deep-dim {
  opacity: 0 !important;
}
body:has(#holographic-overlay-root.is-clinical-lock) .workspace,
body:has(#holographic-overlay-root.is-clinical-lock) .notes-panel {
  filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .cockpit-deep-dim,
  .workspace,
  .notes-panel {
    transition-duration: 0.01ms !important;
  }
}

/* ────────────────────────────────────────────────────────────────────────
   IDENTITY HUB — Glass refinement (Fase 2.3.2 · refinement chirurgico)

   Bug fix applicati rispetto a 2.3.1:
     • overflow: visible       → la linea zenitale non viene piu tagliata
                                  dai 16px di border-radius del shell padre
     • niente border-image     → border-image ignora border-radius (bordo
                                  rettangolare dentro card arrotondata).
                                  Sostituito con inset box-shadow stratificate
                                  che FOLLOW il border-radius naturalmente.
     • niente mix-blend-mode   → screen su fondo nero ≈ no-op. Sostituito
                                  con normal compositing a opacita visibile.
   ──────────────────────────────────────────────────────────────────────── */
.identity-hub-shell {
  /* Override del overflow: hidden ereditato da .t1-sidebar-overlay__shell.
     Necessario affinche il ::before (linea zenitale top:-0.5px) sia visibile.
     I children non sbordano: hanno solo padding + separator linee, niente
     fill esteso fino agli angoli. */
  overflow: visible;
  /* Mantengo affumicato (privacy soggetto) ma alzo leggermente la rifrazione. */
  backdrop-filter: blur(26px) saturate(1.22);
  -webkit-backdrop-filter: blur(26px) saturate(1.22);
  /* Border base sottilissimo perla (segue il radius perche e un border vero). */
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 22%, rgba(255, 255, 255, 0.08));
  /* Box-shadow stratificate che simulano insieme:
       1. drop shadow esterna (separazione dal fondo)
       2. neon glow esterno (alone perla)
       3. lama di luce zenitale interna (gradient bordo top)
       4. inset glow caldo (profondita pareti)
       5. base interna leggera (peso visivo verso il basso)
     Tutte le inset SEGUONO il border-radius del shell — bordo "vivo" curvo. */
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.62),
    0 0 calc(56px * var(--neon-glow-intensity)) color-mix(in srgb, var(--t1-pearl) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 36px color-mix(in srgb, var(--t1-pearl) 12%, transparent),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

/* Edge highlight zenitale · linea di luce 1px sul bordo superiore.
   Posizionata a top: -0.5px per sedersi proprio sull'edge esterno della card,
   visibile grazie a overflow: visible. Lunga (margini 6%) e leggermente
   sfumata: simula la luce zenitale che taglia il cristallo. */
.identity-hub-shell::before {
  content: '';
  position: absolute;
  top: -0.5px;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--t1-pearl) 75%, rgba(255, 255, 255, 0.55)) 50%,
    transparent 100%
  );
  border-radius: 1px;
  filter: blur(0.4px);
  pointer-events: none;
  z-index: 2;
}

/* Specular highlight diffuso in alto a sinistra · effetto "riflesso ambientale".
   Senza mix-blend-mode (era no-op su fondo nero). Opacita perla alzata a 14%
   per essere visibile in normal compositing. */
.identity-hub-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 70% at 22% 0%,
    color-mix(in srgb, var(--t1-pearl) 14%, transparent) 0%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 1;
}

/* Children dell'hub sopra il ::after specular (z-index 1) e ::before zenith (2) */
.identity-hub-shell > * {
  position: relative;
  z-index: 3;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Fase 3.0.2 — Tag profilo / sessione (picker + popover)
   Coerenza visiva con .enhancer-chip (Video Enhancer 3.0.1)
   ═══════════════════════════════════════════════════════════════════════════ */
.t1-tag-section {
  margin: 10px 0 14px;
  padding: 10px 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gateway-card-border);
  background: color-mix(in srgb, var(--panel-bg) 88%, transparent);
}

.t1-tag-section > .field-label {
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.62rem;
  color: var(--t1-helm-frost-muted, var(--text-dim));
}

.t1-tag-picker-label {
  margin: 8px 0 4px;
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted);
}

.t1-tag-section-hint {
  margin: 10px 0 0;
  font-size: 0.56rem;
  line-height: 1.35;
  color: var(--t1-helm-frost-muted);
}

.t1-tag-picker {
  margin-bottom: 10px;
}

.t1-tag-picker:last-child {
  margin-bottom: 0;
}

.t1-tag-picker-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.t1-tag-picker-empty {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  font-family: 'Inter', var(--t1-font-ui, system-ui, sans-serif);
  font-size: 0.58rem;
  line-height: 1.4;
  color: var(--t1-helm-frost-muted);
}

.t1-tag-chip {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--btn-border);
  background: var(--panel-bg);
  color: var(--text-dim);
  font-family: var(--font-tech);
  font-size: var(--t1-tag-chip-font-size, 0.6rem);
  letter-spacing: var(--t1-tag-chip-letter-spacing, 0.03em);
  text-transform: none;
  line-height: 1.25;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.t1-tag-chip:hover {
  border-color: var(--t1-tag-chip-accent, var(--cyan-accent));
  color: var(--t1-tag-chip-accent, var(--cyan-accent));
  background: rgba(0, 229, 255, 0.06);
}

.t1-tag-chip.is-active {
  border-color: var(--t1-tag-chip-accent, var(--cyan-accent));
  color: var(--t1-tag-chip-accent, var(--cyan-accent));
  background: rgba(0, 229, 255, 0.1);
}

.t1-session-tag-popover {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 12000;
  min-width: min(360px, calc(100vw - 32px));
  padding: 16px 18px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gateway-card-border);
  background: color-mix(in srgb, var(--panel-bg) 94%, rgba(0, 0, 0, 0.35));
  box-shadow: var(--geo-plate-drop);
  backdrop-filter: blur(var(--geo-panel-blur));
}

.t1-session-tag-popover[hidden] {
  display: none !important;
}

.t1-popover-title {
  margin: 0 0 10px;
  font-family: var(--font-tech);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t1-helm-frost-muted, var(--text-dim));
}

.t1-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.t1-btn-ghost,
.t1-btn-primary {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--btn-border);
  background: transparent;
  color: var(--text-dim);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.t1-btn-ghost:hover {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
}

.t1-btn-primary {
  border-color: color-mix(in srgb, var(--cyan-accent) 55%, transparent);
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan-accent);
}

.t1-btn-primary:hover {
  background: rgba(0, 229, 255, 0.2);
}

/* ────────────────────────────────────────────────────────────────────────
   LUCE TRANSPORT BTN + POPUP (Fase 3.1.8)
   Icona nel chrome nero che apre un mini-pannello con gli slider.
   z-index: 25 → sopra drawing canvas (~18), sotto overlay sistema (150+).
   ──────────────────────────────────────────────────────────────────────── */
.cockpit-luce-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--t1-helm-frost-muted);
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
  flex-shrink: 0;
}

.cockpit-luce-btn:hover,
.cockpit-luce-btn.is-active {
  color: var(--t1-pearl);
  border-color: color-mix(in srgb, var(--t1-pearl) 24%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--t1-pearl) 8%, rgba(8,12,20,0.5));
}

.cockpit-luce-btn.is-active {
  color: var(--cyan-accent);
  border-color: color-mix(in srgb, var(--cyan-accent) 30%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--cyan-accent) 10%, rgba(8,14,22,0.6));
}

body.is-zen .cockpit-luce-btn { display: none !important; }

/* Popup galleggiante — inside cockpit-zone--system (position:relative) */
.cockpit-zone--system {
  position: relative;
}

.luce-popup {
  position: absolute;
  bottom: calc(100% + 8px); /* sopra il transport chrome */
  right: 0;                 /* allineato al bordo destro della system-zone */
  width: 240px;
  z-index: 25;
  background:
    linear-gradient(160deg,
      rgba(6, 8, 16, 0.97) 0%,
      rgba(2, 4, 10, 0.99) 100%);
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 32%, rgba(255,255,255,0.14));
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  isolation: isolate;
}

.luce-popup[hidden] { display: none !important; }

.luce-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.luce-popup__title {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t1-helm-frost, rgba(232, 238, 248, 0.92));
}

.luce-popup__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: color-mix(in srgb, var(--t1-helm-frost, #e8eef8) 72%, transparent);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease;
}

.luce-popup__close:hover { color: var(--t1-helm-frost, #f4f7fc); }

/* Presets inline compatti */
.luce-popup__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.luce-popup .enhancer-chip {
  padding: 3px 8px;
  font-size: 0.55rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--t1-pearl) 28%, rgba(255,255,255,0.12));
  background: rgba(255,255,255,0.08);
  color: color-mix(in srgb, var(--t1-helm-frost, #e8eef8) 78%, transparent);
  cursor: pointer;
  transition: border-color 140ms, color 140ms, background 140ms;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-tech, var(--font-mono, monospace));
}

.luce-popup .enhancer-chip:hover,
.luce-popup .enhancer-chip.is-active {
  border-color: color-mix(in srgb, var(--cyan-accent) 40%, transparent);
  color: var(--cyan-accent);
  background: color-mix(in srgb, var(--cyan-accent) 8%, rgba(8,14,22,0.5));
}

.luce-popup .enhancer-slider-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  align-items: center;
  gap: 8px;
}

.luce-popup .enhancer-label {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--t1-helm-frost, #e8eef8) 82%, transparent);
}

.luce-popup .enhancer-value {
  font-family: var(--font-tech, var(--font-mono, monospace));
  font-size: 0.54rem;
  color: color-mix(in srgb, var(--t1-helm-frost, #e8eef8) 88%, transparent);
  text-align: right;
}

.luce-popup .enhancer-slider {
  width: 100%;
  accent-color: var(--cyan-accent);
  cursor: pointer;
}

.luce-popup .enhancer-yt-guard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 8px 0;
  color: color-mix(in srgb, var(--t1-helm-frost, #e8eef8) 75%, transparent);
}

.luce-popup .enhancer-yt-guard__msg {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--t1-helm-frost, #e8eef8) 80%, transparent);
}

/* ────────────────────────────────────────────────────────────────────────
   IDENTITY HUB — TAG SOTTO FOTO (Fase 3.1.8)
   ──────────────────────────────────────────────────────────────────────── */
.identity-hub-photo-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 180px;
  align-self: start;
}

/* Tag nella colonna foto: più piccoli e desaturati rispetto al drawer */
.identity-hub-tags-wrap--under-photo {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.identity-hub-tags-wrap--under-photo .identity-hub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.identity-hub-tags-wrap--under-photo .identity-hub-tag-pill {
  font-size: var(--t1-hub-tag-pill-font-size-compact, 0.54rem);
  padding: 3px 7px;
  opacity: 0.72;
  color: color-mix(in srgb, var(--t1-hub-tag-accent, var(--cyan-accent)) 55%, var(--t1-helm-frost-muted));
  border-color: color-mix(in srgb, var(--t1-hub-tag-accent, var(--cyan-accent)) 22%, rgba(255,255,255,0.06));
  background: color-mix(in srgb, var(--t1-hub-tag-accent, var(--cyan-accent)) 5%, rgba(8,14,22,0.35));
}

/* Footer: spinge il pulsante Modifica verso il basso */
.identity-hub-foot {
  margin-top: auto;
}

/* VIS-X-ERG — Release 1.0 §4.8 cursori cockpit */
.cockpit-app .cockpit-shell {
  cursor: default;
}

.cockpit-app button:not(:disabled),
.cockpit-app .rail-icon-btn,
.cockpit-app .t1-sidebar-overlay__close,
.cockpit-app .context-gateway-fly-close,
.cockpit-app a.context-gateway-card-link,
.cockpit-app .cockpit-progress-wrap,
.cockpit-app .cockpit-progress {
  cursor: pointer;
}
