/* ============================================================================
 * shared/doc.css ― 画面に出す書面（eoRenderDoc mode:'screen'）の見た目
 * お客様の画面・管理画面のプレビューで共用。PDFは render.js の eoPdfCss() が別に持つ。
 * 色の正＝共通ルールブック §5（ネイビー #10293C／ティール #0F7E9D／シアン #7FD7E2）
 * ==========================================================================*/
.eo-doc { display: flex; flex-direction: column; gap: 20px; color: var(--ink, #17232c); }
.eo-sheet {
  background: var(--paper, #fdfefe);
  border: 1px solid var(--line, #d5dee3);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 41, 60, .05), 0 8px 24px -12px rgba(16, 41, 60, .14);
  padding: clamp(20px, 4vw, 44px) clamp(18px, 4.5vw, 48px);
  font-size: 14px; line-height: 1.75;
}
.eo-doc table { border-collapse: collapse; width: 100%; }

.eo-head td { vertical-align: top; }
.eo-head-r { text-align: right; }
.eo-logo { height: 26px; display: block; margin-left: auto; margin-bottom: 8px; }
.eo-meta { font-size: 12.5px; color: var(--sub, #52606b); line-height: 1.8; font-variant-numeric: tabular-nums; }
.eo-meta b { color: var(--ink, #17232c); font-weight: 700; }
.eo-stamp {
  display: inline-block; font-size: 12px; color: #8a4b12; background: #fff6ea;
  border: 1px solid #ecc592; border-radius: 12px; padding: 2px 10px;
}
.eo-title {
  text-align: center; color: var(--navy, #10293c);
  font-size: clamp(20px, 3.2vw, 26px); font-weight: 700; letter-spacing: .28em;
  margin: 20px 0 4px; line-height: 1.4; text-indent: .28em;
}
.eo-delivery { text-align: center; color: var(--teal, #0f7e9d); font-size: 12.5px; letter-spacing: .06em; margin: 0 0 24px; }

.eo-parties td { vertical-align: top; }
.eo-party { width: 48%; }
.eo-gap { width: 4%; }
.eo-party h2 {
  font-size: 13px; color: var(--navy, #10293c); font-weight: 700; margin: 0 0 6px;
  padding-bottom: 5px; border-bottom: 1.5px solid var(--navy, #10293c);
}
.eo-party-t th { width: 8.3em; text-align: left; font-weight: 400; color: var(--sub, #52606b); vertical-align: top; padding: 3px 8px 3px 0; font-size: 12.5px; }
.eo-party-t td { padding: 3px 0; font-size: 13.5px; }

.eo-lead {
  margin: 24px 0 18px; padding: 12px 16px; background: var(--tint, #eaf3f6);
  border-left: 3px solid var(--teal, #0f7e9d); border-radius: 0 12px 12px 0; font-size: 13.5px;
}
.eo-grid { margin-bottom: 14px; }
.eo-grid th, .eo-grid td { border: 1px solid var(--line, #d5dee3); padding: 8px 12px; vertical-align: top; }
.eo-grid th { background: var(--tint, #eaf3f6); color: var(--navy, #10293c); font-weight: 700; text-align: left; font-size: 13px; }
.eo-kv th { width: 9.5em; white-space: nowrap; }
.eo-items thead th { text-align: center; }
.eo-items .w-no { width: 3em; } .eo-items .w-qty { width: 5em; } .eo-items .w-yen { width: 8.5em; }
.eo-doc .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eo-doc .c { text-align: center; } .eo-doc .r { text-align: right; }
.eo-items tr.sum td { background: #f7fafb; }
.eo-items tr.total td { font-weight: 700; color: var(--navy, #10293c); border-top: 2px solid var(--navy, #10293c); font-size: 15px; }
.eo-note { font-size: 12.5px; color: var(--sub, #52606b); margin: 0; }

.eo-h3 { font-size: 16px; color: var(--navy, #10293c); font-weight: 700; margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.eo-h3 small { font-size: 12px; color: var(--sub, #52606b); font-weight: 400; }
.eo-terms th, .eo-terms td { border-bottom: 1px solid var(--line, #d5dee3); padding: 10px 6px; vertical-align: top; font-size: 13.5px; line-height: 1.8; }
.eo-terms tr:first-child th, .eo-terms tr:first-child td { border-top: 2px solid var(--navy, #10293c); }
.eo-terms th { width: 11em; text-align: left; color: var(--navy, #10293c); font-weight: 700; white-space: nowrap; }
.eo-terms-end { height: 1px; }

.eo-rec-intro { margin: 0 0 12px; font-size: 13.5px; }
.eo-rec th, .eo-rec td { border: 1px solid var(--line, #d5dee3); padding: 10px 12px; vertical-align: top; font-size: 13px; }
.eo-rec thead th { background: var(--navy, #10293c); color: #fdfefe; text-align: left; border-color: var(--navy, #10293c); font-weight: 700; }
.eo-rec .step { width: 6.5em; font-weight: 700; color: var(--navy, #10293c); white-space: nowrap; }
.eo-rec .step span { display: block; font-size: 11.5px; color: var(--sub, #52606b); font-weight: 400; }
.eo-rec .when { width: 10.5em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eo-rec .who { width: 15em; }
.eo-done { display: inline-block; margin-top: 4px; font-size: 11.5px; color: var(--teal, #0f7e9d); border: 1px solid var(--teal, #0f7e9d); border-radius: 12px; padding: 0 8px; }
.eo-hash { margin: 16px 0; }
.eo-hash td { border: 1px solid var(--line, #d5dee3); border-radius: 12px; padding: 12px 16px; font-size: 13px; }
.eo-hash-v { font-family: "Consolas", "SFMono-Regular", monospace; font-size: 12.5px; word-break: break-all; margin-top: 4px; color: var(--ink, #17232c); }
.eo-hash-s { font-size: 12px; color: var(--sub, #52606b); margin-top: 4px; }
.eo-fine { margin: 0; padding-left: 1.2em; font-size: 12.5px; color: var(--sub, #52606b); line-height: 1.8; }
.eo-end { text-align: right; margin: 18px 0 0; }

/* 条文形式の書面（顧問契約・変更合意） */
.eo-subtitle { text-align: center; color: var(--navy, #10293c); font-size: 14px; letter-spacing: .2em; margin: -2px 0 4px; }
.eo-preamble { margin: 0 0 18px; font-size: 13.5px; }
.eo-approver { margin: 10px 0 0; padding: 8px 12px; background: var(--tint, #eaf3f6); border-radius: 12px; font-size: 13px; color: var(--navy, #10293c); }
.eo-art { margin: 0 0 16px; }
.eo-art h4 { margin: 0 0 4px; font-size: 14.5px; color: var(--navy, #10293c); }
.eo-art p { margin: 0 0 2px; font-size: 13.5px; line-height: 1.8; text-align: justify; }
.eo-art p.n { padding-left: 1.3em; text-indent: -1.3em; }
.eo-art p.i { padding-left: 1em; }
.eo-art p.i.b { padding-left: 2em; text-indent: -1em; }
.eo-art .eo-parties { margin: 6px 0 0; }
.eo-fee { margin: 6px 0 10px; } .eo-fee .w-yen2 { width: 10em; }
.eo-fee thead th { text-align: center; }
.eo-fee tr.total td { font-weight: 700; color: var(--navy, #10293c); border-top: 2px solid var(--navy, #10293c); }
.eo-change th small { display: block; font-weight: 400; color: var(--sub, #52606b); font-size: 12px; }
.eo-change td.after { font-weight: 700; color: var(--navy, #10293c); }
.eo-change .w-item { width: 11em; }
.eo-closing { margin: 20px 0 4px; font-size: 13.5px; }
.eo-signed { margin: 0; font-size: 13.5px; }
/* テンプレート方式の契約書：末尾の記名欄・別表・別紙／表形式の書面（個別業務発注書） */
.eo-sign { margin: 18px 0 0; }
.eo-app { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line, #d5dee3); }
.eo-app h4 { margin: 0 0 8px; font-size: 14.5px; color: var(--navy, #10293c); }
.eo-app-intro { margin: 0 0 8px; font-size: 13px; color: var(--sub, #52606b); }
.eo-app-note { margin: 0 0 4px; font-size: 13px; }
.eo-app-kv th { width: 12em; white-space: normal; }
.eo-app-grid thead th { text-align: center; }
.eo-app-grid .w-yen2 { width: 9em; }
.eo-app-grid td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eo-app-grid tr.sum td { background: var(--paper2, #f7fafb); }
.eo-app-grid tr.total td { font-weight: 700; color: var(--navy, #10293c); border-top: 2px solid var(--navy, #10293c); }
.eo-form { margin: 8px 0 0; }
.eo-form .eo-app-note { margin-top: 8px; }
.eo-base { margin: 10px 0 0; font-size: 12.5px; color: var(--sub, #52606b); }

/* スマホ：表を縦に積む（書面の中身は削らない） */
@media (max-width: 640px) {
  .eo-sheet { font-size: 13.5px; }
  .eo-parties, .eo-parties > tbody, .eo-parties > tbody > tr, .eo-parties > tbody > tr > td { display: block; width: 100% !important; }
  .eo-gap { height: 14px; }
  .eo-head-r { text-align: left; }
  .eo-logo { margin-left: 0; }
  .eo-terms tr, .eo-terms th, .eo-terms td { display: block; width: 100%; }
  .eo-terms th { border-bottom: 0; padding-bottom: 0; white-space: normal; }
  .eo-terms tr:first-child td { border-top: 0; }
  .eo-rec thead { display: none; }
  .eo-rec tr, .eo-rec td { display: block; width: 100% !important; }
  .eo-rec tr { border: 1px solid var(--line, #d5dee3); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
  .eo-rec td { border: 0; border-bottom: 1px solid var(--line, #d5dee3); }
  .eo-rec td:last-child { border-bottom: 0; }
  /* 別表・別紙・発注書の「項目｜内容」の表は、項目の下に内容を積む */
  .eo-app-kv, .eo-app-kv tbody, .eo-app-kv tr, .eo-app-kv th, .eo-app-kv td { display: block; width: 100% !important; }
  .eo-app-kv th { border-bottom: 0; }
  .eo-app-kv tr + tr th { border-top: 0; }
  /* 明細は1件ずつの組にする（項目名／数量 × 単価／金額）。中身は削らない */
  .eo-items, .eo-items tbody { display: block; width: 100%; }
  .eo-items thead { display: none; }
  .eo-items tbody tr { display: grid; grid-template-columns: 1.8em auto 1fr auto; column-gap: 8px; border: 1px solid var(--line, #d5dee3); border-top: 0; padding: 10px 12px; }
  .eo-items tbody tr:first-child { border-top: 1px solid var(--line, #d5dee3); border-radius: 12px 12px 0 0; }
  .eo-items tbody td { border: 0; padding: 0; }
  .eo-items tbody tr:not(.sum):not(.total) td:nth-child(1) { grid-row: span 2; color: var(--sub, #52606b); }
  .eo-items tbody tr:not(.sum):not(.total) td:nth-child(2) { grid-column: 2 / 5; font-weight: 500; margin-bottom: 2px; }
  .eo-items tbody tr:not(.sum):not(.total) td:nth-child(3) { grid-column: 2; text-align: left; color: var(--sub, #52606b); }
  .eo-items tbody tr:not(.sum):not(.total) td:nth-child(4) { grid-column: 3; text-align: left; color: var(--sub, #52606b); }
  .eo-items tbody tr:not(.sum):not(.total) td:nth-child(4)::before { content: "× "; }
  .eo-items tbody tr:not(.sum):not(.total) td:nth-child(5) { grid-column: 4; }
  .eo-items tr.sum, .eo-items tr.total { display: flex; justify-content: space-between; gap: 12px; }
  .eo-items tr.sum td, .eo-items tr.total td { background: none; border: 0; }
  .eo-items tr.total { border-radius: 0 0 12px 12px; border-top: 2px solid var(--navy, #10293c); }
}
