:root {
  --bg: #f5f6f7;
  --paper: #ffffff;
  --ink: #1c2530;
  --muted: #5b6672;
  --line: #d8dde2;
  --accent: #1f4e6b;
  --accent-ink: #ffffff;
  --accent-soft: #e8eff4;
  --warn: #8a3b0c;
  --warn-soft: #fbefe6;
  --ok: #17603a;
  --ok-soft: #e6f3ec;
  --radius: 6px;
  --font: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--font); word-break: keep-all;
}
a { color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* 상단 */
.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 0; font-size: 15px; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav a:hover { color: var(--ink); }

main { padding: 28px 0 48px; }
h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 32px 0 10px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }

.notice {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 10px 14px; margin: 16px 0; font-size: 15px; border-radius: 0 var(--radius) var(--radius) 0;
}
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice strong { font-weight: 700; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 16px 0;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* 폼 */
label, .label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 3px; }
input[type=text], input[type=number], input[type=search], select {
  width: 100%; min-height: 44px; padding: 8px 10px; font: inherit;
  border: 1px solid #aeb6bd; border-radius: var(--radius); background: #fff; color: var(--ink);
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8fb4cc; outline-offset: 1px; }
input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.field { min-width: 0; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit .u { color: var(--muted); font-size: 14px; white-space: nowrap; min-width: 2.2em; }

button, .btn {
  min-height: 44px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
button.secondary { background: #fff; color: var(--accent); }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; }
button:hover { filter: brightness(1.08); }

/* 행 입력 (면적표·층별) */
.rows { display: grid; gap: 10px; margin: 8px 0 12px; }
.row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; align-items: end; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.row .span2 { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .row.area-row { grid-template-columns: 1.4fr 1fr 110px 44px; padding-bottom: 0; border: 0; }
  .row.floor-row { grid-template-columns: 1fr 1fr 1.3fr 44px; padding-bottom: 0; border: 0; }
  .row.park-row { grid-template-columns: 2.4fr 1fr 1fr 44px; padding-bottom: 0; border: 0; }
  .row .span2 { grid-column: auto; }
}
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; font-size: 14px; }
.check input { flex: none; }
.rm { padding: 0; width: 44px; font-size: 20px; line-height: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 결과 */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef1f3; font-weight: 600; font-size: 14px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: #f7f9fa; }
.table-scroll { overflow-x: auto; }
.result-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 8px 0; }
@media (min-width: 720px) { .result-grid.three { grid-template-columns: repeat(3, 1fr); } }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .s { font-size: 13px; color: var(--muted); }
.stat.ok { border-color: #9cc8b0; background: var(--ok-soft); }
.stat.over { border-color: #e0b08f; background: var(--warn-soft); }
.stat.over .v { color: var(--warn); }
.stat.ok .v { color: var(--ok); }
.empty { color: var(--muted); font-size: 15px; padding: 8px 0; }

/* 홈 카드 */
.tools { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 720px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tool-link { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); }
.tool-link:hover { border-color: var(--accent); }
.tool-link h2 { margin: 0 0 6px; font-size: 18px; color: var(--accent); }
.tool-link p { margin: 0; color: var(--muted); font-size: 15px; }

.site-foot { border-top: 1px solid var(--line); background: var(--paper); padding: 18px 0 28px; font-size: 14px; color: var(--muted); }
.site-foot p { margin: 4px 0; }
.src-link { font-size: 13px; }
ul.plain { padding-left: 20px; margin: 6px 0; }
.small { font-size: 14px; color: var(--muted); }
code { background: #eef1f3; padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }
@media print { .site-head, .site-foot .nav, button, .actions { display: none; } body { background: #fff; } }

/* 푸터 링크, 광고 자리(광고 ID 전에는 hidden이라 보이지 않음) */
.foot-links{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:8px}
.ad-slot{margin:20px 0;min-height:100px;text-align:center}
.ad-slot::before{content:"광고";display:block;font-size:12px;color:#5a6472}
.faq dt{font-weight:600;margin-top:14px}
.faq dd{margin:4px 0 0}
