/* ==========================================================================
   내일집 청년주거 — DREXLY 템플릿
   색·활자·간격은 32번 묶음 00-디자인보드.png 를 그대로 옮겼다
   (Civic Blue #2563EB / Deep Blue #1E40AF / Lilac #8B5CF6 / Lavender #EDE9FE
    / Sky #EFF6FF / Neutral #111827 · Pretendard · 8px 격자).
   상태는 색만으로 전하지 않는다 — 배지에 아이콘과 글자를 함께 둔다.
   ========================================================================== */

:root {
  /* 색 — 디자인보드 팔레트 */
  --blue: #2563eb;
  --blue-deep: #1e40af;
  --blue-press: #1b3a9c;
  --lilac: #8b5cf6;
  --lilac-ink: #6d28d9;
  --lavender: #ede9fe;
  --sky: #eff6ff;
  --ink: #111827;
  --ink2: #4b5563;
  --muted: #626b79;
  --line: #e2e6ef;
  --line-soft: #eef1f7;
  --paper: #ffffff;
  --canvas: #f7f8fc;

  /* 의미색 — 디자인보드 「상태」 칸 */
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #9a3412;
  --warn-bg: #ffedd5;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --off: #374151;
  --off-bg: #f3f4f6;
  --err: #b91c1c;
  --err-bg: #fee2e2;

  /* 글꼴 — 디자인보드는 Pretendard 한 가족만 지정한다 */
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  /* 조판 — 8px 격자 */
  --wrap: 1240px;
  --gutter: 40px;
  --section: 96px;
  --r: 8px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --ease: cubic-bezier(0.22, 0.7, 0.28, 1);
}

/* ------------------------------------------------------------------ 기본 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  /* 한국어는 어절 단위로 끊는다 — 「2층」·「무주택」이 갈라지지 않게 */
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; letter-spacing: -0.022em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
b, strong { font-weight: 700; }
time { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--blue-deep); color: #fff; padding: 12px 20px; font-size: 15px; font-weight: 600;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.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;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ico-sm { width: 16px; height: 16px; stroke-width: 1.8; }
.ico-xs { width: 14px; height: 14px; stroke-width: 2; }

/* ------------------------------------------------------------- 활자 계층 */
h1 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.28; letter-spacing: -0.03em; }
.section-title { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.34; letter-spacing: -0.028em; }
.section-title.sm { font-size: clamp(20px, 1.9vw, 24px); }
.lead { color: var(--ink2); font-size: 17px; line-height: 1.72; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em; color: var(--blue-deep);
  background: var(--sky); border-radius: var(--r-pill); padding: 6px 14px;
}
.eyebrow-light { color: #fff; background: rgba(255, 255, 255, 0.18); }

.section { padding-block: calc(var(--section) / 2); }
.section-lead { padding-top: var(--section); }
.section-tint { background: var(--canvas); }
.section-head { max-width: 760px; margin-bottom: 32px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head p { margin-top: 12px; color: var(--ink2); }
.section-head-row {
  max-width: none; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.section-head-row > div { max-width: 720px; }

.note-line {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 20px;
  font-size: 14px; color: var(--ink2); line-height: 1.6;
}
.note-line .ico { color: var(--blue); margin-top: 3px; }
.note-line a { color: var(--blue-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.stamp {
  display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 20px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); font-size: 14px; color: var(--ink2); line-height: 1.6;
}
.stamp span { min-width: 0; }
.stamp .ico { color: var(--blue); margin-top: 3px; }

.crumb { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumb a { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- 버튼 */
.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid var(--bd); border-radius: var(--r); background: var(--bg); color: var(--fg);
  font-size: 15px; font-weight: 700; letter-spacing: -0.015em; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn span[aria-hidden] { transition: transform 0.2s var(--ease); }
.btn:hover span[aria-hidden] { transform: translateX(3px); }
.btn-primary { --bg: var(--blue); --fg: #fff; --bd: var(--blue); }
.btn-primary:hover { --bg: var(--blue-deep); --bd: var(--blue-deep); }
.btn-secondary { --bg: var(--paper); --fg: var(--blue-deep); --bd: #c7d7fb; }
.btn-secondary:hover { --bg: var(--sky); --bd: var(--blue); }
.btn-ghost { --bg: var(--paper); --fg: var(--ink2); --bd: var(--line); }
.btn-ghost:hover { --fg: var(--blue-deep); --bd: #c7d7fb; }
.btn-on-blue { --bg: #fff; --fg: var(--blue-deep); --bd: #fff; }
.btn-on-blue:hover { --bg: var(--lavender); --bd: var(--lavender); }
.btn-lg { min-height: 56px; font-size: 16px; padding: 0 28px; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.is-off { --bg: var(--off-bg); --fg: var(--off); --bd: var(--line); cursor: not-allowed; }
.btn[aria-disabled="true"] { pointer-events: none; }

.btn-text {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--blue-deep); font-size: 14px; font-weight: 700;
}
.btn-text:hover { text-decoration: underline; text-underline-offset: 4px; }

.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 14px; color: var(--ink2); background: var(--paper);
}
.chip:hover { border-color: var(--blue); color: var(--blue-deep); background: var(--sky); }

/* 상태 배지 — 색 + 아이콘 + 글자를 함께 쓴다 (디자인보드 「상태」 규칙) */
.st {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.st-open { color: var(--ok); background: var(--ok-bg); }
.st-soon-close { color: var(--warn); background: var(--warn-bg); }
.st-upcoming { color: var(--info); background: var(--info-bg); }
.st-closed { color: var(--off); background: var(--off-bg); }
.st-standby { color: var(--lilac-ink); background: var(--lavender); }

.tag {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 13px; color: var(--ink2); background: var(--paper);
}

/* --------------------------------------------------------------- 헤더 */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  background: var(--blue); color: #fff; border-radius: 10px;
}
.brand-text { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.brand-text small { display: block; font-size: 12px; font-weight: 700; color: var(--blue-deep); letter-spacing: -0.01em; }

.navlinks { display: flex; gap: 4px; margin-right: auto; }
.navlinks a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: var(--r); font-size: 15px; font-weight: 600; color: var(--ink2);
}
.navlinks a:hover { background: var(--sky); color: var(--blue-deep); }
.navlinks a[aria-current="page"] { color: var(--blue-deep); background: var(--sky); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-asof {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.nav-asof:hover { color: var(--blue-deep); }
.menu-btn {
  display: none; width: 46px; height: 46px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); cursor: pointer;
}

/* 모바일 서랍 */
.scrim {
  position: fixed; inset: 0; z-index: 100; background: rgba(17, 24, 39, 0.45);
  opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.scrim.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
  width: min(340px, 88vw); background: var(--paper);
  border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(17, 24, 39, 0.12);
  transform: translateX(101%); transition: transform 0.28s var(--ease);
  display: flex; flex-direction: column; padding: 16px 20px 28px; overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.drawer-close {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); cursor: pointer;
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px;
  border-radius: var(--r); font-size: 16px; font-weight: 600; color: var(--ink);
}
.drawer-nav a .ico { color: var(--muted); }
.drawer-nav a[aria-current="page"] { background: var(--sky); color: var(--blue-deep); }
.drawer-nav a[aria-current="page"] .ico { color: var(--blue); }
.drawer-extra { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }
.drawer-note { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* 모바일 하단 탭바 */
.tabbar { display: none; }

/* --------------------------------------------------------------- 히어로 */
.hero {
  background: linear-gradient(160deg, var(--sky) 0%, #f6f4ff 52%, var(--paper) 100%);
  border-bottom: 1px solid var(--line-soft);
  padding-block: 56px 64px;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr); gap: 48px; align-items: center; }
.hero-copy h1 { margin: 18px 0 16px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.quick-grid a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.quick-grid a:hover { border-color: var(--blue); transform: translateY(-2px); }
.quick-ico {
  width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 4px;
  border-radius: 12px; background: var(--lavender); color: var(--lilac-ink);
}
.quick-grid strong { font-size: 16px; letter-spacing: -0.02em; }
.quick-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

.hero-map { margin: 0; }
.map-svg {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: #eef1f7;
}
.hero-map figcaption, .map-box figcaption {
  display: flex; gap: 6px; align-items: flex-start;
  margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.55;
}
.hero-map figcaption a { color: var(--blue-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.map-box figcaption .ico { color: var(--blue); margin-top: 3px; flex: none; }

.pin-body { fill: #7c3aed; stroke: #fff; stroke-width: 2.5; }
.pin-num { fill: #fff; font-size: 15px; font-weight: 700; font-family: var(--sans); }
.map-pin { cursor: pointer; }
.map-pin:hover .pin-body, .map-pin:focus-visible .pin-body { fill: var(--blue); }
.map-pin.is-on .pin-body { fill: var(--blue-deep); }
.map-pin:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.map-sub circle { stroke: #fff; stroke-width: 2.5; }

/* --------------------------------------------------------- 페이지 히어로 */
.page-hero {
  background: linear-gradient(150deg, var(--sky) 0%, #f5f3ff 100%);
  border-bottom: 1px solid var(--line-soft); padding-block: 40px 52px;
}
.page-hero h1 { margin: 16px 0 14px; }
.page-hero-sm { padding-block: 36px 44px; }

/* --------------------------------------------------------------- 검색 */
.search-band { padding-top: 40px; }
.search-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 24px;
}
.search-tabs { position: relative; display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.stab {
  min-height: 48px; padding: 0 16px; border: 0; background: none; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent;
}
.stab.is-on { color: var(--blue-deep); border-bottom-color: var(--blue); }
.search-row { display: flex; gap: 10px; }
.search-input {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  border: 1.5px solid var(--line); border-radius: var(--r); padding: 0 16px; background: var(--canvas);
}
.search-input .ico { color: var(--muted); flex: none; }
.search-input input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: inherit; height: 52px; color: var(--ink);
}
.search-input:focus-within { border-color: var(--blue); background: var(--paper); }
.search-card.invalid .search-input { border-color: var(--err); background: #fff5f5; }
.field-msg { margin-top: 10px; font-size: 14px; color: var(--err); font-weight: 600; }
.search-go { margin-top: 14px; }
.search-hot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hot-label { font-size: 13px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------------ 카드·요약 */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; background: var(--sky); border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 18px; }
.card-sub { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.dash-side { display: grid; gap: 24px; }

.sum-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; padding: 24px; }
.req-list { display: grid; gap: 20px; }
.req-list li { display: flex; gap: 12px; }
.req-ico {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--sky); color: var(--blue-deep);
}
.req-t { font-size: 15px; font-weight: 700; }
.req-d { font-size: 14px; color: var(--ink2); line-height: 1.6; }
.req-note { font-size: 13px; color: var(--muted); }
.ok {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 4px;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--ok-bg); color: var(--ok); font-size: 12px; font-weight: 700;
}
.no { background: var(--err-bg); color: var(--err); }

.sum-count {
  display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center;
  padding: 22px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--canvas);
}
.sum-label { font-size: 14px; color: var(--ink2); font-weight: 600; }
.sum-num { font-size: 20px; font-weight: 700; color: var(--ink2); margin-bottom: 6px; }
.sum-num strong { font-size: 46px; color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.sum-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

.notice-list { padding: 8px 24px 20px; }
.notice-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.notice-list li:last-child { border-bottom: 0; }
.notice-list a {
  flex: 1; min-width: 0; display: block; padding: 14px 0; font-size: 15px; color: var(--ink);
}
.notice-list a:hover { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.notice-list time { font-size: 13px; color: var(--muted); flex: none; }

.card-tip { padding: 22px 24px; background: var(--lavender); border-color: #ddd6fe; }
.tip-h { display: flex; align-items: center; gap: 7px; font-size: 16px; color: var(--lilac-ink); margin-bottom: 8px; }
.card-tip p { font-size: 14px; color: #3b3355; line-height: 1.65; }
.card-tip .btn-text { color: var(--lilac-ink); }

/* ------------------------------------------------------------ 워터폴 */
.wf {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 24px 8px;
}
.wf-track {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
  align-items: end; height: 260px; padding-bottom: 4px;
}
.wf-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.wf-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 8px; color: var(--ink2); }
/* 워터폴 — 각 항목이 앞선 합계 위에 떠서 쌓인다(--b 는 앞선 합계, --h 는 그 항목) */
.wf-bar { position: relative; display: block; flex: 1; min-height: 0; }
.wf-fill {
  position: absolute; left: 0; right: 0; bottom: var(--b, 0%); height: var(--h);
  min-height: 10px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #93b4fb, var(--blue));
}
.wf-fill::after {
  content: ""; position: absolute; top: 0; left: 100%; width: 12px;
  border-top: 1.5px dashed #9db4d8;
}
.wf-col:last-child .wf-fill::after { display: none; }
.wf-add .wf-fill { background: linear-gradient(180deg, #c4b5fd, var(--lilac)); }
.wf-total .wf-fill { background: linear-gradient(180deg, #3b82f6, var(--blue-deep)); }
.wf-total .wf-val { color: var(--blue-deep); font-size: 17px; }
.wf-label { margin-top: 10px; font-size: 13px; color: var(--ink2); font-weight: 600; }
.wf-total .wf-label { color: var(--blue-deep); font-weight: 700; }

/* 시그니처 연출 — 막대가 아래에서 자라 오른다. 위치를 직접 재서 켠다. */
.js .wf-fill { height: 0; min-height: 0; transition: height 0.85s var(--ease); }
.js .wf.in .wf-fill { height: var(--h); min-height: 10px; }
.js .wf-track .wf-col:nth-child(2) .wf-fill { transition-delay: 0.08s; }
.js .wf-track .wf-col:nth-child(3) .wf-fill { transition-delay: 0.16s; }
.js .wf-track .wf-col:nth-child(4) .wf-fill { transition-delay: 0.24s; }
.js .wf-track .wf-col:nth-child(5) .wf-fill { transition-delay: 0.32s; }
.js .wf-track .wf-col:nth-child(6) .wf-fill { transition-delay: 0.42s; }

.wf-table { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: 14px; }
.wf-table caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 10px; }
.wf-table th, .wf-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.wf-table thead th { font-size: 13px; color: var(--muted); background: var(--canvas); }
.wf-table tbody th { font-weight: 600; }
.wf-table td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.wf-sum th, .wf-sum td { background: var(--sky); color: var(--blue-deep); font-weight: 700; border-bottom: 0; }

/* --------------------------------------------------------------- 표 */
/* overflow-x 상자는 반드시 position:relative — 아니면 320px 에서 문서 전체가 밀린다 */
.table-scroll {
  position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper);
}
.table-scroll + .table-scroll { margin-top: 20px; }
.grid-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14.5px; }
.grid-table caption {
  text-align: left; padding: 16px 20px; font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--line-soft); background: var(--canvas);
}
.grid-table th, .grid-table td {
  padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.grid-table thead th { font-size: 13px; font-weight: 700; color: var(--ink2); background: var(--canvas); white-space: nowrap; }
.grid-table tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.grid-table tbody tr:last-child th, .grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table tbody tr:hover td, .grid-table tbody tr:hover th { background: var(--sky); }

/* 쉬운말 / 원문 토글 */
.lang-toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-pill); }
.ltab {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill);
  background: none; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink2);
}
.ltab.is-on { background: var(--blue); color: #fff; }
.official { display: none; }
.mode-official .plain { display: none; }
.mode-official .official { display: inline; }

/* --------------------------------------------------------- 가이드 배너 */
.section-guide { padding-block: 0; }
.guide-band {
  display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 40px; align-items: center;
  background: linear-gradient(115deg, var(--blue-deep) 0%, #4338ca 55%, #6d28d9 100%);
  color: #fff; border-radius: var(--r-lg); padding: 44px 40px; margin-bottom: 48px;
}
.guide-title { color: #fff; margin: 14px 0 24px; }
.stepper { display: grid; gap: 14px; margin-bottom: 28px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-n {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: rgba(15, 23, 42, 0.38); color: #fff; font-size: 14px; font-weight: 700;
}
.step.is-done .step-n, .step.is-now .step-n { background: #fff; color: var(--blue-deep); }
.step-t { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); background: rgba(15, 23, 42, 0.38); }
.step-d { font-size: 14px; color: rgba(255, 255, 255, 0.92); line-height: 1.6; }
.guide-media { margin: 0; }
.guide-media img { border-radius: var(--r); width: 100%; height: auto; }
.guide-media figcaption { margin-top: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.88); }

/* ==================================================== 2면 — 자격 확인 */
.elig-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
@supports (reading-flow: source-order) { .elig-grid { reading-flow: source-order; } }

.fs { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin: 0 0 20px; background: var(--paper); }
.fs legend {
  display: flex; align-items: center; gap: 10px; padding: 0 8px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.025em;
}
.fs-n {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 700;
}
.fs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 16px; }
.branch { border-color: #ddd6fe; background: #fbfaff; }
.branch legend .fs-n { background: var(--lilac-ink); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.ctl {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--paper);
  font: inherit; font-size: 15px; color: var(--ink);
}
select.ctl {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6.4 9.6l5.6 5.6 5.6-5.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 40px;
}
.ctl:focus { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.ctl-wrap { display: block; }
.field.invalid .ctl { border-color: var(--err); background: #fff6f6; }
.field.invalid .hint { color: var(--err); font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.55; }

.term {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-block: -12px;
  padding: 0 2px; border: 0; background: none; cursor: pointer;
  color: var(--blue-deep); font-weight: 700; font-size: inherit; text-align: left;
  vertical-align: middle;
}
.term-t { border-bottom: 1.5px dashed var(--blue); }
.term:hover .term-t { border-bottom-style: solid; }
.term:hover { color: var(--blue); }
.pop {
  max-width: 320px; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px; font-size: 14px; color: var(--ink2); line-height: 1.6;
  background: var(--paper);
}
.pop-t { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
#t-nohouse { position-anchor: --a-nohouse; }
#t-income { position-anchor: --a-income; }
@supports (anchor-name: --x) {
  .field:has(#t-nohouse) .term { anchor-name: --a-nohouse; }
  .field:has(#t-income) .term { anchor-name: --a-income; }
  .pop { position: absolute; margin: 0; position-area: bottom span-right; position-try-fallbacks: flip-block, flip-inline; margin-top: 8px; }
}

.agree { display: flex; gap: 10px; align-items: flex-start; padding: 16px 4px 4px; }
.ck { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--blue); cursor: pointer; }
.agree label { font-size: 14px; color: var(--ink2); line-height: 1.6; cursor: pointer; }
.agree.invalid label { color: var(--err); font-weight: 600; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.result { margin-top: 48px; scroll-margin-top: 100px; }
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.result-head h2 { font-size: clamp(21px, 2vw, 26px); }
.result-count { color: var(--blue); font-variant-numeric: tabular-nums; }
.result-tag {
  display: inline-block; margin-right: 6px; padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--lavender); color: var(--lilac-ink); font-size: 13px; font-weight: 700;
  vertical-align: 3px;
}
.result-sub { margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 640px; line-height: 1.6; }
.result-sub strong { color: var(--lilac-ink); }
.disclaim {
  display: flex; gap: 10px; align-items: flex-start; padding: 16px 18px; margin-bottom: 20px;
  border: 1.5px solid #fcd9b6; border-radius: var(--r); background: #fffaf3;
  font-size: 14px; color: #7c3f14; line-height: 1.65;
}
.disclaim .ico { color: var(--warn); margin-top: 3px; flex: none; }

.verdicts { display: grid; gap: 14px; }
.vd { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--paper); }
.vd-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.vd-name { font-size: 17px; font-weight: 700; }
.vd-note { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.vd-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border-radius: var(--r-pill); font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.vd-yes { background: var(--ok-bg); color: var(--ok); }
.vd-check { background: var(--warn-bg); color: var(--warn); }
.vd-no { background: var(--off-bg); color: var(--off); }
.vd-rule { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.vd-reasons { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.vd-reasons li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink2); }
.rs-ico {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok); margin-top: 1px;
}
.rs-ico.bad { background: var(--err-bg); color: var(--err); }
.rs-ico.warn { background: var(--warn-bg); color: var(--warn); }

.standard { margin-top: 52px; }
.standard .section-title { margin-bottom: 10px; }
.std-note { font-size: 14px; color: var(--ink2); margin-bottom: 18px; }

.faq { margin-top: 52px; }
.faq .section-title { margin-bottom: 16px; }

/* 아코디언 */
.accordion { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); }
.acc-item + .acc-item { border-top: 1px solid var(--line-soft); }
.acc-item h3, .acc-item h4 { margin: 0; }
.acc-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 14px 20px; border: 0; background: none; cursor: pointer;
  font-size: 15.5px; font-weight: 700; text-align: left; color: var(--ink);
}
.acc-trigger:hover { background: var(--sky); }
.acc-caret { color: var(--muted); transition: transform 0.24s var(--ease); flex: none; }
.acc-item.open .acc-trigger { color: var(--blue-deep); }
.acc-item.open .acc-caret { transform: rotate(180deg); }
.acc-panel { padding: 0 20px 20px; font-size: 14.5px; color: var(--ink2); line-height: 1.7; }
.js .acc-item:not(.open) .acc-panel { display: none; }
.acc-panel a { color: var(--blue-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.acc-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.bullet { display: grid; gap: 7px; }
.bullet li { position: relative; padding-left: 15px; }
.bullet li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--blue);
}

.elig-side { position: sticky; top: 96px; }
.side-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; background: var(--canvas); }
.side-h { font-size: 16px; margin-bottom: 14px; }
.side-dl { display: grid; gap: 0; margin: 0 0 18px; }
.side-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.side-dl dt { font-size: 13.5px; color: var(--muted); flex: none; }
.side-dl dd { margin: 0; font-size: 14px; font-weight: 700; text-align: right; }
.side-count { text-align: center; padding: 16px 0 18px; }
.side-label { font-size: 13px; color: var(--ink2); }
.side-num { font-size: 17px; font-weight: 700; color: var(--ink2); }
.side-num strong { font-size: 40px; color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.side-note { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.5; text-align: center; }

/* ==================================================== 3면 — 공고 찾기 */
.filters { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); padding: 20px 20px 16px; box-shadow: var(--shadow-sm); }
.filter-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(140px, 1fr)); gap: 14px; }
.ctl-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: var(--r); padding: 0 14px; background: var(--canvas); }
.ctl-search .ico { color: var(--muted); flex: none; }
.ctl-search input { border: 0; background: none; height: 48px; padding: 0; }
.ctl-search input:focus { outline: none; }
.ctl-search:focus-within { border-color: var(--blue); background: var(--paper); }
.filter-foot {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.switch { display: inline-flex; align-items: center; gap: 8px; }
.switch label { font-size: 14px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.filter-count { font-size: 14px; color: var(--ink2); margin-right: auto; }
.filter-count b { color: var(--blue-deep); font-variant-numeric: tabular-nums; font-size: 16px; }
.filter-hint { color: var(--muted); font-size: 13px; margin-left: 6px; }

.ml-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; margin-top: 28px; align-items: start; }
.ml-list { grid-column: 1; grid-row: 1 / span 2; }
.map-box { grid-column: 2; grid-row: 1; }
.detail-stack { grid-column: 2; grid-row: 2; }
/* 초점 순서를 눈에 보이는 순서에 맞춘다 — 모바일에서 지도가 위로 올라온다 */
@supports (reading-flow: grid-order) { .ml-grid { reading-flow: grid-order; } }
.list-h { font-size: 16px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.list-h-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.lc-list { display: grid; gap: 12px; }
.lc { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); overflow: hidden; }
.lc-link { display: flex; gap: 14px; padding: 14px; transition: background 0.18s var(--ease); }
.lc-link:hover { background: var(--sky); }
.lc.is-on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.lc-img { width: 88px; height: 88px; flex: none; border-radius: var(--r); object-fit: cover; background: var(--line-soft); }
.lc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.lc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lc-kind { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lc-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.lc-addr { font-size: 13px; color: var(--muted); }
.lc-price { font-size: 14px; color: var(--ink2); margin-top: 2px; }
.lc-price b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lc-meta { font-size: 13px; color: var(--muted); }
.lc-period { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--blue-deep); font-weight: 600; margin-top: 2px; flex-wrap: wrap; }
.lc-sub { color: var(--muted); font-weight: 600; }
.lc[data-state="closed"] { background: var(--off-bg); }
.lc[data-state="closed"] .lc-img { filter: grayscale(1); opacity: 0.6; }
.lc[data-state="closed"] .lc-name, .lc[data-state="closed"] .lc-price b { color: var(--off); }
.lc[data-state="closed"] .lc-period { color: var(--off); }
.list-empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }

.map-box { margin: 0; }
.detail-stack { display: grid; gap: 16px; }
.detail {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper);
  padding: 22px; scroll-margin-top: 100px;
}
.js .detail:not(.is-active) { display: none; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.detail-kind { font-size: 13px; font-weight: 700; color: var(--blue-deep); }
.detail-head h3 { font-size: clamp(19px, 2vw, 24px); margin: 6px 0 10px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-img { width: 94px; height: 112px; flex: none; border-radius: var(--r); object-fit: cover; background: var(--line-soft); }
.detail-price {
  margin-top: 18px; padding: 14px 16px; border-radius: var(--r); background: var(--sky);
  font-size: 15px; color: var(--ink2); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
}
.detail-price b { color: var(--blue-deep); font-size: 17px; font-variant-numeric: tabular-nums; }
.detail-monthly { font-size: 13px; color: var(--muted); margin-left: auto; }
.detail-dl { display: grid; gap: 0; margin: 18px 0; }
.detail-dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.detail-dl dt { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.detail-dl dd { margin: 0; font-size: 14.5px; }
.dl-strong { font-variant-numeric: tabular-nums; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.detail .accordion { margin-top: 6px; }

/* Custom Highlight API — 검색어 강조 */
::highlight(gongo-hit) { background: #fde68a; color: #78350f; }
.hl-fallback { background: #fde68a; color: #78350f; border-radius: 2px; }

/* ==================================================== 4면 — 비교하기 */
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.tray-n {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: var(--r-pill); background: var(--blue); color: #fff; font-size: 15px; margin-left: 6px;
}
.tray-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tray-tools .btn.is-on { --bg: var(--sky); --fg: var(--blue-deep); --bd: var(--blue); }

.cmp-scroll { background: var(--paper); }
.cmp-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14.5px; }
.cmp-table caption { text-align: left; padding: 16px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-soft); background: var(--canvas); }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.cmp-table tbody th { width: 132px; font-size: 13.5px; font-weight: 700; color: var(--ink2); background: var(--canvas); white-space: nowrap; }
.cmp-table td { font-variant-numeric: tabular-nums; }
.cell-strong { color: var(--blue-deep); font-size: 16px; }
.cell-sub { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.cmp-corner { width: 132px; background: var(--canvas); font-size: 13.5px; color: var(--ink2); }
.cmp-col { vertical-align: top; padding: 16px; min-width: 172px; }
.cmp-card { position: relative; display: flex; flex-direction: column; gap: 6px; }
.cmp-card img {
  width: 100%; max-width: 132px; height: 96px; object-fit: cover; border-radius: var(--r);
  background: var(--line-soft);
  /* 이미지 드래그가 포인터를 가로채면 FLIP 정렬이 간헐적으로 죽는다 */
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.cmp-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.cmp-addr { font-size: 12.5px; color: var(--muted); }
.cmp-x {
  position: absolute; top: -6px; right: -6px; width: 44px; height: 44px;
  display: grid; place-items: center; border: 0; background: none; cursor: pointer; color: var(--ink2);
}
.cmp-x::before {
  content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.cmp-x .ico { position: relative; }
.cmp-x:hover { color: var(--err); }
.cmp-col.flip { transition: transform 0.36s var(--ease); }
.tray-empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }

.tray-add { margin-top: 28px; }
.add-h { font-size: 16px; margin-bottom: 12px; }
.add-list { display: grid; gap: 8px; }
.add-list li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
}
.add-list li.is-in { background: var(--sky); border-color: #c7d7fb; }
.add-name { font-size: 15px; font-weight: 700; }
.add-meta { font-size: 13px; color: var(--muted); margin-right: auto; }
.add-list .btn { margin-left: auto; }

.cost-bars { display: grid; gap: 14px; margin-bottom: 28px; }
.cb { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 108px; gap: 16px; align-items: center; }
.cb-name { font-size: 14.5px; font-weight: 700; }
.cb-track { display: block; height: 30px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.cb-fill { display: block; height: 100%; width: var(--w); border-radius: var(--r-pill); background: linear-gradient(90deg, var(--blue), var(--lilac)); }
.js .cb-fill { width: 0; transition: width 0.8s var(--ease); }
.js .cost-bars.in .cb-fill { width: var(--w); }
.js .cb:nth-child(2) .cb-fill { transition-delay: 0.08s; }
.js .cb:nth-child(3) .cb-fill { transition-delay: 0.16s; }
.js .cb:nth-child(4) .cb-fill { transition-delay: 0.24s; }
.cb-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--blue-deep); }

.pick-band { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
.pick-list { display: grid; gap: 12px; margin-top: 16px; counter-reset: pick; }
.pick-list li {
  position: relative; padding-left: 40px; font-size: 15px; color: var(--ink2); line-height: 1.65;
  counter-increment: pick;
}
.pick-list li::before {
  content: counter(pick); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--lavender); color: var(--lilac-ink); font-size: 13px; font-weight: 700;
}
.pick-cta { display: grid; gap: 10px; }

/* ==================================================== 5면 — 서류 준비 */
.docs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
@supports (reading-flow: source-order) { .docs-grid { reading-flow: source-order; } }
.docs-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.tablist { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.dtab {
  min-height: 48px; padding: 0 20px; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  background: var(--paper); cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--ink2);
}
.dtab:hover { border-color: var(--blue); color: var(--blue-deep); }
.dtab.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.progress { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--blue-deep); }

.dpanel { margin-bottom: 28px; }
.js .dpanel:not(.is-active) { display: none; }
.dpanel-h { font-size: 20px; margin-bottom: 8px; }
.dpanel-d { font-size: 14.5px; color: var(--ink2); margin-bottom: 18px; }
.doc-list { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); }
.doc {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; gap: 14px;
  align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.doc:last-child { border-bottom: 0; }
.doc:hover { background: var(--sky); }
.doc-label { display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; padding: 8px 0; }
.doc-name { font-size: 15px; font-weight: 700; }
.doc-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.doc-where { font-size: 13px; color: var(--ink2); white-space: nowrap; }
.doc-kind { padding: 4px 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.doc-issue { background: var(--info-bg); color: var(--info); }
.doc-form { background: var(--lavender); color: var(--lilac-ink); }
.doc-own { background: var(--off-bg); color: var(--off); }
.doc.is-done .doc-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.docs-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mini-time { display: grid; gap: 0; margin-bottom: 18px; }
.mini-time li { position: relative; display: flex; gap: 12px; padding: 0 0 20px 0; }
.mini-time li:last-child { padding-bottom: 4px; }
.mt-dot { width: 14px; height: 14px; flex: none; margin-top: 4px; border-radius: 50%; background: var(--paper); border: 3px solid var(--blue); }
.mini-time li:not(:last-child)::before {
  content: ""; position: absolute; left: 6px; top: 20px; bottom: 4px; width: 2px; background: var(--line);
}
.mt-t { font-size: 14.5px; font-weight: 700; }
.mt-d { font-size: 13px; color: var(--ink2); line-height: 1.55; }

.timeline { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 8px; padding-left: 28px; }
.tl { position: relative; padding: 0 0 28px; }
.tl:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -37px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--line);
}
.tl.is-past .tl-dot { border-color: var(--muted); background: var(--muted); }
.tl.is-now .tl-dot { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16); }
.tl-date { font-size: 13.5px; font-weight: 700; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
.tl-t { font-size: 16px; font-weight: 700; margin: 4px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-state { padding: 3px 9px; border-radius: var(--r-pill); background: var(--off-bg); color: var(--off); font-size: 12.5px; font-weight: 700; }
.tl-live { background: var(--ok-bg); color: var(--ok); }
.tl-d { font-size: 14px; color: var(--ink2); }
.tl.is-past .tl-date, .tl.is-past .tl-t { color: var(--muted); }

/* 진행선 그리기 — 신기술은 덤이다. 기본값이 이미 「다 그려진」 상태다 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .js .timeline { animation: tl-draw linear both; animation-timeline: view(); animation-range: entry 40% cover 60%; }
  }
}
@keyframes tl-draw {
  from { border-image: linear-gradient(180deg, var(--blue) 0%, var(--line) 0%) 1; }
  to { border-image: linear-gradient(180deg, var(--blue) 100%, var(--line) 100%) 1; }
}

.alert-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: start; }
.alert-lead { margin: 12px 0 18px; font-size: 15.5px; color: var(--ink2); }
.alert-bullet li { font-size: 14.5px; color: var(--ink2); }
.alert-form {
  display: grid; gap: 18px; padding: 28px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--canvas);
}
.form-note { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* --------------------------------------------------------------- 푸터 */
.site-footer { background: #0f172a; color: #cbd5e1; padding-block: 56px 28px; margin-top: 0; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.foot-brand .brand-mark { margin-bottom: 12px; }
.foot-name { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.foot-desc { margin-top: 10px; font-size: 14px; line-height: 1.7; max-width: 380px; }
.foot-legal {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(148, 163, 184, 0.12); font-size: 13px; line-height: 1.65; color: #e2e8f0;
}
.foot-legal strong { color: #fff; }
.foot-h { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; }
.foot-col a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 14px; color: #cbd5e1;
}
.foot-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-line { font-size: 13.5px; line-height: 1.75; margin-bottom: 14px; }
.foot-line strong { color: #fff; font-size: 13px; }
.foot-line a { display: inline; min-height: 0; }
.foot-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.foot-copy { font-size: 13px; color: #94a3b8; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { font-size: 13px; color: #94a3b8; display: inline-flex; align-items: center; min-height: 40px; }
.foot-links a:hover { color: #fff; }

/* ------------------------------------------------------- 맨 위로·토스트 */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper);
  color: var(--blue-deep); box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }

.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 200;
  transform: translate(-50%, 16px);
  min-width: 280px; max-width: calc(100vw - 40px);
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; background: var(--ink); color: #fff;
  border-radius: var(--r); font-size: 14.5px; line-height: 1.5;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.28);
  opacity: 0; visibility: hidden;
  /* 알림일 뿐이므로 아래 제출 버튼을 가로막지 않는다 */
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast .ico { color: #93c5fd; flex: none; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- 등장 */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* =============================================================== 반응형 */
@media (max-width: 1180px) {
  :root { --wrap: 1024px; --gutter: 32px; --section: 88px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .ml-grid { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; }
  .guide-band { grid-template-columns: minmax(0, 1fr) 300px; padding: 36px 32px; }
}

@media (max-width: 1024px) {
  :root { --section: 80px; }
  .navlinks, .nav-asof { display: none; }
  .menu-btn { display: inline-flex; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .elig-grid, .docs-grid, .pick-band, .alert-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .elig-side { position: static; }
  .ml-grid { grid-template-columns: minmax(0, 1fr); }
  .ml-list, .map-box, .detail-stack { grid-column: 1; grid-row: auto; }
  .map-box { order: -1; }
  .sum-body { grid-template-columns: minmax(0, 1fr); }
  .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .guide-band { grid-template-columns: minmax(0, 1fr); }
  .guide-media { max-width: 390px; }
  .cb { grid-template-columns: minmax(0, 1fr) 108px; }
  .cb-name { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --gutter: 20px; --section: 64px; }
  body { padding-bottom: 68px; }
  .nav { height: 64px; gap: 12px; }
  .brand-text { font-size: 17px; }

  /* 모바일은 축소판이 아니다 — 아래 탭바로 다섯 면을 한 손에 둔다 */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 60px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  }
  .tabbar a[aria-current="page"] { color: var(--blue); }
  .to-top { bottom: 78px; right: 16px; }
  .toast { bottom: 80px; }

  .hero { padding-block: 32px 40px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .quick-grid { gap: 8px; margin-top: 28px; }
  .quick-grid a { padding: 14px 12px; }
  .quick-ico { width: 34px; height: 34px; }
  .quick-grid strong { font-size: 14.5px; }
  .quick-sub { font-size: 12px; }

  .search-card { padding: 18px 16px; }
  .search-tabs { overflow-x: auto; }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }

  .card-head { padding: 14px 18px; }
  .sum-body { padding: 18px; gap: 20px; }
  .notice-list { padding: 4px 18px 14px; }
  .notice-list li { flex-direction: column; gap: 0; align-items: flex-start; }
  .notice-list a { padding: 12px 0 2px; }
  .notice-list time { padding-bottom: 12px; }

  /* 워터폴은 세로 막대가 좁아 못 읽는다 — 가로 줄로 다시 짠다 */
  .wf { padding: 20px 16px; }
  .wf-track { display: grid; grid-template-columns: minmax(0, 1fr); height: auto; gap: 10px; }
  .wf-col { display: grid; grid-template-columns: 88px minmax(0, 1fr) 78px; align-items: center; gap: 10px; text-align: left; }
  .wf-label { grid-area: 1 / 1; margin: 0; font-size: 13.5px; }
  .wf-bar { grid-area: 1 / 2; }
  .wf-val { grid-area: 1 / 3; }
  .wf-bar { height: 22px; background: var(--line-soft); border-radius: var(--r-pill); }
  .wf-fill {
    top: 0; bottom: 0; height: auto; min-height: 0;
    left: var(--b, 0%); right: auto; width: var(--h); min-width: 10px;
    border-radius: var(--r-pill);
  }
  .wf-fill::after { display: none; }
  .js .wf-fill { height: auto; width: 0; min-width: 0; transition: width 0.7s var(--ease); }
  .js .wf.in .wf-fill { height: auto; min-height: 0; width: var(--h); min-width: 10px; }
  .wf-val { margin: 0; font-size: 13.5px; text-align: right; }
  .wf-table { margin-top: 20px; }

  .fs { padding: 18px 16px; }
  .fs legend { font-size: 16px; }
  .fs-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .form-actions .btn { width: 100%; }

  .filter-row { grid-template-columns: minmax(0, 1fr); }
  .filter-foot { gap: 10px; }
  .filter-count { width: 100%; margin-right: 0; }
  .lc-link { padding: 12px; gap: 12px; }
  .lc-img { width: 72px; height: 72px; }
  .lc-name { font-size: 15px; }
  .detail { padding: 18px 16px; }
  .detail-head { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
  .detail-img { width: 100%; height: 150px; }
  .detail-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .detail-actions .btn { width: 100%; }
  .detail-monthly { margin-left: 0; }

  .tray-tools { width: 100%; }
  .tray-tools .btn { flex: 1 1 auto; }
  .cmp-table tbody th { width: 108px; }

  .docs-bar { gap: 12px; }
  .tablist { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .dtab { white-space: nowrap; }
  /* 서류는 모바일에서 먼저 읽힌다 — 이름·상태를 위로, 발급처를 아래로 */
  .doc { grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "ck name" ". meta"; row-gap: 6px; }
  .doc .ck { grid-area: ck; }
  .doc-label { grid-area: name; }
  .doc-where { grid-area: meta; font-size: 12.5px; color: var(--muted); }
  .doc-kind { grid-area: meta; justify-self: end; }
  .docs-actions .btn { width: 100%; }
  .timeline { padding-left: 22px; }
  .tl-dot { left: -31px; }
  .alert-form { padding: 20px 16px; }

  .foot-top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 400px) {
  :root { --gutter: 16px; }
  .brand-text small { display: none; }
  .sum-num strong { font-size: 40px; }
  .wf-col { grid-template-columns: 66px minmax(0, 1fr) 76px; gap: 8px; }
  .wf-val { font-size: 12.5px; }
  .tabbar a { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* 진행 연출을 없애고 최종 상태를 즉시 보여 준다 */
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .wf-fill { height: var(--h) !important; min-height: 10px !important; }
  .js .cb-fill { width: var(--w) !important; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
  .js .wf-fill {
    height: auto !important; min-height: 0 !important;
    width: var(--h) !important; min-width: 10px !important;
  }
}

@media print {
  .site-header, .drawer, .scrim, .tabbar, .to-top, .toast, .docs-actions,
  .alert-grid, .page-hero .btn, .site-footer .foot-links { display: none !important; }
  body { background: #fff; color: #000; padding-bottom: 0; }
  .js .dpanel:not(.is-active) { display: block !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .doc { break-inside: avoid; }
  .doc-list { border-color: #999; }
  .section, .section-lead { padding-block: 12px; }
  a[href]::after { content: ""; }
}
