/* 印刷専用。先生が一番見るのは印刷結果 */
@page{size:A4 landscape;margin:12mm}
body.landscape{}
@media print{
  body{background:#fff}
  /* スマホ用の縮小は紙には持ちこまない */
  #sheetBox{height:auto !important;overflow:visible !important}
  .sheet{width:auto !important;transform:none !important}
  .noprint,.site-head,.read,footer,.plan-tabs,.card,details.opt,.notice,
  h1,.catch,.lead,.two-col{display:none !important}
  .wrap{max-width:none;padding:0;margin:0}
  #result{margin:0}
  .sheet{border:none;border-radius:0;padding:0}
  .sheet-title{font-size:16pt}
  .sheet-date{font-size:10pt}
  .board{padding:2mm;font-size:11pt;letter-spacing:.5em}
  .board{background:#3e5c4b !important;color:#fff !important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .seat{
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
    border:1pt solid #b5b5b5;min-height:14mm;
  }
  .seat.empty{
    background:#fff !important;border-style:solid !important;
    font-size:0 !important;color:transparent !important;
  }
  /* 画面用のサイズが要素に直接ついているので、印刷では上書きする */
  .seat .nm{font-size:var(--nmPrint,4mm) !important}
  /* 男女の色は紙では出さない（⑤のチェックを入れたときだけ出す） */
  .sheet:not(.sexprint) .seat .nm{color:#111 !important}
  .seat.bad{border-color:#999;background:#fff}
  /* 班の色は紙にも出す。線は太めにして、色が薄い印刷機でも見分けられるように */
  .seat.grp{border-width:1mm !important;border-color:var(--gLine) !important}
  .seat.g-both,.seat.g-fill{background:var(--gFill) !important}
  .seat.g-fill{border-width:.3mm !important;border-color:#b5b5b5 !important}
  .seat.g-none{border-width:1pt !important;border-color:#b5b5b5 !important;background:#fff !important}
  .seat.g-none .gno{color:#555 !important}
  .seat .gno{
    font-size:3.2mm !important;color:var(--gLine) !important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  /* 「班の番号を出す」を外したぶんは、紙には出さない */
  .seat .gno.dim{display:none !important}
}

@media print{
  /* 机は少しだけ角丸に（かたくしない） */
  .seat{border-radius:6px}
  /* かざりは印刷にも出す */
  .deco-mark{font-size:14pt}
  .sheet-head{display:grid;grid-template-columns:auto 1fr auto;align-items:end;gap:6px}
}

@media print{
  .seat{height:var(--seatH,15mm);padding:1.5mm}
  .sheet-foot{
    display:grid !important;grid-template-columns:1fr auto 1fr;align-items:end;
    break-inside:avoid;page-break-inside:avoid;margin-top:6mm;
  }
  .sheet.bold .seat .nm{font-weight:bold}
}

@media print{
  body.print-all #sheet{display:none}
  body.print-all #printAll{display:block}
  #printAll .sheet{break-after:page;page-break-after:always}
  #printAll .sheet:last-child{break-after:auto;page-break-after:auto}
}

@media print{
  .sheet-credit{
    font-size:9pt;color:#b9a8b0;margin-top:4mm;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
}

@media print{
  /* サンプルのまま刷ってしまう事故を防ぐので、透かしは紙にも出す */
  .sheet.sample::after{
    content:"SAMPLE";position:absolute;inset:0;
    display:flex;align-items:center;justify-content:center;
    font-weight:bold;font-size:80pt;letter-spacing:.14em;
    color:rgba(229,143,174,.3);transform:rotate(-18deg);
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
}

@media print{
  /* 紙の高さいっぱいに広げる。URLは紙の一番下に置く（下の余白が空かないように）
     🔴⚠ここで 100vh を使ってはいけない（2026-09-01 タブレットで発覚）。
        パソコンでは紙の高さとほぼ一致するが、**タブレットは画面の高さ**が入ってきて、
        紙からはみ出し、サイト名が2ページ目に流れる。
        用紙の向きから mm で決めた値を JS が --sheetMin に入れる。入っていなければ広げない */
  .sheet{
    min-height:var(--sheetMin, 0);
    display:flex;flex-direction:column;
  }
  .sheet{justify-content:flex-start}   /* ⚠上ぞろえ。上下中央にしない（2026-09-01 本人） */
  .sheet .grid{flex:0 0 auto}
  .sheet-credit{margin-top:auto;padding-top:4mm}
  .sheet-foot{display:none}
}
