/* ---------- Preview ---------- */
.preview {
  position: sticky;
  top: 42px;
  align-self: start;
  margin-top: 100px;
}

.qr-card {
  width: 100%;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 360px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 10px;
  
}

#qrCanvas,
#qrPlaceholder {
  display: block;
  max-width: 100%;     /* passt sich der Spaltenbreite an – kein Überlauf auf Mobil */
  /* Vorher 360px: das begrenzte höhere Rahmen (Bubble, circle-with-bottom-bar) stärker
     als breite/normale Rahmen und ließ sie dadurch insgesamt schmaler wirken, weil
     Breite UND Höhe gleichzeitig limitiert wurden. Jetzt großzügiger, damit bei
     allen Rahmen-Arten einheitlich die Breite die Größe bestimmt. */
  max-height: 520px;
  width: auto;
  height: auto;
  margin-top: 30px;
}

#qrCanvas[hidden],
#qrPlaceholder[hidden] { display: none; }

/* ---------- Download: Format-Auswahl direkt sichtbar (kein Dropdown) ---------- */
.save-box { margin-top: 14px; }

.dl-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.dl-fmt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: border-color .15s ease, background .15s ease;
}

.dl-fmt input {
  accent-color: var(--theme-color);
  cursor: pointer;
  margin: 0;
}

.dl-fmt:has(input:checked) {
  border-color: var(--theme-color);
  background: var(--theme-color-hover);
  font-weight: 600;
}

.dl-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* Drucken-Knopf neben dem Download-Button */
.print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease;
}
.print-btn:hover { background: #ececf0; }

/* ---------- Download-Button (deine Anpassungen bleiben erhalten) ---------- */
.save-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);

  /* Normaler Zustand: hellere Zufallsfarbe */
  background: var(--theme-color-hover) !important;
  color: var(--theme-color) !important;

  font: 500 15px inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.save-btn:hover {
  background: var(--theme-color-hover) !important;
  opacity: 0.85;
}

/* BEREIT (.ready): vollflächige Zufallsfarbe & weiße Schrift */
.save-btn.ready {
  background: var(--theme-color) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px var(--theme-color-hover) !important;
}

.save-btn.ready:hover {
  background: var(--theme-color) !important;
  opacity: 0.9 !important;
}

/* In der Button-Reihe: Download-Button füllt die Breite, kein Extra-Abstand oben */
.dl-actions .save-btn {
  flex: 1;
  width: auto;
  margin-top: 0;
}