:root {
  --bg: #f7f8f5;
  --panel: #ffffff;
  --text: #1c2026;
  --muted: #5d6573;
  --line: #dfe3e8;
  --accent: #3f7a16;
  --accent-soft: #eaf5dc;
  --code-bg: #eef0f3;
  --warn-bg: #fbf3dc;
  --warn-line: #d9a92e;
  --tip-bg: #e7f4f6;
  --tip-line: #3a9aa8;
  --shadow: 0 1px 2px rgb(20 24 30 / 6%), 0 6px 18px rgb(20 24 30 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --panel: #171b21;
    --text: #e6e9ed;
    --muted: #98a1ae;
    --line: #2b313b;
    --accent: #b4ed78;
    --accent-soft: #1f2a19;
    --code-bg: #222831;
    --warn-bg: #2a2617;
    --warn-line: #e8c15a;
    --tip-bg: #15262a;
    --tip-line: #72d4df;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101216;
  --panel: #171b21;
  --text: #e6e9ed;
  --muted: #98a1ae;
  --line: #2b313b;
  --accent: #b4ed78;
  --accent-soft: #1f2a19;
  --code-bg: #222831;
  --warn-bg: #2a2617;
  --warn-line: #e8c15a;
  --tip-bg: #15262a;
  --tip-line: #72d4df;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", Inter, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
code, kbd {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: 1px 6px;
}
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
.btn-ref {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 0.9em;
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  white-space: nowrap;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand small { color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar a.cta {
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  width: 36px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
}
.menu-toggle { display: none; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.toc {
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 28px 0 40px;
}
.toc p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}
.toc a:hover { color: var(--text); }
.toc a.active {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 650;
}
main { min-width: 0; padding: 40px 0 96px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; color: var(--muted); font-size: 18px; }
.quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: quick;
}
.quick li {
  position: relative;
  padding: 16px 16px 16px 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.55;
  counter-increment: quick;
}
.quick li::before {
  content: counter(quick);
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}
.quick li + li { margin-top: 0; }
.quick strong { display: block; }
@media (max-width: 1100px) {
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
section { padding-top: 24px; }
section + section { border-top: 1px solid var(--line); margin-top: 40px; }
h2 {
  margin: 16px 0 12px;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
h3 { margin: 28px 0 8px; font-size: 19px; line-height: 1.4; }
p, ul, ol, table { margin: 0 0 14px; }
li + li { margin-top: 4px; }
.steps { padding-left: 22px; }
.steps > li { padding-left: 4px; }
.steps > li::marker { color: var(--accent); font-weight: 800; }
figure { margin: 20px 0 24px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.note, .warn, .tip {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid;
  border-radius: 0 8px 8px 0;
  font-size: 15px;
}
.note { background: var(--accent-soft); border-color: var(--accent); }
.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.tip { background: var(--tip-bg); border-color: var(--tip-line); }
.note > :last-child, .warn > :last-child, .tip > :last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
dl.faq dt { margin-top: 18px; font-weight: 700; }
dl.faq dd { margin: 4px 0 0; }
footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .brand small { display: none; }
  .topbar a.cta { padding: 7px 10px; font-size: 13px; }
  .table-wrap table { min-width: 560px; }
  .quick { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle {
    white-space: nowrap;
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    height: 34px;
    padding: 0 10px;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
  }
  .toc {
    position: fixed;
    inset: 56px 0 auto 0;
    z-index: 9;
    max-height: calc(100vh - 56px);
    padding: 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  body.toc-open .toc { display: block; }
  main { padding-top: 28px; }
  h2 { font-size: 23px; }
}
