/* ── Tether Documentation Site ───────────────────────────────────── */
:root {
  --ink:         #15171c;
  --ink-soft:    #21242c;
  --ink-mid:     #2d313b;
  --ink-line:    #383d4a;
  --accent:      #d4f034;
  --accent-deep: #aacf0a;
  --accent-glow: rgba(212,240,52,.12);
  --surface:     #ffffff;
  --bg:          #f5f6f8;
  --border:      #e6e8ec;
  --text:        #1a1d24;
  --muted:       #6b7280;
  --faint:       #9ca3af;
  --emerald:     #10b981;
  --blue:        #3b82f6;
  --amber:       #f59e0b;
  --red:         #ef4444;
  --r:           10px;
  --r-sm:        7px;
  --sans:        'IBM Plex Sans', system-ui, sans-serif;
  --display:     'Bricolage Grotesque', system-ui, sans-serif;
  --mono:        'IBM Plex Mono', monospace;
  --nav-h:       60px;
  --sidebar-w:   272px;
  --toc-w:       210px;
  --content-max: 780px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: #c9cdd6;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── TOP NAV ─────────────────────────────────────────────────────── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(21,23,28,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-line);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 18px; font-weight: 700;
  color: #fff; letter-spacing: -.02em;
}
.nav-brand .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--ink-soft); border: 1px solid var(--ink-line);
  display: grid; place-items: center;
}
.nav-brand .mark span {
  width: 11px; height: 11px; border: 2.5px solid var(--accent); border-radius: 2px;
}
.nav-badge {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent);
  background: var(--accent-glow); border: 1px solid rgba(212,240,52,.25);
  border-radius: 5px; padding: 2px 8px; font-family: var(--sans);
}
.nav-links-right {
  display: flex; align-items: center; gap: 4px;
}
.nav-links-right a {
  padding: 6px 13px; border-radius: var(--r-sm); color: #9ca3af;
  font-size: 13.5px; font-weight: 500; transition: color .12s, background .12s;
}
.nav-links-right a:hover { color: #fff; background: var(--ink-soft); }
.nav-links-right a.active { color: #fff; background: var(--ink-soft); }
.nav-links-right .btn-signin {
  background: var(--accent); color: var(--ink); font-weight: 600;
  padding: 7px 16px; border-radius: var(--r-sm); font-size: 13.5px;
  margin-left: 6px; transition: background .14s;
}
.nav-links-right .btn-signin:hover { background: var(--accent-deep); }

/* ── LAYOUT ──────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
}

/* ── LEFT SIDEBAR ────────────────────────────────────────────────── */
.docs-sidebar {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; overflow-x: hidden;
  background: var(--ink-soft);
  border-right: 1px solid var(--ink-line);
  padding: 20px 0 40px;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--ink-line); border-radius: 2px; }

.sidebar-section { margin-bottom: 6px; }
.sidebar-section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #374151;
  padding: 16px 20px 7px; font-family: var(--sans);
}
.sidebar-section-label:first-of-type { padding-top: 4px; }
.sidebar-link {
  display: block; padding: 5px 20px;
  font-size: 13.5px; color: #6b7280;
  transition: color .1s, background .1s;
  line-height: 1.45;
}
.sidebar-link:hover { color: #c9cdd6; background: rgba(255,255,255,.03); }
.sidebar-link.active { color: var(--accent) !important; }
.sidebar-link.active::before {
  content: ''; display: inline-block;
  width: 3px; height: 100%; background: var(--accent);
  position: absolute; left: 0; top: 0;
}
.sidebar-link { position: relative; }
.sidebar-link.sub { padding-left: 34px; font-size: 13px; }
.sidebar-link.sub-sub { padding-left: 48px; font-size: 12.5px; }

/* ── MAIN CONTENT ────────────────────────────────────────────────── */
.docs-main {
  padding: 48px 56px 80px;
  max-width: calc(var(--content-max) + 112px);
  min-width: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: #4b5563; margin-bottom: 20px;
}
.breadcrumb a { color: #6b7280; transition: color .12s; }
.breadcrumb a:hover { color: #9ca3af; }
.breadcrumb svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Page title */
.docs-main h1 {
  font-family: var(--display); font-size: clamp(26px, 3vw, 36px);
  font-weight: 800; letter-spacing: -.025em; color: #fff;
  line-height: 1.15; margin-bottom: 10px;
}
.page-intro {
  font-size: 16.5px; color: #9ca3af; margin-bottom: 36px;
  padding-bottom: 32px; border-bottom: 1px solid var(--ink-line);
  line-height: 1.7;
}

/* Headings */
.docs-main h2 {
  font-family: var(--display); font-size: 22px; font-weight: 700;
  color: #fff; letter-spacing: -.02em;
  margin: 48px 0 14px; padding-top: 48px;
  border-top: 1px solid var(--ink-line);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.docs-main h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.docs-main h3 {
  font-family: var(--display); font-size: 17px; font-weight: 600;
  color: #e5e7eb; margin: 30px 0 10px;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.docs-main h4 {
  font-size: 14.5px; font-weight: 700; color: #d1d5db;
  margin: 22px 0 8px; font-family: var(--sans);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

/* Body text */
.docs-main p { color: #9ca3af; margin-bottom: 16px; line-height: 1.75; }
.docs-main ul, .docs-main ol {
  color: #9ca3af; padding-left: 22px; margin-bottom: 18px;
}
.docs-main li { margin-bottom: 8px; line-height: 1.7; }
.docs-main li::marker { color: #4b5563; }
.docs-main a { color: var(--accent); }
.docs-main a:hover { text-decoration: underline; }
.docs-main strong { color: #e5e7eb; font-weight: 600; }
.docs-main em { color: #c9cdd6; font-style: italic; }

/* Inline code */
.docs-main code {
  font-family: var(--mono); font-size: 13px;
  background: var(--ink-mid); border: 1px solid var(--ink-line);
  padding: 2px 7px; border-radius: 5px; color: #86efac;
}

/* Code blocks */
.docs-main pre {
  background: #0d0f12; border: 1px solid var(--ink-line);
  border-radius: var(--r); padding: 0; margin: 20px 0;
  overflow: hidden; position: relative;
}
.pre-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; background: var(--ink-mid);
  border-bottom: 1px solid var(--ink-line);
}
.pre-lang {
  font-family: var(--mono); font-size: 11px; color: #6b7280;
  text-transform: uppercase; letter-spacing: .05em;
}
.pre-copy {
  font-size: 11px; color: #6b7280; cursor: pointer;
  font-family: var(--sans); transition: color .12s;
  background: none; border: none; padding: 0;
}
.pre-copy:hover { color: var(--accent); }
.docs-main pre code {
  background: none; border: none; padding: 20px 22px;
  color: #c9cdd6; font-size: 13.5px; line-height: 1.75;
  display: block; overflow-x: auto;
  white-space: pre;
}

/* Tables */
.docs-main table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14px; }
.docs-main thead th {
  text-align: left; padding: 10px 16px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: #6b7280; border-bottom: 1px solid var(--ink-line);
  background: var(--ink-soft); font-family: var(--sans); font-weight: 600;
}
.docs-main tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--ink-line);
  color: #9ca3af; vertical-align: top; line-height: 1.6;
}
.docs-main tbody tr:last-child td { border-bottom: none; }
.docs-main tbody tr:hover td { background: rgba(255,255,255,.02); }
.docs-main td code { font-size: 12px; }
.docs-main thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
.docs-main thead th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.table-wrap {
  border: 1px solid var(--ink-line); border-radius: var(--r);
  overflow: hidden; margin: 22px 0;
}
.table-wrap table { margin: 0; }

/* Callouts */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: var(--r); padding: 16px 18px; margin: 24px 0;
  border: 1px solid;
}
.callout-icon { flex-shrink: 0; margin-top: 1px; }
.callout-icon svg { width: 18px; height: 18px; }
.callout-body { flex: 1; min-width: 0; }
.callout-title { font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
.callout-body p { color: inherit; margin: 0; font-size: 14px; line-height: 1.65; }
.callout-body p + p { margin-top: 8px; }
.callout-body code { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }

.callout.info    { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.3);  color: #93c5fd; }
.callout.tip     { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.3);  color: #6ee7b7; }
.callout.warn    { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.3);  color: #fcd34d; }
.callout.danger  { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.3);   color: #fca5a5; }
.callout.accent  { background: var(--accent-glow);   border-color: rgba(212,240,52,.3);  color: #d4f034; }

/* Steps / numbered procedure */
.step-block {
  border: 1px solid var(--ink-line); border-radius: var(--r);
  overflow: hidden; margin: 24px 0;
}
.step {
  display: grid; grid-template-columns: 52px 1fr;
  border-bottom: 1px solid var(--ink-line);
}
.step:last-child { border-bottom: none; }
.step-num {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 20px; font-weight: 800;
  color: var(--accent); background: var(--ink-soft);
  border-right: 1px solid var(--ink-line);
}
.step-content { padding: 18px 22px; }
.step-content h4 { margin: 0 0 8px; color: #fff; font-size: 15px; }
.step-content p  { margin: 0; color: #9ca3af; font-size: 14px; }
.step-content pre { margin: 12px 0 0; }

/* Related links */
.related-links {
  border-top: 1px solid var(--ink-line); margin-top: 56px; padding-top: 28px;
}
.related-links h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: #4b5563; margin-bottom: 14px; font-family: var(--sans); font-weight: 700;
}
.related-links ul { list-style: none; padding: 0; }
.related-links li { margin-bottom: 8px; }
.related-links a {
  color: var(--accent); font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.related-links a svg { width: 13px; height: 13px; }
.related-links a:hover { text-decoration: underline; }

/* Page nav */
.page-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--ink-line);
}
.page-nav-link {
  background: var(--ink-soft); border: 1px solid var(--ink-line);
  border-radius: var(--r); padding: 16px 20px; transition: border-color .14s;
}
.page-nav-link:hover { border-color: var(--accent); }
.page-nav-link.next { text-align: right; }
.page-nav-label { font-size: 11.5px; color: #4b5563; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .05em; }
.page-nav-title { font-size: 15px; font-weight: 600; color: #fff; font-family: var(--display); }

/* ── RIGHT TOC ────────────────────────────────────────────────────── */
.docs-toc {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; padding: 36px 22px 36px 24px;
  border-left: 1px solid var(--ink-line);
}
.docs-toc h5 {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: #374151; margin-bottom: 14px; font-weight: 700; font-family: var(--sans);
}
.toc-link {
  display: block; padding: 4px 0; font-size: 12.5px; color: #4b5563;
  transition: color .12s; line-height: 1.45;
}
.toc-link:hover { color: #9ca3af; }
.toc-link.active { color: var(--accent); }
.toc-link.sub { padding-left: 14px; font-size: 12px; }

/* ── UPDATED / FEEDBACK ──────────────────────────────────────────── */
.page-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: #4b5563; margin-top: 48px;
  padding-top: 20px; border-top: 1px solid var(--ink-line);
}
.feedback-btns { display: flex; gap: 8px; }
.fb-btn {
  border: 1px solid var(--ink-line); border-radius: 6px;
  padding: 5px 12px; font-size: 12px; color: #6b7280; cursor: pointer;
  background: none; font-family: var(--sans); transition: all .12s;
}
.fb-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .docs-layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .docs-toc { display: none; }
}
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-main { padding: 28px 20px 60px; }
}
@media (max-width: 640px) {
  .top-nav { padding: 0 16px; }
  .nav-links-right a:not(.btn-signin) { display: none; }
}
