:root {
  --ink: #111827;
  --muted: #5b6472;
  --line: #d9e0e7;
  --soft: #f5f8fb;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --warn: #b45309;
  --radius: 8px;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; height: auto; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-mark {
  width: 44px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 15px;
  color: #2f3744;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}
.lang-switch:hover { border-color: #9fb5c7; color: var(--accent); }
.hero {
  padding: 56px 0 34px;
  background: linear-gradient(180deg, #f6fafb 0%, #ffffff 78%);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 40px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}
h1, h2, h3 { line-height: 1.22; letter-spacing: 0; }
h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
}
.lead {
  margin: 18px 0 0;
  max-width: 690px;
  color: #344052;
  font-size: 19px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 750;
  background: #fff;
}
.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.hero-art {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}
.section { padding: 48px 0; }
.section.alt { background: var(--soft); border-block: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.section h2 { margin: 0; font-size: 30px; }
.section-desc { margin: 8px 0 0; color: var(--muted); max-width: 760px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  min-height: 100%;
}
a.card { display: block; }
a.card:hover { border-color: #9fb5c7; box-shadow: var(--shadow); transform: translateY(-1px); }
.card h3 { margin: 0 0 8px; font-size: 21px; }
.card p { margin: 0; color: var(--muted); }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef6f5;
  color: #0f5f59;
  font-size: 13px;
  font-weight: 700;
}
.article {
  padding: 42px 0 58px;
}
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 34px;
  align-items: start;
}
.article h1 { font-size: clamp(31px, 4vw, 46px); }
.article h2 { margin-top: 34px; font-size: 25px; }
.article h3 { margin-top: 24px; }
.article p, .article li { color: #344052; }
.article-visual {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}
.toc {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc a { display: block; padding: 6px 0; color: var(--muted); font-size: 14px; }
.toc a:hover { color: var(--accent); }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #fff;
}
.spec-table th, .spec-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.spec-table th {
  width: 170px;
  background: #f8fafc;
  font-weight: 800;
}
.note {
  border-left: 4px solid var(--accent);
  background: #f1f8f7;
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  color: #24433f;
}
.warning {
  border-left-color: var(--warn);
  background: #fff7ed;
  color: #5f3712;
}
.term {
  position: relative;
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  font-weight: 650;
}
.term::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(260px, 72vw);
  padding: 9px 10px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 30;
  box-shadow: var(--shadow);
}
.term:hover::after, .term:focus::after { opacity: 1; }
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}
.footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.download-list {
  display: grid;
  gap: 12px;
}
.download-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: #fff;
}
.download-row p { margin: 3px 0 0; color: var(--muted); }
.tool-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.tool-links a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #263241;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}
.tool-links a:hover {
  border-color: #9fb5c7;
  color: var(--accent);
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.tool-links small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

/* Mobile-safe article contents: code, tables, long URLs */
.article-layout > article,
.article article,
.article .card,
.article .step-box,
.article .note,
.article .warning,
.article .warn {
  min-width: 0;
  max-width: 100%;
}
.article p,
.article li,
.article td,
.article th,
.article code,
.article .url-box {
  overflow-wrap: anywhere;
}
.article code {
  white-space: normal;
}
.article .url-box,
.article .code-card,
.article .code-lines,
.article .code-table,
.article pre,
.article table {
  max-width: 100%;
}
.article .url-box,
.article .code-lines,
.article .code-table,
.article pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article .code-card {
  overflow: hidden;
}
.article .code-table {
  display: block;
  width: 100%;
}
.article .code-table tbody {
  display: table;
  min-width: 100%;
  width: max-content;
}
.article .code-table td,
.article .code-lines .line {
  overflow-wrap: normal;
}
.article .spec-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article .spec-table tbody {
  display: table;
  width: 100%;
}

@media (max-width: 860px) {
  .wrap { width: min(100% - 24px, 1120px); }
  .nav { align-items: flex-start; flex-direction: column; padding: 14px 0; gap: 10px; }
  .nav-links { width: 100%; max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .hero-grid, .article-layout, .grid.cols-3, .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .article { padding: 30px 0 44px; }
  .article h1 { font-size: clamp(27px, 8vw, 36px); }
  .article h2 { font-size: 22px; }
  .article-visual { padding: 10px; }
  .toc { position: static; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .download-row { grid-template-columns: 1fr; }
  .tool-links { grid-template-columns: 1fr; }
  .article .code-head { flex-wrap: wrap; align-items: flex-start; }
  .article .copy-code { flex: 0 0 auto; }
  .article .code-lines { font-size: 13px; }
  .article .code-lines .line { padding-left: 52px; }
  .article .code-lines .line::before { width: 38px; padding-right: 8px; }
  .article .code-table { font-size: 13px; }
  .article .code-table td { padding-inline: 9px; }
  .article .code-table .ln { min-width: 34px; }
}


/* Hard mobile overflow guard for guide articles */
@media (max-width: 860px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .wrap,
  .article,
  .article-layout,
  .article-layout > *,
  .article article,
  .article aside,
  .article .grid,
  .article .card,
  .article .step-box,
  .article .article-visual,
  .article .note,
  .article .warning,
  .article .warn {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .article .code-card,
  .article .code-lines,
  .article .code-table,
  .article .url-box,
  .article .spec-table,
  .article pre,
  .article table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .article .code-card,
  .article .url-box,
  .article .spec-table,
  .article .code-lines,
  .article .code-table,
  .article pre {
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .article .code-lines {
    display: block !important;
    white-space: normal !important;
  }
  .article .code-lines .line {
    display: block !important;
    width: max-content;
    min-width: 100%;
    max-width: none !important;
    white-space: pre !important;
  }
  .article .code-table tbody {
    display: table !important;
    width: max-content !important;
    min-width: 100% !important;
  }
  .article .code-table td {
    white-space: pre !important;
  }
  .article .spec-table tbody {
    display: table !important;
    min-width: 100% !important;
  }
  .article p,
  .article li,
  .article td:not(.code-line),
  .article th,
  .article code,
  .article .url-box,
  .article a {
    overflow-wrap: anywhere !important;
    word-break: break-word;
  }
  .article img,
  .article svg {
    max-width: 100% !important;
    height: auto !important;
  }
}
.article-visual img[src*="pinmap.svg"] {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Official resource links inside board profile cards */
.article .card a.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.4rem;
  color: #0f766e;
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.article .card a.text-link::after {
  content: "↗";
  font-size: 0.82em;
  line-height: 1;
  opacity: 0.72;
}
.article .card a.text-link:hover {
  color: #0f4f49;
  text-decoration-style: solid;
}

/* Anchor targets for tools category links */
.tools-page .card[id], .article .card[id]{scroll-margin-top:110px}
.tools-page .toc a{cursor:pointer}
/* 2026-07-11: article pages are now single-column; right TOC/sidebar removed. */
.article-layout.no-sidebar{display:block;width:100%;max-width:1120px;margin-left:auto;margin-right:auto}
.article-layout.no-sidebar article{width:100%;max-width:none;margin-left:0;margin-right:0}
.article-layout.no-sidebar .toc{display:none}
@media (min-width: 1080px){.article-layout.no-sidebar article{width:100%}}
/* 2026-07-11 cache-bust width alignment */
main.article > .wrap.article-layout.no-sidebar{display:block !important;width:min(1120px, calc(100% - 32px)) !important;max-width:1120px !important;margin-left:auto !important;margin-right:auto !important}
main.article > .wrap.article-layout.no-sidebar > article{width:100% !important;max-width:none !important;margin-left:0 !important;margin-right:0 !important}
/* 2026-07-11: category pages use the full article width for intro text. */
main.article > .wrap.article-layout.no-sidebar .lead{max-width:100% !important}
