body {
	background-color: #fdf6e3;
	font-family: 'Montserrat';
}

/* Sovrascrivi stili Tailwind prose per uniformare con sidebar */
#contenuto-nota.prose {
	font-family: 'Montserrat', sans-serif;
	font-size: 1em;
	line-height: 1.6;
}

#contenuto-nota.prose p,
#contenuto-nota.prose div {
	font-family: inherit;
	line-height: inherit;
}

/* Stili per l'anteprima al passaggio del mouse */
.nota {
	position: relative;
}

.nota .preview-content {
	max-width: 600px;
	background-color: white;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	z-index: 20;
	transition: opacity 0.2s ease;
}

/* Stili per la paginazione */
.pagination-container {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.25rem;
	margin: 1.5rem 0;
}

.pagination-button {
	padding: 0.5rem 1rem;
	border: 1px solid #e5e7eb;
	border-radius: 0.375rem;
	background-color: white;
	color: #374151;
	transition: all 0.2s ease;
}

.pagination-button:hover {
	background-color: #f3f4f6;
}

.pagination-button.active {
	background-color: #3b82f6;
	color: white;
	border-color: #3b82f6;
}
.preferito-attivo {
	background-color: #fef08a; /* giallo chiaro */
	font-weight: 600;          /* semi-bold */
	color: #1f2937;            /* grigio scuro / nero */
	border-radius: 0.25rem;
	padding: 0 0.25rem;
}
#contenuto-nota{
	background-color: #fdf6e3;
	padding: 1em;
}
#contenuto-nota.griglia-stesura-a{ position: relative; }
#contenuto-nota.griglia-stesura-a::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.12) 0, rgba(0,0,0,0.12) 2px, transparent 1px, transparent 100px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.12) 0, rgba(0,0,0,0.12) 2px, transparent 1px, transparent 100px);
}
.tabella-stesure th {
	background-color: #dbeafe;
	color: #1e3a8a;
	padding: 0.5rem 1rem;
	border: 1px solid #bfdbfe;
  }
  
  .tabella-stesure td {
	padding: 0.5rem 1rem; 
	border: 1px solid #bfdbfe;
	background-color: #eff6ff;
  }

  /* Scrollbar e stili per le sezioni note */
  #note-75, #note-cartacea, #note-nazionale {
    scrollbar-width: thin;
    scrollbar-color: #facc15 transparent;
  }
  #note-75::-webkit-scrollbar,
  #note-cartacea::-webkit-scrollbar,
  #note-nazionale::-webkit-scrollbar {
    width: 6px;
  }
  #note-75::-webkit-scrollbar-thumb,
  #note-cartacea::-webkit-scrollbar-thumb,
  #note-nazionale::-webkit-scrollbar-thumb {
    background-color: #facc15;
    border-radius: 4px;
  }
  #note-75::-webkit-scrollbar-track,
  #note-cartacea::-webkit-scrollbar-track,
  #note-nazionale::-webkit-scrollbar-track {
    background: transparent;
  }

  .arrow-marker {
    transition: transform 0.3s ease;
  }
  .nota:hover .arrow-marker {
    transform: translateX(6px);
  }
  .active-container {
    background-color: #fef9c3;
    border: 2px solid #facc15;
  }
  
  /* Link Leggi più visibile su sfondo giallo */
  .bg-yellow-300 .leggi-link {
    color: #1e40af !important;
    font-weight: 600;
  }
  
  /* Allinea Leggi a destra quando badge ordinamento è nascosto */
  .nota .text-sm:has(.ordina.hidden) {
    justify-content: flex-end !important;
  }

  .dot-bounce {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: flex-end;
    height: 20px;
  }
  .dot-bounce .dot {
    width: 10px;
    height: 10px;
    background-color: #facc15;
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
  }
  .dot-bounce .dot:nth-child(1) { animation-delay: 0s; }
  .dot-bounce .dot:nth-child(2) { animation-delay: 0.1s; }
  .dot-bounce .dot:nth-child(3) { animation-delay: 0.2s; }
  .dot-bounce .dot:nth-child(4) { animation-delay: 0.3s; }
  .dot-bounce .dot:nth-child(5) { animation-delay: 0.4s; }
  @keyframes bounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-10px); opacity: 1; }
  }


  /* gestione rotazione mobile */
  #rotate-device-overlay {
    display: none;
  }

  #rotate-device-overlay.active {
    display: block;
  }

  #rotate-device-overlay > div {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    color: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 9999;
    padding: 2rem;
    font-size: 1.2rem;
  }

  .rotate-icon {
    animation: rotateHint 2.5s infinite;
    transform-origin: center center;
    display: inline-block;
  }

  @keyframes rotateHint {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(15deg); }
    50%  { transform: rotate(90deg); }
    75%  { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
  }

  /* preferiti */

  .cartella-voce.drag-hover {
    background-color: #ffeaa7;
    border-left: 4px solid #fdcb6e;
    transition: background-color 0.2s ease;
  }
  .elimina-cartella {
    background: none;
    border: none;
    color: #c0392b;
    margin-left: 8px;
    cursor: pointer;
    font-size: 14px;
  }
  .elimina-cartella:hover {
    color: #e74c3c;
  }

  .cartella-label {
    display: inline-block;
    width: 80%;
  }

  .sortable-ghost {
    opacity: 0.5;
    background-color: #f1c40f;
  }

  .drag-hover {
    background-color: #ffeaa7;
    border-left: 4px solid #fdcb6e;
  }

  .cartella-voce.active {
    background-color: #dfe6e9;
    font-weight: bold;
    border-left: 4px solid #0984e3;
  }


  /* Contenitore generale */
#sidebar-preferiti {
  font-size: 0.95rem;
}

/* Ogni gruppo cartella */
.gruppo-cartella {
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  background-color: white;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.gruppo-cartella:hover {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Header cartella */
.cartella-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  color: #374151; /* gray-700 */
  padding: 0.5rem 0.75rem;
  width: 100%;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6; /* gray-100 */
  transition: background-color 0.2s ease;
}
.cartella-header:hover {
  background-color: #fefce8; /* yellow-50 */
}

/* Icona chevron con transizione rotazione */
.icon-folder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

/* Applica rotazione al contenitore dell'icona per evitare conflitti con lucide.createIcons() */
.gruppo-cartella.open .icon-folder,
.gruppo-cartella.open .icon-folder svg,
.gruppo-cartella.open .icon-folder i {
  transform: rotate(90deg);
  transition: transform 0.3s ease-in-out;
}


/* Cartelle vuote con stile visivo più chiaro */
.gruppo-cartella.vuota .cartella-header {
  opacity: 0.6;
  font-style: italic;
}

/* Badge conteggio note */
.cartella-header .text-xs {
  /* background-color: #fef3c7;
  color: #92400e; */
  font-weight: 600;
  border-radius: 9999px;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
}

/* Nota attiva con più evidenza */
.note-cartella a.font-bold.text-yellow-800 {
  background-color: #fde68a;
  border: 1px solid #facc15;
  color: #78350f;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  display: inline-block;
}

/* Focus visibile accessibile */
.cartella-header:focus-visible {
  outline: 2px solid #facc15;
  outline-offset: 2px;
}

/* Espansione più fluida con transizione */
.note-cartella {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
  padding-top: 0;
  padding-bottom: 0;
}

.note-cartella.expanded {
  max-height: 2000px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Stili per mark class="line" con simbolo a lato */
.mark_line_container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
   
    
    
    align-items: center; /* Torna a center per allineamento generale */
    justify-content: space-between;
    min-height: 1.5em; /* Aumenta leggermente l'altezza minima */
}
 /* Sovrascrivi la regola inline-block per i nostri container */
    #contenuto-nota .mark_line_container {
        display: flex !important;
    }
.mark_line {
    border-right: 2px solid black;   
    padding-right: 5px;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 60px);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4; /* Line height normale per il testo */
}

.mark_symbol_note {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-shrink: 0;
    width: 50px;
    white-space: nowrap;
    height: 100%; /* Occupa tutta l'altezza del container */
}

.mark_symbol {
    color: black;
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1;
    display: flex;
    align-items: center; /* Centra il simbolo nel suo contenitore */
}

.apice {
    font-size: 0.7em;
    line-height: 1;
    display: flex;
    align-items: center; /* Centra anche il numero */
}

/* Stili per mark class="text" con commento a lato */
.mark_text_container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.mark_text_content {
    /* Nessuna evidenziazione, testo normale */
    flex: 1;
    min-width: 0; /* Permette al testo di ridursi se necessario */
}

.mark_text_comment {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 2px 5px;
    font-size: 0.9em;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0; /* Il commento non si riduce */
}

/* Rimuoviamo le regole complicate per mark_text_container */
#contenuto-nota .mark_text_container {
    display: flex !important;
    align-items: baseline;
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 1.2em;
}
.line-through { text-decoration: line-through; color: #666; }
.del { background-color: #ffebee; color: #c62828; text-decoration: line-through; padding: 0 2px; border-radius: 2px; }
.emp { font-style: italic; }
.integrazione { font-style: italic; color: #4b5563; }
/* .h_3 { font-size: 1.2em; font-weight: bold; margin: 0.8em 0 0.4em; color: #2e7d32; border-bottom: 1px solid #e8f5e8; padding-bottom: 0.2em; } */
.tratto { position: relative; display: block; width: 100%; height: 50%; border-top: 2px solid #333; margin: 0.5em 0; cursor: help; }
.tratto:hover::after { content: 'riga bianca con tratto di penna'; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: inline-block; box-sizing: border-box; background: #fff; color: #111; padding: 4px 10px; font-size: 0.8em; line-height: 1.2; border: 1px solid #d1d5db; border-radius: 8px; white-space: nowrap; z-index: 1000; box-shadow: 0 2px 6px rgba(0,0,0,0.1); pointer-events: none; }
.tratto:hover::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #fff; filter: drop-shadow(0 -1px 0 #d1d5db); z-index: 1001; }
.accapo { position: relative; height: 1.2em; display: block; cursor: help; }
.accapo:hover::after { content: 'pagina/pagine bianche'; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: inline-block; box-sizing: border-box; background: #fff; color: #111; padding: 4px 10px; font-size: 0.8em; line-height: 1.2; border: 1px solid #d1d5db; border-radius: 8px; white-space: nowrap; z-index: 1000; box-shadow: 0 2px 6px rgba(0,0,0,0.1); pointer-events: none; }
.accapo:hover::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #fff; filter: drop-shadow(0 -1px 0 #d1d5db); z-index: 1001; }
.new_page { 
  display: inline-block; 
  padding: 2px 6px;  
  font-size: 0.85em; 
  color: #374151; 
}
 #contenuto-nota div {
    display: inline-block;
  }
  #contenuto-nota .new_page {
    display: block; /* o block, come preferisci */
    text-align: right;
    padding: 0.2em 0.5em;
    margin: 0.2em;
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    /*background-color: #fceabb;/* /* sfondo evidenziatore */
    border-bottom: 1px solid #333; /* bordo giallo */
    
  }
/* .tabella { border-collapse: collapse; margin: 1em 0; width: 100%; border: 1px solid #ddd; } */
/* .cella { padding: 0.5em; border: 1px solid #ddd; vertical-align: top; } */

.box { background-color: #e8f5e8; border: 1px solid #4caf50; border-radius: 4px; padding: 0.3em 0.5em; margin: 0.2em 0; display: inline-block; }

/* Titoli colonne: altezza uniforme per evitare disallineamenti su schermi stretti */
.col-title { display: flex; align-items: center; min-height: 3.2em; }
@media (max-width: 768px) {
  .col-title { min-height: 3.2em; }
}

/* Inserzioni <add>: testo rialzato in interlinea, senza colore */
.add_block { position: relative; display: inline-flex; align-items: baseline; vertical-align: baseline; font-size: 0.85em; line-height: 1.1; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: 2px 6px; margin-right: 0.25em; margin-left: 0.4em; box-shadow: 0 1px 4px rgba(0,0,0,0.08); white-space: normal; z-index: 1; }
.add_block::after { content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 6px solid #fff; z-index: 2; }
.add_block::before { content: ''; position: absolute; left: -7px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 7px solid #d1d5db; z-index: 1; }
.add_text { display: inline; white-space: normal; max-width: 100%; overflow-wrap: break-word; word-break: normal; margin-left: 0.2em; }
.alternativa { color: #666; font-style: italic; background-color: #f5f5f5; padding: 0 0.3em; border-radius: 2px; display: inline; }
.commento { color: #555; font-size: 0.9em; margin-top: 0.3em; line-height: 1.4; }
.icon-stesura { display: inline-block; height: 36px; width: auto; margin-left: 8px; vertical-align: middle; opacity: 0.95; }
.no-wrap { white-space: nowrap; }
.puntini { position: relative; display: block; width: 100%; border-bottom: 2px dotted #6b7280; height: 0; line-height: 0; margin: 0.6em 0; padding: 6px 0; cursor: help; }
.puntini:hover::after { content: 'riga/righe bianche'; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: inline-block; box-sizing: border-box; background: #fff; color: #111; padding: 4px 10px; font-size: 0.8em; line-height: 1.2; border: 1px solid #d1d5db; border-radius: 8px; white-space: nowrap; z-index: 1000; box-shadow: 0 2px 6px rgba(0,0,0,0.1); pointer-events: none; }
.puntini:hover::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #fff; filter: drop-shadow(0 -1px 0 #d1d5db); z-index: 1001; }
/* Badge "alt" visibile */
.alt_badge {
    display: inline-block;
    font-size: 0.75em;
    line-height: 1;
    font-weight: 600;
    color: #6b4f00;
    background: #ffe9a6;
    border: 1px solid #c49a00;
    border-radius: 3px;
    padding: 0 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.alt_block { display: inline-grid !important; grid-template-rows: auto auto; align-items: start; row-gap: 0; line-height: 1.05; vertical-align: middle; font-size: 0.8em; transform: translateY(-0.3em); }
.alt_variant { display: block !important; line-height: 1.12; }
.alt_original { display: block !important; line-height: 1.0; margin-top: -1px; font-size: 0.95em; color: #666; }
.alt_sub{ text-decoration: none; }
.mark_line_container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
   
    
    
    align-items: center; /* Torna a center per allineamento generale */
    justify-content: space-between;
    min-height: 1.5em; /* Aumenta leggermente l'altezza minima */
}
 /* Sovrascrivi la regola inline-block per i nostri container */
    #contenuto-nota .mark_line_container {
        display: flex !important;
    }
.mark_line {
    border-right: 2px solid black;   
    padding-right: 5px;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 60px);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4; /* Line height normale per il testo */
}

.mark_symbol_note {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-shrink: 0;
    width: 50px;
    white-space: nowrap;
    height: 100%; /* Occupa tutta l'altezza del container */
}

.mark_symbol {
    color: black;
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1;
    display: flex;
    align-items: center; /* Centra il simbolo nel suo contenitore */
}

.apice {
    font-size: 0.7em;
    line-height: 1;
    display: flex;
    align-items: center; /* Centra anche il numero */
}

/* Stili per mark class="text" con commento a lato */
.mark_text_container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.mark_text_content {
    /* Nessuna evidenziazione, testo normale */
    flex: 1;
    min-width: 0; /* Permette al testo di ridursi se necessario */
}

.mark_text_comment {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 2px 5px;
    font-size: 0.9em;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0; /* Il commento non si riduce */
}

/* Rimuoviamo le regole complicate per mark_text_container */
#contenuto-nota .mark_text_container {
    display: flex !important;
    align-items: baseline;
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 1.2em;
}
.line-through { text-decoration: line-through; color: #666; }
.del { background-color: #ffebee; color: #c62828; text-decoration: line-through; padding: 0 2px; border-radius: 2px; }
.emp { font-style: italic; font-weight: 600; color: #1565c0; }
.h_3 {
  width: 100%;
  text-align: center;
  font-style: italic; 
  font-size: 1.2em; 
  /* font-weight: bold; 
  margin: 0.8em 0 0.4em; 
  color: #2e7d32; 
  border-bottom: 1px solid #e8f5e8; 
  padding-bottom: 0.2em;  */
}
.tratto { position: relative; display: block; width: 100%; height: 50%; border-top: 2px solid #333; margin: 0.5em 0; cursor: help; }
.tratto:hover::after { content: 'riga bianca con tratto di penna'; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: inline-block; box-sizing: border-box; background: #fff; color: #111; padding: 4px 10px; font-size: 0.8em; line-height: 1.2; border: 1px solid #d1d5db; border-radius: 8px; white-space: nowrap; z-index: 1000; box-shadow: 0 2px 6px rgba(0,0,0,0.1); pointer-events: none; }
.tratto:hover::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #fff; filter: drop-shadow(0 -1px 0 #d1d5db); z-index: 1001; }
.accapo { height: 1.2em; display: block; width: 100%; }
.tabella { border-collapse: collapse; margin: 1em 0; width: 100%; border: 0px solid #ddd; }
.cella { padding: 0.5em; border: 0px solid #ddd; vertical-align: top; }

.box { background-color: #e8f5e8; border: 1px solid #4caf50; border-radius: 4px; padding: 0.3em 0.5em; margin: 0.2em 0; display: inline-block; }

/* Layout a colonne parallele per i commenti */
.parallel-layout {
    display: grid !important;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
}

.main-content {
    grid-column: 1 !important;
    line-height: 1.6;
    position: relative;
}

.notes-sidebar {
    grid-column: 2 !important;
    padding: 0;
    padding-top: 0;
    position: relative;
    font-family: 'Montserrat', sans-serif;
}

.parallel-note {
    margin-bottom: 1.5rem;
    padding: 0;
    padding-top: 0;
    background-color: transparent;
    position: relative;
    margin-left: 0;
    margin-top: 0;
    transform: none;
    width: auto;
    z-index: 1;
}

.parallel-note .note-number {
    font-weight: bold;
    color: #1976d2;
    font-size: 1em;
    margin-bottom: 0.25rem;
    display: block;
}

.parallel-note .note-content {
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.parallel-note:hover {
    background-color: transparent;
    transition: none;
}

.parallel-note.highlighted {
    background-color: transparent;
    box-shadow: none;
}

.footnote-apex {
    color: #1976d2;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted #1976d2;
}

.footnote-apex:hover {
    color: #0d47a1;
    border-bottom-style: solid;
}

/* Responsive: su mobile torna al modale */
@media (max-width: 1024px) {
    .parallel-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .notes-sidebar {
        display: none;
    }
    
    .footnote-content {
        display: block !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: white;
        padding: 2rem;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        max-width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1000;
        border: 1px solid #ddd;
    }
    
    .footnote-content.hidden {
        display: none !important;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .parallel-layout {
        grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
        gap: 1rem;
    }

    .notes-sidebar {
        display: block;
        /* padding: 0.75rem; */
        padding: 0rem;
    }
}

@media (max-width: 768px) {
    .parallel-layout {
        margin: 1rem 0;
    }
    
    .footnote-content {
        padding: 1rem;
        max-width: 95%;
    }
}

/* Curly brace table (caso speciale: graffa con label) */
.curly-brace-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.curly-brace-table td {
    vertical-align: middle;
    padding: 0.5rem 0;
}

.curly-brace-table .brace-content {
    width: 1px;
    white-space: normal;
    padding-right: 0.5rem;
}

.curly-brace-table .brace-symbol {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    font-size: 8rem;
    line-height: 0.9;
    color: #333;
    font-weight: 100;
    font-family: fangsong;
    padding: 0 0.25rem;
}

.curly-brace-table .brace-label {
    width: 1%;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-align: center;
    padding-left: 0.5rem;
}

/* Ridimensiona label su viewport stretti (graffa scala automaticamente con clamp) */
@media (max-width: 900px) {
    .curly-brace-table .brace-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .curly-brace-table .brace-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 400px) {
    .curly-brace-table .brace-label {
        font-size: 0.65rem;
    }
}

/* Grid helpers per #lista-note: replica essenziale di Tailwind */
#lista-note .grid {
  display: grid;
}
#lista-note .grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 768px) {
  #lista-note .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
#lista-note .gap-6 {
  gap: 1.5rem; /* 24px */
}
/* Assicura che ogni colonna non forzi larghezze extra */
#lista-note section {
  width: 100%;
  box-sizing: border-box;
}

/* Griglia stabile per risultati ricerca in 3 colonne — BLOCCO UNICO */

.search-column {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.search-column .nota {
  width: 100%;
  box-sizing: border-box;
}
/* opzionale: stile del titolo di colonna coerente */
.search-column h2 {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #1f2937; /* gray-800 */
  font-size: 1rem;
}
.search-columns {
  display: grid;
  grid-template-columns: 1fr; /* edizione selezionata: 1 colonna (JS usa lista monocolonna) */
  gap: 24px;
}
@media (min-width: 1024px) {
  .search-columns {
    grid-template-columns: repeat(3, 1fr); /* tutte le edizioni: 3 colonne stabili */
  }
}
.search-column {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.search-column .nota {
  width: 100%;
  box-sizing: border-box;
}
.preferito-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  padding: 10px 12px;
  transition: background-color 0.15s ease-in-out;
}
.preferito-card:hover {
  background-color: #f7f7f7; /* grigio chiarissimo */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.preferito-sep {
  border: 0;
  border-top: 1px solid #eaeaea; /* riga sottilissima */
  margin: 12px 0;
}
.cartella-voce {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.cartella-voce:hover {
  background-color: #dbeafe;
  box-shadow: 0 1px 3px rgba(59,130,246,0.1);
}
.cartella-voce.active {
  background-color: #bfdbfe;
  border-color: #93c5fd;
  box-shadow: 0 1px 4px rgba(59,130,246,0.15);
}
.cartella-voce.drag-hover {
  background-color: #f3f3f3;
  border-color: #cfcfcf;
}
.cartella-label {
  font-weight: 500;
  color: #1e40af;
}
.cartella-count {
  background-color: #2563eb;
  color: #fff;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  min-width: 1.5rem;
  text-align: center;
  display: inline-block;
}
.cartella-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cartella-actions .rinomina-cartella,
.cartella-actions .elimina-cartella {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.cartella-actions .rinomina-cartella:hover,
.cartella-actions .elimina-cartella:hover {
  background-color: #efefef;
  color: #222;
}

/* Pulsanti generici */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #f5f5f5;
  color: #222;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.btn:hover {
  background-color: #efefef;
}
.btn-primary {
  background: #1f6feb;
  color: #fff;
  border-color: #1f6feb;
  padding: 6px 12px;
}
.btn-primary:hover {
  background: #185fce;
  border-color: #185fce;
}
.btn-secondary {
  background: #f5f5f5;
  color: #333;
  border-color: #e0e0e0;
  padding: 6px 10px;
}

/* Input testo compatto */
.input-text {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.input-text:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}

/* Riga editor nuova cartella */
.create-folder-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 10px;
}

/* Margini lista cartelle migliorati */
#lista-cartelle {
  margin-top: 8px;
}
.fav-folder-badge {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.85em;
  border-radius: 12px;
  background: #ffffff;
  color: #14532d;
  border: 1px solid rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}

/* Nasconde i numeri delle note a margine e nel testo */
.note-number.hidden {
    display: none !important;
}

.footnote-apex.hidden {
    display: none !important;
}

/* Ancora per le note a margine - non deve occupare spazio */
.note-anchor {
    display: inline;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
}
