:root {
  --paper-light: #efe8de;
  --paper-mid: #e3d9cc;
  --paper-border: #c8bcb0;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: "SF Mono", ui-monospace, "Courier Prime", "Courier New", Courier, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Lora", "Iowan Old Style", Georgia, serif;
  --font-ui: "Space Mono", ui-monospace, monospace;
  --font-kicker: "Space Mono", ui-monospace, monospace;

  /* Tema B5: "Fanzine d'Archivio" (Carta Paglia & 2 Colori Dattilografici) */
  --ink: #191714;
  --ink-soft: #564f45;
  --ink-border: #191714;
  --accent-sun: #e6ad42;
  --accent-sun-deep: #cf4c28;
  --accent-sea: #5a879e;
  --ui-ink: #191714;
  --ui-ink-soft: #524b42;
  --ui-accent: #cf4c28;
  --ui-surface: #faf5ea;
  --ui-surface-hover: #efe4d0;
  --ui-surface-border: #191714;
  --ui-primary-bg: #d4532a;
  --ui-primary-fg: #fffaf2;
  --ui-primary-hover: #bf4620;
  --ui-dot: rgba(25, 23, 20, 0.28);
  --ui-dot-active: #cf4c28;
  --ui-divider: rgba(29, 26, 23, 0.16);
  --desk-color: #efe7d8;
  --desk-bg: repeating-linear-gradient(0deg, transparent 0 23px, rgba(38, 32, 24, 0.07) 23px 24px);
  --desk-bg-size: auto;
  --desk-bg-pos: 0 0;
  --stamp-bg: #e6ad42;
  --stamp-fg: #191714;
  --stamp-hover: #efb954;
  --nav-bg: #faf5ea;
  --nav-primary-bg: #cf4c28;
  --nav-primary-fg: #fffaf2;
  --nav-primary-hover: #dc5c38;
  --badge-bg: #faf5ea;
  --badge-hover: #e6ad42;
  --modal-bg: #faf5ea;
  --rotate-card-bg: #f4ecdd;
  --rotate-eyebrow: #b54020;

  /* Ombra fisica netta e ravvicinata (contatto reale con la scrivania) */
  --shadow-book:
    0 2px 3px rgba(38, 36, 33, 0.24),
    0 8px 14px -4px rgba(38, 36, 33, 0.30),
    0 16px 26px -10px rgba(38, 36, 33, 0.20);
  --shadow-soft: 0 8px 22px rgba(38, 36, 33, 0.12);
  --flip-duration: 780ms;
  --flip-ease: cubic-bezier(0.32, 0.08, 0.24, 1);
  --spread-ratio: 2.819046;
  --chrome-v: 108px;
  --chrome-h: 40px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--desk-color);
  color: var(--ui-ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  position: relative;
  background-color: var(--desk-color);
  background-image: var(--desk-bg);
  background-size: var(--desk-bg-size);
  background-position: var(--desk-bg-pos);
  color: var(--ui-ink);
  transition: background-color 280ms ease, color 220ms ease;
}

/* Leggerissima grana cartacea inline (zero richieste esterne) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] {
  display: none !important;
}

button,
a {
  font-family: inherit;
  color: inherit;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* =========================================================
   App Shell
   ========================================================= */
.app-shell {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding:
    max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  gap: 14px;
  overflow: hidden;
  transition: opacity 380ms ease, transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.is-locked {
  opacity: 0;
  pointer-events: none;
}

@media (orientation: portrait) and (max-width: 960px) {
  .app-shell {
    opacity: 0;
    pointer-events: none;
  }
}

.app-shell.is-entering .book-viewport {
  animation: bookReveal 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bookReveal {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* =========================================================
   Top Bar
   ========================================================= */
.top-bar {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  flex-shrink: 0;
  z-index: 5;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-style: italic;
  color: var(--ui-ink-soft);
}

.brand-couple {
  color: var(--ui-ink);
  font-weight: 700;
  font-style: normal;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Bottone "Cause benefiche" stile timbro / etichetta cartacea */
.stamp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 3px;
  border: 1.5px solid var(--ink-border);
  background: var(--stamp-bg);
  color: var(--stamp-fg);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink-border);
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.stamp-btn--icon {
  width: 32px;
  padding: 0;
}

.stamp-btn:hover {
  background: var(--stamp-hover);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink-border);
}

.stamp-btn .icon--sketch {
  width: 16px;
  height: 16px;
  color: var(--stamp-fg);
}

/* =========================================================
   Notebook Stage & 3D Book
   ========================================================= */
.notebook-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1240px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2400px;
  -webkit-perspective: 2400px;
  touch-action: pan-y pinch-zoom;
}

/* Dimensionamento esatto 2.819:1 che si adatta a qualsiasi schermo senza scroll */
.book {
  --book-w: min(calc(100vw - var(--chrome-h) - env(safe-area-inset-left) - env(safe-area-inset-right)),
      calc((100dvh - var(--chrome-v)) * var(--spread-ratio)));
  --book-h: calc(var(--book-w) / var(--spread-ratio));
  position: relative;
  width: var(--book-w);
  height: var(--book-h);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform var(--flip-duration) var(--flip-ease);
  will-change: transform;
}

/* Centra il taccuino quando è chiuso sulla copertina (step 0) o sulla quarta (step 12) */
.book[data-position="cover"] {
  transform: translateX(-25%);
}

.book[data-position="open"] {
  transform: translateX(0%);
}

.book[data-position="end"] {
  transform: translateX(25%);
}

/* Sottile linea di piega centrale (1-2px) solo a libro aperto */
.book[data-position="open"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
      rgba(38, 36, 33, 0.04),
      rgba(38, 36, 33, 0.16),
      rgba(38, 36, 33, 0.04));
  pointer-events: none;
  z-index: 45;
}

/* Spessore fisico dei fogli sotto la pila sinistra e destra */
.book-stack-shadow {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 50%;
  pointer-events: none;
  border-radius: 4px;
  transition: opacity 480ms ease;
  box-shadow: var(--shadow-book);
}

.book-stack-shadow--left {
  left: 0;
  opacity: 0;
  background: linear-gradient(to right, #cfc4b6 0%, #ddd4c7 3px, transparent 5px);
}

.book-stack-shadow--right {
  left: 50%;
  opacity: 1;
  background: linear-gradient(to left, #cfc4b6 0%, #ddd4c7 3px, transparent 5px);
}

.book[data-has-left="true"] .book-stack-shadow--left {
  opacity: 1;
}

.book[data-has-right="false"] .book-stack-shadow--right {
  opacity: 0;
}

/* Fogli statici e animazione curva multi-sezione (.curl-sheet) */
.sheet {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  -webkit-transform-origin: left center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform var(--flip-duration) var(--flip-ease);
  will-change: transform;
  pointer-events: none;
}

.sheet.no-transition {
  transition: none !important;
}

.sheet.is-curl-hidden {
  visibility: hidden;
  pointer-events: none;
}

.sheet.flipped {
  transform: rotateY(-180deg);
}

.sheet-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--paper-light);
  background-repeat: no-repeat;
  overflow: hidden;
  pointer-events: none;
}

.sheet-face.is-active-face {
  pointer-events: auto;
}

.sheet-front {
  transform: rotateY(0deg);
  border-radius: 0 5px 5px 0;
}

.sheet-back {
  transform: rotateY(180deg);
  border-radius: 5px 0 0 5px;
}

/* L'ombra sotto l'ultima pagina è già gestita da .book-stack-shadow--left */

/* Strisce annidate per la curvatura reale della pagina durante lo sfoglio */
.curl-sheet {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  pointer-events: none;
  z-index: 90;
}

.curl-slice {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 100%;
  transform-origin: left center;
  -webkit-transform-origin: left center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  outline: 0.5px solid transparent;
  will-change: transform;
}

.curl-slice--root {
  left: 0;
  width: 12.5%;
}

.curl-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--paper-light);
  background-repeat: no-repeat;
  overflow: hidden;
}

.curl-page-content {
  position: absolute;
  top: 0;
  height: 100%;
  pointer-events: none;
}

.curl-face--front {
  transform: rotateY(0deg);
}

.curl-face--back {
  transform: rotateY(180deg);
}

.curl-face-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(24, 18, 12, 1);
  opacity: 0;
}

/* Copertina singola e pagina finale singola occupano 100% della faccia */
.sheet-face--single {
  background-size: 100% 100%;
  background-position: 50% 50%;
}

/* Le doppie pagine (spread 2..12) usano la stessa immagine tagliata esattamente al 50% */
.sheet-face--spread-left {
  background-size: 200% 100%;
  background-position: 0% 50%;
}

.sheet-face--spread-right {
  background-size: 200% 100%;
  background-position: 100% 50%;
}

/* La piega centrale è già disegnata nelle immagini del PDF */
.sheet-gutter {
  display: none;
}

.sheet-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg,
      rgba(30, 22, 14, 0.06) 0%,
      rgba(255, 250, 242, 0.16) 40%,
      rgba(30, 22, 14, 0.14) 100%);
}

.sheet.is-flipping .sheet-sheen {
  animation: pageSheenSweep var(--flip-duration) ease-in-out both;
}

@keyframes pageSheenSweep {
  0% {
    opacity: 0;
  }

  42% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
  }
}

/* Invito visivo discreto sull'angolo della copertina */
.cover-curl-cue {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  pointer-events: none;
  background: linear-gradient(135deg, transparent 50%, rgba(31, 28, 25, 0.12) 52%, rgba(255, 250, 243, 0.72) 100%);
  border-top-left-radius: 6px;
  opacity: 0.78;
  animation: curlPulse 2.4s ease-in-out infinite;
}

@keyframes curlPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.68;
  }

  50% {
    transform: scale(1.16);
    opacity: 1;
  }
}

/* Zone cliccabili laterali sulle pagine (tranne sopra i pulsanti donazione) */
.page-tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.page-tap-zone--left {
  left: 0;
}

.page-tap-zone--right {
  right: 0;
}

/* =========================================================
   Hotspot cliccabili integrati nelle pagine (Pagine 9–12)
   ========================================================= */
.qr-hotspot {
  position: absolute;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, 0.8vw, 9px);
  padding: 0 clamp(6px, 1vw, 10px) 0 clamp(4px, 0.7vw, 8px);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.qr-hotspot--badge {
  background: var(--badge-bg);
  border: 1.5px solid var(--ink-border);
  box-shadow: 2px 2px 0 var(--ink-border);
  padding: 0 clamp(7px, 1.1vw, 12px);
  color: var(--ink);
}

.qr-hotspot--badge:hover,
.qr-hotspot--badge:focus-visible {
  background: var(--badge-hover);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink-border);
  outline: none;
}

.qr-hotspot--transparent {
  background: rgba(232, 153, 62, 0.08);
  border: 1.5px dashed rgba(209, 122, 86, 0.55);
  justify-content: flex-end;
  align-items: flex-end;
  padding: 4px;
}

.qr-hotspot--transparent:hover,
.qr-hotspot--transparent:focus-visible {
  background: rgba(232, 153, 62, 0.16);
  border-style: solid;
  border-color: var(--accent-sun-deep);
}

.qr-hotspot--transparent .qr-hotspot-text,
.qr-hotspot--transparent .qr-hotspot-emblem,
.qr-hotspot--transparent .qr-hotspot-arrow {
  display: none;
}

.qr-hotspot--transparent::after {
  content: "Apri link ↗";
  font-size: clamp(9px, 1.05vw, 12px);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
  background: #f4efe6;
  border: 1px solid rgba(38, 36, 33, 0.45);
  color: var(--ink);
}

.qr-hotspot-emblem {
  width: clamp(13px, 1.7vw, 20px);
  height: clamp(13px, 1.7vw, 20px);
  flex-shrink: 0;
  color: var(--accent-sun-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-hotspot-emblem .charity-emblem-svg {
  width: 100%;
  height: 100%;
}

.qr-hotspot-text {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.15vw, 14px);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-hotspot-arrow {
  font-size: clamp(10px, 1.2vw, 14px);
  font-weight: 700;
  color: var(--accent-sun-deep);
  flex-shrink: 0;
}

body.debug-hotspots .qr-hotspot {
  outline: 2px solid #e11d48 !important;
  background: rgba(225, 29, 72, 0.16) !important;
}

/* =========================================================
   Swipe Hint
   ========================================================= */
.swipe-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(31, 28, 25, 0.84);
  color: #faf5ee;
  font-size: 0.78rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  animation: hintFade 4.2s ease forwards;
}

.swipe-hint svg {
  width: 16px;
  height: 16px;
}

@keyframes hintFade {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }

  12%,
  78% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, 4px);
  }
}

/* =========================================================
   Bottom Dock (Controlli editoriali senza barra bianca)
   ========================================================= */
.bottom-dock {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  z-index: 15;
}

.controls-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 0;
  border-top: 0;
  background: transparent;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 6px 13px;
  border-radius: 3px;
  border: 1.5px solid var(--ink-border);
  background: var(--nav-bg);
  color: var(--ui-ink);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink-border);
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, opacity 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.nav-btn--primary {
  background: var(--nav-primary-bg);
  color: var(--nav-primary-fg);
  font-weight: 700;
}

.nav-btn:hover:not(:disabled) {
  background: var(--ui-surface-hover);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink-border);
}

.nav-btn--primary:hover:not(:disabled) {
  background: var(--nav-primary-hover);
}

.nav-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.progress-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.page-indicator {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ui-ink);
  letter-spacing: 0.06em;
}

.progress-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.progress-dot {
  width: 10px;
  height: 2px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: var(--ui-dot);
  cursor: pointer;
  transition: width 220ms ease, background-color 220ms ease, height 150ms ease;
}

.progress-dot:hover {
  height: 4px;
}

.progress-dot[aria-selected="true"] {
  width: 22px;
  height: 3px;
  background: var(--ui-dot-active);
}

.progress-dot--charity {
  background: rgba(209, 122, 86, 0.48);
}

.progress-dot--charity[aria-selected="true"] {
  background: var(--accent-sun-deep);
}

/* =========================================================
   Rotate Phone Overlay (Mobile Portrait)
   ========================================================= */
.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--desk-color);
  background-image: var(--desk-bg);
  background-size: var(--desk-bg-size);
  background-position: var(--desk-bg-pos);
}

.rotate-card {
  position: relative;
  width: 100%;
  max-width: 356px;
  padding: 28px 28px 22px;
  border-radius: 4px;
  background: var(--rotate-card-bg);
  border: 1px solid rgba(31, 28, 25, 0.20);
  box-shadow: var(--shadow-book);
  color: var(--ink);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rotate-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(31, 28, 25, 0.09);
  border-radius: 2px;
  pointer-events: none;
}

.rotate-groot-stage {
  position: relative;
  width: 172px;
  height: 204px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: -6px 0 2px;
  pointer-events: none;
}

.rotate-groot-img {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
  user-select: none;
  -webkit-user-drag: none;
}

.rotate-eyebrow {
  margin: 2px 0 0;
  font-family: var(--font-kicker);
  font-style: italic;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: var(--rotate-eyebrow);
}

.rotate-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.46rem;
  line-height: 1.18;
  font-weight: 700;
  color: var(--ink);
}

.rotate-subtitle {
  margin: 2px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 28ch;
}

@media (max-height: 620px) {
  .rotate-card {
    padding: 20px 22px 16px;
    gap: 8px;
  }

  .rotate-groot-stage {
    width: 138px;
    height: 164px;
    margin: -4px 0 0;
  }
}

/* =========================================================
   Charities Editorial Index Modal ("L'Indice / Il Menù")
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(38, 36, 33, 0.48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-sheet {
  width: 100%;
  max-width: 640px;
  max-height: min(88dvh, 680px);
  background: var(--modal-bg);
  border: 1.5px solid var(--ink-border);
  border-radius: 3px;
  box-shadow: 6px 6px 0 var(--ink-border);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(38, 36, 33, 0.16);
}

.modal-kicker {
  margin: 0 0 4px;
  font-family: var(--font-kicker);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--accent-sun-deep);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.modal-subtitle {
  margin: 6px 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 3px;
  border: 1px solid rgba(38, 36, 33, 0.24);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.modal-close:hover {
  background: rgba(38, 36, 33, 0.06);
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.charities-list {
  padding: 6px 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.charity-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(38, 36, 33, 0.14);
  text-decoration: none;
  color: var(--ink);
  transition: transform 150ms ease, background-color 150ms ease;
}

.charity-row:last-child {
  border-bottom: 0;
}

.charity-row:hover,
.charity-row:focus-visible {
  background: rgba(38, 36, 33, 0.035);
  transform: translateX(3px);
  outline: none;
}

.charity-row-emblem {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  border: 1px dashed rgba(38, 36, 33, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.charity-row-emblem .charity-emblem-svg {
  width: 24px;
  height: 24px;
}

.charity-row-emblem--custom {
  width: 50px;
  height: 50px;
  border: 0;
  background: transparent;
}

.charity-emblem-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  user-select: none;
  -webkit-user-drag: none;
}

.charity-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.charity-row-motive {
  margin: 0 0 2px;
  font-family: var(--font-kicker);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--accent-sun-deep);
}

.charity-row-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.charity-row-desc {
  margin: 3px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.charity-row-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--accent-sun);
  padding-bottom: 1px;
  transition: border-color 150ms ease;
}

.charity-row:hover .charity-row-cta {
  border-bottom-color: var(--accent-sun-deep);
}

/* =========================================================
   Ottimizzazione Mobile Landscape (altezza ridotta)
   ========================================================= */
@media (max-height: 520px),
(max-width: 960px) and (orientation: landscape) {
  :root {
    --chrome-v: 62px;
    --chrome-h: 16px;
  }

  .app-shell {
    padding:
      max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(3px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    gap: 4px;
  }

  .notebook-stage {
    /* Compensa leggermente l'inset asimmetrico della Dynamic Island su iPhone in landscape */
    transform: translateX(calc((env(safe-area-inset-right) - env(safe-area-inset-left)) * 0.35));
  }

  .top-bar {
    min-height: 24px;
  }

  .brand-tag {
    font-size: 0.74rem;
  }

  .brand-sep,
  .brand-date {
    display: none;
  }

  .stamp-btn {
    height: 26px;
    padding: 0 8px;
  }

  .stamp-btn--icon {
    width: 26px;
    padding: 0;
  }

  .bottom-dock {
    gap: 0;
  }

  .controls-bar {
    padding: 1px 2px 0;
  }

  .nav-btn {
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
  }

  .nav-btn .icon {
    width: 14px;
    height: 14px;
  }

  .page-indicator {
    font-size: 0.72rem;
  }

  .progress-dot {
    width: 7px;
    height: 2px;
  }

  .progress-dot[aria-selected="true"] {
    width: 16px;
    height: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --flip-duration: 180ms;
  }

  .cover-curl-cue {
    animation: none !important;
  }
}