/* ============================================================
   XenoX 見積ページ専用スタイル（/estimate）
   - 共通の土台 xm.css の後に読み込む。これまでの estimate.css の代わり
   - 見積（#_estimate の中）は本番のHTMLのまま。クラス名（_plugin-item など）に見た目だけを当てる
   ============================================================ */

/* このファイルで使う色（モックの値そのまま） */
.xm {
  --ink-30: rgba(21, 23, 28, .3);
  --ink-25: rgba(21, 23, 28, .25);
  --white: #fff;
  --text-2: #3a3d45;
  --text-5: #5d616b;
  --muted: #6d717a;
  --placeholder: #9a9ea8;
  --rule-3: #c9c8c0;
  --rule-2: #d6d5ce;
  --red-bg: #fde8e6;
  --red-text-2: #b3261e;
}


.xm-es { padding: 56px 0 72px; }
@media (max-width: 960px) { .xm-es { padding: 36px 0 48px; } }

/* ---------- 見出し ---------- */
.xm-es #_estimate ._hero { text-align: center; margin-bottom: 36px; }
.xm-es #_estimate ._badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; letter-spacing: .12em;
  padding: 4px 12px; border: var(--bd); border-radius: 999px; background: var(--white);
}
.xm-es #_estimate ._badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); }
.xm-es #_estimate ._hero h1 { margin: 16px 0 10px; font-size: clamp(32px, 4.4vw, 52px); font-weight: 900; line-height: 1.25; }
.xm-es #_estimate ._lead { margin: 0 auto; max-width: 40em; font-size: clamp(15px, 1.6vw, 17px); color: var(--text-2); word-break: auto-phrase; }

/* ---------- 2列（左：選ぶ／右：見積の内容） ---------- */
.xm-es #_estimate ._estimate-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 32px; align-items: start; }
@media (max-width: 960px) { .xm-es #_estimate ._estimate-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.xm-es #_estimate ._input-panel { display: grid; gap: 24px; min-width: 0; }

/* 入力の箱 */
.xm-es #_estimate ._section { background: var(--white); border: var(--bd); border-radius: 18px; box-shadow: var(--sh); padding: 22px 22px 24px; }
@media (max-width: 560px) { .xm-es #_estimate ._section { padding: 18px 14px 20px; } }
.xm-es #_estimate ._section h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; font-size: 19px; font-weight: 900; line-height: 1.4; }
.xm-es #_estimate ._step { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); font-family: var(--en); font-size: 15px; font-weight: 700; }
.xm-es #_estimate ._multi { font-size: 11.5px; font-weight: 700; padding: 1px 10px; border: 1.5px solid var(--rule-3); border-radius: 999px; background: var(--paper); }

/* ---------- 選ぶ（プラン・プラグイン） ---------- */
.xm-es #_estimate ._plugin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.xm-es #_estimate ._plugin-item {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; background: var(--white); border: 2px solid var(--ink); border-radius: 12px;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.xm-es #_estimate ._plugin-item:hover { transform: translate(-1px, -1px); box-shadow: var(--sh-sm); }
.xm-es #_estimate ._plugin-item input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* チェックの印（左の四角） */
.xm-es #_estimate ._plugin-item::before { content: ""; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 6px; background: var(--white); grid-column: 1; grid-row: 1; }
.xm-es #_estimate ._plugin-item._selected { background: var(--yellow-2); box-shadow: var(--sh-sm); }
.xm-es #_estimate ._plugin-item._selected::before { background: var(--yellow); }
.xm-es #_estimate ._plugin-item._selected::after { content: ""; position: absolute; left: 19px; top: 50%; width: 6px; height: 11px; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateY(-65%) rotate(45deg); }
.xm-es #_estimate ._plugin-item:has(input:focus-visible) { outline: 3px solid var(--navy); outline-offset: 2px; }
/* アイコンがある行は、チェック → アイコン → 名前 → 金額 */
.xm-es #_estimate ._plugin-item:has(._plugin-icon) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.xm-es #_estimate ._plugin-icon { width: 30px; height: 30px; }
.xm-es #_estimate ._plugin-name { min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.45; word-break: auto-phrase; }
.xm-es #_estimate ._plugin-price { font-family: var(--en); font-size: 14px; font-weight: 700; white-space: nowrap; }
.xm-es #_estimate ._plugin-price small { font-family: "Noto Sans JP", sans-serif; font-size: 11px; font-weight: 700; margin-left: 1px; }
/* プランは紺で目立たせる */
.xm-es #_estimate ._plan-item { background: var(--navy-2); color: var(--white); border-color: var(--ink); }
.xm-es #_estimate ._plan-item::before { border-color: var(--white); background: transparent; }
.xm-es #_estimate ._plan-item._selected { background: var(--navy); }
.xm-es #_estimate ._plan-item._selected::before { background: var(--yellow); border-color: var(--yellow); }
.xm-es #_estimate ._plan-item ._plugin-name { font-size: 15px; font-weight: 900; }
.xm-es #_estimate ._plan-item ._plugin-price { color: var(--yellow); font-size: 16px; }
/* スマホ：35行の縦並びにせず、2列の小さなカード（チェックとアイコン → 名前 → 金額）にする */
@media (max-width: 560px) {
  .xm-es #_estimate ._plugin-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .xm-es #_estimate ._plugin-item,
  .xm-es #_estimate ._plugin-item:has(._plugin-icon) { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 6px 8px; padding: 10px; }
  .xm-es #_estimate ._plugin-item ._plugin-name { flex: 1 1 100%; font-size: 13px; }
  .xm-es #_estimate ._plugin-item ._plugin-price { flex: 1 1 100%; font-size: 13px; }
  .xm-es #_estimate ._plugin-item._selected::after { left: 17px; top: 21px; transform: translateY(-65%) rotate(45deg); }
  .xm-es #_estimate ._plugin-icon { width: 26px; height: 26px; }
}
.xm-es #_estimate ._group-divider { margin: 16px 0; border-top: 2px dashed var(--ink-25); }

/* ---------- 宛名と送付先 ---------- */
.xm-es #_estimate ._field { display: grid; gap: 6px; }
.xm-es #_estimate ._field + ._field { margin-top: 16px; }
.xm-es #_estimate ._field label { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 14.5px; }
.xm-es #_estimate ._field label::after { content: "必須"; font-size: 11px; font-weight: 700; color: var(--white); background: var(--red); border-radius: 6px; padding: 0 7px; line-height: 1.7; }
.xm-es #_estimate ._field input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
  border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; transition: box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.xm-es #_estimate ._field input::placeholder { color: var(--placeholder); }
.xm-es #_estimate ._field input:focus { outline: 0; background: var(--yellow-2); box-shadow: var(--sh-sm); }
.xm-es #_estimate ._field-note { margin: 0; font-size: 12.5px; color: var(--text-5); }

/* ---------- 見積の内容（右。PCではスクロールに付いてくる） ---------- */
.xm-es #_estimate ._summary-panel { position: sticky; top: 84px; background: var(--white); border: var(--bd); border-radius: 18px; box-shadow: var(--sh); padding: 0 0 20px; overflow: hidden; }
@media (max-width: 960px) { .xm-es #_estimate ._summary-panel { position: static; } }
.xm-es #_estimate ._summary-panel > h2 { margin: 0 0 16px; padding: 12px 20px; background: var(--ink); color: var(--white); font-size: 15px; font-weight: 900; }
.xm-es #_estimate ._summary-panel > h2::before { content: "● ● ●  "; letter-spacing: -.1em; font-size: 10px; vertical-align: 2px; color: var(--yellow); }
.xm-es #_estimate ._summary-panel > :not(h2) { margin-left: 20px; margin-right: 20px; }
.xm-es #_estimate ._empty { margin-top: 0; margin-bottom: 18px; padding: 22px 12px; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); border: 2px dashed var(--ink-25); border-radius: 12px; }
.xm-es #_estimate ._summary-table { width: calc(100% - 40px); border-collapse: collapse; font-size: 14px; }
.xm-es #_estimate ._summary-table th { padding: 6px 0; font-size: 12px; color: var(--muted); text-align: left; border-bottom: 2px solid var(--ink); }
.xm-es #_estimate ._summary-table th:last-child, .xm-es #_estimate ._summary-table ._num { text-align: right; }
.xm-es #_estimate ._summary-table td { padding: 9px 0; border-bottom: 1px dashed var(--rule-2); vertical-align: top; font-weight: 700; line-height: 1.5; }
.xm-es #_estimate ._summary-table td small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.xm-es #_estimate ._summary-table ._num { font-family: var(--en); white-space: nowrap; padding-left: 10px; }
.xm-es #_estimate ._totals { margin-top: 12px; display: grid; gap: 4px; }
.xm-es #_estimate ._total-row { display: flex; justify-content: space-between; font-size: 14px; }
.xm-es #_estimate ._total-row span:last-child { font-family: var(--en); font-weight: 700; }
.xm-es #_estimate ._total-row._grand { margin-top: 6px; padding: 10px 14px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; font-weight: 900; font-size: 15px; align-items: baseline; }
.xm-es #_estimate ._total-row._grand span:last-child { font-size: 22px; }
.xm-es #_estimate ._warn { margin-top: 12px; padding: 10px 12px; background: var(--yellow-2); border: 2px solid var(--ink); border-radius: 12px; font-size: 13px; font-weight: 700; }
.xm-es #_estimate ._warn::before { content: "💡 "; }
.xm-es #_estimate ._error { margin-top: 12px; padding: 10px 12px; background: var(--red-bg); border: 2px solid var(--red); border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--red-text-2); }
.xm-es #_estimate ._error::before { content: "！ "; }

/* 送るボタン（共通の .xm-btn と同じ見た目） */
.xm-es #_estimate ._download-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: calc(100% - 40px); min-height: 56px; margin-top: 16px; padding: 0 18px; cursor: pointer;
  font: inherit; font-weight: 900; font-size: 16px; color: var(--ink);
  background: var(--yellow); border: var(--bd); border-radius: 999px; box-shadow: var(--sh);
  transition: transform .15s, box-shadow .15s;
}
.xm-es #_estimate ._download-btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.xm-es #_estimate ._download-btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }
.xm-es #_estimate ._notes { list-style: none; margin-top: 14px; margin-bottom: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; color: var(--text-5); line-height: 1.7; }

/* 送信完了 */
.xm-es #_estimate #_send { text-align: center; padding: 28px 4px 6px; }
.xm-es #_estimate ._send-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: var(--yellow); border: var(--bd); box-shadow: var(--sh-sm); animation: xm-es-pop .5s cubic-bezier(.2, .8, .2, 1.3) both; }
.xm-es #_estimate ._send-title { font-size: 22px; font-weight: 900; }
.xm-es #_estimate ._send-sub { margin-top: 8px; font-size: 14px; color: var(--text-2); line-height: 1.9; overflow-wrap: anywhere; }
@keyframes xm-es-pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- 見積の次の一歩 ---------- */
.xm-es-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 800px) { .xm-es-next { grid-template-columns: minmax(0, 1fr); } }
.xm-es-next a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); background: var(--white); border: var(--bd); border-radius: 20px; box-shadow: var(--sh); padding: 22px 24px; transition: transform .15s, box-shadow .15s; }
.xm-es-next a:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.xm-es-next a:first-child { background: var(--yellow); }
.xm-es-next .xm-es-next__q { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-2); }
.xm-es-next b { font-size: clamp(19px, 2vw, 23px); line-height: 1.45; }
.xm-es-next p:not(.xm-es-next__q) { margin: 0; font-size: 14px; color: var(--text-2); }
.xm-es-next a > span { margin-top: auto; padding-top: 10px; border-top: 2px dashed var(--ink-30); font-weight: 900; display: flex; justify-content: space-between; align-items: center; }
.xm-es-next .xm-arw { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font-size: 12px; }
