/* 마이사바 CI(MysabaERP lib/brand/ci.ts): 남색 #0E2350 · 그린 #3AAA5A(포인트만) · 본문 #525252 · 선 #E5E5E5 · 면 #F7F7F7 · 주의 #B42318/#FEF3F2 · 상자 모서리 3px */
:root {
  --navy: #0E2350;
  --green: #3AAA5A;
  --gray: #525252;
  --line: #E5E5E5;
  --surface: #F7F7F7;
  --white: #FFFFFF;
  --red: #B42318;
  --pink: #FEF3F2;
  --radius: 3px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--gray);
  font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 위 2색 띠: 남색 66% + 흰 틈 + 그린, 맞닿는 끝은 빗금 */
.band { display: flex; height: 8px; }
.band-navy { width: 66%; background: #0E2350; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.band-green { flex: 1; margin-left: 4px; background: #3AAA5A; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
  padding-left: max(16px, env(safe-area-inset-left));
}

h1 { color: var(--navy); font-size: 22px; line-height: 1.35; margin: 4px 0 4px; }
.meta { margin: 0 0 12px; font-size: 14px; }
.intro {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  font-size: 15px;
}
.legend { font-size: 14px; margin: 0 0 8px; }

.req {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
}
.req.sm { margin-left: 6px; font-size: 11px; line-height: 18px; }

.sec { margin-top: 28px; }
.sec-title { color: var(--navy); font-size: 18px; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--navy); }
.sec-note { margin: 6px 0 0; font-size: 14px; }

.q {
  margin: 14px 0 0;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.q[hidden] { display: none; }
.q-title { float: left; width: 100%; padding: 0; color: var(--navy); font-weight: 700; font-size: 16px; display: flex; gap: 6px; }
.q-title + * { clear: both; }
.q-no { flex: none; }
.q-tags { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.q-hint { margin: 6px 0 0; font-size: 14px; }

.options { display: grid; gap: 6px; margin-top: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}
.opt:has(input:checked) { border-color: var(--navy); background: var(--surface); color: var(--navy); font-weight: 600; }
.opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); flex: none; }

input[type="text"], textarea, select {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #BDBDBD;
  border-radius: var(--radius);
  background: var(--white);
  color: #1F1F1F;
  font: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, .opt:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 1px; }
.q > input[type="text"], .q > textarea { margin-top: 10px; }

.sub { display: block; margin-top: 10px; }
.sub[hidden] { display: none; }
.sub-label { display: flex; align-items: center; font-size: 14px; color: var(--gray); margin: 0; }

.task { margin-top: 12px; padding: 10px 12px 12px; background: var(--surface); border-left: 3px solid var(--line); border-radius: var(--radius); }
.task-head { margin: 0; color: var(--navy); font-weight: 700; font-size: 15px; display: flex; align-items: center; }
.task .sub:first-of-type { margin-top: 6px; }

.scale { margin-top: 12px; }
.scale-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.scale-opt { position: relative; }
.scale-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.scale-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}
.scale-opt input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.scale-opt input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 1px; }
.scale-ends { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: 12px; }

/* 오류 */
.q.has-error { border-color: var(--red); border-left-color: var(--red); }
.has-error > input, .has-error > textarea, .has-error > select, .sub.has-error input, .sub.has-error select { border-color: var(--red); }
.err-msg { margin: 6px 0 0; color: var(--red); font-size: 14px; font-weight: 600; }
.errors {
  margin-top: 24px;
  padding: 12px 14px;
  background: var(--pink);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
}
.err-head { margin: 0 0 6px; font-weight: 700; }
.errors ul { margin: 0; padding-left: 18px; font-size: 14px; }
.errors a { color: var(--red); font-weight: 700; }

.submit {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.submit:disabled { opacity: .6; cursor: progress; }
.saved-note { font-size: 13px; text-align: center; margin: 8px 0 0; }

.done { margin-top: 24px; padding: 18px 16px; background: var(--surface); border-left: 3px solid var(--green); border-radius: var(--radius); }
.done h2 { color: var(--navy); margin: 0 0 6px; font-size: 20px; }
.done p { margin: 0; }
.loading { font-size: 14px; }
[hidden] { display: none !important; }
