/* Bacheca Note v24 — stile indipendente, namespace "nb-" per non collidere con l'app.
   Card con lo stesso linguaggio visivo delle altre card native (bordo
   sottile, angoli arrotondati, ombra leggera) così da sembrare la naturale
   prosecuzione della pagina; righe piatte come le note native; colonne a
   griglia (max 3 per riga) che dividono l'intera larghezza disponibile.
   Solo CSS in questa revisione: nessuna modifica alla logica/markup. */
.nb-root, .nb-root * { box-sizing: border-box; }
.nb-root {
  --nb-ink: #0f172a;
  --nb-body: #1e293b;
  --nb-muted: #64748b;
  --nb-faint: #94a3b8;
  --nb-border: #e2e8f0;
  --nb-border-light: #eef1f6;
  --nb-surface: #ffffff;
  --nb-subtle: #f8fafc;
  --nb-hover: #f1f5f9;
  --nb-accent: #4f46e5;
  --nb-accent-ink: #3730a3;
  --nb-accent-tint: #eef2ff;
  --nb-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --nb-shadow-sm: 0 2px 8px -3px rgba(15, 23, 42, .10);
  --nb-shadow-md: 0 10px 24px -8px rgba(15, 23, 42, .16);
  --nb-shadow-lg: 0 22px 48px -14px rgba(15, 23, 42, .30);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--nb-body);
  -webkit-font-smoothing: antialiased;
  z-index: 45;
}
.nb-root-hidden { display: none; }
.nb-root-modal {
  position: fixed !important;
  inset: 0;
  top: 6vh !important;
  left: 50% !important;
  transform: translateX(-50%);
  width: min(1100px, 94vw) !important;
  max-height: 88vh;
  z-index: 60;
  animation: nb-pop-in .16s ease-out;
}
@keyframes nb-pop-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.99); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.nb-panel {
  background: var(--nb-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: inherit;
  border: 1px solid var(--nb-border);
  border-radius: 14px;
  box-shadow: var(--nb-shadow-xs);
}
.nb-root-modal .nb-panel {
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: var(--nb-shadow-lg);
}

.nb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: var(--nb-surface);
  border-bottom: 1px solid var(--nb-border-light);
}
.nb-panel-title {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -.005em;
  color: var(--nb-ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.nb-badge {
  background: var(--nb-accent-tint);
  color: var(--nb-accent-ink);
  border-radius: 999px;
  padding: 1.5px 9px;
  font-size: 11.5px;
  font-weight: 700;
}
.nb-panel-actions { display: flex; align-items: center; gap: 6px; }

.nb-btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 6.5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.nb-btn:active { transform: scale(.97); }
.nb-btn-ghost { background: var(--nb-surface); border-color: var(--nb-border); color: #334155; }
.nb-btn-ghost:hover { background: var(--nb-subtle); border-color: #cbd5e1; }
.nb-btn-primary { background: var(--nb-accent); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.25); }
.nb-btn-primary:hover { background: #4338ca; }

.nb-icon-btn {
  border: none;
  background: transparent;
  color: var(--nb-muted);
  cursor: pointer;
  border-radius: 8px;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex: none;
  transition: background .12s ease, color .12s ease;
}
.nb-icon-btn:hover { background: var(--nb-accent-tint); color: var(--nb-accent-ink); }
.nb-icon-btn-active { background: var(--nb-accent-tint); color: var(--nb-accent-ink); }
.nb-root :focus-visible { outline: 2px solid #a5b4fc; outline-offset: 1px; }

/* Barra "nuova nota", sempre visibile in cima alla bacheca */
.nb-create {
  padding: 13px 18px;
  background: linear-gradient(180deg, #fffdf5, #fffbeb);
  border-bottom: 1px solid #fde68a;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.nb-cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nb-cat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--nb-border);
  background: var(--nb-surface);
  border-radius: 999px;
  padding: 3.5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--nb-muted);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .08s ease;
}
.nb-cat-chip:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.nb-cat-chip::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nb-c, #94a3b8);
  flex: none;
}
.nb-cat-chip-active { background: var(--nb-ink); border-color: var(--nb-ink); color: #fff; }
.nb-cat-chip-active:hover { transform: none; }
.nb-create-row { display: flex; align-items: center; gap: 8px; }
.nb-create-row input[type="text"] {
  flex: 1;
  border: 1px solid var(--nb-border);
  border-radius: 9px;
  padding: 8.5px 13px;
  font-size: 13px;
  outline: none;
  background: var(--nb-surface);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.nb-create-row input[type="text"]::placeholder { color: var(--nb-faint); }
.nb-create-row input[type="text"]:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }

.nb-settings[hidden] { display: none; }
.nb-settings {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 18px;
  background: var(--nb-subtle);
  border-bottom: 1px solid var(--nb-border-light);
  font-size: 12.5px;
  color: #334155;
  animation: nb-slide-down .14s ease-out;
}
.nb-settings-row { display: flex; align-items: center; gap: 6px; }
.nb-settings-row input[type="checkbox"] { cursor: pointer; accent-color: var(--nb-accent); }
.nb-settings-row input[type="number"] {
  width: 54px;
  border: 1px solid var(--nb-border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12.5px;
  text-align: center;
}
.nb-settings-row input[type="number"]:focus { border-color: var(--nb-accent); outline: none; box-shadow: 0 0 0 3px var(--nb-accent-tint); }

.nb-new-section[hidden] { display: none; }
.nb-new-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: var(--nb-subtle);
  border-bottom: 1px solid var(--nb-border-light);
  flex-wrap: wrap;
  animation: nb-slide-down .14s ease-out;
}
@keyframes nb-slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nb-new-section input[type="text"] {
  flex: 1 1 200px;
  min-width: 160px;
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  padding: 6.5px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.nb-new-section input[type="text"]:focus { border-color: var(--nb-accent); box-shadow: 0 0 0 3px var(--nb-accent-tint); }
.nb-swatches { display: flex; gap: 6px; }
.nb-swatch {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff;
  outline: 1px solid var(--nb-border);
  cursor: pointer; padding: 0;
  flex: none;
  transition: transform .1s ease;
}
.nb-swatch:hover { transform: scale(1.12); }
.nb-swatch-selected { outline: 2px solid var(--nb-ink); }

/* Griglia: le colonne dividono SEMPRE l'intera larghezza disponibile in parti
   uguali, MASSIMO 3 per riga: con più sezioni vanno a capo su una nuova
   riga invece di stringersi all'infinito (vedi i breakpoint responsive più
   sotto per tablet/mobile). */
.nb-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 18px;
  background: var(--nb-subtle);
}
.nb-root-modal .nb-columns { overflow-y: auto; }

.nb-column {
  background: var(--nb-surface);
  border: 1px solid var(--nb-border-light);
  border-radius: 12px;
  overflow: hidden; /* la testata colorata resta dentro gli angoli arrotondati */
  display: flex;
  flex-direction: column;
  min-height: 148px;
  box-shadow: var(--nb-shadow-xs);
  transition: box-shadow .15s ease, border-color .15s ease;
  /* Niente scroll interno: l'altezza cresce con il contenuto */
}
.nb-column:hover { box-shadow: var(--nb-shadow-sm); border-color: var(--nb-border); }

.nb-column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-top: 3px solid var(--nb-c, #94a3b8); /* fascia colorata ben visibile, non solo una tinta leggera */
  background: #f8fafc; /* fallback per browser senza color-mix() */
  background: color-mix(in srgb, var(--nb-c, #94a3b8) 13%, #ffffff);
  border-bottom: 1px solid #e2e8f0;
  border-bottom: 1px solid color-mix(in srgb, var(--nb-c, #94a3b8) 28%, #ffffff);
}
.nb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-c, #94a3b8) 22%, transparent); }
.nb-column-title {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--nb-ink);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.nb-count {
  font-size: 11.5px;
  font-weight: 800;
  color: #334155;
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 2px 9px;
  flex: none;
  min-width: 20px;
  text-align: center;
}
.nb-menu-wrap { position: relative; flex: none; }
.nb-menu {
  display: none;
  position: fixed; /* calcolato via JS: mai tagliato dallo scroll interno delle colonne */
  background: var(--nb-surface);
  border: 1px solid var(--nb-border);
  border-radius: 11px;
  box-shadow: var(--nb-shadow-md);
  padding: 6px;
  min-width: 178px;
  z-index: 65;
}
.nb-menu-open { display: block; animation: nb-menu-in .12s ease-out; }
@keyframes nb-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.nb-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7.5px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: #334155;
  transition: background .1s ease;
}
.nb-menu button:hover { background: var(--nb-hover); }
.nb-menu-danger { color: #dc2626 !important; }
.nb-menu-danger:hover { background: #fef2f2 !important; }
.nb-menu-colors { display: flex; gap: 5px; padding: 6px 8px; flex-wrap: wrap; }
.nb-menu-colors .nb-swatch { width: 17px; height: 17px; }

.nb-dropzone {
  flex: 1;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  min-height: 58px;
  transition: background .15s ease;
}
.nb-dropzone-over { background: var(--nb-accent-tint); outline: 2px dashed #a5b4fc; outline-offset: -3px; border-radius: 8px; }

.nb-empty {
  font-size: 12px;
  color: var(--nb-faint);
  text-align: center;
  padding: 20px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nb-empty::before {
  content: '';
  width: 26px; height: 26px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 7px;
}

/* Riga nota "piatta", coerente con lo stile della lista nativa: pallino + testo */
.nb-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9.5px 10px;
  cursor: grab;
  border-bottom: 1px solid var(--nb-subtle);
  transition: background .12s ease, opacity .15s ease;
}
.nb-card:last-child { border-bottom: none; }
.nb-card:hover { background: var(--nb-subtle); }
.nb-card-flagged { background: #fffbeb; }
.nb-card-flagged:hover { background: #fef3c7; }
.nb-card:active { cursor: grabbing; }
.nb-dragging { opacity: .4; }
.nb-check {
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  flex: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.nb-check:hover { border-color: var(--nb-c, #94a3b8); transform: scale(1.1); }
.nb-check-done {
  background: #16a34a;
  border-color: #16a34a;
}
.nb-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--nb-c, #94a3b8);
  flex: none;
}
.nb-card-done { opacity: .5; }
.nb-card-done .nb-card-text { text-decoration: line-through; }
.nb-card-text {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--nb-body);
  word-break: break-word;
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
}
.nb-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.nb-card-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--nb-faint);
  background: var(--nb-subtle);
  border-radius: 5px;
  padding: 1.5px 5px;
  margin-right: 2px;
  flex: none;
}
.nb-star {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 14.5px;
  line-height: 1;
  color: #dbe1e9;
  flex: none;
  transition: color .12s ease, transform .1s ease;
}
.nb-star:hover { color: #fcd34d; transform: scale(1.15); }
.nb-star-active { color: #d97706; }
.nb-star-active:hover { color: #b45309; }

/* Pulsante flottante (fallback) */
.nb-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--nb-accent, #4f46e5);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 10px 24px -6px rgba(79,70,229,.5);
  cursor: pointer;
  z-index: 55;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nb-fab:hover { transform: scale(1.07); box-shadow: 0 14px 28px -6px rgba(79,70,229,.55); }
.nb-fab-visible { display: flex; animation: nb-pop-in .18s ease-out; }

.nb-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  backdrop-filter: blur(1.5px);
  z-index: 59;
}
.nb-backdrop-show { display: block; }

.nb-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: #1e293b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 500;
  font-family: ui-sans-serif, system-ui, sans-serif;
  box-shadow: var(--nb-shadow-md, 0 10px 24px -8px rgba(15,23,42,.3));
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 70;
}
.nb-toast-show { opacity: 1; transform: translate(-50%, 0); }
.nb-toast-error { background: #b91c1c; }
.nb-toast-info { background: #1e40af; }

@media (max-width: 900px) {
  .nb-columns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  /* Stesso posizionamento assoluto calcolato in JS di desktop: NON usare
     position:static qui, altrimenti il pannello finisce in fondo a tutta la
     pagina (dopo <main>, dove root è stato realmente inserito nel DOM)
     invece che subito sotto le note, lasciando un enorme vuoto. */
  .nb-columns { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
  .nb-create-row { flex-wrap: wrap; }
  .nb-create-row .nb-btn-primary { flex: 1 1 100%; }
}

/* ───────────────────────── v23 ─────────────────────────
   Aggiunte per: area di scrittura persistente (textarea), sezione di
   destinazione, ricerca, modifica inline, menu unico appeso a <body>,
   toast con "Annulla", stato compresso. */

.nb-root-modal .nb-columns { overflow-y: visible; }
.nb-body { display: flex; flex-direction: column; min-height: 0; }
.nb-root-modal .nb-body { overflow-y: auto; }
.nb-root.nb-collapsed .nb-body { display: none; }
.nb-root-inline .nb-only-modal,
.nb-root-modal .nb-only-inline { display: none !important; }

.nb-search input {
  width: 190px;
  border: 1px solid var(--nb-border);
  border-radius: 9px;
  padding: 6px 11px;
  font-size: 12.5px;
  outline: none;
  background: var(--nb-subtle);
  transition: border-color .12s ease, box-shadow .12s ease, width .15s ease, background .12s ease;
}
.nb-search input:focus { width: 240px; background: var(--nb-surface); border-color: var(--nb-accent); box-shadow: 0 0 0 3px var(--nb-accent-tint); }
.nb-filter-info {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nb-accent-ink);
  background: var(--nb-accent-tint);
  border-bottom: 1px solid var(--nb-border-light);
}
.nb-filter-info[hidden] { display: none; }

.nb-create-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nb-target { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--nb-muted); font-weight: 600; }
.nb-target select {
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nb-ink);
  background: var(--nb-surface);
  max-width: 220px;
  cursor: pointer;
}
.nb-create-row { align-items: flex-end; }
.nb-create-row textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--nb-border);
  border-radius: 9px;
  padding: 8.5px 13px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  background: var(--nb-surface);
  max-height: 160px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.nb-create-row textarea::placeholder { color: var(--nb-faint); }
.nb-create-row textarea:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.nb-create-row .nb-icon-btn { height: 36px; width: 36px; }
.nb-create-row .nb-btn-primary { height: 36px; white-space: nowrap; }

.nb-loading { grid-column: 1 / -1; text-align: center; color: var(--nb-faint); font-size: 12.5px; padding: 26px 0; }

.nb-card { align-items: flex-start; }
.nb-card .nb-check, .nb-card .nb-cat-dot { margin-top: 1px; }
.nb-card .nb-cat-dot { margin-top: 6px; }
.nb-card-text { white-space: pre-wrap; cursor: text; }
.nb-card-pending { opacity: .6; }
.nb-card-meta { flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.nb-card-meta .nb-icon-btn { width: 24px; height: 22px; }
.nb-tag, .nb-author {
  font-size: 10px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1.5px 5px;
  flex: none;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-tag { color: #047857; background: #ecfdf5; }
.nb-author { color: #6d28d9; background: #f5f3ff; }
.nb-shared { font-size: 11px; line-height: 1; flex: none; }
.nb-card-editing { background: #fffbeb; cursor: default; }
.nb-edit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.nb-edit textarea {
  width: 100%;
  resize: none;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 6px 9px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.42;
  outline: none;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
  background: #fff;
}
.nb-edit-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nb-edit-actions .nb-btn { padding: 4px 10px; font-size: 12px; }
.nb-hint { font-size: 11px; color: var(--nb-faint); }

.nb-column-head .nb-icon-btn { width: 24px; height: 24px; font-size: 15px; font-weight: 700; }

/* Menu unico appeso a <body> */
.nb-popover {
  --nb-ink: #0f172a; --nb-border: #e2e8f0; --nb-hover: #f1f5f9; --nb-muted: #64748b;
  display: none;
  position: fixed;
  z-index: 75;
  min-width: 210px;
  max-width: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: #fff;
  border: 1px solid var(--nb-border);
  border-radius: 12px;
  box-shadow: 0 14px 32px -10px rgba(15,23,42,.28);
  padding: 6px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12.5px;
  color: #334155;
}
.nb-popover, .nb-popover * { box-sizing: border-box; }
.nb-popover-open { display: block; animation: nb-menu-in .12s ease-out; }
.nb-popover > button, .nb-pop-list > button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7px 9px;
  border-radius: 7px;
  font: inherit;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}
.nb-popover > button:hover:not([disabled]), .nb-pop-list > button:hover:not([disabled]) { background: var(--nb-hover); }
.nb-popover button[disabled] { opacity: .45; cursor: default; }
.nb-pop-list > button.nb-pop-current { opacity: 1; font-weight: 700; color: var(--nb-ink); background: #f8fafc; }
.nb-pop-title { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--nb-ink); padding: 6px 9px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-pop-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; padding: 8px 9px 3px; }
.nb-pop-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 8px 4px; }
.nb-pop-chips .nb-cat-chip { padding: 3px 9px; font-size: 11px; }
.nb-pop-colors { display: flex; gap: 5px; padding: 4px 9px 6px; flex-wrap: wrap; }
.nb-pop-colors .nb-swatch { width: 18px; height: 18px; }
.nb-pop-sep { height: 1px; background: #eef1f6; margin: 5px 4px; }
.nb-pop-danger { color: #dc2626 !important; }
.nb-pop-danger:hover { background: #fef2f2 !important; }
.nb-popover .nb-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* chip e swatch riusati nel popover (fuori da .nb-root) */
.nb-popover .nb-cat-chip { display: flex; align-items: center; gap: 5px; border: 1px solid var(--nb-border); background: #fff; border-radius: 999px; font-weight: 600; color: var(--nb-muted); cursor: pointer; }
.nb-popover .nb-cat-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--nb-c, #94a3b8); flex: none; }
.nb-popover .nb-cat-chip-active { background: var(--nb-ink); border-color: var(--nb-ink); color: #fff; }
.nb-popover .nb-swatch { border-radius: 50%; border: 2px solid #fff; outline: 1px solid var(--nb-border); cursor: pointer; padding: 0; }
.nb-popover .nb-swatch-selected { outline: 2px solid var(--nb-ink); }

/* Toast con azione "Annulla" */
.nb-toast { display: flex; align-items: center; gap: 14px; }
.nb-toast-interactive { pointer-events: auto; }
.nb-toast-action {
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 7px;
  padding: 4px 11px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nb-toast-action:hover { background: rgba(255,255,255,.28); }

@media (max-width: 640px) {
  .nb-panel-head { flex-wrap: wrap; }
  .nb-panel-actions { flex-wrap: wrap; width: 100%; }
  .nb-search { flex: 1 1 100%; order: -1; }
  .nb-search input, .nb-search input:focus { width: 100%; }
  .nb-create-row { flex-wrap: wrap; }
  .nb-create-row textarea { flex: 1 1 100%; }
  .nb-create-row .nb-btn-primary { flex: 1 1 auto; }
  .nb-card-meta { max-width: 40%; }
  .nb-hint { display: none; }
}

/* ───────── v25: promemoria e ripetizione ───────── */
.nb-remind { font-size: 10.5px; font-weight: 700; color: #1d4ed8; background: #eff6ff; border-radius: 5px; padding: 1.5px 5px; flex: none; white-space: nowrap; }
.nb-remind-due { color: #b91c1c; background: #fef2f2; animation: nb-pulse 1.6s ease-in-out 3; }
@keyframes nb-pulse { 50% { box-shadow: 0 0 0 3px rgba(220,38,38,.18); } }
.nb-repeat { font-size: 11px; line-height: 1; flex: none; }
.nb-pop-presets { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 8px 4px; }
.nb-pop-row { display: flex; gap: 6px; padding: 2px 8px 6px; align-items: center; }
.nb-pop-row input[type="datetime-local"] { flex: 1; min-width: 0; border: 1px solid #e2e8f0; border-radius: 7px; padding: 4px 6px; font: inherit; font-size: 12px; color: #0f172a; }
.nb-popover .nb-mini { border: 1px solid #e2e8f0; background: #fff; border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 11.5px; font-weight: 600; color: #334155; cursor: pointer; white-space: nowrap; }
.nb-popover .nb-mini:hover { background: #f1f5f9; }
.nb-popover .nb-mini-primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.nb-popover .nb-mini-primary:hover { background: #4338ca; }
.nb-remind-past { color: #64748b; background: #f1f5f9; }
.nb-popover .nb-pop-ai { color: #6d28d9 !important; font-weight: 600 !important; }

/* ───────── v27: elenco promemoria ───────── */
.nb-remind-btn { display: inline-flex; align-items: center; gap: 5px; }
.nb-remind-btn span { font-weight: 800; }
.nb-remind-btn-due { border-color: #fecaca !important; background: #fef2f2 !important; color: #b91c1c !important; }
.nb-reminders[hidden] { display: none; }
.nb-reminders { padding: 12px 18px 14px; background: #f8fbff; border-bottom: 1px solid var(--nb-border-light); animation: nb-slide-down .14s ease-out; }
.nb-rem-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--nb-ink); margin-bottom: 8px; }
.nb-rem-head span { font-size: 12px; color: var(--nb-muted); }
.nb-rem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; }
.nb-rem-list li { display: flex; align-items: stretch; gap: 6px; }
.nb-rem-list li > button:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--nb-border); background: #fff; border-radius: 9px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--nb-body); }
.nb-rem-list li > button:first-child:hover { border-color: #93c5fd; background: #eff6ff; }
.nb-rem-when { font-weight: 800; color: #1d4ed8; white-space: nowrap; font-size: 12px; min-width: 112px; }
.nb-rem-past .nb-rem-when { color: #b91c1c; }
.nb-rem-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; font-weight: 500; }
.nb-rem-rep { font-size: 11px; color: var(--nb-muted); white-space: nowrap; }
.nb-rem-x { border: 1px solid var(--nb-border); background: #fff; border-radius: 9px; width: 34px; cursor: pointer; color: #16a34a; font-weight: 800; }
.nb-rem-x:hover { background: #f0fdf4; border-color: #86efac; }
.nb-rem-empty, .nb-rem-foot { font-size: 12px; color: var(--nb-muted); margin: 6px 0 0; }
.nb-rem-foot button { border: 0; background: none; color: #1d4ed8; font: inherit; font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }
.nb-card-flash { animation: nb-flash 1.8s ease-out; }
@keyframes nb-flash { 0%, 40% { background: #fef08a; box-shadow: inset 0 0 0 2px #facc15; } 100% { background: transparent; } }
@media (max-width: 640px) { .nb-rem-when { min-width: 0; } .nb-rem-rep { display: none; } }

/* v28 — composer: tab delle sezioni + flag promemoria */
.nb-sec-tabs { gap: 5px; }
.nb-sec-tabs .nb-cat-chip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-sec-tabs .nb-cat-chip-active::before { background: #fff; box-shadow: 0 0 0 2px var(--nb-c, #94a3b8); }
.nb-sec-tabs .nb-sec-add { padding: 3.5px 10px; color: var(--nb-faint); border-style: dashed; }
.nb-sec-tabs .nb-sec-add::before { display: none; }
.nb-rem-flag[aria-pressed="true"] { background: #fef3c7; color: #92400e; box-shadow: inset 0 0 0 1px #f59e0b; }
.nb-create-remind[hidden] { display: none; }
.nb-create-remind {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 10px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffbeb;
  animation: nb-slide-down .14s ease-out;
}
.nb-cr-label { font-size: 12px; font-weight: 700; color: #92400e; }
.nb-create-remind input[type="datetime-local"] {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12.5px; background: #fff;
}
.nb-create-remind input[type="datetime-local"]:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.nb-cr-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.nb-create-remind .nb-mini { border: 1px solid #e2e8f0; background: #fff; border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 11.5px; font-weight: 600; color: #334155; cursor: pointer; white-space: nowrap; }
.nb-create-remind .nb-mini:hover { background: #fef3c7; border-color: #fcd34d; }
.nb-cr-hint { margin-left: auto; font-size: 11px; color: #a16207; }
@media (max-width: 640px) { .nb-cr-hint { display: none; } .nb-create-remind input[type="datetime-local"] { flex: 1; min-width: 0; } }
