/* 한비즈 민원 작성 시스템 — 비개발자·난독증 배려: 큰 활자, 큰 버튼, 차분한 크림 배경 */
/* 고급화(초호화) 리스타일 — 입력화면은 밝고 눈편하게 + 프리미엄 질감 / 결과 민원글은 다크 공문 시트 */
@font-face { font-family:'Pretendard'; font-weight:400; font-style:normal; font-display:swap; src:url('/fonts/Pretendard-Regular.woff2') format('woff2'); }
@font-face { font-family:'Pretendard'; font-weight:500; font-style:normal; font-display:swap; src:url('/fonts/Pretendard-Medium.woff2') format('woff2'); }
@font-face { font-family:'Pretendard'; font-weight:600; font-style:normal; font-display:swap; src:url('/fonts/Pretendard-SemiBold.woff2') format('woff2'); }
@font-face { font-family:'Pretendard'; font-weight:700; font-style:normal; font-display:swap; src:url('/fonts/Pretendard-Bold.woff2') format('woff2'); }
:root {
  --navy: #16233f;
  --navy-hi: #223763;      /* 네이비 그라데이션 상단(밝은쪽) */
  --blue: #1e3a8f;
  --accent: #2f56c8;
  --accent-hi: #3f66d8;    /* 액센트 그라데이션 상단 */
  --accent-deep: #2545a8;  /* 액센트 그라데이션 하단 */
  --orange: #f5821f;
  --orange-deep: #e06c0c;
  --green: #16a34a;
  --green-hi: #1fb457;
  --cream: #f6f3ec;
  --paper: #fbfaf7;
  --ink: #1b2130;
  --muted: #5d6472;
  --line: #e6e1d5;
  --line-strong: #cfc8b6;
  --gold: #c9a24a;
  --gold-hi: #e6c877;
  --amber-bg: #fff6d9;
  --amber-line: #f2c94c;
  /* 프리미엄 다층 그림자 시스템 — 은은하고 깊게, 네이비 틴트 */
  --shadow-sm: 0 1px 2px rgba(22,35,63,.05), 0 2px 6px rgba(22,35,63,.05);
  --shadow: 0 1px 0 rgba(255,255,255,.75) inset, 0 1px 2px rgba(22,35,63,.04), 0 6px 16px rgba(22,35,63,.06), 0 20px 44px rgba(22,35,63,.07);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.75) inset, 0 4px 10px rgba(22,35,63,.08), 0 26px 56px rgba(22,35,63,.12);
  --radius: 18px;
  --radius-sm: 13px;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  /* 미묘한 대기감 — 옅은 블루/앰버 라디얼 + 크림 세로 그라데이션(과하지 않게, 고정) */
  background:
    radial-gradient(1200px 620px at 12% -12%, rgba(47,86,200,.055), transparent 60%),
    radial-gradient(1000px 520px at 102% -4%, rgba(245,130,31,.045), transparent 58%),
    linear-gradient(180deg, #f8f5ee 0%, #f2eee4 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;      /* 한글 단어 단위 줄바꿈 — 어절 중간에서 안 끊겨 훨씬 덜 '짜쳐' 보임 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

/* ===== Header ===== */
.site-header {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf7 100%);
  color: var(--navy);
  padding: 17px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #e7e3d9;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 2px 10px rgba(22, 35, 63, 0.05);
}
/* 마스트헤드 하단 — 얇은 네이비→골드 실선 악센트(고급 레터헤드 느낌) */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--accent) 42%, var(--gold) 100%);
  opacity: .55;
}
.wordmark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-img { height: 40px; width: auto; display: block; flex: 0 0 auto; }
.wordmark .sub {
  font-size: 15px;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-left: 14px;
  border-left: 1px solid #d8d4c8;
  white-space: nowrap;
}
/* 로그인 화면 로고 (밝은 배경, 투명 PNG) */
.login-logo { text-align: center; margin: 0 0 24px; }
.login-logo img { width: 100%; max-width: 320px; height: auto; }
.site-header .who { margin-left: auto; font-size: 14px; color: #55617e; display: flex; align-items: center; gap: 12px; font-weight: 600; }
.site-header .who button {
  background: #fff; color: var(--navy); border: 1px solid #d4d9e6;
  border-radius: 10px; padding: 7px 14px; font-size: 13px; font-weight: 700;
  box-shadow: 0 1px 2px rgba(22,35,63,.05); transition: border-color .15s, box-shadow .2s, transform .1s;
}
.site-header .who button:hover { border-color: var(--accent); box-shadow: 0 3px 10px rgba(47,86,200,.14); }
.site-header .who button:active { transform: translateY(1px); }

/* ===== Layout ===== */
.wrap { max-width: 960px; margin: 0 auto; padding: 34px 20px 92px; }
.center-wrap { max-width: 470px; margin: 0 auto; padding: 9vh 20px 40px; }

/* ===== Step rail (signature) — 프리미엄 진행 표시 ===== */
.rail { display: flex; align-items: center; margin: 8px 0 36px; }
.rail .station { display: flex; flex-direction: column; align-items: center; gap: 9px; flex: 0 0 auto; }
.rail .dot {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #f2eee4 100%);
  border: 2px solid var(--line-strong);
  color: var(--muted); font-weight: 800; font-size: 19px;
  display: grid; place-items: center;
  box-shadow: 0 1px 2px rgba(22,35,63,.06), inset 0 1px 0 rgba(255,255,255,.9);
  transition: all .35s cubic-bezier(.2,.7,.3,1);
}
.rail .label { font-size: 14.5px; color: var(--muted); font-weight: 700; white-space: nowrap; letter-spacing: -0.01em; }
.rail .bar { flex: 1 1 auto; height: 3px; background: var(--line-strong); margin: 0 10px; margin-bottom: 32px; border-radius: 3px; transition: background .4s; }
/* 완료 단계: 색(초록)만이 아니라 ✓ 아이콘도 함께 = 색맹·난독증 배려 이중코딩 */
.rail .station.done .dot {
  background: linear-gradient(180deg, var(--green-hi) 0%, #128540 100%);
  border-color: #128540; color: transparent; position: relative;
  box-shadow: 0 4px 12px rgba(18,133,64,.28), inset 0 1px 0 rgba(255,255,255,.25);
}
.rail .station.done .dot::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 22px; font-weight: 800;
}
.rail .station.done .label { color: #128540; }
.rail .station.active .dot {
  background: linear-gradient(180deg, var(--navy-hi) 0%, var(--navy) 100%);
  border-color: var(--navy); color: #fff;
  box-shadow: 0 0 0 5px rgba(22,35,63,.10), 0 8px 20px rgba(22,35,63,.32), inset 0 1px 0 rgba(255,255,255,.18);
}
.rail .station.active .label { color: var(--navy); font-weight: 800; }
.rail .bar.filled { background: linear-gradient(90deg, var(--green-hi), #128540); }

/* ===== Cards / panels ===== */
.card {
  background: linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 36px;
  position: relative;
  animation: cardIn .5s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.card + .card { margin-top: 22px; }
h1.title { font-size: 30px; font-weight: 800; margin: 0 0 8px; color: var(--navy); letter-spacing: -0.7px; line-height: 1.28; }
h2.step-title { font-size: 24px; font-weight: 800; margin: 0 0 5px; color: var(--navy); letter-spacing: -0.5px; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 16px; line-height: 1.65; }

/* ===== Form ===== */
.field { margin-bottom: 24px; }
.field > label.q { display: block; font-weight: 800; margin-bottom: 9px; font-size: 16.5px; color: var(--ink); letter-spacing: -0.02em; }
.field > label.q .opt { font-weight: 700; font-size: 12px; color: var(--muted); background: #efece2; border: 1px solid #e4e0d3; border-radius: 999px; padding: 2px 10px; margin-left: 7px; vertical-align: middle; }
.field .req { color: var(--orange); margin-left: 5px; font-size: 14px; font-weight: 800; }
.field .hint { color: var(--muted); font-size: 14px; margin: 5px 0 0; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 15px 17px; background: #fff;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(22,35,63,.03);
  transition: border-color .15s, box-shadow .22s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47,86,200,.14), inset 0 1px 2px rgba(22,35,63,.02);
}
textarea { min-height: 92px; resize: vertical; }
::placeholder { color: #aaa596; }

/* 먼데이 불러오기 패널 — 프리미엄 검색 콘솔 */
.monday-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #f1f5fe 0%, #e7eefb 100%);
  border: 1.5px solid #c7d3f2; border-radius: 16px;
  padding: 20px 20px 18px; margin-bottom: 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 8px 24px rgba(30,58,143,.09);
}
/* 우상단 옅은 광택 — 콘솔의 유리 질감 */
.monday-panel::before {
  content: ""; position: absolute; top: -40px; right: -30px; width: 180px; height: 120px;
  background: radial-gradient(closest-side, rgba(63,102,216,.16), transparent 70%);
  pointer-events: none;
}
.monday-panel .mday-title { font-weight: 800; color: var(--blue); font-size: 16.5px; margin-bottom: 4px; letter-spacing: -0.02em; }
.monday-panel .mday-sub { font-weight: 500; color: var(--muted); font-size: 13px; }
.mday-row { display: flex; gap: 10px; margin-top: 14px; }
.mday-row input { flex: 1; }
.mday-row .btn { min-height: 54px; padding: 0 24px; }
.mday-status { margin-top: 11px; font-size: 14px; color: var(--muted); }
.mday-status.err { color: #a32020; }
.mday-results { margin-top: 13px; display: flex; flex-direction: column; gap: 9px; }
.mday-result {
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 13px 15px; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(22,35,63,.04);
  transition: border-color .15s, box-shadow .2s, transform .12s;
}
.mday-result:hover { border-color: var(--accent); box-shadow: 0 6px 16px rgba(47,86,200,.14); transform: translateY(-1px); }
.mday-result .rname { font-weight: 800; letter-spacing: -0.01em; }
.mday-result .rmeta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.mday-loaded {
  margin-top: 13px; background: linear-gradient(180deg, #ecfbf2, #e3f6ec);
  border: 1.5px solid #b6e6c8; border-radius: 12px;
  padding: 13px 15px; font-size: 14px; color: #157a3a; font-weight: 600;
  box-shadow: 0 4px 14px rgba(21,122,58,.08);
}

/* choice buttons (기관·감정 등) */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  background: linear-gradient(180deg, #ffffff, #fbfaf6); border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 12px 19px; font-weight: 700; font-size: 16px; color: var(--ink);
  box-shadow: 0 1px 2px rgba(22,35,63,.04);
  transition: all .16s cubic-bezier(.2,.7,.3,1);
}
.choice:hover { border-color: var(--accent); color: var(--accent-deep); box-shadow: 0 5px 14px rgba(47,86,200,.14); transform: translateY(-1px); }
.choice.on {
  background: linear-gradient(180deg, var(--navy-hi), var(--navy)); border-color: var(--navy); color: #fff;
  box-shadow: 0 6px 16px rgba(22,35,63,.26), inset 0 1px 0 rgba(255,255,255,.14);
}
.choice.multi.on {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-deep)); border-color: var(--accent-deep);
  box-shadow: 0 6px 16px rgba(47,86,200,.28), inset 0 1px 0 rgba(255,255,255,.18);
}

/* collapsible */
.collapse-toggle {
  width: 100%; text-align: left; background: #fff; border: 1.5px dashed var(--line-strong);
  border-radius: 12px; padding: 16px 18px; font-weight: 800; color: var(--blue);
  display: flex; align-items: center; justify-content: space-between;
  transition: border-color .15s, background .15s;
}
.collapse-toggle:hover { border-color: var(--accent); background: #fbfcff; }
.collapse-body { padding-top: 18px; }

/* 녹취록/상담 붙여넣기 — 직원이 유일하게 '붙여넣기'만 하는 큰 선택 입력 */
.rec-field { margin-top: 4px; padding: 20px; background: linear-gradient(180deg, #f5f9f3, #eef5ec); border: 1.5px solid #cfe0cc; border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.rec-field > label.q { margin-bottom: 4px; }
.rec-field .hint { margin: 2px 0 12px; }
.rec-field .opt { background: #dcefd7; color: #2f7a3a; border-color: #c3e3bd; }
.rec-box { min-height: 132px; background: #fff; }

/* ===== Buttons ===== */
.btn {
  border: none; border-radius: 14px; padding: 16px 28px; font-size: 18px; font-weight: 800;
  min-height: 58px; letter-spacing: -0.01em; position: relative;
  transition: transform .12s cubic-bezier(.2,.7,.3,1), box-shadow .22s, filter .18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent-deep) 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 2px 5px rgba(22,35,63,.14), 0 8px 20px rgba(41,73,180,.26);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.03); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 8px rgba(22,35,63,.16), 0 14px 30px rgba(41,73,180,.34); }
.btn-primary:active { transform: translateY(0); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 6px rgba(41,73,180,.24); }
.btn-ghost {
  background: linear-gradient(180deg, #ffffff, #fbfaf6); border: 1.5px solid var(--line-strong); color: var(--ink);
  box-shadow: 0 1px 2px rgba(22,35,63,.05);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(47,86,200,.14); }
.btn-ghost:active { transform: translateY(0); }
.btn-navy {
  background: linear-gradient(180deg, var(--navy-hi) 0%, var(--navy) 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 2px 5px rgba(22,35,63,.18), 0 8px 20px rgba(22,35,63,.28);
}
.btn-navy:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 14px 30px rgba(22,35,63,.36); }
.btn-navy:active { transform: translateY(0); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; margin-top: 28px; }
.btn-row .grow { flex: 1; }

/* ===== Evidence cards ===== */
.ev-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(180deg, #ffffff, #fcfbf7); border: 1.5px solid var(--line-strong); border-radius: 15px;
  padding: 17px 19px; margin-bottom: 14px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(22,35,63,.04);
  transition: border-color .16s, background .16s, box-shadow .22s, transform .12s;
}
.ev-card:hover { border-color: #a9d9bd; box-shadow: 0 6px 16px rgba(22,35,63,.08); transform: translateY(-1px); }
.ev-card.on { border-color: var(--green); background: linear-gradient(180deg, #f4fcf7, #ecf9f1); box-shadow: 0 6px 18px rgba(21,122,58,.12); }
.ev-card .chk {
  width: 27px; height: 27px; border-radius: 8px; border: 2px solid var(--line-strong);
  display: grid; place-items: center; flex: 0 0 auto; margin-top: 2px; font-size: 16px; color: #fff; background: #fff;
  transition: background .16s, border-color .16s;
}
.ev-card.on .chk { background: linear-gradient(180deg, var(--green-hi), #128540); border-color: #128540; box-shadow: 0 2px 6px rgba(18,133,64,.28); }
.ev-card .body { flex: 1; }
.ev-card .ev-title { font-weight: 800; margin-bottom: 5px; letter-spacing: -0.01em; }
.ev-card .ev-desc { color: var(--muted); font-size: 15px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.badge.high { background: #e6f4ea; color: #157a3a; border: 1px solid #c9e9d4; }
.badge.mid { background: #eef2fd; color: var(--blue); border: 1px solid #d3ddf6; }
.badge.low { background: #f2efe6; color: var(--muted); border: 1px solid #e6e1d3; }
/* 그룹 구분용 — 크게 볼드로 외치지 않고, 작은 대문자 트래킹의 조용한 구분선으로. */
.section-label {
  font-weight: 800; color: var(--muted); font-size: 12.5px; letter-spacing: 0.07em;
  margin: 28px 0 13px; padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
/* 짧은 악센트 틱 — 조용한 프리미엄 디테일 */
.section-label::before {
  content: ""; display: inline-block; width: 15px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold)); vertical-align: middle; margin-right: 9px;
}

/* ===== Loading ===== */
.loading { text-align: center; padding: 44px 10px; }
.spinner {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 22px;
  border: 5px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; max-width: 420px; margin: 20px auto 10px; box-shadow: inset 0 1px 2px rgba(22,35,63,.08); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-hi), var(--blue)); border-radius: 999px; transition: width .4s; }
.loading .note { color: var(--muted); font-size: 15px; }

/* ===== Result: official document sheet (signature) ===== */
.result-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
/* ===== 결과 민원글: 다크 공문 레터헤드 시트 (하이브리드 — 결과만 격조있게 어둡게) ===== */
.doc {
  position: relative;
  background: linear-gradient(165deg, #1a2740 0%, #141d33 55%, #101728 100%);
  border: 1px solid #29375a; border-radius: 16px;
  box-shadow: 0 2px 6px rgba(9,14,26,.4), 0 30px 64px rgba(9,14,26,.4);
  overflow: hidden;
}
/* 골드 포일 상단 바 */
.doc .doc-top { height: 4px; background: linear-gradient(90deg, #b58f3d, var(--gold-hi) 45%, #f0dca0 55%, var(--gold) 100%); }
/* 우상단 옅은 골드 광휘 — 인장/문서 격조 */
.doc::after {
  content: ""; position: absolute; top: 0; right: 0; width: 60%; height: 55%;
  background: radial-gradient(closest-side at 100% 0%, rgba(201,162,74,.10), transparent 72%);
  pointer-events: none;
}
.doc .doc-inner { position: relative; z-index: 1; padding: 40px 44px 46px; }
/* 레터헤드: 금색 얇은 밑줄 + 문서명 + 인장 느낌 */
.doc .doc-letterhead {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 1px solid rgba(201,162,74,.42); padding-bottom: 15px; margin-bottom: 22px;
}
.doc .dl-mark { font-size: 12.5px; letter-spacing: 0.17em; color: #ddc78c; font-weight: 700; }
.doc .dl-seal {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid #c0473a;
  color: #dc7a70; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  transform: rotate(-7deg); letter-spacing: 0.02em;
  box-shadow: 0 0 0 3px rgba(192,71,58,.10);
}
.doc .doc-kind {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.05em;
  color: #d3ddf2; background: rgba(120,140,190,.2); border: 1px solid rgba(120,140,190,.3);
  border-radius: 8px; padding: 5px 13px; margin-bottom: 15px;
}
.doc .doc-title { font-size: 23px; font-weight: 800; color: #f4f7fd; margin: 0 0 19px; line-height: 1.5; letter-spacing: -0.02em; }
.doc .doc-body {
  font-size: 17.5px; line-height: 1.98; white-space: pre-wrap; word-break: keep-all;
  color: #dde4f1;
}
.doc .doc-body mark.need {
  background: rgba(230,200,119,.17); border-bottom: 2px solid var(--gold);
  padding: 0 3px; border-radius: 3px; color: #f1d99e; font-weight: 700;
}
.side { position: sticky; top: 22px; }
.side h3 { font-size: 15px; font-weight: 800; color: var(--navy); margin: 0 0 13px; text-transform: none; letter-spacing: -0.01em; }
/* 각주 스타일 — 디버그 박스가 아니라 문서 하단 각주처럼: 얇은 좌측 괘선 + 조용한 활자 */
.foot {
  border-left: 2px solid var(--line-strong); padding: 2px 0 2px 15px;
  margin-bottom: 15px; font-size: 13.5px; line-height: 1.55;
}
.foot .fref { font-weight: 800; color: var(--ink); }
.foot .fsrc { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.flag-box { background: linear-gradient(180deg, #fff8e0, var(--amber-bg)); border: 1px solid var(--amber-line); border-radius: 11px; padding: 13px 15px; font-size: 14px; margin-bottom: 15px; color: #7a5a00; box-shadow: 0 4px 12px rgba(242,201,76,.14); }
.flag-box b { color: #6b4e00; }

/* tone slider + regen */
.regen { margin-top: 24px; padding: 22px; background: linear-gradient(180deg, #ffffff, var(--paper)); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.regen .slabel { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 30px; }

/* toast / error */
.alert { background: linear-gradient(180deg, #fef0f0, #fdecec); border: 1px solid #f2b8b8; color: #a32020; border-radius: 13px; padding: 15px 17px; margin-bottom: 18px; font-size: 15px; font-weight: 600; box-shadow: 0 4px 14px rgba(163,32,32,.08); }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: linear-gradient(180deg, var(--navy-hi), var(--navy)); color: #fff; padding: 15px 26px; border-radius: 999px; font-weight: 800;
  box-shadow: 0 14px 36px rgba(9,14,26,.4), inset 0 1px 0 rgba(255,255,255,.16); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.link-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 800; text-decoration: none; }
.link-btn:hover { color: var(--accent); }
.copy-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

/* ===== 자동 인식 뱃지 (주민번호 파생·접수보드) ===== */
.auto-badge {
  display: inline-block; font-size: 12px; font-weight: 700; vertical-align: middle;
  background: #eef2fd; color: var(--blue); border: 1px solid #c7d3f2;
  padding: 3px 11px; border-radius: 999px; margin-left: 8px;
}
.amount-badge { margin-top: 8px; font-size: 14px; font-weight: 600; }
.amount-badge.hidden { display: none; }
.amount-badge.loading { color: var(--muted); }
.amount-badge.ok { color: #157a3a; }
.amount-badge.muted { color: var(--muted); }
.amount-badge.err { color: #a32020; }

/* ===== 상담 댓글 참조 패널 (휴대폰 프레임, sticky) ===== */
.ref-toggle {
  position: fixed; right: 18px; bottom: 20px; z-index: 60;
  background: linear-gradient(180deg, var(--navy-hi), var(--navy)); color: #fff; border: none; border-radius: 999px;
  padding: 13px 20px; font-size: 15px; font-weight: 800;
  box-shadow: 0 10px 26px rgba(9,14,26,.34), inset 0 1px 0 rgba(255,255,255,.16);
  transition: transform .12s, box-shadow .2s;
}
.ref-toggle:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(9,14,26,.42); }
.ref-toggle:active { transform: translateY(0); }
.ref-panel { position: fixed; top: 88px; right: 20px; width: 330px; z-index: 55; animation: refSlideIn .22s ease; }
@keyframes refSlideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ref-panel { animation: none; } }
.ref-phone {
  background: linear-gradient(180deg, #131926, #0d121b); border-radius: 28px; padding: 10px;
  box-shadow: 0 18px 48px rgba(16,21,31,.42); border: 1px solid #05070c;
  display: flex; flex-direction: column; max-height: calc(100vh - 120px);
}
.ref-phone::before {
  content: ""; display: block; width: 46px; height: 5px; border-radius: 3px;
  background: #2b3444; margin: 2px auto 8px;
}
.ref-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.ref-title { color: #fff; font-weight: 800; font-size: 16px; }
.ref-close { background: transparent; color: #9aa4b8; border: none; font-size: 18px; padding: 4px 8px; }
.ref-close:hover { color: #fff; }
.ref-sub { color: #7d879b; font-size: 12px; padding: 2px 8px 8px; }
.ref-comments {
  background: #f6f3ec; border-radius: 16px; padding: 10px; overflow-y: auto;
  flex: 1; display: flex; flex-direction: column; gap: 8px;
}
.ref-msg { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(22,35,63,.04); }
.ref-msg.reply { margin-left: 20px; background: #eef2fd; border-color: #cfdaf5; }
.ref-msg.intake { background: #fff6d9; border-color: #f2c94c; }
.ref-msg.intake .ref-meta { color: #7a5a00; }
/* 부결 요약 — 패널 상단 한눈 카드 (부결기관/부결일/사유) */
.ref-summary { background: #fff; border: 1.5px solid #f0b8b0; border-left: 4px solid #c0473a; border-radius: 12px; padding: 13px 15px; box-shadow: 0 4px 14px rgba(192,71,58,.1); }
.ref-summary-h { font-size: 13px; font-weight: 800; color: #9c3b2e; margin-bottom: 8px; letter-spacing: 0.01em; }
.ref-summary-row { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.5; padding: 2px 0; }
.ref-summary-row .rs-k { flex: 0 0 66px; color: var(--muted); font-weight: 700; }
.ref-summary-row .rs-v { flex: 1; color: var(--ink); font-weight: 600; word-break: break-word; }
.ref-msg .ref-meta { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.ref-msg .ref-text { font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.ref-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 20px 8px; }
.ref-foot { color: #7d879b; font-size: 11px; text-align: center; padding: 8px 6px 2px; }

/* ===== A/B 선택 카드 ===== */
.ab-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.ab-card {
  border: 2px solid var(--line-strong); border-radius: 17px; background: linear-gradient(180deg, #ffffff, #fcfbf7);
  padding: 20px; display: flex; flex-direction: column; min-height: 220px;
  box-shadow: 0 1px 2px rgba(22,35,63,.04); transition: border-color .16s, box-shadow .22s, transform .12s;
}
.ab-card:hover { box-shadow: 0 10px 26px rgba(22,35,63,.1); transform: translateY(-2px); }
.ab-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.ab-tag { font-size: 14px; font-weight: 800; color: #fff; border-radius: 8px; padding: 4px 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.22); }
.ab-tag.tag-a { background: linear-gradient(180deg, var(--accent-hi), var(--accent-deep)); }
.ab-tag.tag-b { background: linear-gradient(180deg, #ff9636, var(--orange-deep)); }
.ab-card.pick-a { border-color: var(--accent); box-shadow: 0 10px 26px rgba(47,86,200,.16); }
.ab-card.pick-b { border-color: var(--orange); box-shadow: 0 10px 26px rgba(245,130,31,.16); }
.ab-kind { font-weight: 800; color: var(--navy); font-size: 15px; }
.ab-card-body { flex: 1; display: flex; flex-direction: column; }
.ab-prev-title { font-weight: 800; color: var(--navy); font-size: 17px; margin-bottom: 8px; line-height: 1.4; letter-spacing: -0.01em; }
.ab-prev-text { color: #3a4356; font-size: 15px; line-height: 1.7; flex: 1; }
.ab-pick-btn { margin-top: 15px; border: none; border-radius: 13px; padding: 14px; font-size: 16px; font-weight: 800; color: #fff; transition: transform .12s, filter .18s, box-shadow .2s; }
.ab-pick-btn.a { background: linear-gradient(180deg, var(--accent-hi), var(--accent-deep)); box-shadow: 0 6px 16px rgba(41,73,180,.24), inset 0 1px 0 rgba(255,255,255,.24); }
.ab-pick-btn.b { background: linear-gradient(180deg, #ff9636, var(--orange-deep)); box-shadow: 0 6px 16px rgba(245,130,31,.24), inset 0 1px 0 rgba(255,255,255,.24); }
.ab-pick-btn:hover { transform: translateY(-2px); filter: brightness(1.03); }
.ab-pick-btn:active { transform: translateY(0); }
.ab-card .ab-state { text-align: center; color: var(--muted); padding: 30px 6px; }
.ab-card .ab-state .spinner { width: 34px; height: 34px; border-width: 4px; margin-bottom: 14px; }
.ab-card .ab-fail { color: #a32020; font-weight: 600; }
.ab-retry { margin-top: 12px; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 11px; padding: 10px 17px; font-weight: 700; transition: border-color .15s; }
.ab-retry:hover { border-color: var(--accent); }

.detail-back { margin-bottom: 16px; }
.link-area { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ===== Responsive ===== */
@media (max-width: 780px) {
  body { font-size: 17px; }
  .wrap { padding: 24px 16px 76px; }
  .card { padding: 26px 22px; }
  .result-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .rail .label { font-size: 12px; }
  .rail .dot { width: 38px; height: 38px; font-size: 16px; }
  h1.title { font-size: 26px; }
  h2.step-title { font-size: 21px; }
  .doc .doc-inner { padding: 26px 22px; }
  .doc .doc-title { font-size: 20px; }
  .wordmark .sub { display: none; }
  .logo-img { height: 32px; }
  .site-header { padding: 13px 16px; }
  .btn-row { flex-direction: column-reverse; }
  .ab-cards { grid-template-columns: 1fr; }
  /* 참조 패널: 모바일은 하단 시트 */
  .ref-panel {
    top: auto; bottom: 0; right: 0; left: 0; width: auto;
    max-height: 72vh; border-top-left-radius: 20px; border-top-right-radius: 20px;
    box-shadow: 0 -8px 30px rgba(16,21,31,.3);
    animation: refSheetUp .24s ease;
  }
  @keyframes refSheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .ref-phone {
    border-radius: 20px 20px 0 0; padding: 8px 10px 14px;
    max-height: 72vh;
  }
  .ref-comments { max-height: 52vh; }
}

/* 참조 패널은 순수 떠 있는(fixed overlay) 요소 — 본문 .wrap 은 패널 유무와 무관하게 항상 중앙 고정.
   자동 표시는 오른쪽 여백이 본문(max 960)과 안 겹칠 만큼 넓은 화면(≥1640px)에서만.
   그 아래 폭에서는 우하단 플로팅 버튼으로만 열고, 열려도 본문을 밀지 않는다(overlay). */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===== 모션 최소화 존중 — 리프트/등장 애니메이션 비활성 (스피너 등 필수 피드백은 유지) ===== */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .btn, .btn-primary, .btn-navy, .btn-ghost, .choice, .mday-result, .ev-card, .ab-card, .ab-pick-btn, .ref-toggle, .site-header .who button {
    transition: none;
  }
  .btn:hover, .btn-primary:hover, .btn-navy:hover, .btn-ghost:hover, .choice:hover, .mday-result:hover,
  .ev-card:hover, .ab-card:hover, .ab-pick-btn:hover, .ref-toggle:hover, .site-header .who button:hover {
    transform: none;
  }
}

/* ===== 관리자 · 비밀번호 변경 모달 (인앱, 초호화) ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 23, 40, 0.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn 0.18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; width: 100%; max-width: 460px;
  background: linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); padding: 32px 32px 28px;
  animation: cardIn 0.28s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.modal-close {
  position: absolute; top: 13px; right: 15px;
  width: 34px; height: 34px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; transition: border-color .15s, color .15s;
}
.modal-close:hover { border-color: var(--accent); color: var(--navy); }
.modal-title { font-size: 23px; font-weight: 800; color: var(--navy); margin: 0 0 9px; letter-spacing: -0.5px; }
.modal-lead { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 22px; }
.modal-lead b { color: var(--orange-deep, #e06c0c); font-weight: 800; }
.alert.ok { background: #e9f8ef; border: 1px solid #b7e6c9; color: #12703a; }
.link-inline {
  display: block; width: 100%; margin: 15px auto 0; padding: 8px;
  background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-inline:hover { color: var(--navy); }

/* 자동확장 텍스트칸 — 엔터로 줄바꿈, 길어지면 아래로 늘어남 */
textarea.autogrow { resize: none; overflow: hidden; min-height: 58px; }

/* 접속 기록(관리자) */
.modal-divider { border: none; border-top: 1px solid var(--line, #e5e7eb); margin: 18px 0 14px; }
.logins-box { margin-top: 12px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; background: #fafafa; }
.log-summary { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--navy, #1f2b4d); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.log-chip { display: inline-block; background: #eef1f7; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.log-row { display: flex; gap: 10px; align-items: center; padding: 5px 2px; font-size: 13px; border-top: 1px dashed #ececec; }
.log-row:first-of-type { border-top: none; }
.log-row .log-at { color: #555; font-variant-numeric: tabular-nums; }
.log-row .log-ip { margin-left: auto; color: #8a8f98; font-size: 12px; font-family: ui-monospace, monospace; }
.log-row.muted { color: #8a8f98; }
