:root {
  --bg: #ffffff; --fg: #1a1f27; --muted: #5b6573; --line: #e3e6ea; --soft: #f6f7f9;
  --card: #ffffff; --primary: #3b4a5e; --primary-fg: #ffffff; --ok: #1f7a4d; --no: #b42318;
  --radius: 10px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161c; --fg: #eef1f5; --muted: #a7b0bd; --line: #2a313b; --soft: #181d24;
    --card: #171c23; --primary: #a9b8cc; --primary-fg: #12161c; --ok: #5fd39a; --no: #ff8a80; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--font); color: var(--fg); background: var(--bg); line-height: 1.6; word-break: keep-all; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { border-color: var(--line); background: var(--card); }
.btn-outline:hover { background: var(--soft); }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; text-decoration: none; }
.brand b { color: var(--primary); font-weight: 700; }
.brand.small { font-size: 15px; }
.brand-mark { width: 30px; height: 30px; }
.mark-shield { fill: var(--primary); }
.mark-check { fill: none; stroke: var(--primary-fg); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 14px; font-weight: 500; }
.site-nav a:not(.btn):hover { background: var(--soft); }
.site-nav .btn { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; color: inherit; cursor: pointer; }
.nav-toggle svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  .site-nav.open { display: flex; }
  .site-nav .btn { margin: 8px 0 0; justify-content: center; }
}

/* hero */
.hero { border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; padding-top: 36px; } }
.pill { display: inline-block; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }
.hero h1 { margin-top: 16px; font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
.lead { margin-top: 16px; color: var(--muted); font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.flow-card { padding: 20px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.flow-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.flow-head h2 { font-size: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; font-weight: 500; padding: 6px 14px; background: var(--card); color: var(--fg); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }
figure { margin: 0; }
.flow svg { width: 100%; height: auto; display: block; }
.flow-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.f-node { fill: var(--card); stroke: var(--line); }
.f-node-out { fill: var(--card); stroke: var(--primary); stroke-opacity: .55; }
.f-text { fill: var(--fg); font-size: 13px; font-family: var(--font); }
.f-center { fill: var(--primary); }
.f-center-t { fill: var(--primary-fg); font-size: 13px; font-weight: 600; font-family: var(--font); }
.f-in { fill: none; stroke: var(--muted); stroke-opacity: .5; stroke-width: 1.5; stroke-dasharray: 4 4; }
.f-out { fill: none; stroke: var(--primary); stroke-width: 1.75; }
.f-arrow { fill: var(--primary); }
.f-ok { fill: var(--ok); }
.f-tick { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* sections */
.section { padding: 72px 0; outline: none; }
.section.alt { background: var(--soft); }
.eyebrow { font-size: 14px; color: var(--muted); font-weight: 500; }
.section h2 { font-size: clamp(22px, 3vw, 30px); margin-top: 4px; margin-bottom: 32px; }

.program-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .program-grid { grid-template-columns: 1fr; } }
.program { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.program h3 { font-size: 20px; }
.program h4 { font-size: 15px; margin-top: 8px; }
ul.check, ul.cross { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 15px; }
ul.check li, ul.cross li { position: relative; padding-left: 26px; }
ul.check li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }
ul.cross li::before { content: "✕"; position: absolute; left: 4px; color: var(--no); font-weight: 700; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; color: var(--muted); margin-left: 4px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0; }
.facts div { background: var(--card); padding: 12px 14px; }
.facts dt { font-weight: 600; font-size: 14px; }
.facts dd { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.note { font-size: 14px; color: var(--muted); }
.fit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.fit span { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { caption-side: top; text-align: left; font-size: 13px; color: var(--muted); padding: 12px 16px 4px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; white-space: nowrap; }
td.yes { font-weight: 600; }
td.yes::before { content: "✓ "; color: var(--ok); }

/* mandatory */
.mand-grid { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .mand-grid { grid-template-columns: 1fr; } }
.mand-form { display: grid; gap: 8px; }
.mand-form label { font-weight: 600; font-size: 14px; margin-top: 8px; }
.mand-form small { color: var(--muted); font-weight: 400; }
select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.result { padding: 18px; margin-top: 12px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.badge.req { background: #fdf0d5; color: #7a4b00; }
.badge.none { background: var(--soft); color: var(--fg); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .badge.req { background: #4a3500; color: #ffdf9e; } }
.amount { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.result a { display: inline-block; margin-top: 8px; font-weight: 600; font-size: 14px; }
#mand-table td.sel { background: var(--primary); color: var(--primary-fg); font-weight: 700; }
#mand-table th.sel { color: var(--fg); }

.callout { margin-top: 20px; font-size: 15px; border-left: 3px solid var(--primary); padding-left: 12px; }

/* contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }
.contact .section h2, .contact h2 { margin-bottom: 0; }
.contact-card { padding: 28px; display: grid; gap: 14px; justify-items: start; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--soft); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 40px; padding-bottom: 40px; }
.footer-grid p + p { margin-top: 4px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }

@media (forced-colors: active) {
  .seg button[aria-pressed="true"], #mand-table td.sel { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* small screens: keep diagram and tables legible, scroll horizontally */
@media (max-width: 640px) {
  .flow { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .flow svg { min-width: 600px; }
  .table-wrap table { min-width: 640px; }
  #mand-table { min-width: 520px; }
  .facts { grid-template-columns: 1fr; }
}
.hero-grid > *, .mand-grid > *, .program-grid > *, .contact > *, .footer-grid > * { min-width: 0; }
