/* ===================================================== 토큰 */
:root {
  --bg: #eceff3;
  --surface: #ffffff;
  --ink: #18202b;
  --ink-2: #4f5b6b;
  --line: #cfd6df;
  --key-edge: #aeb8c5;
  --accent: #2b54c9;
  --accent-deep: #1c3a92;
  --accent-soft: #e6ecfb;
  --bad: #c2352b;
  --bad-soft: #fdecea;
  --good: #1f7a4d;
  --r-s: 6px;
  --r-m: 10px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); letter-spacing: -0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 14px; margin: 6px 0 14px; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; margin: 10px 0; }
.err:empty { margin: 0; min-height: 0; }
.req { font-size: 12px; font-weight: 700; color: var(--accent); margin-left: 6px; vertical-align: 2px; }

/* ===================================================== 상단 */
.topbar { background: var(--ink); color: #fff; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.brand-key {
  display: inline-grid; place-items: center; width: 34px; height: 30px; border-radius: 5px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 800;
  box-shadow: inset 0 -3px 0 #c3cad4;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: #c9d1dc; text-decoration: none; padding: 8px 12px; border-radius: var(--r-s); font-size: 15px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.ext { color: #9fb4e8; }
.nav a.on { color: #fff; background: rgba(255,255,255,.14); font-weight: 600; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }
.page-form .wrap { max-width: 860px; }

/* ===================================================== 버튼·입력 */
.btn {
  border: 1px solid var(--line); background: var(--surface); padding: 10px 18px; border-radius: var(--r-s);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 -2px 0 #dfe4ea;
}
.btn:hover { border-color: var(--key-edge); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent-deep); color: #fff; box-shadow: inset 0 -3px 0 var(--accent-deep); }
.btn.primary:hover { background: #2549b3; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.big { padding: 16px 40px; font-size: 18px; }
.btn.wide { width: 100%; padding: 14px; font-size: 17px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 15px; }
.field small { font-weight: 400; color: var(--ink-2); }
.field.compact { margin: 0; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface);
  padding: 11px 13px; min-height: 46px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }
input.pin { letter-spacing: .5em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.panel h2 small { font-size: 14px; font-weight: 400; }
.empty { color: var(--ink-2); padding: 18px 4px; }

/* ===================================================== 작성 화면 */
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.sheet-head h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.03em; }
.intro { margin: 0; color: var(--ink-2); font-size: 17px; }

.block { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 20px 22px 8px; margin: 0 0 18px; }
.block legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

.questions { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px 22px 22px; scroll-margin: 90px; }
.q.invalid, .field.invalid input, .field.invalid select { border-color: var(--bad); }
.q.invalid { box-shadow: 0 0 0 3px var(--bad-soft); }
.q-head { display: flex; gap: 14px; margin-bottom: 14px; }
.q-num {
  flex: none; display: grid; place-items: center; width: 34px; height: 32px; border-radius: 5px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; box-shadow: inset 0 -3px 0 #000;
}
.q-head h3 { margin: 3px 0 2px; font-size: 18px; line-height: 1.4; }
.q-help { margin: 0; color: var(--ink-2); font-size: 14px; }
.q textarea { min-height: 52px; }

/* 선택지 = 키보드 키캡 */
.keys { display: flex; flex-wrap: wrap; gap: 10px; }
.key { position: relative; cursor: pointer; }
.key input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.key span {
  display: block; padding: 11px 16px 13px; min-height: 48px; border-radius: 7px;
  background: linear-gradient(#fff, #f6f8fa); border: 1px solid var(--key-edge);
  box-shadow: inset 0 -4px 0 #d5dbe3, 0 1px 0 rgba(24,32,43,.08);
  font-weight: 500; transition: transform .06s, box-shadow .06s, background .1s;
  user-select: none;
}
.key:hover span { border-color: var(--ink-2); }
.key input:checked + span {
  background: var(--accent); color: #fff; border-color: var(--accent-deep);
  box-shadow: inset 0 -2px 0 var(--accent-deep); transform: translateY(2px); font-weight: 650;
}
.key input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.key.off { cursor: not-allowed; }
.key.off span { opacity: .4; }
.other-input { margin-top: 12px; }
.field.full { grid-column: 1 / -1; }
.field.invalid .keys .key span { border-color: var(--bad); }
.date-wrap { position: relative; }
.date-wrap input { padding-right: 40px; }
.date-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: var(--bg); color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer;
}
.date-clear:hover { background: var(--line); color: var(--ink); }
.field.invalid .date-wrap input { border-color: var(--bad); }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check-row .check { margin: 4px 0; }

.memo-q { margin-top: 14px; border-style: dashed; border-color: var(--key-edge); background: #f6f8fb; }
.memo-q .q-num { background: var(--ink-2); box-shadow: inset 0 -3px 0 #333c48; }
.memo-q textarea { background: #fff; min-height: 80px; }
.memo-edit { margin-bottom: 12px; padding: 16px 18px; }
.memo-edit .field { margin-bottom: 10px; }
.memo-edit .row-btns { justify-content: flex-end; }
.submit-bar { position: sticky; bottom: 0; margin-top: 22px; padding: 16px 0; background: linear-gradient(transparent, var(--bg) 30%); text-align: center; }
.submit-bar .err { margin-bottom: 10px; }

/* 제출 완료 */
.done-head, .view-bar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.done-head h1 { margin: 0 0 4px; font-size: 26px; }
.done-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.spacer { flex: 1; }

/* ===================================================== 로그인 */
.auth { max-width: 420px; margin: 40px auto; padding: 30px; }
.auth h1 { margin: 0 0 6px; font-size: 24px; }
.auth > p { margin: 0 0 22px; }

/* ===================================================== 조회 화면 */
.view-bar .field.compact { min-width: 190px; }
.view-bar .field > span { font-size: 13px; color: var(--ink-2); }
.page-title { margin: 0; font-size: 26px; }
.view-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.list-panel { padding: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.list-panel h2 { font-size: 16px; margin: 4px 4px 12px; }
.rec-list { list-style: none; margin: 0; padding: 0; }
.rec {
  width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 0 12px;
  padding: 11px 12px; border: 1px solid transparent; border-radius: var(--r-s); background: none; cursor: pointer;
}
.rec:hover { background: var(--bg); }
.rec.on { background: var(--accent-soft); border-color: #c1cff3; }
.rt { grid-row: span 2; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); padding-top: 1px; }
.rn { font-weight: 650; }
.rp { color: var(--ink-2); font-size: 14px; }
.detail-panel .actions { margin: 0 0 12px; justify-content: flex-end; }
.paper { background: #dde2e8; border-radius: var(--r-m); padding: 22px; overflow-x: auto; }
.paper > .empty { text-align: center; padding: 60px 10px; }

/* flatpickr: 상담지가 있는 날짜 표시 */
.flatpickr-calendar { font-family: var(--font); }
/* 전역 input/select 스타일(높이 46px, 여백, 테두리)이 달력 머리글의 월 선택·연도 입력에 먹어서 잘리던 문제 → 원래대로 되돌림 */
.flatpickr-calendar .flatpickr-current-month select.flatpickr-monthDropdown-months,
.flatpickr-calendar .flatpickr-current-month input.cur-year {
  width: auto; min-height: 0; height: auto; margin: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; font: inherit; font-weight: 600; line-height: inherit; color: inherit;
}
.flatpickr-calendar .flatpickr-current-month select.flatpickr-monthDropdown-months { padding: 0 0 0 .5ch; display: inline-block; }
.flatpickr-calendar .flatpickr-current-month input.cur-year { padding: 0 0 0 .5ch; }
.flatpickr-calendar .flatpickr-current-month .numInputWrapper { width: 7ch; }
.flatpickr-calendar .flatpickr-current-month select.flatpickr-monthDropdown-months:hover,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper:hover { background: var(--bg); }
.flatpickr-calendar .flatpickr-current-month select:focus,
.flatpickr-calendar .flatpickr-current-month input:focus { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px; }
.flatpickr-day.has-rec { font-weight: 700; }
.flatpickr-day.has-rec::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--accent);
}
.flatpickr-day.has-rec.selected::after { background: #fff; }
.flatpickr-day { position: relative; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--accent); border-color: var(--accent); }

/* ===================================================== 설정 화면 */
.settings-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.settings-grid .col { display: grid; gap: 20px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 8px 0 0; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.wrap-form { flex-wrap: wrap; }
.wrap-form input[type=text] { flex: 1 1 140px; }
.wrap-form select { flex: 1 1 120px; width: auto; }
.mini-select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 14px; max-width: 130px; }
.mini-list, .q-admin { list-style: none; margin: 0; padding: 0; }
.mini-list li, .q-admin li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #e6eaef; }
.mini-list li:first-child, .q-admin li:first-child { border-top: 0; }
.mini-list li { flex-wrap: wrap; }
.mini-list .nm { flex: 1 1 120px; min-width: 0; font-weight: 600; word-break: keep-all; }
.inactive .nm, .inactive .qa-title { color: var(--ink-2); }
.inactive small { color: var(--ink-2); font-weight: 400; }
.tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tools button { border: 1px solid var(--line); background: var(--surface); border-radius: 5px; cursor: pointer; font-size: 13px; padding: 5px 9px; }
.tools button:hover:not(:disabled) { border-color: var(--ink-2); }
.tools button:disabled { opacity: .35; cursor: default; }
.tools .ic { width: 30px; padding: 5px 0; }
.tools .danger { color: var(--bad); }
.q-admin li { align-items: flex-start; }
.qa-main { flex: 1; min-width: 0; }
.qa-title { font-weight: 650; }
.qa-opts { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--bg); color: var(--ink-2); }
.tag.off { background: var(--bad-soft); color: var(--bad); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--r-s); font-size: 15px; }
.seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.row-btns { display: flex; gap: 8px; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th { text-align: left; font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 0 4px 6px; }
.info-table th:not(:first-child), .info-table .c { text-align: center; width: 52px; }
.info-table td { padding: 4px; }
.info-table input[type=text] { min-height: 40px; padding: 8px 10px; }
.info-table input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.info-table input:disabled { opacity: .4; }

/* 조회: 기본 정보 수정 · 연결된 견적서 */
.basic-edit, .quote-panel { margin-bottom: 12px; padding: 16px 18px; }
.basic-edit h2, .quote-panel h2 { font-size: 16px; margin: 0 0 12px; }
.basic-edit h2 small { font-size: 13px; font-weight: 500; margin-left: 6px; }
.basic-edit .grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.basic-edit .row-btns { justify-content: flex-end; }
.qp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qp-head h2 { margin: 0; flex: 1; }
.qp-head .btn, .quote-list .btn { text-decoration: none; color: inherit; padding: 7px 12px; font-size: 14px; }
.quote-list { list-style: none; margin: 0; padding: 0; }
.quote-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid #e6eaef; flex-wrap: wrap; }
.quote-list li:first-child { border-top: 0; }
.quote-list .qi-main { flex: 1; min-width: 180px; }
.quote-list .qi-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-list .empty { display: block; padding: 8px 0; }
.quote-list .empty.bad { color: var(--bad); }
.qbadge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; vertical-align: 1px; }

/* ===================================================== 토스트 */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-s); font-weight: 600;
  transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.good { background: var(--good); }
#toast.bad { background: var(--bad); }

/* ===================================================== 상담지 종이 (화면·PDF·인쇄 공통) */
.sheet {
  background: #fff; color: #111; width: 100%; max-width: 760px; margin: 0 auto; padding: 36px 40px 28px;
  font-size: 13.5px; line-height: 1.5; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.sheet .sh { border-bottom: 2.5px solid #111; padding-bottom: 10px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sheet .sh h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.sheet .sh p { margin: 0; font-size: 13px; color: #444; text-align: right; }
/* border-collapse를 쓰면 바깥 테두리 절반이 인쇄 영역 밖으로 나가 잘리므로, 분리형 테두리로 칸마다 오른쪽·아래 선만 그림 */
.sheet .meta { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1.5px solid #111; margin-bottom: 16px; }
.sheet .meta col.cl { width: 96px; }
.sheet .meta th, .sheet .meta td {
  border: 0; border-right: 1px solid #888; border-bottom: 1px solid #888;
  padding: 7px 10px; height: 34px; text-align: left; vertical-align: middle;
}
.sheet .meta tr > :last-child { border-right: 0; }
.sheet .meta tr:last-child > * { border-bottom: 0; }
.sheet .meta th { background: #f1f1f1; font-weight: 700; word-break: keep-all; line-height: 1.35; }
.sheet .meta td { word-break: break-all; }
.sheet .mv-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.sheet .qa { list-style: none; margin: 0; padding: 0; }
.sheet .qi { padding: 9px 0 11px; border-bottom: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
.sheet .qi:last-child { border-bottom: 0; }
.sheet .qt { font-weight: 700; display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.sheet .qt small { font-weight: 400; color: #555; }
.sheet .qn { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid #111; border-radius: 3px; font-size: 11.5px; }
.sheet .opts { display: flex; flex-wrap: wrap; gap: 5px 16px; padding-left: 28px; }
.sheet .op { display: inline-flex; align-items: center; gap: 5px; color: #333; }
.sheet .op.sel { color: #000; font-weight: 700; }
.sheet .bx { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.3px solid #333; font-size: 11px; line-height: 1; flex: none; }
.sheet .bx.on { background: #111; color: #fff; border-color: #111; }
.sheet .op u { text-decoration: none; border-bottom: 1px solid #333; padding: 0 4px; }
.sheet .ans { padding: 6px 10px; margin-left: 28px; background: #f6f6f6; border-left: 3px solid #111; white-space: pre-wrap; word-break: break-word; }
.sheet .lines { margin-left: 28px; }
.sheet .lines i { display: block; height: 26px; border-bottom: 1px solid #999; }
.sheet .memo-qi .qn { background: #111; color: #fff; }
.sheet .memo-qi { border-top: 1.5px solid #111; margin-top: 2px; }
.sheet .sf { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 8px; border-top: 1.5px solid #111; font-size: 12px; color: #444; }
.sheet.for-pdf {
  /* PDF용: 페이지 안쪽 폭에 딱 맞추지 않고 좌우 여백을 둬서, 브라우저마다 글자 폭이 조금 달라도 오른쪽 끝 글자가 잘리지 않게 함 */
  box-shadow: none; max-width: none; width: 100%; margin: 0; padding: 0 14px;
}
.sheet.for-pdf, .sheet.for-pdf * { letter-spacing: 0 !important; }
/* 인쇄와 같은 밀도로 맞춰 대부분 A4 한 장에 들어가게 */
.sheet.for-pdf { font-size: 12.5px; }
.sheet.for-pdf .qi { padding: 7px 0 9px; }
.sheet.for-pdf .lines i { height: 22px; }
.sheet.for-pdf .meta th, .sheet.for-pdf .meta td { padding: 5px 9px; height: 30px; }  /* html2canvas는 자간 값이 있으면 글자를 한 자씩 그려 폭이 어긋남 */
.sheet.for-pdf .sh p, .sheet.for-pdf .sf span { white-space: nowrap; padding-right: 2px; }

/* ===================================================== 반응형 */
@media (max-width: 900px) {
  .view-grid, .settings-grid { grid-template-columns: 1fr; }
  .list-panel { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 18px 14px 80px; }
  .sheet-head { flex-direction: column; }
  .q, .block { padding-left: 16px; padding-right: 16px; }
  .q-head { gap: 10px; }
  .key span { padding: 10px 13px 12px; }
  .paper { padding: 10px; }
  .sheet:not(.for-pdf) { padding: 22px 14px; }
  .sheet:not(.for-pdf) .meta col.cl { width: 72px; }
  .sheet:not(.for-pdf) .meta th, .sheet:not(.for-pdf) .meta td { padding: 6px; }
  .nav a { padding: 7px 9px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ===================================================== 인쇄 */
#printArea { display: none; }
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  /* 인쇄 밀도: 비고란까지 A4 한 장에 들어가게 */
  #printArea .sheet .sh { padding-bottom: 8px; margin-bottom: 10px; }
  #printArea .sheet .meta { margin-bottom: 10px; }
  #printArea .sheet .meta th, #printArea .sheet .meta td { padding: 5px 9px; height: 30px; }
  #printArea .sheet .qi { padding: 6px 0 7px; }
  #printArea .sheet .qt { margin-bottom: 4px; }
  #printArea .sheet .lines i { height: 21px; }
  #printArea .sheet .sf { margin-top: 10px; }
  #printArea .sheet { box-shadow: none; max-width: none; width: 100%; padding: 0 2px; margin: 0; font-size: 12.5px; }  /* 양 끝 선이 인쇄 영역 경계에 걸려 잘리지 않게 2px 여유 */
  .sheet .bx.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet .meta th, .sheet .ans, .sheet .memo-qi .qn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===================================================== 설치 화면 */
.wrap.install { max-width: 760px; }
.install-title { margin: 6px 0 4px; font-size: 28px; }
.install .panel { margin-top: 16px; }
.install .panel h1 { margin: 0 0 12px; font-size: 24px; }
.install .row-btns { margin-top: 16px; flex-wrap: wrap; }
.install a.btn { text-decoration: none; color: inherit; display: inline-block; }
.install a.btn.primary { color: #fff; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks small { color: var(--ink-2); margin-left: 6px; }
.checks .mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 13px; font-weight: 800; color: #fff; }
.checks .ok .mark { background: var(--good); }
.checks .bad .mark { background: var(--bad); }
.checks .warn .mark { background: #b7791f; }
.checks .bad { color: var(--bad); font-weight: 600; }
.alert { margin-top: 16px; padding: 14px 18px; border-radius: var(--r-m); background: #fff8e6; border: 1px solid #f0d58a; }
.alert.bad { background: var(--bad-soft); border-color: #f2b8b2; color: var(--bad); font-weight: 600; }
.alert p { margin: 4px 0; }
.note a { color: var(--accent); font-weight: 600; }
.note { background: var(--accent-soft); padding: 10px 14px; border-radius: var(--r-s); }
.warn { color: #8a5a00; font-weight: 600; }
textarea.code { font: 13px/1.5 ui-monospace, "D2Coding", monospace; background: #f6f8fa; }
code { font-family: ui-monospace, "D2Coding", monospace; background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
