/* Docs responsive — breakpoint: 1370px
   1. Sidebar → burger menu
   2. Search bar includes "Ask a question" option
   3. "On this page" → floating pill + bottom sheet
*/

/* ================================================================
   BASE LAYOUT (fallback when DOCS_STYLES inline not injected)
   Ensures .docs-layout and .docs-landing-cards are grid even if
   build-docs.cjs has not run after build-docs-html.js.
   ================================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 256px 1fr 430px;
  gap: 0 24px;
  padding-right: 24px;
  min-height: calc(100vh - 64px);
  align-items: start;
}
.docs-main {
  overflow-y: auto;
  min-height: 0;
  position: relative;
  padding-bottom: 80px;
}
.docs-main > div {
  max-width: 56rem;
  padding-bottom: 0 !important;
}
.docs-left-sidebar {
  padding-bottom: 0.75rem;
}
.docs-landing-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 0;
}
.docs-landing-cards--section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1.5rem;
}
@media (max-width: 640px) {
  .docs-landing-cards,
  .docs-landing-cards--section {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   LAYOUT: hide both sidebars, single-column content
   ================================================================ */
@media (max-width: 1370px) {
  .docs-layout {
    grid-template-columns: 1fr !important;
    padding: 0 24px !important;
    gap: 0 !important;
  }
  .docs-layout .docs-left-sidebar {
    display: none !important;
  }
  .docs-layout .docs-right-sidebar {
    display: none !important;
  }
  .docs-main > div {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ================================================================
   HEADER: switch grid → flex so burger fits naturally
   ================================================================ */
@media (max-width: 1370px) {
  .docs-header-grid {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0 20px !important;
  }
  .docs-header-search {
    flex: 1 !important;
    min-width: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: none !important;
  }
}

/* ================================================================
   BURGER BUTTON
   ================================================================ */
.docs-burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: 12px;
  margin-right: 0;
  padding: 0;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.docs-burger-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #1f2937;
}
.docs-burger-btn[aria-expanded="true"] {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}
.docs-burger-btn svg { width: 20px; height: 20px; }
@media (max-width: 1370px) {
  .docs-burger-btn { display: flex; }
}
@media (max-width: 860px) {
  .docs-burger-btn { margin-left: auto; }
}

/* ================================================================
   NAV DRAWER (sidebar in overlay)
   ================================================================ */
.docs-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0);
  visibility: hidden;
  transition: background 0.3s ease, visibility 0s 0.3s;
}
.docs-nav-overlay.is-open {
  background: rgba(0, 0, 0, 0.4);
  visibility: visible;
  transition: background 0.3s ease, visibility 0s 0s;
}
.docs-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 85vw);
  z-index: 70;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 32px;
}
.docs-nav-drawer-brand-row {
  display: none;
}
.docs-nav-drawer-top {
  display: none;
}
@media (max-width: 860px) {
  .docs-nav-drawer {
    width: 100%;
    max-width: 100%;
  }
  .docs-nav-drawer-top {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .docs-nav-drawer-brand-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .docs-nav-drawer-brand-row .docs-drawer-logo {
    flex-shrink: 0;
  }
  .docs-nav-drawer-brand-row .docs-header-search {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: block;
    overflow: visible;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .docs-nav-drawer-brand-row .docs-header-search .w-full {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .docs-nav-drawer-brand-row .docs-header-search .docs-search-bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .docs-nav-drawer-brand-row .docs-header-search:focus-within,
  .docs-nav-drawer-brand-row .docs-header-search .w-full:focus-within {
    outline: none;
  }
  .docs-nav-drawer-top .docs-header-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .docs-nav-drawer-top .docs-header-actions a {
    width: 100%;
    min-width: 0;
    justify-content: center;
    box-sizing: border-box;
  }
}
.docs-nav-overlay.is-open .docs-nav-drawer {
  transform: translateX(0);
}
.docs-nav-drawer .docs-left-sidebar {
  /* Prevent inline page media rules from hiding the drawer nav on small screens. */
  display: block !important;
}

/* Drawer header row: logo (no text) left aligned with sidebar nav, close button right */
.docs-nav-drawer-close-wrap {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  padding-left: 20px; /* match sidebar .docs-left-sidebar px-5 so logo aligns with nav text */
  box-sizing: border-box;
}
.docs-drawer-logo-only {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.docs-drawer-logo-only img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}
.docs-nav-drawer-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.docs-nav-drawer-close-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #1f2937;
}
.docs-nav-drawer-close-btn svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 1370px) {
  .docs-nav-drawer-close-wrap { display: flex; }
}
@media (max-width: 860px) {
  .docs-nav-drawer-close-wrap {
    position: absolute;
    top: 24px;
    right: 20px;
    margin-bottom: 0;
    justify-content: flex-end;
  }
  .docs-nav-drawer-close-wrap .docs-drawer-logo-only {
    display: none;
  }
  .docs-nav-drawer-brand-row {
    padding-right: 52px;
  }
}
body.docs-nav-open { overflow: hidden; }

/* ================================================================
   ASK BAR: centre on responsive
   ================================================================ */
@media (max-width: 1370px) {
  .docs-ask-bar {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(480px, calc(100vw - 48px)) !important;
  }
  .docs-main > div {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}
@media (max-width: 1370px) {
  body[data-docs-landing="true"] .docs-main > div {
    max-width: 980px !important;
  }
  .docs-landing-cards,
  .docs-landing-cards--section {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
  }
  .docs-group-card,
  .docs-group-card--section {
    width: 100% !important;
    max-width: none !important;
    border-radius: 12px !important;
  }
  .docs-group-card--section {
    align-items: center;
    min-height: 72px;
  }
}
@media (max-width: 640px) {
  .docs-landing-cards,
  .docs-landing-cards--section {
    grid-template-columns: 1fr !important;
  }
  .docs-main > div {
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-top: 28px !important;
  }
  .docs-group-card--section {
    gap: 0.9rem;
    padding: 1rem !important;
  }
  .docs-group-card__icon-wrap {
    width: 38px;
    height: 38px;
  }
  .docs-group-card__icon-wrap img {
    width: 18px;
    height: 18px;
  }
  .docs-group-card--section .docs-group-card__title,
  .docs-group-card--section .docs-group-card__desc {
    overflow-wrap: anywhere;
  }
}

/* ================================================================
   FLOATING "ON THIS PAGE" PILL
   ================================================================ */
.docs-toc-pill {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.docs-toc-pill:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  background: #f8fafc;
}
.docs-toc-pill:active { transform: translateX(-50%) scale(0.97); }
.docs-toc-pill svg {
  width: 18px;
  height: 18px;
  color: #64748b;
  transition: transform 0.25s ease;
}
.docs-toc-pill.is-open svg {
  transform: rotate(180deg);
  color: #2563eb;
}
@media (max-width: 1370px) {
  .docs-toc-pill { display: flex; }
  body.docs-has-ask-bar .docs-toc-pill { bottom: 84px; }
}

/* ================================================================
   TOC BOTTOM SHEET
   ================================================================ */
.docs-toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0);
  visibility: hidden;
  transition: background 0.3s ease, visibility 0s 0.3s;
}
.docs-toc-overlay.is-open {
  background: rgba(0,0,0,0.35);
  visibility: visible;
  transition: background 0.3s ease, visibility 0s 0s;
}
.docs-toc-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  max-height: 70vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.docs-toc-overlay.is-open .docs-toc-drawer {
  transform: translateY(0);
}
.docs-toc-drawer-handle {
  flex-shrink: 0;
  padding: 12px 0;
  display: flex;
  justify-content: center;
}
.docs-toc-drawer-handle::before {
  content: "";
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
}
.docs-toc-drawer-author {
  flex-shrink: 0;
  padding: 0 24px 20px;
}
.docs-toc-drawer-author .docs-author-card {
  margin-bottom: 0;
}
.docs-toc-drawer-title {
  flex-shrink: 0;
  padding: 0 24px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.02em;
}
.docs-toc-drawer nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 32px;
  -webkit-overflow-scrolling: touch;
}
.docs-toc-drawer nav a {
  display: block;
  padding: 10px 0 10px 14px;
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.docs-toc-drawer nav a:hover { color: #1e293b; }
.docs-toc-drawer nav a.toc-active {
  color: #2563eb;
  font-weight: 600;
  border-left-color: #2563eb;
}
body.docs-toc-open { overflow: hidden; }

/* ================================================================
   DOCS ARTICLE FORMATTING (lists & quote blocks)
   Only applies on article pages (not landing): .docs-main .prose with body without data-docs-landing
   ================================================================ */

/* ----- Numbered lists: oval/pill number markers; grid so content stacks in column 2 ----- */
body:not([data-docs-landing="true"]) .docs-main .prose ol {
  list-style: none;
  padding-left: 0;
  counter-reset: docs-step;
  margin: 1rem 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose ol li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 0.75rem;
  padding-left: 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose ol li::before {
  counter-increment: docs-step;
  content: counter(docs-step);
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  line-height: 1;
}
body:not([data-docs-landing="true"]) .docs-main .prose ol li > * {
  grid-column: 2;
  min-width: 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose ol li:last-child {
  margin-bottom: 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose ol a {
  color: #ff4800;
}

/* ----- Bulleted lists: normal disc bullets ----- */
body:not([data-docs-landing="true"]) .docs-main .prose ul {
  list-style-type: disc;
  padding-left: 1.625em;
  margin: 1rem 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose ul li {
  margin-bottom: 0.25rem;
}
body:not([data-docs-landing="true"]) .docs-main .prose ul li:last-child {
  margin-bottom: 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose ul a {
  color: #ff4800;
}

/* ----- Code blocks: wrapper + copy button ----- */
body:not([data-docs-landing="true"]) .docs-main .prose .docs-code-block {
  position: relative;
  margin: 1rem 0;
}
body:not([data-docs-landing="true"]) .docs-main .prose .docs-code-block pre {
  margin: 0;
  padding: 1rem 1.25rem 2.5rem 1.25rem;
  overflow-x: auto;
}
body:not([data-docs-landing="true"]) .docs-main .prose .docs-code-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
body:not([data-docs-landing="true"]) .docs-main .prose .docs-code-copy:hover {
  color: #0d9488;
  background: #e0f7fa;
  border-color: #b2ebf2;
}
body:not([data-docs-landing="true"]) .docs-main .prose .docs-code-copy--copied {
  color: #0f766e;
  background: #ccfbf1;
  border-color: #99f6e4;
}

/* ----- Quote / callout blocks: rounded box, icon left, non-italic text ----- */
body:not([data-docs-landing="true"]) .docs-main .prose blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem 1rem 3.5rem;
  background: #e0f7fa;
  border: 1px solid #b2ebf2;
  border-radius: 12px;
  position: relative;
  font-size: inherit;
  font-style: normal;
  font-weight: inherit;
  color: inherit;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #26c6da;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
  background-size: 1.25rem;
  background-repeat: no-repeat;
  background-position: center;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote p {
  margin: 0;
  color: inherit;
  font-weight: inherit;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote p + p {
  margin-top: 0.5rem;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote a {
  color: #00acc1;
  font-weight: 500;
  text-decoration: underline;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote a:hover {
  color: #0097a7;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote strong {
  color: inherit;
}

/* Default (Note): teal/cyan — info icon above */

/* Tip: green — lightbulb icon */
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-tip {
  background: #e8f5e9;
  border-color: #c8e6c9;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-tip::before {
  background: #2e7d32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7z'/%3E%3C/svg%3E");
  background-size: 1.25rem;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-tip a {
  color: #2e7d32;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-tip a:hover {
  color: #1b5e20;
}

/* Warning / Important: amber — warning triangle icon */
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-warning {
  background: #fff8e1;
  border-color: #ffecb3;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-warning::before {
  background: #f57c00;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' fill-rule='evenodd' clip-rule='evenodd'%3E%3Cpath d='M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z'/%3E%3C/svg%3E");
  background-size: 1.25rem;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-warning a {
  color: #e65100;
}
body:not([data-docs-landing="true"]) .docs-main .prose blockquote.docs-callout-warning a:hover {
  color: #bf360c;
}
