/* Web3Map docs shared stylesheet. Served statically at /docs/docs.css. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --side: #fafafa;
  --ink: #161616;
  --text: #414141;
  --muted: #707070;
  --faint: #9a9a9a;
  --line: #e7e7e7;
  --line-strong: #d8d8d8;
  --blue: #2563d9;
  --blue-soft: #eef4ff;
  --green: #0f8a4d;
  --green-soft: #ecf8f1;
  --amber: #b97714;
  --amber-soft: #fdf6e8;
  --red: #c2382f;
  --red-soft: #fdf0ef;
  --code: #f7f7f8;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.68 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
p a, li a, td a, dd a { color: var(--blue); }
p a:hover, li a:hover, td a:hover, dd a:hover { text-decoration: underline; }
code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code);
  color: var(--ink);
  padding: 0.08rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.9em;
  white-space: nowrap;
}
pre {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}
pre code { border: 0; background: none; padding: 0; white-space: pre; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  border-right: 1px solid var(--line);
  background: var(--side);
  overflow-y: auto;
  padding: 0 22px 28px;
}
.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 0 6px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 760;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.brand-mark { display: inline-flex; align-items: center; gap: 9px; }
.brand img { width: 23px; height: 23px; margin-top: 2px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #505050;
  font-size: 13px;
}
.lang-switch {
  display: inline-flex;
  margin: 10px 0 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.lang-switch a {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 650;
  color: #6b6b6b;
  letter-spacing: 0.02em;
}
.lang-switch a + a { border-left: 1px solid var(--line); }
.lang-switch a.lang-on {
  background: var(--blue-soft);
  color: var(--blue);
}
.nav-group { margin-top: 24px; }
.nav-title {
  margin: 0 0 7px;
  color: #202020;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  border-radius: 8px;
  color: #4f4f4f;
  font-size: 13px;
}
.nav-item.active { color: var(--blue); font-weight: 650; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: var(--blue);
}
.nav-child { padding-left: 28px; color: #555; font-size: 12.5px; min-height: 26px; }
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  color: #9a9a9a;
}
.active .icon { color: var(--blue); }
.icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Page layout ---------- */
.page { min-height: 100vh; margin-left: 268px; background: #fff; }
.article {
  width: min(760px, calc(100vw - 320px));
  margin: 0 auto;
  padding: 0 24px 88px;
}
.section { padding-top: 10px; scroll-margin-top: 24px; }
.section + .section { padding-top: 56px; }
.breadcrumb {
  margin: 18px 0 9px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.055em;
  font-weight: 760;
}
.subtitle {
  margin: 0 0 42px;
  max-width: 600px;
  color: #555;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.02em;
}
h2 {
  margin: 0 0 15px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-weight: 760;
}
h3 {
  margin: 26px 0 8px;
  color: #222;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 720;
  letter-spacing: -0.02em;
}
h4 {
  margin: 20px 0 6px;
  color: #2a2a2a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
p { margin: 0 0 16px; }
strong { color: #202020; font-weight: 720; }
ul, ol { margin: 8px 0 16px; padding-left: 1.15rem; }
li { margin: 6px 0; }
.quote {
  margin: 0 0 26px;
  padding: 0 0 0 21px;
  border-left: 5px solid #dedede;
  color: #4b4b4b;
  font-size: 15px;
}

/* ---------- Cards / grids ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 10px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 19px 21px 22px;
  box-shadow: var(--shadow);
}
.card-icon { margin-bottom: 16px; color: var(--blue); }
.card-icon svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card p { margin: 0; color: #5d5d5d; }
.mini-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 16px;
}
.mini {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 15px;
  background: #fff;
}
.mini h3 { margin: 0 0 6px; font-size: 14px; }
.mini p { margin: 0; font-size: 14px; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0; }
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.steps > li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 720;
}
.steps p { margin-bottom: 8px; }
.steps p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.compare {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13.5px;
}
.compare th, .compare td {
  padding: 11px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare tr:last-child td { border-bottom: 0; }
.compare th:last-child, .compare td:last-child { border-right: 0; }
.compare th { background: #fbfbfb; color: #222; font-weight: 720; }
.compare td code { white-space: normal; word-break: break-word; }

/* ---------- Callouts ---------- */
.callout {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: #fcfcfc;
  padding: 12px 16px;
  color: #4d4d4d;
  font-size: 14px;
}
.callout.info { border-left-color: var(--blue); background: var(--blue-soft); }
.callout.tip { border-left-color: var(--green); background: var(--green-soft); }
.callout.warn { border-left-color: var(--amber); background: var(--amber-soft); }
.callout.danger { border-left-color: var(--red); background: var(--red-soft); }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin: 0; }

/* ---------- Glossary ---------- */
.glossary { display: grid; gap: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.glossary div {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.glossary dt { color: #222; font-weight: 720; }
.glossary dd { margin: 0; }

/* ---------- Screenshots ---------- */
figure.shot {
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  background: #fcfcfc;
}
figure.shot.bleed { border: 0; box-shadow: none; }
figure.shot.bleed img { border: 1px solid var(--line); border-radius: 12px; }
figure.shot.bleed figcaption { border-top: 0; background: none; padding: 8px 2px 0; }

/* ---------- UI label chips ---------- */
.ui {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fbfbfb;
  padding: 0 0.4rem;
  color: #2a2a2a;
  font-size: 0.85em;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: 1px;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #f1f1f1; color: #666; }

/* ---------- Definition rows (control reference) ---------- */
.ctrl { margin: 16px 0; border-top: 1px solid var(--line); }
.ctrl > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ctrl dt { color: #222; font-weight: 700; font-size: 13.5px; }
.ctrl dd { margin: 0; font-size: 14px; }
.ctrl dd p { margin: 0 0 8px; }
.ctrl dd p:last-child { margin: 0; }

/* ---------- Telegram mockup ---------- */
.tg {
  margin: 22px 0 26px;
  border-radius: 14px;
  background: #0e1621;
  padding: 18px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #f1f5f9;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.tg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 14px;
}
.tg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563d9, #4f8df9);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.tg-title { color: #fff; font-weight: 650; font-size: 14px; line-height: 1.2; }
.tg-sub { color: #7d8b99; font-size: 12px; }
.tg-msg {
  position: relative;
  max-width: 92%;
  background: #182533;
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 10px 12px 8px;
  margin: 0 0 10px;
  overflow-wrap: break-word;
}
.tg-msg b, .tg-msg strong { color: #fff; font-weight: 700; }
.tg-msg i, .tg-msg em { color: #c9d4de; }
.tg-msg a { color: #6ab3f3; text-decoration: none; }
.tg-msg a:hover { color: #8ec5f7; text-decoration: underline; }
.tg-msg code {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #8ec5f7;
  border-radius: 4px;
  font-size: 12px;
  padding: 0.05rem 0.3rem;
}
.tg-msg pre {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #d7e3ee;
  border-radius: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.5;
}
.tg-msg blockquote {
  margin: 8px 0;
  padding: 6px 10px;
  border-left: 3px solid #6ab3f3;
  background: rgba(106, 179, 243, 0.08);
  border-radius: 0 8px 8px 0;
}
.tg-msg blockquote p { margin: 0; }
.tg-time {
  display: block;
  text-align: right;
  color: #6d7b89;
  font-size: 11px;
  margin-top: 4px;
}
.tg-msg.out {
  margin-left: auto;
  background: #2b5278;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}
.tg-kb { display: grid; gap: 5px; max-width: 92%; margin: -4px 0 12px; }
.tg-kb-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.tg-kb-btn {
  background: rgba(255, 255, 255, 0.10);
  border: 0;
  border-radius: 8px;
  color: #8ec5f7;
  font: 600 12.5px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  padding: 8px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-note {
  margin: 6px 0 12px;
  text-align: center;
  color: #7d8b99;
  font-size: 11.5px;
}

/* ---------- Page navigation footer ---------- */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 52px;
}
.page-nav a {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  display: block;
}
.page-nav a:hover { border-color: var(--blue); }
.page-nav .dir { color: var(--muted); font-size: 12px; }
.page-nav .label { color: var(--ink); font-weight: 650; font-size: 14px; }
.page-nav a.next { text-align: right; }

.footer {
  margin-top: 58px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer a { color: #333; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar { position: relative; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .page { margin-left: 0; }
  .article { width: min(760px, calc(100vw - 36px)); margin: 0 auto; padding-top: 18px; }
  .brand { font-size: 22px; }
  .cards, .mini-list, .page-nav { grid-template-columns: 1fr; }
  .glossary div, .ctrl > div { grid-template-columns: 1fr; gap: 4px; }
}
