/* Crypto Networks — restrained documentation system */
:root:not([data-theme="dark"]) {
  --bg: #f7f9fa;
  --card: #ffffff;
  --ink: #17232d;
  --muted: #5c6a74;
  --line: #dce4e9;
  --line-strong: #b9c7cf;
  --accent: #0b607b;
  --accent-dark: #084b60;
  --accent-soft: #e8f3f6;
  --telegram: #1678a5;
  --surface-subtle: #f1f5f7;
  --shadow-sm: 0 5px 18px rgba(22, 43, 55, .06);
  --shadow-md: 0 14px 34px rgba(22, 43, 55, .09);
}

:root[data-theme="dark"] {
  --bg: #111a20;
  --card: #18252c;
  --ink: #edf4f5;
  --muted: #a7b7bd;
  --line: #2a3b43;
  --line-strong: #48606a;
  --accent: #80c8da;
  --accent-dark: #a1dcea;
  --accent-soft: #1b3b46;
  --telegram: #48a9d0;
  --surface-subtle: #1d2d34;
  --shadow-sm: 0 5px 18px rgba(0, 0, 0, .16);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

html { scroll-padding-top: 86px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body::before { display: none !important; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  border-bottom-color: color-mix(in srgb, var(--line) 86%, transparent);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
}

.site-nav {
  width: min(1200px, calc(100vw - 48px));
  min-height: 64px;
  margin: 0 auto;
  padding: 0;
  border-bottom: 0;
}

.brand-link { gap: 10px; color: var(--ink); font-size: 14px; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 10px; }
.site-links { gap: 2px; }
.site-links a {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.site-links a:hover,
.site-links a[aria-current="page"] {
  color: var(--accent-dark);
  border-color: var(--line);
  background: var(--card);
}

.page {
  width: min(1200px, calc(100vw - 48px));
  max-width: 1200px;
  padding: 52px 0 80px;
}

.hero {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 26px 0 52px;
}

body:has(.start-card) .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: end;
  gap: 72px;
}

.hero h1,
h1 {
  max-width: 820px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 5.3vw, 64px);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: -.045em;
}

body:has(.start-card) .hero h1 { font-size: clamp(42px, 6vw, 72px); }

.eyebrow,
.section-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lead {
  max-width: 720px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.back-link {
  display: inline-flex;
  margin-bottom: 26px;
  min-height: 0;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { color: var(--accent-dark); background: transparent; }

.hero > .back-link,
.hero > .eyebrow {
  display: block;
}
.hero > .back-link { width: max-content; margin-bottom: 12px; }

.hero-meta,
.updated,
.source-note { color: var(--muted); font-size: 12px; }

.document-meta { gap: 8px; margin-top: 24px; }
.document-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}

.document-actions { margin-top: 16px; }

.button {
  min-height: 40px;
  border-radius: 9px;
  padding: 9px 14px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary,
.button.telegram { background: var(--accent); }
.button.primary:hover,
.button.telegram:hover { background: var(--accent-dark); }
.button.secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--card);
}
.button.secondary:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.start-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.start-card h2 { margin-top: 14px; color: var(--ink); font-size: 25px; font-weight: 680; }
.start-badge { color: var(--accent); font-size: 10px; letter-spacing: .1em; }
.start-number { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); }

.summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.summary-grid { gap: 0; }
.summary-card {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 24px;
  background: transparent;
  box-shadow: none;
}
.summary-card:last-child { border-right: 0; }
.summary-card h3 { color: var(--ink); font-size: 16px; font-weight: 700; }
.summary-card p,
.summary-note { color: var(--muted); }
.summary-number { color: var(--accent); font-weight: 800; }

.document-layout {
  grid-template-columns: minmax(200px, 240px) minmax(0, 760px);
  justify-content: start;
  gap: 48px;
  align-items: start;
}
.sidebar { position: sticky; top: 90px; }
.toc {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 0 6px 18px;
  background: transparent;
  box-shadow: none;
}
.toc-title { color: var(--ink); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.toc a {
  border-left: 2px solid transparent;
  margin-left: -20px;
  padding: 5px 0 5px 18px;
  color: var(--muted);
  font-size: 12px;
}
.toc a::before { display: none; }
.toc a:hover,
.toc a[aria-current="location"] { color: var(--accent-dark); border-left-color: var(--accent); background: transparent; }

.legal-document { min-width: 0; }
.legal-section {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 48px;
  background: transparent;
  box-shadow: none;
}
.legal-section + .legal-section { padding-top: 48px; }
.legal-section h2 { margin-bottom: 18px; color: var(--ink); font-size: 30px; font-weight: 680; line-height: 1.15; }
.legal-section h3 { color: var(--ink); font-size: 18px; font-weight: 700; }
.legal-section p,
.legal-section li { color: var(--muted); font-size: 16px; line-height: 1.68; }
.legal-section li::marker { color: var(--accent); }
.legal-section .data-grid { gap: 10px; }
.legal-section .data-grid > li {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.legal-section .data-grid h3 { font-size: 15px; }
.callout,
.no-logs-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  box-shadow: none;
}
.callout strong { color: var(--ink); }
.callout p { color: var(--muted); }

.table-scroll {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: none;
}
th { background: var(--surface-subtle); color: var(--ink); }
td { color: var(--muted); }
th, td { border-color: var(--line); }

.faq-filters {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  background: transparent;
}
.filter-chip {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
}
.filter-chip.is-active { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.quick-links { gap: 10px; }
.quick-links a {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: none;
}
.quick-links a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.quick-icon { color: var(--accent); }
.faq-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: none;
}
.faq-item summary { color: var(--ink); font-size: 16px; font-weight: 700; }
.faq-item summary:hover { color: var(--accent-dark); }
.answer p,
.answer li { color: var(--muted); line-height: 1.65; }
.faq-section .steps li,
.faq-section .method-grid article {
  border-color: var(--line);
  background: var(--surface-subtle);
}
.search-field { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); box-shadow: none; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.support-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

body:has(.steps[id="instruction"]) .steps { gap: 14px; }
.step {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: none;
}
.step-copy { display: flex; flex-direction: column; justify-content: center; }
.step-copy h2 { color: var(--ink); font-size: 25px; font-weight: 680; }
.step p,
.help p { color: var(--muted); line-height: 1.65; }
.step-kicker { color: var(--accent); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.media { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.media.phone img { --image-max: 240px; }
.media.desktop img { --image-max: 360px; }
.media img { border-radius: 8px; box-shadow: 0 5px 18px rgba(22, 43, 55, .10); }
.help {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.help h2 { color: var(--ink); font-size: 28px; font-weight: 680; }

.directory-card,
.link-grid a,
.benefit-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: none;
}
.directory-card { min-height: 0; }
.directory-card:hover,
.link-grid a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.directory-card.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.directory-card strong,
.benefit-card h3 { color: var(--ink); }
.directory-card span,
.benefit-card p,
.link-grid a { color: var(--muted); }
.security-note { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); box-shadow: none; }

.footer { border-top: 1px solid var(--line); padding-top: 26px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent-dark); }

.mobile-toc { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }

@media (max-width: 900px) {
  body:has(.start-card) .hero { gap: 34px; }
  .document-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 34px; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 72px; }
  body { overflow-x: hidden; }
  .site-nav,
  .page { width: calc(100vw - 32px); }
  .site-nav { min-height: 58px; }
  .site-header { position: sticky; }
  .site-links { gap: 4px; }
  .site-links a { padding: 8px; font-size: 11px; }
  .theme-toggle { min-height: 32px; padding: 6px 8px; }
  .page { padding: 34px 0 56px; }
  .hero { padding: 18px 0 38px; }
  .back-link { width: auto; min-height: 0; justify-content: flex-start; padding: 0; background: transparent; }
  body:has(.start-card) .hero { display: block; }
  body:has(.start-card) .start-card { margin-top: 28px; }
  .hero h1,
  body:has(.start-card) .hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .lead { font-size: 17px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-card:last-child { border-bottom: 0; }
  .document-layout { display: block; }
  .sidebar { display: none; }
  .mobile-toc { display: block; margin: 24px 0; }
  .legal-section { padding-bottom: 36px; }
  .legal-section + .legal-section { padding-top: 36px; }
  .legal-section h2 { font-size: 26px; }
  .faq-filters { flex-wrap: wrap; overflow: visible; white-space: normal; gap: 8px; }
  .faq-filters .filter-label { width: 100%; }
  .quick-links { grid-template-columns: 1fr; }
  .faq-section { padding: 22px 18px; }
  .step { grid-template-columns: 1fr; padding: 20px; }
  .step-copy { justify-content: flex-start; }
  .media { order: 2; }
  .media img { max-height: none; }
  .document-meta { align-items: stretch; flex-direction: column; }
  .document-actions,
  .actions { flex-wrap: wrap; }
  .button { width: 100%; justify-content: center; }
  .hero-actions .button { width: auto; }
  .footer nav { gap: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .directory-card,
[data-theme="dark"] .link-grid a,
[data-theme="dark"] .benefit-card,
[data-theme="dark"] .support-card,
[data-theme="dark"] .step,
[data-theme="dark"] .faq-section,
[data-theme="dark"] .summary,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .legal-section,
[data-theme="dark"] .quick-links a,
[data-theme="dark"] .start-card {
  border-color: var(--line);
  background: var(--card);
  box-shadow: none;
}
[data-theme="dark"] .directory-card.featured { border-color: var(--line-strong); background: var(--accent-soft); }
[data-theme="dark"] .callout,
[data-theme="dark"] .no-logs-card,
[data-theme="dark"] .media,
[data-theme="dark"] .security-note { border-color: var(--line); background: var(--surface-subtle); }
[data-theme="dark"] .legal-section p,
[data-theme="dark"] .legal-section li,
[data-theme="dark"] .answer p,
[data-theme="dark"] .answer li,
[data-theme="dark"] .step p,
[data-theme="dark"] .help p { color: #c3d0d4; }
[data-theme="dark"] .toc a { color: #b9c8cc; }

@media print {
  .site-header,
  .sidebar,
  .mobile-toc,
  .document-actions,
  .to-top,
  .reading-progress { display: none !important; }
  body, .page { width: 100%; background: #fff; }
  .document-layout { display: block; }
  .legal-section { break-inside: avoid; }
}
