/* ── 申込フォーム・見積ページ共通のスタイル（§287: §285 の見積ページの CSS から切り出し。モックアップ Estimate.dc.html のトークンと部品） ──
   ページ固有の配置は quote-form.css / apply-form.css に置く */
:root {
  --bg: #f4f5f4;
  --text: #1d2420;  --text-2: #3d4642;  --text-3: #5b6560;  --text-4: #8a938e;  --text-5: #9aa39e;
  --accent: #1f5c45;  --accent-dark: #163f30;
  --sel-bg: #eef5f1;  --sel-line: #9cc2ae;  --sel-line-2: #b9d6c7;  --sel-line-3: #cfe2d8;
  --card-line: #dfe3e0;  --rule: #eceeed;  --input-line: #c9cfcb;  --item-line: #e3e6e4;  --band: #f7f8f7;
  --err: #b42318;  --err-2: #9b1c13;  --err-bg: #fdf2f1;  --err-line: #f0c9c4;
  --shadow: 0 1px 2px rgba(20, 30, 25, .04);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* display:flex などの指定より hidden 属性を優先する */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Noto Sans JP", system-ui, sans-serif; font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #7fb39b; outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes qspin { to { transform: rotate(360deg); } }

.q-page { max-width: 1160px; margin: 0 auto; padding: 32px 32px 48px; min-height: 100vh; }

/* ヘッダー */
.q-header { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 28px; }
.q-header-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--text-3); }
.q-header h1 { margin: 0; font-size: 32px; line-height: 1.35; font-weight: 700; letter-spacing: .02em; }
.q-lead { margin: 0; color: var(--text-2); }
.q-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 6px; align-items: center; }
.q-steps li { display: flex; align-items: center; gap: 6px; }
.q-step { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--card-line);
  background: transparent; font-size: 15px; font-weight: 500; color: var(--text-3); }
.q-step .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--item-line); color: var(--text-3); }
.q-step.done { background: var(--sel-bg); border-color: var(--sel-line-3); color: var(--accent-dark); }
.q-step.current { background: #fff; border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.q-step.done .dot, .q-step.current .dot { background: var(--accent); color: #fff; }
.q-step-arrow { color: var(--text-5); font-size: 14px; }

/* レイアウト */
.q-card { background: #fff; border: 1px solid var(--card-line); border-radius: 10px; box-shadow: var(--shadow); }
.q-section-card { padding: 24px 28px; display: flex; flex-direction: column; gap: 22px; min-width: 0; scroll-margin-top: 16px; }
.q-download.q-section-card { gap: 16px; }
.q-h2 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.q-h2 .no { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; display: grid; place-items: center; flex: none; }
.q-sub { margin: 0; color: var(--text-3); font-size: 15px; }
.q-section-head { display: flex; flex-direction: column; gap: 4px; }

/* 検体カード */
.q-sample { overflow: hidden; scroll-margin-top: 16px; }
.q-sample-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.q-sample-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.q-remove { font: inherit; font-size: 14px; color: var(--text-3); background: none; border: 1px solid var(--card-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; min-height: 44px; }
.q-remove:hover { color: var(--err); border-color: #e7b7b2; }
.q-sample-body { padding: 18px 20px 6px; display: flex; flex-direction: column; gap: 22px; }
.q-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-legend { padding: 0; margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.q-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.q-type { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 6px 8px;
  border-radius: 8px; border: 1px solid #d5dad7; background: #fff; color: var(--text-2); font-size: 15px; text-align: center; cursor: pointer; }
.q-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.q-type .mark { font-size: 14px; width: 0; overflow: hidden; }
.q-type.on { background: var(--sel-bg); border-color: var(--accent); color: var(--accent-dark); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent); }
.q-type.on .mark { width: 14px; }
.q-type:focus-within { outline: 3px solid #7fb39b; outline-offset: 2px; }
.q-group-legend { width: 100%; padding: 0 0 8px; margin: 0 0 10px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.q-group-legend .label { font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.q-group-legend .count { font-size: 13px; color: var(--text-3); }
.q-items { display: flex; flex-direction: column; gap: 6px; }
.q-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: start; padding: 11px 14px;
  border-radius: 8px; border: 1px solid var(--item-line); background: #fff; cursor: pointer; min-height: 44px; }
.q-item:hover { border-color: var(--sel-line); }
.q-item input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.q-item.on { background: var(--sel-bg); border-color: var(--accent); }
.q-item.on .q-item-name { font-weight: 700; }
.q-item.off { opacity: .5; background: var(--band); cursor: not-allowed; }
.q-item.off input { cursor: not-allowed; }
.q-item.off:hover { border-color: var(--item-line); }
.q-item-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-item-name { overflow-wrap: anywhere; }
.q-item-sub { font-size: 14px; color: var(--text-3); overflow-wrap: anywhere; }
.q-item-note { font-size: 13px; color: var(--text-3); }
.q-includes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.q-chip { padding: 1px 8px; border: 1px solid #cfd8d3; border-radius: 4px; background: #fff; }
.q-price { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; padding-top: 1px; }
.q-info { padding: 12px 14px; border-radius: 8px; background: var(--sel-bg); border: 1px solid var(--sel-line-2); font-size: 15px; color: var(--accent-dark); }
.q-info p { margin: 0; }
.q-info .q-check { margin-top: 10px; }
.q-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--text); }
.q-check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.q-alert { margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--err-bg); color: var(--err-2); font-size: 15px; }
.q-alert ul { margin: 0; padding-left: 1.2em; }
.q-band { margin-top: 14px; padding: 16px 20px; background: var(--band); border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 20px; }
.q-qty-label { font-size: 15px; font-weight: 700; }
.q-stepper-row { display: flex; align-items: center; gap: 8px; }
.q-stepper { display: flex; align-items: stretch; border: 1px solid var(--input-line); border-radius: 8px; background: #fff; overflow: hidden; }
.q-stepper button { font: inherit; font-size: 20px; width: 44px; height: 44px; border: 0; background: none; color: var(--accent); cursor: pointer; }
.q-stepper button:disabled { opacity: .35; cursor: default; }
.q-stepper input { font: inherit; width: 56px; height: 44px; text-align: center; border: 0; border-left: 1px solid var(--item-line); border-right: 1px solid var(--item-line); font-variant-numeric: tabular-nums; }
.q-hint { font-size: 14px; color: var(--text-3); }
.q-card-total { text-align: right; margin-left: auto; }
.q-card-total .calc { font-size: 14px; color: var(--text-3); }
.q-card-total .line { font-size: 15px; }
.q-card-total strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.q-card-total .tax { font-size: 13px; color: var(--text-3); }
.q-add { font: inherit; font-weight: 700; color: var(--accent); background: #fff; border: 1.5px dashed #8db8a3; border-radius: 10px; min-height: 56px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.q-add:hover:not(:disabled) { background: var(--sel-bg); border-color: var(--accent); }
.q-add:disabled { opacity: .5; cursor: default; }

/* お見積り金額 */
.q-summary-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.q-summary-card h2 { margin: 0; font-size: 18px; font-weight: 700; }
.q-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.q-row { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.q-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.q-row-head .t { font-weight: 700; }
.q-row-head .ty { font-weight: 400; color: var(--text-3); font-size: 14px; }
.q-row .empty { font-size: 14px; color: var(--text-4); }
.q-row ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--text-2); }
.q-row li { display: flex; gap: 6px; }
.q-row li::before { content: "・"; color: var(--text-5); }
.q-row .qty { font-size: 14px; color: var(--text-3); }
.q-sums { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-variant-numeric: tabular-nums; }
.q-sums dt { color: var(--text-2); }
.q-sums dd { margin: 0; text-align: right; }
.q-total-band { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; margin: 0 -4px; background: var(--sel-bg); border-radius: 8px; }
.q-total-band .label { font-weight: 700; }
.q-total-band .v { font-size: 30px; line-height: 1.2; font-weight: 700; color: var(--accent-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-note { margin: 0; font-size: 13px; color: var(--text-3); line-height: 1.6; }
.q-outline-btn { font: inherit; font-weight: 700; min-height: 48px; border-radius: 8px; border: 1px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; }
.q-outline-btn:hover { background: var(--sel-bg); }

/* お客様情報 */
.q-field { display: flex; flex-direction: column; gap: 8px; }
.q-label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.q-badge { font-size: 13px; font-weight: 500; padding: 1px 8px; border-radius: 4px; background: var(--rule); color: var(--text-2); }
.q-badge.req { background: var(--accent); color: #fff; }
.q-input { font: inherit; height: 48px; padding: 0 14px; border: 1px solid var(--input-line); border-radius: 8px; background: #fff; width: 100%; }
.q-input:focus { border-color: var(--accent); }
.q-input.invalid { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.q-name-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.q-name-grid .q-field { gap: 6px; }
.q-name-grid label { font-size: 14px; color: var(--text-2); }
.q-err { font-size: 14px; color: var(--err); }
.q-consent { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 8px; background: var(--band); border: 1px solid var(--item-line); }
.q-consent.invalid { border-color: var(--err); }
.q-consent label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.q-consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.q-consent .t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; }
.q-consent .desc, .q-consent .q-err { margin: 0 0 0 34px; font-size: 14px; }
.q-consent .desc { color: var(--text-2); }

/* ダウンロード */
.q-dl-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 4px; }
.q-dl-sum .c { color: var(--text-2); }
.q-dl-sum .v { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.q-dl-sum .v small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.q-reasons { padding: 14px 16px; border-radius: 8px; background: var(--band); border: 1px solid var(--item-line); color: var(--text-2); }
.q-reasons.submitted { background: var(--err-bg); border-color: var(--err-line); color: var(--err-2); }
.q-reasons p { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.q-reasons ul { margin: 0; padding: 0 0 0 1.2em; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.q-reasons a { color: inherit; }
.q-result { padding: 14px 16px; border-radius: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.q-result.ok { background: var(--sel-bg); border: 1px solid var(--sel-line-2); color: var(--accent-dark); }
.q-result.ng { background: var(--err-bg); border: 1px solid var(--err-line); color: #7a1a12; }
.q-result .actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; align-items: center; }
.q-apply-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.q-apply-btn:hover { background: var(--accent-dark); color: #fff; }
.q-link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.q-dl-btn { font: inherit; font-size: 17px; font-weight: 700; min-height: 60px; width: 100%; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; }
.q-dl-btn:hover { background: var(--accent-dark); }
.q-dl-btn[aria-busy="true"] { background: #4f7f6a; cursor: progress; }
.q-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: qspin .8s linear infinite; display: inline-block; }
.q-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* フッター */
.q-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--card-line); font-size: 14px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* スマホの下部固定バー */
.q-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: #fff; border-top: 1px solid var(--card-line); box-shadow: 0 -4px 16px rgba(20, 30, 25, .06);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-bar[hidden] { display: none; }
.q-bar .l { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.q-bar .c { font-size: 13px; color: var(--text-3); }
.q-bar .v { font-size: 22px; font-weight: 700; color: var(--accent-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-bar button { font: inherit; font-weight: 700; min-height: 48px; padding: 0 18px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; }

@media (max-width: 899.98px) {
  .q-page { padding: 16px 16px 120px; }
  .q-header h1 { font-size: 26px; }
  .q-section-card { padding: 20px; }
  .q-summary-cta { display: none; }
}
@media (min-width: 900px) {
  .q-bar { display: none !important; }
}
