:root {
  color-scheme: light dark;
  --bg: #eae9e5;
  --surface: #ffffff;
  --border: #dfdcd5;
  --border-strong: #c6c2b9;
  --control-border: #858178;
  --text: #1a1a18;
  --text-sub: #5d5b56;
  --accent: #1b3a6b;
  --accent-strong: #16305a;
  --accent-weak: #e7edf7;
  --on-accent: #ffffff;
  --focus-ring: rgba(27, 58, 107, 0.25);
  --ok: #1b5e20;
  --warn: #a54c08;
  --bad: #b71c1c;
  --ok-weak: #e9f2eb;
  --warn-weak: #faf0e6;
  --bad-weak: #fbebe9;
  --fs-2xs: 0.75rem;
  --fs-xs: 0.875rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.75rem;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 12px;
  --radius-stamp: 3px;
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 90ms;
  --dur-base: 240ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #242422;
    --border: #38362f;
    --border-strong: #4d4a41;
    --control-border: #77736a;
    --text: #eceae5;
    --text-sub: #aaa79f;
    --accent: #9fbbe4;
    --accent-strong: #b0c8ea;
    --accent-weak: #1b2434;
    --on-accent: #111a28;
    --focus-ring: rgba(159, 187, 228, 0.35);
    --ok: #81c995;
    --warn: #fcad70;
    --bad: #f28b82;
    --ok-weak: #1e2a22;
    --warn-weak: #2d2519;
    --bad-weak: #31211f;
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eae9e5;
  --surface: #ffffff;
  --border: #dfdcd5;
  --border-strong: #c6c2b9;
  --control-border: #858178;
  --text: #1a1a18;
  --text-sub: #5d5b56;
  --accent: #1b3a6b;
  --accent-strong: #16305a;
  --accent-weak: #e7edf7;
  --on-accent: #ffffff;
  --focus-ring: rgba(27, 58, 107, 0.25);
  --ok: #1b5e20;
  --warn: #a54c08;
  --bad: #b71c1c;
  --ok-weak: #e9f2eb;
  --warn-weak: #faf0e6;
  --bad-weak: #fbebe9;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface: #242422;
  --border: #38362f;
  --border-strong: #4d4a41;
  --control-border: #77736a;
  --text: #eceae5;
  --text-sub: #aaa79f;
  --accent: #9fbbe4;
  --accent-strong: #b0c8ea;
  --accent-weak: #1b2434;
  --on-accent: #111a28;
  --focus-ring: rgba(159, 187, 228, 0.35);
  --ok: #81c995;
  --warn: #fcad70;
  --bad: #f28b82;
  --ok-weak: #1e2a22;
  --warn-weak: #2d2519;
  --bad-weak: #31211f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

summary {
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

button:active,
summary:active {
  transform: scale(0.98);
}

[hidden] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-right: var(--sp-4);
  padding-left: var(--sp-4);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @supports (background: color-mix(in srgb, white, black)) {
    .site-header {
      background: color-mix(in srgb, var(--surface) 78%, transparent);
    }
  }
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.header-row > *,
.header-tools > *,
.entry-option > * {
  min-width: 0;
}

.text-size-toggle,
.theme-toggle {
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 750;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.text-size-toggle[aria-pressed="true"] {
  background: var(--accent-weak);
  border-color: var(--accent);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mock-stamp,
.status-stamp {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px var(--sp-2);
  border: 1.5px solid currentColor;
  border-radius: var(--radius-stamp);
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.mock-stamp {
  color: var(--accent);
}

main.wrap {
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-7);
}

.crumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.page-head h1 {
  margin: var(--sp-1) 0 var(--sp-2);
  font-size: var(--fs-xl);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.page-desc {
  margin: 0 0 var(--sp-4);
  color: var(--text-sub);
}

/* 개인정보 안내는 접어 둔다 (2026-09-09).
   약속(저장하지 않는다)은 한 줄로 보이고, 근거 문장은 펼쳐야 나온다.
   전에는 두 문단이 펼쳐진 채 첫 화면의 1/4을 차지했다 — 정직함은 지키되 자리를 내주지 않는다. */
.privacy-note {
  margin: var(--sp-4) 0;
  color: var(--text);
  background: var(--accent-weak);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--fs-sm);
}

.search-privacy-note {
  margin: var(--sp-3) 0;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.search-privacy-note strong { color: var(--text); }

.privacy-note summary,
.search-privacy-note summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 48px;
  padding: var(--sp-2) var(--sp-4);
  cursor: pointer;
}

.privacy-note summary .summary-note,
.search-privacy-note summary .summary-note {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.privacy-note[open] summary .summary-note,
.search-privacy-note[open] summary .summary-note {
  visibility: hidden;
}

.privacy-note p,
.search-privacy-note p {
  margin: 0;
  padding: 0 var(--sp-4) var(--sp-3);
  color: var(--text-sub);
  line-height: 1.6;
}

.entry-hub {
  margin: var(--sp-5) 0;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.entry-hub h2 {
  margin: var(--sp-1) 0 var(--sp-4);
  font-size: var(--fs-lg);
}

.entry-options {
  display: grid;
  gap: var(--sp-3);
}

.entry-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  min-height: 76px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.entry-option.is-active {
  background: var(--accent-weak);
  border-color: var(--accent);
}

.entry-option strong,
.entry-option small {
  display: block;
}

.entry-state {
  display: none;
  padding: 2px var(--sp-2);
  color: var(--accent);
  background: var(--surface);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 800;
  white-space: nowrap;
}

.entry-option.is-active .entry-state {
  display: inline-flex;
}

.entry-option strong {
  font-size: var(--fs-base);
}

.entry-option small {
  margin-top: 2px;
  color: var(--text-sub);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.calc,
.results {
  margin: var(--sp-4) 0;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.calc > h2,
.results h2,
.prototype-notes h2,
.service-guide h2 {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-md);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.section-heading h2 {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-lg);
}

.step-label {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.step-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: var(--sp-3) 0 var(--sp-4);
  overflow: hidden;
  background: var(--border);
  border: 0;
  border-radius: 999px;
  color: var(--accent);
}

.step-progress::-webkit-progress-bar {
  background: var(--border);
}

.step-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.step-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.answer-form {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.answer-verdict {
  margin: 0 0 2px;
  color: var(--text-sub);
  font-size: var(--fs-base);
}

.answer-main {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(2.2rem, 10.3vw, 2.9rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.answer-unit {
  color: var(--text-sub);
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
}

.answer-basis {
  margin: var(--sp-2) 0 0;
  color: var(--text-sub);
  font-size: var(--fs-xs);
}

.form-inputs {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.answer-summary[hidden] + .form-inputs {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.question-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.question-step legend {
  display: grid;
  width: 100%;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
}

.question-kicker {
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.question-title {
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.question-help {
  margin: var(--sp-2) 0 var(--sp-5);
  color: var(--text-sub);
  font-size: var(--fs-base);
}

.question-step .field + .field {
  margin-top: var(--sp-4);
}

.field-narrow {
  max-width: 340px;
}

.birth-year-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
}

.age-estimate {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 54px;
  padding: var(--sp-2) var(--sp-3);
  color: var(--text);
  background: var(--accent-weak);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.age-estimate > span,
.age-estimate > small {
  color: var(--text-sub);
  font-size: var(--fs-2xs);
  line-height: 1.4;
}

.age-estimate > strong {
  color: var(--accent-strong);
  font-size: var(--fs-lg);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.optional-label {
  display: inline-flex;
  margin-left: var(--sp-1);
  padding: 1px var(--sp-2);
  color: var(--text-sub);
  background: var(--bg);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  vertical-align: middle;
}

.grid2,
.accuracy-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4) var(--sp-3);
}

.field.is-input {
  padding-left: var(--sp-3);
  border-left: 2px solid var(--accent);
}

.field label {
  display: block;
  margin-bottom: var(--sp-1);
  color: var(--text-sub);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.household-flags {
  min-width: 0;
  margin: 0;
  padding: 0 0 0 var(--sp-3);
  border: 0;
  border-left: 2px solid var(--accent);
}

.household-flags legend {
  margin-bottom: var(--sp-1);
  padding: 0;
  color: var(--text-sub);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.household-flags > label {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.household-flags input {
  width: 20px;
  height: 20px;
  margin: 0 var(--sp-2) 0 0;
  accent-color: var(--accent);
}

.field input,
.field select {
  width: 100%;
  min-height: 54px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.field input {
  font-variant-numeric: tabular-nums;
}

.field input::placeholder {
  color: var(--text-sub);
  opacity: 0.65;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  padding-right: var(--sp-7);
}

.input-with-unit > span {
  position: absolute;
  top: 50%;
  right: var(--sp-4);
  color: var(--text-sub);
  transform: translateY(-50%);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--bad);
}

.field-error,
.hint {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-sm);
}

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

.hint {
  color: var(--text-sub);
}

.accuracy-panel {
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.accuracy-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--accent);
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 700;
}

.accuracy-panel summary .summary-title {
  flex: 1 1 auto;
  color: var(--accent);
  font-size: var(--fs-base);
  font-weight: 700;
}

.accuracy-panel summary .summary-note {
  flex: 0 0 auto;
  color: var(--text-sub);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.accuracy-panel summary::after,
.excluded-panel > summary::after {
  width: 9px;
  height: 9px;
  margin: 0 3px 4px var(--sp-3);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  flex: 0 0 auto;
  transform: rotate(45deg);
  transition: transform var(--dur-base) var(--ease-out);
}

.accuracy-panel[open] > summary::after,
.excluded-panel[open] > summary::after {
  margin-bottom: -4px;
  transform: rotate(225deg);
}

.accuracy-fields {
  padding: var(--sp-3) 0 var(--sp-1);
}

.none-option {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.btn-primary,
.btn-secondary {
  min-height: 52px;
  padding: var(--sp-3) var(--sp-5);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 800;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

.btn-primary {
  min-width: 132px;
  color: var(--on-accent);
  background: var(--accent);
}

.btn-secondary {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--control-border);
}

.form-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.btn-ghost,
.btn-text {
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  color: var(--accent);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.btn-ghost {
  border: 1.5px solid var(--control-border);
}

.btn-text {
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-rows {
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.form-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
}

.form-row span {
  color: var(--text-sub);
}

.form-row b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.form-row.is-total {
  padding-top: var(--sp-3);
  border-bottom: 0;
}

.form-row.is-total span,
.form-row.is-total b {
  color: var(--text);
  font-weight: 800;
}

.form-source {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.results {
  margin-top: var(--sp-5);
}

.results-head,
.group-title-row,
.program-top,
.program-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.results-head h2 {
  margin: var(--sp-1) 0 0;
}

.results-updated {
  flex: 0 0 auto;
  margin: 0;
  color: var(--text-sub);
  font-size: var(--fs-2xs);
}

.empty-state {
  margin-top: var(--sp-4);
  padding: var(--sp-5) var(--sp-4);
  background: var(--accent-weak);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state p {
  margin: var(--sp-2) 0 0;
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.result-group {
  margin-top: var(--sp-6);
}

.recommended-group {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--accent-weak);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
}

.recommended-group h3 {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-lg);
}

.recommendation-label {
  margin: 0;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 850;
  letter-spacing: 0.03em;
}

.result-group:first-child {
  margin-top: var(--sp-4);
}

.group-title-row h3 {
  margin: 0;
  font-size: var(--fs-lg);
}

.group-count {
  flex: 0 0 auto;
  color: var(--text-sub);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.group-desc {
  margin: var(--sp-1) 0 var(--sp-3);
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.program-list {
  display: grid;
  gap: var(--sp-3);
}

.program-card {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.program-card,
.program-top > *,
.program-footer > *,
.official-link,
.official-pending,
.suggestion-button > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.program-card[data-status="eligible"] {
  border-left: 4px solid var(--ok);
}

.program-card[data-status="near"],
.program-card[data-status="review"] {
  border-left: 4px solid var(--warn);
}

.program-card[data-status="excluded"] {
  border-left: 4px solid var(--bad);
}

.program-card[data-status="browse"] {
  border-left: 4px solid var(--accent);
}

.program-card.is-featured {
  border-color: var(--accent);
}

.program-card[data-status="eligible"] .status-stamp {
  color: var(--ok);
}

.program-card[data-status="near"] .status-stamp,
.program-card[data-status="review"] .status-stamp {
  color: var(--warn);
}

.program-card[data-status="excluded"] .status-stamp {
  color: var(--bad);
}

.program-card[data-status="browse"] .status-stamp {
  color: var(--accent);
}

.program-deadline {
  color: var(--text-sub);
  font-size: var(--fs-xs);
  text-align: right;
}

.program-card h4 {
  margin: var(--sp-3) 0 var(--sp-1);
  font-size: var(--fs-lg);
  line-height: 1.4;
}

.program-benefit {
  margin: 0;
  color: var(--accent-strong);
  font-size: var(--fs-base);
  font-weight: 800;
}

.program-summary {
  margin: var(--sp-2) 0 0;
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.detail-pending {
  margin: var(--sp-3) 0 0;
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.catalog-region {
  margin: var(--sp-2) 0 0;
  color: var(--text-sub);
  font-size: var(--fs-xs);
}

/* 접수 단계 배지 — 목록 줄·카드·상세 페이지가 같은 모양을 쓴다. 색은 상태 의미(진행·예정·마감)만 나타낸다. */
.phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  color: var(--text-sub);
  background: var(--bg);
  border-radius: 999px;
  font-size: var(--fs-2xs);
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}

.phase-badge[data-phase="open"] { color: var(--ok); background: var(--ok-weak); }
.phase-badge[data-phase="upcoming"] { color: var(--warn); background: var(--warn-weak); }
.phase-badge[data-phase="always"] { color: var(--accent-strong); background: var(--accent-weak); }
.phase-badge[data-phase="closed"] { color: var(--bad); background: var(--bad-weak); }

.phase-detail {
  color: var(--text-sub);
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}

.status-stamp .phase-badge {
  font-size: var(--fs-2xs);
}

.status-stamp.is-phase {
  min-height: 0;
  padding: 0;
  border: 0;
  letter-spacing: 0;
}

.catalog-facts {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-3) 0 0;
  padding: var(--sp-3);
  background: var(--accent-weak);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.catalog-facts dt {
  color: var(--accent-strong);
  font-weight: 800;
}

.catalog-facts dd {
  min-width: 0;
  margin: 0;
  color: var(--text-sub);
  overflow-wrap: anywhere;
}

.reason-list {
  display: grid;
  gap: var(--sp-2);
  margin: var(--sp-4) 0 0;
  padding: var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-sm);
  list-style: none;
}

.reason-list li {
  position: relative;
  padding-left: var(--sp-5);
  font-size: var(--fs-sm);
}

.reason-list li::before {
  position: absolute;
  left: 0;
  font-weight: 800;
}

.reason-list .is-pass::before {
  color: var(--ok);
  content: "✓";
}

.reason-list .is-fail::before {
  color: var(--bad);
  content: "×";
}

.reason-list .is-missing::before {
  color: var(--warn);
  content: "?";
}

.program-footer {
  align-items: center;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.program-agency {
  color: var(--text-sub);
  font-size: var(--fs-xs);
}

.official-actions {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.official-link,
.official-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
}

.official-link {
  color: var(--accent);
  border: 1.5px solid var(--accent);
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.official-link.is-primary {
  color: var(--on-accent);
  background: var(--accent);
}

.official-link.is-secondary {
  background: var(--surface);
}

.official-pending {
  color: var(--text-sub);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
}

.program-page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  color: var(--accent);
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.program-page-link:focus-visible,
a.suggestion-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.excluded-panel {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.excluded-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  color: var(--text-sub);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.excluded-panel > summary .summary-title {
  flex: 1 1 auto;
  min-width: 0;
}

.excluded-panel > summary b {
  flex: 0 0 auto;
  margin-left: var(--sp-3);
}

.excluded-panel > p {
  margin: 0 0 var(--sp-3);
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.search-flow {
  margin: var(--sp-4) 0;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.search-intro {
  margin: var(--sp-2) 0 var(--sp-3);
  color: var(--text-sub);
}

/* 데이터 상태 한 줄 — 점 하나와 문장 하나 (2026-09-09).
   상태는 색이 아니라 문장이 말한다. 점은 훑어볼 때의 보조일 뿐이다. */
.search-data-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.search-data-note::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  content: "";
  flex: 0 0 auto;
}

.search-data-note[data-state="loading"]::before { background: var(--border-strong); }
.search-data-note[data-state="warning"] { background: var(--warn-weak); }
.search-data-note[data-state="warning"]::before { background: var(--warn); }
.search-data-note[data-state="error"] { background: var(--bad-weak); }
.search-data-note[data-state="error"]::before { background: var(--bad); }

.search-box label {
  display: block;
  margin-bottom: var(--sp-2);
  font-weight: 750;
}

.search-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-2);
}

.search-input-row input {
  width: 100%;
  min-height: 58px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.search-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.search-input-row input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  min-width: 68px;
  min-height: 48px;
  padding: var(--sp-2) var(--sp-3);
  color: var(--accent);
  background: var(--accent-weak);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 750;
}

.topic-area {
  margin-top: var(--sp-5);
}

.topic-area h3 {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-base);
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.topic-list button {
  min-height: 48px;
  padding: var(--sp-2) var(--sp-4);
  color: var(--accent);
  background: var(--accent-weak);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

.suggestion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.suggestion-head p {
  margin: 0;
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.suggestion-list {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding: 0;
  list-style: none;
}

.suggestion-button {
  display: grid;
  gap: var(--sp-1);
  width: 100%;
  min-height: 64px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.suggestion-button strong {
  font-size: var(--fs-base);
}

a.suggestion-button { text-decoration: none; }

.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.suggestion-button .suggestion-source {
  color: var(--text-sub);
  font-size: var(--fs-xs);
}

/* 검색 필터 — 접수 상태·분야·지역 세 칸. 라벨과 건수는 필터 색인에서 채운다. */
.search-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.search-filters .field {
  margin: 0;
}

.search-filters .field.is-input {
  padding-left: 0;
  border-left: 0;
}

.search-filters .hint {
  grid-column: 1 / -1;
}

/* 자료 출처 — 공공데이터포털 이용 조건(출처 표시). 랜딩과 상세 페이지 꼬리말이 같은 문장을 쓴다. */
.footer-source {
  margin: var(--sp-2) 0;
  color: var(--text-sub);
  font-size: var(--fs-2xs);
  line-height: 1.7;
}

/* 문의 — 계산기 꼬리말의 「문의」와 같은 주소. 지원금 화면은 링크가 그것뿐이라 문장으로 적는다. */
.footer-contact {
  margin: var(--sp-2) 0;
  color: var(--text-sub);
  font-size: var(--fs-xs);
  line-height: 1.7;
}

.footer-contact a {
  color: var(--accent-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.suggestion-button span {
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.search-empty {
  margin: 0;
  padding: var(--sp-5);
  color: var(--text-sub);
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
}

.search-selection {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 2px solid var(--border);
}

.search-selection h3 {
  margin: var(--sp-1) 0 var(--sp-3);
  font-size: var(--fs-lg);
}

.situation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.situation-options label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 54px;
  padding: var(--sp-3);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.situation-options input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.situation-options[aria-invalid="true"] {
  outline: 2px solid var(--bad);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.profile-review {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.profile-review h3 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-base);
}

.profile-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 48px;
  font-size: var(--fs-sm);
}

.profile-review-row span { min-width: 0; overflow-wrap: anywhere; }
.profile-review-row button { flex-shrink: 0; }

.search-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
  margin-top: var(--sp-4);
  text-align: center;
  font-size: var(--fs-sm);
}

.search-pagination button { min-height: 48px; }
.search-pagination button:disabled { opacity: 0.45; cursor: default; transform: none; }
#search-results-view { min-height: 240px; }
#search-status { min-height: 3.5em; }
#search-results-view[data-state="loading"] .suggestion-list { opacity: 0.5; pointer-events: none; }
.search-recovery { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.search-recovery button { min-height: 48px; }
.search-selection [tabindex="-1"] { scroll-margin-top: 80px; }
.detail-freshness, .catalog-region {
  margin: var(--sp-3) 0;
  padding: var(--sp-3);
  color: var(--text-sub);
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

#search-detail-status { color: var(--text-sub); line-height: 1.65; }
.program-card[data-status="browse"] .program-benefit { white-space: pre-line; line-height: 1.7; font-weight: 600; }

@media (max-width: 479px) {
  .situation-options { grid-template-columns: minmax(0, 1fr); }
  .search-pagination { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-filters { grid-template-columns: 1fr; }
  .search-pagination span { grid-column: 1 / -1; grid-row: 1; }
}

.prototype-notes,
.service-guide {
  margin-top: var(--sp-6);
  line-height: 1.75;
}

.ad-slot {
  width: 100%;
  min-height: 128px;
  margin: var(--sp-7) 0;
}

.ad-label {
  margin: 0 0 var(--sp-2);
  color: var(--text-sub);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.ad-placeholder {
  display: grid;
  place-content: center;
  gap: var(--sp-1);
  width: 100%;
  min-height: 100px;
  padding: var(--sp-4);
  overflow: hidden;
  color: var(--text-sub);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  text-align: center;
}

.ad-placeholder span {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.ad-placeholder small {
  font-size: var(--fs-2xs);
}

.prototype-notes h2,
.service-guide h2 {
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-lg);
}

.prototype-notes ul {
  padding-left: var(--sp-5);
}

.site-footer {
  margin-top: var(--sp-7);
  padding: var(--sp-6) 0 var(--sp-7);
  color: var(--text-sub);
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.footer-note,
.footer-copy {
  margin: 0;
}

.footer-copy {
  margin-top: var(--sp-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html.large-type {
  font-size: 112.5%;
}

.question-title,
.field input,
.field select,
.search-input-row input {
  scroll-margin-top: 72px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .entry-option:hover,
  .suggestion-button:hover {
    background: var(--accent-weak);
    border-color: var(--accent);
  }

  .btn-ghost:hover,
  .btn-secondary:hover,
  .text-size-toggle:hover,
  .theme-toggle:hover,
  .program-page-link:hover,
  .official-link:hover {
    background: var(--accent-weak);
    border-color: var(--accent);
  }

  .btn-primary:hover,
  .official-link.is-primary:hover {
    color: var(--on-accent);
    background: var(--accent-strong);
  }

  .topic-list button:hover {
    border-color: var(--accent);
  }
}

@media (min-width: 640px) {
  .grid2,
  .accuracy-fields {
    grid-template-columns: 1fr 1fr;
  }

  .entry-options {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 480px) {
  .birth-year-grid {
    grid-template-columns: minmax(0, 1fr) minmax(168px, 0.9fr);
    align-items: stretch;
  }

  .ad-slot {
    min-height: 118px;
  }

  .ad-placeholder {
    min-height: 90px;
  }
}

@media (max-width: 479px) {
  .calc,
  .results {
    padding: var(--sp-4);
  }

  .answer-form {
    padding: var(--sp-3);
  }

  .results-head,
  .program-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .results-updated {
    text-align: left;
  }

  .form-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .step-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .btn-ghost,
  .btn-text,
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .official-link {
    width: 100%;
  }

  .suggestion-head {
    align-items: stretch;
    flex-direction: column;
  }

  .suggestion-head .btn-text {
    text-align: left;
  }

  .search-input-row {
    grid-template-columns: 1fr;
  }

  .search-clear {
    width: 100%;
  }

  .catalog-facts {
    grid-template-columns: 1fr;
  }

  .catalog-facts dd + dt {
    margin-top: var(--sp-2);
  }

  .freshness-status {
    gap: var(--sp-2);
    padding: var(--sp-3);
  }
}

@media (max-width: 359px) {
  .wrap {
    padding-right: var(--sp-3);
    padding-left: var(--sp-3);
  }

  .mock-stamp {
    display: none;
  }

  .search-flow {
    padding: var(--sp-4);
  }
}

@media (max-height: 500px) {
  html {
    scroll-padding-top: var(--sp-4);
  }

  .site-header {
    position: static;
  }

  .question-title,
  .field input,
  .field select,
  .search-input-row input {
    scroll-margin-top: var(--sp-4);
  }
}

@media print {
  .ad-slot {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  button:active,
  summary:active {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.review-scope { color: var(--text-sub); font-size: 0.95rem; line-height: 1.6; }
.review-checklist { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.review-checklist summary { min-height: 48px; cursor: pointer; font-weight: 700; }
.review-checklist li { margin-bottom: 10px; line-height: 1.65; }
.review-checklist .official-link { margin: 8px 0; }
.detail-share-box { display: grid; gap: 12px; margin-top: 24px; }
.detail-share-box input { width: 100%; min-width: 0; font-size: 1rem; }
.search-selection { scroll-margin-top: 80px; }
