
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      margin: 0;
      padding: 0;
    }

    .body-santo {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      gap: 20px;

    }

    #layout-options {
      background: #eef3f5;
      width: 250px;
      font-family: Arial;
      font-size: 14px;
      margin-top: 150px;
      align-self: flex-start;
    }

    #layout-options h4 {
      margin-top: 0;
    }

    .layout-choice,
    .rucktitel-mode {
      display: flex;
      gap: 10px;
      margin-top: 10px;
      min-width: 250px;
      justify-content: center;
      align-items: center;
    }

    .layout-choice label,
    .rucktitel-mode label {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .layout-choice .preview,
    .rucktitel-mode .preview {
      width: 60px;
      height: 90px;
      border: 1px solid #ccc;
      background: #fff;
      padding: 2px;
      text-align: center;
      font-size: 10px;
      line-height: 1.2;
      margin-bottom: 5px;
    }

    .checkboxes {
      margin-top: 20px;
    }



    /* Allineamento testo etichette */
    .checkboxes label {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #editor-container {
      width: 116mm;
      height: 216mm;
      margin: 20px 0;
      background-color: white;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      overflow: hidden;
      padding: 3mm;
      box-sizing: border-box;
      position: relative;
    }

    #editor-container {
      width: 101mm;
      height: 216mm;
      background-color: white;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      overflow: hidden;
      padding: 0;
      box-sizing: border-box;
      position: relative;
      padding-bottom: 30px;
    }

    #toolbar {
      display: flex;
      justify-content: flex-start;
      gap: 5px;
      padding: 5px;
      border-bottom: 1px solid #ccc;
    }

    #toolbar button {
      padding: 5px 8px;
      background: red;
      color: white;
      border: none;
      cursor: pointer;
    }

    #editor {
      width: 100%;
      height: calc(100% - 30px);
      background: white;
      padding: 10px;
      box-sizing: border-box;
      position: relative;
      overflow-y: auto;
    }

    .section {
      margin: 10px 0;
      padding: 10px;
      border: 1px dashed #ccc;
      min-height: 20mm;
      text-align: center;
    }

    #headline {
      font-weight: bold;
    }

    /* #innenseite-layout {
      position: absolute;
      top: 10px;
      left: 30px;
      z-index: 100;
    } */

    #photo {
      height: 120mm;
      background-color: #eee;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: height 0.3s ease;
      overflow: hidden;
    }

    #logo-qr {
      display: flex;
      justify-content: space-between;
      transition: opacity 0.3s ease;
    }

    #logo-qr .box {
      width: 45%;
      border: 1px solid #ccc;
      padding: 5px;
    }

    #popup {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0, 0, 0, 0.8);
      color: #fff;
      padding: 10px 20px;
      border-radius: 4px;
      font-size: 14px;
      display: none;
      z-index: 1000;
      opacity: 0;
      transition: opacity 0.5s ease;
    }

    #popup.show {
      display: block;
      opacity: 1;
    }

    /*layout delle finestre*/
    #seiten-layout {
      background: #eef3f5;
      padding: 15px;
      width: 250px;
      font-size: 14px;
    }

    .seiten-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-top: 10px;
    }

    .seiten-grid .seite {
      background: #e0e0e0;
      border: 1px solid #ccc;
      height: 90px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      user-select: none;
      font-size: 14px;
    }

    .seiten-grid .seite.active {
      background: #d32f2f;
      color: white;
    }

    .layout-panel {
      background: #eef3f5;
      width: 250px;
      font-size: 14px;
      display: none;
    }

    #innenseite-layout {
      margin-top: 150px;
      align-self: flex-start;
      width: 250px;
    }



    #toolbar {
      display: flex;
      gap: 5px;
      padding: 5px;
      border-bottom: 1px solid #ccc;
      background: white;
      flex-wrap: wrap;
    }

    #toolbar button {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: white;
      border: 1px solid #ccc;
      border-radius: 4px;
      cursor: pointer;
      font-size: 16px;
      color: black;
      padding: 0;
    }

    #toolbar button:hover {
      background: #f5f5f5;
    }

    /* Nasconde testo interno ai pulsanti ma mantiene accessibilità */
    #toolbar button span {
      position: absolute;
      left: -9999px;
    }




    .layout-choice {
      display: flex;
      gap: 10px;
    }

    .layout-choice .preview {
      border: 1px solid #ccc;
      padding: 3px;
      background: white;
    }

    .layout-choice svg {
      display: block;
    }

    .layout-choice input[type="radio"] {
      display: none;
    }

    .layout-choice input[type="radio"]:checked+.preview {
      border-color: #0078d4;
      box-shadow: 0 0 5px rgba(0, 120, 212, 0.5);
    }


    button {
      position: relative;
      background: none;
      border: none;
      cursor: pointer;
    }

    .tooltip-text {
      visibility: hidden;
      background-color: #333;
      color: #fff;
      font-size: 12px;
      padding: 4px 8px;
      border-radius: 4px;
      position: absolute;
      bottom: 125%;
      /* sopra l'icona */
      left: 50%;
      transform: translateX(-50%);
      white-space: nowrap;
      opacity: 0;
      transition: opacity 0.3s;
      pointer-events: none;
      z-index: 1000;
    }

    .tooltip-icon:hover+.tooltip-text {
      visibility: visible;
      opacity: 1;
    }

    #photo img {
      /*check se è giusto così*/
      max-width: 100%;
      max-height: 100%;
      width: auto;
      height: auto;
    }


    .layout-choice .preview {
      width: 120px;
      /* larghezza anteprima */
      height: 80px;
      /* altezza anteprima */
      border: 1px solid #ccc;
      border-radius: 6px;
      overflow: hidden;
      transition: all .25s ease;
      cursor: pointer;
      background: #fff;
      padding: 4px;
    }

    .layout-choice .preview img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      /* mostra l’intera immagine senza tagliare */
      image-rendering: -webkit-optimize-contrast;
    }

    .layout-choice input[type="radio"]:checked+.preview {
      border-color: #d32f2f;
      box-shadow: 0 0 6px rgba(211, 47, 47, .6);
    }



    .rucktitel-options {
      display: flex;
      flex-direction: column;
      /* verticale invece che orizzontale */
      gap: 16px;
      /* spazio tra le opzioni */
      align-items: center;
      /* centrate al centro */
    }

    .rucktitel-options label {
      cursor: pointer;
      width: 140px;
      /* larghezza fissa per le anteprime */
    }

    .rucktitel-options input[type="radio"] {
      display: none;
      /* nasconde i radio button */
    }

    .rucktitel-options .preview {
      width: 140px;
      height: 100px;
      border: 1px solid #ccc;
      border-radius: 6px;
      overflow: hidden;
      transition: all .25s ease;
      cursor: pointer;
      background: #fff;
    }

    .rucktitel-options .preview img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      /* mostra tutta l’immagine */
    }

    .rucktitel-options input[type="radio"]:checked+.preview {
      border-color: #d32f2f;
      box-shadow: 0 0 6px rgba(211, 47, 47, .6);
    }


    .innenseite-options {
      display: flex;
      flex-direction: column;
      /* verticale */
      gap: 16px;
      /* spazio tra le opzioni */
      align-items: center;
      /* centrate */
    }

    .innenseite-options label {
      cursor: pointer;
      width: 160px;
      /* larghezza fissa */
    }

    .innenseite-options input[type="radio"] {
      display: none;
    }

    .innenseite-options .preview {
      width: 160px;
      height: 120px;
      border: 1px solid #ccc;
      border-radius: 6px;
      overflow: hidden;
      transition: all .25s ease;
      cursor: pointer;
      background: #fff;
    }

    .innenseite-options .preview img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .innenseite-options input[type="radio"]:checked+.preview {
      border-color: #d32f2f;
      box-shadow: 0 0 6px rgba(211, 47, 47, .6);
    }



    .checkboxes {
      margin-top: 20px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      /* spazio uniforme tra le righe */
      align-items: flex-start;
      /* allinea tutto a sinistra */
    }

    .checkboxes label {
      display: flex;
      align-items: center;
      /* centra verticalmente checkbox e testo */
      cursor: pointer;
      font-size: 14px;
    }

    .checkboxes input[type="checkbox"] {
      margin: 0 8px 0 0;
      /* spazio a destra della checkbox */
      position: relative;
      top: 0;
      /* niente offset verticale */
    }




    /* Checkbox personalizzati in stile immagine */
    /* Cerchio (puoi tenere quello che hai già) */
    input[type="checkbox"] {
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      width: 20px;
      height: 20px;
      border: 2px solid #000;
      /* bordo nero */
      border-radius: 50%;
      background: #fff;
      position: relative;
      cursor: pointer;
      margin-right: 8px;
    }

    /* Spunta rossa centrata */
    input[type="checkbox"]:checked::after {
      content: "";
      position: absolute;
      width: 6px;
      /* “braccio” corto */
      height: 10px;
      /* “braccio” lungo */
      border-right: 2px solid #d32f2f;
      border-bottom: 2px solid #d32f2f;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -60%) rotate(45deg);
      /* centratura */
      transform-origin: center;
    }

    #toolbar {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
    }

    #toolbar button {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: white;
      border: 1px solid #ccc;
      border-radius: 4px;
      cursor: pointer;
    }

    #toolbar button img {
      width: 70%;
      height: 70%;
      object-fit: contain;
    }

    /* Spazio extra solo per il blocco finale */
    #save-pdf {
      margin-left: 30px;
      /* regola tu la distanza (es. 20px, 25px...) */
    }

    #toolbar button img {
      width: 85%;
      height: 85%;
      object-fit: contain;
    }


    #toolbar button:hover {
      background: #f0f0f0;
      border-color: #999;
      transform: scale(1.05);
      transition: all 0.15s ease;
    }

    /* Click: breve animazione rossa */
    #toolbar button:active {
      background: #d32f2f;
      /* rosso */
      border-color: #b71c1c;
      transform: scale(0.95);
      transition: all 0.1s ease;
    }

    #toolbar button.clicked {
      animation: flash-red 0.3s ease;
    }

    @keyframes flash-red {
      0% {
        background: #fff;
        border-color: #ccc;
      }

      50% {
        background: #d32f2f;
        border-color: #b71c1c;
      }

      100% {
        background: #fff;
        border-color: #ccc;
      }
    }

    .seiten-grid {
      display: flex;
      /* mettiamoli affiancati */
      gap: 10px;
      /* spazio tra i bottoni */
      margin-top: 10px;
    }

    .seiten-grid .seite {
      width: 60px;
      /* larghezza fissa */
      height: 120px;
      /* altezza fissa */
      background: white;
      border: 1px solid #aaa;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
      color: #333;
      transition: all 0.2s ease;
      box-sizing: border-box;
    }

    .seiten-grid .seite:hover {
      background: #f3f3f3;
    }

    .seiten-grid .seite.active {
      background: #b71c1c;
      /* rosso selezionato */
      color: white;
      border-color: #b71c1c;
    }

    .seiten-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      /* 2 colonne */
      gap: 10px;
      margin-top: 10px;
    }

    .seiten-grid {
      display: grid;
      grid-template-columns: repeat(3, auto);
      /* colonne larghe quanto serve */
      gap: 10px;
      justify-content: center;
      /* centra il tutto */
      margin-top: 10px;
    }

    .seiten-grid .seite {
      display: flex;
      align-items: center;
      justify-content: center;
      /* centratura orizzontale */
      text-align: center;
      /* centra anche il testo su più righe */
      line-height: 1.2;
      /* resetta il vecchio 50px */
      padding: 4px;
      /* evita che il testo tocchi i bordi */
      hyphens: auto;
      /* permette "Innen-seite" in tedesco */
      word-break: break-word;
      /* fallback */
    }
