a { color: #6e2e38; text-underline-offset: .2em; }
a:focus-visible, textarea:focus-visible { outline: 3px solid #ad7b82; outline-offset: 2px; }
.apri { color: inherit; text-decoration: none; flex-wrap: wrap; }
.apri b { margin-left: auto; color: #6e2e38; text-decoration: underline; font-size: .9rem; }
.apri:hover, .udienze a:hover { background: #f7f2ee; }
.agenda { max-width: 1080px; margin: 36px auto; }
.agenda .box { padding: clamp(16px, 3.5vw, 38px); }
.tools { margin-bottom: 24px; }
.tools nav { font-size: .9rem; }
.tools nav span { margin: 0 5px; color: #666; }
.pannelli { margin-top: 28px; border-top: 1px solid #d7d9ce; padding-top: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.pannello { border: 1px solid #d7d9ce; border-radius: 7px; padding: 18px; }
.pannello h2 { margin: 0 0 16px; font: 600 1.35rem Georgia,serif; }
.testata-agenda { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 16px; }
.testata-agenda h2 { margin: 0; }
.testata-agenda a { font-weight: 600; }
.udienze, .storico ol { list-style: none; padding: 0; margin: 0; }
.udienze li { border-top: 1px solid #dddcd3; }
.udienze a { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; text-decoration: none; padding: 12px 10px; border-left: 3px solid transparent; }
.udienze time { grid-column: 1; font-size: .86rem; color: #535b54; }
.udienze strong { grid-column: 1; font-weight: 600; }
.udienze strong, .sopratitolo { overflow-wrap: anywhere; }
.udienze a span { grid-column: 2; grid-row: 1 / 3; font-size: 1.4rem; }
.udienze a[aria-current] { background: #f5eaeb; border-left-color: #70353e; }
.scelta { color: #555e55; background: #f8f8f3; }
.scelta p { margin: 0; line-height: 1.5; }
.sopratitolo { color: #753744; margin: 0 0 6px; font-weight: 600; font-size: .85rem; }
.data-corrente { color: #535b54; font-size: .9rem; margin: 0 0 18px; }
.data-corrente strong { display: block; margin-top: 4px; color: #242925; }
.campi { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
.campi label, .campi input { min-width: 0; }
.rinvio { display: grid; gap: 14px; }
textarea { display: block; margin-top: 6px; width: 100%; border: 1px solid #adb3a9; padding: 10px; border-radius: 5px; font: inherit; resize: vertical; }
.facoltativa { color: #5c635e; font-weight: normal; }
.azioni { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-end; align-items: center; }
.storico { border-top: 1px solid #d7d9ce; margin-top: 22px; }
.storico h3 { font-size: 1rem; }
.storico .muted, .storico li { font-size: .9rem; }
.storico li { padding: 9px 0; border-bottom: 1px solid #e4e2d8; }
.storico li span, .storico li strong { display: block; }
.storico li p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.ok { border-left: 3px solid #47644c; background: #edf2ea; padding: 10px; }
@media (max-width: 700px) {
    .agenda { margin: 18px auto; }
    .pannelli { grid-template-columns: 1fr; gap: 12px; }
    .agenda h1 { font-size: 1.65rem; }
    .pannello { padding: 14px; }
}
.nav-tabelle { display: flex; gap: 24px; border-top: 1px solid #d7d9ce; padding-top: 14px; }
.voce-tabella, .elenco-tabella { margin-top: 24px; }
.voce-tabella .azioni { flex-wrap: wrap; }
.elenco-tabella table { border-collapse: collapse; width: 100%; text-align: left; font-size: .94rem; }
.elenco-tabella td, .elenco-tabella th { border-bottom: 1px solid #d7d9ce; padding: 10px 6px; overflow-wrap: anywhere; }
.elenco-tabella td:last-child a { display: inline-block; margin-right: 8px; }
.nav-tabelle { flex-wrap: wrap; gap: 10px 24px; }
.voce-tabella select { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #adb3a9; border-radius: 5px; background: white; font: inherit; color: inherit; }
.campione { display: inline-block; width: .85em; height: .85em; margin-right: .4em; border: 1px solid #94938b; }
.colore-0 { background: #fff; } .colore-1 { background: #ff0000; } .colore-2 { background: #ffff00; }
.colore-3 { background: #a4bdfc; } .colore-4 { background: #339966; } .colore-5 { background: #5484ed; }
.colore-6 { background: #46d6db; } .colore-7 { background: #7ae7bf; } .colore-8 { background: #ffb878; }
.colore-9 { background: #ff887c; } .colore-11 { background: #dbadff; } .colore-12 { background: #e1e1e1; }
.apri-zoom { justify-self: start; }
#zoom-note { width: min(42rem, 94vw); max-height: 92vh; padding: clamp(14px, 4vw, 30px); border: 1px solid #c6c7bd; border-radius: 8px; background: #fffefa; color: inherit; }
#zoom-note::backdrop { background: rgb(32 28 28 / 55%); }
#zoom-note h2 { margin: 0; font: 600 1.6rem Georgia, serif; }
#zoom-note .azioni { margin-top: 16px; flex-wrap: wrap; }
.descrizione-nota { white-space: pre-line; overflow-wrap: anywhere; }
#report-nota { display: none; }
@media print {
    body:has(#zoom-note[open]) { background: white; color: black; }
    body:has(#zoom-note[open]) header, body:has(#zoom-note[open]) main .contenuto-scheda > :not(#report-nota),
    #zoom-note[open], #zoom-note::backdrop { display: none; }
    body:has(#zoom-note[open]) main, body:has(#zoom-note[open]) main .box { display: block; margin: 0; padding: 0; border: 0; background: white; max-width: none; }
    body:has(#zoom-note[open]) #report-nota { display: block; width: 15.59cm; max-width: 100%; margin: 0 auto; font-family: Arial, sans-serif; }
    #report-nota h1 { white-space: pre-line; overflow-wrap: anywhere; font: bold 12pt Arial, sans-serif; }
    #report-nota time { display: block; margin: 3mm 0 2mm; padding-bottom: 1mm; border-bottom: .3mm solid black; font-size: 10pt; }
    #report-nota pre { margin: 1mm; white-space: pre-wrap; overflow-wrap: anywhere; font: 10pt/1.3 "Courier New", monospace; }
}
.filtri-contatto { display:flex; flex-wrap:wrap; gap:.75rem; align-items:end; margin:1.35rem 0; }
.filtri-contatto > label, .filtri-contatto > div { min-width:0; max-width:100%; }
.filtri-contatto.ricerca-breve { display:grid; grid-template-columns:minmax(0,34rem) max-content; justify-content:start; }
.filtri-contatto.con-selettore { grid-template-columns:minmax(9rem,14rem) minmax(11rem,32rem) max-content; }
.ricerca-breve > a, .ricerca-breve > details { grid-column:1/-1; justify-self:start; }
.comandi-ricerca { display:flex; gap:.55rem; align-items:center; }
.icona-info { flex:none; width:1.75rem; height:1.75rem; padding:0; border-radius:50%; background:#eef5f5; color:#284e52; border:1px solid #638185; font:bold 1.05rem Georgia,serif; }
.icona-info:hover { background:#daebeb; }
#guida-ricerca { width:min(23rem,calc(100vw - 2rem)); padding:1.25rem; color:#242925; background:#fffefa; border:1px solid #adb3a9; border-radius:.55rem; box-shadow:0 .35rem 1.4rem #302b2d30; }
#guida-ricerca h2 { margin:0; }
#guida-ricerca p { margin:.65rem 0 1rem; line-height:1.45; }
@media (max-width:42rem) {
    .filtri-contatto.con-selettore { grid-template-columns:minmax(0,1fr) max-content; }
    .con-selettore > .tipo-filtro { grid-column:1/-1; }
}
@media print { #guida-ricerca { display:none; } }
.filtri-contatto select { display: block; width: 100%; margin-top: 6px; padding: 10px; font: inherit; }
.rubrica { list-style: none; padding: 0; }
.rubrica li { padding: .8rem 0; border-top: 1px solid #d7d9ce; }
.rubrica li span { display: block; margin-top: .25rem; overflow-wrap: anywhere; }
.scheda-contatto { padding: 12px; border: 1px solid #c8cabe; }
.scheda-contatto h2 { font: 600 1.35rem Georgia,serif; margin: 0; }
.riga-contatto { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; padding: 8px 0; border-top: 1px solid #e0dfd8; }
.riga-contatto > div { flex: 1 1 8rem; min-width: 0; }
.riga-contatto dt { font-size: .83em; color: #4f5954; }
.riga-contatto dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.data-stampa { display: none; }
.pagine-schede { flex-wrap: wrap; margin-block: 1rem; }
.pagine-schede [aria-disabled] { color: #63665e; }
.ingrandisci-campo { margin-top: .4em; font-size: .85rem; }
@media print {
    body:has(.scheda-contatto):not(:has(#zoom-note[open])) { color: black; background: white; }
    body:has(.scheda-contatto):not(:has(#zoom-note[open])) header, body:has(.scheda-contatto):not(:has(#zoom-note[open])) main .contenuto-scheda > :not(.scheda-contatto) { display: none; }
    body:has(.scheda-contatto):not(:has(#zoom-note[open])) main, body:has(.scheda-contatto):not(:has(#zoom-note[open])) main .box { padding: 0; margin: 0; border: 0; background: white; max-width: none; }
    .scheda-contatto { padding: 3mm; border: .3mm solid black; font: 10pt Arial, sans-serif; page: anagrafica; }
    .riga-contatto { padding: 2mm 0; }
    .riga-contatto > div { flex-basis: 0; }
    .ingrandisci-campo { display: none; }
    .data-stampa { display: block; font-size: 9pt; margin-top: 3mm; }
    @page anagrafica { size: A4; margin: 15mm; @bottom-right { content: "Pagina " counter(page) " di " counter(pages); font: 9pt Arial, sans-serif; } }
}

.editor-contatto fieldset {border:1px solid #c9c6b9;border-radius:.4rem;margin:1.5rem 0;padding:1rem}
.editor-contatto legend {padding:0 .4rem;font-weight:650}
.griglia-anagrafica {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:.9rem}
.griglia-anagrafica [hidden] {display:none}
.griglia-anagrafica label {display:block}
.griglia-anagrafica :is(input,textarea,select) {width:100%;max-width:100%;box-sizing:border-box}
.griglia-anagrafica .campo-memo {grid-column:1/-1}

.corpo-documento {white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5}
.testo-documento {width:100%;box-sizing:border-box;line-height:1.5}
@media print {
    body:has(.documento-stampa) header, body:has(.documento-stampa) .contenuto-scheda > :not(.documento-stampa) {display:none}
    body:has(.documento-stampa) :is(main,.box,.documento-stampa) {background:white;border:0;margin:0;padding:0;max-width:none}
    .documento-stampa {page:documento}
    @page documento {size:A4;margin:20mm}
}
.report-documenti td { overflow-wrap: anywhere; }
.report-documenti .nota-stampa { white-space: pre-wrap; margin-top: .3em; }
@media print {
    .report-documenti thead { display: table-header-group; }
    .report-documenti tr { break-inside: avoid; }
}

#avvia-editor { margin: .6rem 0; }
.strumenti-atto { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.strumenti-atto :is(button,select) { width: auto; margin: 0; padding: .35rem .55rem; font-size: .9rem; }
.strumenti-atto button[aria-pressed=true] { background: #403238; color: white; }
#foglio-atto { background: white; border: 1px solid #87847c; padding: clamp(.8rem,3vw,2rem); min-height: 18rem; margin: .5rem 0; }
.atto-formattato { font-family: Georgia, serif; line-height: 1.5; overflow-wrap: anywhere; }
.atto-formattato :is(p,li,h2,h3) { white-space: pre-wrap; }
.atto-formattato p { margin: 0 0 .55em; min-height: 1.5em; }
.atto-left { text-align: left; } .atto-right { text-align: right; } .atto-center { text-align: center; } .atto-justify { text-align: justify; }

.report-fatture td { overflow-wrap: anywhere; }
.report-fatture td:nth-child(n+4), .report-fatture th:nth-child(n+4) { text-align: right; }
.movimento-stampa { font-size: .9em; }
@media print {
    .report-fatture { page: fatture; font-size: 9pt; }
    .report-fatture thead { display: table-header-group; }
    .report-fatture tr { break-inside: avoid; }
    @page fatture { size: A4 landscape; margin: 14mm; @bottom-right { content: "Pagina " counter(page) " di " counter(pages); font: 9pt Arial,sans-serif; } }
}

@media screen and (max-width: 700px) {
    .report-fatture { overflow-x: auto; }
    .report-fatture table { min-width: 42rem; }
    #scheda-fattura select { max-width: 100%; }
}

.moduli-studio { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: 1rem 2rem; margin-top: 1.5rem; }
.moduli-studio section { border-top: 1px solid #d7d9ce; padding-top: .85rem; }
.moduli-studio h2 { margin: 0 0 .5rem; }
.versione-demo { margin: 2rem 0 0; color: #596158; font-size: .85rem; }
