/* エースプランニング 見積もりシミュレーター 0.2.0
 * 仮配色（プロトタイプの青／白）。色は変数で差し替える。このファイルの装飾は .ap-sim 配下と問い合わせページの引き継ぎパネルに限定する。 */
.ap-sim {
  --sim-ink: #22384a;        /* 本文 */
  --sim-blue: #174e81;       /* 主色・見出し */
  --sim-action: #236ad4;     /* 操作・選択中 */
  --sim-sky: #eaf3fb;        /* 住宅図の背景 */
  --sim-yellow: #f4cc52;     /* 選択部位・目印 */
  --sim-line: #cfdae4;       /* 境界線 */
  --sim-muted: #5b6b78;
  --sim-error: #a52b30;
  color: var(--sim-ink);
  font-size: 16px;
  line-height: 1.8;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}
.ap-sim *, .ap-sim-handoff-panel * { box-sizing: border-box; }
.ap-sim p, .ap-sim h2, .ap-sim h3, .ap-sim dl, .ap-sim dd, .ap-sim ul { margin: 0; }
.ap-sim button, .ap-sim input, .ap-sim select, .ap-sim textarea { font: inherit; color: inherit; }
.ap-sim button { cursor: pointer; }
.ap-sim button:focus-visible, .ap-sim a:focus-visible, .ap-sim input:focus-visible, .ap-sim select:focus-visible, .ap-sim textarea:focus-visible { outline: 3px solid var(--sim-action); outline-offset: 4px; }
.ap-sim-noscript { padding: 16px; border: 1px solid var(--sim-line); }

/* 2領域：図（左・空色）／質問（右・白） */
.sim-shell { display: grid; grid-template-columns: 44% 56%; min-height: 640px; border: 1px solid var(--sim-line); border-radius: 8px; overflow: hidden; background: linear-gradient(90deg, var(--sim-sky) 0, var(--sim-sky) 44%, #fff 44%); align-items: start; }
.sim-scene { background: var(--sim-sky); padding: 36px 7% 26px; display: flex; flex-direction: column; min-width: 0; position: sticky; top: 16px; }
.sim-tag { font-size: 13px; display: flex; align-items: center; gap: 9px; color: var(--sim-blue); font-weight: 700; }
.sim-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sim-blue); }
.sim-title { font-size: clamp(26px, 2.6vw, 40px); font-weight: 700; line-height: 1.45; letter-spacing: .015em; color: var(--sim-blue); margin: 10px 0 10px; text-wrap: balance; }
.sim-intro { font-size: 15px; line-height: 1.9; max-width: 360px; }
.sim-figure { margin: 14px -20px 0; min-height: 240px; display: flex; align-items: center; }
.sim-figure svg { width: 100%; height: auto; max-height: 380px; display: block; }
.sim-figure.is-map svg { max-height: 300px; }
.sim-caption { font-size: 13px; line-height: 1.7; color: var(--sim-blue); min-height: 23px; margin-top: 6px; }
.sim-area-list { font-size: 13px; color: var(--sim-ink); margin-top: 6px; }
.sim-part { cursor: pointer; }
.sim-part .sim-fill { transition: fill .28s ease, stroke .28s ease; }
.sim-part.is-on .sim-fill { fill: var(--sim-yellow); }
.sim-part-roof.is-on .sim-fill { fill: var(--sim-action); }
.sim-part-roof.is-on .sim-roof-a { fill: #4d86d9; }
.sim-part-roof.is-on .sim-gutter { stroke: var(--sim-yellow); }
.sim-part-garden.is-on .sim-fill, .sim-part-window.is-on .sim-fill, .sim-part-garage.is-on .sim-fill, .sim-part-water.is-on .sim-fill, .sim-part-interior.is-on .sim-fill { fill: var(--sim-yellow); stroke: var(--sim-blue); }
.sim-part-water, .sim-part-interior { opacity: 0; }
.sim-part-water.is-on, .sim-part-interior.is-on { opacity: 1; }
.sim-pref { transition: fill .28s ease; }
.sim-pref.is-selected { fill: var(--sim-yellow); }

.sim-main { padding: 34px 8% 30px; display: flex; flex-direction: column; min-width: 0; }
.sim-progress { margin-bottom: 26px; }
.sim-progress-bars { display: flex; gap: 6px; }
.sim-progress-bars span { height: 4px; flex: 1; background: #e5ebf0; }
.sim-progress-bars span.done { background: var(--sim-blue); }
.sim-step-count { font-size: 13px; color: var(--sim-blue); margin-top: 10px; font-weight: 700; }
.sim-question { font-size: clamp(22px, 2.2vw, 29px); line-height: 1.5; letter-spacing: .01em; margin-bottom: 10px; font-weight: 700; color: var(--sim-ink); }
.sim-question:focus { outline: none; }
.sim-help { font-size: 14px; line-height: 1.85; color: var(--sim-muted); margin-bottom: 16px; }
.sim-context { font-size: 14px; font-weight: 700; color: var(--sim-blue); border-left: 3px solid var(--sim-yellow); padding-left: 10px; margin-bottom: 18px; }
.sim-field { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.sim-legend { font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.sim-field .sim-help { margin-bottom: 10px; }
.sim-options { display: grid; gap: 0; border-top: 1px solid var(--sim-line); }
.sim-option { position: relative; display: flex; align-items: center; gap: 14px; background: #fff; border-bottom: 1px solid var(--sim-line); padding: 15px 12px; min-height: 60px; cursor: pointer; }
.sim-option:hover { background: #f5f9fc; }
.sim-option.is-selected { background: #edf4ff; }
.sim-option.is-selected::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sim-action); }
.sim-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sim-option input:focus-visible + .sim-radio { outline: 3px solid var(--sim-action); outline-offset: 3px; }
.sim-radio { border: 1.5px solid #91a8b9; border-radius: 50%; width: 22px; height: 22px; flex: none; display: grid; place-items: center; background: #fff; }
.sim-option input[type="checkbox"] + .sim-radio { border-radius: 4px; }
.is-selected .sim-radio { background: var(--sim-action); border-color: var(--sim-action); }
.is-selected .sim-radio::after { content: "✓"; color: #fff; font-size: 14px; line-height: 1; }
.sim-option-text { display: block; min-width: 0; flex: 1; }
.sim-option-text strong { font-size: 16px; display: block; line-height: 1.5; }
.sim-option-text small { font-size: 13px; color: var(--sim-muted); display: block; margin-top: 4px; line-height: 1.6; }
.sim-selected-word { display: none; font-size: 12px; color: var(--sim-action); font-weight: 700; }
.is-selected .sim-selected-word { display: inline; }
.sim-options-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; border-top: 0; }
.sim-options-cards .sim-option { flex-direction: column; align-items: flex-start; border: 1px solid var(--sim-line); border-radius: 6px; padding: 12px; gap: 10px; }
.sim-options-cards .sim-option.is-selected { border-color: var(--sim-action); border-width: 2px; padding: 11px; }
.sim-options-cards .sim-option.is-selected::before { display: none; }
.sim-options-cards .sim-fig { order: -1; width: 100%; }
.sim-fig { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; background: var(--sim-sky); }
.sim-fig svg, .sim-fig img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sim-fig-tag { position: absolute; right: 6px; bottom: 6px; font-size: 11px; background: rgba(255,255,255,.9); color: var(--sim-blue); padding: 2px 7px; border-radius: 3px; font-weight: 700; }
.sim-callout { position: relative; border: 1px solid var(--sim-line); border-radius: 8px; padding: 18px 18px 6px; margin: 0 0 24px; background: #fff; }
.sim-callout::before { content: ""; position: absolute; left: -14px; top: 34px; width: 14px; height: 2px; background: var(--sim-blue); }
.sim-callout::after { content: ""; position: absolute; left: -22px; top: 30px; width: 10px; height: 10px; border-radius: 50%; background: var(--sim-yellow); border: 2px solid var(--sim-blue); }
.sim-callout .sim-field { margin-bottom: 10px; }
.sim-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sim-input, .sim-select, .sim-textarea { padding: 12px 12px; border: 1px solid #afc1d0; border-radius: 3px; background: #fff; min-height: 48px; font-size: 16px; max-width: 100%; }
.sim-input-num { width: 160px; }
.sim-textarea { width: 100%; resize: vertical; line-height: 1.7; }
.sim-error { color: var(--sim-error); font-size: 14px; font-weight: 700; margin: 4px 0 10px; }
.sim-error::before { content: "！ "; }
.sim-field.has-error .sim-legend { color: var(--sim-error); }
.sim-field.has-error .sim-options { border-top-color: var(--sim-error); }
.sim-field.has-error .sim-option { border-bottom-color: var(--sim-error); }
.sim-next-note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; line-height: 1.7; font-size: 14px; color: var(--sim-muted); }
.sim-next-icon { font-size: 22px; line-height: 1; }
.sim-footnote { font-size: 13px; line-height: 1.8; color: var(--sim-muted); margin-top: 16px; }
.sim-footnote a { color: var(--sim-blue); }
.sim-price-note { border-left: 3px solid var(--sim-yellow); padding-left: 14px; font-size: 13px; line-height: 1.85; margin-top: 24px; }
.sim-notice { border-left: 3px solid var(--sim-blue); padding-left: 12px; margin-bottom: 10px; }
.sim-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.sim-actions-right { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.sim-primary { border: 0; background: var(--sim-blue); color: #fff; padding: 15px 24px; min-height: 52px; min-width: 150px; font-weight: 700; border-radius: 4px; }
.sim-primary:hover { background: #103d68; }
.sim-secondary { background: #fff; border: 1px solid var(--sim-blue); color: var(--sim-blue); padding: 13px 17px; min-height: 52px; border-radius: 4px; font-weight: 700; }
.sim-back { border: 0; background: none; padding: 12px 0; font-size: 14px; color: var(--sim-muted); text-decoration: underline; text-underline-offset: 4px; }
.sim-link { border: 0; background: none; padding: 6px 0; font-size: 14px; color: var(--sim-blue); text-decoration: underline; text-underline-offset: 4px; }

/* 確認 */
.sim-review { margin: 12px 0 16px; }
.sim-review > div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--sim-line); font-size: 15px; line-height: 1.75; }
.sim-review dt { color: var(--sim-muted); }
.sim-lines { padding-left: 1.2em; margin-top: 4px; font-size: 14px; }
.sim-item-actions { display: flex; gap: 16px; margin-top: 6px; }
.sim-add { margin: 6px 0 12px; }
.sim-handoff { margin-top: 20px; }
.sim-pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; line-height: 1.7; background: #f1f6fa; border-radius: 6px; padding: 14px 16px; margin: 8px 0 0; max-height: 320px; overflow: auto; }
.sim-reset { margin-top: 24px; }

/* 問い合わせページ：引き継ぎパネル（既存 CSS の .ap-form button より優先させる） */
.ap-sim-handoff-panel { margin: 0 0 24px; padding: 20px 22px; border: 1px solid #b8c9d8; background: #eaf3fb; border-radius: 8px; color: #22384a; font-size: 16px; line-height: 1.7; }
.ap-sim-handoff-title { font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.ap-sim-handoff-lead { margin: 0; font-size: 15px; }
.ap-sim-handoff-panel .sim-pre { background: #fff; }
.ap-sim-handoff-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ap-form .ap-sim-handoff-panel .ap-sim-btn, .ap-sim-handoff-panel .ap-sim-btn { font: inherit; font-size: 15px; font-weight: 700; padding: 14px 22px; border-radius: 4px; min-height: 50px; cursor: pointer; }
.ap-form .ap-sim-handoff-panel .ap-sim-btn-primary, .ap-sim-handoff-panel .ap-sim-btn-primary { background: #174e81; color: #fff; border: 1px solid #174e81; }
.ap-form .ap-sim-handoff-panel .ap-sim-btn-primary:disabled, .ap-sim-handoff-panel .ap-sim-btn-primary:disabled { background: #c7d3dd; border-color: #c7d3dd; color: #425b70; cursor: default; }
.ap-form .ap-sim-handoff-panel .ap-sim-btn-outline, .ap-sim-handoff-panel .ap-sim-btn-outline { background: #fff; color: #174e81; border: 1px solid #174e81; }
.ap-sim-handoff-msg { margin: 10px 0 0; font-weight: 700; font-size: 15px; }
.ap-sim-handoff-msg:empty { display: none; }

/* タブレット */
@media (max-width: 1000px) {
  .sim-shell { grid-template-columns: 42% 58%; }
  .sim-scene, .sim-main { padding-left: 5%; padding-right: 5%; }
}
/* スマホ：質問を主役に、図は縮める。素材の候補は図の下（質問側）に展開 */
@media (max-width: 760px) {
  .sim-shell { display: block; min-height: 0; border-radius: 6px; background: #fff; }
  .sim-scene { padding: 20px 18px 16px; position: relative; min-height: 190px; }
  .sim-title { font-size: 22px; max-width: 58%; margin: 8px 0; line-height: 1.4; }
  .sim-intro { font-size: 13px; max-width: 58%; line-height: 1.75; }
  .sim-figure { position: absolute; right: -4px; top: 30px; width: 44%; min-height: 0; margin: 0; }
  .sim-figure.is-map { position: static; width: 100%; margin: 6px 0 0; }
  .sim-figure svg { max-height: 190px; }
  .sim-caption { font-size: 12px; max-width: 62%; margin-top: 8px; }
  .sim-figure.is-map + .sim-caption { max-width: 100%; }
  .sim-main { padding: 22px 18px 28px; }
  .sim-progress { margin-bottom: 18px; }
  .sim-question { font-size: 23px; }
  .sim-help { font-size: 13px; }
  .sim-option { min-height: 56px; padding: 13px 10px; }
  .sim-options-cards { grid-template-columns: 1fr 1fr; }
  .sim-callout::before, .sim-callout::after { display: none; }
  .sim-callout { padding: 14px 12px 4px; }
  .sim-review > div { grid-template-columns: 70px 1fr; }
  .sim-actions .sim-primary, .sim-actions .sim-secondary { flex: 1 1 auto; text-align: center; }
  .sim-actions-right { width: 100%; margin-left: 0; }
  .sim-input-num { width: 100%; }
  .ap-sim { padding-bottom: 76px; } /* 下部の固定連絡ボタンと重ねない */
}
@media (max-width: 420px) { .sim-options-cards { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ap-sim * { transition: none !important; } }


/* 雨どいの場所強調（屋根選択時） */
.sim-part-roof.is-on .sim-gutter.is-target { stroke-width: 5px; }

/* 別棟（garage グループ）への相談：建物＋部位で強調（R8） */
.sim-part-garage.is-annex-roof .sim-annex-roof, .sim-part-garage.is-annex-all .sim-annex-roof { fill: var(--sim-action); }
.sim-part-garage.is-annex-wall .sim-annex-wall, .sim-part-garage.is-annex-all .sim-annex-wall { fill: var(--sim-yellow); stroke: var(--sim-blue); }
.sim-part-garage.is-annex-window .sim-annex-window, .sim-part-garage.is-annex-all .sim-annex-window { fill: var(--sim-yellow); stroke: var(--sim-blue); }
.sim-h3 { font-size: 17px; font-weight: 700; margin: 18px 0 10px; color: var(--sim-blue); }
