/* Zapt Docs — documentation shell + content blocks */

@import url("https://fonts.googleapis.com/css2?family=Cousine:wght@400;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --docs-topbar-height: 56px;
  --docs-sidebar-width: 280px;
  --docs-font: Inter, "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --docs-mono: Cousine, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --docs-bg: #f7f8fa;
  --docs-surface: #ffffff;
  --docs-sidebar-bg: #f3f4f7;
  --docs-border: #e5e7eb;
  --docs-text: #0d1b2a;
  --docs-text-body: #374151;
  --docs-text-muted: #6b7b8d;
  --docs-text-subtle: #9ca3af;
  --docs-accent: #3b5bdb;
  --docs-accent-soft: #eef2ff;
  --docs-code-bg: #0f172a;
  --docs-inline-code: #2563eb;
  --docs-name: #ff4b3e;
  --docs-soft: #f8f9fa;
  --docs-soft-2: #f9fafb;
  --docs-radius: 10px;
  --docs-hover: #f3f4f6;
  --docs-focus-ring: rgba(59, 91, 219, 0.35);

  --docs-callout-info: #0757c8;
  --docs-callout-note: #92650a;
  --docs-callout-success: #067852;
  --docs-callout-body: #737373;
  --docs-callout-border: #e5e5e5;

  /* Filled primary actions (`.docs-btn`). Do not reuse `--docs-accent` as a fill:
     in dark mode that token is a light accent and fails WCAG AA on white text.
     Pair `--docs-btn-bg` / `--docs-btn-fg` must stay ≥ 4.5:1 at 14px. */
  --docs-btn-bg: #0757c8;
  --docs-btn-fg: #ffffff;
  --docs-btn-hover-bg: #0546a0;
}

html[data-theme="dark"] {
  --docs-bg: #12141a;
  --docs-surface: #1a1d26;
  --docs-sidebar-bg: #161920;
  --docs-border: #2a2e3a;
  --docs-text: #f3f4f6;
  --docs-text-body: #d1d5db;
  --docs-text-muted: #9ca3af;
  --docs-text-subtle: #6b7280;
  --docs-accent: #7b93ff;
  --docs-accent-soft: #2a3358;
  --docs-code-bg: #0f172a;
  --docs-inline-code: #93c5fd;
  --docs-name: #fb7185;
  --docs-soft: #161920;
  --docs-soft-2: #1f232d;
  --docs-hover: #252833;
  --docs-focus-ring: rgba(123, 147, 255, 0.4);

  --docs-callout-info: #8bb4ff;
  --docs-callout-note: #e8b84a;
  --docs-callout-success: #3dcea0;
  --docs-callout-body: #a3a3a3;
  --docs-callout-border: var(--docs-border);

  --docs-btn-bg: #1b67d0;
  --docs-btn-fg: #ffffff;
  --docs-btn-hover-bg: #1557b0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.docs-body {
  font-family: var(--docs-font);
  background: var(--docs-bg);
  color: var(--docs-text);
  -webkit-font-smoothing: antialiased;
}

body.docs-lightbox-open {
  overflow: hidden;
}

/* —— Top bar —— */
.docs-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--docs-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  background: var(--docs-surface);
  border-bottom: 1px solid var(--docs-border);
}

.docs-topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-topbar__logo {
  display: flex;
  align-items: center;
}

.docs-topbar__logo img {
  width: 28px;
  height: 28px;
  display: block;
}

.docs-topbar__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-text);
}

.docs-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.docs-theme-toggle:hover {
  background: var(--docs-hover);
}

.docs-theme-toggle img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

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

.docs-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--docs-border);
  object-fit: cover;
}

/* —— Layout (with home chrome sidebar) —— */
.docs-shell {
  display: flex;
  margin-top: var(--chrome-topbar-height, 56px);
  margin-left: var(--chrome-sidebar-width, 88px);
  min-height: calc(100vh - var(--chrome-topbar-height, 56px));
}

.docs-sidebar {
  position: sticky;
  top: var(--chrome-topbar-height, 56px);
  align-self: flex-start;
  flex: 0 0 var(--docs-sidebar-width);
  width: var(--docs-sidebar-width);
  min-width: var(--docs-sidebar-width);
  max-width: var(--docs-sidebar-width);
  height: calc(100vh - var(--chrome-topbar-height, 56px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: var(--docs-sidebar-bg);
  border-right: 1px solid var(--docs-border);
  padding: 20px 12px 32px;
  box-sizing: border-box;
}

.docs-sidebar__toolbar {
  display: none;
}

.docs-sidebar--mobile {
  display: none;
}

.docs-nav__group {
  margin-bottom: 24px;
}

.docs-nav__group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0 0 4px 0;
}

.docs-nav__product {
  margin: 0 0 4px;
}

.docs-nav__product.is-open {
  margin-bottom: 12px;
}

.docs-nav__product--flat {
  margin-bottom: 8px;
}

.docs-nav__product-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 10px;
  border-radius: 8px;
  color: var(--docs-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.docs-nav__product-link:hover {
  background: var(--docs-hover);
}

.docs-nav__product-link.is-active {
  background: var(--chrome-nav-active-bg, #d9e3ff);
  color: var(--chrome-nav-active-fg, #0757c8);
}

.docs-nav__product-link.is-active:hover {
  background: var(--chrome-nav-active-bg, #d9e3ff);
  color: var(--chrome-nav-active-fg, #0757c8);
}

.docs-nav__product-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 12px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--docs-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.docs-nav__product-toggle span,
.docs-nav__parent span {
  min-width: 0;
  flex: 1;
  overflow-wrap: break-word;
}

.docs-nav__product-toggle:hover {
  background: var(--docs-hover);
}

.docs-nav__product-toggle.is-open {
  color: var(--chrome-nav-active-fg, #0757c8);
}

.docs-nav__list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px 10px;
}

.docs-nav__list[hidden],
.docs-nav__children[hidden] {
  display: none;
}

.docs-nav__link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.docs-nav__link--child {
  padding: 8px 10px;
  font-size: 13px;
}

.docs-nav__parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--docs-text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.docs-nav__parent:hover {
  background: var(--docs-hover);
  color: var(--docs-text);
}

.docs-nav__parent.is-open {
  color: var(--docs-text);
}

.docs-nav__chevron {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.docs-nav__parent.is-open .docs-nav__chevron,
.docs-nav__product-toggle.is-open .docs-nav__chevron {
  transform: rotate(90deg);
}

html[data-theme="dark"] .docs-nav__chevron {
  filter: invert(1);
}

.docs-nav__children {
  list-style: none;
  margin: 2px 0 6px 12px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--docs-border);
}

.docs-nav__link:hover {
  background: var(--docs-hover);
  color: var(--docs-text);
}

.docs-nav__link.is-active {
  background: var(--chrome-nav-active-bg, #d9e3ff);
  color: var(--chrome-nav-active-fg, #0757c8);
  font-weight: 600;
}

.docs-nav__link.is-active:hover {
  background: var(--chrome-nav-active-bg, #d9e3ff);
  color: var(--chrome-nav-active-fg, #0757c8);
}

.docs-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 64px;
  background: var(--docs-surface);
}

.docs-article {
  max-width: 860px;
}

.docs-article--blocks {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.docs-stub {
  color: var(--docs-text-muted);
  font-size: 15px;
}

/* —— Prose / block 1 —— */
.docs-title {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docs-prose h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose h2 {
  margin: 32px 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose h3 {
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  color: var(--docs-text);
}

.docs-section > h3,
.docs-prose .docs-section > h3,
.docs-tabs__panel-body > h3 {
  margin: 0;
}

.docs-prose p {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--docs-text-body);
}

.docs-prose .docs-title p {
  margin: 0;
  font-size: 15px;
  color: var(--docs-text-muted);
  line-height: 1.6;
}

.docs-prose strong {
  font-weight: 700;
  color: var(--docs-text);
}

.docs-prose em {
  font-style: italic;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--docs-text-body);
}

.docs-prose a {
  color: var(--docs-inline-code);
  text-decoration: none;
}

.docs-prose a:hover {
  text-decoration: underline;
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--docs-btn-bg);
  color: var(--docs-btn-fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.docs-prose a.docs-btn {
  color: var(--docs-btn-fg);
  text-decoration: none;
}

.docs-prose a.docs-btn:hover {
  color: var(--docs-btn-fg);
  text-decoration: none;
  background: var(--docs-btn-hover-bg);
}

.docs-btn:hover {
  background: var(--docs-btn-hover-bg);
}

.docs-btn:focus-visible {
  outline: 2px solid var(--docs-btn-bg);
  outline-offset: 2px;
}

.docs-prose code {
  font-family: var(--docs-mono);
  font-size: 13px;
  background: transparent;
  color: var(--docs-inline-code);
  padding: 0;
  border: none;
  border-radius: 0;
}

.docs-sep {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--docs-border);
}

.docs-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.docs-section[id] {
  scroll-margin-top: 24px;
}

.docs-section > h2,
.docs-prose .docs-section > h2 {
  margin: 0;
}

.docs-section > p,
.docs-prose .docs-section > p {
  margin: 0;
}

.docs-section > .docs-code,
.docs-section > .docs-sample,
.docs-section > .docs-figure,
.docs-section > .docs-compare,
.docs-section > .docs-video,
.docs-section > .docs-audio,
.docs-section > .docs-embed,
.docs-section > .docs-callouts,
.docs-section > .docs-callout,
.docs-section > .docs-table-wrap,
.docs-section > .docs-demo,
.docs-section > .docs-tabs,
.docs-section > .docs-btn,
.docs-section > ul,
.docs-section > ol {
  margin: 0;
}

.docs-demo__preview--map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.docs-tabs__panel-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.docs-tabs__panel-body > .docs-code,
.docs-tabs__panel-body > .docs-table-wrap,
.docs-tabs__panel-body > .docs-callout,
.docs-tabs__panel-body > .docs-callouts,
.docs-tabs__panel-body > .docs-demo,
.docs-tabs__panel-body > .docs-figure,
.docs-tabs__panel-body > ul,
.docs-tabs__panel-body > ol {
  margin: 0;
}

.docs-sample {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
}

.docs-prose .docs-sample p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--docs-text-body);
}

.docs-prose .docs-sample p.docs-sample__h1,
.docs-prose .docs-sample p.docs-sample__h2,
.docs-prose .docs-sample p.docs-sample__h3 {
  margin: 0;
  font-weight: 700;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose .docs-sample p.docs-sample__h1 {
  font-size: 24px;
}

.docs-prose .docs-sample p.docs-sample__h2 {
  font-size: 18px;
}

.docs-prose .docs-sample p.docs-sample__h3 {
  font-size: 16px;
}

/* —— Block 2: code —— */
.docs-code {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 32px;
  padding: 20px;
  background: var(--docs-code-bg);
  border-radius: var(--docs-radius);
  overflow: hidden;
  border: none;
  box-shadow: none;
}

.docs-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 0;
  background: transparent;
  border: none;
}

.docs-code__lang {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

html[data-theme="dark"] .docs-code__lang {
  background: transparent;
  color: #64748b;
}

.docs-code__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.docs-code__copy:hover {
  background: rgba(255, 255, 255, 0.08);
}

.docs-code__copy:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-code__copy-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.docs-code__copy.is-copied {
  width: auto;
  gap: 6px;
  padding: 6px 8px;
  background: transparent;
  color: #4ade80;
}

.docs-copy-feedback {
  display: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #4ade80;
  white-space: nowrap;
}

.docs-code__copy.is-copied .docs-copy-feedback,
.docs-tabs__copy.is-copied .docs-copy-feedback {
  display: inline;
}

.docs-prose .docs-code pre,
.docs-prose .docs-code pre code,
.docs-prose .docs-code .docs-code__src {
  background: transparent;
  color: #94a3b8;
  padding: 0;
  border: none;
  border-radius: 0;
}

.docs-code pre,
.docs-code__body {
  margin: 0;
  padding: 0;
  overflow-x: auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: Cousine, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.docs-code__line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.docs-code__n {
  flex: 0 0 24px;
  width: 24px;
  text-align: right;
  color: #64748b;
  font-size: 13px;
  line-height: 1.2;
}

.docs-code__src {
  flex: 1 1 auto;
  min-width: 0;
  color: #94a3b8;
  line-height: 1.6;
  white-space: pre;
}

/* —— Block 3: figure (image preview or looping GIF) —— */
.docs-figure {
  display: block;
  margin: 0 0 32px;
  padding: 0;
  background: transparent;
  border: none;
}

.docs-article--blocks > .docs-figure {
  margin: 0;
}

.docs-figure > img,
.docs-figure > video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--docs-border);
  background: var(--docs-bg);
}

.docs-figure--ui > img {
  height: auto;
  object-fit: contain;
}

.docs-figure--gif {
  max-width: min(640px, 100%);
}

.docs-figure--gif > img,
.docs-figure--gif > video {
  width: 100%;
  height: auto;
}

.docs-figure--image {
  position: relative;
  width: fit-content;
  max-width: min(640px, 100%);
}

.docs-figure--image > img {
  width: auto;
  max-width: 100%;
  max-height: 360px;
  cursor: zoom-in;
}

.docs-figure__zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.docs-figure__zoom:hover {
  background: var(--docs-hover);
}

.docs-figure__zoom:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-figure__zoom img {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

/* Figure pair: desktop columns, mobile stack */
.docs-compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

.docs-compare__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.docs-compare__col > .docs-figure,
.docs-compare__col > .docs-figure--image,
.docs-compare__col > .docs-figure--gif {
  margin: 0;
  width: fit-content;
  max-width: 100%;
}

.docs-compare--preview .docs-compare__col > .docs-figure,
.docs-compare--preview .docs-compare__col > .docs-figure--gif {
  width: 100%;
  max-width: 100%;
}

.docs-compare__col > .docs-figure > img,
.docs-compare__col > .docs-figure--image > img {
  width: auto;
  max-width: 100%;
  max-height: 420px;
  height: auto;
  object-fit: contain;
  object-position: top center;
}

@media (min-width: 720px) {
  .docs-compare {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 280px);
    align-items: start;
    gap: 24px;
  }

  .docs-compare--device,
  .docs-compare--preview {
    grid-template-columns: 1fr;
  }

  .docs-compare--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

.docs-compare--triple .docs-compare__col > .docs-figure--image {
  width: 100%;
  max-width: none;
}

.docs-compare--triple .docs-compare__col > .docs-figure--image > img {
  display: block;
  width: 100%;
  height: 200px;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.docs-compare__block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docs-compare__block > h2,
.docs-prose .docs-compare__block > h2,
.docs-compare__block > p,
.docs-prose .docs-compare__block > p,
.docs-compare__block > ul,
.docs-prose .docs-compare__block > ul {
  margin: 0;
}

.docs-compare--device .docs-compare__col {
  gap: 24px;
}

.docs-compare--device .docs-compare__col:last-child {
  align-items: center;
}

@media (min-width: 900px) {
  .docs-compare--device {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    align-items: start;
    gap: 32px;
  }

  .docs-compare--preview {
    grid-template-columns: minmax(200px, 0.72fr) minmax(360px, 1.28fr);
    align-items: start;
    gap: 32px;
  }

  .docs-compare--usage {
    grid-template-columns: minmax(240px, 0.9fr) minmax(340px, 1.1fr);
  }
}

.docs-figure--crop {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--docs-border);
}

.docs-figure--crop > video {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

.docs-compare--preview .docs-compare__col:last-child {
  align-items: stretch;
}

.docs-compare--preview .docs-tabs,
.docs-compare--preview .docs-demo {
  width: 100%;
}

html[data-theme="dark"] .docs-figure__zoom img {
  filter: invert(1);
}

.docs-prose .docs-figure__caption {
  display: none;
}

.docs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(12, 14, 20, 0.72);
}

.docs-lightbox[hidden] {
  display: none;
}

.docs-lightbox__img {
  display: block;
  max-width: min(1120px, 92vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface);
}

.docs-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #1a1d26;
  color: #f3f4f6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.docs-lightbox__close:hover {
  background: #252833;
}

.docs-lightbox__close:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

/* —— Block 4: video —— */
.docs-video {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 32px;
  padding: 16px;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
}

.docs-video__frame {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-radius: 8px;
  background: #1a1d26;
}

.docs-video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.docs-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.docs-video__play img {
  width: 20px;
  height: 20px;
  display: block;
}

.docs-video__play:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-video__duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: normal;
}

.docs-video__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-prose .docs-video__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose .docs-video__desc {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--docs-text-body);
}

/* —— Block 5: audio —— */
.docs-audio {
  margin: 0 0 32px;
  padding: 16px;
  border-radius: var(--docs-radius);
  border: 1px solid var(--docs-border);
  background: var(--docs-surface);
}

.docs-audio__player {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-soft);
}

.docs-audio__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.docs-audio__heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.docs-prose .docs-audio__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose .docs-audio__time {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  color: var(--docs-text-muted);
}

.docs-audio__volume {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.docs-audio__volume img {
  width: 18px;
  height: 18px;
  display: block;
}

.docs-audio__vol-track,
.docs-audio__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--docs-border);
  overflow: hidden;
}

.docs-audio__vol-track {
  width: 80px;
}

.docs-audio__vol-track > span {
  display: block;
  height: 100%;
  width: 48px;
  background: var(--docs-accent);
  border-radius: 999px;
}

.docs-audio__progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-audio__bar > span {
  display: block;
  height: 100%;
  width: 220px;
  max-width: 100%;
  background: var(--docs-accent);
  border-radius: 999px;
}

.docs-audio__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.docs-audio__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 18px;
  background: var(--docs-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.docs-audio__play img {
  width: 16px;
  height: 16px;
  display: block;
}

.docs-audio__play:focus-visible,
.docs-audio__skip:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-audio__spacer {
  flex: 1;
  min-width: 0;
  height: 1px;
}

.docs-audio__skip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.docs-audio__skip img {
  width: 18px;
  height: 18px;
  display: block;
}

/* —— Block 6: link embed —— */
.docs-embed {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 32px;
  padding: 16px;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-surface);
}

.docs-embed__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--docs-radius);
  background: var(--docs-accent-soft);
  flex-shrink: 0;
}

.docs-embed__icon img {
  width: 20px;
  height: 20px;
  display: block;
}

.docs-embed__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.docs-embed__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.docs-prose .docs-embed__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose .docs-embed__host {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  color: var(--docs-text-subtle);
  white-space: nowrap;
}

.docs-prose .docs-embed__desc {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--docs-text-body);
}

.docs-embed__thumb {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
}

/* —— Block 7: callouts —— */
.docs-callouts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.docs-callout {
  --docs-callout-accent: var(--docs-callout-info);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--docs-callout-border);
  background: var(--docs-surface);
  box-shadow: none;
  overflow: hidden;
}

.docs-callout--info {
  --docs-callout-accent: var(--docs-callout-info);
}

.docs-callout--note {
  --docs-callout-accent: var(--docs-callout-note);
}

.docs-callout--success {
  --docs-callout-accent: var(--docs-callout-success);
}

.docs-callout__icon {
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 16px 0 0;
  border: 0;
  border-radius: 0;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  background-color: var(--docs-callout-accent);
  -webkit-mask: url("../assets/icons/icon-callout-mask.svg") center / 16px 16px no-repeat;
  mask: url("../assets/icons/icon-callout-mask.svg") center / 16px 16px no-repeat;
}

.docs-callout__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.docs-callout__body > img {
  display: block;
  width: auto;
  max-width: min(320px, 100%);
  height: auto;
  margin-top: 8px;
  border-radius: 8px;
}

.docs-callout strong {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--docs-callout-accent);
}

.docs-prose .docs-callout p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--docs-callout-body);
}

.docs-prose .docs-callout a {
  color: var(--docs-callout-accent);
}

/* —— Block 8: API table —— */
.docs-table-wrap {
  margin: 0 0 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-surface);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.docs-table th,
.docs-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: top;
  line-height: normal;
}

.docs-table th {
  background: var(--docs-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--docs-text-body);
}

.docs-table td {
  font-size: 13px;
  color: var(--docs-text-body);
}

.docs-table tbody tr:nth-child(even) {
  background: var(--docs-soft-2);
}

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

.docs-table tbody .docs-table__name {
  width: 140px;
  color: var(--docs-name);
  font-family: var(--docs-mono);
  font-size: 13px;
  font-weight: 700;
}

.docs-table tbody .docs-table__type {
  width: 170px;
  color: var(--docs-inline-code);
  font-family: var(--docs-mono);
  font-size: 12px;
  font-weight: 400;
}

.docs-table .docs-table__req {
  width: 100px;
}

.docs-table tbody .docs-table__default {
  width: 90px;
  color: var(--docs-text-subtle);
  font-family: var(--docs-mono);
  font-size: 12px;
}

.docs-table td.docs-table__desc {
  font-size: 13px;
  font-weight: 400;
}

/* —— Block 9: interactive demo —— */
.docs-demo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 32px;
  padding: 16px;
  border-radius: var(--docs-radius);
  border: 1px solid var(--docs-border);
  background: var(--docs-surface);
}

.docs-demo__preview {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 8px;
}

.docs-demo__preview.docs-demo__preview--map {
  height: 520px;
  background: var(--docs-soft);
}

.docs-demo__preview > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.docs-demo__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.docs-demo__play img {
  position: static;
  width: 18px;
  height: 18px;
  display: block;
}

.docs-demo__play:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-demo__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-prose .docs-demo__label {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: var(--docs-text);
}

.docs-prose .docs-demo__title {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--docs-text-body);
}

.docs-demo--phone,
.docs-demo--kiosk,
.docs-demo--wide {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  align-items: center;
}

.docs-demo__device {
  --src-w: 390;
  --src-h: 844;
  --frame-w: 390px;
  --frame-h: 844px;
  --phone-scale: calc(240 / 390);
  position: relative;
  flex: 0 0 auto;
  width: 260px;
  max-width: 100%;
  padding: 10px 8px 12px;
  border-radius: 32px;
  background: #111318;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(13, 27, 42, 0.16);
}

.docs-demo__device::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 1;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: #2a2e3a;
  transform: translateX(-50%);
  pointer-events: none;
}

.docs-demo__screen {
  position: relative;
  width: 100%;
  aspect-ratio: var(--src-w) / var(--src-h);
  overflow: hidden;
  border-radius: 26px;
  background: var(--docs-soft);
}

.docs-demo__screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--frame-w);
  height: var(--frame-h);
  border: 0;
  background: var(--docs-soft);
  transform: scale(var(--phone-scale));
  transform-origin: top left;
}

.docs-demo__device--kiosk {
  --src-w: 1080;
  --src-h: 1920;
  --frame-w: 1080px;
  --frame-h: 1920px;
  --phone-scale: calc(220 / 1080);
  width: 240px;
  padding: 12px 10px;
  border-radius: 18px;
}

.docs-demo__device--kiosk::before,
.docs-demo__device--wide::before,
.docs-demo__device--laptop::before {
  display: none;
}

.docs-demo__device--kiosk .docs-demo__screen {
  border-radius: 8px;
}

.docs-demo__device--wide,
.docs-demo__device--laptop {
  --src-w: 1920;
  --src-h: 1080;
  --frame-w: 1920px;
  --frame-h: 1080px;
  --phone-scale: calc(640 / 1920);
  width: min(100%, 660px);
  padding: 10px;
  border-radius: 14px;
}

.docs-demo__device--wide .docs-demo__screen,
.docs-demo__device--laptop .docs-demo__screen {
  border-radius: 6px;
}

.docs-demo__device--laptop {
  --src-w: 1440;
  --src-h: 900;
  --frame-w: 1440px;
  --frame-h: 900px;
  --phone-scale: calc(640 / 1440);
  padding: 10px 10px 0;
  border-radius: 12px 12px 0 0;
}

.docs-demo__device--laptop .docs-demo__screen {
  border-radius: 6px 6px 0 0;
}

.docs-demo__device--laptop::after {
  content: "";
  display: block;
  height: 10px;
  margin: 0 -18px;
  border-radius: 0 0 10px 10px;
  background: #1c1f28;
}

.docs-demo__screen--image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border: 0;
  border-radius: inherit;
}

@media (max-width: 899px) {
  .docs-compare--device .docs-compare__col:last-child,
  .docs-compare--preview .docs-compare__col:last-child {
    align-items: stretch;
    width: 100%;
  }

  .docs-demo--phone,
  .docs-demo--kiosk,
  .docs-demo--wide {
    width: 100%;
    max-width: 100%;
    align-items: center;
  }

  .docs-demo__device {
    --phone-scale: calc(264 / 390);
    width: 280px;
    max-width: 100%;
  }

  .docs-demo__device--kiosk,
  .docs-compare--preview .docs-demo__device--kiosk {
    --phone-scale: calc(148 / 1080);
    width: 168px;
  }

  .docs-compare--preview .docs-demo__device--wide,
  .docs-compare--preview .docs-demo__device--laptop {
    width: 100%;
  }

  .docs-figure--crop {
    width: 100%;
    max-width: 100%;
  }

  .docs-callout__body > img {
    width: 100%;
    max-width: 100%;
  }
}

.docs-demo--phone .docs-demo__meta {
  text-align: center;
}

@media (min-width: 900px) {
  .docs-compare--preview .docs-demo__device--kiosk {
    --phone-scale: calc(280 / 1080);
    width: min(300px, 100%);
  }
}

.docs-compare--preview .docs-demo__device--wide,
.docs-compare--preview .docs-demo__device--laptop {
  container-type: inline-size;
  width: 100%;
}

.docs-compare--preview .docs-demo__device--wide iframe,
.docs-compare--preview .docs-demo__device--laptop iframe {
  transform: scale(calc(100cqi / var(--frame-w)));
}

.docs-tabs--bare {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 16px;
}

.docs-tabs--bare .docs-tabs__panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.docs-tabs--bare .docs-tabs__panel-bar {
  display: none;
}

.docs-tabs--bare .docs-tabs__panel-body {
  gap: 0;
}

/* —— Block 10: tabs —— */
.docs-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 32px;
  padding: 16px;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
}

.docs-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.docs-tabs__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid #e5e7eb;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #6b7b8d;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
}

.docs-tabs__tab:hover {
  background: #f9fafb;
}

.docs-tabs__tab:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-tabs__tab.is-active {
  background: #eef2ff;
  border-color: transparent;
  color: #3b5bdb;
  font-weight: 700;
}

.docs-tabs__tab.is-active:hover {
  background: #eef2ff;
}

.docs-tabs__panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.docs-tabs__panel.is-active {
  display: flex;
}

.docs-tabs__panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}

.docs-tabs__panel-title {
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.docs-tabs__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.docs-tabs__copy:hover {
  background: rgba(0, 0, 0, 0.04);
}

.docs-tabs__copy:focus-visible {
  outline: 2px solid var(--docs-focus-ring);
  outline-offset: 2px;
}

.docs-tabs__copy-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.docs-tabs__copy.is-copied {
  width: auto;
  gap: 6px;
  padding: 6px 8px;
  background: transparent;
}

html[data-theme="dark"] .docs-tabs__copy.is-copied .docs-copy-feedback {
  color: #4ade80;
}

.docs-tabs__copy.is-copied .docs-copy-feedback {
  color: #16a34a;
}

.docs-prose .docs-tabs__panel-body,
.docs-prose .docs-tabs__panel-body p {
  margin: 0;
  color: #374151;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

html[data-theme="dark"] .docs-tabs {
  background: var(--docs-surface);
  border-color: var(--docs-border);
}

html[data-theme="dark"] .docs-tabs__tab {
  border-color: var(--docs-border);
  color: var(--docs-text-muted);
}

html[data-theme="dark"] .docs-tabs__tab:hover {
  background: var(--docs-hover);
}

html[data-theme="dark"] .docs-tabs__tab.is-active,
html[data-theme="dark"] .docs-tabs__tab.is-active:hover {
  background: var(--docs-accent-soft);
  border-color: transparent;
  color: var(--docs-accent);
}

html[data-theme="dark"] .docs-tabs__panel {
  background: var(--docs-bg);
  border-color: var(--docs-border);
}

html[data-theme="dark"] .docs-tabs__panel-title,
html[data-theme="dark"] .docs-prose .docs-tabs__panel-body,
html[data-theme="dark"] .docs-prose .docs-tabs__panel-body p {
  color: var(--docs-text);
}

html[data-theme="dark"] .docs-tabs__copy:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .docs-shell {
    margin-left: 0;
    flex-direction: column;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    z-index: 130;
    align-self: auto;
    flex: none;
    width: var(--chrome-drawer-width, min(280px, 86vw));
    min-width: var(--chrome-drawer-width, min(280px, 86vw));
    max-width: var(--chrome-drawer-width, min(280px, 86vw));
    height: 100vh;
    height: 100dvh;
    max-height: none;
    min-height: 100dvh;
    padding-top: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    border-right: 1px solid var(--docs-border);
    box-shadow: none;
    background: var(--docs-sidebar-bg);
    display: flex;
    flex-direction: column;
  }

  body.is-docs-nav-open .docs-sidebar {
    transform: translateX(0);
  }

  .docs-sidebar--mobile {
    display: block;
  }

  .docs-sidebar__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
    min-height: var(--chrome-topbar-height, 56px);
    margin: 0 -12px 12px;
    padding: 0 4px 0 8px;
    border-bottom: 1px solid var(--docs-border);
    background: var(--docs-sidebar-bg);
  }

  .docs-sidebar > .docs-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .docs-sidebar__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--docs-text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .docs-sidebar__back:hover {
    background: var(--docs-hover);
  }

  .docs-sidebar__back-icon {
    width: 14px;
    height: 14px;
    display: block;
    transform: rotate(180deg);
  }

  html[data-theme="dark"] .docs-sidebar__back-icon {
    filter: invert(1);
  }

  .docs-main {
    padding: 24px 16px 48px;
  }

  .docs-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }

  .docs-table tbody .docs-table__name,
  .docs-table tbody .docs-table__type,
  .docs-table .docs-table__req,
  .docs-table tbody .docs-table__default {
    width: auto;
    white-space: nowrap;
  }

  .docs-table td.docs-table__desc {
    min-width: 200px;
    white-space: normal;
  }

  .docs-tabs__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
}
