:root {
  --brand: #1f3a8a;
  --brand-2: #2b52c7;
  --bg: #ffffff;
  --soft: #f4f6fb;
  --text: #1c2333;
  --muted: #5f6878;
  --line: #e2e6ee;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --purple: #7c3aed;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--brand-2); }
code, kbd {
  font: 0.9em ui-monospace, Consolas, monospace;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

/* 상단 바 */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 16px;
  background: var(--brand); color: #fff;
}
.top .title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top a { color: #fff; text-decoration: none; font-size: 14px; opacity: .9; white-space: nowrap; }

/* 레이아웃 */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
.toc { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 88px); overflow: auto; padding: 24px 0; font-size: 14px; }
.toc b { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; letter-spacing: .02em; }
.toc a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.toc a:hover { background: var(--soft); }
main { min-width: 0; padding: 24px 0 80px; }

/* 본문 */
.hero { padding: 28px 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.3; }
.hero p { margin: 0; color: var(--muted); }
section { padding-top: 28px; }
h2 { font-size: 22px; margin: 16px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--soft); }
h3 { font-size: 17px; margin: 24px 0 8px; }
ol.steps { padding-left: 0; list-style: none; counter-reset: step; }
ol.steps > li { position: relative; padding-left: 40px; margin: 12px 0; counter-increment: step; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-2); color: #fff; font-size: 14px; font-weight: 700;
  display: grid; place-items: center;
}
.b { font-weight: 700; }
.btn-label {
  display: inline-block; padding: 0 8px; border-radius: 5px; background: var(--brand-2); color: #fff;
  font-size: 0.88em; font-weight: 700; line-height: 1.7;
}
.btn-label.green { background: var(--green); }
.btn-label.red { background: var(--red); }
.btn-label.ghost { background: #fff; color: var(--brand-2); border: 1px solid var(--brand-2); }

figure { margin: 16px 0 24px; }
figure img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
}
figure.phone img { max-width: 300px; border-radius: 18px; }
figure.dialog img { max-width: 560px; }
figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.phones { display: flex; flex-wrap: wrap; gap: 16px; }
.phones figure { margin: 8px 0; }
.phones figure.phone img { max-width: 240px; }

.note, .warn, .tip {
  border-radius: 10px; padding: 12px 16px; margin: 16px 0; font-size: 15px;
  border-left: 4px solid;
}
.note { background: #eef3ff; border-color: var(--brand-2); }
.tip { background: #ecfdf3; border-color: var(--green); }
.warn { background: #fef2f2; border-color: var(--red); }
.note > :first-child, .warn > :first-child, .tip > :first-child { margin-top: 0; }
.note > :last-child, .warn > :last-child, .tip > :last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 700; white-space: nowrap; }

.legend { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.c-red { color: var(--red); }
.c-green { color: var(--green); }
.c-orange { color: var(--orange); }
.c-purple { color: var(--purple); }

details { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin: 10px 0; }
details summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
details > :last-child { margin-bottom: 14px; }

footer { color: var(--muted); font-size: 13px; padding: 24px 0 40px; border-top: 1px solid var(--line); margin-top: 40px; }

/* 모바일 매뉴얼 (직원용) */
.mobile .wrap { max-width: 640px; }
.mobile .hero h1 { font-size: 26px; }
.mobile .toc-inline { background: var(--soft); border-radius: 12px; padding: 12px 16px; margin: 16px 0 8px; }
.mobile .toc-inline b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.mobile .toc-inline a { display: block; padding: 6px 0; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.mobile .toc-inline a:last-child { border-bottom: 0; }
.mobile figure.phone img { max-width: min(280px, 100%); margin: 0 auto; }
.mobile figure.phone figcaption { text-align: center; }
.big-link {
  display: block; text-align: center; background: var(--brand); color: #fff; text-decoration: none;
  border-radius: 12px; padding: 14px; font-weight: 700; font-size: 17px; margin: 16px 0;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; padding: 16px; margin-top: 16px; background: var(--soft); border-radius: 12px; }
  .toc a { display: inline-block; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .hero h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .phones { justify-content: center; }
}
@media print {
  .top, .toc { display: none; }
  .layout { display: block; }
  figure img { box-shadow: none; }
  section { break-inside: avoid-page; }
}
