/* Gitpay Docs — theme
   Colours and type follow the Gitpay app: dark top bar, Gitpay green for actions,
   teal wordmark, orange accent, Roboto/Inter type. */

:root {
  --ink: #1b1f24;
  --ink-2: #353a42;
  --muted: #5f6670;
  --faint: #8a9099;
  --line: #e2e5ea;
  --line-soft: #eef0f3;
  --bg: #ffffff;
  --bg-soft: #f7f8f6;
  --bg-cream: #f6f5f0;
  --green: #2c5c46;
  --green-700: #224a38;
  --green-600: #2f6a50;
  --green-100: #dcebe3;
  --green-50: #eef5f1;
  --teal: #16bfb4;
  --teal-50: #e6f8f6;
  --orange: #d0722a;
  --orange-700: #b35a1f;
  --orange-50: #fbf1e8;
  --blue-50: #eef4fb;
  --blue-700: #1f4e86;
  --red-50: #fdf0ef;
  --red-700: #a2332b;
  --amber-50: #fdf6e3;
  --amber-700: #8a5a00;
  --header: #0f1412;
  --header-2: #1a211e;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 20, .18);
  --font: "Inter", "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 60px;
  --sidebar-w: 272px;
  --toc-w: 220px;
  --content-w: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; letter-spacing: -0.015em; }
kbd {
  font-family: var(--mono); font-size: 11px; line-height: 1;
  padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; background: #fff; color: var(--muted);
}
.icon { flex: none; vertical-align: -0.18em; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 14.5px; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-700); color: #fff; }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.button-accent { background: var(--orange); color: #fff; }
.button-accent:hover { background: var(--orange-700); color: #fff; }
.button-lg { height: 48px; padding: 0 22px; font-size: 15.5px; }
.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius);
  background: transparent; border: 0; color: inherit; cursor: pointer;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h); background: var(--header); color: #e8ece9;
  border-bottom: 1px solid #000;
}
.header-inner {
  height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 22px; width: auto; }
.brand-docs {
  font-size: 13px; font-weight: 600; color: #c8d1cc; padding: 2px 8px;
  border: 1px solid #2c3531; border-radius: 999px; letter-spacing: .02em;
}
.header-tabs { display: flex; gap: 4px; height: 100%; }
.header-tabs a {
  display: flex; align-items: center; height: 100%; padding: 0 12px;
  color: #b9c3be; font-size: 14.5px; font-weight: 500; border-bottom: 2px solid transparent;
}
.header-tabs a:hover { color: #fff; text-decoration: none; }
.header-tabs a.is-active { color: #fff; border-bottom-color: var(--teal); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; width: 240px;
  background: var(--header-2); border: 1px solid #2a332f; border-radius: var(--radius);
  color: #9aa6a0; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.search-trigger span { flex: 1; }
.search-trigger:hover { border-color: #3b4641; color: #cfd8d3; }
.search-trigger kbd { background: transparent; border-color: #36403b; color: #8d9993; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--radius); color: #cfd8d3; font-size: 13px; font-weight: 600; }
.lang-switch:hover { background: var(--header-2); color: #fff; text-decoration: none; }
.header-github { color: #cfd8d3; }
.header-github:hover { background: var(--header-2); color: #fff; }
.header-cta { height: 36px; padding: 0 14px; font-size: 14px; }
.nav-toggle { display: none; color: #e8ece9; }

/* Search dialog */
.search-dialog[hidden] { display: none; }
.search-dialog { position: fixed; inset: 0; z-index: 80; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 12, .5); backdrop-filter: blur(2px); }
.search-panel {
  position: relative; margin: 10vh auto 0; width: min(640px, calc(100% - 32px));
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; height: 56px; border: 0; outline: 0; font: inherit; font-size: 17px; color: var(--ink); background: transparent; }
.search-esc { font: inherit; font-size: 12px; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 7px; color: var(--muted); cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 520px); overflow: auto; }
.search-results li a { display: block; padding: 10px 12px; border-radius: var(--radius); color: var(--ink); }
.search-results li a:hover, .search-results li a.is-selected { background: var(--green-50); text-decoration: none; }
.search-results .result-title { font-weight: 600; display: block; }
.search-results .result-meta { font-size: 13px; color: var(--muted); }
.search-results .result-empty { padding: 18px 12px; color: var(--muted); font-size: 14px; }

/* Docs layout */
.docs-shell {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); gap: 0;
}
.docs-sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 24px 16px 48px 20px; border-right: 1px solid var(--line-soft);
  scrollbar-width: thin;
}
.sidebar-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 20px; }
.sidebar-switch a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.sidebar-switch a:hover { color: var(--ink); text-decoration: none; }
.sidebar-switch a.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.nav-group { margin-bottom: 22px; }
.nav-group-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group li a {
  display: block; padding: 6px 10px; margin: 1px 0; border-radius: 7px;
  font-size: 14.5px; line-height: 1.4; color: var(--ink-2);
}
.nav-group li a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav-group li a.is-active { background: var(--green-50); color: var(--green); font-weight: 600; box-shadow: inset 2px 0 0 var(--green); }
.sidebar-overlay { display: none; }

.docs-article { min-width: 0; padding: 36px 56px 64px; max-width: calc(var(--content-w) + 112px); width: 100%; justify-self: center; }
.breadcrumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--faint); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }
.article-header { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.article-header h1 { font-size: 38px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.025em; }
.lead { font-size: 18.5px; line-height: 1.55; color: var(--muted); margin: 0; }

.docs-toc { position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 40px 20px 40px 8px; }
.toc-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc-list a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.toc-list a:hover { color: var(--ink); text-decoration: none; }
.toc-list a.is-active { color: var(--green); border-left-color: var(--green); font-weight: 500; }
.toc-list .toc-h3 a { padding-left: 24px; font-size: 13px; }

/* Prose */
.prose { font-size: 16.5px; line-height: 1.72; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose figure, .prose blockquote, .prose .callout { margin: 0 0 1.15em; }
.prose h2 { font-size: 25px; font-weight: 700; margin: 2.1em 0 .6em; padding-top: .2em; }
.prose h3 { font-size: 19px; font-weight: 650; font-weight: 600; margin: 1.7em 0 .5em; }
.prose h4 { font-size: 16.5px; font-weight: 600; margin: 1.5em 0 .4em; }
.prose h2 + h3 { margin-top: .8em; }
.prose .heading-anchor { margin-left: 6px; color: var(--line); opacity: 0; font-weight: 400; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor { opacity: 1; color: var(--faint); text-decoration: none; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration: underline; text-decoration-color: rgba(44, 92, 70, .3); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li > ul, .prose li > ol { margin: .3em 0 .5em; }
.prose li::marker { color: var(--faint); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose code {
  font-family: var(--mono); font-size: .86em; padding: .15em .4em; border-radius: 5px;
  background: var(--bg-soft); border: 1px solid var(--line-soft); color: var(--ink);
  overflow-wrap: anywhere;
}
.prose pre, .prose div.highlight pre, .prose .highlighter-rouge pre {
  position: relative; background: #111815; color: #dde6e1; border-radius: var(--radius-lg);
  padding: 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.6; border: 1px solid #000;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.prose .highlighter-rouge { position: relative; }
.prose div.highlighter-rouge, .prose figure.highlight { margin: 0 0 1.2em; }
.prose div.highlight { margin: 0; }
.copy-button {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 9px; border-radius: 6px; border: 1px solid #2a3530; background: #1a2420; color: #b8c4be;
  font: 500 12px var(--font); cursor: pointer; opacity: 0; transition: opacity .15s;
}
pre:hover .copy-button, .copy-button:focus { opacity: 1; }
.copy-button:hover { color: #fff; border-color: #3b4a43; }

/* Ordered lists become numbered steps */
.prose ol { list-style: none; counter-reset: step; padding-left: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 40px; margin: .55em 0; }
.prose ol > li::before {
  content: counter(step); position: absolute; left: 0; top: .15em;
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  background: var(--green-50); color: var(--green); font-size: 13px; font-weight: 700; border: 1px solid var(--green-100);
}
.prose ol ol > li::before, .prose ul ol > li::before { background: #fff; }

/* Tables (wrapped in .table-wrap by docs.js for horizontal scrolling) */
.prose .table-wrap { margin: 0 0 1.25em; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; margin: 0 0 1.25em; }
.prose .table-wrap table { margin: 0; }
.prose thead th { background: var(--bg-soft); text-align: left; font-weight: 600; color: var(--ink); font-size: 13.5px; border-bottom: 1px solid var(--line); }
.prose thead:not(:has(th:not(:empty))) { display: none; }
.prose th, .prose td { padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--line-soft); text-align: left; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--ink); }
.prose th:first-child, .prose td:first-child { min-width: 120px; }

/* Callouts */
.callout { position: relative; display: block; padding: 14px 16px 14px 46px; border-radius: var(--radius-lg); border: 1px solid; font-size: 15.5px; line-height: 1.6; }
.callout > p, .callout > div > p { margin: 0 0 .5em; }
.callout > *:last-child, .callout > div > *:last-child { margin-bottom: 0; }
.callout::before { position: absolute; left: 16px; top: 17px; width: 20px; height: 20px; content: ""; background: var(--callout-c); -webkit-mask: var(--callout-icon) center / contain no-repeat; mask: var(--callout-icon) center / contain no-repeat; }
.callout.note { background: var(--blue-50); border-color: #d6e3f3; --callout-c: var(--blue-700); --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.callout.tip { background: var(--green-50); border-color: var(--green-100); --callout-c: var(--green); --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5M9 18h6M10 22h4'/%3E%3C/svg%3E"); }
.callout.warning { background: var(--amber-50); border-color: #f1e2b8; --callout-c: var(--amber-700); --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.callout.danger { background: var(--red-50); border-color: #f3d4d1; --callout-c: var(--red-700); --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E"); }
.callout { color: var(--ink-2) !important; }
.callout::before { color: var(--callout-c); }
.callout > p:first-child > strong:first-child { color: var(--callout-c); }

/* Figures: screenshots and diagrams */
.figure { margin: 1.6em 0 1.8em; }
.figure figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.5; }
.shot { border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; background: #fff; }
.shot-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d9dcd8; display: block; }
.shot-bar span { margin-left: 10px; font: 500 11.5px var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot img { display: block; width: 100%; }
.shot.narrow { max-width: 520px; margin: 0 auto; }
.diagram { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--bg-cream); padding: 18px; }
@media (min-width: 1100px) { .docs-article .figure.wide, .docs-article .figure:has(.diagram) { margin-left: -48px; margin-right: -48px; } }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram svg text { font-family: var(--font); }

/* Card grids used in docs and home */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 1.2em 0 1.6em; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.link-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #fff; color: var(--ink-2); transition: border-color .15s, box-shadow .15s, transform .15s; text-decoration: none !important;
}
.link-card:hover { border-color: var(--green); box-shadow: var(--shadow); color: var(--ink-2); }
.link-card .card-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--green-50); color: var(--green); margin-bottom: 4px; }
.link-card strong { color: var(--ink); font-size: 16px; }
.link-card span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.link-card .card-more { margin-top: auto; padding-top: 6px; color: var(--green); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.orange { background: var(--orange-50); color: var(--orange-700); }
.badge.blue { background: var(--blue-50); color: var(--blue-700); }
.badge.gray { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line-soft); }
.badge.red { background: var(--red-50); color: var(--red-700); }
.badge.amber { background: var(--amber-50); color: var(--amber-700); }

/* Fee / key figures strip */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1.2em 0 1.6em; }
.stat { padding: 14px 16px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--line-soft); }
.stat b { display: block; font-size: 26px; line-height: 1.2; color: var(--ink); letter-spacing: -0.02em; }
.stat span { font-size: 13.5px; color: var(--muted); line-height: 1.4; display: block; margin-top: 4px; }

/* Swatches (design system page) */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 1em 0 1.6em; }
.swatch { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; font-size: 13px; }
.swatch i { display: block; height: 64px; }
.swatch div { padding: 8px 10px; }
.swatch b { display: block; color: var(--ink); font-size: 13.5px; }
.swatch code { font-size: 12px; border: 0; padding: 0; background: none; color: var(--muted); }

/* Article footer */
.article-footer { margin-top: 56px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); }
.pager-link:hover { border-color: var(--green); text-decoration: none; color: var(--ink); }
.pager-link span { font-size: 13px; color: var(--faint); }
.pager-link strong { font-weight: 600; color: var(--green); }
.pager-link.next { text-align: right; grid-column: 2; }
.article-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.article-meta a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.article-meta a:hover { color: var(--green); }

/* Footer */
.site-footer { background: var(--header); color: #a9b4ae; margin-top: 0; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 48px 24px 32px; display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; }
.footer-brand img { height: 22px; width: auto; }
.footer-brand p { max-width: 300px; font-size: 14.5px; margin: 14px 0 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #e8ece9; margin: 0 0 12px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 6px 0; font-size: 14.5px; }
.footer-cols a, .footer-bottom a { color: #a9b4ae; }
.footer-cols a:hover, .footer-bottom a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding: 18px 24px 28px; border-top: 1px solid #222a26; display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.layout-doc .site-footer { position: relative; z-index: 1; }

/* Home */
.home-hero { background: var(--header); color: #dfe6e2; position: relative; overflow: hidden; }
.home-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: #000; }
.home-hero-inner { max-width: 1200px; margin: 0 auto; padding: 72px 24px 80px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.home-hero h1 { font-size: 52px; line-height: 1.08; color: #fff; margin: 14px 0 16px; letter-spacing: -0.035em; font-weight: 700; }
.home-hero p.lead { color: #b6c1bb; font-size: 19px; max-width: 540px; }
.hero-search {
  margin-top: 28px; display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; height: 52px; padding: 0 14px 0 16px;
  background: #fff; border: 0; border-radius: 12px; color: var(--muted); font: inherit; font-size: 16px; cursor: pointer; text-align: left;
  box-shadow: 0 0 0 4px rgba(22, 191, 180, .12);
}
.hero-search span { flex: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-actions .button-secondary { background: transparent; color: #e8ece9; border-color: #36403b; }
.hero-actions .button-secondary:hover { border-color: #8d9993; color: #fff; }
.hero-art { background: #151c19; border: 1px solid #26302b; border-radius: 18px; padding: 18px; }
.home-section { max-width: 1200px; margin: 0 auto; padding: 72px 24px; }
.home-section.tight { padding-top: 0; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head h2 { font-size: 32px; margin: 8px 0 8px; letter-spacing: -0.025em; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.path-card { position: relative; display: flex; flex-direction: column; padding: 26px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); transition: border-color .15s, box-shadow .15s, transform .15s; }
.path-card:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; color: var(--ink-2); }
.path-card .path-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; }
.path-card.fund .path-icon { background: var(--green-50); color: var(--green); }
.path-card.solve .path-icon { background: var(--teal-50); color: #0b8d84; }
.path-card.paid .path-icon { background: var(--orange-50); color: var(--orange-700); }
.path-card h3 { font-size: 20px; margin: 0 0 4px; }
.path-card .who { font-size: 13.5px; color: var(--faint); font-weight: 500; margin-bottom: 10px; }
.path-card p { margin: 0 0 16px; color: var(--muted); font-size: 15.5px; }
.path-card ul { list-style: none; padding: 0; margin: 0 0 20px; font-size: 14.5px; }
.path-card li { display: flex; gap: 8px; padding: 4px 0; color: var(--ink-2); }
.path-card li .icon { color: var(--green); margin-top: 3px; }
.path-card .card-more { margin-top: auto; color: var(--green); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.band { background: var(--bg-cream); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.topic h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 10px; }
.topic h3 .icon { color: var(--green); }
.topic ul { list-style: none; margin: 0; padding: 0; }
.topic li { padding: 3px 0; font-size: 15px; }
.topic li a { color: var(--ink-2); }
.topic li a:hover { color: var(--green); }
.dev-band { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; background: var(--header); color: #b6c1bb; border-radius: 22px; padding: 40px; }
.dev-band h2 { color: #fff; font-size: 30px; margin: 8px 0 10px; letter-spacing: -0.02em; }
.dev-band p { margin: 0 0 20px; }
.dev-band pre { margin: 0; background: #0a0e0c; border: 1px solid #222a26; border-radius: 14px; padding: 18px 20px; color: #cfe0d7; font: 13.5px/1.7 var(--mono); overflow-x: auto; }
.dev-band pre .c { color: #6f7f77; }
.dev-band .button-secondary { background: transparent; color: #e8ece9; border-color: #36403b; }
.dev-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* Blog */
.blog-hero { background: var(--bg-cream); border-bottom: 1px solid var(--line-soft); }
.blog-hero-inner { max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px; }
.blog-hero h1 { font-size: 44px; margin: 6px 0 8px; letter-spacing: -0.03em; }
.blog-hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 620px; }
.blog-wrap { max-width: 1200px; margin: 0 auto; padding: 36px 24px 72px; }
.featured-post { display: grid; grid-template-columns: 1.1fr 1fr; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #fff; color: var(--ink-2); margin-bottom: 36px; }
.featured-post:hover { border-color: var(--green); box-shadow: var(--shadow); text-decoration: none; color: var(--ink-2); }
.featured-post .post-art { min-height: 300px; }
.featured-post .featured-body { padding: 36px; display: flex; flex-direction: column; justify-content: center; }
.featured-post h2 { font-size: 30px; margin: 10px 0 12px; letter-spacing: -0.02em; }
.featured-post p { color: var(--muted); margin: 0 0 18px; font-size: 16.5px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--faint); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 500 14px var(--font); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; color: var(--ink-2); transition: border-color .15s, box-shadow .15s, transform .15s; }
.post-card:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; color: var(--ink-2); }
.post-card[hidden] { display: none; }
.post-card .post-art { height: 150px; }
.post-card .post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 18px; line-height: 1.35; margin: 8px 0 8px; }
.post-card p { font-size: 14.5px; color: var(--muted); margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .post-meta { margin-top: auto; }
.post-art { position: relative; overflow: hidden; background: var(--green-50); }
.post-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.post-art.t1 { background: #e7f1ec; } .post-art.t2 { background: #fbefe4; } .post-art.t3 { background: #e5f6f4; } .post-art.t4 { background: #f1efe8; } .post-art.t5 { background: #e9eef6; }
.professions { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line-soft); }
.professions h2 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.02em; }
.professions > p { color: var(--muted); margin: 0 0 22px; }
.profession-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profession-grid a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-size: 14.5px; font-weight: 500; background: #fff; }
.profession-grid a:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.profession-grid a .icon { color: var(--faint); }

/* Post */
.post-header { background: var(--bg-cream); border-bottom: 1px solid var(--line-soft); }
.post-header-inner { max-width: 1100px; margin: 0 auto; padding: 40px 24px 40px; }
.post-header .back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.post-header h1 { font-size: 42px; line-height: 1.15; margin: 10px 0 14px; letter-spacing: -0.03em; max-width: 860px; }
.post-header .lead { max-width: 760px; }
.post-header .post-meta { margin-top: 18px; }
.post-author { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; }
.post-author img { width: 26px; height: 26px; border-radius: 50%; }
.post-shell { max-width: 1100px; margin: 0 auto; padding: 40px 24px 64px; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 56px; }
.post-shell .prose { max-width: 720px; font-size: 17.5px; line-height: 1.78; }
.post-aside { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 20px; }
.post-aside .toc-inner { max-height: 50vh; overflow: auto; }
.cta-card { padding: 20px; border-radius: 16px; background: var(--header); color: #b6c1bb; font-size: 14.5px; }
.cta-card strong { display: block; color: #fff; font-size: 17px; margin-bottom: 6px; }
.cta-card p { margin: 0 0 14px; }
.cta-card .button { width: 100%; justify-content: center; }
.related { max-width: 1100px; margin: 0 auto; padding: 0 24px 72px; }
.related h2 { font-size: 24px; margin: 0 0 18px; }
.inline-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-radius: 16px; background: var(--green-50); border: 1px solid var(--green-100); margin: 2.4em 0 0; }
.inline-cta strong { color: var(--ink); display: block; font-size: 17px; }
.inline-cta span { color: var(--muted); font-size: 15px; }

/* Changelog */
.changelog-wrap { max-width: 920px; margin: 0 auto; padding: 36px 24px 72px; }
.release { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line-soft); }
.release-date { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.release-date b { display: block; color: var(--ink); font-size: 16px; }
.release-date span { font-size: 13.5px; color: var(--faint); }
.release h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: -0.015em; }
.release .summary { color: var(--muted); margin: 0 0 14px; }
.release ul { list-style: none; padding: 0; margin: 0; }
.release li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 6px 0; font-size: 15.5px; line-height: 1.55; align-items: baseline; }
.release li .badge { justify-self: start; }
.earlier { margin-top: 40px; }
.earlier h2 { font-size: 22px; }
.year-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.year-row b { color: var(--ink); font-size: 18px; }
.year-row p { margin: 0; color: var(--ink-2); font-size: 15.5px; }

/* Plain pages */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.page-wrap h1 { font-size: 38px; margin: 0 0 12px; letter-spacing: -0.025em; }

/* Responsive */
@media (max-width: 1240px) {
  .docs-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .docs-toc { display: none; }
  .search-trigger { width: 190px; }
}
@media (max-width: 1060px) {
  .header-tabs a { padding: 0 9px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; }
  .home-hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .path-grid, .post-grid { grid-template-columns: repeat(2, 1fr); }
  .profession-grid { grid-template-columns: repeat(3, 1fr); }
  .dev-band { grid-template-columns: 1fr; }
  .post-shell { grid-template-columns: 1fr; }
  .post-aside { position: static; }
  .post-aside .toc-inner { display: none; }
}
@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .nav-toggle { display: inline-grid; }
  .header-tabs, .header-github { display: none; }
  .header-inner { gap: 10px; padding: 0 12px; }
  .docs-shell { display: block; }
  .docs-sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 60; width: min(320px, 86vw); height: auto;
    background: #fff; transform: translateX(-105%); transition: transform .2s ease;
  }
  body.nav-open .docs-sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .diagram { overflow-x: auto; padding: 12px; }
  .diagram svg { min-width: 680px; }
  .hero-art svg { min-width: 0; }
  body.nav-open .sidebar-overlay { display: block; position: fixed; inset: var(--header-h) 0 0; z-index: 55; background: rgba(10,14,12,.4); }
  .docs-article { padding: 24px 20px 48px; }
  .article-header h1 { font-size: 30px; }
  .lead { font-size: 17px; }
  .home-hero h1 { font-size: 38px; }
  .home-hero-inner { padding: 48px 20px 56px; }
  .home-section { padding: 52px 20px; }
  .path-grid, .topic-grid, .post-grid, .card-grid.two { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .post-art { min-height: 180px; }
  .featured-post .featured-body { padding: 24px; }
  .profession-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .release { grid-template-columns: 1fr; gap: 8px; }
  .release-date { position: static; }
  .release li { grid-template-columns: 1fr; gap: 2px; }
  .post-header h1, .blog-hero h1 { font-size: 32px; }
  .dev-band { padding: 26px; }
  .pager { grid-template-columns: 1fr; }
  .pager-link.next { grid-column: auto; }
  .inline-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .header-cta { display: none; }
  .brand-docs { display: none; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .docs-sidebar, .docs-toc, .site-footer, .article-footer, .copy-button { display: none !important; }
  .docs-shell { display: block; }
  .docs-article { padding: 0; }
}

/* Syntax highlighting (Rouge) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: #6f7f77; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .nt { color: #7fd1c7; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh, .highlight .sx, .highlight .dl { color: #f0b37e; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .il, .highlight .kc { color: #f3a46b; }
.highlight .nf, .highlight .na, .highlight .nb, .highlight .nx { color: #bfe3a8; }
.highlight .o, .highlight .p { color: #a9b6b0; }
.highlight .nv, .highlight .vi, .highlight .no { color: #e8c07d; }
.highlight .gi { color: #9fd59f; } .highlight .gd { color: #f19a8e; }

/* Definition lists (glossary) */
.prose dl { margin: 0 0 1.4em; border-top: 1px solid var(--line-soft); }
.prose dt { font-weight: 600; color: var(--ink); padding-top: 14px; }
.prose dd { margin: 4px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }

/* Product cards with two roles (What is Gitpay) */
.link-card.product-card:hover { border-color: var(--line); box-shadow: none; }
.role-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.role-row a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none !important; background: var(--bg-soft); }
.role-row a:hover { border-color: var(--green); background: var(--green-50); }
.role-row b { color: var(--green); font-size: 14.5px; }
.role-row a span { font-size: 13px; line-height: 1.45; color: var(--muted); }
@media (max-width: 520px) { .role-row { grid-template-columns: 1fr; } }

/* Edit links */
.article-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.article-topbar .breadcrumbs { margin-bottom: 0; }
.edit-top { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 500; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.edit-top:hover { color: var(--green); border-color: var(--green); text-decoration: none; }
.edit-links { display: flex; flex-wrap: wrap; gap: 8px 20px; width: 100%; }
.edit-links a:last-child { margin-left: auto; }
.edit-hint { width: 100%; margin: 8px 0 0; font-size: 13px; color: var(--faint); }
.article-meta { flex-direction: column; align-items: stretch; }
.page-edit-band { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; }
.post-edit { margin-top: 2em; }
.post-edit a { text-decoration: none !important; }
@media (max-width: 520px) { .edit-top span, .edit-top { font-size: 12px; } .edit-links a:last-child { margin-left: 0; } }
