/* N8 docs. Direction A "또렷": white canvas, grey surfaces, one purple accent.
   Tokens from n8 design/t14/tokens.py (contrast pairs checked there). No webfonts. */
:root {
  --bg: #FFFFFF; --surface: #F2F4F6; --line: #E5E8EB;
  --text: #191F28; --text2: #4E5968; --text3: #5F6B78;
  --accent: #4433E6; --on-accent: #FFFFFF; --accent-soft: #EEECFF; --accent-ink: #3324C4;
  --danger: #D0281B; --danger-soft: #FFEDEB;
  --warn-ink: #7A4E00; --warn-soft: #FFF3D6;
  --ok: #0B7A47; --ok-soft: #E5F6EE;
  --r: 14px; --r-lg: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --field-line: #7B8794;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; font: 400 16px/1.6 var(--font); background: var(--bg); color: var(--text); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 28px; line-height: 36px; font-weight: 700; text-wrap: balance; }
h2 { font-size: 22px; line-height: 30px; font-weight: 700; margin-top: 40px; }
h3 { font-size: 18px; line-height: 26px; font-weight: 700; margin-top: 28px; }
p, ul, ol, dl, table, pre { margin: 12px 0 0; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 6px; }
code { font: 0.9em/1.4 var(--mono); background: var(--surface); padding: 1px 6px; border-radius: 6px; }
pre { background: var(--surface); padding: 14px 16px; border-radius: var(--r); overflow-x: auto; font: 14px/1.6 var(--mono); }
pre code { background: none; padding: 0; }
strong { font-weight: 700; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--accent); color: var(--on-accent); padding: 12px 16px; border-radius: var(--r); font-weight: 700; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header + nav */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: inline-grid; place-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; }
.brand-sub { font-weight: 600; font-size: 14px; color: var(--text2); }
.nav { margin: 0 -20px; }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 2px; margin: 0; padding: 0 10px 8px; }
.nav li { flex: none; margin: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--text2); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.app-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.app-link:hover { color: var(--on-accent); background: var(--accent-ink); }

/* Layout */
main { max-width: 760px; margin: 0 auto; padding: 28px 20px 64px; }
main.wide { max-width: 1120px; }
.lead { font-size: 17px; line-height: 28px; color: var(--text2); margin-top: 12px; }
.muted { color: var(--text2); }
.cap { font-size: 13px; line-height: 18px; color: var(--text3); font-weight: 500; }
.toc { margin-top: 20px; padding: 14px 16px; background: var(--surface); border-radius: var(--r); }
.toc p { margin: 0; font-weight: 700; font-size: 15px; }
.toc ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.toc li { margin: 0; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; font-size: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: var(--r); font-weight: 700; font-size: 17px; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { color: var(--text); background: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Home */
.hero { padding: 12px 0 8px; }
.hero h1 { font-size: 30px; line-height: 40px; }
.eyebrow { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; margin: 0 0 14px; }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; counter-reset: s; }
.steps > li { margin: 0; padding: 18px 18px 18px 64px; position: relative; background: var(--surface); border-radius: var(--r-lg); counter-increment: s; }
.steps > li::before { content: counter(s); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-content: center; font-weight: 800; font-size: 15px; }
.steps h3 { margin: 4px 0 0; font-size: 18px; }
.steps p { margin-top: 6px; color: var(--text2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.fact { background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.fact b { display: block; font-size: 22px; line-height: 30px; letter-spacing: -0.02em; }
.fact span { font-size: 14px; color: var(--text2); }
.cards { display: grid; gap: 12px; margin-top: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card h3 { margin: 0; }
.card p { margin-top: 6px; color: var(--text2); }

/* Guide steps (numbered with section ids) */
.how { list-style: none; padding: 0; counter-reset: h; margin-top: 8px; }
.how > li { counter-increment: h; position: relative; padding: 16px 0 16px 48px; border-bottom: 1px solid var(--line); margin: 0; }
.how > li:last-child { border-bottom: 0; }
.how > li::before { content: counter(h); position: absolute; left: 0; top: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-content: center; font-weight: 800; font-size: 15px; }
.how h3 { margin: 3px 0 0; font-size: 17px; line-height: 26px; }
.how p, .how ul { margin-top: 6px; }
.ui { display: inline; font-weight: 700; color: var(--text); background: var(--surface); border-radius: 6px; padding: 1px 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.links { list-style: none; padding: 0; }
.links li { margin: 0; }
.links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Notes */
.note { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); }
.note-warn { background: var(--warn-soft); color: var(--warn-ink); }
.note-accent { background: var(--accent-soft); color: var(--accent-ink); }
.note p:first-child, .note ul:first-child { margin-top: 0; }
.note a { color: inherit; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 700; background: var(--surface); }
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }

/* FAQ */
.faq h3 { scroll-margin-top: 16px; }

/* Changelog */
.log h2 { font-size: 20px; }
.log ul { margin-top: 10px; }
.tag { display: inline-block; min-width: 3.5em; font-size: 13px; font-weight: 700; padding: 0 8px; margin-right: 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); text-align: center; }

/* Search */
.search-form { display: flex; gap: 8px; margin-top: 20px; }
.search-form input { flex: 1; min-width: 0; min-height: 52px; padding: 12px 14px; border: 1px solid var(--field-line); border-radius: var(--r); font: inherit; font-size: 16px; color: var(--text); background: var(--bg); }
.search-form input::placeholder { color: var(--text3); }
.search-form button { min-height: 52px; padding: 0 20px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; cursor: pointer; }
.results { list-style: none; padding: 0; margin-top: 16px; }
.results li { margin: 0; border-bottom: 1px solid var(--line); }
.results a { display: block; padding: 14px 4px; min-height: 44px; text-decoration: none; color: var(--text); }
.results a:hover { background: var(--surface); }
.results b { display: block; color: var(--accent-ink); }
.results span { display: block; margin-top: 4px; font-size: 14px; color: var(--text2); }
mark { background: var(--warn-soft); color: var(--warn-ink); border-radius: 3px; padding: 0 1px; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 20px 20px 32px; font-size: 14px; color: var(--text2); }
.foot-in p { margin: 4px 0 0; }
.foot ul { list-style: none; padding: 0; margin: 0 0 8px -8px; display: flex; flex-wrap: wrap; }
.foot li { margin: 0; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--text2); font-weight: 600; }

@media (min-width: 768px) {
  h1 { font-size: 34px; line-height: 44px; }
  .hero h1 { font-size: 42px; line-height: 54px; }
  .lead { font-size: 18px; line-height: 30px; }
  main { padding-top: 40px; }
  .brand-row { min-height: 64px; }
  .top-in { display: flex; align-items: center; gap: 24px; }
  .brand-row { flex: none; }
  .nav { margin: 0; flex: 1; min-width: 0; }
  .nav ul { padding: 0; gap: 0 4px; }
  .top .app-link-wide { margin-left: auto; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps > li { padding: 64px 20px 20px; }
  .steps > li::before { top: 20px; left: 20px; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .app-link-wide { display: none; }
}
@media (min-width: 768px) {
  .app-link-narrow { display: none; }
}
@media print {
  .top, .foot, .skip { display: none; }
}
