:root {
  color-scheme: dark;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: #131611;
  color: #edf0e9;
  font-synthesis: none;
  --accent: #c9ecae;
  --text: #edf0e9;
  --muted: #adb5a6;
  --surface: #1b2019;
  --border: #343d31;
  --error: #ffb5a7;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p { margin: 0; }
fieldset { min-inline-size: 0; margin: 0; }
a { color: var(--accent); }
.layout { width: min(1088px, calc(100% - 64px)); margin-inline: auto; }
.masthead { display: flex; align-items: center; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: .92rem; font-weight: 650; letter-spacing: -.02em; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 52px 47px 45px; border: 1px solid #39483a; border-radius: 28px; background: #232e23; }
.hero h1 { font-size: clamp(2rem, 5vw, 4.06rem); letter-spacing: -.074em; line-height: 1.16; font-weight: 770; word-break: keep-all; }
.hero p { color: #c7d3c1; font-size: .99rem; margin-top: 21px; line-height: 1.7; word-break: keep-all; }
.hero-note { display: grid; gap: 6px; flex: none; padding-left: 22px; border-left: 1px solid #53654e; color: #d1dbcc; font-size: .81rem; line-height: 1.35; }
.hero-note strong { color: var(--accent); font-size: 1.27rem; letter-spacing: -.035em; }
.content { display: grid; grid-template-columns: 202px minmax(0, 1fr); align-items: start; column-gap: 48px; padding: 39px 0 64px; }
.rail { position: sticky; top: 24px; padding: 2px 0; }
.progress-caption { display: flex; justify-content: space-between; align-items: center; font-size: .79rem; color: var(--muted); font-weight: 650; }
progress { display: block; width: 100%; height: 5px; margin-top: 11px; border: 0; border-radius: 10px; background: #30372d; color: var(--accent); }
progress::-webkit-progress-bar { background: #30372d; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 10px; }
.steps { display: grid; gap: 8px; margin: 21px 0 0; padding: 0; list-style: none; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 13px; min-height: 40px; padding: 5px 8px; font-size: .84rem; overflow-wrap: anywhere; }
.steps li[aria-current] { background: #242d22; border-color: #3d503a; color: var(--accent); font-weight: 700; }
.steps li.complete { color: var(--text); }
.step-mark { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #485247; border-radius: 50%; font-size: .73rem; flex: none; }
[aria-current] .step-mark { background: var(--accent); border-color: var(--accent); color: #21341e; }
.section-head { margin-bottom: 15px; }
.section-kicker { display: block; color: var(--accent); font-size: .75rem; font-weight: 700; margin-bottom: 5px; }
.section-head h2, .outcome h2, .admin h1 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.06em; line-height: 1.3; scroll-margin-top: 20px; }
.notice { color: #c4cbbf; font-size: .91rem; line-height: 1.75; padding: 15px 18px; border: 1px solid var(--border); border-radius: 13px; background: #191e17; word-break: keep-all; overflow-wrap: anywhere; margin-bottom: 18px; }
.questions { display: grid; gap: 14px; }
.question, .outcome { position: relative; padding: 23px; background: var(--surface); border: 1px solid var(--border); border-radius: 19px; scroll-margin-top: 24px; }
.question-legend { display: contents; }
.question-heading { display: flex; gap: 10px; align-items: start; margin-bottom: 16px; }
.question-number { color: var(--accent); font-variant-numeric: tabular-nums; min-width: 25px; font-size: .84rem; font-weight: 700; margin-top: .18em; }
.prompt { color: var(--text); font-size: clamp(.98rem, 2vw, 1.11rem); line-height: 1.57; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: start; gap: 11px; min-height: 44px; padding: 11px 14px; border-radius: 13px; border: 1px solid #3a4436; background: #20261e; line-height: 1.45; font-size: .9rem; cursor: pointer; overflow-wrap: anywhere; }
.option input { margin: .14em 0 0; accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex: none; }
.option small { display: block; color: var(--muted); margin-top: 3px; font-size: .78rem; }
.option:hover { border-color: #687c5d; background: #273126; }
.option:has(input:checked) { border-color: #91a780; background: #2c3a28; }
.selection-count { display: block; margin: -5px 0 10px 35px; color: var(--muted); font-size: .78rem; }
.other, textarea, .admin input { width: 100%; background: #141a13; color: var(--text); border: 1px solid #566050; border-radius: 13px; padding: 11px 14px; font-size: .91rem; }
.other { margin-top: 9px; }
textarea { resize: vertical; line-height: 1.6; }
::placeholder { color: #a2ab9a; opacity: 1; }
.matrix-key { display: flex; flex-wrap: wrap; gap: 7px 15px; padding: 11px 12px; background: #252e23; border-radius: 11px; margin-bottom: 15px; color: #d2d9ce; font-size: .78rem; }
.key-item { display: flex; gap: 5px; }
.key-item b { color: var(--accent); }
.matrix-row { padding: 13px 0 14px; border: 0; border-bottom: 1px solid var(--border); }
.matrix-row:last-child { border-bottom: 0; padding-bottom: 0; }
.matrix-row legend { display: contents; color: #e2e7de; font-size: .92rem; font-weight: 650; line-height: 1.6; }
.matrix-letter { display: inline-block; min-width: 22px; color: var(--accent); }
.matrix-choices { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding-top: 9px; }
.matrix-choices .option { justify-content: center; align-items: center; min-width: 0; min-height: 43px; gap: 0; padding: 5px 2px; }
.matrix-choices .option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.matrix-choices .option:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; }
.button { padding: 11px 22px; border: 1px solid transparent; border-radius: 999px; min-height: 46px; cursor: pointer; font-size: .92rem; font-weight: 750; }
.button.primary { background: var(--accent); color: #1c2819; justify-self: end; margin-left: auto; }
.button.primary:hover { background: #d9f6c6; }
.button.secondary { background: #232a21; color: var(--text); border-color: #4b5746; }
.button.secondary:hover { background: #303a2d; }
.button:disabled { opacity: .62; cursor: wait; }
.error { color: var(--error); line-height: 1.5; font-size: .84rem; margin-top: 10px; }
.error:empty { display: none; }
.form-error { margin-top: 0; }
.question.invalid { border-color: #b4786e; }
.outcome { padding: 36px 25px; }
.outcome p { color: var(--muted); margin-top: 11px; line-height: 1.65; }
.admin { width: min(490px, calc(100% - 40px)); margin: 8vh auto; }
.admin h1 { margin-bottom: 12px; }
.admin p { color: var(--muted); line-height: 1.65; }
.admin form { display: grid; gap: 12px; margin-top: 23px; }
.admin label { display: grid; gap: 6px; }
.admin .status { margin-top: 14px; color: var(--error); }

@media (max-width: 780px) {
  .layout { width: min(660px, calc(100% - 34px)); }
  .masthead { min-height: 64px; }
  .hero { padding: 32px 23px; border-radius: 22px; }
  .hero p { margin-top: 14px; }
  .content { grid-template-columns: 1fr; row-gap: 23px; padding-top: 24px; }
  .rail { position: static; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 9px; gap: 4px; }
  .steps li { gap: 5px; font-size: .7rem; padding: 5px; }
  .step-mark { width: 20px; height: 20px; font-size: .62rem; }
}

@media (max-width: 480px) {
  .hero { align-items: start; flex-direction: column; gap: 20px; }
  .hero-note { display: flex; align-items: center; gap: 8px; padding-left: 0; border: 0; }
  .hero-note strong { font-size: .9rem; }
  .hero-note span:last-child { padding-left: 8px; border-left: 1px solid #53654e; }
  .question { padding: 16px; }
  .option { padding-inline: 11px; }
}

.admin.is-open { width: min(820px, calc(100% - 40px)); margin-block: 6vh; }
.dashboard-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 20px; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.dashboard-actions .button, .page-nav .button { padding-inline: 15px; }
.dashboard-actions .button:disabled, .page-nav .button:disabled { cursor: default; }
.admin .status:empty { display: none; }
#response-list { display: grid; gap: 9px; }
.response-entry { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; }
.response-summary { padding: 13px 16px; min-height: 48px; cursor: pointer; line-height: 1.6; }
.response-summary::marker { color: var(--accent); }
.response-summary strong { margin-inline: 6px 11px; }
.response-summary time { color: var(--muted); font-size: .84rem; }
.response-position { color: var(--accent); margin-left: 11px; font-size: .83rem; overflow-wrap: anywhere; }
.response-answers { border-top: 1px solid var(--border); margin: 0 16px; padding-block: 13px; overflow-wrap: anywhere; }
.response-answers dt { font-weight: 650; margin-top: 11px; line-height: 1.55; }
.response-answers dd { color: #c4cbbf; margin: 4px 0 15px; white-space: pre-wrap; line-height: 1.65; }
.response-answers dd:last-child { margin-bottom: 4px; }
.response-answers ul { margin: 0; padding-left: 19px; }
.response-answers small { display: block; margin-top: 6px; color: var(--muted); }
.page-nav { display: flex; justify-content: center; align-items: center; gap: 13px; margin-top: 18px; color: var(--muted); font-size: .86rem; }

.survey-charts {
  margin-bottom: 26px;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.chart-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.chart-heading h2, .individual-heading { margin: 0; font-size: 1.2rem; }
.chart-heading label { display: grid; gap: 4px; min-width: 0; max-width: 100%; color: var(--muted); font-size: .83rem; }
.chart-heading select {
  width: min(100%, 22rem);
  min-height: 42px;
  color: var(--text);
  background: #181e16;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  font: inherit;
  font-size: .92rem;
  text-overflow: ellipsis;
}
#survey-chart h3 { margin: 15px 0 0; font-size: 1rem; line-height: 1.55; }
.chart-guidance, .chart-total, .chart-empty { font-size: .88rem; }
.chart-guidance { margin-top: 5px; }
.chart-card { margin: 12px 0 0; padding: 12px 0 6px; border-top: 1px solid var(--border); }
.chart-card figcaption { margin-bottom: 5px; font-weight: 640; font-size: .94rem; }
.chart-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 10px; }
.response-pie { display: block; width: 176px; height: 176px; margin-inline: auto; }
.pie-legend { display: grid; gap: 5px; list-style: none; margin: 0; padding: 0; }
.pie-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; align-items: baseline; font-size: .84rem; line-height: 1.5; }
.pie-legend b { color: var(--muted); white-space: nowrap; font-weight: 560; font-variant-numeric: tabular-nums; }
.pie-key { width: 10px; height: 10px; border-radius: 3px; }
.individual-heading { margin: 0 0 9px; }

@media (max-width: 520px) {
  .survey-charts { padding: 14px; }
  .chart-heading { align-items: start; flex-direction: column; }
  .chart-layout { grid-template-columns: minmax(0, 1fr); gap: 9px; }
}
