/* QR Code tool: print sheet panel and its print mode. The rest of the page
   still carries its original inline styles. */

.qr-sheet {
  max-width: 900px;
  margin-top: 40px;
}

.qr-sheet h2 {
  margin-bottom: 6px;
}

.qr-sheet-intro {
  margin-bottom: 4px;
}

.qr-sheet-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  column-gap: 16px;
}

.qr-sheet-field[hidden] {
  display: none;
}

.qr-sheet-wide {
  grid-column: 1 / -1;
}

.qr-sheet-status {
  margin: 18px 0 10px;
  min-height: 3em;
  font-size: 14px;
}

.qr-sheet-status.is-error {
  color: #b02a37;
}

.qr-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qr-sheet-button {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid var(--site-accent);
  background: transparent;
  color: var(--site-accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.qr-sheet-button:hover:not(:disabled),
.qr-sheet-button:focus-visible {
  background: var(--site-accent);
  color: var(--site-accent-contrast);
}

.qr-sheet-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--site-accent-ring);
}

.qr-sheet-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.qr-sheet-note {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.8;
}

/* The preview keeps the paper's shape before and after the image loads,
   so nothing below it moves when the sheet appears. */
.qr-sheet-preview {
  margin-top: 18px;
  width: min(100%, 520px);
  aspect-ratio: 210 / 297;
  border: 2px dashed var(--site-surface-border);
  border-radius: 6px;
  background: var(--site-surface);
  overflow: hidden;
}

.qr-sheet-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.qr-sheet-preview img[hidden] {
  display: none;
}

.qr-card .card-links {
  display: flex;
  justify-content: center;
  gap: 14px;
}

#qr-print-area {
  display: none;
}

@media print {
  body.qr-printing > *:not(#qr-print-area) {
    display: none !important;
  }

  html:has(body.qr-printing),
  body.qr-printing {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.qr-printing #qr-print-area {
    display: block;
    overflow: hidden;
    break-inside: avoid;
  }

  body.qr-printing #qr-print-area img {
    display: block;
    width: 100%;
    height: 100%;
  }
}
