:root {
  --bg: #f6f8fb;
  --text: #172033;
  --muted: #647087;
  --card: #ffffff;
  --line: #dfe6f0;
  --primary: #2347ff;
  --soft: #eef2ff;
  --shadow: 0 14px 36px rgba(23, 32, 51, 0.07);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

code {
  background: #eef2f7;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 0.92em;
}

.page-header {
  background: #10172a;
  color: #fff;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}

.page-header .eyebrow {
  color: #9fb0ff;
  margin: 0 0 2px;
}

h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin: 0;
}

h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin: 0 0 18px;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  margin: 0 0 28px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 12px;
  z-index: 10;
}

.toolbar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

.toolbar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(35, 71, 255, 0.1);
}

.section {
  margin: 46px 0;
}

.intro-card,
.click-path {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.note {
  background: var(--soft);
  border: 1px solid #d6ddff;
  color: #23316a;
  border-radius: 12px;
  padding: 12px 14px;
}

.click-path ol {
  margin: 0;
  padding-left: 22px;
}

.click-path li {
  margin: 8px 0;
}

.table-wrap {
  width: 100%;
  overflow-x: visible;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

th {
  background: #f0f4fa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

/* Desktop column balance */
.validation-table th:nth-child(1),
.validation-table td:nth-child(1) {
  width: 17%;
}

.validation-table th:nth-child(2),
.validation-table td:nth-child(2) {
  width: 12%;
}

.validation-table th:nth-child(3),
.validation-table td:nth-child(3) {
  width: 15%;
}

.validation-table th:nth-child(4),
.validation-table td:nth-child(4) {
  width: 25%;
  font-size: 13px;
}

.validation-table th:nth-child(5),
.validation-table td:nth-child(5) {
  width: 16%;
}

.validation-table th:nth-child(6),
.validation-table td:nth-child(6) {
  width: 15%;
  font-size: 13px;
}

.copy-cell {
  position: relative;
  width: 100%;
  min-width: 0;
}

.copy-cell code {
  display: block;
  width: 100%;
  min-height: 42px;
  background: #f7f9fd;
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  padding: 10px 42px 10px 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #172033;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.inline-copy-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  border: 1px solid #cfd8e8;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 0;
  transition: 0.18s ease;
}

.inline-copy-btn::before {
  content: "";
  width: 15px;
  height: 15px;
  background: #647087;
  -webkit-mask: 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' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: 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' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: 0.18s ease;
}

.inline-copy-btn:hover {
  background: var(--soft);
  border-color: var(--primary);
}

.inline-copy-btn:hover::before {
  background: var(--primary);
}

.inline-copy-btn:active {
  transform: scale(0.96);
}

/* Copied state */
.inline-copy-btn.copied {
  background: #ecfdf5;
  border-color: #86efac;
  animation: copiedPop 0.32s ease;
}

.inline-copy-btn.copied::before {
  width: 16px;
  height: 16px;
  background: #16a34a;
  -webkit-mask: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

@keyframes copiedPop {
  0% {
    transform: scale(0.85);
  }

  55% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 20px 46px;
}

#toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #10172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 99;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .page-header {
    padding: 18px;
  }

  .header-inner {
    align-items: flex-start;
  }

  main {
    padding: 18px;
  }

  .toolbar {
    position: static;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 980px;
    table-layout: auto;
  }

  th,
  td {
    padding: 12px 14px;
  }

  .copy-cell {
    min-width: 260px;
  }
}

.doc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.doc-card h2 {
  margin-bottom: 14px;
}

.doc-card h3 {
  margin: 24px 0 8px;
  font-size: 17px;
  letter-spacing: -0.015em;
}

.doc-card p {
  margin: 10px 0;
}

.doc-card a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.setup-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.setup-item {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.setup-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.setup-item p {
  margin: 6px 0;
  color: var(--muted);
}

.soft-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.copy-code {
  position: relative;
  margin: 12px 0 18px;
  background: #0f172a;
  color: #e6edf7;
  border-radius: 14px;
  padding: 46px 16px 16px;
  overflow-x: auto;
  border: 1px solid #1c2942;
}

.copy-code code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 0;
  transition: 0.18s ease;
}

.copy-btn::before {
  content: "";
  width: 15px;
  height: 15px;
  background: #dbeafe;
  -webkit-mask: 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' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: 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' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: 0.18s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(134, 239, 172, 0.7);
  animation: copiedPop 0.32s ease;
}

.copy-btn.copied::before {
  width: 16px;
  height: 16px;
  background: #86efac;
  -webkit-mask: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

@keyframes copiedPop {
  0% {
    transform: scale(0.85);
  }

  55% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 820px) {
  .doc-card {
    padding: 18px;
  }

  .setup-list {
    grid-template-columns: 1fr;
  }

  .copy-code {
    overflow-x: auto;
  }

  .copy-code code {
    white-space: pre;
  }
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-nav a {
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 9px 10px;
  border-radius: 999px;
  transition: 0.18s ease;
}

.page-nav a:hover,
.page-nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 820px) {
  .header-inner {
    display: block;
  }

  .header-brand {
    margin-bottom: 14px;
  }

  .page-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .page-nav a {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* Page navigation stays in top navbar.
   Section navigation stays in left sidebar. */

.docs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.docs-content {
  min-width: 0;
}

.section-sidebar {
  position: sticky;
  top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.section-sidebar p {
  margin: 0 0 10px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-sidebar a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  padding: 10px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  transition: 0.18s ease;
}

.section-sidebar a:hover {
  color: var(--primary);
  background: var(--soft);
}

.section-sidebar a.active {
  color: var(--primary);
  background: var(--soft);
}

.section {
  scroll-margin-top: 28px;
}

.toolbar {
  top: 18px;
}

main {
  max-width: none;
  padding: 0;
}

@media (max-width: 900px) {
  .docs-shell {
    display: block;
    padding: 18px;
  }

  .section-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .section-sidebar p {
    flex: 0 0 auto;
    margin: 0 8px 0 0;
    padding: 0;
  }

  .section-sidebar a {
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .section-sidebar a.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }

  .section {
    scroll-margin-top: 18px;
  }
}

/* =========================================================
   NEW DOCUMENTATION APP HEADER
   Light sticky shell + clean page tabs
   ========================================================= */

body {
  background:
    radial-gradient(circle at top left, rgba(35, 71, 255, 0.07), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
}

/* Header becomes a clean sticky app bar, not a hero section */
.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1240px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: center;
  gap: 28px;
}

/* Brand block */
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #2347ff;
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  font-size: 19px;
  font-weight: 900;
  box-shadow:
    0 10px 24px rgba(35, 71, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.page-header .eyebrow {
  margin: 0 0 3px;
  color: #647087;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(22px, 2.3vw, 31px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page navigation becomes a clean tab strip */
.page-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.page-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  color: #526179;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.page-nav a:hover {
  color: #172033;
  background: rgba(255, 255, 255, 0.72);
}

.page-nav a.active {
  color: #172033;
  background: #ffffff;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.08),
    inset 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.page-nav a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: #2347ff;
}

.page-nav a:active {
  transform: translateY(1px);
}

.page-nav a:focus-visible {
  outline: 2px solid rgba(35, 71, 255, 0.35);
  outline-offset: 3px;
}

/* Main layout gets a little more breathing room below sticky header */
.docs-shell {
  padding-top: 28px;
}

/* Since header is sticky, sidebar/search should sit below it */
.section-sidebar {
  top: 96px;
  max-height: calc(100vh - 116px);
}

.docs-shell .toolbar,
.toolbar {
  top: 96px;
}

/* Sidebar active becomes more refined */
.section-sidebar a.active {
  color: #172033;
  background: #eef2ff;
}

/* Content cards slightly cleaner with the new header */
.doc-card,
.intro-card,
.click-path,
.table-wrap,
.section-sidebar,
.toolbar {
  border-color: #e1e8f2;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.055);
}

/* Medium screens */
@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 20px;
  }

  .page-nav {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .page-nav a {
    flex: 0 0 auto;
  }

  .section-sidebar {
    top: 120px;
  }

  .docs-shell .toolbar,
  .toolbar {
    top: 120px;
  }
}

/* Mobile */
@media (max-width: 620px) {
  .page-header {
    position: static;
  }

  .header-inner {
    min-height: auto;
    padding: 14px 18px;
  }

  .header-brand {
    align-items: center;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .page-header .eyebrow {
    font-size: 9.5px;
    letter-spacing: 0.13em;
  }

  .page-header h1 {
    font-size: 24px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .page-nav {
    border-radius: 12px;
    padding: 3px;
  }

  .page-nav a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 9px;
  }

  .page-nav a.active::after {
    left: 10px;
    right: 10px;
    bottom: 4px;
  }

  .docs-shell {
    padding-top: 18px;
  }

  .section-sidebar {
    top: auto;
    max-height: none;
  }

  .docs-shell .toolbar,
  .toolbar {
    top: auto;
  }
}

/* Navbar search */

.header-inner {
  grid-template-columns: minmax(280px, 1fr) auto auto;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.search-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 12px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: 0.18s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.search-toggle::before {
  content: "";
  width: 17px;
  height: 17px;
  background: #526179;
  -webkit-mask: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search-toggle:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.search-toggle:hover::before {
  background: var(--primary);
}

.nav-search input {
  position: absolute;
  right: 0;
  width: 0;
  height: 42px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #ffffff;
  color: var(--text);
  padding: 0 44px 0 14px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  transition: 0.22s ease;
}

.nav-search.open input,
.nav-search input:focus {
  width: min(320px, 70vw);
  opacity: 1;
  pointer-events: auto;
}

.nav-search.open .search-toggle {
  position: relative;
  z-index: 2;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
}

.nav-search.open .search-toggle::before {
  background: var(--primary);
}

.toolbar {
  display: none;
}

@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .page-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .nav-search {
    order: 2;
  }
}

@media (max-width: 620px) {
  .nav-search input {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 72px;
    width: auto;
    transform: translateY(-8px);
  }

  .nav-search.open input,
  .nav-search input:focus {
    width: auto;
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   FINAL NAVBAR FIX
   Clean light documentation header + stable nav + search icon
   Paste this at the absolute end of style.css
   ========================================================= */

.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  padding: 0;
  border-bottom: 1px solid #e3e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  width: 100%;
  max-width: 1240px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: #2347ff;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(35, 71, 255, 0.22);
}

.page-header .eyebrow {
  margin: 0 0 3px;
  color: #647087;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  max-width: 460px;
  color: #101828;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top page navigation only */
.page-nav {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: auto;
  min-width: 0;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: none;
  overflow: visible;
}

.page-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  color: #56657a;
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: none;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.page-nav a:hover {
  color: #172033;
  background: rgba(255, 255, 255, 0.75);
}

.page-nav a.active {
  color: #172033;
  background: #ffffff;
  box-shadow:
    0 5px 14px rgba(15, 23, 42, 0.08),
    inset 0 0 0 1px rgba(226, 232, 240, 0.95);
}

.page-nav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: #2347ff;
}

/* Navbar search */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 42px;
  height: 42px;
}

.search-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 12px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transition: 0.18s ease;
}

.search-toggle::before {
  content: "";
  width: 17px;
  height: 17px;
  background: #526179;
  -webkit-mask: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search-toggle:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.search-toggle:hover::before {
  background: var(--primary);
}

.nav-search input {
  position: absolute;
  right: 0;
  top: 0;
  width: 0;
  height: 42px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #ffffff;
  color: var(--text);
  padding: 0 44px 0 14px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  transition: 0.22s ease;
}

.nav-search.open input,
.nav-search input:focus {
  width: min(320px, 72vw);
  opacity: 1;
  pointer-events: auto;
}

.nav-search.open .search-toggle {
  position: relative;
  z-index: 2;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav-search.open .search-toggle::before {
  background: var(--primary);
}

/* Old toolbar hidden because search is now in navbar */
.toolbar {
  display: none !important;
}

/* Header-aware sticky sidebar */
.docs-shell {
  padding-top: 28px;
}

.section-sidebar {
  top: 96px;
  max-height: calc(100vh - 116px);
}

/* Tablet */
@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: auto;
    padding: 14px 20px;
    gap: 12px;
  }

  .header-brand {
    min-width: 0;
  }

  .page-header h1 {
    max-width: none;
  }

  .page-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .page-nav a {
    flex: 0 0 auto;
  }

  .nav-search {
    order: 2;
  }

  .section-sidebar {
    top: 126px;
    max-height: calc(100vh - 146px);
  }
}

/* Mobile */
@media (max-width: 620px) {
  .page-header {
    position: static;
  }

  .header-inner {
    padding: 14px 18px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .page-header .eyebrow {
    font-size: 9.5px;
    letter-spacing: 0.13em;
  }

  .page-header h1 {
    font-size: 23px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .page-nav {
    border-radius: 12px;
    padding: 3px;
  }

  .page-nav a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 9px;
  }

  .page-nav a.active::after {
    left: 10px;
    right: 10px;
    bottom: 4px;
  }

  .nav-search input {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 72px;
    width: auto;
    transform: translateY(-8px);
  }

  .nav-search.open input,
  .nav-search input:focus {
    width: auto;
    opacity: 1;
    transform: translateY(0);
  }

  .docs-shell {
    padding-top: 18px;
  }

  .section-sidebar {
    top: auto;
    max-height: none;
  }
}