:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #1d2320;
  --sub: #5a645f;
  --line: #dfe3dd;
  --brand: #1f6f50;
  --brand-ink: #ffffff;
  --brand-soft: #e5f1eb;
  --accent: #c2410c;
  --accent-soft: #fff1e8;
  --warn-soft: #fff8db;
  --warn-line: #e8cf6a;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --card: #1b211e;
    --ink: #eef2ef;
    --sub: #a9b3ad;
    --line: #2f3833;
    --brand: #4fbf8f;
    --brand-ink: #0d1a14;
    --brand-soft: #1d3329;
    --accent: #ff9b62;
    --accent-soft: #3a2519;
    --warn-soft: #332c12;
    --warn-line: #6d5d1f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 19px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--brand); }
img, svg { max-width: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 8px; }
.logo { white-space: nowrap; flex-shrink: 0; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo b { color: var(--brand); }
.nav { display: flex; gap: 2px; justify-content: flex-end; }
@media (max-width: 420px) { .nav a.home { display: none; } .nav a { padding: 8px 8px; } }
.nav a { white-space: nowrap; text-decoration: none; color: var(--sub); font-size: 16px; padding: 8px 10px; border-radius: 10px; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 700; }

/* 본문 */
main { padding: 20px 0 40px; }
h1 { font-size: 28px; line-height: 1.35; margin: 8px 0 8px; }
h2 { font-size: 23px; line-height: 1.4; margin: 36px 0 12px; }
h3 { font-size: 20px; margin: 22px 0 8px; }
p { margin: 0 0 14px; }
.lead { color: var(--sub); font-size: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; margin: 16px 0; }

/* 첫 화면 계산기 카드 */
.tools { display: grid; gap: 14px; margin: 18px 0; }
.tool { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px; }
.tool:hover, .tool:focus-visible { border-color: var(--brand); }
.tool .t { font-size: 22px; font-weight: 800; display: block; }
.tool .d { color: var(--sub); font-size: 17px; display: block; margin-top: 4px; }
.tool .go { display: inline-block; margin-top: 12px; color: var(--brand); font-weight: 700; }

/* 입력 */
.field { margin: 0 0 18px; }
.field label { display: block; font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.field .hint { display: block; color: var(--sub); font-size: 15px; margin-top: 4px; line-height: 1.5; }
.inbox { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.inbox:focus-within { border-color: var(--brand); }
.inbox input, .inbox select { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink);
  font-size: 24px; font-weight: 700; padding: 12px 14px; font-family: inherit; outline: none; }
.inbox select { font-size: 20px; appearance: none; -webkit-appearance: none; }
.inbox .unit { display: flex; align-items: center; padding: 0 14px; color: var(--sub); font-size: 18px; background: var(--bg); }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.row2 > * { min-width: 0; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; border: 0; border-radius: 14px;
  font-size: 21px; font-weight: 800; cursor: pointer; text-decoration: none; font-family: inherit; padding: 10px 16px; text-align: center; }
.btn-main { background: var(--brand); color: var(--brand-ink); }
.btn-sub { background: var(--brand-soft); color: var(--brand); }
.btn-cta { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-cta { color: #1b0f08; } }
.btns { display: grid; gap: 10px; margin-top: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.seg button { min-height: 54px; font-size: 19px; font-weight: 700; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); color: var(--sub); font-family: inherit; cursor: pointer; }
.seg button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 결과 */
.result { display: none; }
.result.on { display: block; }
.big { background: var(--brand-soft); border-radius: 14px; padding: 18px; text-align: center; margin-bottom: 12px; }
.big .k { color: var(--sub); font-size: 17px; }
.big .v { font-size: 40px; font-weight: 900; color: var(--brand); line-height: 1.25; }
.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.list li span:first-child { color: var(--sub); flex-shrink: 0; white-space: nowrap; }
.list li span:last-child { font-weight: 800; text-align: right; }
.err { background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 12px 14px; font-weight: 700; display: none; margin: 8px 0; }
.err.on { display: block; }
.note { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.6; margin: 12px 0; }
.tag { display: inline-block; font-size: 14px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag.ok { background: var(--brand-soft); color: var(--brand); }

/* 표 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 17px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; white-space: nowrap; }
th { color: var(--sub); font-weight: 700; }
td.n, th.n { text-align: right; }

/* 자주 묻는 질문 */
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 0 16px; }
summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style-position: outside; }
details > div { padding: 0 0 14px; color: var(--ink); }

/* 바닥 */
footer { border-top: 1px solid var(--line); background: var(--card); padding: 26px 0 40px; font-size: 16px; color: var(--sub); }
footer .office { white-space: pre-line; line-height: 1.8; color: var(--ink); }
footer .office strong { display: block; margin-bottom: 4px; }
footer .links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0; }
footer .links a { color: var(--sub); }
.ad-slot { margin: 18px 0; min-height: 0; }

/* 2차: 건물 계산기·비교표·보고서 */
@media (max-width: 480px) { .logo span { display: none; } .nav a { font-size: 15px; padding: 8px 7px; } }
.cmp td, .cmp th { font-size: 15px; padding: 8px 4px; }
.cmp tr.cur td { background: var(--brand-soft); font-weight: 800; }
.list.stack li { flex-direction: column; gap: 2px; }
.list.stack li span:last-child { text-align: left; font-weight: 700; }
details.opt { margin: 0 0 18px; }
details.opt summary { color: var(--brand); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.price { width: 100%; }
.price td:last-child { text-align: right; font-weight: 800; white-space: nowrap; }
.price td { white-space: normal; }
.shots { display: grid; gap: 12px; }
.shots img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.shots figcaption { font-size: 15px; color: var(--sub); margin-top: 4px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.total { font-size: 30px; font-weight: 900; color: var(--accent); }
footer .biz { font-size: 14px; margin: 10px 0 0; }
.legal h3 { margin-top: 20px; }
.legal ol, .legal ul { padding-left: 22px; }
