:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d9e0e7;
  --primary: #1769aa;
  --primary-dark: #0f4f82;
  --primary-soft: #eaf3fb;
  --success: #176b45;
  --success-bg: #e9f7ef;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --warning-bg: #fff8e8;
  --shadow: 0 8px 28px rgba(16, 24, 40, .07);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.62;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-weight: 800; color: var(--text); }
.admin-nav { display: flex; gap: 18px; font-size: 14px; }
.main-content { padding: 34px 0 60px; }
.site-footer { color: var(--muted); font-size: 13px; padding: 28px 0 42px; text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.narrow { max-width: 680px; margin: 40px auto; }
.centered { text-align: center; }
.eyebrow { color: var(--primary); font-weight: 800; font-size: 13px; letter-spacing: .03em; margin-bottom: 8px; }
h1, h2, h3 { line-height: 1.3; margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 18px; }
h2 { font-size: 25px; }
h3 { font-size: 19px; }
.hero { max-width: 900px; margin: 0 auto; }
.hero p { font-size: 16px; }
.notice-box, .training-note { border-radius: 12px; padding: 16px 18px; margin: 20px 0; }
.notice-box { background: var(--warning-bg); border: 1px solid #f1d58d; }
.training-note { background: var(--primary-soft); border: 1px solid #bfd7eb; }
.contact, .muted, .help-text { color: var(--muted); }
.contact { margin-top: 20px; font-size: 14px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 18px; font-weight: 800;
  cursor: pointer; font-size: 15px; text-decoration: none; min-height: 44px;
}
.button:hover { text-decoration: none; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #fff; color: var(--text); border-color: var(--line); }
.button.danger { background: #fff; color: var(--danger); border-color: #f2b8b5; }
.button.large { padding: 14px 24px; font-size: 17px; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.flash-stack { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; border: 1px solid; }
.flash.error { background: var(--danger-bg); color: var(--danger); border-color: #fac5bf; }
.flash.success { background: var(--success-bg); color: var(--success); border-color: #b7e4ca; }
.status-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--success-bg); color: var(--success); font-size: 32px; font-weight: 900; }
.response-code { margin: 22px auto; max-width: 380px; padding: 16px; background: #f8fafc; border: 1px dashed #aab5c3; border-radius: 12px; display: grid; gap: 4px; }
.response-code span { font-size: 13px; color: var(--muted); }
.response-code strong { font-size: 22px; letter-spacing: .05em; }

.survey-shell { max-width: 1080px; margin: 0 auto; }
.survey-topbar { display: grid; grid-template-columns: 1fr 260px; gap: 30px; align-items: center; margin-bottom: 18px; position: sticky; top: 78px; z-index: 20; }
.survey-topbar h1 { font-size: 24px; margin-bottom: 6px; }
.progress-box { min-width: 220px; }
.progress-label { text-align: right; font-weight: 800; margin-bottom: 7px; }
.progress-track { height: 10px; border-radius: 999px; background: #e8edf2; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.survey-section { display: none; margin-bottom: 18px; }
.survey-section.active-step { display: block; }
.survey-section[hidden] { display: none !important; }
.section-heading { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); margin: -4px 0 22px; padding-bottom: 16px; }
.section-heading h2 { margin: 8px 0 0; }
.audience-badge { display: inline-block; background: #eef2f6; color: #475467; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.question-block { padding: 20px 0; border-bottom: 1px solid #edf0f3; }
.question-block:last-child { border-bottom: 0; }
.question-title { display: flex; gap: 8px; align-items: flex-start; font-weight: 750; font-size: 16px; }
.q-number { color: var(--primary); font-weight: 900; white-space: nowrap; }
.required-mark { color: var(--danger); font-weight: 900; }
.help-text { margin: 8px 0 12px; padding-left: 3px; font-size: 14px; }
.choice-list { display: grid; gap: 9px; margin-top: 14px; }
.check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 13px; cursor: pointer; }
.choice:hover { border-color: #a8c8e0; background: #fbfdff; }
.choice input { margin-top: 4px; accent-color: var(--primary); }
.other-wrap { margin: 12px 0 0; }
.other-wrap label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.text-input, .text-area {
  width: 100%; border: 1px solid #b9c3cf; border-radius: 10px; padding: 11px 12px; font: inherit; color: var(--text); background: #fff;
}
.text-area { min-height: 130px; resize: vertical; }
.text-input:focus, .text-area:focus { outline: 3px solid rgba(23, 105, 170, .13); border-color: var(--primary); }
.char-count { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.client-error { color: var(--danger); font-weight: 700; font-size: 13px; margin-top: 8px; }
.has-error { background: #fffafa; box-shadow: inset 4px 0 0 var(--danger); padding-left: 14px; }
.matrix-block { margin: 24px 0 32px; }
.matrix-intro { color: #475467; }
.matrix-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.matrix-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.matrix-table th, .matrix-table td { border-bottom: 1px solid #e6eaee; padding: 12px 10px; vertical-align: middle; }
.matrix-table thead th { background: #f8fafc; font-size: 12px; text-align: center; color: #475467; }
.matrix-table thead th:first-child { text-align: left; width: 50%; }
.matrix-table td:not(:first-child) { text-align: center; width: 10%; }
.matrix-choice { display: inline-grid; place-items: center; cursor: pointer; width: 100%; }
.matrix-choice input { accent-color: var(--primary); width: 18px; height: 18px; }
.matrix-short { display: none; }
.wizard-actions { display: flex; gap: 10px; align-items: center; position: sticky; bottom: 12px; z-index: 25; padding: 14px; }
.wizard-spacer { flex: 1; }

.admin-layout { display: grid; gap: 18px; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.admin-heading h1 { font-size: 30px; margin-bottom: 0; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.metric-card span { display: block; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; font-size: 30px; margin-top: 4px; }
.admin-grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 10px; border-bottom: 1px solid #e8edf2; text-align: left; font-size: 14px; vertical-align: top; }
.data-table th { color: #475467; font-size: 12px; background: #f8fafc; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 800; background: #eef2f6; }
.pill.yes { background: var(--success-bg); color: var(--success); }
.pill.no { background: #f2f4f7; color: #667085; }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(160px,1fr) 2fr 55px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 12px; background: #edf1f5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); }
.form-grid { display: grid; gap: 14px; }
.form-row label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.login-card { max-width: 460px; margin: 50px auto; }
.detail-list { display: grid; gap: 16px; }
.detail-group { border-top: 1px solid var(--line); padding-top: 16px; }
.detail-item { padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.detail-item dt { font-weight: 800; }
.detail-item dd { margin: 5px 0 0; white-space: pre-wrap; color: #344054; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.inline-form { display: inline; }
.danger-zone { border-color: #fac5bf; }

@media (max-width: 900px) {
  .survey-topbar { grid-template-columns: 1fr; position: static; }
  .progress-box { min-width: 0; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .admin-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { width: min(100% - 20px, 1180px); }
  .main-content { padding-top: 18px; }
  .card { padding: 18px; border-radius: 12px; }
  .header-inner { align-items: flex-start; padding: 12px 0; flex-direction: column; gap: 7px; }
  .site-header { position: static; }
  .admin-nav { gap: 12px; }
  .check-grid { grid-template-columns: 1fr; }
  .survey-topbar h1 { font-size: 20px; }
  .section-heading h2 { font-size: 21px; }
  .wizard-actions { bottom: 6px; }
  .wizard-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
}
