:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --ink: #111816;
  --muted: #5d6965;
  --faint: #8a9591;
  --line: #e2e8e5;
  --brand: #12403c;
  --brand-2: #1c5c56;
  --brand-soft: #e8f0ee;
  --danger: #b3261e;
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.sample-bar { background: #1b211f; color: #d9e2df; font-size: 12px; text-align: center; padding: 7px 16px; }

.top { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; margin: 0 auto; padding: 18px 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); position: relative; }
.mark::after { content: ''; position: absolute; inset: 8px 6px auto; height: 7px; border: 2px solid #fff; border-bottom: 0; border-radius: 8px 8px 0 0; }
.tag { font-size: 12px; font-weight: 600; color: #7a5d22; background: #f4ecdb; padding: 4px 10px; border-radius: 99px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.intro { padding: 36px 0 28px; }
.intro h1 { font-size: clamp(30px, 7.4vw, 44px); line-height: 1.22; letter-spacing: -0.035em; margin: 0 0 12px; font-weight: 750; }
.intro p { margin: 0; color: var(--muted); font-size: 17px; }

.layout { display: grid; gap: 20px; }
.calc { display: grid; gap: 14px; }
.block { background: var(--surface); border-radius: var(--radius); padding: 22px 20px 20px; box-shadow: 0 1px 0 var(--line); }
legend { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 16px; padding: 0; float: left; width: 100%; }
legend + * { clear: both; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; display: grid; place-items: center; font-weight: 700; }

.area-row { display: flex; gap: 10px; align-items: stretch; }
.area-input { position: relative; flex: 1; }
.area-input input {
  width: 100%; height: 60px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 52px 0 18px;
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; background: #fbfcfc; outline: none;
  transition: border-color .18s var(--ease), background .18s;
}
.area-input input::placeholder { color: #c5cdca; }
.area-input input:focus { border-color: var(--brand); background: #fff; }
.area-input.bad input { border-color: var(--danger); }
.unit-suffix { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }

.seg { display: inline-flex; background: #eef2f0; border-radius: 12px; padding: 4px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-width: 52px; height: 100%; min-height: 44px; padding: 0 14px; border-radius: 9px; font-weight: 600; color: var(--muted); transition: background .18s, color .18s; text-align: center; font-size: 15px; line-height: 1.3; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg.wide { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg.wide span { padding: 8px 6px; }
.seg.wide small { display: block; font-size: 12px; font-weight: 500; color: var(--faint); }

.help { margin: 10px 2px 0; color: var(--faint); font-size: 13px; }
.err { margin: 8px 2px 0; color: var(--danger); font-size: 14px; font-weight: 600; min-height: 0; font-style: normal; display: block; }
.err:empty { display: none; }

.cards { display: grid; gap: 10px; }
.card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: pointer; transition: border-color .18s var(--ease), background .18s; }
.card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.card b { display: block; font-size: 17px; }
.card small { color: var(--muted); font-size: 14px; }
.card .rate { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.card:has(input:checked) .rate { color: var(--brand); font-weight: 600; }
.card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.bad-group .card, .bad-group .chip span { border-color: #e9b8b4; }

.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.opt:first-of-type { border-top: 0; padding-top: 0; }
.opt.col { flex-direction: column; align-items: stretch; }
.opt-text b { display: block; font-size: 16px; }
.opt-text span { font-size: 13px; color: var(--faint); }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 46px; height: 44px; border: 0; background: #fff; font-size: 20px; color: var(--brand); }
.stepper button:disabled { color: #c9d1ce; cursor: default; }
.stepper output { width: 36px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch-row { cursor: pointer; padding-bottom: 0; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: #d7dfdc; position: relative; cursor: pointer; transition: background .2s var(--ease); flex: none; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .24s var(--ease); }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: 15px; line-height: 1.35; height: 100%; transition: border-color .18s, background .18s; }
.chip small { display: block; font-weight: 500; color: var(--faint); font-size: 13px; margin-top: 2px; }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.summary { background: var(--surface); border-radius: 20px; padding: 26px 22px 22px; box-shadow: 0 1px 0 var(--line); }
.sum-label { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.total { margin: 4px 0 2px; font-size: 40px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.total.dim { color: #b9c3bf; }
.total.consult { font-size: 30px; color: var(--brand); }
.sum-state { margin: 0 0 14px; font-size: 14px; color: var(--muted); min-height: 21px; }
.lines { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.lines:empty { display: none; }
.lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.lines li span small { display: block; color: var(--faint); font-size: 13px; }
.lines li b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { margin: 16px 0 0; font-size: 13px; color: var(--faint); }

.cta { display: inline-flex; align-items: center; justify-content: center; height: 54px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--brand); color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; transition: background .18s, transform .18s var(--ease), opacity .18s; }
.cta:hover { background: var(--brand-2); }
.cta:active { transform: scale(.98); }
.cta.wait { opacity: .45; }
.cta.full { width: 100%; }
.cta.ghost { background: var(--brand-soft); color: var(--brand); }
.cta.desk { display: none; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bar-total { flex: 1; min-width: 0; }
.bar-total span { display: block; font-size: 12px; color: var(--muted); }
.bar-total b { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar .cta { flex: none; }

.foot { max-width: 1080px; margin: 28px auto 0; padding: 0 20px 24px; color: var(--faint); font-size: 12px; }

/* 문의 창: 아래에서 올라옴 */
.sheet { border: 0; padding: 0; width: 100%; max-width: 520px; margin: auto auto 0; border-radius: 22px 22px 0 0; background: #fff; color: var(--ink); max-height: 92vh; overflow: auto; }
.sheet::backdrop { background: rgba(10, 18, 16, .45); }
.sheet[open] { animation: up .38s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-in { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.x { width: 40px; height: 40px; border: 0; background: #f0f3f2; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); }
.sheet-quote { background: var(--bg); border-radius: 12px; padding: 14px 16px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.sheet-quote b { display: block; color: var(--ink); font-size: 22px; letter-spacing: -0.02em; margin-top: 2px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field i { font-style: normal; color: var(--brand); font-size: 12px; font-weight: 600; margin-left: 4px; }
.field input, .field textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fbfcfc; outline: none; font-size: 16px; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field.bad input { border-color: var(--danger); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 4px 0 6px; cursor: pointer; }
.agree input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
#ask .cta { margin-top: 12px; }
.done { text-align: center; padding-top: 34px; }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); margin: 0 auto 16px; position: relative; }
.check::after { content: ''; position: absolute; left: 22px; top: 17px; width: 14px; height: 24px; border: solid var(--brand); border-width: 0 3.5px 3.5px 0; transform: rotate(45deg); }
.done-sub { color: var(--muted); margin: 8px 0 18px; }
.done .sheet-quote { text-align: left; }
.sample-note { font-size: 13px; color: #7a5d22; background: #f8f2e5; border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .intro { padding: 56px 0 36px; }
  .layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
  .summary { position: sticky; top: 24px; padding: 30px 28px 26px; }
  .cta.desk { display: flex; width: 100%; margin-top: 22px; }
  .bar { display: none; }
  .chips { grid-template-columns: repeat(4, 1fr); }
  .sheet { margin: auto; border-radius: 22px; }
  .sheet[open] { animation: fade .3s var(--ease); }
  @keyframes fade { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (max-width: 360px) {
  .area-input input { font-size: 22px; }
  .chips { grid-template-columns: 1fr; }
  .bar .cta { padding: 0 16px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.privacy { margin: 2px 0 6px 30px; font-size: 12px; line-height: 1.6; color: var(--faint); }
#q-send:disabled { opacity: .6; cursor: progress; }
