/* BetterTickets API docs */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-sunk: #f1f3f6;
  --panel: #ffffff;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-text: #4338ca;
  --code-bg: #f6f8fa;
  --code-border: #e4e7ec;
  --code-text: #1f2937;
  --inline-code-bg: #f2f4f7;
  --callout-bg: #f5f7ff;
  --callout-border: #c7d2fe;
  --get: #067647; --get-bg: #dcfae6;
  --post: #175cd3; --post-bg: #d1e9ff;
  --put: #b54708; --put-bg: #fef0c7;
  --delete: #b42318; --delete-bg: #fee4e2;
  --s2: #067647; --s4: #b54708; --s5: #b42318;
  --t-k: #7a2e9e; --t-s: #0a7a3f; --t-n: #b54708; --t-b: #175cd3; --t-c: #8a94a6; --t-kw: #c11574; --t-v: #175cd3;
  --mark: #fff3a3;
  --shadow: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --topbar-h: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --bg-soft: #11161d; --bg-sunk: #161b22; --panel: #11161d;
    --border: #232a33; --border-strong: #303844;
    --text: #e6edf3; --text-2: #c9d1d9; --muted: #8b949e;
    --accent: #8b8cf8; --accent-soft: #1e1f3d; --accent-text: #a5a6ff;
    --code-bg: #0b0f14; --code-border: #232a33; --code-text: #e6edf3; --inline-code-bg: #1c222b;
    --callout-bg: #15172b; --callout-border: #34368a;
    --get: #47cd89; --get-bg: #0c2c1d; --post: #6aaefc; --post-bg: #0d2440;
    --put: #fdb022; --put-bg: #33230a; --delete: #f97066; --delete-bg: #3a1513;
    --s2: #47cd89; --s4: #fdb022; --s5: #f97066;
    --t-k: #d2a8ff; --t-s: #7ee2a8; --t-n: #ffa657; --t-b: #79c0ff; --t-c: #6e7681; --t-kw: #ff7bb0; --t-v: #79c0ff;
    --mark: #5c4a00;
    --shadow: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --bg-soft: #11161d; --bg-sunk: #161b22; --panel: #11161d;
  --border: #232a33; --border-strong: #303844;
  --text: #e6edf3; --text-2: #c9d1d9; --muted: #8b949e;
  --accent: #8b8cf8; --accent-soft: #1e1f3d; --accent-text: #a5a6ff;
  --code-bg: #0b0f14; --code-border: #232a33; --code-text: #e6edf3; --inline-code-bg: #1c222b;
  --callout-bg: #15172b; --callout-border: #34368a;
  --get: #47cd89; --get-bg: #0c2c1d; --post: #6aaefc; --post-bg: #0d2440;
  --put: #fdb022; --put-bg: #33230a; --delete: #f97066; --delete-bg: #3a1513;
  --s2: #47cd89; --s4: #fdb022; --s5: #f97066;
  --t-k: #d2a8ff; --t-s: #7ee2a8; --t-n: #ffa657; --t-b: #79c0ff; --t-c: #6e7681; --t-kw: #ff7bb0; --t-v: #79c0ff;
  --mark: #5c4a00;
  --shadow: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.brand-name { letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--border); }
.search { position: relative; flex: 1; max-width: 460px; margin-left: 24px; }
.search input {
  width: 100%; height: 38px; padding: 0 36px 0 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: 14px; -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:focus { outline: none; border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-icon { position: absolute; left: 11px; top: 11px; color: var(--muted); pointer-events: none; }
.search-kbd {
  position: absolute; right: 9px; top: 9px; font-size: 11px; line-height: 18px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--bg);
}
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; max-height: min(70vh, 520px); overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.sr-item { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.sr-item:hover, .sr-item.sel { background: var(--accent-soft); text-decoration: none; }
.sr-sec { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sr-title { display: block; font-weight: 600; font-size: 14px; }
.sr-title code { font-size: 12px; color: var(--accent-text); }
.sr-text { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.sr-empty { margin: 0; padding: 12px; color: var(--muted); font-size: 14px; }
mark { background: var(--mark); color: inherit; border-radius: 2px; }
.top-links { display: flex; gap: 18px; margin-left: auto; font-size: 14px; font-weight: 500; white-space: nowrap; }
.top-links a { color: var(--text-2); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); }
.menu-btn { display: none; }
.theme-btn svg { display: none; }
.theme-btn[data-mode="light"] .i-sun, .theme-btn[data-mode="dark"] .i-moon, .theme-btn[data-mode="system"] .i-auto, .theme-btn:not([data-mode]) .i-auto { display: block; }

/* Layout */
.layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 232px;
  max-width: 1480px; margin: 0 auto;
}
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  border-right: 1px solid var(--border); padding: 20px 14px 40px;
}
.nav-group { margin-bottom: 18px; }
.nav-title { margin: 0 0 6px; padding: 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 7px;
  color: var(--text-2); font-size: 14px; line-height: 1.4;
}
.sidebar li a:hover { background: var(--bg-soft); text-decoration: none; color: var(--text); }
.sidebar li a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sidebar li a span { min-width: 0; }

.content { min-width: 0; padding: 36px 56px 40px; }
.prose { max-width: 820px; }
.toc {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 36px 20px 40px 8px; font-size: 13px;
}
.toc-title { margin: 0 0 10px; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; color: var(--muted); border-left: 2px solid transparent; line-height: 1.4; }
.toc li.toc-l3 a { padding-left: 24px; }
.toc li a:hover { color: var(--text); text-decoration: none; }
.toc li a.active { color: var(--accent-text); border-left-color: var(--accent); }

/* Prose */
.prose h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 700; }
.prose h2 { font-size: 23px; letter-spacing: -.01em; margin: 44px 0 12px; padding-top: 4px; font-weight: 650; }
.prose h3 { font-size: 17px; margin: 28px 0 8px; font-weight: 600; }
.prose h4 { font-size: 15px; margin: 22px 0 6px; }
.prose h1, .prose h2, .prose h3 { position: relative; }
.anchor { position: absolute; left: -1em; width: 1em; opacity: 0; color: var(--muted); font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; text-decoration: none; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; color: var(--text-2); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.prose :not(pre) > code {
  font-size: .86em; padding: .12em .38em; border-radius: 5px;
  background: var(--inline-code-bg); color: var(--text); border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.eyebrow { margin: 0 0 6px !important; font-size: 13px; font-weight: 600; color: var(--accent-text) !important; text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted) !important; }
.callout {
  border: 1px solid var(--callout-border); background: var(--callout-bg);
  border-radius: 10px; padding: 12px 16px; margin: 0 0 18px;
}
.callout p:last-child { margin-bottom: 0; }

/* Page actions */
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.btn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; color: var(--text); }
.btn.done { color: var(--get); border-color: var(--get); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; font-size: 13px; color: var(--text-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); }
td:first-child code { white-space: nowrap; }

/* Small screens: one card per parameter row (name, type, required on one line, description below). */
@media (max-width: 600px) {
  table.params thead { display: none; }
  table.params, table.params tbody, table.params tr { display: block; width: 100%; }
  table.params tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  table.params tr:last-child { border-bottom: 0; }
  table.params td { display: inline; padding: 0; border: 0; margin-right: 8px; }
  table.params td:last-child { display: block; margin: 6px 0 0; }
  table.params td code { white-space: nowrap; }
}

/* Code blocks */
.codeblock { margin: 0 0 18px; border: 1px solid var(--code-border); border-radius: 10px; background: var(--code-bg); overflow: hidden; }
.codebar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--code-border); }
.codelang { font-size: 12px; font-weight: 600; color: var(--muted); }
.copy {
  font: inherit; font-size: 12px; font-weight: 500; height: 26px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-2); cursor: pointer;
}
.copy:hover { color: var(--text); background: var(--bg-soft); }
.copy.done { color: var(--get); border-color: var(--get); }
pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; color: var(--code-text); tab-size: 2; }
pre code { font-size: inherit; }
.t-k { color: var(--t-k); } .t-s { color: var(--t-s); } .t-n { color: var(--t-n); } .t-b { color: var(--t-b); }
.t-c { color: var(--t-c); font-style: italic; } .t-kw { color: var(--t-kw); } .t-v { color: var(--t-v); }

/* Tabs */
.tabs { margin: 0 0 18px; }
.tablist { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; overflow-x: auto; }
.tab {
  font: inherit; font-size: 14px; font-weight: 500; padding: 8px 12px; background: none; border: 0;
  border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; margin-bottom: -1px; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* Method pills + endpoint */
.method {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 6px; line-height: 1.5; min-width: 52px;
}
.method.small { font-size: 10px; padding: 0 5px; min-width: 40px; border-radius: 4px; }
.method-get { color: var(--get); background: var(--get-bg); }
.method-post { color: var(--post); background: var(--post-bg); }
.method-put, .method-patch { color: var(--put); background: var(--put-bg); }
.method-delete { color: var(--delete); background: var(--delete-bg); }
.endpoint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 4px 0 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft);
}
.endpoint-path { font-size: 15px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; flex: 1; min-width: 0; }
.prose .endpoint .endpoint-path { background: none; border: 0; padding: 0; font-size: 15px; }
.op-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 22px; font-size: 14px; }
.op-meta div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.op-meta dt { color: var(--muted); font-weight: 500; white-space: nowrap; }
.op-meta dd { margin: 0; min-width: 0; }
.scope { color: var(--accent-text) !important; background: var(--accent-soft) !important; border-color: transparent !important; }

/* Schema tree */
.schema { list-style: none; padding: 0 !important; margin: 0 0 18px !important; border: 1px solid var(--border); border-radius: 10px; }
.schema.nested { margin: 8px 0 0 !important; border-radius: 8px; background: var(--bg-soft); }
.prop { padding: 10px 14px; border-bottom: 1px solid var(--border); margin: 0 !important; }
.prop:last-child { border-bottom: 0; }
.prop-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.prose .prop-name { font-weight: 600; font-size: 13.5px; background: none; border: 0; padding: 0; color: var(--text); }
.prop-type { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.badge {
  display: inline-block; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--bg-sunk); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.badge-req { color: var(--s4); background: var(--put-bg); border-color: transparent; font-weight: 600; }
.prop-desc { font-size: 14px; margin-top: 4px; }
.prop-desc p { margin: 0 0 6px; }
.prop-desc p:last-child, .prop-desc ul:last-child { margin-bottom: 0; }
.prop-desc .table-wrap { margin: 6px 0; }
.prop-children { margin-top: 6px; }
.prop-children > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); font-weight: 500; width: max-content; }
.label { margin: 14px 0 6px !important; font-size: 13px; font-weight: 600; color: var(--text) !important; }
.schema-desc p { font-size: 14px; }

/* Responses */
.status { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.status-2xx { color: var(--s2); } .status-4xx { color: var(--s4); } .status-5xx { color: var(--s5); }
.response { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 18px; }
.response h3 { font-size: 15px; }
.response .status { margin-right: 6px; }
.response-err { border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; margin-top: 10px; }
.response-err > summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: 14px; color: var(--text); }
.response-err[open] { padding-bottom: 6px; }
.response-err[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.prose h3.sub { margin-top: 22px; }
.responses td:first-child { white-space: nowrap; }

/* Tag page cards */
.op-cards { display: grid; gap: 12px; }
.op-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; color: var(--text); }
.op-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.op-card-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.op-card-top code { font-size: 14px; background: none !important; border: 0 !important; padding: 0 !important; overflow-wrap: anywhere; }
.op-card-title { font-weight: 600; margin-top: 6px; }
.op-card-desc { color: var(--muted); font-size: 14px; }
.op-card-scope { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Pager + footer */
.pager { max-width: 820px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.pager a { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-weight: 600; color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.pager-next { text-align: right; grid-column: 2; }
.site-footer { max-width: 820px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--muted); }

.scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0, 0, 0, .35); z-index: 30; }

@media (max-width: 1240px) {
  .layout { grid-template-columns: 264px minmax(0, 1fr); }
  .toc { display: none; }
  .content { padding: 32px 40px 40px; }
}
@media (max-width: 900px) {
  :root { --topbar-h: 56px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .menu-btn { display: inline-flex; }
  .brand-sub, .top-links, .search-kbd { display: none; }
  .search { margin-left: 4px; max-width: none; }
  .layout { display: block; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 35;
    background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; border-right: 1px solid var(--border);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  body.nav-open { overflow: hidden; }
  .content { padding: 24px 16px 32px; }
  .prose h1 { font-size: 27px; }
  .prose h2 { font-size: 21px; margin-top: 36px; }
  .anchor { display: none; }
  .op-meta { flex-direction: column; gap: 6px; }
  .page-actions .btn { height: 28px; padding: 0 9px; font-size: 12.5px; }
  pre { font-size: 12.5px; }
  th, td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .search-results { position: fixed; top: calc(var(--topbar-h) - 4px); left: 8px; right: 8px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.responses td:last-child code { display: inline-block; white-space: nowrap; margin: 1px 0; }
