/*
 * 帳票（A4ページ）のスタイル。プレビューとPDFの見た目を決める。
 * UI改善などの都合で変更しないこと。画面（操作領域）のスタイルは app.css に書く。
 *
 * 構成：
 *   1. 基本レイアウト（表紙・目次・表）
 *   2. 署名欄
 *   3. 以降は「PDF様式に合わせた微調整」の積み重ね。後ろの規則が前の規則を上書きするため、
 *      見た目を直すときは、該当する最後の規則（!important 付き）を編集する。
 */

/* ---- 1. 基本レイアウト ---- */
.a4{width:210mm;min-height:297mm;margin:0 auto 20px;background:#fff;padding:15mm 17mm 16mm;color:#111;font-family:"Yu Gothic",Meiryo,sans-serif;font-size:10.5pt;line-height:1.72;position:relative}
.a4.landscape{width:297mm;min-height:210mm;padding:13mm 15mm}
.title{font-size:15pt;margin:0 0 12mm}
.cover{padding:14mm 18mm}
.coverProject{position:absolute;top:101mm;left:20mm;right:20mm;text-align:center;font-size:12pt}
.coverDoc{position:absolute;top:135mm;left:15mm;right:15mm;text-align:center;font-size:22pt;font-weight:bold}
.coverDate{position:absolute;top:184mm;left:20mm;right:20mm;text-align:center}
.coverCompany{position:absolute;top:219mm;left:20mm;right:20mm;text-align:center}
.toc h1{text-align:center;font-size:16pt;letter-spacing:.35em;margin:5mm 0 15mm}
.a4 h2{font-size:11pt;margin:7mm 0 2mm}
.kv{width:100%;border-collapse:collapse}
.kv th,.kv td{border:0;padding:1.5mm 2mm}
.kv th{width:38mm;text-align:justify;text-align-last:justify;font-weight:normal}
.table{width:100%;border-collapse:collapse;font-size:8.5pt}
.table th,.table td{border:1px solid #333;padding:1.5mm}
.toc-chapter{background:#fff;padding:16px;border-radius:9px}

/* ---- 2. 署名欄 ---- */
.sign-area{position:absolute;left:18mm;right:18mm;bottom:13mm;font-size:8pt;line-height:1.25}.sign-table{border-collapse:collapse;width:100%;table-layout:fixed}.sign-table th,.sign-table td{border:.25mm solid #222;text-align:center;vertical-align:middle;padding:1mm}.sign-table th{height:7mm;font-weight:400}.sign-table td{height:20mm}.sign-cell{position:relative;min-height:17mm;display:flex;align-items:center;justify-content:center;gap:2mm}.sign-cell .stamp-img{max-width:17mm;max-height:17mm;object-fit:contain}.sign-cell .sign-text{font-size:7.5pt;line-height:1.35;white-space:pre-line}.sign-company{font-size:8pt;font-weight:400}.sign-stack{display:grid;grid-template-columns:1fr 1fr;gap:8mm}.sign-block-label{margin-bottom:2mm}.sign-block{border-collapse:collapse;width:100%;table-layout:fixed}.sign-block th,.sign-block td{border:.25mm solid #222;text-align:center;padding:1mm}.sign-block th{height:6mm;font-weight:400}.sign-block td{height:18mm}.sign-design{display:grid;grid-template-columns:1fr;gap:7mm}.sign-design .sign-block-label{font-weight:600}

/* ---- 3. PDF様式に合わせた微調整 ---- */
/* 表紙全体を上方向へ調整 */
.coverProject{top:82mm!important}.coverDoc{top:116mm!important}.coverDate{top:163mm!important}.coverCompany{top:196mm!important}.sign-area{bottom:24mm!important}
/* 2段署名欄は少し上へ詰め、表紙内に収める */
.sign-area.sign-design{bottom:18mm!important;gap:5mm!important}.sign-design .sign-block-label{margin-bottom:1.5mm!important}.sign-design .sign-block th{height:5.5mm!important}.sign-design .sign-block td{height:16mm!important}

/* 表紙位置の追加調整: v5.1 cover-up-more */
.coverProject{top:70mm!important}
.coverDoc{top:104mm!important}
.coverDate{top:151mm!important}
.coverCompany{top:184mm!important}
.sign-area{bottom:39mm!important}
.sign-area.sign-design{bottom:33mm!important}

/* PDF様式に合わせた階層型目次 */
.toc-pdf-style{padding:16mm 24mm 18mm!important;font-family:"Yu Gothic","YuGothic",Meiryo,sans-serif!important}.toc-pdf-style h1{text-align:center!important;font-size:16pt!important;letter-spacing:.65em!important;margin:0 0 13mm!important;font-weight:700!important}.toc-body{font-size:10pt;line-height:1.3}.toc-chapter{margin:0 0 7mm;break-inside:avoid}.toc-chapter-title{display:grid;grid-template-columns:9mm 1fr;column-gap:2mm;margin-bottom:2.3mm;font-weight:400}.toc-chapter-no{text-align:left}.toc-item{display:flex;align-items:flex-end;margin:1.7mm 0;padding-left:4mm;min-height:4.4mm}.toc-item-title{white-space:nowrap}.toc-leader{flex:1;border-bottom:.28mm dotted #222;margin:0 3mm 1.2mm;min-width:12mm}.toc-page-number{width:9mm;text-align:right}.toc-pending{color:#e60012;font-size:12pt;line-height:9pt}.toc-item-title::first-letter{letter-spacing:normal}

/* PDF様式: x.1ページの先頭に章見出し */
.document-chapter-heading{display:grid;grid-template-columns:11mm 1fr;column-gap:2mm;font-size:11pt;font-weight:400;margin:0 0 7mm}.document-chapter-heading+.title{margin-top:0}

/* 各章の先頭見出しをPDF様式に合わせて統一 */
.document-chapter-heading{
  display:grid!important;
  grid-template-columns:10mm 1fr!important;
  column-gap:2mm!important;
  align-items:baseline!important;
  margin:0 0 5mm 0!important;
  padding:0!important;
  font-family:"Yu Gothic","YuGothic",Meiryo,sans-serif!important;
  font-size:10.5pt!important;
  line-height:1.35!important;
  font-weight:400!important;
  letter-spacing:0!important;
}
.document-chapter-heading span:first-child{
  text-align:left!important;
  font-size:10.5pt!important;
  font-weight:400!important;
}
.document-chapter-heading span:last-child{
  font-size:10.5pt!important;
  font-weight:400!important;
}
.document-chapter-heading + .title{
  margin:0 0 9mm 10mm!important;
  padding:0!important;
  font-size:10.5pt!important;
  line-height:1.35!important;
  font-weight:400!important;
  letter-spacing:0!important;
}
/* 第1章の本文見出しも2章以降の小項目と同じ大きさへ統一 */
.a4:not(.toc):not(.cover) h2{
  font-size:10.5pt!important;
  line-height:1.35!important;
  font-weight:400!important;
}

/* 第1章と同じ章・項目階層へ統一 */
.a4.chapter-first .document-chapter-heading{margin:0 0 8mm 0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-first>.title{margin:0 0 14mm 10mm!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-continuation>.title{margin:0 0 14mm 10mm!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-continuation>h2:first-of-type{margin-top:0!important}

/* 津田塾大学PDF準拠の本文階層・余白 最終調整 */
.a4.chapter-first,.a4.chapter-continuation{padding-top:18mm!important;padding-left:20mm!important;padding-right:18mm!important}
.document-chapter-heading{display:flex!important;align-items:baseline!important;margin:0 0 6mm 0!important;padding:0!important;font-family:"Yu Gothic","YuGothic",Meiryo,sans-serif!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.document-chapter-heading .chapter-number{display:inline-block!important;width:15mm!important;text-align:left!important}
.document-chapter-heading .chapter-name{display:inline-block!important;font-size:10.5pt!important;font-weight:400!important}
.a4.chapter-first>.title{margin:0 0 10mm 15mm!important;padding:0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-continuation>.title{margin:0 0 10mm 15mm!important;padding:0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.document-body{margin-left:15mm!important;font-size:10.5pt!important;line-height:1.65!important}
.document-body>h2{margin:0 0 2mm 0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.document-body>h2:not(:first-child){margin-top:6mm!important}
.document-body .kv{margin-left:0!important;width:auto!important;min-width:145mm!important}
.document-body .kv th{width:42mm!important;padding:1.6mm 2mm 1.6mm 0!important;text-align:justify!important;text-align-last:justify!important;white-space:nowrap!important}
.document-body .kv td{padding:1.6mm 0 1.6mm 2mm!important}
.document-body .table{margin-left:0!important}
.a4.landscape .document-body{margin-left:10mm!important}
.a4.landscape.chapter-first>.title,.a4.landscape.chapter-continuation>.title{margin-left:10mm!important}

/* 大項目と小項目の基準線を全章で完全統一 */
.a4.chapter-only,.a4.chapter-first,.a4.chapter-continuation{padding-top:18mm!important;padding-left:20mm!important;padding-right:18mm!important}
.a4.chapter-only>.document-chapter-heading,.a4.chapter-first>.document-chapter-heading{display:grid!important;grid-template-columns:15mm 1fr!important;column-gap:0!important;margin:0 0 6mm 0!important;padding:0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-only>.document-chapter-heading .chapter-number,.a4.chapter-first>.document-chapter-heading .chapter-number{width:auto!important;text-align:left!important}
.a4.chapter-only>.document-chapter-heading .chapter-name,.a4.chapter-first>.document-chapter-heading .chapter-name{font-size:10.5pt!important;font-weight:400!important}
/* 小項目の左端は全章ともページ左から35mm */
.a4.chapter-first>.title,.a4.chapter-continuation>.title{margin:0 0 10mm 15mm!important;padding:0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-only>.document-body,.a4.chapter-first>.document-body,.a4.chapter-continuation>.document-body{margin-left:15mm!important;font-size:10.5pt!important;line-height:1.65!important}
.a4.chapter-only>.document-body>h2,.a4.chapter-first>.document-body>h2,.a4.chapter-continuation>.document-body>h2{margin:0 0 2mm 0!important;padding:0!important;font-size:10.5pt!important;line-height:1.35!important;font-weight:400!important}
.a4.chapter-only>.document-body>h2:not(:first-child),.a4.chapter-first>.document-body>h2:not(:first-child),.a4.chapter-continuation>.document-body>h2:not(:first-child){margin-top:6mm!important}

@media print{.a4{box-shadow:none;break-after:page;margin:0}}
