:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --paper: #FBF8F1;
  --ink: #1C2234;
  --ink-soft: #50586E;
  --ink-faint: #8A91A5;
  --blue: #2144D6;
  --blue-dark: #1A36A8;
  --blue-tint: #EEF2FF;
  --navy: #224797;
  --marker: #FFE278;
  --yellow-tint: #FFF8DC;
  --green: #1EA55A;
  --green-tint: #EAF8EF;
  --red: #E23E34;
  --red-tint: #FDEDEC;
  --border: #E3E7F0;
  --border-strong: #CDD3E1;
  --radius: 14px;
  --header-h: 64px;
  --shadow: 0 1px 2px rgba(28, 34, 52, .05), 0 6px 20px rgba(28, 34, 52, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 700; }
.ui {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: .9em;
  line-height: 1.6;
  white-space: nowrap;
}
mark, .hl {
  background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%);
  color: inherit;
  padding: 0 2px;
}
.kw { color: var(--blue); }

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand small { color: var(--ink-faint); font-weight: 600; font-size: 14px; }
.search { position: relative; flex: 1; min-width: 0; max-width: 420px; margin-left: auto; }
.search input {
  width: 100%; height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface);
  font: inherit; font-size: 15px; color: var(--ink);
}
.search input:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
.search::before { content: '🔍'; position: absolute; left: 14px; top: 9px; font-size: 14px; }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0;
  max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--blue-tint); text-decoration: none; }
.search-results small { display: block; color: var(--ink-faint); font-size: 13px; line-height: 1.4; }
.search-results .empty { padding: 12px 14px; color: var(--ink-faint); }
.top-link { color: var(--ink-soft); font-size: 14px; font-weight: 600; white-space: nowrap; }
.menu-btn {
  display: none;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
  cursor: pointer;
}

.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
.toc {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 12px 40px 20px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol > li { margin-bottom: 2px; }
.toc a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px;
  color: var(--ink-soft); font-size: 15px; font-weight: 600; line-height: 1.4;
}
.toc a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.toc a.active { background: var(--blue-tint); color: var(--blue); }
.toc .num {
  flex: none; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 800; color: var(--ink-soft);
}
.toc a.active .num { background: var(--blue); border-color: var(--blue); color: #fff; }
.toc ol ol { margin: 2px 0 8px 32px; display: none; }
.toc li.open > ol { display: block; }
.toc ol ol a { font-size: 14px; font-weight: 500; padding: 5px 10px; }

main { padding: 32px 40px 80px; min-width: 0; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; align-items: center;
  padding: 36px;
  background: var(--paper);
  background-image: radial-gradient(rgba(196, 204, 222, .55) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  margin-bottom: 28px;
}
.hero h1 { margin: 0 0 12px; font-size: 38px; line-height: 1.3; letter-spacing: -.02em; }
.hero p { margin: 0 0 20px; color: var(--ink-soft); font-size: 17px; }
.hero > div, .hero .shot { min-width: 0; }
.hero .shot { margin: 0; }
.steps-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.steps-mini a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--ink); font-weight: 700; font-size: 15px;
}
.steps-mini a:hover { border-color: var(--blue); text-decoration: none; }
.steps-mini b {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-size: 12px;
}
.market-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.market-row img { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--border); padding: 4px; }
.market-row span { color: var(--ink-faint); font-size: 14px; margin-left: 4px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px; margin-bottom: 40px; }
.quick-grid a {
  display: block; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--ink);
}
.quick-grid a:hover { border-color: var(--blue); text-decoration: none; box-shadow: var(--shadow); }
.quick-grid .ico { font-size: 22px; }
.quick-grid strong { display: block; margin-top: 6px; font-size: 16px; }
.quick-grid small { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  margin-bottom: 28px;
}
.section > header { margin-bottom: 8px; }
.section .eyebrow { color: var(--blue); font-weight: 800; font-size: 14px; letter-spacing: .04em; }
.section h2 { margin: 2px 0 10px; font-size: 30px; line-height: 1.35; letter-spacing: -.02em; }
.section .lead { color: var(--ink-soft); font-size: 17px; margin: 0 0 8px; }
.section h3 {
  margin: 40px 0 10px; padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 22px; line-height: 1.4; letter-spacing: -.01em;
}
.section h3:first-of-type { border-top: 0; padding-top: 4px; margin-top: 24px; }
.section h4 { margin: 24px 0 6px; font-size: 17px; }
.section p { margin: 0 0 12px; }
.section ul, .section ol { margin: 0 0 14px; padding-left: 22px; }
.section li { margin-bottom: 6px; }
.section li::marker { color: var(--ink-faint); }

.videos { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.videos a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--red-tint); color: #B4261D; border: 1px solid #F6CFCB;
  font-size: 14px; font-weight: 700;
}
.videos a::before {
  content: ''; width: 18px; height: 18px; border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2.5v5l4-2.5z' fill='white'/%3E%3C/svg%3E") center/12px no-repeat;
}
.videos a:hover { background: #FBDCD9; text-decoration: none; }

figure.shot, figure.card { margin: 18px 0 22px; }
figure.shot .frame {
  border-radius: 12px; overflow: hidden;
  border: 1px solid #2A3040; background: #14161C;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
figure.shot .frame::before {
  content: ''; display: block; height: 22px;
  background: #222634 radial-gradient(circle at 12px 11px, #FF5F57 4px, transparent 4.5px),
              radial-gradient(circle at 26px 11px, #FEBC2E 4px, transparent 4.5px),
              radial-gradient(circle at 40px 11px, #28C840 4px, transparent 4.5px);
  background-color: #222634;
}
figure.card img {
  border-radius: 14px; border: 1px solid var(--border);
  cursor: zoom-in;
}
figure.card { max-width: 780px; }
figure.shot .frame.center img { margin: 16px auto; }
figure.narrow { max-width: 620px; }
figure.narrow-s { max-width: 460px; }
figcaption { margin-top: 8px; color: var(--ink-faint); font-size: 14px; line-height: 1.5; }
.fig-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.fig-row figure { margin: 18px 0 8px; }

.note, .warn, .ok {
  display: flex; gap: 12px;
  margin: 16px 0; padding: 14px 18px;
  border-radius: 12px; border: 1px solid;
  font-size: 15.5px;
}
.note { background: var(--blue-tint); border-color: #D3DCFB; }
.warn { background: var(--yellow-tint); border-color: #F2DF9E; }
.ok { background: var(--green-tint); border-color: #C5EBD3; }
.note::before { content: '💡'; }
.warn::before { content: '⚠'; font-weight: 700; color: #9A6B00; }
.ok::before { content: '✅'; }
.note > div, .warn > div, .ok > div { min-width: 0; }
.note p:last-child, .warn p:last-child, .ok p:last-child { margin-bottom: 0; }

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0 18px; }
ol.steps > li {
  counter-increment: step;
  position: relative; padding: 2px 0 10px 42px; margin: 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 14px;
}

.table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: #F2F4F9; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.c, th.c { text-align: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; margin: 14px 0 18px; }
.cards > div { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cards h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.cards h4 img { width: 26px; height: 26px; object-fit: contain; }
.cards p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.dot.g { background: var(--green); }
.dot.y { background: #F5B400; }
.dot.r { background: var(--red); }

details {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
  margin: 10px 0;
}
details summary {
  cursor: pointer; list-style: none;
  padding: 14px 18px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; margin-left: auto; color: var(--ink-faint); font-size: 20px; font-weight: 400; }
details[open] summary::after { content: '−'; }
details[open] summary { border-bottom: 1px solid var(--border); }
details .body { padding: 14px 18px 6px; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; margin: 12px 0 24px; }
.video-grid a { display: block; color: var(--ink); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.video-grid a:hover { border-color: var(--blue); text-decoration: none; box-shadow: var(--shadow); }
.video-grid .thumb { position: relative; aspect-ratio: 16 / 9; background: #E9ECF3 center/cover no-repeat; }
.video-grid .thumb::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; background: rgba(226, 62, 52, .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2.5v5l4-2.5z' fill='white'/%3E%3C/svg%3E") center/22px no-repeat;
}
.video-grid span { display: block; padding: 10px 14px; font-weight: 700; font-size: 15px; }
.video-cat { margin: 24px 0 4px; font-size: 18px; }

footer.foot { padding: 24px 0 0; color: var(--ink-faint); font-size: 14px; text-align: center; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(14, 18, 28, .86);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  box-shadow: var(--shadow); font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .toc {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 45;
    width: 290px; height: auto;
    background: var(--bg); border-right: 1px solid var(--border);
    transform: translateX(-100%); transition: transform .2s;
  }
  body.toc-open .toc { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-block; }
  main { padding: 24px 16px 60px; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
}
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  body { font-size: 15.5px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand small, .top-link { display: none; }
  .brand { font-size: 0; gap: 0; }
  .search input { font-size: 14px; }
  .hero h1 { font-size: 28px; }
  .section { padding: 24px 18px; border-radius: 16px; }
  .section h2 { font-size: 24px; }
  .section h3 { font-size: 19px; }
  .fig-row { grid-template-columns: 1fr; }
  .ui { white-space: normal; }
}
@media print {
  .topbar, .toc, .to-top { display: none; }
  .layout { display: block; }
  .section { break-inside: avoid-page; border: 0; }
}
