.preview-area {
  padding: 16px 28px 48px;
  display: flex;
  flex-direction: column;
  align-items: safe center;
  overflow: auto;
  max-height: calc(100vh - 52px);
  background: var(--bg-preview);
}

@media (max-width: 1100px) {
  .preview-area {
    max-height: none;
    padding: 16px;
  }
}

.preview-toolbar {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-controls input[type="range"] {
  width: 100px;
}

.print-tip {
  width: 100%;
  max-width: 900px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.a4-pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  zoom: var(--preview-zoom);
  margin: 0 auto;
}

.preview-empty {
  width: 210mm;
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.a4-sheet {
  width: 210mm;
  height: 297mm;
  background: #fff;
  color: #111;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  page-break-after: always;
  break-after: page;
}

.a4-sheet:last-child {
  page-break-after: auto;
  break-after: auto;
}

.a4-sheet-header,
.a4-sheet-footer {
  position: absolute;
  left: 10.5mm;
  right: 10.5mm;
  display: flex;
  justify-content: space-between;
  font-size: 7pt;
  color: #8a8f95;
  font-family: var(--font);
  pointer-events: none;
}

.a4-sheet-header {
  top: 5mm;
}

.a4-sheet-footer {
  bottom: 5mm;
}

.tcg-grid {
  display: grid;
  grid-template-columns: repeat(3, 63mm);
  grid-template-rows: repeat(3, 88mm);
}

.tcg-grid.gap-zero {
  gap: 0;
}

.tcg-grid.gap-small {
  gap: 2mm;
}

.tcg-grid.gap-medium {
  gap: 4mm;
}

.tcg-card {
  --tc: #5f6b76;
  width: 63mm;
  height: 88mm;
  background: #fff;
  border: 0.3mm solid #b9bec4;
  border-radius: 2.5mm;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  color: #111;
}

.tcg-grid.gap-zero .tcg-card {
  border-radius: 0;
}

.show-crop-marks .tcg-card {
  outline: 0.2mm dashed rgba(0, 0, 0, 0.3);
  outline-offset: -0.1mm;
}

.tcg-card.empty-slot {
  background: transparent;
  border: 0.25mm dashed #d3d6da;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tcg-card.empty-slot.invisible-slot {
  border-color: transparent;
  outline: none !important;
}

.empty-slot-label {
  font-size: 7pt;
  color: #c3c7cc;
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .no-print {
    display: none !important;
  }

  .app-workspace {
    display: block !important;
    min-height: auto !important;
  }

  .preview-area {
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: none !important;
    display: block !important;
  }

  .a4-pages-container {
    zoom: 1 !important;
    gap: 0 !important;
    display: block !important;
  }

  .a4-sheet {
    height: 296.6mm !important;
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
  }

  .a4-sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}
