@font-face {
  font-family: Portfolio Sans;
  src: url("assets/portfolio-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #242424;
  --secondary: #646464;
  --line: #e4e4e4;
  --soft: #f5f5f4;
  --font: "Portfolio Sans", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; color: var(--ink); background: #f4f4f3; font-family: var(--font); font-size: 16px; line-height: 1.75; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: #aaa; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
button { font: inherit; }
:focus-visible { outline: 2px solid #4a4a4a; outline-offset: 5px; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 5; background: white; padding: 8px 16px; }
.skip-link:focus { top: 12px; }
.toolbar { min-height: 57px; position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: #fff; font-size: 14px; }
.document-name { text-decoration: none; font-weight: 650; white-space: nowrap; }
.document-name span { color: var(--secondary); font-weight: 400; margin-left: 8px; }
.page-links { display: flex; gap: 22px; }
.page-links a { color: var(--secondary); text-decoration: none; white-space: nowrap; }
.page-links a span { margin-right: 5px; font-size: 12px; }
.page-links a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px; }
.print-button { border: 1px solid #d4d4d4; background: #fff; padding: 5px 12px; border-radius: 3px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.print-button:hover { background: var(--soft); }
main { padding: 32px 20px 48px; }
.page { width: 210mm; min-height: 297mm; margin: 0 auto 26px; padding: 12mm 16mm 10mm; background: #fff; display: flex; flex-direction: column; scroll-margin-top: 0; }
.page:last-child { margin-bottom: 0; }
.page-header, .page-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; line-height: 1.5; color: var(--secondary); }
.page-header { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 23px; flex-shrink: 0; }
.page-footer { padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; flex-shrink: 0; }
.page-footer a { text-decoration: none; }
.page-content { padding-bottom: 22px; flex-shrink: 0; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: 36px; font-weight: 750; line-height: 1.3; letter-spacing: -0.035em; }
.overview h1 { font-size: 44px; letter-spacing: -0.04em; }
.subtitle { margin-top: 7px; font-size: 20px; font-weight: 450; line-height: 1.6; letter-spacing: -0.025em; }
.introduction { margin-top: 18px; }
.properties { margin: 21px 0 0; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.65; }
.properties > div { display: grid; grid-template-columns: 106px minmax(0, 1fr); padding: 4px 0; }
.properties dt { color: var(--secondary); }
.properties dd { margin: 0; }
.properties a { font-size: 13px; }
.block { margin-top: 20px; }
h2 { font-size: 17px; line-height: 1.55; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 9px; }
p { font-size: 15px; line-height: 1.75; }
.stack { margin-top: 13px; color: var(--secondary); font-size: 12px; line-height: 1.65; }
.first-block { margin-top: 22px; }
.service-flow { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-flow li { font-size: 14px; line-height: 1.7; border-top: 1px solid #bcbcbc; padding-top: 8px; }
.flow-index { display: block; font-size: 11px; color: var(--secondary); margin-bottom: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; text-align: left; }
th { font-weight: 500; }
th, td { vertical-align: top; padding: 9px 0; border-bottom: 1px solid var(--line); }
.contributions th { width: 106px; color: var(--secondary); }
.contributions tr:last-child th, .contributions tr:last-child td { border-bottom: 0; }
.contributions tr:first-child th, .contributions tr:first-child td { padding-top: 2px; }
.closing-note { margin-top: 17px; }
.rules-table { margin-top: 14px; }
.rules-table thead { color: var(--secondary); font-size: 12px; }
.rules-table thead th { background: var(--soft); padding: 7px 12px; border-bottom: 0; }
.rules-table tbody th { width: 119px; padding-left: 12px; }
.rules-table td { padding-left: 12px; padding-right: 8px; font-size: 13px; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.89em; }
p code { padding: 2px 4px; background: var(--soft); border-radius: 2px; }
.transaction-flow { margin-top: 15px; padding: 13px 16px; background: var(--soft); }
.transaction-flow figcaption { font-size: 13px; margin-bottom: 10px; }
.transaction-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.transaction-line > span[aria-hidden] { color: #888; }
.transaction-flow p { font-size: 12px; line-height: 1.5; color: var(--secondary); margin-top: 9px; }
.verification { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 19px; }
strong { font-weight: 650; }
.code-reference { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; color: var(--secondary); font-size: 11px; line-height: 1.7; }
.code-reference span:not(:first-child) { margin-left: 9px; }
.code-reference code { font-size: 10.5px; }
.batch .block { margin-top: 16px; }
.batch-flow { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 21px; }
.batch-flow li { border-top: 1px solid var(--line); padding: 8px 0 12px; font-size: 13px; line-height: 1.6; }
.batch-flow li > span { display: inline-block; color: var(--secondary); font-size: 11px; margin-right: 8px; }
.batch-flow strong { font-weight: 550; }
.batch-flow small { display: block; color: var(--secondary); font-size: 11px; margin-top: 2px; padding-left: 24px; }
.restart-note { border-left: 2px solid #bfbfbd; padding: 0 0 0 13px; margin-top: 12px; }
.note-label { display: block; color: var(--secondary); font-size: 11px; margin-bottom: 3px; }
.restart-note p { font-size: 13px; line-height: 1.8; }

@media screen and (min-width: 860px) {
  .page { height: 297mm; }
}

@media screen and (max-width: 859px) {
  .toolbar { padding: 10px 18px; gap: 14px; flex-wrap: wrap; }
  .document-name { flex: 1; }
  .page-links { order: 3; width: 100%; gap: 22px; padding: 4px 0; }
  .print-button { font-size: 12px; }
  html { scroll-padding-top: 110px; }
  main { padding: 0; }
  .page { width: 100%; min-height: 0; margin: 0; padding: 32px 24px 28px; border-bottom: 10px solid #f4f4f3; }
  .page:last-child { border-bottom: 0; }
  .page-content { padding-bottom: 35px; }
  .page-header { margin-bottom: 24px; }
  h1 { font-size: 31px; }
  .overview h1 { font-size: 38px; }
  .subtitle { font-size: 19px; }
  p { font-size: 16px; }
  .desktop-break { display: none; }
  .properties > div { grid-template-columns: 87px minmax(0, 1fr); padding: 5px 0; }
  .properties dd { overflow-wrap: anywhere; }
  .service-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
  .contributions th { width: 85px; }
  .contributions td { padding-left: 4px; }
  .rules-table tbody th { width: 95px; }
  .transaction-flow { padding: 13px 12px; }
  .transaction-line { align-items: flex-start; font-size: 12px; }
  .transaction-line > span:not([aria-hidden]) { flex: 1; }
  .batch-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { margin: 0; padding: 0; background: white; }
  body { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .toolbar, .skip-link { display: none !important; }
  main { padding: 0; }
  .page { width: 210mm; height: 297mm; min-height: 297mm; margin: 0; break-after: page; break-inside: avoid; }
  .page:last-child { break-after: auto; }
  a { text-decoration: none; }
}
