/* ============================================================
   print.css — 印刷 / PDF保存用（A4横・1セクション＝1ページ）
   印刷ダイアログで「用紙: A4」「向き: 横」「余白: なし」
   「背景のグラフィック: オン」を選ぶこと。
   ============================================================ */

@page {
  size: A4 landscape;
  margin: 0;                 /* 余白はページ内側 .pad で確保する */
}

@media print {
  html, body { background: #fff !important; }

  /* 画面専用UIは印刷しない */
  .topbar, .progress { display: none !important; }

  /* 背景色・背景画像を確実に印刷する */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .sheet { display: block; padding: 0; gap: 0; }

  .page {
    width: 297mm;
    height: 210mm;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
    box-shadow: none !important;
    overflow: hidden;
    break-inside: avoid;
    break-after: page;
    page-break-inside: avoid;
    page-break-after: always;
  }
  .page:last-child { break-after: auto; page-break-after: auto; }

  /* ページ内で分割されたくない箱 */
  .card, .step, .fig, .tl-row, .fitem, .credit, .vs-row {
    break-inside: avoid; page-break-inside: avoid;
  }

  /* 濃い面・色面は背景を強制する（印刷で落ちるため） */
  .page.cover { background: #167FB8 !important; color: #fff !important; }
  .cov-wm { color: rgba(255,255,255,.13) !important; }
  .page.dark  { background: #0a0a0a !important; color: #fff !important; }
  .page.act1  { background: #FDFBF7 !important; }

  .card.solid { background: #0a0a0a !important; color: #fff !important; }
  .card.blue  { background: #167FB8 !important; color: #fff !important; }
  .card.tint  { background: #f6f6f5 !important; }
  .card.warm  { background: #F8F2E9 !important; }

  .tbd { background: #0E6C9F !important; color: #fff !important; }
  .page.dark .tbd, .card.solid .tbd { background: #57ABDD !important; color: #06222F !important; }
  .card.blue .tbd { background: #fff !important; color: #0E6C9F !important; }

  .tbl thead th { background: #0E6C9F !important; color: #fff !important; }
  .tbl tbody tr.sub td { background: #E9F3FA !important; }
  .tbl tbody tr.total td { background: #167FB8 !important; color: #fff !important; }
  .tbl tbody tr.total.blk td { background: #0a0a0a !important; color: #fff !important; }
  .page.dark .tbl tbody tr.sub td { background: #16384C !important; color: #fff !important; }

  .tl-row.warm  { background: #F8F2E9 !important; }
  .tl-row.hi    { background: #f6f6f5 !important; }
  .tl-row.key   { background: #167FB8 !important; color: #fff !important; }
  .tl-row.amber { background: #A8722F !important; color: #fff !important; }
  .tl-row.blk   { background: #0a0a0a !important; color: #fff !important; }

  .vs-col.a { background: #F8F2E9 !important; }
  .vs-col.b { background: #0a0a0a !important; color: #fff !important; }

  .fmap { background: #f6f6f5 !important; }
  .fmap.night { background: #14181b !important; }
  .fitem { background: #fff !important; }
  .fitem.k { background: #167FB8 !important; color: #fff !important; }
  .fitem.w { background: #A8722F !important; color: #fff !important; }
  .fmap.night .fitem { background: #232a2f !important; color: #fff !important; }
  .fitem.ghost { background: transparent !important; }

  .bar { background: #c4c4c4 !important; }
  .bar.on { background: #167FB8 !important; }
  .bar.mid { background: #57ABDD !important; }

  /* リンクのURL自動追記・色変化を止める */
  a[href]::after { content: "" !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
