:root {
  --green: #17503a;
  --green-deep: #0e3526;
  --green-soft: #e4efe8;
  --amber: #f2b632;
  --cream: #f6f3ea;
  --ink: #1f2a24;
  --muted: #6b766f;
  --line: #dcd8cb;
  --white: #fff;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-num: "Oswald", "Noto Sans JP", sans-serif;
  --max: 1120px;
  --pad: clamp(16px, 4vw, 36px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--cream); line-height: 1.8; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
fieldset { min-width: 0; border: 0; }

/* ---------- ヘッダー ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--pad); background: var(--white); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 900; }
.logo i { position: relative; width: 30px; height: 30px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 0 4px #fbe6ad; }
.header-tel { font-family: var(--font-num); font-size: 1.5rem; line-height: 1.2; text-align: right; color: var(--green); }
.header-tel small { display: block; font-family: var(--font); font-size: .7rem; font-weight: 400; color: var(--muted); }

/* ---------- ファーストビュー ---------- */
.hero { padding: clamp(30px, 5vw, 52px) var(--pad) clamp(70px, 9vw, 96px); color: var(--white); background: var(--green) linear-gradient(135deg, transparent 0 62%, rgba(255, 255, 255, .06) 62% 100%); }
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero-label { display: inline-block; padding: 2px 16px; font-size: .84rem; font-weight: 700; color: var(--green-deep); background: var(--amber); border-radius: 999px; }
.hero h1 { margin: 14px 0 18px; font-size: clamp(1.8rem, 4.8vw, 3rem); font-weight: 900; line-height: 1.4; }
.hero h1 em { font-family: var(--font-num); font-size: 1.35em; font-style: normal; color: var(--amber); }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; font-weight: 700; }
.hero-points li { padding-left: 26px; background: radial-gradient(circle at 9px 50%, var(--amber) 0 4px, transparent 4.5px), radial-gradient(circle at 9px 50%, rgba(242, 182, 50, .3) 0 9px, transparent 9.5px); }

/* ---------- レイアウト ---------- */
.layout { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; max-width: var(--max); margin: clamp(-56px, -6vw, -40px) auto 0; padding: 0 var(--pad); }
.questions { display: grid; gap: 14px; }
.questions fieldset { padding: clamp(18px, 3vw, 28px); background: var(--white); border-radius: 16px; box-shadow: 0 6px 20px rgba(23, 80, 58, .08); }
legend { float: left; display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 16px; font-size: 1.1rem; font-weight: 900; }
legend + * { clear: both; }
legend span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; font-family: var(--font-num); font-size: 1.1rem; color: var(--white); background: var(--green); border-radius: 50%; }
legend small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.hint { margin-top: 12px; font-size: .8rem; color: var(--muted); }

/* ---------- 選択肢 ---------- */
.choices { display: grid; gap: 10px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.paints, .options { grid-template-columns: repeat(2, 1fr); }
.choices label { position: relative; display: block; cursor: pointer; }
.choices input { position: absolute; opacity: 0; }
.choices label > span { display: block; height: 100%; padding: 14px 16px; background: var(--white); border: 2px solid var(--line); border-radius: 12px; transition: border-color .2s, background .2s, box-shadow .2s; }
.choices label:hover > span { border-color: #9cbbaa; }
.choices input:checked + span { background: var(--green-soft); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.choices input:focus-visible + span { outline: 3px solid rgba(242, 182, 50, .8); outline-offset: 2px; }
.choices b { display: block; font-size: 1rem; }
.choices small { display: block; font-size: .8rem; color: var(--muted); }
.choices em { display: block; margin-top: 4px; font-size: .78rem; font-style: normal; line-height: 1.6; color: var(--green); }

.cols-4 label > span { padding: 14px 8px 12px; font-size: .92rem; font-weight: 700; text-align: center; }

/* チェックボックスの見た目 */
.options label > span { padding-left: 50px; }
.options label > span::before { content: ""; position: absolute; top: 50%; left: 16px; width: 22px; height: 22px; background: var(--white); border: 2px solid var(--line); border-radius: 6px; transform: translateY(-50%); transition: background .2s, border-color .2s; }
.options label > span::after { content: ""; position: absolute; top: 50%; left: 24px; width: 6px; height: 11px; border: solid var(--white); border-width: 0 3px 3px 0; opacity: 0; transform: translateY(-65%) rotate(45deg); }
.options input:checked + span::before { background: var(--green); border-color: var(--green); }
.options input:checked + span::after { opacity: 1; }

/* 建物の形を四角と屋根で描く */
.house { position: relative; display: block; width: 44px; margin: 14px auto 8px; background: var(--green); border-radius: 0 0 3px 3px; }
.house::before { content: ""; position: absolute; left: -6px; right: -6px; bottom: 100%; height: 12px; background: var(--amber); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.house::after { content: ""; position: absolute; inset: 5px 8px auto; height: 100%; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .85) 0 6px, transparent 6px 14px); }
.h1 { height: 16px; width: 52px; }
.h2 { height: 28px; }
.h3 { height: 42px; width: 38px; margin-top: 0; }
.h4 { height: 28px; width: 62px; }
.h4::before { height: 6px; clip-path: none; left: -3px; right: -3px; }
.h1::after { height: 6px; }
.h2::after { height: 20px; }
.h3::after { height: 34px; }
.h4::after { height: 20px; }
.cols-4 .h1 { margin-top: 26px; }
.cols-4 .h2, .cols-4 .h4 { margin-top: 14px; }

/* ---------- 面積のスライダー ---------- */
.area-value { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.area-value > output { margin-right: 4px; font-family: var(--font-num); font-size: 2.8rem; color: var(--green); }
.area-value small { margin-left: 10px; font-size: .86rem; font-weight: 400; color: var(--muted); }
input[type="range"] { --fill: 33%; display: block; width: 100%; height: 32px; margin-top: 4px; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 10px; background: linear-gradient(90deg, var(--green) var(--fill), var(--line) var(--fill)); border-radius: 999px; }
input[type="range"]::-moz-range-track { height: 10px; background: var(--line); border-radius: 999px; }
input[type="range"]::-moz-range-progress { height: 10px; background: var(--green); border-radius: 999px; }
input[type="range"]::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -10px; background: var(--amber); border: 4px solid var(--white); border-radius: 50%; box-shadow: 0 2px 8px rgba(14, 53, 38, .35); -webkit-appearance: none; appearance: none; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; background: var(--amber); border: 4px solid var(--white); border-radius: 50%; box-shadow: 0 2px 8px rgba(14, 53, 38, .35); }
input[type="range"]:focus-visible { outline: 3px solid rgba(242, 182, 50, .8); outline-offset: 4px; border-radius: 999px; }
.area-scale { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }

/* ---------- 結果 ---------- */
.result { position: sticky; top: 16px; padding: 26px 24px; color: var(--white); background: var(--green-deep); border-radius: 16px; box-shadow: 0 14px 34px rgba(14, 53, 38, .3); }
.result-label { font-size: .84rem; font-weight: 700; color: var(--amber); }
.result-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 2px 0 16px; font-weight: 700; line-height: 1.2; }
.result-price b { font-family: var(--font-num); font-size: clamp(2.8rem, 6vw, 3.6rem); font-variant-numeric: tabular-nums; }
.result-price span:last-child { font-size: 1.2rem; }

.bar { display: flex; height: 14px; overflow: hidden; background: rgba(255, 255, 255, .12); border-radius: 999px; }
.bar i { display: block; height: 100%; transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.breakdown { margin: 14px 0 16px; font-size: .88rem; }
.breakdown div { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.breakdown i { flex: 0 0 10px; height: 10px; border-radius: 3px; }
.breakdown dd { margin-left: auto; font-family: var(--font-num); font-size: 1.05rem; white-space: nowrap; }
.breakdown dd small { margin-left: 2px; font-family: var(--font); font-size: .74rem; }

.per-year { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.per-year p { padding: 10px 12px; background: rgba(255, 255, 255, .08); border-radius: 10px; }
.per-year small { display: block; font-size: .72rem; color: #b9cfc3; }
.per-year b { font-size: 1.05rem; color: var(--amber); }

.btn { width: 100%; min-height: 58px; padding: 10px 16px; font-size: 1rem; font-weight: 900; color: var(--green-deep); background: var(--amber); border: 0; border-radius: 12px; box-shadow: 0 5px 0 #c58f15; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 #c58f15; }
.result-note { margin-top: 12px; font-size: .74rem; line-height: 1.7; color: #b9cfc3; }
.result-note[data-apply-note] { font-size: .84rem; font-weight: 700; color: var(--amber); }

/* ---------- 説明 ---------- */
.about { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 80px) var(--pad); }
.about h2 { margin-bottom: 20px; font-size: clamp(1.3rem, 2.8vw, 1.7rem); font-weight: 900; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.about article { padding: 22px; background: var(--white); border-top: 5px solid var(--green); border-radius: 0 0 12px 12px; }
.about article:nth-child(2) { border-color: var(--amber); }
.about article:nth-child(3) { border-color: #8fb7a2; }
.about h3 { margin-bottom: 6px; font-size: 1.02rem; }
.about p { font-size: .88rem; color: var(--muted); }

.footer { padding: 24px var(--pad); font-size: .8rem; text-align: center; color: #b9cfc3; background: var(--green-deep); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .result { position: static; }
}

@media (max-width: 600px) {
  .header-tel small { display: none; }
  .header-tel { font-size: 1.25rem; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .paints, .options, .about-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
