.voci-pagina {
    width: min(100% - 3rem, 1160px);
}

.voci-pubbliche {
    margin-top: 3rem;
}

.voci-home-link {
    color: inherit;
    text-decoration: none;
}

.voci-home-link:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 0.15em;
}

.voci-strumenti {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 340px);
    align-items: end;
    gap: 0.75rem 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.voci-admin h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
}

.voci-strumenti label {
    grid-column: 2;
    font-size: 0.8rem;
}

.voci-strumenti input,
.voci-editor-form input,
.voci-editor-form textarea,
.voci-editor-form select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.voci-strumenti input,
.voci-editor-form input,
.voci-editor-form select {
    min-height: 2.8rem;
    padding: 0.65rem 0.75rem;
}

.voci-strumenti input {
    grid-column: 2;
}

.voci-stato {
    min-height: 1.5em;
    margin: 0.85rem 0;
    opacity: 0.7;
}

.voci-layout {
    display: grid;
    grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    min-width: 0;
}

.voci-layout.voce-aperta.voce-con-indice {
    grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
}

.voci-layout.voce-aperta:not(.voce-con-indice) {
    grid-template-columns: minmax(0, 1fr);
}

.voci-layout.voce-aperta .voci-indice {
    display: none;
}

.voci-layout.voce-aperta:not(.voce-con-indice) .voce-articolo {
    padding-left: 0;
    border-left: 0;
}

.voci-indice,
.voci-editor-indice {
    display: grid;
    align-content: start;
    min-width: 0;
}

.voci-indice a,
.voci-editor-indice button {
    padding: 0.8rem 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.voci-indice a:hover,
.voci-indice a:focus-visible,
.voci-editor-indice button:hover,
.voci-editor-indice button:focus-visible,
.voci-editor-indice button[aria-current="true"] {
    outline: none;
    padding-left: 0.6rem;
    background: rgba(var(--ink-rgb), 0.08);
}

.voci-indice small,
.voci-editor-indice small {
    display: block;
    margin-top: 0.25rem;
    opacity: 0.65;
}

.voci-indice span,
.voci-indice small {
    overflow-wrap: anywhere;
}

.voci-indice small {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.voce-articolo {
    min-width: 0;
    padding-left: 2rem;
    border-left: 1px solid var(--line);
}

.voce-articolo h1 {
    margin: 0 0 0.75rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1;
}

.voce-articolo h2,
.voce-articolo h3 {
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
    font-weight: 400;
}

.voce-articolo h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.voce-articolo h3 {
    font-size: 1.35rem;
}

.voce-articolo p,
.voce-articolo li {
    max-width: 72ch;
    font-size: 1.05rem;
    line-height: 1.7;
}

.voce-sommario {
    font-size: 1.15rem !important;
    font-style: italic;
}

.voce-indice-interno {
    max-width: 42rem;
    margin: 1.5rem 0 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
}

.voce-indice-laterale[hidden] {
    display: none;
}

.voce-indice-laterale {
    position: sticky;
    top: 1.25rem;
    align-self: start;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    scrollbar-width: thin;
}

.voce-indice-laterale .voce-indice-interno {
    max-width: none;
    margin: 0;
    padding: 0 1rem 1rem 0;
    border: 0;
}

.voce-indice-interno-intestazione {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
}

.voce-indice-interno-titolo {
    margin: 0;
    font-weight: 700;
}

.voce-indice-interno-toggle {
    padding: 0.2rem 0.4rem !important;
    border: 0 !important;
    background: rgba(var(--ink-rgb), 0.07) !important;
    color: inherit !important;
    font-size: 0.75rem !important;
    text-decoration: none !important;
}

.voce-indice-interno-toggle:hover,
.voce-indice-interno-toggle:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 0.1rem;
}

.voce-indice-mobile-chiudi,
.voce-indice-mobile-pulsante,
.voce-indice-mobile-sfondo {
    display: none;
}

.voce-indice-interno-contenuto[hidden] {
    display: none;
}

.voce-indice-interno ol {
    margin: 0;
    padding-left: 1.5rem;
    list-style: none;
}

.voce-indice-interno li {
    margin: 0.25rem 0;
    line-height: 1.45;
}

.voce-indice-interno button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.voce-indice-interno button:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 0.2rem;
}

.voce-indice-interno-sottosezioni {
    margin-top: 0.25rem !important;
}

.voce-indice-interno-sottosezioni[hidden] {
    display: none;
}

.voce-indice-sezione-riga {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.voce-indice-sezione-riga > [data-wiki-heading] {
    flex: 1 1 auto;
    min-width: 0;
}

.voce-indice-numero {
    flex: 0 0 2.25rem;
    font-variant-numeric: tabular-nums;
}

.voce-indice-sottosezione {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.voce-indice-sottosezione > [data-wiki-heading] {
    min-width: 0;
}

.voce-indice-interno .voce-indice-sezione-toggle {
    display: inline-grid;
    flex: 0 0 1.4rem;
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    border: 1px solid var(--line);
    background: rgba(var(--ink-rgb), 0.04);
    place-items: center;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    margin-left: auto;
}

.voce-indice-interno .voce-indice-sezione-toggle:hover,
.voce-indice-interno .voce-indice-sezione-toggle:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 0.1rem;
    background: rgba(var(--ink-rgb), 0.1);
}

.voce-indice-interno-vuoto {
    margin: 0;
    opacity: 0.65;
}

.voce-articolo a {
    color: inherit;
    text-underline-offset: 0.15em;
}

.voce-tabella-contenitore {
    max-width: 100%;
    margin: 1.75rem 0;
}

.voce-tabella {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.voce-tabella caption {
    padding: 0 0 0.55rem;
    font-weight: 700;
    text-align: left;
}

.voce-tabella th,
.voce-tabella td {
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
    hyphens: auto;
    white-space: normal;
    text-align: left;
    vertical-align: top;
}

.voce-tabella th {
    background: rgba(var(--ink-rgb), 0.1);
    font-weight: 700;
}

.voce-tabella tbody tr:nth-child(even) {
    background: rgba(var(--ink-rgb), 0.035);
}

.voce-metadati {
    margin-top: 3rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem !important;
    opacity: 0.65;
}

.voce-richiamo-fonte {
    margin-left: 0.12em;
    font-size: 0.72em;
    vertical-align: super;
    line-height: 0;
}

.voce-richiamo-fonte a {
    text-decoration: none;
}

.voce-fonti {
    margin-top: 3rem;
}

.voce-fonti h2 {
    margin-bottom: 0.75rem;
}

.voce-fonti ol {
    padding-left: 1.7rem;
}

.voce-fonti li {
    max-width: 78ch;
    margin-bottom: 0.65rem;
    overflow-wrap: anywhere;
}

.voce-fonte-dettagli {
    opacity: 0.76;
}

.voce-fonte-ritorno {
    margin-left: 0.45rem;
    font-size: 0.82em;
    text-decoration: none !important;
}

.voci-admin {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 2px solid var(--ink);
}

.voci-admin-intestazione {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.voci-sopratitolo {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.voci-admin button,
.voci-editor-form button {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

.voci-admin button:hover,
.voci-admin button:focus-visible,
.voci-editor-form button:hover,
.voci-editor-form button:focus-visible {
    outline: none;
    background: var(--ink);
    color: var(--paper);
}

.voci-admin button:disabled {
    cursor: wait;
    opacity: 0.5;
}

.voci-editor-layout {
    display: grid;
    grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

.voci-editor-form {
    display: grid;
    gap: 0.65rem;
}

.voci-editor-form label {
    margin-top: 0.5rem;
    font-weight: 700;
}

.voci-editor-form textarea {
    min-height: 6rem;
    padding: 0.75rem;
    resize: vertical;
    line-height: 1.55;
}

#vociEditorTesto {
    min-height: 25rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.92rem;
}

.voci-slug-riga {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
}

.voci-slug-riga span {
    opacity: 0.6;
}

.voci-editor-testo-titolo {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.voci-editor-testo-titolo span {
    font-size: 0.75rem;
    opacity: 0.65;
}

.voci-editor-toolbar,
.voci-editor-azioni {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.voci-editor-toolbar button {
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
}

.voci-fonte-pannello,
.voci-tabella-pannello,
.voci-collegamento-pannello {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
}

.voci-fonte-pannello[hidden],
.voci-tabella-pannello[hidden],
.voci-collegamento-pannello[hidden] {
    display: none;
}

.voci-fonte-pannello legend,
.voci-tabella-pannello legend,
.voci-collegamento-pannello legend {
    padding: 0 0.4rem;
    font-weight: 700;
}

.voci-fonte-pannello label,
.voci-tabella-pannello label,
.voci-collegamento-pannello label {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
}

.voci-fonti-riuso {
    margin-bottom: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.voci-fonti-riuso[hidden] {
    display: none;
}

.voci-fonti-riuso h3,
.voci-fonte-nuova-titolo {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 700;
}

.voci-fonti-riuso-elenco {
    display: grid;
    gap: 0.55rem;
}

.voci-fonte-riuso-scheda {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
}

.voci-fonte-riuso-scheda:first-child {
    padding-top: 0;
    border-top: 0;
}

.voci-fonte-riuso-scheda > div {
    min-width: 0;
}

.voci-fonte-riuso-scheda strong,
.voci-fonte-riuso-scheda small {
    display: block;
    overflow-wrap: anywhere;
}

.voci-fonte-riuso-scheda small {
    margin-top: 0.2rem;
    opacity: 0.65;
}

.voci-fonte-riga {
    display: grid;
    grid-template-columns: 1fr minmax(140px, 0.45fr);
    gap: 0.75rem;
}

.voci-fonte-riga > div {
    display: grid;
    gap: 0.55rem;
}

.voci-tabella-riga {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.75rem;
}

.voci-tabella-riga > div {
    display: grid;
    gap: 0.55rem;
}

.voci-tabella-pannello > p {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    opacity: 0.72;
}

.voci-fonte-azioni,
.voci-tabella-azioni {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.voci-collegamento-azioni {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.voci-fonte-azioni button:last-child,
.voci-tabella-azioni button:last-child,
.voci-collegamento-azioni button:last-child {
    background: var(--ink);
    color: var(--paper);
}

.voce-collegamento-mancante {
    text-decoration: underline dotted;
    text-underline-offset: 0.15em;
    opacity: 0.65;
}

.voci-foto {
    margin-top: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
}

.voci-foto-intestazione {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.voci-foto-intestazione h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.voci-foto-intestazione span,
.voci-foto > p {
    font-size: 0.78rem;
    opacity: 0.7;
}

.voci-foto > p {
    max-width: 70ch;
    margin: 0.4rem 0 1rem;
    line-height: 1.5;
}

.voci-foto-elenco {
    display: grid;
    gap: 1rem;
}

.voci-foto-scheda {
    display: grid;
    grid-template-columns: minmax(110px, 170px) minmax(0, 1fr);
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.voci-foto-scheda:first-child {
    padding-top: 0;
    border-top: 0;
}

.voci-foto-immagine {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: rgba(var(--ink-rgb), 0.08);
}

.voci-foto-campi {
    display: grid;
    gap: 0.45rem;
}

.voci-foto-campi label {
    margin: 0;
    font-size: 0.78rem;
}

.voci-foto-campi input {
    min-height: 2.45rem;
}

.voci-foto-azioni {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.voci-foto-azioni button {
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
}

.voce-foto {
    max-width: min(100%, 48rem);
    margin: 1.75rem 0;
}

.voce-foto img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    background: rgba(var(--ink-rgb), 0.05);
}

.voce-foto figcaption {
    margin-top: 0.45rem;
    font-size: 0.82rem;
    line-height: 1.45;
    opacity: 0.72;
}

.voci-editor-azioni {
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.voci-editor-azioni button:last-child {
    background: var(--ink);
    color: var(--paper);
}

.voci-anteprima {
    margin-top: 2rem;
    padding: 2rem;
    border: 1px solid var(--line);
}

@media (max-width: 760px) {
    .voci-pagina {
        width: min(100% - 2rem, 1160px);
    }

    .voci-strumenti,
    .voci-layout,
    .voci-layout.voce-aperta.voce-con-indice,
    .voci-layout.voce-aperta:not(.voce-con-indice),
    .voci-editor-layout {
        grid-template-columns: 1fr;
    }

    .voci-strumenti label,
    .voci-strumenti input {
        grid-column: 1;
    }

    .voce-articolo {
        padding: 1.5rem 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    body.voce-indice-mobile-aperto {
        overflow: hidden;
    }

    .voce-indice-mobile-pulsante:not([hidden]) {
        display: block;
        position: fixed;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        z-index: 1700;
        min-height: 2.75rem;
        padding: 0.65rem 1rem;
        border: 1px solid var(--ink);
        border-radius: 999px;
        background: var(--ink);
        color: var(--paper);
        box-shadow: 0 0.45rem 1.25rem rgba(var(--ink-rgb), 0.24);
        font: inherit;
        font-size: 0.9rem;
        cursor: pointer;
    }

    .voce-indice-mobile-pulsante:focus-visible {
        outline: 2px solid var(--paper);
        outline-offset: 2px;
    }

    .voce-indice-mobile-sfondo:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1920;
        background: rgba(var(--ink-rgb), 0.42);
    }

    .voce-indice-laterale {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1950;
        width: min(88vw, 24rem);
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-left: 1px solid var(--line);
        background: var(--paper);
        box-shadow: -0.75rem 0 2rem rgba(var(--ink-rgb), 0.22);
        scrollbar-width: thin;
        transform: translateX(105%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 180ms ease, visibility 180ms;
        -webkit-overflow-scrolling: touch;
    }

    body.voce-indice-mobile-aperto .voce-indice-laterale {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .voce-indice-laterale .voce-indice-interno {
        min-height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        box-sizing: border-box;
    }

    .voce-indice-laterale .voce-indice-interno-intestazione {
        position: sticky;
        top: 0;
        z-index: 1;
        margin: 0;
        padding: calc(0.85rem + env(safe-area-inset-top)) 1rem 0.85rem;
        border-bottom: 1px solid var(--line);
        background: var(--paper);
    }

    .voce-indice-laterale .voce-indice-interno-titolo {
        font-size: 1.2rem;
    }

    .voce-indice-laterale .voce-indice-interno-toggle {
        display: none;
    }

    .voce-indice-laterale .voce-indice-mobile-chiudi {
        display: inline-grid;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border: 1px solid var(--line);
        background: transparent;
        place-items: center;
        font-size: 1.75rem;
        line-height: 1;
        text-decoration: none;
    }

    .voce-indice-laterale .voce-indice-interno-contenuto {
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    }

    @media (prefers-reduced-motion: reduce) {
        .voce-indice-laterale {
            transition: none;
        }
    }

    .voci-admin-intestazione {
        align-items: flex-start;
        flex-direction: column;
    }

    .voci-admin-intestazione button,
    .voci-editor-azioni button {
        width: 100%;
    }

    #vociEditorTesto {
        min-height: 20rem;
    }

    .voci-anteprima {
        padding: 1.25rem;
    }

    .voci-foto-scheda {
        grid-template-columns: 1fr;
    }

    .voci-fonte-riga,
    .voci-tabella-riga {
        grid-template-columns: 1fr;
    }

    .voci-fonte-azioni,
    .voci-tabella-azioni,
    .voci-collegamento-azioni {
        flex-direction: column-reverse;
    }

    .voci-fonte-azioni button,
    .voci-tabella-azioni button,
    .voci-collegamento-azioni button {
        width: 100%;
    }

    .voci-fonte-riuso-scheda {
        grid-template-columns: 1fr;
    }

    .voci-fonte-riuso-scheda button {
        width: 100%;
    }

    .voci-foto-immagine {
        max-height: 14rem;
    }
}
