/* Printable templates. Builds on style.css tokens and classes. */

.print-tool [hidden] { display: none !important; }

.print-tool input[type="date"], .print-tool input[type="time"] { direction: ltr; text-align: start; }

.print-form { margin-top: 20px; }
.print-form > .calendar-choice + .calendar-choice { margin-top: 12px; }
.print-form .segmented { flex-wrap: wrap; }
.print-form .segmented label { min-width: 72px; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); column-gap: 8px; }
.signatures { border: 0; padding: 0; margin: 20px 0 0; }
.signatures legend { padding: 0; font-weight: 600; }
.signatures .two-cols .field { margin-top: 10px; }

.sheet-preview { margin: 0; }
.sheet-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 297 / 210;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.18);
}
.print-status { min-height: 1.4em; margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.print-status:empty { display: none; }

.print-downloads { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

.privacy-note { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.steps { margin: 0; padding-inline-start: 20px; }
.steps li { margin-bottom: 6px; }
.prose h2:not(:first-child) { margin-top: 20px; }
.hub-prose { margin-top: 16px; }

/* Timetable cell editor */
.grid-title { margin: 24px 0 4px; font-size: 17px; }
.grid-wrap { overflow-x: auto; margin: 12px -4px 12px; padding: 0 4px; }
.grid-editor { border-collapse: separate; border-spacing: 3px; min-width: 100%; font-size: 14px; }
.grid-editor th { font-weight: 600; white-space: nowrap; padding: 4px; color: var(--muted); }
.grid-editor th small { display: block; font-weight: 400; font-size: 12px; }
.grid-editor tbody th { text-align: start; color: var(--text); }
.grid-editor td { padding: 0; }
.print-tool .grid-editor input[type="text"] { min-width: 76px; min-height: 40px; padding: 6px; font-size: 15px; border-radius: 8px; }
.grid-editor .is-break { background: var(--bg); border-radius: 8px; min-width: 18px; padding: 0 4px; font-size: 12px; }

/* Ready-made phrases */
.phrases h3 { font-size: 16px; margin: 20px 0 4px; }
.phrase-list li { gap: 6px; }
.phrase-list li > div { padding-block: 10px; line-height: 1.6; }
.phrase-list button.copy { flex-shrink: 0; font-size: 14px; padding: 5px 12px; }

/* Printing: only the sheet, on A4 landscape. */
.print-sheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  body.is-printing { margin: 0; background: #fff; }
  body.is-printing > :not(.print-sheet) { display: none !important; }
  body.is-printing .print-sheet { display: block; width: 297mm; height: 209.5mm; margin: 0; }
}

/* Certificate: many names, pictures */
.sheet-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.sheet-pager[hidden] { display: none; }
.sheet-pager button.copy { min-width: 48px; font-size: 20px; line-height: 1; padding: 6px 12px; }
.batch-cancel { margin: 4px 0 0; text-align: center; }
.batch-cancel:has(> [hidden]) { display: none; }
.names-count { margin: 4px 0 0; }
.print-form [data-batch] .field, .print-form [data-single] .field { margin-top: 12px; }
.print-form textarea[name="names"] { font-size: 16px; line-height: 1.6; }
.picture-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.picture-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border: 1px dashed var(--line, #d0d4d9); border-radius: 10px; text-align: center; font-size: 14px; }
.picture-slot img { max-width: 100%; height: 48px; object-fit: contain; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 4px; }
.picture-slot label.copy, .picture-slot button.copy { font-size: 14px; padding: 4px 12px; min-height: 36px; cursor: pointer; }
.pictures .check { margin-top: 10px; }
.pictures [data-forget] { margin-top: 8px; font-size: 14px; }

/* Printing many sheets: one per page. */
.print-sheets { display: none; }
@media print {
  body.is-printing-many { margin: 0; background: #fff; }
  body.is-printing-many > :not(.print-sheets) { display: none !important; }
  body.is-printing-many .print-sheets { display: block; }
  .print-sheets img { display: block; width: 297mm; height: 209.5mm; margin: 0; break-after: page; page-break-after: always; }
  .print-sheets img:last-child { break-after: auto; page-break-after: auto; }
}
