/* 생활 계산기 사이트 스타일 */
:root {
  --ink: #1B1F24;
  --ink-2: #3B4148;
  --muted: #5F6873;
  --line: #E3E6EA;
  --line-2: #CDD2D8;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --accent: #0E7C72;
  --accent-ink: #0B5F57;
  --accent-soft: #EEF7F6;
  --accent-line: #9CCFC9;
  --dark: #1E2227;
  --dark-2: #2A3037;
  --dark-3: #343B44;
  --dark-line: #3A424B;
  --dark-ink: #F1F3F5;
  --dark-muted: #A3ABB4;
  --warn-bg: #FFF4E5;
  --warn-ink: #8A4B00;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--ink-2); }
a:hover { color: var(--accent); }
button, input { font-family: inherit; font-size: inherit; }
:focus-visible { outline: 3px solid #4C9BE8; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* 머리말 */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-in { max-width: 1440px; margin: 0 auto; height: 72px; padding: 0 clamp(16px, 6vw, 120px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 20px; letter-spacing: -0.3px; }
.nav { display: flex; gap: 32px; font-size: 15px; font-weight: 500; }
.nav a { text-decoration: none; }
.menu-btn { display: none; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--dark); color: #fff; font-size: 14px; font-weight: 500; align-items: center; gap: 6px; cursor: pointer; }

/* 본문 */
.wrap { max-width: 1440px; margin: 0 auto; padding: 32px clamp(16px, 6vw, 120px) 48px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.intro .kicker { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.intro p { margin: 4px 0 0; color: var(--muted); }
.intro .stamp { font-size: 14px; color: var(--muted); margin: 0; }
.layout { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 24px; align-items: start; }

/* 선택 박스 */
.selector { background: var(--dark); color: var(--dark-ink); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }
.sel-search label { display: block; font-size: 13px; color: var(--dark-muted); margin-bottom: 8px; }
.search-wrap { position: relative; }
.search-wrap .i-search { position: absolute; left: 14px; top: 14px; color: var(--dark-muted); }
#calc-search { width: 100%; height: 48px; padding: 0 14px 0 44px; background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 10px; color: var(--dark-ink); font-size: 15px; }
#calc-search::placeholder { color: #8A929B; }
.sel-body { display: flex; gap: 16px; min-height: 360px; }
.cats { width: 148px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
.cat { height: 44px; padding: 0 14px; border: 0; border-radius: 8px; text-align: left; background: transparent; color: #B7BEC6; font-size: 15px; cursor: pointer; }
.cat:hover { background: var(--dark-2); color: #fff; }
.cat.on { background: var(--dark-3); color: #fff; font-weight: 600; }
.sel-divider { width: 1px; background: var(--dark-3); flex-shrink: 0; }
.items-col { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid-title { font-size: 13px; color: var(--dark-muted); }
.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.calc-btn { min-height: 52px; padding: 6px 12px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; text-decoration: none; font-size: 15px; font-weight: 500; background: var(--dark-2); color: var(--dark-ink); border: 1px solid var(--dark-line); }
a.calc-btn:hover { border-color: #6B747E; color: #fff; }
.calc-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.calc-btn.later { background: transparent; color: #9AA2AB; border: 1px dashed #4A525C; cursor: default; font-weight: 400; font-size: 14px; flex-direction: column; gap: 2px; }
.calc-btn.later .badge { background: transparent; padding: 0; }
.badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--dark-2); color: var(--dark-muted); white-space: nowrap; }
.empty { grid-column: 1 / -1; margin: 4px 0 0; font-size: 14px; color: var(--dark-muted); }
.sel-foot { border-top: 1px solid var(--dark-3); padding-top: 16px; font-size: 13px; color: var(--dark-muted); }
.menu-close { display: none; }

/* 계산 창 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crumb { font-size: 14px; color: var(--muted); }
.fav { height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fav.on { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.fav.on svg { fill: currentColor; }
.panel-head h1 { margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.3; }
.panel-head p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.6; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.span2 { grid-column: 1 / -1; }
.field.hidden { display: none; }
.field label, .field .label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.opt { font-weight: 400; color: var(--muted); }
.help { margin: 0; font-size: 13px; color: var(--muted); }
.input-wrap { position: relative; }
.field input[type="text"], .field input[type="date"] { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 16px; color: var(--ink); background: #fff; }
.input-wrap input { padding-right: 52px !important; }
.unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--muted); pointer-events: none; }
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(14, 124, 114, 0.18); }
.seg { display: flex; gap: 6px; padding: 4px; background: #F0F2F4; border-radius: 10px; }
.seg button { flex: 1; min-height: 40px; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--accent-ink); border-color: var(--accent-line); font-weight: 600; }
.seg { flex-wrap: wrap; }
.seg button { min-width: 72px; }
.stepper { display: flex; align-items: center; gap: 0; }
.stepper button { width: 48px; height: 48px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.stepper button:first-child { border-radius: 10px 0 0 10px; }
.stepper button:nth-of-type(2) { border-radius: 0 10px 10px 0; }
.stepper button:hover { background: #F0F2F4; }
.field .stepper input[type="text"] { width: 64px; height: 48px; border-radius: 0; border-left: 0; border-right: 0; text-align: center; padding: 0; }
.step-unit { margin-left: 10px; color: var(--muted); font-size: 15px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.quick button { height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink-2); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.quick button:hover { border-color: var(--accent); color: var(--accent-ink); }
.quick .quick-clear { color: var(--muted); }
.result-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -8px; }
.result-actions button { height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.result-actions button:disabled { color: #9AA2AB; cursor: default; background: #F7F8F9; }
.copy-msg { font-size: 13px; color: var(--accent-ink); }
.table-wrap.plain { max-height: none; }
.table-wrap tbody th, .table-wrap tbody th:first-child { font-weight: 500; text-align: left; color: var(--ink-2); background: #fff; position: static; }
.table-wrap tr.sum td, .table-wrap tr.sum th { font-weight: 700; color: var(--ink); background: #F7F8F9; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.go { width: 100%; height: 52px; margin-top: 4px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; }
.go:hover { background: var(--accent-ink); }
.calc-form { display: flex; flex-direction: column; gap: 16px; }

/* 결과 */
.result { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.result-main { display: flex; flex-direction: column; gap: 2px; }
.result-label { font-size: 14px; font-weight: 500; color: var(--accent-ink); }
.result-value { font-size: 32px; font-weight: 700; color: var(--accent-ink); letter-spacing: -0.5px; line-height: 1.3; word-break: keep-all; }
.result-hint { margin: 0; font-size: 14px; color: var(--ink-2); }
.result-rows { margin: 0; display: grid; gap: 8px; border-top: 1px solid var(--accent-line); padding-top: 12px; }
.result-rows div { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.result-rows dt { color: var(--ink-2); }
.result-rows dd { margin: 0; font-weight: 600; text-align: right; }
.warn { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.note { margin: 0; font-size: 13px; color: var(--ink-2); }
.note::before { content: '· '; }
.schedule summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-ink); padding: 4px 0; }
.table-wrap { overflow-x: auto; max-height: 360px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.table-wrap th { position: sticky; top: 0; background: #F7F8F9; color: var(--ink-2); font-weight: 600; }
.table-wrap td:first-child, .table-wrap th:first-child { text-align: center; }

.basis { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.6; }
.basis svg { flex-shrink: 0; margin-top: 2px; }
.basis strong { color: var(--ink-2); }
.related { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.related-title { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.related-list { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 18px; background: #fff; color: var(--ink-2); font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; }
.chip:hover { border-color: var(--accent); }

/* 홈 */
.home-title { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.home-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; }
.home-card:hover { border-color: var(--accent); }
.home-card strong { font-size: 16px; }
.home-card span { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* 하단 설명·광고 */
.below { display: flex; gap: 24px; margin-top: 24px; align-items: flex-start; }
.below .guide { flex: 1; min-width: 0; }
.ad-side { width: 336px; flex-shrink: 0; }
.ad-side:has(.ad-slot:empty) { display: none; }
.guide { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.guide h2 { margin: 0 0 14px; font-size: 20px; }
.guide h2 + * { margin-top: 0; }
.steps { margin: 0 0 28px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); line-height: 1.6; }
.faq { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.faq dt { font-weight: 600; margin-top: 10px; }
.faq dd { margin: 0; color: var(--ink-2); line-height: 1.6; }
.ad-slot:empty { display: none; }

/* 문서 페이지 (요율 기준, 개인정보처리방침) */
.doc { max-width: 880px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; }
.doc h1 { margin: 0 0 12px; font-size: 28px; }
.doc h2 { margin: 32px 0 10px; font-size: 19px; }
.doc p, .doc li { color: var(--ink-2); line-height: 1.7; }
table.rates { white-space: normal; }
.table-wrap table.rates td, .table-wrap table.rates th { text-align: left; white-space: normal; font-size: 14px; vertical-align: top; }
.table-wrap table.rates td:nth-child(2), .table-wrap table.rates td:nth-child(3) { white-space: nowrap; }
.doc .table-wrap { max-height: none; }
.muted { color: var(--muted); font-size: 14px; }

/* 문의하기 */
.contact-box { margin: 24px 0 8px; padding: 24px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.contact-label { font-size: 14px; color: var(--accent-ink); font-weight: 500; }
.contact-email { font-size: 24px; color: var(--ink); word-break: break-all; user-select: all; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.copy-email { height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.copy-email:hover { background: var(--accent-ink); }
.mail-link { height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; display: inline-flex; align-items: center; text-decoration: none; font-size: 15px; }

/* 꼬리말 */
.site-footer { border-top: 1px solid var(--line); background: var(--card); }
.footer-in { max-width: 1440px; margin: 0 auto; padding: 24px clamp(16px, 6vw, 120px); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-in nav { display: flex; gap: 16px; }

/* 태블릿·모바일 */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 480px minmax(0, 1fr); }
  .below { flex-direction: column; align-items: stretch; }
  .ad-side { width: auto; }
}
@media (max-width: 959px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .header-in { height: 60px; }
  .logo { font-size: 17px; }
  .wrap { padding-top: 20px; }
  .intro { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .selector { display: none; position: fixed; inset: 0; z-index: 50; border-radius: 0; overflow-y: auto; padding: 0 16px 24px; gap: 20px; }
  body.menu-open { overflow: hidden; }
  body.menu-open .selector { display: flex; }
  .menu-close { display: flex; align-items: center; justify-content: space-between; height: 60px; margin: 0 -16px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--dark-3); font-weight: 700; font-size: 17px; }
  .menu-close button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--dark-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .sel-body { flex-direction: column; min-height: 0; }
  .cats { width: auto; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .cat { height: 40px; border-radius: 20px; border: 1px solid var(--dark-line); padding: 0 14px; font-size: 14px; }
  .cat.on { background: #fff; color: var(--dark); border-color: #fff; }
  .sel-divider { display: none; }
  .calc-btn { min-height: 56px; }
  .panel { padding: 20px; gap: 20px; border-radius: 14px; }
  .panel-head h1 { font-size: 24px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .result { padding: 18px 20px; }
  .result-value { font-size: 28px; }
  .home-cards { grid-template-columns: minmax(0, 1fr); }
  .guide { padding: 20px; }
  .doc { padding: 24px 20px; }
}

/* 내용이 짧은 페이지에서도 꼬리말을 화면 아래에 붙임 */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main.wrap { flex: 1 0 auto; width: 100%; }
