.media-editor {
    display: grid;
    gap: 0.3125rem;
    width: 100%;
    min-width: 0;
    margin-top: 1.125rem;
}

.media-editor-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    background: #e7e7e7;
    color: #303030;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    letter-spacing: 0;
}

.media-editor-toggle:hover { background: #dedede; }
.media-editor-toggle:focus-visible { outline: 0.125rem solid #333; outline-offset: 0.125rem; }
.media-editor-pendenti { font-size: 0.75rem; font-weight: 400; color: #555; }
.media-editor-corpo { padding: 0.875rem 0 0.5rem; }
.media-editor [hidden] { display: none !important; }
.media-editor-righe { display: grid; gap: 1rem; }
.media-editor-riga { border-bottom: 1px solid #d5d5d5; padding: 0 0.625rem 1rem; min-width: 0; }
.media-editor-riga-testata { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.625rem; }
.media-editor .media-editor-rappresentativo { display: flex; align-items: center; justify-content: flex-start; gap: 0.375rem; width: 100%; font-size: 0.8125rem; margin: 0.375rem 0 0; }
.media-editor-icon { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; padding: 0; }
.media-editor-campi { display: grid; gap: 0.5rem; }
.media-editor-griglia { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.media-editor-griglia > div { min-width: 0; }
.media-editor-campo-intero { grid-column: 1 / -1; }
.media-editor label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.25rem; }
.media-editor input, .media-editor select, .media-editor textarea { max-width: 100%; min-width: 0; }
.media-editor input[type="file"] { font-size: 0.8125rem; }
.media-editor-anteprima { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; overflow-wrap: anywhere; }
.media-editor-anteprima img, .media-editor-anteprima video { width: 10rem; height: 6.875rem; max-width: 100%; object-fit: contain; background: #f4f4f4; }
.media-editor-anteprima > .media-editor-player { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.media-editor-anteprima:empty { display: none; }
.media-editor .media-editor-visibilita { display: flex; align-items: center; gap: 0.5rem; margin: 0.375rem 0 0; }
.media-editor-stato { color: #65500c; font-size: 0.8125rem; margin: 0.5rem 0 0; }
.media-editor-stato:empty { display: none; }
.media-editor-riga--rimossa strong { text-decoration: line-through; color: #777; }
.media-editor[data-inline="true"] .media-editor-toggle { display: none; }

@media (max-width: 37.5em) {
    .media-editor-griglia { grid-template-columns: minmax(0, 1fr); }
    .media-editor-toggle { flex-wrap: wrap; gap: 0.25rem; }
    .media-editor-pendenti { text-align: left; }
    .evento-mappa-admin-anteprima { height: 18.75rem; max-height: 55vh; }
}
.storia-admin { display: grid; width: 100%; min-width: 0; gap: 1.125rem; }
.storia-admin .table .utente-escluso > td { color: #b02a37; }
.storia-admin .table-responsive { position: relative; }
.storia-admin > * { width: 100%; min-width: 0; max-width: 100%; }
.storia-admin-azioni { display: flex; min-width: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.125rem; }
.media-admin-azioni { padding-top: 1.125rem; }
.storia-admin-azioni > .admin-apri-sito { margin-left: auto; }
.storia-pannello-heading .eyebrow { margin-bottom: 0.4375rem; color: #7562aa; }
.storia-admin-azioni h2, .storia-pannello-heading h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.storia-admin-azioni h2 { font-size: 2rem; }
.storia-pannello { min-width: 0; padding: 1.375rem; border: 1px solid #dfdde1; border-radius: 0.25rem; background: #fff; }
.storia-pannello > h2, .storia-pannello > h3 { margin: 0 0 1.25rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.4375rem; font-weight: 400; }
.storia-nuovo { padding: 0; }
.storia-nuovo > summary { display: flex; min-height: 4.25rem; align-items: center; gap: 0.75rem; padding: 1.125rem 1.375rem; cursor: pointer; font-family: Georgia, "Times New Roman", serif; font-size: 1.4375rem; list-style: none; }
.storia-nuovo > summary::-webkit-details-marker { display: none; }
.storia-nuovo > summary::before { width: 1.75rem; height: 1.75rem; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid #d7d4da; border-radius: 50%; color: #7862b6; content: "+"; font-family: Arial, sans-serif; font-size: 1.25rem; line-height: 1; }
.storia-nuovo[open] > summary { border-bottom: 1px solid #dfdde1; }
.storia-nuovo[open] > summary::before { content: "−"; }
.storia-nuovo > summary:focus-visible { outline: 0.1875rem solid #9a84d2; outline-offset: -0.1875rem; }
.records-elenco-contenuto { padding: 1rem 1.375rem 1.375rem; }
.storia-nuovo > .page-media-form { margin: 1.125rem 1.375rem 1.375rem; }
.storia-nuovo > .storia-nuovo-media-contenuto { margin: 1.125rem 1.375rem 1.375rem; }
.storia-nuovo-media-contenuto > .row { margin-bottom: 0 !important; }
.storia-nuovo-media-contenuto .page-media-form { height: 100%; }
.storia-pannello > .media-editor-player { margin-bottom: 1.125rem; }
.storia-pannello > .page-media-form { height: auto; }
.storia-pannello-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.storia-pannello-heading h3 { font-size: 1.4375rem; }
.storia-updated { color: #77747d; font-size: 0.6875rem; }
.storia-editor-form { width: 100%; min-width: 0; }
.storia-editor-form .form-label, .page-media-form .form-label { margin-bottom: 0.375rem; color: #46434b; font-size: 0.875rem; font-weight: 600; }
/* Una legend con form-label (es. "Gruppi *") ha la stessa dimensione delle altre label, non quella di default di Bootstrap per legend. */
legend.form-label { font-size: inherit; }
.storia-editor-form .form-control, .page-media-form .form-control { min-height: 2.625rem; border-color: #d7d4da; border-radius: 0.1875rem; font-size: 0.75rem; }
.storia-editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.4375rem; border: 1px solid #d7d4da; border-radius: 0.1875rem 0.1875rem 0 0; background: #faf9fb; }
.storia-editor-tool { width: 2.125rem; min-height: 2rem; display: grid; place-items: center; border: 1px solid transparent; border-radius: 0.1875rem; background: transparent; color: #393640; font-size: 0.8125rem; }
.storia-editor-tool:hover, .storia-editor-tool:focus-visible, .storia-editor-tool[aria-pressed="true"] { border-color: #d7d4da; background: #fff; color: #5d4b8e; }
.page-rich-editor { width: 100%; min-width: 0; min-height: 21.25rem; padding: 1.125rem; overflow-wrap: anywhere; border: 1px solid #d7d4da; border-top: 0; border-radius: 0 0 0.1875rem 0.1875rem; background: #fff; color: #28262b; font-size: 0.875rem; line-height: 1.7; }
.storia-editor-html-source { display: block; min-height: 21.25rem; resize: vertical; font-family: Consolas, monospace; white-space: pre; overflow-wrap: normal; }
.storia-editor-tool-html { display: flex; width: auto; align-items: center; gap: 0.3125rem; padding: 0 0.5rem; }
.page-rich-editor:focus { outline: 0; border-color: #9a84d2; box-shadow: 0 0 0 0.125rem rgb(120 98 182 / 12%); }
.page-rich-editor:empty::before { color: #99949f; content: "Scrivi il testo della sezione…"; }
.page-rich-editor blockquote { margin: 0.875rem 0; padding-left: 0.875rem; border-left: 0.125rem solid #8e75c2; color: #5b5562; }
.storia-seo { margin-top: 1rem; border-top: 1px solid #e8e6e9; padding-top: 0.875rem; }
.storia-seo summary { color: #5b5761; cursor: pointer; font-size: 0.6875rem; font-weight: 700; }
.evento-mappa-admin { margin-top: 0; border-top: 0; padding-top: 0; }
.evento-form hr { border-color: #e8e6e9; opacity: 1; }
.evento-mappa-nota { display: block; margin-top: 0.75rem; color: #77747d; font-size: 0.6875rem; }
.evento-mappa-preview { margin-top: 0.875rem; }
.evento-mappa-preview[hidden] { display: none !important; }
.evento-mappa-admin-anteprima { display: block; width: 100%; height: 22.5rem; max-height: 60vh; border: 0; border-radius: 0.1875rem; background: #f0eff2; }
.storia-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.125rem; }
.storia-form-actions > span { color: #77747d; font-size: 0.625rem; }
.btn-tuxedo-admin { min-height: 2.5rem; display: inline-flex; align-items: center; gap: 0.5rem; border: 0; border-radius: 0.1875rem; background: #7862b6; color: #fff; font-size: 0.6875rem; font-weight: 700; }
.btn-tuxedo-admin:hover, .btn-tuxedo-admin:focus { background: #625095; color: #fff; }
.page-media-form { height: 100%; display: flex; flex-direction: column; gap: 0.5625rem; padding: 0.9375rem; border: 1px solid #e1dfe3; border-radius: 0.1875rem; background: #faf9fb; }
.page-media-form.evento-form, .page-media-form.record-media-form { display: grid; gap: 1.375rem; height: auto; padding: 0; border: 0; background: transparent; }
.evento-form > .storia-pannello, .record-media-form > .storia-pannello { display: flex; flex-direction: column; gap: 0.5625rem; }
.storia-nuovo > .evento-form > .storia-pannello, .storia-nuovo > .record-media-form > .storia-pannello { padding: 0; border: 0; background: transparent; }
.page-media-form h4 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.25rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.0625rem; font-weight: 400; }
.page-media-form h4 i { color: #7862b6; }
.page-media-form .btn { margin-top: auto; min-height: 2.375rem; border-radius: 0.1875rem; font-size: 0.6875rem; }
.media-salva-gallery { justify-content: center; text-align: center; text-transform: uppercase; }
.media-editor-player { width: 100%; max-width: 45rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 0.1875rem; background: #1b1a1f; }
.media-editor-player > video, .media-editor-player > iframe { display: block; width: 100%; height: 100%; border: 0; }
.page-media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.page-media-item { min-width: 0; overflow: hidden; border: 1px solid #e1dfe3; border-radius: 0.1875rem; background: #fff; }
.page-media-item > img, .page-media-placeholder { width: 100%; height: 9.375rem; display: grid; place-items: center; object-fit: cover; background: #1b1a1f; color: #d4cde4; }
.page-media-placeholder { align-content: center; gap: 0.5rem; font-size: 0.6875rem; }
.page-media-placeholder i { color: #a998df; font-size: 1.375rem; }
.page-media-item-info { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.625rem; padding: 0.625rem; }
.page-media-item-info > div { min-width: 0; }
.page-media-item-info strong, .page-media-item-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-media-item-info strong { font-size: 0.625rem; }
.page-media-item-info small { margin-top: 0.1875rem; color: #77747d; font-size: 0.5625rem; }
.page-media-item-info form { flex: 0 0 auto; }
.page-media-item-info > a { flex: 0 0 auto; }
.memorabilia-admin-item { display: flex; min-width: 0; align-items: center; gap: 0.75rem; }
.memorabilia-admin-item img { width: 3.625rem; height: 3.625rem; flex: 0 0 auto; object-fit: contain; background: #f3f1ee; }
.memorabilia-admin-item span { min-width: 0; }
.memorabilia-admin-preview { width: min(100%, 32.5rem); max-height: 22.5rem; align-self: flex-start; object-fit: contain; background: #f3f1ee; }
.page-media-vuota { margin: 0; padding: 1.25rem; border: 1px dashed #d7d4da; color: #77747d; text-align: center; font-size: 0.75rem; }

@media (max-width: 62.5em) {
    .page-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 37.5em) {
    .storia-admin-azioni { align-items: flex-start; flex-direction: column; }
    .storia-pannello { padding: 1rem; }
    .records-elenco-contenuto { padding: 1rem 1rem 1rem; }
    .storia-pannello-heading { align-items: flex-start; flex-direction: column; }
    .page-rich-editor, .storia-editor-html-source { min-height: 16.875rem; }
    .storia-form-actions { align-items: stretch; flex-direction: column; }
    .storia-form-actions .btn { justify-content: center; }
    .page-media-grid { grid-template-columns: 1fr; }
}