/* Anymo documentation - Mintlify-style dark theme */

:root {
  --bg: #09090b;
  --bg-soft: #0e0f11;
  --bg-raised: #131417;
  --bg-inset: #0c0d0f;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ececee;
  --text-2: #a0a2a8;
  --text-3: #6e7177;
  --accent: #4da3ff;
  --accent-strong: #7cc0ff;
  --accent-dim: rgba(77, 163, 255, 0.12);
  --accent-border: rgba(77, 163, 255, 0.30);
  --warn: #e5b35a;
  --warn-dim: rgba(229, 179, 90, 0.1);
  --warn-border: rgba(229, 179, 90, 0.25);
  --info: #6cb1f0;
  --info-dim: rgba(108, 177, 240, 0.1);
  --info-border: rgba(108, 177, 240, 0.25);
  --code-bg: #0d0e10;
  --kbd-bg: #1a1b1f;
  --sans: "Geist", -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --topbar-h: 64px;
  --sidebar-w: 286px;
  --toc-w: 240px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-raised: #f4f4f5;
  --bg-inset: #f8f8f9;
  --border: rgba(9, 9, 11, 0.08);
  --border-strong: rgba(9, 9, 11, 0.16);
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #8b8b94;
  --accent: #1a6fe8;
  --accent-strong: #0f56c2;
  --accent-dim: rgba(26, 111, 232, 0.08);
  --accent-border: rgba(26, 111, 232, 0.3);
  --code-bg: #f7f7f8;
  --kbd-bg: #ececef;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar-h) + 24px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

::selection { background: rgba(77, 163, 255, 0.3); }

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.topbar-inner {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}
.brand-mark img { width: 30px; height: 30px; display: block; object-fit: contain; }

.brand-docs {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 1px 9px;
  margin-top: 2px;
}

.searchbar {
  flex: 1;
  max-width: 420px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-3);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.searchbar:hover { border-color: var(--border-strong); }
.searchbar span { flex: 1; text-align: left; }
.searchbar kbd {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
}

.topbar-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 8px;
}
.top-link:hover { color: var(--text); background: var(--bg-raised); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--bg-raised); }

/* ---------- Shell ---------- */

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: var(--topbar-h);
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 28px 16px 40px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-group { margin-bottom: 28px; }

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 10px;
  margin-bottom: 6px;
}
.nav-group-label svg { color: var(--text-2); }

.nav-items { display: flex; flex-direction: column; gap: 1px; }

.nav-item {
  display: block;
  font-size: 14px;
  color: var(--text-2);
  padding: 6px 10px 6px 31px;
  border-radius: 8px;
  line-height: 1.45;
}
.nav-item:hover { color: var(--text); background: var(--bg-raised); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 500;
}
.nav-item .ext {
  display: inline-block;
  margin-left: 6px;
  color: var(--text-3);
  font-size: 11px;
  vertical-align: 1px;
}

/* ---------- Main column ---------- */

.main {
  min-width: 0;
  padding: 44px 56px 80px;
  display: flex;
  flex-direction: column;
}

.article { max-width: 46rem; width: 100%; margin: 0 auto; }

.crumb {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 4px;
}

h1 {
  font-size: 38px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0;
}

.lead {
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 14px 0 0;
  text-wrap: pretty;
}

.article-head { margin-bottom: 40px; }

/* Copy page split button */

.copy-page { position: relative; display: flex; flex-shrink: 0; margin-top: 4px; }
.copy-page-main, .copy-page-caret {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 14px;
  white-space: nowrap;
}
.copy-page-main { border-radius: 10px 0 0 10px; border-right: none; }
.copy-page-caret { border-radius: 0 10px 10px 0; padding: 7px 10px; }
.copy-page-main:hover, .copy-page-caret:hover { background: var(--bg-raised); }

.copy-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 5px;
  z-index: 40;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.copy-menu button, .copy-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.copy-menu button:hover, .copy-menu a:hover { background: var(--bg-inset); color: var(--text); }
.copy-menu svg { color: var(--text-2); flex-shrink: 0; }
.copy-menu .menu-sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* ---------- Typography ---------- */

h2 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
  margin: 52px 0 14px;
  padding-top: 10px;
}

h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 36px 0 10px;
}

h4 { font-size: 16px; font-weight: 600; margin: 28px 0 8px; }

.article p { margin: 0 0 16px; color: var(--text); text-wrap: pretty; }
.article p + p { margin-top: -2px; }

.article ul, .article ol { margin: 0 0 18px; padding-left: 26px; }
.article li { margin-bottom: 7px; }
.article li::marker { color: var(--text-3); }

strong { font-weight: 600; }

.anchor { color: inherit; }
.anchor:hover { color: inherit; }
.anchor:hover::after {
  content: "#";
  color: var(--accent);
  margin-left: 9px;
  font-weight: 400;
}

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

/* Inline code */

code {
  font-family: var(--mono);
  font-size: 0.855em;
}
:not(pre) > code {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.13em 0.38em;
  white-space: nowrap;
}
.article a :not(pre) > code, .article a > code { color: var(--accent); }

/* ---------- Code blocks ---------- */

.code {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--code-bg);
  overflow: hidden;
}

.code figcaption {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.code .code-lang {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}

.code .code-title {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
}

.code .code-copy {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-3);
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.code .code-copy:hover { color: var(--text); background: var(--bg-raised); }
.code .code-copy.copied { color: var(--accent); }

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  scrollbar-width: thin;
}
.code pre code { background: none; border: none; padding: 0; font-size: inherit; white-space: pre; }

/* Syntax highlighting (highlight.js classes) */
.hljs { color: #d8dade; background: transparent; }
.hljs-comment, .hljs-quote { color: #6e7480; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-meta .hljs-keyword { color: #c792ea; }
.hljs-string, .hljs-attr { color: #8ee8c0; }
.hljs-number, .hljs-literal { color: #f2b66d; }
.hljs-title, .hljs-title.function_, .hljs-name { color: #82b4f5; }
.hljs-type, .hljs-class .hljs-title, .hljs-title.class_ { color: #f0c674; }
.hljs-variable, .hljs-template-variable { color: #e8a2a2; }
.hljs-built_in, .hljs-symbol { color: #66c7e8; }
.hljs-section, .hljs-meta { color: #9aa7e8; }
.hljs-deletion { color: #e8a2a2; }
.hljs-addition { color: #8ee8c0; }

html[data-theme="light"] .hljs { color: #27272d; }
html[data-theme="light"] .hljs-comment, html[data-theme="light"] .hljs-quote { color: #8d93a0; }
html[data-theme="light"] .hljs-keyword { color: #9333ea; }
html[data-theme="light"] .hljs-string, html[data-theme="light"] .hljs-attr { color: #0e9f6e; }
html[data-theme="light"] .hljs-number, html[data-theme="light"] .hljs-literal { color: #c2700d; }
html[data-theme="light"] .hljs-title, html[data-theme="light"] .hljs-name { color: #1d63d8; }
html[data-theme="light"] .hljs-built_in { color: #0d7fa3; }

/* ---------- Callouts ---------- */

.callout {
  display: flex;
  gap: 12px;
  padding: 15px 17px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  margin: 0 0 22px;
  font-size: 15px;
}
.callout > svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }
.callout-body { min-width: 0; }
.callout-body p { margin: 0 0 8px; }
.callout-body p:last-child { margin-bottom: 0; }
.callout .callout-title { font-weight: 600; color: var(--accent); display: block; margin-bottom: 3px; }

.callout.info { border-color: var(--info-border); background: var(--info-dim); }
.callout.info > svg, .callout.info .callout-title { color: var(--info); }

.callout.warn { border-color: var(--warn-border); background: var(--warn-dim); }
.callout.warn > svg, .callout.warn .callout-title { color: var(--warn); }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 22px;
}

.card {
  display: block;
  padding: 19px 19px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.card:hover { border-color: var(--accent-border); color: var(--text); background: var(--bg-raised); }
.card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  margin-bottom: 13px;
}
.card h3 { margin: 0 0 5px; font-size: 15.5px; }
.card p { margin: 0; font-size: 13.8px; color: var(--text-2); line-height: 1.55; }

/* ---------- Steps ---------- */

.steps { list-style: none; counter-reset: step; margin: 0 0 22px; padding: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 30px 46px;
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 34px;
  bottom: 4px;
  width: 1px;
  background: var(--border);
}
.steps > li:last-child { padding-bottom: 4px; }
.steps > li:last-child::after { display: none; }
.steps .step-title { font-weight: 600; font-size: 16px; display: block; margin: 3px 0 8px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 0 22px; }
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}
.article th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.article td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.article td:first-child, .article th:first-child { padding-left: 2px; }
.article td code { white-space: nowrap; }
.routing-note {
  margin-top: -8px;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- Pager + footer ---------- */

.pager {
  max-width: 46rem;
  width: 100%;
  margin: 56px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pager a {
  display: block;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}
.pager a:hover { border-color: var(--accent-border); }
.pager a.next { text-align: right; grid-column: 2; }
.pager .pager-dir { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 3px; }
.pager .pager-title { font-size: 14.5px; font-weight: 600; }
.pager a:hover .pager-title { color: var(--accent); }

.foot {
  max-width: 46rem;
  width: 100%;
  margin: 44px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--text-3);
}
.foot a { color: var(--text-3); }
.foot a:hover { color: var(--text-2); }
.foot .spacer { flex: 1; }

/* ---------- TOC ---------- */

.toc {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 44px 28px 40px 8px;
  font-size: 13.5px;
  scrollbar-width: thin;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 12px;
}
.toc-title svg { color: var(--text-2); }

.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; }
.toc-list a {
  display: block;
  color: var(--text-2);
  padding: 4.5px 0 4.5px 14px;
  border-left: 1px solid transparent;
  line-height: 1.45;
}
.toc-list a:hover { color: var(--text); }
.toc-list a.active { color: var(--accent); }
.toc-list a.depth-3 { padding-left: 28px; font-size: 13px; }
.toc-list a.active::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--accent);
  margin: 0 8px 1.5px -13px;
}

/* ---------- Search dialog + markdown overlay ---------- */

.overlay-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 40px;
}

.search-panel {
  width: 100%;
  max-width: 560px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
}
.search-input-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
}
.search-results { max-height: 46vh; overflow-y: auto; padding: 7px; }
.search-result {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}
.search-result .sr-group { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.search-result .sr-title { font-size: 14.5px; font-weight: 500; }
.search-result .sr-desc { font-size: 13px; color: var(--text-2); }
.search-result:hover, .search-result.selected { background: var(--accent-dim); }
.search-result:hover .sr-title, .search-result.selected .sr-title { color: var(--accent); }
.search-empty { padding: 26px; text-align: center; color: var(--text-3); font-size: 14px; }

.md-panel {
  width: 100%;
  max-width: 820px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.md-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.md-panel-head .md-title { font-weight: 600; font-size: 14.5px; flex: 1; }
.md-panel-head button {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 11px;
  cursor: pointer;
}
.md-panel-head button:hover { background: var(--bg-inset); }
.md-panel pre {
  margin: 0;
  padding: 20px 24px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* ---------- Responsive ---------- */

.menu-btn { display: none; }

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

@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-docs { display: none; }
  .top-link span { display: none; }
  .top-link { padding: 7px 9px; }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    width: min(320px, 84vw);
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
    background: var(--bg);
    border-right: 1px solid var(--border);
    transform: translateX(-103%);
    transition: transform 0.22s ease;
    z-index: 60;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }
  .nav-item { padding-top: 9px; padding-bottom: 9px; }
  .menu-btn { display: grid; }
  .main { padding: 32px 22px 64px; }
  .searchbar span { display: none; }
  .searchbar { flex: 0 0 auto; width: 42px; justify-content: center; padding: 0; margin-left: auto; }
  .searchbar kbd { display: none; }
  .topbar-links { margin-left: 0; }
  .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: 31px; }
  .lead { font-size: 17px; }
  .title-row { flex-direction: column; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: 1; }
  .overlay-back { padding: 8vh 12px 24px; }
  .md-panel { max-height: 84vh; max-height: 84dvh; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
