/* Doge Soft Docs — docs.dogesoft.io
   Shares brand tokens with dogesoft.io (landing.css); adds the docs shell:
   sidebar, in-page TOC, search palette, code blocks, callouts, api tables. */

:root {
  --ink: #17211b;
  --muted: #647069;
  --paper: #f7f3e8;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(23, 33, 27, 0.14);
  --yellow: #ffcf40;
  --orange: #ff7138;
  --coral: #ff7852;
  --green: #1a7f5a;
  --mint: #72e7ab;
  --blue: #246bfe;
  --sky: #68d9ff;
  --purple: #7656ff;
  --violet: #8e72ff;
  --shadow: 0 24px 80px rgba(45, 38, 20, 0.12);
  --radius: 28px;
  --header-bg: rgba(247, 243, 232, 0.78);
  --sidebar-w: 264px;
  --toc-w: 224px;
  --header-h: 70px;
}

html[data-theme="dark"] {
  --ink: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.62);
  --paper: #0f1713;
  --card: rgba(22, 32, 26, 0.88);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(15, 23, 19, 0.88);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 207, 64, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 6%, rgba(36, 107, 254, 0.14), transparent 30rem),
    var(--paper);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.6;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 207, 64, 0.1), transparent 26rem),
    radial-gradient(circle at 88% 6%, rgba(255, 113, 56, 0.08), transparent 30rem),
    var(--paper);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img {
  max-width: 100%;
}

code,
pre,
kbd {
  font-family: "DM Mono", ui-monospace, monospace;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", Arial, sans-serif;
  letter-spacing: -0.03em;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- header (shared chrome) ---------- */

.site-header {
  position: sticky;
  z-index: 60;
  top: 0;
  padding: 0 max(20px, calc((100vw - 1280px) / 2));
  backdrop-filter: blur(18px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 10px 40px rgba(23, 33, 27, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand span span {
  color: var(--orange);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}

.desktop-nav a {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

html[data-theme="dark"] .desktop-nav a:hover,
html[data-theme="dark"] .desktop-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.77rem;
  font-weight: 750;
  white-space: nowrap;
}

html[data-theme="dark"] .signal {
  background: rgba(255, 255, 255, 0.04);
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25c979;
  box-shadow: 0 0 0 5px rgba(37, 201, 121, 0.12);
}

.signal-change.up {
  color: #087c45;
}

.signal-change.down {
  color: #c53f2d;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-btn,
.theme-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}

html[data-theme="dark"] .search-btn,
html[data-theme="dark"] .theme-btn {
  background: rgba(255, 255, 255, 0.05);
}

.search-btn:hover,
.theme-btn:hover {
  border-color: rgba(255, 113, 56, 0.45);
}

.search-btn svg {
  pointer-events: none;
}

/* ---------- shell layout ---------- */

.docs-shell {
  --gap: 40px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: var(--gap);
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  height: calc(100svh - var(--header-h) - 44px);
  overflow-y: auto;
  padding: 30px 6px 40px 0;
  scrollbar-width: thin;
}

.docs-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.sidebar-group-title {
  margin: 0 0 8px;
  padding-left: 14px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.89rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-links a::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  content: "";
  background: var(--dot, var(--line));
  opacity: 0.55;
}

.sidebar-group[data-accent="gold"] .sidebar-links a {
  --dot: var(--yellow);
}
.sidebar-group[data-accent="coral"] .sidebar-links a {
  --dot: var(--coral);
}
.sidebar-group[data-accent="mint"] .sidebar-links a {
  --dot: var(--mint);
}
.sidebar-group[data-accent="sky"] .sidebar-links a {
  --dot: var(--sky);
}
.sidebar-group[data-accent="violet"] .sidebar-links a {
  --dot: var(--violet);
}
.sidebar-group[data-accent="orange"] .sidebar-links a {
  --dot: var(--orange);
}
.sidebar-group[data-accent="yellow"] .sidebar-links a {
  --dot: var(--yellow);
}

.sidebar-links a:hover,
.sidebar-links a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .sidebar-links a:hover,
html[data-theme="dark"] .sidebar-links a:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-links a[aria-current="page"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px var(--line);
}

html[data-theme="dark"] .sidebar-links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-links a[aria-current="page"]::before {
  opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--orange)) 25%, transparent);
}

.docs-main {
  min-width: 0;
  padding: 34px 0 90px;
}

.docs-toc {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  height: max-content;
  max-height: calc(100svh - var(--header-h) - 44px);
  overflow-y: auto;
  padding: 34px 0 40px;
}

.toc-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-toc ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.docs-toc li.toc-h3 a {
  padding-left: 26px;
  font-size: 0.82rem;
}

.docs-toc a {
  display: block;
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.docs-toc a:hover,
.docs-toc a:focus-visible,
.docs-toc a.is-active {
  color: var(--ink);
  border-color: var(--orange);
}

.toc-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.toc-status a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
}

.toc-status a:hover {
  color: var(--orange);
}

/* ---------- breadcrumb / doc header ---------- */

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.doc-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.doc-breadcrumb a:hover {
  color: var(--orange);
}

.doc-breadcrumb .sep {
  opacity: 0.5;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 24px;
  height: 2px;
  content: "";
  background: var(--orange);
}

.doc-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.doc-header h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.doc-lead {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.status-row.status-row--legend {
  margin-top: 4px;
}

.status-legend-copy {
  margin-top: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .status-badge {
  background: rgba(255, 255, 255, 0.04);
}

.status-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: var(--dot);
}

.status-badge.status-live {
  --dot: #25c979;
}

.status-badge.status-beta {
  --dot: #ffcf40;
}

.status-badge.status-internal {
  --dot: #68d9ff;
}

.status-badge.status-wip {
  --dot: #ff7138;
}

/* ---------- prose ---------- */

.doc-prose {
  max-width: 720px;
}

.doc-prose h2 {
  margin: 52px 0 18px;
  font-size: 1.56rem;
  letter-spacing: -0.03em;
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.doc-prose h2:first-child {
  margin-top: 0;
}

.doc-prose h3 {
  margin: 34px 0 14px;
  font-size: 1.16rem;
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.doc-prose p {
  margin-bottom: 16px;
  color: var(--ink);
}

.doc-prose p.lead-muted {
  color: var(--muted);
}

.doc-prose ul,
.doc-prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink);
}

.doc-prose li {
  margin-bottom: 8px;
}

.doc-prose li::marker {
  color: var(--orange);
}

.doc-prose a.doc-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration-color: rgba(255, 113, 56, 0.5);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.doc-prose a.doc-link:hover {
  text-decoration-color: var(--orange);
}

.inline-code {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(23, 33, 27, 0.05);
  font-size: 0.86em;
  white-space: nowrap;
}

html[data-theme="dark"] .inline-code {
  background: rgba(255, 255, 255, 0.06);
}

hr.doc-rule {
  margin: 44px 0;
  border: none;
  border-top: 1px solid var(--line);
}

/* ---------- callouts ---------- */

.callout {
  display: flex;
  gap: 14px;
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--dot, var(--blue));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .callout {
  background: rgba(255, 255, 255, 0.04);
}

.callout-icon {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1.4;
}

.callout p {
  margin: 0;
  font-size: 0.94rem;
}

.callout p + p {
  margin-top: 8px;
}

.callout-note {
  --dot: var(--blue);
}

.callout-tip {
  --dot: #1a7f5a;
}

.callout-warn {
  --dot: var(--orange);
}

.callout-status {
  --dot: #8e72ff;
}

/* ---------- code blocks ---------- */

.doc-code {
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(23, 25, 45, 0.18);
  color: #edf0ff;
  background: #171526;
}

.code-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font: 700 0.76rem/1.4 "DM Mono", monospace;
  color: rgba(237, 240, 255, 0.6);
}

.code-toolbar .code-lights {
  display: inline-flex;
  gap: 6px;
  margin-right: 4px;
}

.code-toolbar .code-lights i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.code-toolbar .code-lights i:nth-child(2) {
  background: var(--yellow);
}

.code-toolbar .code-lights i:nth-child(3) {
  background: #4bd58b;
}

.code-toolbar .code-name {
  flex: 1 1 auto;
}

.copy-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(237, 240, 255, 0.75);
  font: 700 0.72rem/1.5 "DM Mono", monospace;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.copy-button.is-copied {
  color: #72e7ab;
  border-color: rgba(114, 231, 171, 0.4);
}

.doc-code pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font: 500 0.85rem/1.75 "DM Mono", monospace;
}

.doc-code code {
  font: inherit;
}

.code-green {
  color: #72e7ab;
}

.code-yellow {
  color: #ffdb6e;
}

.code-purple {
  color: #bcaaff;
}

.code-blue {
  color: #7fc4ff;
}

.code-muted {
  color: rgba(237, 240, 255, 0.42);
}

/* ---------- api tables ---------- */

.api-table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.api-table th,
table.api-table td {
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.api-table td:last-child,
table.api-table th:last-child {
  white-space: normal;
}

table.api-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(23, 33, 27, 0.03);
}

html[data-theme="dark"] table.api-table th {
  background: rgba(255, 255, 255, 0.03);
}

table.api-table tr:last-child td {
  border-bottom: none;
}

table.api-table code {
  font-size: 0.86em;
}

.method-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 7px;
  font: 800 0.72rem/1.6 "DM Mono", monospace;
  letter-spacing: 0.02em;
}

.method-get {
  color: #0e6b46;
  background: rgba(26, 127, 90, 0.14);
}

.method-post {
  color: #1d54c9;
  background: rgba(36, 107, 254, 0.14);
}

.method-put {
  color: #9a5c00;
  background: rgba(255, 207, 64, 0.22);
}

html[data-theme="dark"] .method-get {
  color: #72e7ab;
}

html[data-theme="dark"] .method-post {
  color: #8fb4ff;
}

html[data-theme="dark"] .method-put {
  color: #ffdb6e;
}

/* ---------- method / definition cards ---------- */

.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.doc-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .doc-card {
  background: rgba(255, 255, 255, 0.03);
}

.doc-card h4 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.doc-card code {
  display: block;
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 700;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- pager ---------- */

.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pager-link:hover,
.pager-link:focus-visible {
  border-color: rgba(255, 113, 56, 0.4);
  transform: translateY(-2px);
}

.pager-link.next {
  grid-column: 2;
  text-align: right;
  align-items: flex-end;
}

.pager-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pager-title {
  font-weight: 750;
  font-size: 0.98rem;
}

/* ---------- mobile appbar (matches main site: fixed bottom bar) ---------- */

.mobile-appbar {
  display: none;
  position: fixed;
  z-index: 70;
  right: 0;
  bottom: 0;
  left: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 -12px 40px rgba(23, 33, 27, 0.08);
}

html[data-theme="dark"] .mobile-appbar {
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
}

.mobile-appbar__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

html[data-theme="dark"] .mobile-appbar__brand {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-appbar__brand img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.mobile-appbar__signal.signal {
  margin: 0;
  max-width: min(58vw, 240px);
}

.mobile-appbar__end {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-appbar__end .theme-btn,
.mobile-appbar__end .search-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

/* mobile sidebar drawer */

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  border: none;
  padding: 0;
  background: rgba(10, 14, 11, 0.5);
}

.mobile-sidebar-backdrop.is-open {
  display: block;
}

.mobile-sidebar-panel {
  position: fixed;
  z-index: 71;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(300px, 84vw);
  overflow-y: auto;
  padding: 20px 18px 40px;
  background: var(--paper);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.2);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.mobile-sidebar-panel.is-open {
  transform: translateX(0);
}

.mobile-sidebar-panel .docs-sidebar-inner {
  display: flex;
}

/* ---------- search palette ---------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding: 10vh 16px 16px;
  background: rgba(10, 14, 11, 0.5);
  backdrop-filter: blur(2px);
}

.search-overlay.is-open {
  display: flex;
  justify-content: center;
}

.search-modal {
  width: min(600px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.search-input-row svg {
  flex: 0 0 auto;
  opacity: 0.6;
}

#searchInput {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: none;
  color: var(--ink);
  font: 500 1rem/1.4 "DM Sans", sans-serif;
}

.search-esc {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font: 700 0.7rem/1.6 "DM Mono", monospace;
}

.search-results {
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
}

.search-result strong {
  font-size: 0.92rem;
}

.search-result span {
  color: var(--muted);
  font-size: 0.78rem;
}

.search-result .search-section {
  color: var(--orange);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-result.is-active,
.search-result:hover {
  background: rgba(255, 113, 56, 0.1);
}

.search-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- footer (shared chrome) ---------- */

.site-footer {
  margin-top: 40px;
  padding: 64px max(20px, calc((100vw - 1280px) / 2)) 28px;
  color: #fff;
  background: #0f1713;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: end;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-main h2 {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.footer-main h2 span {
  color: var(--yellow);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 11px 25px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-links a[aria-current="page"] {
  color: var(--yellow);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 60px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.76rem;
}

/* ---------- misc ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  :root {
    --toc-w: 0px;
  }
  .docs-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 980px) {
  .site-header {
    display: none !important;
  }
  .mobile-appbar {
    display: flex;
  }
  body {
    padding-bottom: 78px;
  }
  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(1280px, calc(100% - 32px));
  }
  .docs-sidebar {
    display: none;
  }
  .doc-header h1 {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
  }
  .doc-pager {
    grid-template-columns: 1fr;
  }
  .pager-link.next {
    grid-column: 1;
    text-align: left;
    align-items: flex-start;
  }
  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .doc-cards {
    grid-template-columns: 1fr;
  }
}
