@font-face {
  font-family: "Korinna";
  src: url("../assets/fonts/ITC Korinna Std.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Korinna";
  src: url("../assets/fonts/ITC Korinna Std Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Korinna";
  src: url("../assets/fonts/ITC Korinna Std Kursiv.otf") format("opentype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Korinna";
  src: url("../assets/fonts/ITC Korinna Std Bold Kursiv.otf") format("opentype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "FrizQuadrataCTT";
  src: url("../assets/fonts/FrizQuadrataCTT.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "FrizQuadrataCTTHeavy";
  src: url("../assets/fonts/FrizQuadrataCTT-Heavy.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/*
 * TOMI PERDUTI — FOGLIO DI STILE PRINCIPALE
 * Indice: base, intestazione, componenti, home, catalogo, dettaglio,
 * pagine editoriali, moduli, amministrazione, statistiche, responsive.
 */

:root {
  --ink: #2d2118;
  --ink-soft: #66513c;
  --paper: #ead8af;
  --paper-light: #f7ecd3;
  --paper-deep: #ddc498;
  --gold: #d1a85b;
  --gold-dark: #86602f;
  --red: #7b241c;
  --red-dark: #50140f;
  --blue: #18365d;
  --blue-dark: #0d2039;
  --green: #275f42;
  --dark: #1b1510;
  --dark-soft: #2a2118;
  --danger: #7d3025;
  --success: #456635;
  --shadow: 0 12px 30px rgb(35 22 13 / 24%);
  --display-font: "FrizQuadrataCTT", Georgia, serif;
  --body-font: "Korinna", Georgia, serif;
  --content-width: 1280px;
  --radius: 2px;
}

/* Gestione delle miniature dinamiche */

.thumbnail-admin-panel {
  max-width: 1120px;
  margin-inline: auto;
}

.thumbnail-health {
  margin-top: 26px;
}

.thumbnail-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.thumbnail-stat-grid article {
  padding: 18px 14px;
  color: #f1ddb0;
  background-color: #20170f;
  background-image: linear-gradient(rgb(28 18 11 / 25%), rgb(13 9 6 / 35%)), url("../assets/leather.webp");
  background-size: auto, 760px auto;
  border: 1px solid #b68a45;
  text-align: center;
}

.thumbnail-stat-grid strong,
.thumbnail-stat-grid span {
  display: block;
}

.thumbnail-stat-grid strong {
  color: #f0cc7e;
  font: 700 31px/1 var(--display-font);
}

.thumbnail-stat-grid span {
  margin-top: 7px;
  color: #d4c09a;
  font-size: 11px;
}

.thumbnail-manager {
  padding: 21px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
  box-shadow: inset 0 0 0 3px #f2e5ce;
}

.thumbnail-manager-copy h2 {
  margin: 0;
  color: #532719;
  font: 700 24px var(--display-font);
}

.thumbnail-manager-copy p {
  max-width: 760px;
  margin: 7px 0 0;
  color: #654d38;
}

.thumbnail-manager-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.thumbnail-manager button:disabled {
  cursor: not-allowed;
  filter: grayscale(.8);
  opacity: .55;
}

.thumbnail-progress {
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid #c2a472;
}

.thumbnail-progress progress {
  display: block;
  width: 100%;
  height: 15px;
  accent-color: var(--blue);
}

.thumbnail-progress p {
  margin: 8px 0 0;
  color: #5f432d;
  font-size: 12px;
}

@media (max-width: 760px) {
  .thumbnail-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thumbnail-manager-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .thumbnail-manager-actions .fantasy-button,
  .thumbnail-manager-actions .text-button {
    width: 100%;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  background-color: #d8c098;
  background-image: linear-gradient(rgb(238 219 179 / 8%), rgb(185 148 92 / 10%)), url("../assets/parchment-strong.webp");
  background-position: center top;
  background-size: auto, 720px auto;
  background-repeat: repeat, repeat;
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font-family: var(--body-font);
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #f0c96f;
  outline-offset: 3px;
}

.container {
  width: min(var(--content-width), calc(100% - 32px));
  margin-inline: auto;
}

.narrow-container,
.form-container,
.auth-container {
  max-width: 920px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  translate: 0 -150%;
  padding: 9px 13px;
  color: #fff8e6;
  background: var(--blue-dark);
  border: 2px solid var(--gold);
}

.skip-link:focus {
  translate: 0;
}

code {
  padding: 2px 5px;
  color: #3d2b1d;
  background: #e8d3aa;
  border: 1px solid #c4a16b;
  font-size: .88em;
  overflow-wrap: anywhere;
}

/* Intestazione */

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  color: #f0dcad;
  background-color: #20170f;
  background-image: linear-gradient(rgb(27 18 12 / 18%), rgb(15 10 7 / 42%)), url("../assets/leather.webp");
  background-position: center;
  background-size: auto, 760px auto;
  border-top: 2px solid #7c5729;
  border-bottom: 2px solid var(--gold-dark);
  box-shadow: 0 7px 22px rgb(0 0 0 / 45%);
}

.site-header::after {
  position: absolute;
  right: 8px;
  bottom: 5px;
  left: 8px;
  height: 1px;
  background: rgb(224 188 111 / 32%);
  content: "";
}

.header-inner {
  position: relative;
  display: flex;
  min-height: 88px;
  align-items: stretch;
}

.brand {
  display: flex;
  width: 340px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 8px 22px 8px 4px;
  color: #f0d696;
  text-decoration: none;
}

.brand img {
  width: 82px;
  height: 70px;
  flex: 0 0 auto;
  object-fit: cover;
}

.brand-copy,
.brand-copy span {
  display: block;
}

.brand-title {
  font: 700 25px/1 var(--display-font);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.brand-tagline {
  margin-top: 5px;
  font: 700 9px/1.15 var(--display-font);
  letter-spacing: .45px;
  text-transform: uppercase;
}

.brand-tagline > .brand-tagline-emphasis {
  display: inline;
  text-decoration-line: underline;
  text-decoration-color: #d9b866;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}

.brand-subtitle {
  margin-top: 5px;
  color: #cbb782;
  font: 600 8px/1.15 var(--display-font);
  letter-spacing: .4px;
}

.top-nav {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: stretch;
  justify-content: flex-end;
}

.top-nav > a {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  color: #f0dcad;
  border-left: 1px solid rgb(194 147 68 / 23%);
  font: 700 13px/1.2 var(--display-font);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}

.top-nav > a:hover,
.top-nav > a.active {
  color: #fff0c7;
  background-color: #681d17;
  background-image: linear-gradient(rgb(112 22 18 / 52%), rgb(62 13 10 / 58%)), url("../assets/leather.webp");
  background-position: center;
  background-size: auto, 760px auto;
  box-shadow: inset 0 0 0 2px #34100d, inset 0 0 0 4px #ad7b37;
}

.top-nav .login-link {
  height: auto;
  min-width: 154px;
  align-self: center;
  flex-direction: column;
  gap: 3px;
  margin: 9px 5px 9px 10px;
  padding: 9px 14px;
  border: 1px solid #c89a47;
  box-shadow: inset 0 0 0 2px #3c2a17;
}

/* Mantiene il riquadro delle voci attive sopra il filetto inferiore dell'header. */
@media (min-width: 961px) {
  .top-nav > a:not(.login-link) {
    margin-bottom: 6px;
    padding-top: 6px;
  }
}

.login-link small {
  display: block;
  max-width: 145px;
  overflow: hidden;
  color: #cbb782;
  font-size: 10px;
  text-overflow: ellipsis;
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 42px;
  align-self: center;
  margin-left: auto;
  padding: 9px 10px;
  color: #f0d696;
  background: rgb(15 10 7 / 30%);
  border: 1px solid #ba8c42;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: currentColor;
}

.site-message {
  position: relative;
  z-index: 20;
  padding: 10px 0;
  border-bottom: 1px solid;
  font-weight: 700;
}

.site-message-success {
  color: #294521;
  background: #dce8d5;
  border-color: #527247;
}

.site-message-error {
  color: #5b1d15;
  background: #f2d7cb;
  border-color: #8d3526;
}

.site-message-info {
  color: #4a3821;
  background: #e7ddc7;
  border-color: #8f713e;
}

/* Componenti condivisi */

.inner-main,
.home-content {
  background-color: var(--paper);
  background-image: linear-gradient(rgb(236 214 170 / 14%), rgb(181 142 84 / 12%)), url("../assets/parchment-strong.webp");
  background-position: center;
  background-size: auto, 720px auto;
  background-repeat: repeat, repeat;
}

.inner-main {
  min-height: 58vh;
  padding: 36px 0 46px;
}

.panel,
.home-frame {
  position: relative;
  isolation: isolate;
  color: var(--ink);
  background-color: #f5e7c9;
  background-image: linear-gradient(rgb(247 236 211 / 48%), rgb(247 236 211 / 48%)), url("../assets/parchment-strong.webp");
  background-position: center;
  background-size: auto, 560px auto;
  background-repeat: repeat, repeat;
  border: 6px solid #4f321b;
  box-shadow: var(--shadow), inset 0 0 0 2px #a77d3e;
}

.panel {
  padding: 34px;
}

.panel::after,
.home-frame::after {
  position: absolute;
  z-index: 1;
  inset: 7px;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 1px #745027;
  content: "";
  pointer-events: none;
}

.panel > *,
.home-frame > * {
  position: relative;
  z-index: 3;
}

.ornate-frame {
  --corner-size: 58px;
  --corner-offset: 1px;
}

.ornate-corner {
  position: absolute;
  z-index: 8;
  width: var(--corner-size);
  height: var(--corner-size);
  background: url("../assets/ornament-corner.svg") center / contain no-repeat;
  pointer-events: none;
}

.corner-tl { top: var(--corner-offset); left: var(--corner-offset); }
.corner-tr { top: var(--corner-offset); right: var(--corner-offset); rotate: 90deg; }
.corner-br { right: var(--corner-offset); bottom: var(--corner-offset); rotate: 180deg; }
.corner-bl { bottom: var(--corner-offset); left: var(--corner-offset); rotate: 270deg; }

.page-heading,
.section-heading {
  text-align: center;
}


.page-heading h1 {
  margin: 0;
  color: #551c14;
  font: 700 clamp(30px, 4vw, 48px)/1.04 var(--display-font);
  letter-spacing: -.5px;
}

.section-heading h2 {
  margin: 0;
  color: #4f2117;
  font: 700 clamp(27px, 3.5vw, 39px)/1.08 var(--display-font);
}

.section-heading p,
.lead {
  max-width: 830px;
  margin: 9px auto 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.lead {
  margin-bottom: 26px;
  text-align: center;
}

.eyebrow,
.cards-kicker,
.support-kicker,
.stats-kicker,
.about-kicker {
  margin: 0 0 6px;
  color: #7b5526;
  font: 700 11px/1.3 var(--display-font);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.ornament {
  display: flex;
  max-width: 500px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 13px auto;
  color: #946426;
  font-size: 19px;
}

.ornament::before,
.ornament::after {
  width: min(150px, 28vw);
  height: 1px;
  background: #a87733;
  content: "";
}

.fantasy-button,
.download {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 24px;
  color: #f8e5b8;
  background: linear-gradient(#7a542f, #432b18);
  border: 2px solid #2e1c0f;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px #bd8133, 0 3px 8px rgb(0 0 0 / 28%);
  font: 700 14px/1.2 var(--display-font);
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: filter .15s ease, translate .15s ease;
}

.fantasy-button:hover,
.download:hover {
  filter: brightness(1.1);
  translate: 0 -1px;
}

.fantasy-button.becmi,
.page-becmi .download,
.page-carte .download {
  background: linear-gradient(#9b3528, #641712);
}

.fantasy-button.adnd,
.page-adnd .download,
.fantasy-button.blue {
  background: linear-gradient(#285078, #102947);
}

.fantasy-button.small {
  min-height: 40px;
  padding: 8px 20px;
  font-size: 12px;
}

button.fantasy-button {
  cursor: pointer;
}

.button-link,
.text-link,
.text-button,
.catalog-detail-link,
.detail-back-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
}

.button-link {
  padding: 10px 4px;
  color: #5a2c1d;
}

.text-button {
  padding: 7px 0;
  background: transparent;
  border: 0;
}

.info-box,
.notice {
  color: var(--ink);
  background: #f8eed7;
  border: 1px solid #c6a872;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 50%);
}

.info-box {
  padding: 20px;
}

.notice {
  margin: 18px 0 0;
  padding: 12px 14px;
  font-size: 13px;
}

.badge-list,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.detail-tag {
  display: inline-block;
  padding: 4px 8px;
  color: #594127;
  background: #e4d2ad;
  border: 1px solid #b99a65;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.25;
}

.badge-category {
  color: #f7e8bf;
  background: var(--blue);
  border-color: #0b203a;
}

.provenance-mark {
  display: inline-block;
  width: fit-content;
  margin: 1px 0 8px;
  padding: 4px 7px;
  color: #fff8e8;
  background: #5c5244;
  border: 1px solid rgb(45 31 20 / 55%);
  font: 700 9px/1.2 var(--display-font);
  letter-spacing: .55px;
  text-transform: uppercase;
}

.provenance-official_it { background: #355b39; border-color: #223c26; }
.provenance-official_original { background: #315767; border-color: #1d3946; }
.provenance-community_translation { color: #3b2714; background: #d8b66f; border-color: #8e6a2c; }
.provenance-fanmade { background: #7b3027; border-color: #4f1c16; }
.provenance-review { color: #392f26; background: #c8baa3; border-color: #887663; }

/* Home */

.hero {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  background: #160f0b;
  border-bottom: 2px solid #86602f;
}

.hero::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 18%) 0%, rgb(0 0 0 / 10%) 28%, rgb(0 0 0 / 38%) 50%, rgb(0 0 0 / 12%) 76%, rgb(0 0 0 / 22%) 100%),
    linear-gradient(180deg, rgb(0 0 0 / 8%) 0%, rgb(0 0 0 / 4%) 48%, rgb(0 0 0 / 34%) 100%);
  content: "";
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 600px;
  align-items: center;
  justify-content: center;
}

.hero-art {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: cover;
  object-position: center;
}

.hero-copy {
  width: min(980px, 82%);
  margin: 0;
  padding: 52px 20px;
  text-align: center;
}

.hero .eyebrow {
  color: #f0d08a;
  font-size: 13px;
  letter-spacing: 1.8px;
  text-shadow:
    0 1px 0 rgb(0 0 0 / 80%),
    0 2px 4px rgb(0 0 0 / 85%);
  -webkit-text-stroke: 0.25px rgb(48 22 10 / 70%);
  paint-order: stroke fill;
}

.hero h1 {
  margin: 0;
  color: transparent;
  background: linear-gradient(180deg, #fff4d7 0%, #f0d08a 43%, #bd7c2f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font: 400 clamp(52px, 6vw, 80px)/.92 var(--display-font);
  letter-spacing: .015em;
  text-transform: none;
  text-shadow:
    0 1px 0 rgb(255 229 165 / 60%),
    0 3px 5px rgb(35 11 5 / 65%);
}

.hero h1.site-title-heavy {
  font-family: "FrizQuadrataCTTHeavy", Georgia, serif;
  font-weight: 400;
  -webkit-text-stroke: 0.70px #6b371a;
  paint-order: stroke fill;
}

.hero-lead {
  width: min(900px, 100%);
  max-width: none;
  margin: 0 auto;
  padding: 15px 24px 16px;
  box-sizing: border-box;
  color: #fff1d1;
  background: #050505;
  position: relative;
  border: 1px solid rgb(200 155 69 / 82%);
  border-radius: 0;
  box-shadow:
    0 0 0 1px rgb(82 48 14 / 35%),
    0 8px 22px rgb(0 0 0 / 32%);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.38;
  text-shadow: 0 1px 2px rgb(0 0 0 / 75%);
}

.hero-lead::before,
.hero-lead::after {
  content: "◆";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  padding: 0 5px;
  color: #c89b45;
  background: #050505;
  font-family: Georgia, serif;
  font-size: 8px;
  line-height: 1;
}

.hero-lead::before {
  top: -4px;
}

.hero-lead::after {
  bottom: -4px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}

.hero-actions .button-link {
  color: #f0c45f;
  text-shadow: 0 1px 2px rgb(0 0 0 / 75%);
}

.home-content {
  padding: 28px 0 42px;
}

.home-frame {
  --corner-size: 72px;
  padding: 42px 34px 34px;
}

.home-section-heading {
  margin-bottom: 27px;
}

.home-section-heading p:last-child {
  max-width: 760px;
}

.eras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.era-card {
  display: grid;
  min-width: 0;
  min-height: 310px;
  grid-template-columns: minmax(190px, 39%) minmax(0, 1fr);
  overflow: hidden;
  background: #f0dfbc;
  border: 3px solid #9c7537;
  box-shadow: inset 0 0 0 2px #4d2a16, 0 6px 16px rgb(40 24 14 / 27%);
}

.cover-zone {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #6f2019;
  background-image: linear-gradient(rgb(117 24 18 / 50%), rgb(63 12 10 / 54%)), url("../assets/leather.webp");
  background-position: center;
  background-size: auto, 760px auto;
  border-right: 2px solid #b88b42;
}

.era-card-adnd .cover-zone {
  background-color: #172f52;
  background-image: linear-gradient(rgb(23 51 89 / 58%), rgb(7 22 41 / 62%)), url("../assets/leather.webp");
}

.cover-zone img {
  width: auto;
  max-width: 100%;
  max-height: 270px;
  object-fit: contain;
  filter: drop-shadow(5px 7px 6px rgb(0 0 0 / 58%));
}

.era-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 24px;
}

.era-copy h2,
.project-copy h2,
.archive-promo h2 {
  margin: 0 0 10px;
  color: #4d2016;
  font: 700 28px/1.08 var(--display-font);
}

.era-card-adnd .era-copy h2 {
  color: var(--blue);
}

.era-copy p:not(.eyebrow) {
  margin: 0 0 20px;
  color: #594535;
}

.project-banner {
  display: grid;
  min-height: 175px;
  grid-template-columns: minmax(240px, 32%) minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 24px;
  overflow: hidden;
  background: #ead7af;
  border: 3px solid #8c642d;
  box-shadow: inset 0 0 0 2px #4d2a16, 0 6px 16px rgb(40 24 14 / 22%);
}

.project-art {
  align-self: stretch;
}

.project-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-copy {
  min-width: 0;
  padding: 22px 26px;
}

.project-copy p:not(.eyebrow) {
  margin: 0;
  color: #594535;
}

.project-cta {
  padding: 22px 28px 22px 0;
}

/* Pagina di ingresso archivio */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.archive-promo {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(170px, 36%) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 22px;
  background: #ead8b5;
  border: 2px solid #9b743d;
  box-shadow: inset 0 0 0 2px rgb(255 248 227 / 55%);
}

.archive-promo img {
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  filter: drop-shadow(4px 6px 5px rgb(0 0 0 / 38%));
}

.archive-promo p:not(.eyebrow) {
  color: var(--ink-soft);
}

/* Cataloghi */

.catalog-panel {
  scroll-margin-top: 105px;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) repeat(4, minmax(115px, .55fr)) auto;
  align-items: end;
  gap: 12px;
  margin: 26px 0 13px;
  padding: 15px;
  background: #e6d2aa;
  border: 1px solid #b18b4e;
}

.catalog-tools label,
.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.catalog-tools label > span,
.field label {
  color: #5c341f;
  font-size: 12px;
  font-weight: 700;
}

.catalog-tools input,
.catalog-tools select,
.field input,
.field select,
.field textarea,
.admin-editor-form input,
.admin-editor-form select,
.admin-editor-form textarea,
.admin-catalog-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: #2e241b;
  background: #fff9ec;
  border: 1px solid #9e7844;
  border-radius: 0;
}

.catalog-reset {
  min-height: 42px;
  padding: 8px 12px;
  color: #51321f;
  background: #f2e3c5;
  border: 1px solid #9e7844;
  font-weight: 700;
}

.catalog-status {
  margin: 12px 0;
  color: #68543d;
  font-size: 13px;
  font-weight: 700;
}

.active-tag-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0;
  padding: 8px 10px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
  font-size: 13px;
}

.active-tag-filter strong {
  padding: 3px 7px;
  color: var(--blue);
  background: #f7ecd3;
  border: 1px solid #b69761;
}

.active-tag-filter a {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #5d291c;
  background: #dfc699;
  border-radius: 50%;
  font-size: 18px;
  text-decoration: none;
}

.catalog-results {
  display: grid;
  gap: 10px;
}

.catalog-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 92px minmax(0, 1fr) minmax(150px, 185px);
  gap: 18px;
  align-items: center;
  padding: 14px;
  background: #f8efd9;
  border: 1px solid #c1a16e;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 52%);
  transition: background-color .15s ease, border-color .15s ease;
}

.catalog-item:nth-child(even) {
  background: #f1e2c4;
}

.catalog-item:hover {
  background: #fff5df;
  border-color: #987039;
}

.catalog-cover,
.archive-cover-link {
  display: block;
  min-width: 0;
}

.archive-thumbnail {
  width: auto;
  height: auto;
  max-width: 78px;
  max-height: 104px;
  margin: auto;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: 0 5px 11px rgb(43 28 17 / 35%);
  transition: translate .15s ease, box-shadow .15s ease;
}

.cover-placeholder.archive-thumbnail {
  width: 78px;
  height: 104px;
  background: #d9c499;
  border: 1px solid #8d6a3c;
}

.archive-cover-link:hover .archive-thumbnail {
  translate: 0 -2px;
  box-shadow: 0 8px 15px rgb(43 28 17 / 40%);
}

.cover-placeholder {
  display: flex;
  aspect-ratio: 3 / 4;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #ecd79e;
  background-color: #3b281b;
  background-image: linear-gradient(rgb(28 16 10 / 32%), rgb(28 16 10 / 32%)), url("../assets/leather.webp");
  background-size: auto, 520px auto;
  border: 1px solid #8d6a3c;
  text-align: center;
}

.cover-placeholder > span {
  font: 700 27px/1 var(--display-font);
}

.cover-placeholder small {
  font: 700 8px/1.2 var(--display-font);
  letter-spacing: .7px;
  text-transform: uppercase;
}

/* Tag "Novità" in evidenza: modifica richiesta. */
.catalog-new-badge {
  display: inline-block;
  margin: 0 0 7px;
  padding: 4px 8px;
  color: #fff8e8;
  background: #a32121;
  border: 1px solid #741616;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.catalog-editorial-indicators {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 8px;
  color: #695035;
  font-size: 11px;
  line-height: 1.4;
}

.catalog-comment-indicator,
.catalog-review-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.catalog-indicator-icon {
  font-size: 13px;
  line-height: 1;
}

.catalog-comment-indicator {
  font-weight: 700;
}

.catalog-review-indicator {
  color: #79562c;
}

.catalog-copy {
  min-width: 0;
}

.catalog-item-kicker,
.detail-kicker {
  margin: 0 0 4px;
  color: #7a5526;
  font: 700 10px/1.2 var(--display-font);
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.catalog-copy h2 {
  margin: 0 0 7px;
  color: #4f2117;
  font: 700 19px/1.18 var(--body-font);
}

.catalog-copy h2 a {
  text-decoration: none;
}

.catalog-copy h2 a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.catalog-copy p {
  max-width: 82ch;
  white-space: pre-line;
  margin: 8px 0 0;
  color: #5f4b38;
  font-size: 13px;
}

.catalog-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin-top: 8px;
  color: #756047;
  font-size: 11px;
}

.catalog-facts span + span::before {
  margin-right: 13px;
  color: #ad8b58;
  content: "•";
}

.catalog-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: center;
}

.download {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 11px;
  white-space: normal;
}

.download-pending,
.download-rights-pending,
.attachment-link-pending,
.attachment-rights-pending {
  display: inline-flex;
  min-height: 44px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  color: #5c5145;
  background: linear-gradient(#e2ddd4, #c9c1b5);
  border: 2px solid #8f8578;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%), 0 2px 5px rgb(0 0 0 / 16%);
  font: 700 12px/1.2 var(--display-font);
  letter-spacing: .15px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
}

.page-becmi .download-pending,
.page-becmi .download-rights-pending {
  color: #4d302a;
  background: linear-gradient(#ddd8d1, #c5bdb3);
  border-color: #8d7f76;
}

.page-adnd .download-pending,
.page-adnd .download-rights-pending {
  color: #3c4854;
  background: linear-gradient(#dfe2e3, #c4c9cc);
  border-color: #818990;
}

.download-locked {
  background: linear-gradient(#6a5842, #473827);
  box-shadow: inset 0 0 0 1px #2d2118;
}

.catalog-detail-link {
  font-size: 12px;
}

.catalog-attachment-count {
  color: #766047;
  font-size: 10px;
  font-weight: 700;
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.catalog-pagination button {
  min-height: 38px;
  padding: 7px 12px;
  color: #f5e2b3;
  background: linear-gradient(#715033, #452c1a);
  border: 1px solid #b58e4e;
  font-weight: 700;
}

.catalog-pagination button:disabled {
  opacity: .42;
  cursor: default;
}

.catalog-pagination span {
  color: #654e38;
  font-size: 13px;
}

.catalog-empty,
.catalog-error {
  padding: 34px 20px;
  text-align: center;
  background: #f2e4c8;
  border: 1px dashed #ad8751;
}

.catalog-empty h2,
.catalog-error h2 {
  margin: 0;
  font: 700 25px var(--display-font);
}

.catalog-loading {
  display: grid;
  gap: 9px;
}

.catalog-loading span {
  display: block;
  height: 118px;
  background: linear-gradient(100deg, #ead8b8 20%, #f8edd5 40%, #ead8b8 60%);
  background-size: 200% 100%;
  border: 1px solid #c8aa79;
  animation: loading 1.1s linear infinite;
}

@keyframes loading {
  to { background-position-x: -200%; }
}

/* Dettaglio documento */

.document-detail-panel {
  padding: 34px;
}

.document-detail-loading {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #70593f;
}

.document-detail-loading > span {
  width: 42px;
  height: 42px;
  border: 4px solid #c7a46c;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { rotate: 360deg; } }

.detail-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.detail-admin-edit {
  padding: 7px 10px;
  color: var(--blue);
  background: #e3cea5;
  border: 1px solid #927039;
  font-size: 12px;
  font-weight: 700;
}

.document-detail-hero {
  display: grid;
  grid-template-columns: minmax(210px, 285px) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.document-detail-cover {
  display: flex;
  justify-content: center;
}

.detail-cover-image,
.cover-placeholder.detail-cover-image {
  width: 100%;
  max-width: 285px;
  height: auto;
  min-height: 300px;
  object-fit: contain;
  background: #d9c499;
  border: 1px solid #8d6a3c;
  box-shadow: 0 12px 27px rgb(43 28 17 / 48%);
}

.cover-placeholder.detail-cover-image {
  aspect-ratio: 3 / 4;
}

.cover-placeholder.detail-cover-image > span {
  font-size: 58px;
}

.cover-placeholder.detail-cover-image small {
  font-size: 11px;
}

.document-detail-heading {
  min-width: 0;
}

.document-detail-heading h1 {
  margin: 0;
  color: #531b13;
  font: 700 clamp(30px, 4.2vw, 48px)/1.08 var(--body-font);
}

.detail-summary {
  margin: 14px 0 17px;
  white-space: pre-line;
  color: #5d4632;
  font: italic 18px/1.45 var(--body-font);
}

.detail-notice {
  margin-top: 16px;
  padding: 10px 12px;
  color: #53391f;
  background: #e8d7b7;
  border: 1px solid #b18a50;
  font-size: 13px;
}

.detail-notice.warning {
  color: #5f251d;
  background: #ecd1c7;
  border-color: #91473c;
}

.detail-download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 15px;
  background: #e8d5b1;
  border: 1px solid #b58e4e;
  box-shadow: inset 0 0 0 1px #fff6df;
}

.detail-download-box strong,
.detail-download-box span {
  display: block;
}

.detail-download-box span {
  margin-top: 3px;
  color: #6b543c;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.detail-download-button {
  flex: 0 0 auto;
}

.document-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr);
  gap: 20px;
  margin-top: 30px;
}

.detail-section,
.technical-details {
  min-width: 0;
  padding: 21px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
  box-shadow: inset 0 0 0 1px #fff6df;
}

.detail-section-wide {
  grid-column: 1 / -1;
}

.detail-section h2 {
  margin: 0 0 15px;
  color: #532719;
  font: 700 22px/1.15 var(--display-font);
}

.detail-description {
  margin: 0;
  white-space: pre-line;
  line-height: 1.68;
}

.detail-note {
  margin-top: 18px;
  padding: 13px 15px;
  background: #f2e4ca;
  border-left: 4px solid #8c6a3d;
}

.detail-note p {
  margin: 5px 0 0;
}

.detail-meta {
  margin: 0;
}

.detail-meta-row {
  display: grid;
  grid-template-columns: minmax(105px, 140px) minmax(0, 1fr);
  gap: 11px;
  padding: 8px 0;
  border-bottom: 1px solid #c9af7d;
}

.detail-meta-row:first-child { padding-top: 0; }
.detail-meta-row:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-meta-row dt { color: #60442d; font-weight: 700; }
.detail-meta-row dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.detail-relation-link {
  color: var(--blue);
  font-weight: 700;
}

.detail-related-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-related-list li {
  min-width: 0;
  padding: 10px 12px;
  background: #f1e3c9;
  border: 1px solid #c1a26e;
}

.detail-related-list .detail-relation-link {
  display: block;
  overflow-wrap: anywhere;
}

.detail-related-list span {
  display: block;
  margin-top: 3px;
  color: #78684d;
  font-size: 11px;
}

.detail-relation-separator {
  margin: 0 6px;
  color: #8b7456;
}

.detail-tag {
  color: #59432c;
  background: #f3e7d0;
  border-radius: 2px;
  text-decoration: none;
  transition: background-color .15s ease, translate .15s ease;
}

.detail-tag:hover {
  color: var(--blue);
  background: #dfc99e;
  translate: 0 -1px;
  text-decoration: underline;
}

.detail-tag-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
}

.detail-tag-group h3 {
  margin: 0 0 8px;
  color: #65452e;
  font: 700 12px/1.2 var(--display-font);
  letter-spacing: .45px;
  text-transform: uppercase;
}

.document-detail-heading > .provenance-mark {
  margin: 0 0 12px;
}

.detail-empty {
  color: #796851;
  font-style: italic;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}

.detail-section-heading h2 { margin: 0; }
.detail-section-heading span { color: #786650; font-size: 12px; font-weight: 700; }

.detail-attachment-table-wrap {
  overflow-x: auto;
  border: 1px solid #c1a26e;
  background: #fff7e6;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 35%);
}

.detail-attachment-table {
  width: 100%;
  border-collapse: collapse;
  color: #5f4935;
  font-size: 12px;
}

.detail-attachment-table th {
  padding: 9px 11px;
  color: #f3ddb0;
  background: var(--blue);
  border-right: 1px solid #a7844c;
  font: 700 11px/1.2 var(--display-font);
  letter-spacing: .35px;
  text-align: left;
  text-transform: uppercase;
}

.detail-attachment-table th:last-child { border-right: 0; }

.detail-attachment-table td {
  padding: 10px 11px;
  border-top: 1px solid #d7bd8c;
  vertical-align: middle;
}

.detail-attachment-table tbody tr:first-child td { border-top: 0; }
.detail-attachment-table tbody tr:nth-child(even) td { background: #f1e3c6; }
.detail-attachment-table tbody tr:hover td { background: #ead7b5; }

.detail-attachment-name-cell { width: 36%; }
.detail-attachment-file-cell { width: 34%; }
.detail-attachment-format-cell { width: 12%; white-space: nowrap; }
.detail-attachment-type-cell { width: 18%; }

.detail-attachment-file-cell code {
  color: #65452e;
  font: 600 11px/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.detail-file-type {
  display: inline-block;
  min-width: 38px;
  padding: 3px 6px;
  color: #654a31;
  background: #e0ccaa;
  border: 1px solid #b89a67;
  font: 700 10px/1.1 var(--display-font);
  letter-spacing: .25px;
  text-align: center;
}

.detail-attachment-type-cell > span {
  font-weight: 700;
}

.detail-attachment-type-cell small,
.attachment-access-note {
  display: block;
  margin-top: 3px;
  color: #78684d;
  font-size: 10px;
  font-weight: 400;
}

.attachment-name {
  color: #532719;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.attachment-link {
  color: var(--blue);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.attachment-link-locked {
  color: #66503b;
}

.technical-details {
  padding: 16px 20px;
}

.technical-details summary {
  padding: 3px 0;
}

.technical-details[open] summary {
  margin-bottom: 16px;
}

.document-detail-error {
  padding: 45px 20px;
  text-align: center;
}

.document-detail-error h1 {
  font: 700 36px var(--display-font);
}

/* Commenti: sezione accessoria della scheda */

.comments-panel {
  width: min(920px, calc(100% - 22px));
  margin: 18px auto 0;
  padding: 18px 22px;
  background: rgb(234 217 185 / 94%);
  border: 1px solid #9d7a47;
  box-shadow: inset 0 0 0 1px rgb(255 246 223 / 75%);
}

.comments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid #c4aa78;
}

.comments-heading h2 {
  margin: 0;
  color: #532719;
  font: 700 20px/1.15 var(--display-font);
}

.comments-heading p {
  margin: 2px 0 0;
  color: #766249;
  font-size: 12px;
}

.comments-heading > span {
  min-width: 28px;
  padding: 2px 8px;
  color: #60472f;
  background: #d9c49a;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.comment-item {
  padding: 15px 2px;
  border-bottom: 1px solid #ccb587;
}

.comment-item.is-pending {
  margin: 9px 0;
  padding: 13px;
  background: #f0dfbf;
  border: 1px dashed #9f7842;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 7px 11px;
  flex-wrap: wrap;
  color: #746048;
  font-size: 11px;
}

.comment-meta strong {
  color: #55321f;
  font-size: 13px;
}

.comment-meta > span {
  padding: 1px 6px;
  color: #693a20;
  background: #dec18f;
  border: 1px solid #aa7d3e;
  font-weight: 700;
}

.comment-meta small {
  font-style: italic;
}

.comment-body {
  margin: 7px 0 0;
  line-height: 1.58;
}

.comment-actions,
.comment-admin-actions {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.comment-actions form,
.comment-admin-actions form {
  margin: 0;
}

.text-button.danger {
  color: var(--danger);
}

.comment-edit {
  min-width: 0;
}

.comment-edit summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.comment-edit form {
  display: grid;
  gap: 8px;
  min-width: min(620px, 75vw);
  margin-top: 9px;
}

.comment-edit textarea,
.comment-form textarea,
.comment-admin-filter input {
  width: 100%;
  padding: 9px 11px;
  color: #2e241b;
  background: #fff9ec;
  border: 1px solid #9e7844;
  border-radius: 0;
  resize: vertical;
}

.comment-form {
  position: relative;
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #b99a65;
}

.comment-form > label {
  color: #5c341f;
  font-size: 12px;
  font-weight: 700;
}

.comment-form > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.comment-form small {
  color: #756049;
}

.comment-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.comments-empty,
.comment-login {
  margin: 15px 0 0;
  color: #756049;
  font-size: 13px;
  font-style: italic;
}

.comment-login a,
.comment-document-link {
  color: var(--blue);
  font-weight: 700;
}

/* Moderazione amministrativa */

.comments-admin-panel {
  padding: 32px;
}

.comment-admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 25px 0 16px;
}

.comment-admin-summary a {
  padding: 14px;
  color: #5c3a23;
  background: #ead8b7;
  border: 1px solid #b58e4e;
  text-align: center;
  text-decoration: none;
}

.comment-admin-summary a[aria-current="page"] {
  color: #f1ddb0;
  background: #342218;
  border-color: #b68a45;
}

.comment-admin-summary strong,
.comment-admin-summary span {
  display: block;
}

.comment-admin-summary strong {
  font: 700 25px var(--display-font);
}

.comment-admin-summary span {
  font-size: 11px;
}

.comment-admin-filter {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
}

.comment-admin-filter label {
  color: #5c341f;
  font-size: 12px;
  font-weight: 700;
}

.comment-admin-filter > div {
  display: flex;
  gap: 9px;
}

.comment-admin-card {
  margin-top: 11px;
  padding: 17px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
  box-shadow: inset 0 0 0 1px #fff6df;
}

.comment-admin-card.is-pending {
  border-left: 5px solid #9a6429;
}

.comment-admin-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.comment-admin-card > header strong,
.comment-admin-card > header time {
  display: block;
}

.comment-admin-card > header time {
  color: #756049;
  font-size: 11px;
}

.comment-admin-card > header > span {
  padding: 2px 7px;
  color: #60472f;
  background: #d9c49a;
  border: 1px solid #ad8952;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.comment-admin-card > p {
  margin: 11px 0;
}

.comment-document-link {
  display: inline-block;
  font-size: 12px;
}

.comment-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}

.comment-pagination a {
  min-width: 34px;
  padding: 6px;
  color: #51321f;
  background: #ead8b7;
  border: 1px solid #9e7844;
  text-align: center;
  text-decoration: none;
}

.comment-pagination a[aria-current="page"] {
  color: #fff3d3;
  background: var(--blue);
}

/* Pagine editoriali: FAQ, carte, supporto e social */

.about-heading,
.cards-hero {
  text-align: center;
}

.about-pillars,
.support-reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin: 28px 0;
}

.about-pillar,
.support-reason {
  padding: 20px;
  text-align: center;
  background: #f4e7cd;
  border: 1px solid #b98e4a;
  box-shadow: inset 0 0 0 3px #ead6ae;
}

.about-pillar-icon,
.support-reason-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #f1ddb0;
  background: var(--blue);
  border: 2px solid #b78b43;
  border-radius: 50%;
  font: 700 18px var(--display-font);
}

.about-pillar h2,
.support-reason h2 {
  margin: 11px 0 7px;
  color: #4f2618;
  font: 700 20px var(--display-font);
}

.about-pillar p,
.support-reason p {
  margin: 0;
  color: #604c39;
  font-size: 13px;
}

.faq-section,
.about-actions {
  margin-top: 34px;
}

.faq-list {
  max-width: 920px;
  margin: 20px auto 0;
}

.faq-item {
  margin-top: 9px;
  background: #f8eed8;
  border: 1px solid #b68a45;
  box-shadow: inset 0 0 0 3px #ead7ad;
}

.faq-item summary {
  padding: 14px 17px;
  color: #4d2819;
  cursor: pointer;
  font: 700 16px/1.3 var(--display-font);
}

.faq-answer {
  padding: 0 17px 15px;
  color: #5f4937;
}

.faq-answer p {
  margin: 8px 0 0;
}

.faq-answer a,
.about-action-card a:not(.fantasy-button) {
  color: var(--blue);
  font-weight: 700;
}

.about-action-card .fantasy-button,
.about-action-card .fantasy-button:visited {
  color: #f8e5b8;
}

.about-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 19px;
}

.about-action-card {
  padding: 21px;
  background: #f7ead1;
  border: 1px solid #b78d4e;
}

.about-action-card h3 {
  margin: 0 0 8px;
  color: #4f2618;
  font: 700 21px var(--display-font);
}

.about-closing-note,
.guide-closing-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 28px;
  padding: 15px 18px;
  color: #f1ddb0;
  background-color: #20170f;
  background-image: linear-gradient(rgb(28 18 11 / 28%), rgb(13 9 6 / 38%)), url("../assets/leather.webp");
  background-size: auto, 760px auto;
  border: 2px solid #b68a45;
  text-align: center;
}

.cards-cover {
  width: min(100%, 900px);
  margin: 22px auto 28px;
  border: 2px solid #9a713d;
  box-shadow: var(--shadow);
}

.cards-content {
  max-width: 1040px;
  margin: auto;
}

.cards-content > p,
.cards-content > section:not(.cards-detail) {
  max-width: 850px;
  margin-right: auto;
  margin-left: auto;
}

.cards-features {
  max-width: 790px;
  margin: 17px auto 27px;
  padding-left: 24px;
}

.cards-detail {
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(0, 1.25fr);
  gap: 27px;
  align-items: center;
  margin: 34px 0;
  padding: 23px;
  background: #f4e7cd;
  border: 1px solid #b98e4a;
}

.cards-detail.reverse {
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr);
}

.cards-detail img {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.cards-detail h2,
.cards-content section > h2,
.cards-action h2 {
  color: #4f2618;
  font: 700 25px var(--display-font);
}

.cards-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.cards-action {
  padding: 18px;
  text-align: center;
  background: #ead9b9;
  border: 1px solid #b58e4e;
}

.cards-action h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.support-lead {
  max-width: 760px;
}

.kofi-donation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  max-width: 890px;
  margin: 30px auto 0;
  padding: 24px;
  background: #e7d2aa;
  border: 2px solid #a57b3f;
}

.kofi-eyebrow {
  margin: 0 0 5px;
  color: #7a5526;
  font: 700 10px var(--display-font);
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.kofi-donation-copy h2 {
  margin: 0;
  color: #4f2618;
  font: 700 27px var(--display-font);
}

.kofi-widget-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kofi-widget-area small {
  max-width: 230px;
  color: #6b553d;
  font-size: 10px;
  text-align: center;
}

.support-thanks {
  margin: 25px 0 0;
  text-align: center;
}

.social-callout {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  max-width: 650px;
  margin: 26px auto 0;
}

.social-callout h2 {
  margin: 0 0 5px;
  font: 700 22px var(--display-font);
}

/* Moduli, account e autenticazione */

.form-grid,
.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field {
  margin-bottom: 14px;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.contact-form,
.auth-form,
.auth-single,
.account-card {
  max-width: 740px;
  margin-inline: auto;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #5d4835;
  font-size: 13px;
}

.check-field input {
  margin-top: 4px;
}

.privacy-consent {
  max-width: 740px;
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid rgba(112, 75, 31, 0.45);
  background: rgba(255, 248, 225, 0.58);
  border-radius: 3px;
  line-height: 1.6;
}

.privacy-consent p {
  margin: 0;
  color: #5d4835;
  font-size: 12px;
  line-height: 1.6;
}

.privacy-consent a {
  font-weight: 700;
}

.privacy-consent-check {
  margin-top: 12px;
  font-weight: 700;
}

.privacy-consent-check span {
  color: #4d3625;
}

.privacy-consent input:focus-visible {
  outline: 2px solid #704b1f;
  outline-offset: 2px;
}

.fantasy-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 17px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.form-help {
  color: #67513d;
  font-size: 12px;
}

.form-alert {
  max-width: 740px;
  margin: 0 auto 17px;
  padding: 12px 15px;
  border: 1px solid;
}

.form-alert ul {
  margin: 0;
  padding-left: 20px;
}

.form-alert-error {
  color: #5b1d15;
  background: #f2d7cb;
  border-color: #8d3526;
}

.auth-grid {
  gap: 20px;
}

.auth-choice {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  align-items: flex-start;
}

.auth-choice h2 {
  margin: 0;
  font: 700 24px var(--display-font);
}

.auth-choice p {
  flex: 1;
}

.inline-form {
  display: inline;
  margin: 0;
}

.account-details {
  margin: 0 0 20px;
}

.account-details > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #c6a872;
}

.account-details dt {
  color: #4c2518;
  font-weight: 700;
}

.account-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.email-status {
  display: inline-block;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #9e7f4c;
}

.email-status.verified {
  color: #3c5428;
  background: #e2e5c8;
  border-color: #6e814e;
}

.email-status.pending {
  color: #70431f;
  background: #ead4ad;
  border-color: #a7743f;
}

.email-verification-box,
.admin-access-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 22px;
  padding: 17px;
  background: #ead4ad;
  border: 1px solid #a7743f;
}

.admin-access-request {
  background: #ead9b9;
  border-color: #b58e4e;
}

.email-verification-box h2,
.admin-access-request h2 {
  margin: 0 0 5px;
  color: #532719;
  font: 700 19px var(--display-font);
}

.email-verification-box p,
.admin-access-request p {
  margin: 0;
  color: #62452d;
  font-size: 13px;
}

.verification-wait {
  margin-top: 7px !important;
}

.admin-dashboard {
  margin-top: 23px;
  padding: 20px;
  color: #f1ddb0;
  background-color: #20170f;
  background-image: linear-gradient(rgb(28 18 11 / 28%), rgb(13 9 6 / 38%)), url("../assets/leather.webp");
  background-size: auto, 760px auto;
  border: 2px solid #b68a45;
}

.admin-dashboard h2 {
  margin: 0;
  color: #f0cc7e;
  font: 700 26px var(--display-font);
}

.admin-dashboard > div > p:last-child {
  margin: 5px 0 17px;
  color: #d4c09a;
}

.admin-dashboard-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.admin-dashboard-links a {
  padding: 12px;
  color: #f0d79f;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(209 168 91 / 55%);
  text-decoration: none;
}

.admin-dashboard-links strong,
.admin-dashboard-links span {
  display: block;
}

.admin-dashboard-links span {
  color: #c8b58e;
  font-size: 11px;
}

.admin-mode-pill {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  color: #f7e6b9;
  border: 1px solid #c79c4f;
  font: 700 9px var(--body-font);
  font-style: normal;
  letter-spacing: .6px;
  vertical-align: 2px;
}

.admin-mode-pill.development { background: #734520; }
.admin-mode-pill.production { background: var(--green); }

/* Cache e modalità sviluppo */

.cache-admin-panel {
  max-width: 1080px;
  margin-inline: auto;
}

.cache-current-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 18px;
  padding: 15px 18px;
  color: #f3dfb4;
  background-color: #261b12;
  background-image: linear-gradient(rgb(28 18 11 / 24%), rgb(13 9 6 / 38%)), url("../assets/leather.webp");
  background-size: auto, 760px auto;
  border: 2px solid #b68a45;
}

.cache-current-mode > div > span,
.cache-current-mode > div > strong {
  display: block;
}

.cache-current-mode > div > span {
  color: #d6bb87;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.cache-current-mode > div > strong {
  margin-top: 2px;
  color: #f2cf83;
  font: 700 22px var(--display-font);
}

.cache-current-mode small {
  color: #cdbb98;
}

.cache-current-mode.development { border-left: 8px solid #a3632c; }
.cache-current-mode.production { border-left: 8px solid #4f7640; }

.cache-mode-form {
  margin: 0;
}

.cache-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cache-mode-option {
  position: relative;
  display: block;
  min-width: 0;
  padding: 20px;
  cursor: pointer;
  background: #f5e8ce;
  border: 2px solid #b99152;
  box-shadow: inset 0 0 0 3px #ead6ac;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.cache-mode-option:hover {
  transform: translateY(-1px);
  border-color: #84602f;
}

.cache-mode-option:has(input:checked) {
  border-color: #5e3d22;
  box-shadow: inset 0 0 0 3px #d9bd84, 0 7px 16px rgb(58 35 19 / 14%);
}

.cache-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cache-mode-option:has(input:focus-visible) {
  outline: 3px solid #a37635;
  outline-offset: 3px;
}

.cache-mode-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cache-mode-option-head b {
  color: #72411e;
  font-size: 10px;
  letter-spacing: .9px;
}

.cache-mode-option.production .cache-mode-option-head b { color: #36592e; }

.cache-mode-option-head i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: transparent;
  background: #e3d1ad;
  border: 1px solid #9f7c49;
  border-radius: 50%;
  font-style: normal;
}

.cache-mode-option:has(input:checked) .cache-mode-option-head i {
  color: white;
  background: #815027;
}

.cache-mode-option.production:has(input:checked) .cache-mode-option-head i {
  background: var(--success);
}

.cache-mode-option > strong {
  display: block;
  color: #4f2618;
  font: 700 23px var(--display-font);
}

.cache-mode-option p,
.cache-mode-option li {
  color: #624d38;
  font-size: 13px;
}

.cache-mode-option p {
  margin: 7px 0 12px;
}

.cache-mode-option ul {
  margin: 0;
  padding-left: 19px;
}

.cache-mode-option li + li {
  margin-top: 5px;
}

.cache-mode-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 16px;
  background: #e8d5b1;
  border: 1px solid #b58e4e;
}

.cache-mode-actions strong,
.cache-mode-actions span {
  display: block;
}

.cache-mode-actions strong { color: #50301d; }
.cache-mode-actions span { margin-top: 3px; color: #6a543d; font-size: 12px; }
.cache-mode-actions .fantasy-button { flex: 0 0 auto; }

.cache-safety-note {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f0e2c5;
  border-left: 4px solid #8a6737;
}

.cache-safety-note strong { color: #4d2a19; }
.cache-safety-note p { margin: 3px 0 0; color: #67513b; font-size: 12px; }

/* Editor amministrativo */

.admin-catalog-title-row,
.admin-new-header,
.admin-guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.admin-catalog-title-row .page-title,
.admin-new-header .page-title,
.admin-guide-heading .page-title {
  text-align: left;
}

.admin-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

.admin-editor-alert,
.admin-editor-status {
  margin: 14px 0;
  padding: 10px 12px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
}

.admin-editor-alert.error,
.admin-editor-status.error {
  color: #5f251d;
  background: #ecd1c7;
  border-color: #91473c;
}

.admin-editor-status.ok {
  color: #3f5429;
  background: #e2e4c5;
  border-color: #718650;
}

.admin-editor-status span {
  margin-left: 8px;
  color: #69543c;
}

.admin-catalog-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 21px;
}

.admin-catalog-sidebar,
.admin-catalog-editor {
  min-width: 0;
}

.admin-catalog-search label {
  display: block;
  margin-bottom: 5px;
  color: #5a2c1c;
  font-weight: 700;
}

.admin-catalog-search-row {
  display: flex;
  gap: 6px;
}

.admin-catalog-search-row input {
  min-width: 0;
}

.admin-catalog-search-row button {
  padding: 7px 10px;
}

.admin-document-count {
  margin: 9px 0 6px;
  color: #79664b;
  font-size: 12px;
}

.admin-document-list {
  max-height: 72vh;
  overflow: auto;
  background: #ead9b9;
  border: 1px solid #b58e4e;
}

.admin-document-list a {
  display: block;
  padding: 9px 10px;
  color: #3f2b1d;
  border-bottom: 1px solid #cbb384;
  text-decoration: none;
}

.admin-document-list a:hover { background: #f1e4cb; }
.admin-document-list a.selected { background: #d9c49a; box-shadow: inset 4px 0 var(--blue); }
.admin-document-list strong,
.admin-document-list span { display: block; }
.admin-document-list strong { font-size: 13px; line-height: 1.25; }
.admin-document-list span { margin-top: 3px; color: #78684d; font-size: 11px; }

.admin-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #b99b68;
}

.admin-editor-heading h2 {
  margin: 3px 0 5px;
  color: #532719;
  font: 700 27px/1.12 var(--display-font);
}

.admin-editor-heading code {
  display: block;
  max-width: 680px;
  font-size: 10px;
}

.admin-editor-form fieldset {
  margin: 18px 0 0;
  padding: 16px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
}

.admin-editor-form legend {
  padding: 0 7px;
  color: #532719;
  font: 700 18px var(--display-font);
}

.admin-editor-form label {
  display: block;
  color: #5f432d;
  font-size: 12px;
  font-weight: 700;
}

.admin-editor-form label small {
  color: #7a6850;
  font-weight: 400;
}

.admin-editor-form input,
.admin-editor-form select,
.admin-editor-form textarea {
  margin-top: 4px;
}

.admin-editor-form textarea {
  min-height: 84px;
  resize: vertical;
}

.admin-form-grid {
  display: grid;
  gap: 12px;
}

.admin-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid .wide {
  grid-column: 1 / -1;
}

.admin-field-help {
  margin: 0 0 12px;
  color: #78684d;
  font-size: 12px;
}

.type-new-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #cbb384;
  border-radius: 6px;
  background: #f7eddc;
}

.type-new-checkbox {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  margin: 0 !important;
  color: #3f3425;
  font-size: 16px !important;
  font-weight: 400 !important;
  cursor: pointer;
}

.admin-editor-form .type-new-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #5d4a32;
}

.type-new-checkbox span {
  line-height: 1.3;
}

@media (max-width: 700px) {
  .type-new-checkbox-list {
    grid-template-columns: 1fr;
  }
}

.admin-attachments-editor {
  display: grid;
  gap: 10px;
}

.admin-attachment-card {
  padding: 12px;
  background: #f2e5ce;
  border: 1px solid #c2a472;
}

.admin-attachment-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-attachment-top code {
  max-width: 65%;
  font-size: 10px;
}

.admin-keep-attachment {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

.admin-keep-attachment input {
  width: auto !important;
  min-height: 0;
  margin: 0 !important;
}

.admin-technical-fields dl { margin: 0; }
.admin-technical-fields dl > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid #cbb384; }
.admin-technical-fields dd { margin: 0; }

.admin-save-bar {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 13px 15px;
  background: #dcc291;
  border: 1px solid #8c6937;
  box-shadow: 0 -4px 16px rgb(43 27 18 / 20%);
}

.admin-save-bar strong,
.admin-save-bar span { display: block; }
.admin-save-bar span { margin-top: 2px; color: #69543c; font-size: 11px; }

.admin-editor-empty {
  padding: 50px 20px;
  border: 1px dashed #b58e4e;
  text-align: center;
}

.admin-backup-list {
  margin-top: 18px;
  padding: 10px 12px;
  background: #efe1c6;
  border: 1px solid #c1a26e;
  font-size: 12px;
}

.admin-backup-list summary { cursor: pointer; font-weight: 700; }

.admin-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-upload-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-upload-box {
  padding: 15px;
  background: #f1e4cb;
  border: 1px dashed #9f7d48;
}

.admin-upload-box > span {
  display: block;
  margin-bottom: 7px;
  color: #532719;
  font-size: 14px;
}

.admin-upload-box input[type="file"] {
  margin: 0 0 7px;
}

.admin-upload-box small {
  display: block;
  color: #78684d;
  font-weight: 400;
}

.admin-create-warning {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 13px;
  color: #53391f;
  background: #e8d7b7;
  border: 1px solid #b18a50;
  font-size: 12px;
}

/* Guida amministratore */

.admin-guide-heading {
  align-items: center;
}

.admin-guide-heading .lead {
  margin-bottom: 0;
  text-align: left;
}

.admin-health {
  margin: 28px 0;
  padding: 20px;
  background: #e8d5b1;
  border: 1px solid #b58e4e;
}

.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

.health-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: #f4ead4;
  border: 1px solid #a78d61;
}

.health-card > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--success);
  border-radius: 50%;
  font-weight: 700;
}

.health-card.warning > span { background: var(--danger); }
.health-card strong,
.health-card small { display: block; }
.health-card small { color: #6b573f; }

.admin-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-card {
  position: relative;
  padding: 22px;
  background: #f5e8ce;
  border: 1px solid #b99152;
}

.guide-card-important {
  background: #ead8b5;
  border-width: 2px;
}

.guide-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #f2dfb5;
  background: var(--blue);
  border: 2px solid #b78b43;
  border-radius: 50%;
  font: 700 16px var(--display-font);
}

.guide-card h2 {
  margin: 11px 0 8px;
  color: #4f2618;
  font: 700 22px var(--display-font);
}

.guide-card p,
.guide-card li {
  color: #5f4a37;
  font-size: 13px;
}

.guide-card ol,
.guide-card ul {
  padding-left: 20px;
}

.guide-card a {
  color: var(--blue);
  font-weight: 700;
}

/* Statistiche */

.stats-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.stats-heading .page-title,
.stats-heading .lead {
  text-align: left;
}

.stats-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
  padding: 10px;
  background: #e3cfaa;
  border: 1px solid #b58e4e;
}

.stats-periods a {
  padding: 8px 12px;
  color: #43301f;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.stats-periods a.active {
  color: #f7e5b5;
  background: var(--blue);
  border-color: #b58e4e;
}

.stats-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  min-height: 125px;
  flex-direction: column;
  padding: 16px;
  background: #f7ecd3;
  border: 1px solid #b58e4e;
  box-shadow: inset 0 0 0 3px #ead6aa;
}

.stat-label {
  color: #6b4a25;
  font: 700 11px var(--display-font);
  letter-spacing: .7px;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--blue);
  font: 700 34px/1 var(--display-font);
}

.stat-card small {
  margin-top: auto;
  color: #6a5439;
}

.stats-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 15px 18px;
  color: #f3ddb0;
  background-color: #2b2018;
  background-image: url("../assets/leather.webp");
  background-size: 760px auto;
  border: 2px solid #b58e4e;
}

.stats-highlight span { display: block; color: #d4ad61; font: 700 10px var(--display-font); letter-spacing: 1.1px; text-transform: uppercase; }
.stats-highlight strong { overflow-wrap: anywhere; }
.stats-highlight b { flex: 0 0 auto; padding: 8px 11px; color: #f8e7bc; background: var(--blue); border: 1px solid #d0a551; font-size: 12px; }

.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.stats-chart,
.stats-table-section {
  min-width: 0;
  padding: 17px;
  background: #f7ecd3;
  border: 1px solid #b58e4e;
}

.stats-chart-wide { grid-column: 1 / -1; }
.stats-section-heading h2 { margin: 0; color: #4c2518; font: 700 21px var(--display-font); }
.stats-section-heading p { margin: 3px 0 0; color: #6a5439; font-size: 12px; }

.chart-shell {
  position: relative;
  min-height: 270px;
  margin-top: 14px;
}

.chart-shell-tall { min-height: 340px; }
.chart-shell canvas { display: block; width: 100%; height: 270px; }
.chart-shell-tall canvas { height: 340px; }
.chart-empty { display: flex; min-height: 220px; align-items: center; justify-content: center; margin: 0; padding: 20px; color: #705b40; background: #f3e4c6; border: 1px dashed #b58e4e; text-align: center; }

.stats-table-section { margin-top: 16px; }
.stats-table-wrap { overflow-x: auto; margin-top: 13px; border: 1px solid #c6a872; }
.stats-table { width: 100%; border-collapse: collapse; background: #fff7e6; font-size: 12px; }
.stats-table th { padding: 10px 11px; color: #f3ddb0; background: var(--blue); border-right: 1px solid #a7844c; text-align: left; text-transform: uppercase; }
.stats-table td { padding: 10px 11px; border-top: 1px solid #d7bd8c; vertical-align: top; }
.stats-table tbody tr:nth-child(even) td { background: #f1e3c6; }
.stats-table td small { display: block; color: #715b40; overflow-wrap: anywhere; }
.stats-empty-cell { padding: 27px !important; text-align: center; }
.activity-badge { display: inline-block; padding: 3px 7px; border: 1px solid #94743d; font-size: 10px; font-weight: 700; }
.activity-download { color: var(--blue); background: #dce4ec; border-color: #597394; }
.activity-registrazione { color: #59421d; background: #e5e1cf; }
.activity-catalog_update,
.activity-catalog_create { color: #3f5429; background: #e2e4c5; border-color: #718650; }

/* Pagine istituzionali */
.institutional-panel {
  max-width: 1040px;
  margin-inline: auto;
}

.institutional-heading {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.institutional-heading .eyebrow,
.institutional-heading .about-kicker,
.institutional-heading .support-kicker {
  margin-bottom: 5px;
}

.institutional-panel > .lead {
  max-width: 800px;
  margin-inline: auto;
}

.institutional-panel .section-heading {
  max-width: 800px;
  margin-inline: auto;
}

.about-us-panel { max-width: 1040px; margin-inline: auto; }
.about-us-content { max-width: 800px; margin-inline: auto; }
.about-us-content p { margin: 0 0 18px; }
.about-us-content p:last-child { margin-bottom: 0; }

.about-us-links,
.about-us-contact {
  max-width: 800px;
  margin-inline: auto;
}

/* Collegamenti e contatti delle pagine istituzionali */
.institutional-panel .section-heading {
  margin-bottom: 17px;
}

.institutional-panel .section-heading h2 {
  margin: 0 0 5px;
  color: #4f2618;
  font: 700 23px/1.2 var(--display-font);
}

.institutional-panel .section-heading p {
  margin: 0;
  color: #6b553d;
  font-size: 13px;
}

.about-us-links {
  margin-top: 32px;
  padding-top: 27px;
  border-top: 1px solid #c4a36d;
}

.about-us-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.about-us-link-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  color: var(--ink);
  background: #f4e7cd;
  border: 1px solid #b98e4a;
  box-shadow: inset 0 0 0 2px #ead6ae;
  text-decoration: none;
  transition: translate .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.about-us-link-card:hover {
  translate: 0 -2px;
  background: #f8edd9;
  box-shadow: 0 7px 14px rgb(35 22 13 / 12%), inset 0 0 0 2px #ead6ae;
}

.about-us-link-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.about-us-link-card strong,
.about-us-link-card small {
  display: block;
}

.about-us-link-card strong {
  color: #4f2618;
  font: 700 16px/1.2 var(--display-font);
}

.about-us-link-card small {
  margin-top: 4px;
  color: #6a543b;
  font-size: 11px;
  line-height: 1.4;
}

.about-us-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 18px 20px;
  color: #f1ddb0;
  background-color: #20170f;
  background-image: linear-gradient(rgb(28 18 11 / 28%), rgb(13 9 6 / 38%)), url("../assets/leather.webp");
  background-size: auto, 760px auto;
  border: 2px solid #b68a45;
}

.about-us-contact-kicker {
  margin: 0 0 3px;
  color: #d6b36b;
  font: 700 10px var(--display-font);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.about-us-contact h2 {
  margin: 0;
  color: #f0d18d;
  font: 700 22px/1.2 var(--display-font);
}

.about-us-contact p:not(.about-us-contact-kicker) {
  margin: 5px 0 0;
  color: #d2c09a;
  font-size: 12px;
}

.about-us-contact-email {
  flex: 0 0 auto;
  color: #f5d998;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.social-callout {
  max-width: 800px;
  margin-top: 27px;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 26%);
}

.kofi-donation-card {
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 26%);
}

/* Footer */

.site-footer {
  color: #e9d5a7;
  background-color: #18120d;
  background-image: linear-gradient(rgb(20 13 8 / 20%), rgb(8 6 4 / 42%)), url("../assets/leather.webp");
  background-size: auto, 760px auto;
  border-top: 3px solid #9b7135;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-right: 1px solid rgb(185 139 62 / 48%);
  border-left: 1px solid rgb(185 139 62 / 48%);
}

.footer-block {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  align-items: center;
  padding: 18px 13px;
  border-right: 1px solid rgb(185 139 62 / 48%);
}

.footer-block:last-child { border-right: 0; }
.footer-block img { width: 46px; height: 46px; object-fit: contain; }
.footer-block h2 { margin: 0; color: #d8ae5c; font: 700 17px var(--display-font); }
.footer-block p { margin: 3px 0 5px; color: #cfbd96; font-size: 10px; line-height: 1.4; }
.footer-block a { color: #f0d18d; font-size: 10px; font-weight: 700; }

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 13px;
  color: #bda982;
  border-top: 1px solid rgb(185 139 62 / 42%);
  font-size: 10px;
}

.footer-meta p { margin: 0; }
.footer-meta a { color: #e7cb8a; white-space: nowrap; }

/* Classificazione amministrativa */

.classification-admin-panel {
  max-width: 1120px;
  margin-inline: auto;
}

.classification-intro,
.classification-migrate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 24px;
  padding: 18px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
}

.classification-intro > div,
.classification-migrate > div {
  display: flex;
  min-width: 220px;
  flex-direction: column;
  gap: 3px;
}

.classification-intro p { margin: 0; }
.classification-intro span,
.classification-migrate span { color: #705a42; font-size: 12px; }

.classification-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.classification-summary-grid section,
.classification-rules {
  padding: 20px;
  background: #f2e4c8;
  border: 1px solid #c1a16e;
}

.classification-summary-grid h2,
.classification-rules h2 {
  margin: 0 0 14px;
  color: #552619;
  font: 700 22px/1.2 var(--display-font);
}

.classification-summary-grid dl { margin: 0; }
.classification-summary-grid dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #d0b98e;
}
.classification-summary-grid dl div:last-child { border-bottom: 0; }
.classification-summary-grid dt { font-size: 12px; font-weight: 700; }
.classification-summary-grid dd { margin: 0; font-weight: 700; }

.classification-rules { margin-top: 18px; }
.classification-rules ul { margin-bottom: 0; }
.classification-migrate { margin-top: 18px; background: #e7d1a4; }

/* Responsive */

@media (max-width: 1160px) {
  .brand { width: 285px; }
  .brand-title { font-size: 21px; }
  .brand-tagline { font-size: 8px; }
  .brand-subtitle { display: none; }
  .top-nav > a { padding-inline: 9px; font-size: 11px; }
  .top-nav .login-link { min-width: 133px; padding-inline: 10px; }
  .era-card { grid-template-columns: 180px minmax(0, 1fr); }
  .era-copy { padding: 24px 20px; }
  .era-copy h2 { font-size: 24px; }
  .archive-promo { grid-template-columns: 145px minmax(0, 1fr); }
  .catalog-tools { grid-template-columns: minmax(250px, 1.6fr) repeat(4, minmax(110px, .55fr)) auto; }
  .catalog-reset { grid-column: auto; justify-self: stretch; }
}

@media (max-width: 960px) {
  .header-inner { min-height: 74px; align-items: center; }
  .brand { width: auto; flex: 1; padding-block: 6px; }
  .brand img { width: 66px; height: 58px; }
  .brand-title { font-size: 20px; }
  .menu-toggle { display: block; }
  .top-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background-color: #1c140e;
    background-image: url("../assets/leather.webp");
    background-size: 760px auto;
    border: 2px solid #8e652e;
    box-shadow: 0 12px 23px rgb(0 0 0 / 55%);
  }
  .js .top-nav { display: none; }
  .js .top-nav.open { display: flex; }
  .top-nav > a { min-height: 48px; justify-content: flex-start; padding: 0 18px; border-top: 1px solid rgb(185 139 62 / 22%); border-left: 0; font-size: 13px; }
  .top-nav .login-link { min-height: 50px; align-self: stretch; align-items: flex-start; margin: 7px 12px 12px; }

  .hero,
  .hero-inner { min-height: 560px; }
  .hero-copy { width: min(820px, 88%); }
  .eras,
  .archive-grid { grid-template-columns: 1fr; }
  .era-card { grid-template-columns: minmax(190px, 32%) minmax(0, 1fr); }
  .project-banner { grid-template-columns: 230px minmax(0, 1fr); }
  .project-cta { grid-column: 2; padding: 0 24px 22px; }
  .archive-promo { grid-template-columns: minmax(180px, 30%) minmax(0, 1fr); }

  .catalog-item { grid-template-columns: 88px minmax(0, 1fr); }
  .catalog-actions { grid-column: 2; flex-direction: row; align-items: center; text-align: left; }
  .catalog-actions .download { min-width: 145px; }

  .document-detail-hero { grid-template-columns: 240px minmax(0, 1fr); }
  .document-detail-grid { grid-template-columns: 1fr; }
  .detail-section-wide { grid-column: auto; }

  .admin-catalog-layout { grid-template-columns: 1fr; }
  .admin-document-list { max-height: 330px; }
  .admin-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .about-us-links-grid { grid-template-columns: 1fr; }
  .about-us-contact { align-items: flex-start; flex-direction: column; }
  .about-us-contact-email { white-space: normal; overflow-wrap: anywhere; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-block:nth-child(2) { border-right: 0; }
  .footer-block:nth-child(n + 3) { border-top: 1px solid rgb(185 139 62 / 42%); }
  .container { width: min(100% - 20px, var(--content-width)); }
  .panel { padding: 28px 20px; }
  .ornate-frame { --corner-size: 47px; }
  .page-title,
  .page-heading h1 { font-size: clamp(31px, 8vw, 46px); }

  .hero,
  .hero-inner { min-height: 560px; }
  .hero-copy { width: 100%; padding: 44px 20px; }
  .hero h1 { font-size: clamp(43px, 12vw, 62px); }
  .hero .eyebrow { font-size: 12px; letter-spacing: 1.5px; }
  .hero-lead { padding-inline: 18px; }
  .hero-actions { flex-direction: column; gap: 8px; }

  .home-frame { --corner-size: 52px; padding: 37px 18px 22px; }
  .era-card { grid-template-columns: minmax(150px, 34%) minmax(0, 1fr); }
  .cover-zone { padding: 15px; }
  .project-banner { grid-template-columns: 1fr; }
  .project-art { height: 190px; }
  .project-copy { padding-bottom: 10px; }
  .project-cta { grid-column: auto; padding: 0 22px 23px; }
  .archive-promo { grid-template-columns: minmax(140px, 32%) minmax(0, 1fr); }

  .catalog-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-search-field { grid-column: 1 / -1; }
  .catalog-reset { grid-column: 1 / -1; width: 100%; }

  .document-detail-hero { grid-template-columns: 1fr; }
  .detail-cover-image,
  .cover-placeholder.detail-cover-image { max-width: 240px; min-height: 280px; }
  .document-detail-heading { text-align: center; }
  .document-detail-heading .badge-list { justify-content: center; }
  .document-detail-heading > .provenance-mark { margin-inline: auto; }
  .detail-tag-groups { grid-template-columns: 1fr; }
  .detail-related-list { grid-template-columns: 1fr; }
  .detail-download-box { text-align: left; }
  .comment-admin-summary { grid-template-columns: 1fr; }
  .comment-admin-filter > div { align-items: stretch; flex-direction: column; }
  .comment-admin-filter button { width: 100%; }

  .about-pillars,
  .support-reasons,
  .cards-actions { grid-template-columns: 1fr; }
  .cards-detail,
  .cards-detail.reverse { grid-template-columns: 1fr; }
  .cards-detail.reverse img { grid-row: 1; }
  .kofi-donation-card { grid-template-columns: 1fr; text-align: center; }
  .social-callout { grid-template-columns: 75px minmax(0, 1fr); }
  .form-grid,
  .auth-grid { grid-template-columns: 1fr; }
  .admin-dashboard-links,
  .admin-guide-grid,
  .stats-chart-grid,
  .cache-mode-options { grid-template-columns: 1fr; }
  .classification-summary-grid { grid-template-columns: 1fr; }
  .classification-intro,
  .classification-migrate { align-items: stretch; flex-direction: column; }
  .stats-chart-wide { grid-column: auto; }
  .stats-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-catalog-title-row,
  .admin-new-header,
  .admin-guide-heading { flex-direction: column; }
  .admin-catalog-title-row .page-title,
  .admin-new-header .page-title,
  .admin-guide-heading .page-title,
  .admin-guide-heading .lead { text-align: center; }
  .admin-heading-actions { width: 100%; justify-content: center; flex-wrap: wrap; }
  .admin-upload-grid { grid-template-columns: 1fr; }
  .stats-heading { flex-direction: column; }
  .stats-heading .page-title,
  .stats-heading .lead { text-align: center; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-block { border-right: 0 !important; border-top: 0 !important; border-bottom: 1px solid rgb(185 139 62 / 42%); }
  .footer-block:last-child { border-bottom: 0; }
  body { font-size: 15px; }
  .container { width: min(100% - 14px, var(--content-width)); }
  .brand { gap: 8px; padding-right: 5px; }
  .brand img { width: 55px; height: 50px; }
  .brand-title { font-size: 17px; letter-spacing: .6px; }
  .brand-tagline { font-size: 7px; letter-spacing: .2px; }
  .panel { padding: 24px 13px; border-width: 4px; }
  .panel::after,
  .home-frame::after { inset: 5px; }
  .ornate-frame { --corner-size: 39px; }

  .hero { min-height: 540px; }
  .hero-inner { min-height: 540px; }
  .hero-copy { padding-inline: 12px; }
  .hero-lead { padding: 13px 15px 14px; font-size: 16px; }
  .hero-lead-break { display: none; }
  .hero-actions .fantasy-button { width: min(100%, 320px); }

  .home-content { padding: 15px 0 24px; }
  .home-frame { --corner-size: 40px; padding: 32px 10px 14px; border-width: 4px; }
  .eras { gap: 14px; }
  .era-card { grid-template-columns: 1fr; }
  .cover-zone { height: 205px; border-right: 0; border-bottom: 2px solid #b88b42; }
  .cover-zone img { max-height: 175px; }
  .era-copy { padding: 20px 17px 23px; }
  .era-copy h2 { font-size: 24px; }
  .era-copy .fantasy-button { width: 100%; }
  .project-art { height: 155px; }
  .project-copy { padding: 18px 16px 9px; }
  .project-cta { padding: 0 16px 20px; }
  .project-cta .fantasy-button { width: 100%; }

  .archive-promo { grid-template-columns: 1fr; padding: 17px; text-align: center; }
  .archive-promo img { max-height: 220px; }
  .archive-promo .fantasy-button { width: 100%; }

  .catalog-tools { grid-template-columns: 1fr; padding: 12px; }
  .catalog-search-field,
  .catalog-reset { grid-column: auto; }
  .catalog-item { grid-template-columns: 72px minmax(0, 1fr); gap: 11px; padding: 11px; }
  .archive-thumbnail,
  .cover-placeholder.archive-thumbnail { width: 63px; height: 84px; }
  .catalog-copy h2 { font-size: 18px; }
  .catalog-copy .badge-list { display: none; }
  .catalog-copy p { font-size: 12px; }
  .catalog-facts { display: none; }
  .catalog-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .catalog-actions .download { min-width: 0; }
  .catalog-attachment-count { grid-column: 1 / -1; }
  .catalog-pagination { gap: 7px; }
  .catalog-pagination button { padding-inline: 8px; font-size: 11px; }
  .catalog-pagination span { font-size: 11px; }

  .document-detail-panel { padding: 22px 11px; }
  .detail-top-actions { align-items: stretch; flex-direction: column; }
  .detail-download-box { align-items: stretch; flex-direction: column; }
  .detail-download-button { width: 100%; }
  .detail-section,
  .technical-details { padding: 16px 12px; }
  .detail-meta-row { grid-template-columns: 1fr; gap: 2px; }
  .detail-attachment-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .detail-attachment-table,
  .detail-attachment-table tbody,
  .detail-attachment-table tr,
  .detail-attachment-table td { display: block; width: 100%; box-sizing: border-box; }
  .detail-attachment-table thead { display: none; }
  .detail-attachment-table tr {
    margin-bottom: 10px;
    background: #fff7e6;
    border: 1px solid #c1a26e;
  }
  .detail-attachment-table tr:last-child { margin-bottom: 0; }
  .detail-attachment-table td,
  .detail-attachment-table tbody tr:first-child td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 9px;
    padding: 7px 9px;
    background: transparent;
    border-top: 1px solid #dec79e;
    vertical-align: top;
  }
  .detail-attachment-table td:first-child { border-top: 0; }
  .detail-attachment-table tbody tr:nth-child(even) td,
  .detail-attachment-table tbody tr:hover td { background: transparent; }
  .detail-attachment-table td::before {
    color: #6e573c;
    content: attr(data-label);
    font: 700 10px/1.3 var(--display-font);
    letter-spacing: .25px;
    text-transform: uppercase;
  }
  .detail-file-type { justify-self: start; }

  .comments-panel { width: calc(100% - 8px); padding: 15px 12px; }
  .comment-form > div:last-child { align-items: stretch; flex-direction: column; }
  .comment-form button { width: 100%; }
  .comment-edit { width: 100%; }
  .comment-edit form { min-width: 0; }
  .comments-admin-panel { padding: 25px 13px; }
  .comment-admin-card > header { flex-direction: column; }
  .comment-admin-actions { align-items: stretch; flex-direction: column; }
  .comment-admin-actions > form > button { width: 100%; }

  .about-action-grid { grid-template-columns: 1fr; }
  .social-callout { grid-template-columns: 1fr; text-align: center; }
  .social-callout img { margin: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .fantasy-button { width: 100%; }
  .account-details > div { grid-template-columns: 1fr; gap: 2px; }
  .email-verification-box,
  .admin-access-request { align-items: stretch; flex-direction: column; }
  .admin-dashboard-links { grid-template-columns: 1fr; }
  .cache-current-mode,
  .cache-mode-actions { align-items: stretch; flex-direction: column; }
  .cache-mode-actions .fantasy-button { width: 100%; }
  .admin-form-grid.two { grid-template-columns: 1fr; }
  .admin-form-grid .wide { grid-column: auto; }
  .admin-editor-heading,
  .admin-attachment-top,
  .admin-save-bar { align-items: stretch; flex-direction: column; }
  .admin-attachment-top code { max-width: none; }
  .admin-save-bar button { width: 100%; }
  .admin-health-grid,
  .stats-metrics { grid-template-columns: 1fr; }
  .stats-highlight { align-items: stretch; flex-direction: column; }
  .footer-meta { align-items: flex-start; flex-direction: column; gap: 4px; padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .catalog-tools,
  .catalog-pagination,
  .download,
  .detail-top-actions,
  .admin-save-bar { display: none !important; }
  body,
  .inner-main,
  .home-content { color: #000; background: #fff; }
  .panel { border: 1px solid #000; box-shadow: none; }
}


/* Attachment editor */
.admin-attachments-fieldset .attachment-add-row,
.admin-attachments-fieldset .attachment-add-fields {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: end;
}
.admin-attachments-fieldset .attachment-add-row {
    margin-bottom: .75rem;
}
.admin-attachments-fieldset label {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.admin-attachments-fieldset .checkbox-inline {
    flex-direction: row;
    align-items: center;
}
.attachment-add-section {
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed #c2a472;
    background: #f7eddc;
}
.attachment-add-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
}
.attachment-add-section .attachment-add-fields > label {
    min-width: 180px;
    flex: 1 1 180px;
}
.attachment-add-section .attachment-add-fields > label:first-child {
    flex: 2 1 360px;
}
.attachment-add-section select,
.attachment-add-section input {
    width: 100%;
}
.attachment-add-section > small {
    display: block;
    margin-top: 10px;
    color: #78684d;
}


/* Cancellazione sicura dei documenti dal catalogo */
.admin-heading-actions .fantasy-button.danger,
.fantasy-button.danger {
    border-color: #8b2f2f;
}

.admin-delete-confirmation {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #8b2f2f;
    background: rgba(92, 30, 30, 0.06);
}

.admin-delete-confirmation h2 {
    margin: 4px 0 0;
}

.admin-delete-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.admin-delete-confirmation h3 {
    margin: 0 0 10px;
}

.admin-delete-confirmation ul {
    margin: 0;
    padding-left: 20px;
}

.admin-delete-confirmation li + li {
    margin-top: 7px;
}

.admin-delete-retained,
.admin-delete-effects {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(105, 84, 60, 0.35);
}

.admin-delete-form {
    margin-top: 22px;
}

.admin-delete-check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    font-weight: 700;
}

.admin-delete-check input {
    margin-top: 3px;
}

.admin-delete-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 760px) {
    .admin-delete-grid { grid-template-columns: 1fr; }
    .admin-delete-actions { flex-direction: column-reverse; }
    .admin-delete-actions .fantasy-button { width: 100%; text-align: center; }
}

/* Gestione centralizzata dei tag */
.tags-admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.tags-admin-summary > div {
  padding: 12px 14px;
  background: #ead9b9;
  border: 1px solid #b58e4e;
}
.tags-admin-summary strong,
.tags-admin-summary span { display: block; }
.tags-admin-summary strong { font-size: 21px; color: #5a2c1c; }
.tags-admin-summary span { color: #705a42; font-size: 12px; }
.tags-admin-search { margin: 18px 0; }
.tags-admin-search label { display: block; margin-bottom: 5px; color: #5a2c1c; font-weight: 700; }
.tags-admin-search > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tags-admin-search input { min-width: 260px; flex: 1 1 360px; }
.tags-admin-table-wrap { overflow-x: auto; border: 1px solid #b58e4e; }
.tags-admin-table { width: 100%; border-collapse: collapse; background: rgb(255 255 255 / 18%); }
.tags-admin-table th,
.tags-admin-table td { padding: 10px 12px; border-bottom: 1px solid rgb(112 90 66 / 28%); text-align: left; vertical-align: top; }
.tags-admin-table thead th { background: #e7d1a4; color: #5a2c1c; font-size: 12px; }
.tags-admin-table tbody tr:last-child th,
.tags-admin-table tbody tr:last-child td { border-bottom: 0; }
.tags-admin-table code { color: #5a2c1c; font-weight: 700; }
.tags-admin-document-list { margin: 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.tags-admin-document-list li + li { margin-top: 3px; }
.tags-admin-note { margin: 16px 0 0; color: #705a42; font-size: 12px; }
.text-button.danger { color: #7a2e25; }
@media (max-width: 760px) {
  .tags-admin-summary { grid-template-columns: 1fr; }
  .tags-admin-search input { min-width: 0; }
}


/* Scheda Critica: riquadro editoriale */
.critical-review-panel {
  position: relative;
  isolation: isolate;
  margin-top: 34px;
  color: var(--ink);
  background:
    linear-gradient(rgb(250 241 218 / 90%), rgb(244 229 196 / 94%)),
    url("../assets/parchment.webp") center / 900px auto;
  border: 2px solid #7b5526;
  border-radius: 16px 16px 8px 8px;
  box-shadow: 0 12px 28px rgb(35 22 13 / 18%), inset 0 0 0 3px rgb(255 248 226 / 72%);
  overflow: hidden;
}

.critical-review-panel::after {
  position: absolute;
  z-index: 0;
  inset: 8px;
  border: 1px solid #b88b42;
  border-radius: 10px 10px 5px 5px;
  content: "";
  pointer-events: none;
}

.critical-review-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 14px 28px;
  color: #f4dfaa;
  background:
    linear-gradient(rgb(75 29 19 / 96%), rgb(48 20 14 / 98%)),
    url("../assets/leather.webp") center / 760px auto;
  border-bottom: 3px solid #a77a35;
  box-shadow: 0 5px 12px rgb(35 18 10 / 24%);
}

.critical-review-heading::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 1px;
  background: #e1bc70;
  content: "";
}

.critical-review-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.critical-review-icon {
  display: inline-grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #e2b967;
  border: 1px solid #c59645;
  border-radius: 3px;
  font-size: 25px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgb(83 42 22 / 70%);
}

.critical-review-heading h2 {
  margin: 0;
  color: #fff1c9;
  font: 700 clamp(27px, 3vw, 40px)/1.05 var(--display-font);
  letter-spacing: -.3px;
}

.critical-review-meta {
  color: #dcb46b;
  font: 700 11px/1.4 var(--display-font);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.critical-review-content {
  position: relative;
  z-index: 1;
  padding: 34px 38px 38px;
  overflow: hidden;
}

.critical-review-content::after {
  position: absolute;
  z-index: -1;
  top: 18px;
  right: 10px;
  width: 260px;
  height: 260px;
  border: 1px solid rgb(134 96 47 / 13%);
  border-radius: 50%;
  box-shadow:
    0 0 0 14px rgb(134 96 47 / 5%),
    0 0 0 28px rgb(134 96 47 / 4%);
  content: "";
  transform: rotate(-18deg);
  pointer-events: none;
}

.critical-review-content .scheda-critica {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
}

.critical-review-content .scheda-critica h1 {
  margin: 0;
  color: #2d2118;
  font: 700 clamp(28px, 3.2vw, 42px)/1.08 var(--display-font);
}

.critical-review-content .scheda-critica h1::after {
  display: block;
  width: 100%;
  margin-top: 17px;
  padding-bottom: 12px;
  border-bottom: 1px solid #c9a565;
  color: #9b7133;
  content: "◆  ❖  ◆";
  font: 400 14px/1 var(--body-font);
  letter-spacing: 6px;
  text-align: center;
}

.critical-review-content .scheda-critica .sottotitolo {
  margin: 17px 0 24px;
  color: #715c43;
  font: italic 600 17px/1.55 var(--body-font);
}

.critical-review-content .scheda-critica p {
  max-width: none;
  margin: 0 0 18px;
  color: #33271d;
  font: 400 17px/1.72 var(--body-font);
}

.critical-review-content .scheda-critica p:last-child {
  margin-bottom: 0;
}

.critical-review-content .scheda-critica h2 {
  margin: 31px 0 14px;
  padding-top: 17px;
  color: #5a2c1c;
  border-top: 1px solid #c9a565;
  font: 700 clamp(22px, 2.4vw, 30px)/1.2 var(--display-font);
}

@media (max-width: 760px) {
  .critical-review-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 18px 22px;
  }
  .critical-review-meta { white-space: normal; }
  .critical-review-content { padding: 28px 24px 30px; }
  .critical-review-content .scheda-critica p { font-size: 16px; line-height: 1.65; }
}

@media (max-width: 560px) {
  .critical-review-panel { margin-top: 26px; border-radius: 10px 10px 5px 5px; }
  .critical-review-heading { min-height: 0; padding: 16px 17px; }
  .critical-review-title-wrap { gap: 10px; }
  .critical-review-icon { width: 34px; height: 34px; font-size: 21px; }
  .critical-review-heading h2 { font-size: 27px; }
  .critical-review-content { padding: 24px 18px 26px; }
  .critical-review-content .scheda-critica h1 { font-size: 29px; }
  .critical-review-content .scheda-critica p { font-size: 15.5px; }
}

/* Privacy Policy */
.privacy-policy-header {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.privacy-policy-kicker {
  margin: 0 0 7px;
  color: #7b5526;
  font: 700 12px/1.4 var(--display-font);
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.privacy-policy-header .page-title span {
  font-size: .62em;
  white-space: nowrap;
}

.privacy-policy-content {
  max-width: 920px;
  margin: 24px auto 0;
  padding: 30px 34px;
  color: #3f3023;
  background: #f8eed7;
  border: 1px solid #b89258;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%), 0 3px 12px rgb(76 47 21 / 10%);
  line-height: 1.72;
}

.privacy-policy-content section + section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #d2b783;
}

.privacy-policy-content h2 {
  margin: 0 0 10px;
  color: #5b271a;
  font: 700 22px/1.2 var(--display-font);
}

.privacy-policy-content p {
  margin: 0 0 12px;
}

.privacy-policy-content p:last-child {
  margin-bottom: 0;
}

.privacy-policy-content ul {
  margin: 8px 0 14px;
  padding-left: 26px;
}

.privacy-policy-content li + li {
  margin-top: 7px;
}

.privacy-policy-content a {
  color: var(--blue);
  font-weight: 700;
}

.privacy-policy-intro {
  padding-bottom: 20px;
  border-bottom: 2px solid #a77d3e;
  font-size: 17px;
}

.privacy-policy-updated {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #c7aa75;
  color: #766249;
  font-size: 13px;
  font-style: italic;
  text-align: right;
}

@media (max-width: 700px) {
  .privacy-policy-content {
    margin-top: 18px;
    padding: 23px 18px;
    font-size: 15px;
  }

  .privacy-policy-content h2 {
    font-size: 19px;
  }

  .privacy-policy-intro {
    font-size: 15px;
  }

  .privacy-policy-header .page-title span {
    display: block;
    margin-top: 5px;
    font-size: .52em;
  }

  .privacy-policy-updated {
    text-align: left;
  }
}

/* Eliminazione account */
.account-delete-box,
.account-delete-warning {
  border: 1px solid #b78672;
  background: rgba(125, 48, 37, .07);
  padding: 22px 24px;
}

.account-delete-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
}

.account-delete-box h2,
.account-delete-warning h2 {
  margin: 0 0 8px;
  color: var(--danger);
}

.account-delete-box p:last-child,
.account-delete-warning p:last-child {
  margin-bottom: 0;
}

.account-delete-warning {
  margin: 24px 0;
}

.account-delete-warning ul {
  margin: 14px 0;
  padding-left: 22px;
}

.account-delete-form {
  margin-top: 24px;
}

.account-delete-form .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  color: #4d3022;
}

.account-delete-form .checkbox-label input {
  flex: 0 0 auto;
  margin-top: 5px;
}

.fantasy-button.danger:disabled {
  cursor: not-allowed;
  opacity: .5;
  filter: grayscale(.65);
}

@media (max-width: 760px) {
  .account-delete-box {
    align-items: stretch;
    flex-direction: column;
  }

  .account-delete-box .fantasy-button {
    width: 100%;
  }
}

/* Interesse per una possibile ristampa delle carte */
.cards-reprint-interest {
  margin-top: 22px;
  padding: 18px;
  background: #ead9b9;
  border: 2px solid #a57b3f;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 26%);
}

.cards-reprint-interest-heading p { margin-bottom: 4px; }
.cards-reprint-interest h3 {
  margin: 0;
  color: #4f2618;
  font: 700 22px var(--display-font);
}

.cards-reprint-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 13px 0 8px;
  color: #5a351f;
}

.cards-reprint-counter strong {
  color: #7a3a1f;
  font: 700 35px var(--display-font);
  line-height: 1;
}

.cards-reprint-counter span {
  font: 700 15px var(--display-font);
}

.cards-reprint-note,
.cards-reprint-login-note {
  margin: 8px 0 14px;
  color: #604c39;
  font-size: 12px;
  line-height: 1.55;
}

.cards-reprint-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cards-reprint-user-count {
  color: #604c39;
  font-size: 11px;
}

.cards-reprint-user-count strong { color: #7a3a1f; }

/* Timbro DA REVISIONARE per le schede critiche incorporate in dettaglio.php */
.critical-review-content .stamp {
  position: relative;
  z-index: 10;
  display: block;
  width: max-content;
  max-width: 92%;
  margin: 8px 18px 30px auto;
  padding: 10px 22px 9px;
  color: #b51f1f !important;
  background: transparent !important;
  border: 4px solid #b51f1f !important;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgb(181 31 31 / 72%), 0 0 0 1px rgb(181 31 31 / 42%);
  font: 900 clamp(22px, 3.2vw, 38px)/1 var(--display-font) !important;
  letter-spacing: 2.5px;
  line-height: 1 !important;
  text-align: center;
  text-transform: uppercase;
  opacity: .94;
  transform: rotate(-3deg);
  transform-origin: center;
  text-shadow: none;
}

.critical-review-content .stamp::before {
  position: absolute;
  inset: 5px;
  border: 1px solid rgb(181 31 31 / 88%);
  border-radius: 1px;
  content: "";
  pointer-events: none;
}

.critical-review-content .stamp::after {
  position: absolute;
  inset: 1px;
  border: 1px dashed rgb(181 31 31 / 55%);
  content: "";
  pointer-events: none;
}

@media (max-width: 560px) {
  .critical-review-content .stamp {
    max-width: 100%;
    margin: 4px auto 26px;
    padding: 9px 14px 8px;
    font-size: 22px !important;
    letter-spacing: 1.5px;
  }
}

/* Editor JSON diretto della singola entry del catalogo */
.admin-json-editor {
  margin-top: 24px;
  border: 1px solid rgb(113 73 31 / 42%);
  border-radius: 6px;
  background: rgb(255 248 225 / 54%);
}

.admin-json-editor > summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #4c2819;
  font: 700 18px/1.25 var(--display-font);
}

.admin-json-editor-body {
  padding: 0 16px 16px;
}

.admin-json-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 520px;
  margin-top: 8px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #8d6b42;
  border-radius: 4px;
  background: #fffdf5;
  color: #241a14;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

.admin-json-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.admin-json-actions span {
  color: #6b5948;
  font-size: 12px;
}

@media (max-width: 700px) {
  .admin-json-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-json-form textarea {
    min-height: 420px;
  }
}

.admin-custom-cover {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(184, 139, 66, .45);
  border-radius: 8px;
  background: rgba(255, 248, 228, .32);
}

.admin-custom-cover-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-custom-cover-form label {
  flex: 1 1 360px;
}

.admin-custom-cover-form input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.admin-custom-cover-remove {
  margin-top: 10px;
}

@media (max-width: 700px) {
  .admin-custom-cover-form .fantasy-button {
    width: 100%;
  }
}


/* Riconoscimento visivo degli utenti contributori. */
.contributor-star {
    display: inline-block;
    color: #d99a16;
    font-size: 1.05em;
    line-height: 1;
    margin-inline-start: .18em;
    text-shadow: 0 0 1px rgba(90, 55, 0, .35);
    vertical-align: baseline;
}
.contributor-label {
    display: inline-block;
    margin-inline-start: .45rem;
    padding: .12rem .4rem;
    border: 1px solid rgba(181, 126, 16, .35);
    border-radius: 999px;
    color: #805a0c;
    font-size: .75em;
    white-space: nowrap;
}
.admin-contributor-form { margin: 0; }
.admin-contributor-form button { white-space: nowrap; }
.admin-users-filters { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; align-items: end; }
.admin-users-filters .field { flex: 1 1 180px; margin: 0; }
.admin-users-table td, .admin-users-table th { vertical-align: middle; }
.admin-users-table .user-email { overflow-wrap: anywhere; }


/* Sostenitori della pagina Supporta l'Archivio */
.supporters-section {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid #c2a472;
}

.supporters-section > p {
  text-align: center;
}

.supporters-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.supporters-list li {
  padding: 7px 12px;
  border: 1px solid #c2a472;
  border-radius: 3px;
  background: rgb(255 248 230 / 55%);
}

.supporter-star {
  margin-left: 4px;
  color: #a87512;
}

.supporters-empty {
  font-size: .92rem;
  font-style: italic;
}


/* Metadati discreti nelle schede del catalogo: scheda critica e commenti. */
.catalog-social-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: -3px;
  padding-top: 7px;
  border-top: 1px solid rgb(151 119 69 / 25%);
  color: #806d54;
  font-size: 10px;
  line-height: 1.35;
}
.catalog-social-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}
.catalog-social-meta-item:hover,
.catalog-social-meta-item:focus-visible {
  color: #5c351b;
  text-decoration: underline;
}
.catalog-critical-review {
  color: #88601f;
  font-weight: 700;
}
.catalog-critical-review:first-letter {
  color: #a97920;
}
.catalog-comment-icon {
  font-size: 12px;
}
@media (max-width: 620px) {
  .catalog-social-meta {
    gap: 8px 12px;
  }
}


/* Valutazioni dei lettori: aggiunte senza alterare gli stili dei commenti esistenti. */
.document-rating-panel {
  width: min(920px, calc(100% - 22px)); margin: 18px auto 0; padding: 18px 22px;
  color: #4b2b19; background: rgb(234 217 185 / 96%); border: 1px solid #9d7a47;
  box-shadow: inset 0 0 0 1px rgb(255 246 223 / 75%);
}
.document-rating-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.document-rating-summary h2 { margin:0; color:#532719; font:700 20px/1.15 var(--display-font); }
.document-rating-summary .eyebrow { margin:0 0 4px; color:#766249; font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.document-rating-score { display:grid; justify-items:end; gap:2px; }
.rating-stars { color:#a86d13; font-size:22px; letter-spacing:2px; }
.document-rating-score strong { font-size:20px; }
.document-rating-score small,.rating-no-votes { color:#766249; font-size:12px; }
.review-form { display:grid; gap:8px; margin-top:14px; padding-top:14px; border-top:1px solid #c4aa78; }
.review-form label { color:#5c341f; font-size:12px; font-weight:700; }
.review-form textarea { width:100%; padding:9px 11px; color:#2e241b; background:#fff9ec; border:1px solid #9e7844; }
.review-rating-choice { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; border:0; }
.review-rating-choice legend { margin-bottom:6px; color:#5c341f; font-size:12px; font-weight:700; }
.review-rating-choice label { display:flex; align-items:center; gap:4px; padding:5px 8px; border:1px solid #c4aa78; background:#fff9ec; cursor:pointer; }
.review-rating-choice input { accent-color:#a86d13; }
.review-rating-choice span { color:#a86d13; font-size:15px; letter-spacing:1px; }
.review-rating-choice small { color:#766249; }
.review-form button { justify-self:start; }
.comment-item-review { margin:10px 0; padding:14px; background:#f7edda; border:1px solid #b18a4b; box-shadow:inset 3px 0 #b18a4b; }
.review-badge,.admin-review-label { color:#80520e; font-size:11px; font-weight:800; letter-spacing:.04em; }
.comment-item-review .comment-body { margin-top:9px; }
.catalog-rating-meta { color:#8a5b0d !important; }
@media (max-width:600px) {
  .document-rating-summary { align-items:flex-start; flex-direction:column; }
  .document-rating-score { justify-items:start; }
  .document-rating-panel { width:calc(100% - 8px); padding:15px 12px; }
}
