@media print {
  @page { size: letter portrait; margin: 0.6in; }
  body { background: white; color: black; font-size: 10pt; }
  .no-print, button, .row-actions { display: none !important; }
  .app-container { max-width: none; box-shadow: none; border-radius: 0; margin: 0; padding: 0; }
  .flex-row { display: block; }
  .stronghold-sheet { border: 0; padding: 0; background: white; width: 100%; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 9pt; table-layout: fixed; overflow-wrap: anywhere; }
  th:first-child { width: 34%; }
  th:nth-child(2) { width: 18%; }
  th, td { padding: .35rem .25rem; }
  thead { display: table-header-group; }
  tfoot { display: table-row-group; }
  tr, .summary-grid div, li { break-inside: avoid; }
  tr.selected { background: transparent; }
  h3, h4 { break-after: avoid; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .help, .room-detail, dt { color: #333; }
  .notice { color: black; background: white; border-color: black; }
  #reviewSection { display: none; }
}

@media print {
  .personnel-section { border: 0; padding: 0; background: white; break-before: page; }
  .personnel-layout { display: block; }
  .personnel-section table { min-width: 0; }
  #personnelTable th:first-child { width: 27%; }
  #personnelTable th:nth-child(2), #personnelTable th:nth-child(3) { width: 24%; }
  #personnelTable th:nth-child(4), #personnelTable th:nth-child(5) { width: 12.5%; }
  #housingTable th:first-child, #staffingTable th:first-child { width: 35%; }
  .treasury-section { break-before: page; }
  #treasuryTable th:first-child { width: 8%; }
  #treasuryTable th:nth-child(2) { width: 58%; }
  #treasuryTable th:nth-child(3), #treasuryTable th:nth-child(4) { width: 17%; }
}

@media print {
  /* Print this exact read-only view even when another tab is selected. */
  #panel-record[hidden], #panel-record { display: block !important; margin: 0; }
  #appChrome, dialog, .primary-panel.no-print, #strongholdLibrary, #storageError { display: none !important; }
  dialog::backdrop { display: none !important; }
  #recordRoot .panel { border: 0; padding: 0; }
  #record-personnelTable th:first-child { width: 28%; }
  #record-personnelTable th:nth-child(2), #record-personnelTable th:nth-child(3) { width: 24%; }
  #record-personnelTable th:nth-child(4), #record-personnelTable th:nth-child(5) { width: 12%; }
  #record-housingTable th:first-child, #record-staffingTable th:first-child { width: 35%; }
  #record-treasuryTable th:first-child { width: 8%; }
  #record-treasuryTable th:nth-child(2) { width: 58%; }
  #record-treasuryTable th:nth-child(3), #record-treasuryTable th:nth-child(4) { width: 17%; }
}

@media print {
  #recordRoot { width: 100%; min-width: 0; overflow-wrap: anywhere; }
  .record-room, .summary-grid > div { break-inside: avoid; }
  .room-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
}
