/* ==========================================================================
   app.css — 레이아웃 + 화면 컴포넌트
   base.css 의 토큰만 사용합니다. 모바일 우선.
   ========================================================================== */

/* ================================ 헤더 ================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-700);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.header-spacer { flex: 1 1 auto; }

.header-nav { display: none; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.menu-btn:hover { background: var(--surface-2); }

/* 카테고리 가로 스크롤 탭 */
.cat-bar {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.cat-scroll {
  display: flex;
  gap: 6px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.cat-chip:hover { background: var(--surface-3); text-decoration: none; }
.cat-chip[aria-current="page"],
.cat-chip.is-active {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-600);
}

/* ================================ 드로어 =============================== */

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 24, 40, .45);
  opacity: 0;
  transition: opacity .18s ease;
}
.drawer-scrim[hidden] { display: none; }
.drawer-scrim.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(360px, 88vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform .2s ease;
  overscroll-behavior: contain;
}
.drawer[hidden] { display: none; }
.drawer.is-open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 14px 24px; }

.drawer-body h3 {
  margin: 16px 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.drawer-body a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
}
.drawer-body a:hover { background: var(--surface-3); text-decoration: none; }
.drawer-body a[aria-current="page"] { background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.drawer-body a .ico { flex: 0 0 22px; text-align: center; font-size: 17px; }

/* =============================== 페이지 ================================ */

/* JS 가 셸을 그리기 전/실패해도 본문이 제대로 보이도록 #page-content 에도 적용 */
.wrap,
#page-content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

/* 토스트 (복사 완료 등 짧은 알림) */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  max-width: min(90vw, 420px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inv);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-3);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.breadcrumb {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--brand-500); }

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: clamp(22px, 5.6vw, 30px); color: var(--ink); }
.page-head .lede { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; }

/* 기준 시점 · 출처 배지 줄 */
.basis-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.basis-bar .badge { white-space: normal; text-align: left; }

/* ============================ 계산기 레이아웃 =========================== */

.calc-layout { display: grid; gap: 14px; }

.calc-form-card { min-width: 0; }
.calc-result-col { min-width: 0; }

/* 폼 */
.fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.fieldset + .fieldset { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.fieldset > legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-700);
}

.fieldset .group-note { margin: -6px 0 12px; font-size: 13px; color: var(--ink-3); }

/* 상세 설정 — 몰라도 되는 항목은 접어 둡니다 */
.adv-group {
  margin-top: 20px;
  padding: 0;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.adv-group + .adv-group { margin-top: 10px; }

.adv-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}
.adv-group > summary::-webkit-details-marker { display: none; }
.adv-group > summary::before { content: "⚙"; margin-right: 2px; color: var(--ink-3); }
.adv-group > summary::after { content: "펼치기"; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--brand-500); }
.adv-group[open] > summary::after { content: "접기"; }

.adv-group .adv-title { font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.adv-group .adv-hint { font-size: 12.5px; color: var(--ink-3); }

.adv-body { padding: 4px 14px 16px; border-top: 1px dashed var(--line-strong); background: var(--surface); }
.adv-body .field-grid { padding-top: 12px; }

.field-grid { display: grid; gap: 16px; }

.field { min-width: 0; }
.field[hidden] { display: none; }

.field > label,
.field > .field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.field .req { color: var(--bad-ink); }

.with-unit { position: relative; display: flex; align-items: stretch; }
.with-unit .input { text-align: right; padding-right: 62px; }

.with-unit .unit {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
}

.field .hint { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.field .live { display: block; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--brand-600); min-height: 1em; }
.field .err { display: none; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--bad-ink); }

.field.invalid .input,
.field.invalid .select { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.field.invalid .err { display: block; }

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.calc-actions .btn { flex: 1 1 auto; }
.calc-actions .spacer { display: none; }

/* =============================== 결과 ================================== */

.result[hidden] { display: none; }

.result-hero {
  padding: 20px 18px;
  border: 1px solid var(--brand-100);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--brand-50) 0%, #ffffff 100%);
}

.result-hero .label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-600);
}

.result-hero .value {
  display: block;
  margin-top: 4px;
  font-size: clamp(30px, 8.4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--brand-700);
}

.result-hero .sub { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-2); }

/* 수치 타일 */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stat {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.stat .label { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.stat .value {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -.01em;
}
.stat .sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }

/* 상태는 왼쪽 띠 + 보조문구 색으로만. 값 자체는 본문 잉크를 유지합니다. */
.stat.hi { border-left-color: var(--brand); background: var(--brand-50); }
.stat.hi .sub { color: var(--brand-600); }
.stat.good { border-left-color: var(--good); }
.stat.good .sub { color: var(--good-ink); }
.stat.bad { border-left-color: var(--bad); }
.stat.bad .sub { color: var(--bad-ink); }

/* 비율 막대(meter) — 트랙은 같은 램프의 밝은 단계 */
.meters { margin-top: 14px; display: grid; gap: 10px; }

.meter-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.meter-row .m-label { font-size: 13.5px; color: var(--ink-2); }
.meter-row .m-value { font-size: 14px; font-weight: 700; color: var(--ink); }

.meter-track {
  grid-column: 1 / -1;
  display: block;
  height: 12px;
  border-radius: 3px;
  background: var(--series-1-track);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 0 4px 4px 0;   /* 데이터 끝만 둥글게, 기준선 쪽은 각지게 */
  background: var(--series-1);
}

.meter-row.s2 .meter-track { background: var(--series-2-track); }
.meter-row.s2 .meter-fill { background: var(--series-2); }

/* 계산 근거 */
.basis {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}

.basis > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--brand-600);
  list-style: none;
  background: var(--surface-2);
}
.basis > summary::-webkit-details-marker { display: none; }
.basis > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--ink-3);
  transition: transform .15s;
}
.basis[open] > summary::after { transform: rotate(180deg); }

.basis-body { padding: 14px; border-top: 1px solid var(--line); }
.basis-body > * + * { margin-top: 12px; }

.formula {
  display: block;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border-left: 3px solid var(--brand-200);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-x: auto;
}

.source-list { list-style: none; font-size: 13.5px; }
.source-list li { display: flex; gap: 7px; padding: 3px 0; color: var(--ink-2); }
.source-list li::before { content: "↗"; color: var(--ink-3); }

/* 표 */
.table-block { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.table-block > h3 { padding: 12px 14px; font-size: 14.5px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table-scroll { overflow-x: auto; max-height: 380px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}
table.data th:first-child, table.data td:first-child { text-align: left; font-weight: 500; }
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }

/* 주의사항 */
.notes {
  margin-top: 14px;
  padding: 14px 16px 14px 18px;
  border: 1px solid #f0e3c2;
  border-left: 3px solid var(--warn);
  border-radius: var(--r-sm);
  background: var(--warn-bg);
  list-style: none;
  font-size: 13.5px;
  line-height: 1.65;
  color: #5b4a1e;
}
.notes li + li { margin-top: 7px; }
.notes li { position: relative; padding-left: 14px; }
.notes li::before { content: "•"; position: absolute; left: 0; color: var(--warn-ink); }

/* 모바일 스티키 요약 바 */
.sticky-summary {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, .08);
  transform: translateY(110%);
  transition: transform .2s ease;
}
.sticky-summary.is-visible { transform: translateY(0); }
.sticky-summary[hidden] { display: none; }
.sticky-summary .s-label { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.sticky-summary .s-value {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: var(--brand-700);
  line-height: 1.25;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sticky-summary > div:first-child { min-width: 0; flex: 1 1 auto; }

/* ============================== 본문 아티클 ============================= */

.article { margin-top: 28px; }
.article > section, .article > .article-inner { max-width: 72ch; }
.article h2 {
  margin: 30px 0 10px;
  padding-bottom: 8px;
  font-size: 19px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 22px 0 8px; font-size: 16px; color: var(--brand-700); }
.article p { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 20px; }
.article li { margin-bottom: 6px; color: var(--ink-2); font-size: 15.5px; }
.article strong { color: var(--ink); font-weight: 700; }
.article code {
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13.5px;
}
.article .formula { margin: 10px 0 16px; }

.article .table-wrap { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.article table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 14px; }
.article table th, .article table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article table thead th { background: var(--surface-2); font-weight: 700; color: var(--ink); white-space: nowrap; }
.article table tbody tr:last-child td { border-bottom: 0; }

.faq { margin: 0 0 16px; display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.faq summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; margin-left: auto; color: var(--ink-3); font-weight: 400; }
.faq details[open] summary::after { content: "－"; }
.faq .answer { padding: 0 14px 14px; font-size: 15px; color: var(--ink-2); }

.disclaimer {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--ink-2);
}

/* ============================== 홈 목록 ================================ */

.cat-block { margin-bottom: 26px; }
.cat-block > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--ink);
}

/* 상단 강조 블록 — 검색 수요가 높은 주제 */
.hot-block {
  margin-bottom: 28px;
  padding: 16px 14px 18px;
  border: 1px solid var(--brand-100);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--brand-50) 0%, var(--page) 100%);
}
.hot-block > h2 { margin: 0; font-size: 18px; color: var(--brand-700); }
.hot-block > .hot-note { margin: 2px 0 12px; font-size: 13px; color: var(--ink-3); }
.hot-block .app-card { border-color: var(--brand-100); }

.app-grid { display: grid; gap: 10px; }

.app-card {
  display: flex;
  gap: 12px;
  padding: 15px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.app-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-2); text-decoration: none; }
.app-card:active { transform: translateY(1px); }

.app-card .ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand-50);
  font-size: 21px;
}
.app-card .body { flex: 1 1 auto; min-width: 0; }

/* ① 내 상황 — 가장 먼저 눈에 들어와야 하는 줄 */
.app-card .hook {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.015em;
  color: var(--ink);
  word-break: keep-all;
}
/* ② 계산기 이름 + 검색어 별칭 */
.app-card .t {
  display: block;
  margin-top: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-600);
}
.app-card .aka { font-weight: 500; color: var(--ink-3); }
/* ③ 무엇을 계산하는지 */
.app-card .d {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
  word-break: keep-all;
}

/* 강조 배지 */
.app-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: -.01em;
}
.tag-hot { background: #fdeee7; color: #a63c14; }
.tag-pick { background: var(--brand-50); color: var(--brand-600); }
.tag-new { background: var(--good-bg); color: var(--good-ink); }

.drawer-hot { margin-left: auto; font-size: 13px; }

/* =============================== 푸터 ================================== */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 14px 40px;
}

.footer-nav { display: grid; gap: 18px; margin-bottom: 20px; }
.footer-nav h3 { font-size: 13px; color: var(--ink-3); letter-spacing: .03em; margin-bottom: 8px; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 6px; }
.footer-nav a { color: var(--ink-2); font-size: 14.5px; }

.footer-note { font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.footer-note strong { color: var(--ink-2); }
.footer-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.noscript-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #f0e3c2;
  border-radius: var(--r-sm);
  background: var(--warn-bg);
  font-size: 14.5px;
  color: #5b4a1e;
}

/* ============================== 넓은 화면 ============================== */

@media (min-width: 600px) {
  .wrap, #page-content { padding: 24px 20px 48px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid .field.wide { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-actions .btn { flex: 0 0 auto; }
  .calc-actions .spacer { display: block; flex: 1 1 auto; }
  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  :root { --header-h: 62px; }
  .menu-btn { display: none; }
  .cat-bar { display: none; }

  .header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .header-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }
  .header-nav a:hover { background: var(--surface-3); text-decoration: none; }
  .header-nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-600); }

  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sticky-summary { display: none; }
}

@media (min-width: 1024px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 20px; align-items: start; }
  .calc-result-col { position: sticky; top: calc(var(--header-h) + 20px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head .lede { font-size: 16.5px; }
}

/* =============================== 인쇄 ================================== */

@media print {
  .site-header, .drawer, .drawer-scrim, .sticky-summary, .calc-actions,
  .site-footer .footer-nav, .skip-link, .menu-btn { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .wrap { padding: 0; max-width: none; }
  .calc-layout { display: block; }
  .calc-result-col { position: static; margin-top: 16px; }
  .card, .result-hero, .table-block, .basis { box-shadow: none; break-inside: avoid; }
  .basis[open] .basis-body { display: block; }
  .table-scroll { max-height: none; overflow: visible; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; color: #666; }
}
