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

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

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

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

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

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

  /* 1ページ＝A4横 */
  .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; }

  /* セル・カードがページ内で分割されないように */
  .fact, .issue, .step, .toc-item, .tile, .panel, .rolebox,
  .litem, .ddarow, .mvpstep, .cycev, .rec, .calcrow { break-inside: avoid; page-break-inside: avoid; }

  /* 表紙・最終ページはページ番号を出さない/白抜き */
  .page.cover .folio { display: none !important; }
  .page.closing .folio { color: rgba(255,255,255,.6) !important; }

  /* 濃い面は背景を強制 */
  .page.cover { background: #0d1210 !important; }
  .page.dark { background: #0e1412 !important; color: #fff !important; }
  .page.hero { background: #0b0f0d !important; }
  .page.closing { background: #0d1210 !important; }
  .aside { background: #121815 !important; color: #fff !important; }
  .anav a.on { background: rgba(255,255,255,.1) !important; }
  .hnode.on { background: #1d4d3b !important; border-color: #1d4d3b !important; color: #fff !important; }
  .rolebox.core { background: #1d4d3b !important; border-color: #1d4d3b !important; color: #fff !important; }
  .vsend.ok { background: #1d4d3b !important; color: #fff !important; }
  .vsend.bad { background: #f4f4f0 !important; }
  .ddafoot, .atbl tbody tr.hi { background: #eef3f0 !important; }
  .toc-note { background: #f4f4f0 !important; }
  .tile.warn, .cycev.now, .cmp .tbl td.now { background: #f7efe6 !important; }
  .cycev.nx, .cmp .tbl td.nx { background: #f7eef1 !important; }
  .atbl thead th { background: #f4f4f0 !important; }
  .panel, .tile, .rolebox, .flow-node, .hnode, .cycev { background: #fff !important; }
  .amain { background: #fcfcfa !important; }
  .tbl tbody tr:nth-child(even) { background: rgba(0,0,0,.014) !important; }

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