/* 모든 페이지 공통 스타일. 첫 화면 3D와 같은 밤하늘 톤 하나로 통일한다 (밝은 화면 전환 없음). */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050b14;
  --surface: #0b1420;
  --surface-2: #122030;
  --line: rgba(190, 220, 255, .11);
  --fg: #eef3f8;
  --muted: #93a2b4;
  --accent: #8fd8f0;
  --accent-ink: #04121c;
  --gov: #8fd3b6;
  --local: #f0c67a;
  --warn: #ff9d8f;
  --action: #eaf4fb;
  --action-ink: #06111c;
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
.theme-toggle { display: none !important; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 860px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding-block: 12px; }
.brand { color: var(--fg); font-weight: 800; font-size: 18px; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav { align-items: center; }
.theme-toggle { min-height: 36px; padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 14px; font-weight: 500; white-space: nowrap; }
.theme-toggle:hover { background: var(--surface-2); }

main.wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 32px 56px; }
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 22px; font-weight: 800; line-height: 1.4; margin: 0; text-wrap: balance; }
h3 { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 0; }
.lead { margin: 0; color: var(--muted); }
.crumb { font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
form.panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .label { display: block; font-weight: 700; padding: 0; margin-bottom: 10px; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.regions { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.choice { min-height: 48px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-weight: 500; font-size: 15px; }
.choice:hover { background: var(--surface-2); }
.choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.age-row { display: flex; align-items: center; gap: 10px; }
#age { width: 110px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 0 14px; font-size: 18px; }
#sigungu { width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 0 12px; margin-top: 12px; }
#sigunguBox { margin-top: 14px; }
.go { min-height: 58px; border: 0; border-radius: 14px; background: var(--action); color: var(--action-ink); font-size: 18px; font-weight: 800; }
.go:hover { opacity: .88; }
.go:disabled { opacity: .6; cursor: progress; }
.error { margin: 0; color: var(--warn); font-size: 15px; }
.privacy { margin: 0; color: var(--muted); font-size: 14px; }

.result-head strong { color: var(--accent); }
.result-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tab { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 500; font-size: 15px; }
.tab[aria-selected="true"] { background: var(--surface-2); border-color: var(--accent); font-weight: 700; }
.tab b { color: var(--accent); font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { min-height: 36px; padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; }
.pill:hover { color: var(--fg); }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.only { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 15px; font-weight: 500; }
.only[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.fit { color: var(--accent); font-weight: 700; }
#find { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 0 14px; }
#find::placeholder { color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.scope { font-weight: 700; }
.scope.gov { color: var(--gov); }
.scope.local { color: var(--local); }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; min-height: 28px; }
dl { margin: 8px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; font-size: 15px; }
dt { font-weight: 700; color: var(--fg); }
dd { margin: 2px 0 0; color: var(--muted); white-space: pre-line; }
.official { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 22px; border-radius: 12px; background: var(--action); color: var(--action-ink); font-weight: 800; text-decoration: none; }
.cta.sub { background: transparent; color: var(--fg); border: 1px solid var(--line); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.more { min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 700; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 36px 16px; text-align: center; color: var(--muted); }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--muted); }
.grid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: var(--fg); text-decoration: none; }
.tile:hover { background: var(--surface-2); }
.tile b { display: block; font-size: 17px; }
.tile span { color: var(--muted); font-size: 14px; }
.prose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 68ch; }
.prose h2 { margin-top: 12px; font-size: 19px; }
.prose p, .prose ul { margin: 0; color: var(--muted); }

.foot { border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot .wrap { padding-block: 20px 36px; display: grid; gap: 6px; }
.foot p { margin: 0; }
.foot a { color: inherit; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.hero { padding-block: 6px 2px; }
.hero h1 { font-size: clamp(34px, 7vw, 52px); }
.hero .lead { font-size: 17px; max-width: 58ch; }
form.panel > h2 { margin-bottom: -6px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stats div { background: var(--surface); padding: 14px 8px; text-align: center; display: grid; gap: 2px; }
.stats b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.stats span { font-size: 13px; color: var(--muted); }
.stats-note { margin: -14px 0 0; font-size: 13px; color: var(--muted); }
.kw { display: flex; gap: 8px; }
#kw { flex: 1 1 auto; min-width: 0; height: 52px; border-radius: 12px; border: 1px solid var(--muted); background: var(--surface); color: var(--fg); padding: 0 14px; }
#kw::placeholder { color: var(--muted); }
.kw-go { flex: none; height: 52px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--action); color: var(--action-ink); font-weight: 800; }
.kw-go:hover { opacity: .88; }
.kw-head { margin: 0; font-size: 15px; color: var(--muted); }
.kw-head b { color: var(--fg); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.sec-head a { font-size: 14px; }
.tile small { display: block; font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.faq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.faq summary { color: var(--fg); font-size: 16px; font-weight: 700; }
.faq p { margin: 6px 0 2px; color: var(--muted); font-size: 15px; }
.prose ul { padding-left: 20px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.filter .label { margin-bottom: 6px; font-size: 15px; }
.select, .search { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--muted); background: var(--bg); color: var(--fg); padding: 0 12px; }
.search::placeholder { color: var(--muted); }
.select:disabled { opacity: .6; }
.panel.stack > .filters + div .label { font-size: 15px; margin-bottom: 6px; }
.card .dates { font-size: 14px; color: var(--fg); }
.card .price { font-size: 18px; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ── 첫 화면 3D 주제 고리 (디자인 정리: unslop by @heydamir, CC BY 4.0) ──
   빛·그라데이션 글자·떠다니는 이모지 없이, 실제 주제 카드가 입체로 둘러선다 */
.hero3d { display: block; padding-block: 24px 0; }
.hero3d h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 16px; }
.hero3d .lead { font-size: 17px; max-width: 46ch; margin: 0 0 24px; }
.hero3d .lead b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero-cta { display: inline-flex; align-items: center; width: auto; padding: 0 24px; text-decoration: none; }
.hero-link { color: var(--fg); font-weight: 500; text-underline-offset: 4px; }
.hero-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.ring-stage { position: relative; height: 400px; margin: 0; perspective: 1800px; perspective-origin: 50% -30%; touch-action: pan-y; cursor: grab; user-select: none; }
.ring-stage.dragging { cursor: grabbing; }
.ring { --rot: 0deg; position: absolute; left: 50%; top: 42%; width: 0; height: 0; transform-style: preserve-3d; transform: rotateX(-14deg) rotateY(var(--rot)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.ring-stage.dragging .ring { transition: none; }
.ring-card {
  position: absolute; width: 160px; height: 180px; left: -80px; top: -90px; padding: 16px;
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: none;
  transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(300px);
  backface-visibility: hidden; transition: border-color .15s ease;
}
.ring-card:hover, .ring-card:focus-visible { border-color: var(--fg); }
.rc-num { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: auto; }
.rc-num small { font-size: 13px; font-weight: 500; margin-left: 2px; color: var(--muted); }
.ring-card b { font-size: 16px; font-weight: 600; }
.rc-sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.ring-hint { position: absolute; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .ring-stage { height: 330px; perspective: 1300px; }
  .ring-card { width: 132px; height: 150px; left: -66px; top: -75px; padding: 12px; transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(190px); }
  .rc-num { font-size: 22px; }
  .ring-card b { font-size: 15px; }
}
@media (min-width: 641px) { .ring-stage { height: 330px; } .ring { top: 30%; } .ring-hint { bottom: -8px; } }
@media (prefers-reduced-motion: reduce) { .ring { transition: none; } }

/* ── 블로그 ── */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li a { display: grid; gap: 4px; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.post-list li a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.post-list b { font-size: 17px; font-weight: 600; }
.pl-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-desc { font-size: 14px; color: var(--muted); }
.post { max-width: 720px; }
.post-head h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 700; margin: 8px 0 8px; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.post-body { font-size: 17px; line-height: 1.85; }
.post-body h2 { font-size: 23px; font-weight: 700; margin: 48px 0 12px; letter-spacing: -0.02em; }
.post-body h3 { font-size: 19px; font-weight: 600; margin: 32px 0 8px; }
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { padding-left: 24px; margin: 0 0 16px; }
.post-body li { margin: 4px 0; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--accent); background: var(--surface); color: var(--fg); }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.post-body .table-wrap { overflow-x: auto; margin: 0 0 16px; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.post-body th { background: var(--surface-2); font-weight: 600; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.post-tags span { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.post-cta { margin: 40px 0 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.post-cta b { font-size: 18px; }
.post-cta p { color: var(--muted); margin: 4px 0 16px; }
.post-cta .go { display: inline-flex; width: auto; padding: 0 24px; text-decoration: none; align-items: center; }

/* ── 첫 화면: 3D 시안을 화면 폭 그대로 (src/hero3d/index.html → /hero/) ── */
.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; }
.hero-frame { position: relative; width: 100vw; margin-left: calc(50% - 50vw); margin-top: -32px; height: 100svh; min-height: 560px; background: #050b14; }
.hero-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
#form { scroll-margin-top: 16px; }
html { overflow-x: clip; }

/* 분야별 정책정보 */
.pol-src { margin: 0; font-size: 14px; color: var(--muted); }
.pol-src a { color: var(--muted); }
.pol-n { color: var(--muted); font-size: 12px; margin-left: 4px; }
.pol-form { gap: 14px; }
.pol-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px 12px; }
.pol-row .label { margin: 0; }
.pol-row select, .pol-row input { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 0 12px; min-width: 0; width: 100%; }
.pol-q { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
.pol-q .cta { min-height: 44px; padding: 4px 18px; }
.pol-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pol-sum { margin: 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pol-issues { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; }
.pol-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pol-pager button { min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-variant-numeric: tabular-nums; }
.pol-pager button[aria-current="page"] { background: var(--action); color: var(--action-ink); border-color: var(--action); font-weight: 700; }
@media (max-width: 640px) {
  .pol-row, .pol-q { grid-template-columns: minmax(0, 1fr); }
  .pol-q { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pol-q .label { grid-column: 1 / -1; }
  .pol-q input { grid-column: 1 / -1; }
  .pol-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pol-link { display: flex; align-items: center; min-height: 64px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); text-decoration: none; }
.pol-link span { display: grid; gap: 2px; }
.pol-link b { font-size: 17px; }
.pol-link small { color: var(--muted); font-size: 14px; }
.pol-link:hover { border-color: var(--accent); }
