/* =========================================================
   印刷用CSS (A4)
   スマートフォン画面用UI(ヘッダー/ナビ/ボタン)をPDF/印刷へ混入させない。
   ========================================================= */

@page {
  size: A4 portrait;
  margin: 12mm;
}

@media print {
  html, body {
    background: #fff !important;
    font-size: 12px;
    color: #111;
  }

  /* アプリのUIクロームを非表示 */
  .app-header,
  .home-bottom-nav,
  .bottom-action-bar,
  .report-tabs,
  .history-search,
  .camera-controls,
  .modal-overlay,
  .toast,
  .loading-overlay,
  .draft-banner,
  .no-print {
    display: none !important;
  }

  #app-main {
    padding: 0 !important;
    min-height: 0 !important;
  }

  .view { display: none !important; }
  .view--active { display: block !important; }

  .report-preview-scroll,
  #memo-sheet-container,
  #history-detail-container {
    padding: 0 !important;
  }

  /* 画面ではタブ切替で1枚だけ表示しているが、印刷時は選択した帳票を全て連続ページで出力する */
  .report-sheet-slot {
    display: block !important;
  }
  .report-sheet-slot:not(:last-child) {
    page-break-after: always;
  }

  .a4-sheet {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    min-height: 0 !important;
    max-width: none;
  }
  .a4-sheet + .a4-sheet {
    page-break-before: always;
    margin-top: 0 !important;
  }

  .memo-sheet-a4 {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    width: 100%;
  }

  /* 画面プレビューでは横スクロールさせているが、印刷時はA4の実寸幅に収まるため
     スクロール用の制約(min-width/overflow)を解除して自然に全列を表示する */
  .a4-table-scroll { overflow-x: visible !important; }
  .a4-events-table { min-width: 0 !important; }

  a[href]::after { content: ''; }
}
