/* =============================================================================
 * print.css — the plan sheet builder (js/plansheet.js)
 *
 * On screen: a full-window preview of the sheets with the paper, scale and
 * drawn-by controls above them. In print: only the sheets, one per page, at
 * their true size, so Print → Save as PDF gives a drawing to scale. The page
 * size itself (@page) is written by plansheet.js, because it follows the
 * paper chosen.
 * ========================================================================== */

.ps-root {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; flex-direction: column;
  background: var(--bg, #1A1C1F); color: var(--fg, #F4F5F2);
  font-family: var(--font, sans-serif);
}
.ps-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line, #363A40);
}
.ps-bar label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ps-bar .ff-in { width: auto; min-width: 0; }
.ps-bar .ps-drawn { width: 160px; }
.ps-bar .ps-drawn.is-ask { outline: 2px solid var(--fg, #F4F5F2); }
.ps-title { font-size: 15px; letter-spacing: .4px; margin-right: 4px; }
.ps-status { flex: 1 1 240px; font-size: 12.5px; }
.ps-root.is-busy .ps-pages { opacity: .35; }

.ps-pages {
  flex: 1; overflow: auto; padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.ps-sheet {
  width: 100%; max-width: 1400px; flex: none;
  background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.ps-sheet svg { display: block; width: 100%; height: auto; }

@media (max-width: 640px) {
  .ps-bar { padding: 8px 12px; }
  .ps-pages { padding: 12px 0; }
}

@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body.ps-open > *:not(.ps-root) { display: none !important; }
  body.ps-open .ps-root {
    position: static; display: block; background: none; color: #000;
  }
  .ps-bar { display: none !important; }
  .ps-pages { display: block; padding: 0; overflow: visible; opacity: 1 !important; }
  .ps-sheet {
    width: auto; max-width: none; margin: 0; box-shadow: none; aspect-ratio: auto !important;
    break-after: page; page-break-after: always; break-inside: avoid;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ps-sheet:last-child { break-after: auto; page-break-after: auto; }
  /* True size is set beside @page by plansheet.js, in inches. */
}
