/* ============================================================
   Coding Pack - エクスプレスパック 下層ページ
   （入稿ガイド／取引条件／削減シミュレーター／見積書作成ツール／見積もり・入稿フォーム）
   読み込み順：css/style.css → css/expresspack.css → このファイル
   ルール：角丸なし（ボタンを除く）・影なし・本文18px・最小16px
   ============================================================ */

/* ---- ページの見出し ---- */
.ep-page-hero {
  padding: 64px 20px 72px;
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 14px, transparent 14px 28px),
    linear-gradient(135deg, var(--green) 0%, var(--green-dark) 60%, var(--ep-green-dk) 100%);
  color: var(--white);
}
.ep-page-hero-inner { max-width: var(--container); margin: 0 auto; }
.ep-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 16px;
  margin-bottom: 20px;
}
.ep-crumb li + li::before { content: '›'; margin-right: 10px; opacity: .7; }
.ep-crumb a { color: var(--white); text-decoration: underline; }
.ep-crumb a:hover { color: var(--green-light); }
.ep-page-kicker {
  display: inline-block;
  padding: 2px 14px;
  background: var(--white);
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .12em;
  margin-bottom: 16px;
}
.ep-page-title {
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 18px;
}
.ep-page-lead {
  max-width: 860px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.9;
}

/* ---- 本文 ---- */
.ep-doc-wrap { padding: 72px 0 96px; }
.ep-doc { max-width: 960px; margin: 0 auto; }
.ep-doc > section + section { margin-top: 72px; }
.ep-doc h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 900;
  line-height: 1.4;
  padding: 6px 0 6px 20px;
  border-left: 8px solid var(--green);
  margin-bottom: 28px;
}
.ep-doc h2 .ep-h-num {
  color: var(--pink);
  margin-right: 10px;
}
.ep-doc h3 {
  font-size: 22px;
  font-weight: 900;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-light);
}
.ep-doc p { font-size: 18px; line-height: 1.9; }
.ep-doc p + p { margin-top: 1em; }
.ep-doc strong { background: linear-gradient(transparent 60%, var(--pink-light) 60%); }
.ep-doc a { text-decoration: underline; }

.ep-list { margin: 16px 0; }
.ep-list li {
  position: relative;
  padding-left: 1.4em;
  font-size: 18px;
  line-height: 1.85;
}
.ep-list li + li { margin-top: 8px; }
.ep-list li::before {
  content: '';
  position: absolute;
  left: 2px; top: .75em;
  width: 9px; height: 9px;
  background: var(--green);
}
.ep-olist { margin: 16px 0; counter-reset: ep-ol; }
.ep-olist li {
  position: relative;
  padding-left: 48px;
  font-size: 18px;
  line-height: 1.85;
  counter-increment: ep-ol;
}
.ep-olist li + li { margin-top: 12px; }
.ep-olist li::before {
  content: counter(ep-ol);
  position: absolute;
  left: 0; top: 0;
  width: 34px; height: 34px;
  background: var(--green);
  color: var(--white);
  font-weight: 900;
  text-align: center;
  line-height: 34px;
  border-radius: 50%;
}
.ep-doc .ep-table { margin: 16px 0; }
.ep-doc .ep-table th, .ep-doc .ep-table td { font-size: 18px; line-height: 1.75; }
.ep-doc .ep-table thead th { background: var(--green); color: var(--white); border-color: var(--green); }
.ep-doc .ep-table tbody th { background: var(--bg-light); white-space: nowrap; }

.ep-box {
  margin: 24px 0;
  padding: 24px 28px;
  border: 3px solid var(--green);
  background: var(--white);
}
.ep-box--pink { border-color: var(--pink); background: var(--pink-light); }
.ep-box--light { border: none; background: var(--bg-light); }
.ep-box-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--green-dark);
}
.ep-box--pink .ep-box-title { color: var(--pink-dark); }

.ep-tree {
  margin: 16px 0;
  padding: 24px 28px;
  background: var(--ep-ink);
  color: #CFF3EA;
  font-family: SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 17px;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}

/* 目次 */
.ep-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  padding: 24px 32px;
  background: var(--bg-light);
  border-top: 4px solid var(--green);
  margin-bottom: 64px;
  counter-reset: ep-toc;
}
.ep-toc li { border-bottom: 1px dashed var(--border); counter-increment: ep-toc; }
.ep-toc a {
  display: block;
  padding: 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.ep-toc a::before { content: counter(ep-toc) '. '; color: var(--pink); font-weight: 900; }
.ep-toc a:hover { color: var(--green); }

/* チェックリスト */
.ep-checklist li {
  position: relative;
  padding: 18px 20px 18px 64px;
  border: 2px solid var(--green-light);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
  background: var(--white);
}
.ep-checklist li + li { margin-top: 10px; }
.ep-checklist li::before {
  content: '';
  position: absolute;
  left: 20px; top: 50%;
  width: 28px; height: 28px;
  margin-top: -14px;
  border: 3px solid var(--green);
  background: var(--white);
}

/* ページ下の行動ボタン */
.ep-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 64px;
  padding: 48px 20px;
  background: var(--pink-light);
}
.ep-page-actions .ep-btn-ghost { border-color: var(--green); color: var(--green-dark); }
.ep-page-actions .ep-btn-ghost:hover { background: var(--green); color: var(--white); }

/* ============================================================
   フォーム部品（シミュレーター・見積書・入稿フォーム共通）
   ============================================================ */
.ep-form { display: grid; gap: 28px; }
.ep-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.ep-fieldset + .ep-fieldset { margin-top: 24px; }
.ep-fieldset > legend {
  width: 100%;
  font-size: 24px;
  font-weight: 900;
  padding: 14px 20px;
  background: var(--green);
  color: var(--white);
  margin-bottom: 24px;
}
.ep-field { display: grid; gap: 8px; }
.ep-field + .ep-field { margin-top: 24px; }
.ep-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 18px;
  font-weight: 700;
}
.ep-req, .ep-opt {
  display: inline-block;
  padding: 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}
.ep-req { background: var(--pink); color: var(--white); }
.ep-opt { background: var(--bg-light); color: var(--text-mid); border: 1px solid var(--border); }
.ep-help { font-size: 16px; color: var(--text-mid); line-height: 1.7; }
.ep-help a { text-decoration: underline; }

.ep-input,
.ep-select,
.ep-textarea {
  width: 100%;
  font: inherit;
  font-size: 18px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.ep-input--short { max-width: 240px; }
.ep-textarea { min-height: 160px; line-height: 1.7; resize: vertical; }
.ep-input:focus, .ep-select:focus, .ep-textarea:focus {
  outline: 3px solid var(--green-light);
  border-color: var(--green);
}
.ep-input[aria-invalid="true"], .ep-textarea[aria-invalid="true"] { border-color: var(--pink); background: var(--pink-light); }
.ep-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 18px; }

.ep-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.ep-choice { position: relative; }
.ep-choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.ep-choice span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--white);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}
.ep-choice span::before {
  content: '';
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 2px solid var(--text-light);
  background: var(--white);
}
.ep-choice input[type="radio"] + span::before { border-radius: 50%; }
.ep-choice input:checked + span { border-color: var(--green); background: var(--green-light); color: var(--green-dark); }
.ep-choice input:checked + span::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 3px var(--white); }
.ep-choice input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }

.ep-checks { display: grid; gap: 10px; }
.ep-check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  background: var(--white);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
  cursor: pointer;
}
.ep-check input { flex-shrink: 0; width: 24px; height: 24px; margin-top: 4px; accent-color: var(--green); }
.ep-check:has(input:checked) { border-color: var(--green); background: var(--green-light); }

.ep-cond[hidden] { display: none; }
.ep-cond { margin-top: 12px; }
.ep-notice {
  padding: 16px 20px;
  background: var(--pink-light);
  border-left: 6px solid var(--pink);
  font-size: 18px;
  line-height: 1.8;
}
.ep-notice--green { background: var(--green-light); border-left-color: var(--green); }

.ep-errors {
  padding: 20px 24px;
  border: 3px solid var(--pink);
  background: var(--pink-light);
  margin-bottom: 32px;
}
.ep-errors-title { font-size: 20px; font-weight: 900; color: var(--pink-dark); margin-bottom: 8px; }
.ep-errors li { font-size: 18px; line-height: 1.8; }
.ep-errors a { color: var(--pink-dark); text-decoration: underline; }
.ep-field-error { font-size: 16px; font-weight: 700; color: var(--pink-dark); }

.ep-submit-area { margin-top: 40px; text-align: center; }
.ep-submit-area .ep-btn { min-width: 320px; border: none; cursor: pointer; font-family: inherit; }
.ep-submit-area .ep-help { margin-top: 16px; }
.ep-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============================================================
   削減シミュレーター
   ============================================================ */
.ep-sim-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 20px 28px;
  background: var(--pink-light);
  border-left: 8px solid var(--pink);
  margin-bottom: 40px;
}
.ep-sim-price-name { font-size: 20px; font-weight: 900; }
.ep-sim-price-yen { font-size: 40px; font-weight: 900; color: var(--pink); line-height: 1.1; }
.ep-sim-price-tax { font-size: 16px; font-weight: 700; color: var(--text-mid); }
.ep-sim-price ul { display: flex; flex-wrap: wrap; gap: 4px 20px; width: 100%; }
.ep-sim-price li { font-size: 17px; font-weight: 700; }
.ep-sim-price li::before { content: '✓ '; color: var(--green); font-weight: 900; }

.ep-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.ep-panel {
  border: 3px solid var(--green-light);
  background: var(--white);
  padding: 32px;
  min-width: 0;
}
.ep-panel-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 24px;
}
.ep-num {
  width: 10em;
  max-width: 100%;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ep-unit { font-size: 18px; font-weight: 700; color: var(--text-mid); }
.ep-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ep-chips button {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}
.ep-chips button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
.ep-sep { border: none; border-top: 2px dashed var(--border); margin: 28px 0; }

.ep-result { background: var(--ep-cream); border-color: var(--pink); position: sticky; top: 92px; }
.ep-result-label { font-size: 18px; font-weight: 900; color: var(--text-mid); }
.ep-result-value {
  font-size: clamp(56px, 7vw, 88px);
  font-weight: 900;
  color: var(--pink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ep-result-value small { font-size: .38em; margin-left: 4px; }
.ep-result-formula { font-size: 16px; color: var(--text-mid); margin-top: 6px; overflow-wrap: anywhere; }
.ep-bars { display: grid; gap: 12px; margin: 28px 0; }
.ep-bar { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 6.5em; gap: 10px; align-items: center; font-size: 16px; font-weight: 700; }
.ep-bar-track { height: 20px; background: var(--bg-light); }
.ep-bar-fill { display: block; height: 100%; }
.ep-bar-fill.is-now { background: var(--text-light); }
.ep-bar-fill.is-ex { background: var(--pink); }
.ep-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.ep-rows { border-top: 2px solid var(--text); margin-bottom: 28px; }
.ep-rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
}
.ep-rows strong { font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ep-result .ep-notice { margin-bottom: 24px; }
.ep-result .ep-btn { width: 100%; min-width: 0; }

/* ============================================================
   見積書作成ツール
   ============================================================ */
.ep-tool--estimate { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
.ep-tool--estimate .ep-panel { padding: 28px; }
.ep-tool-actions { display: grid; gap: 14px; margin-top: 32px; }
.ep-tool-actions .ep-btn { width: 100%; min-width: 0; border: none; cursor: pointer; font-family: inherit; }
.ep-tool-actions .ep-btn-ghost { border: 2px solid var(--green); color: var(--green-dark); }
.ep-tool-actions .ep-btn-ghost:hover { background: var(--green); color: var(--white); }
.ep-err { font-size: 16px; font-weight: 700; color: var(--pink-dark); margin-top: 16px; }

.ep-sheet-box { min-width: 0; overflow-x: auto; background: var(--bg-light); padding: 24px; }
/* 見積書の紙：A4縦（210mm × 297mm）。印刷のため白地・黒字で固定 */
.ep-estimate-page .ep-doc-wrap > .container { max-width: 1300px; }
.ep-sheet {
  width: 100%;
  max-width: 210mm;
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  padding: 16mm 15mm;
  background: #fff;
  color: #1b1b1b;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
.ep-sheet h2 { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 700; padding-left: .4em; }
.ep-sheet .s-kind { text-align: center; font-size: 13px; margin-bottom: 14px; }
.ep-sheet .s-meta { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.ep-sheet .s-meta dl { display: grid; grid-template-columns: auto auto; gap: 0 14px; font-size: 12px; }
.ep-sheet .s-meta dt { color: #555; }
.ep-sheet .s-parties { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 18px; }
.ep-sheet .s-to-name { font-size: 18px; font-weight: 700; border-bottom: 1px solid #1b1b1b; padding-bottom: 4px; overflow-wrap: anywhere; }
.ep-sheet .s-to-person { margin-top: 4px; overflow-wrap: anywhere; }
.ep-sheet .s-greet { margin-top: 10px; }
.ep-sheet .s-from { font-size: 12px; justify-self: end; }
.ep-sheet .s-from .s-co { font-weight: 700; font-size: 14px; }
.ep-sheet .s-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 16px; border-bottom: 2px solid #1b1b1b; padding-bottom: 6px; margin-bottom: 16px; }
.ep-sheet .s-total .t { font-weight: 700; }
.ep-sheet .s-total .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ep-sheet .s-info { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 4px 12px; margin-bottom: 16px; }
.ep-sheet .s-info dt { color: #555; }
.ep-sheet .s-info dd { overflow-wrap: anywhere; }
.ep-sheet table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.ep-sheet th, .ep-sheet td { border: 1px solid #c9ccd2; padding: 6px 8px; vertical-align: top; font-size: 13px; }
.ep-sheet th { background: #eef1f6; font-weight: 700; font-size: 12px; }
.ep-sheet td.n { text-align: right; white-space: nowrap; }
.ep-sheet td.c { text-align: center; white-space: nowrap; }
.ep-sheet .s-desc { font-size: 11px; color: #555; margin-top: 2px; }
.ep-sheet tfoot td { font-weight: 700; }
.ep-sheet tfoot .lab { text-align: right; }
.ep-sheet .s-notes { font-size: 11px; line-height: 1.6; }
.ep-sheet .s-notes h3 { font-size: 12px; margin-bottom: 4px; }
.ep-sheet .s-notes ul { padding-left: 1.3em; list-style: disc; }
.ep-sheet .s-notes li + li { margin-top: 2px; }

/* ============================================================
   受付完了
   ============================================================ */
.ep-done {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px;
  border: 4px solid var(--green);
  text-align: center;
}
.ep-done-title { font-size: clamp(30px, 4vw, 44px); font-weight: 900; color: var(--green-dark); margin-bottom: 24px; }
.ep-done p { font-size: 19px; line-height: 2; }
.ep-done strong { color: var(--pink); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .ep-tool, .ep-tool--estimate { grid-template-columns: minmax(0, 1fr); }
  .ep-result { position: static; }
  .ep-toc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ep-page-hero { padding: 40px 16px 48px; }
  .ep-page-title { font-size: 30px; }
  .ep-page-lead { font-size: 18px; }
  .ep-doc-wrap { padding: 48px 0 64px; }
  .ep-doc > section + section { margin-top: 56px; }
  .ep-doc h2 { font-size: 24px; padding-left: 14px; border-left-width: 6px; }
  .ep-doc h3 { font-size: 20px; }
  .ep-box { padding: 20px 18px; }
  .ep-tree { font-size: 16px; padding: 18px; }
  .ep-toc { padding: 16px 20px; }
  .ep-panel { padding: 22px 18px; }
  .ep-fieldset > legend { font-size: 21px; padding: 12px 16px; }
  .ep-choice { flex: 1 1 100%; }
  .ep-choice span { width: 100%; }
  .ep-submit-area .ep-btn { min-width: 0; width: 100%; }
  .ep-sim-price { padding: 18px; }
  .ep-sim-price-yen { font-size: 34px; }
  .ep-bar { grid-template-columns: 6.5em minmax(0, 1fr) 6em; font-size: 16px; }
  .ep-sheet-box { padding: 0; background: none; }
  .ep-done { padding: 32px 20px; }
  .ep-done p { font-size: 18px; }

  /* 表：スマホでは行ごとに積む */
  .ep-doc .ep-table--stack thead { display: none; }
  .ep-doc .ep-table--stack, .ep-doc .ep-table--stack tbody, .ep-doc .ep-table--stack tr,
  .ep-doc .ep-table--stack th, .ep-doc .ep-table--stack td { display: block; width: 100%; }
  .ep-doc .ep-table--stack { border: none; background: transparent; }
  .ep-doc .ep-table--stack tr { margin-bottom: 14px; border: 2px solid var(--border); background: var(--white); }
  .ep-doc .ep-table--stack th, .ep-doc .ep-table--stack td { border: none; padding: 12px 16px; }
  .ep-doc .ep-table--stack th { white-space: normal; }
  .ep-doc .ep-table--stack td + td { border-top: 1px dashed var(--border); }
  .ep-doc .ep-table--stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 16px;
    font-weight: 900;
    color: var(--green-dark);
  }
}

/* ============================================================
   印刷
   ============================================================ */
@media print {
  .site-header, .site-footer, .ep-campaign, .ep-page-actions, .ep-bottom, .no-print { display: none !important; }
  .ep { padding-top: 0; }
  body { background: #fff; }
  .ep-page-hero { background: none; color: #000; padding: 0 0 8mm; }
  .ep-page-kicker { border: 1px solid #000; }
  .ep-crumb { display: none; }
  .ep-doc-wrap { padding: 0; }
  .ep-doc section { break-inside: auto; }
  .ep-doc h2, .ep-doc h3 { break-after: avoid; }
  .ep-table tr, .ep-checklist li, .ep-box { break-inside: avoid; }
  .ep-tree { background: #fff; color: #000; border: 1px solid #000; }
}

/* 見積書のページは、見積書（A4縦1枚）だけを印刷する */
@media print {
  .ep-estimate-page .ep-page-hero,
  .ep-estimate-page .ep-tool > .ep-panel { display: none !important; }
  .ep-estimate-page .ep-doc-wrap,
  .ep-estimate-page .container { padding: 0; margin: 0; max-width: none; }
  .ep-estimate-page .ep-tool { display: block; }
  .ep-estimate-page .ep-sheet-box { padding: 0; background: none; overflow: visible; }
  .ep-estimate-page .ep-sheet {
    width: auto;
    max-width: none;
    aspect-ratio: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    break-inside: avoid;
  }
}
@page { size: A4 portrait; margin: 12mm; }

/* シミュレーターの工程の帯・注記 */
.ep-sim-band { margin-top: 64px; }
.ep-sim-notes { margin-top: 56px; }
.ep-sim-notes h2 { font-size: 24px; margin-bottom: 16px; }
.ep-sim-notes a { text-decoration: underline; }
.ep-notice a { text-decoration: underline; }
.ep-page-lead a { color: var(--white); text-decoration: underline; }
.ep-page-lead a:hover { color: var(--green-light); }
.ep-errors:focus { outline: none; }
#data .ep-table thead th:first-child { width: 9em; }
#data .ep-table thead th:nth-child(2) { width: 11em; }
