/* 환자·보호자용 화면: 흰 바탕, 큰 글씨, 휴대폰 우선 */
:root {
  --bg: #ffffff;
  --soft: #f5f8fc;
  --ink: #0f1b2d;
  --muted: #5b6a7e;
  --line: #e4eaf1;
  --primary: #1565d8;
  --primary-dark: #0f4fb0;
  --tint: #edf4fe;
  --ok: #0f8a5f;
  --err: #c93a2b;
  --err-tint: #fdf0ee;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 10px 30px rgba(15, 27, 45, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
small { font-size: .82em; color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* 상단 */
.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.brand { font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a[aria-current] { color: var(--primary); }
.nav a.nav-cta { background: var(--primary); color: #fff; padding: 9px 18px; margin-left: 6px; }
.nav a.nav-cta:hover { background: var(--primary-dark); }
@media (max-width: 480px) {
  .nav a:not(.nav-cta):not([aria-current]) { padding-inline: 8px; }
  .nav a[href="./"] { display: none; }
}

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; font: inherit; font-weight: 700; text-decoration: none;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.wide { width: 100%; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.5rem 0 0; }

/* 첫 화면 */
.hero { padding: 44px 0 48px; background: linear-gradient(180deg, var(--soft), #fff); }
.hero-in { display: grid; gap: 32px; }
.eyebrow { display: inline-block; background: var(--tint); color: var(--primary); font-weight: 700; font-size: .88rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(1.8rem, 5.4vw, 2.7rem); font-weight: 800; text-wrap: balance; }
.lead { margin-top: 1.1rem; font-size: 1.08rem; color: var(--muted); max-width: 32em; }
.ticks { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 30px; font-weight: 600; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: .2em; width: 21px; height: 21px; border-radius: 50%; background: var(--tint); color: var(--primary); font-size: .78rem; font-weight: 800; display: grid; place-items: center; }

.start { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px 24px; }
.start h2 { font-size: 1.3rem; font-weight: 800; }
.start > p { color: var(--muted); margin: .3rem 0 1.1rem; }
.pick { display: grid; gap: 10px; }
.pick a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-radius: var(--radius); border: 1.5px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.08rem;
  transition: border-color .15s, background .15s;
}
.pick a small { display: block; font-weight: 500; }
.pick a::after { content: "→"; color: var(--primary); font-size: 1.2rem; }
.pick a:hover { border-color: var(--primary); background: var(--tint); }
.start .fine { margin: 1rem 0 0; }
@media (min-width: 860px) {
  .hero { padding: 76px 0 72px; }
  .hero-in { grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
}

/* 섹션 */
.sec { padding: 60px 0; }
.sec.alt { background: var(--soft); }
.sec h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: .8rem; }
.sec h3 { font-size: 1.1rem; margin: 2.2rem 0 .7rem; }
.sec-lead { color: var(--muted); max-width: 40em; }
.fine { color: var(--muted); font-size: .92rem; margin-top: 1rem; }
.plain { padding: 80px 20px; text-align: center; }
.plain h1 { font-size: 1.7rem; margin-bottom: 1rem; }
.plain p { color: var(--muted); }

.notice { display: flex; gap: 12px; background: var(--tint); border-radius: var(--radius); padding: 18px 20px; margin-top: 1.5rem; }
.notice::before { content: "i"; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; margin-top: 2px; }
.notice p { margin: 0; }

/* 진행 절차 */
.steps { list-style: none; margin: 1.6rem 0 0; padding: 0; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; color: var(--primary); font-weight: 800; font-size: .9rem; letter-spacing: .04em; margin-bottom: 6px; }
.steps strong { display: block; font-size: 1.08rem; }
.steps span { color: var(--muted); font-size: .95rem; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* 센터 수치 */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 1.6rem 0 0; }
.facts div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.facts small { display: block; }
@media (min-width: 860px) { .facts { grid-template-columns: repeat(4, 1fr); } }

/* 표 */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-top: 1.3rem; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: .85rem; color: var(--muted); font-weight: 700; background: var(--soft); }
tbody th { font-weight: 700; }
tbody th small { display: block; }
td { font-variant-numeric: tabular-nums; }

/* 목록 */
.list { margin: 0; padding-left: 1.2rem; }
.list li { margin-bottom: .45rem; }

/* 자주 묻는 질문 */
.faq { margin-top: 1.3rem; display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
.faq summary { cursor: pointer; padding: 18px 28px 18px 0; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 1.4rem; font-weight: 400; color: var(--primary); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-right: 20px; }

/* 마지막 안내 */
.banner { background: var(--primary); color: #fff; border-radius: 24px; padding: 40px 24px; text-align: center; }
.banner h2 { margin-bottom: .5rem; }
.banner p { opacity: .9; margin-bottom: 1.4rem; }
.banner .btn { background: #fff; color: var(--primary); }
.banner .btn:hover { background: var(--tint); }

/* 휴대폰 하단 고정 버튼 (안내 페이지) */
.dock { display: none; }
@media (max-width: 720px) {
  .dock { display: block; position: fixed; inset: auto 0 0 0; z-index: 6; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .has-dock { padding-bottom: 84px; }
}

/* 상담 신청 폼 */
.form-page { background: var(--soft); padding: 28px 0 64px; min-height: 70vh; }
.card { max-width: 620px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px 22px; }
@media (min-width: 640px) { .card { padding: 40px; } }
.prog { display: flex; gap: 6px; margin-bottom: 8px; }
.prog i { flex: 1; height: 6px; border-radius: 999px; background: var(--line); transition: background .2s; }
.prog i.on { background: var(--primary); }
.prog-txt { color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 1.4rem; }
.step h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .3rem; }
.step > p { color: var(--muted); }
.field { margin-top: 1.5rem; }
.field > label, .field > .lbl { display: block; font-weight: 700; margin-bottom: .5rem; }
.opt { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: 4px; }
.input, textarea.input {
  width: 100%; min-height: 54px; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: #9aa7b8; }
.input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--tint); }

/* 선택 버튼 (라디오·체크박스) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.two { display: grid; grid-template-columns: 1fr 1fr; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chips span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 50px; padding: 8px 18px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 600;
  transition: border-color .15s, background .15s, color .15s;
}
.chips label:hover span { border-color: #b9c8dc; }
.chips input:checked + span { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.chips input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

/* 파일 */
.drop { position: relative; display: block; border: 1.5px dashed #b9c8dc; border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; color: var(--muted); }
.field > label.drop { font-weight: 500; font-size: .92rem; margin-bottom: 0; }
.drop:hover { border-color: var(--primary); background: var(--tint); }
.drop strong { display: block; color: var(--primary); font-size: 1.05rem; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--soft); border-radius: 10px; padding: 8px 8px 8px 14px; font-size: .93rem; }
.files button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.files button:hover { background: #fff; color: var(--err); }

/* 동의 */
.agree { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.agree label { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer; }
.agree label + label, .agree details { border-top: 1px solid var(--line); }
.agree input { flex: none; width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--primary); }
.agree .all { background: var(--soft); font-weight: 800; }
.agree details { padding: 0 16px; font-size: .9rem; color: var(--muted); }
.agree summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.agree details ul { margin: 0 0 14px; padding-left: 1.1rem; }

.err { background: var(--err-tint); color: var(--err); border-radius: 12px; padding: 12px 16px; font-weight: 600; margin-top: 1.3rem; }
.actions { display: flex; gap: 10px; margin-top: 1.8rem; }
.actions .btn { flex: 1; }
.actions .btn.ghost { flex: 0 0 auto; }

/* 접수 완료 */
.done { text-align: center; }
.done .mark { width: 64px; height: 64px; border-radius: 50%; background: #e6f6ef; color: var(--ok); font-size: 1.8rem; font-weight: 800; display: grid; place-items: center; margin: 0 auto 1rem; }
.done h1 { font-size: 1.5rem; font-weight: 800; }
.done .num { margin: 1.4rem 0; padding: 18px; background: var(--soft); border-radius: var(--radius); }
.done .num b { display: block; font-size: 1.7rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.done p { color: var(--muted); }

/* 하단 */
.foot { padding: 40px 0 48px; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); }
.foot p { margin-bottom: .6rem; max-width: 52em; }
.foot-name { font-weight: 800; color: var(--ink); font-size: 1rem; }

/* ── 관리자 ── */
.wrap.wide { max-width: 1200px; }
.brand small { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--primary); font-weight: 700; }
.linkbtn { border: 0; background: none; font: inherit; font-size: .95rem; font-weight: 600; color: var(--muted); cursor: pointer; padding: 8px 12px; border-radius: 999px; }
.linkbtn:hover { color: var(--ink); background: var(--soft); }
.card.narrow { max-width: 440px; }
.adm { background: var(--soft); padding: 28px 0 64px; min-height: 75vh; font-size: .95rem; }
.adm-h1 { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-h1 small { font-size: .95rem; }
.adm-sub { color: var(--muted); margin-top: .4rem; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-search { display: flex; gap: 8px; flex: 1; max-width: 420px; }
.adm-search .input, .adm-search .btn, .adm-head .btn { min-height: 46px; }
.adm-search .btn { padding: 0 20px; }
.toast { background: #e6f6ef; color: var(--ok); font-weight: 700; border-radius: 12px; padding: 12px 16px; }
.back { margin-bottom: 12px; }
.back a { text-decoration: none; font-weight: 600; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); font-size: .9rem; margin: .8rem 0 0; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.tabs a { flex: none; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 600; }
.tabs a b { color: var(--ink); margin-left: 2px; }
.tabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs a[aria-current] b { color: #fff; }

.adm-table { font-size: .93rem; white-space: nowrap; }
.adm-table tbody tr:hover { background: var(--soft); }
.adm-table td a { text-decoration: none; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; background: var(--tint); color: var(--primary); }
.badge.s0 { background: #fff1e2; color: #b45a09; }
.badge.s1 { background: #fef6d8; color: #8a6400; }
.badge.s2 { background: var(--err-tint); color: var(--err); }
.badge.s5 { background: #efeafd; color: #5b3fc4; }
.badge.s6 { background: #e6f6ef; color: var(--ok); }
.badge.s7 { background: #eef1f4; color: var(--muted); }
.badge.new { background: var(--primary); color: #fff; margin-left: 6px; }

/* 보완 요청 안내 (관리자·환자 공통) */
.ask { background: #fff7e8; border: 1px solid #f3dcae; border-radius: var(--radius); padding: 16px 18px; }
.ask b { display: block; color: #8a5a00; margin-bottom: 4px; }
.ask p { margin: 0; white-space: pre-wrap; }

/* 환자용 진행 조회 */
.track { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.track li { position: relative; padding: 0 0 22px 36px; color: var(--muted); }
.track li::before { content: ""; position: absolute; left: 6px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--line); z-index: 1; }
.track li::after { content: ""; position: absolute; left: 12px; top: 8px; bottom: -4px; width: 2px; background: var(--line); }
.track li:last-child { padding-bottom: 0; }
.track li:last-child::after { display: none; }
.track li.past { color: var(--ink); }
.track li.past::before { background: var(--primary); border-color: var(--primary); }
.track li.past::after { background: var(--primary); }
.track li.now { color: var(--ink); font-weight: 800; }
.track li.now::before { border-color: var(--primary); box-shadow: 0 0 0 5px var(--tint); }
.track li.now small { display: block; font-weight: 500; font-size: .92rem; margin-top: 2px; }
.sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--soft); border-radius: var(--radius); padding: 14px 18px; margin-top: 1.2rem; }
.sum b { font-size: 1.15rem; letter-spacing: .03em; }
.sub-h { font-size: 1.05rem; font-weight: 800; margin: 2rem 0 .7rem; }

.adm-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .adm-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.panel h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 12px; }
.panel .field:first-of-type { margin-top: 0; }
.panel .field { margin-top: 1rem; }
.panel .actions { margin-top: 1rem; }
.kv { display: grid; grid-template-columns: 7.5em 1fr; gap: 9px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.pre { white-space: pre-wrap; }
.doc { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc li { display: flex; justify-content: space-between; gap: 10px; background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.doc a { font-weight: 600; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.log li { padding-left: 14px; border-left: 2px solid var(--line); }
.log time { display: block; color: var(--muted); font-size: .82rem; }
.danger { text-align: right; }
.danger .linkbtn:hover { color: var(--err); background: var(--err-tint); }
select.input { appearance: auto; }

@media print {
  .top, .foot, .noprint { display: none !important; }
  .adm { background: #fff; padding: 0; }
  .adm-grid { display: block; }
  .panel { break-inside: avoid; }
}
.adm-search .btn { flex: none; white-space: nowrap; }
#upBox { margin-bottom: 2rem; }

/* 관리자: 사이트 내용 편집 */
.adm .panel { scroll-margin-top: 80px; }
.adm-sub b { color: var(--ink); }
.rows { display: grid; gap: 8px; }
.rows .row { display: contents; }
.rows.cols2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.rows.cols3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1fr); }
.rows-h { font-size: .82rem; font-weight: 600; color: var(--muted); }
.rows .input { min-height: 44px; padding: 9px 12px; font-size: .95rem; }
.rows textarea.input { min-height: 68px; }
@media (max-width: 640px) {
  .rows.cols2, .rows.cols3 { grid-template-columns: 1fr; gap: 10px; }
  .rows-h { display: none; }
  .rows.cols2 .row, .rows.cols3 .row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
}

/* 동의 내용 (신청서) */
.agree details h4 { font-size: .9rem; color: var(--ink); margin: 0 0 4px; }
.agree details ul { margin-bottom: 12px; }
.agree details p { margin: 0 0 14px; }

/* 개인정보 처리방침 · 이용약관 */
.legal-page { padding: 36px 0 64px; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 1rem; }
.legal h2 { font-size: 1.1rem; font-weight: 800; margin: 2rem 0 .6rem; }
.legal p { margin-bottom: .7rem; }
.legal ul { margin: 0 0 .7rem; padding-left: 1.2rem; }
.legal li { margin-bottom: .35rem; }
.legal h3 { font-size: 1rem; margin: 1rem 0 .3rem; }
.tbd { color: var(--muted); }

/* 관리자 상단 메뉴: 휴대폰에서는 두 줄로 */
.linkbtn { white-space: nowrap; }
@media (max-width: 560px) {
  .top-in.wide { flex-wrap: wrap; row-gap: 0; padding-block: 8px; }
  .top-in.wide .nav { margin-left: -8px; }
}
.add-row { margin-top: 6px; color: var(--primary); padding-left: 0; }
.add-row:hover { background: none; color: var(--primary-dark); }
.cta.center { justify-content: center; }
