/* Tabscanner API docs. Plain CSS, no build step. */

:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #eef1f5;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d0d7de;
  --accent: #1d5fd6;
  --accent-soft: #e8f0fe;
  --success: #1a7f37;
  --warning: #b35c00;
  --danger: #cf222e;
  --pending: #7a5af5;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --code-border: #1e293b;
  --code-bar: #1e293b;
  --nav-w: 260px;
  --content-max: 1480px;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #111827;
  --surface-2: #1a2234;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --border: #27324a;
  --accent: #7aa7ff;
  --accent-soft: #16244a;
  --success: #3fb950;
  --warning: #e3a12f;
  --danger: #f47067;
  --pending: #a98cff;
  --code-bg: #05080f;
  --code-text: #e2e8f0;
  --code-border: #1e293b;
  --code-bar: #101827;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --surface: #111827;
    --surface-2: #1a2234;
    --text: #e5e7eb;
    --muted: #9aa4b2;
    --border: #27324a;
    --accent: #7aa7ff;
    --accent-soft: #16244a;
    --success: #3fb950;
    --warning: #e3a12f;
    --danger: #f47067;
    --pending: #a98cff;
    --code-bg: #05080f;
    --code-text: #e2e8f0;
    --code-border: #1e293b;
    --code-bar: #101827;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  font-size: 0.86em;
  white-space: nowrap;
}
td :not(pre) > code, li :not(pre) > code { white-space: normal; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 0; }
h3 { font-size: 1.15rem; margin-top: 2rem; }
h4 { font-size: 1rem; margin-top: 1.5rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.3em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header__brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; }
.header__brand img { height: 26px; width: auto; }
.header__brand:hover { text-decoration: none; }
.header__sep { color: var(--muted); }
.header__links { display: flex; gap: 18px; margin-left: 8px; }
.header__links a { color: var(--muted); font-size: 0.95rem; }
.header__links a[aria-current="page"], .header__links a:hover { color: var(--text); text-decoration: none; }
.header__spacer { flex: 1; }
.header__search { position: relative; }
.header__search input {
  width: 240px; height: 34px; padding: 0 34px 0 12px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.9rem;
}
.header__search kbd {
  position: absolute; right: 8px; top: 8px; font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--bg);
}
.search-results {
  position: absolute; right: 0; top: 40px; width: 360px; max-height: 60vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18); padding: 6px; z-index: 50;
}
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 0.92rem; }
.search-results a small { display: block; color: var(--muted); font-size: 0.8rem; }
.search-results a:hover, .search-results a.is-active { background: var(--accent-soft); text-decoration: none; }
.search-results .search-results__empty { padding: 10px; color: var(--muted); font-size: 0.9rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon, :root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}
.nav-toggle { display: none; }

/* Layout */
.layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); max-width: var(--content-max); margin: 0 auto; }

.sidebar {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  padding: 20px 12px 40px 20px; border-right: 1px solid var(--border);
  font-size: 0.92rem;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar > ul > li { margin-bottom: 4px; }
.sidebar li { margin: 0; }
.sidebar a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); }
.sidebar a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.sidebar a.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.sidebar ul ul { margin: 2px 0 6px 12px; border-left: 1px solid var(--border); padding-left: 4px; }
.sidebar ul ul a { padding: 3px 10px; font-size: 0.88rem; }
.sidebar .sidebar__group { margin: 18px 10px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sidebar .method { font-family: var(--mono); font-size: 0.68rem; font-weight: 700; margin-right: 6px; }
.method--get { color: var(--success); }
.method--post { color: var(--accent); }

main { min-width: 0; }

.section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 48px 40px; border-bottom: 1px solid var(--border); }
.section--full { grid-template-columns: 1fr; }
.section > .prose { min-width: 0; }
.section > .aside { min-width: 0; position: relative; }
.aside .sticky { position: sticky; top: 76px; }
.prose > :last-child { margin-bottom: 0; }
.section h2 { scroll-margin-top: 72px; }
.section h3 { scroll-margin-top: 72px; }
h2 a.anchor, h3 a.anchor, h4 a.anchor { color: var(--muted); opacity: 0; margin-left: 6px; font-weight: 400; }
h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor { opacity: 1; }

.lead { font-size: 1.1rem; color: var(--muted); }
.hero { padding: 56px 40px 40px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.hero h1 { font-size: 2.4rem; margin-bottom: 0.4em; }
.hero .lead { max-width: 60ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-weight: 600; font-size: 0.95rem; }
.btn:hover { background: var(--surface); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent); filter: brightness(1.08); }

/* Endpoint badge */
.endpoint { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-family: var(--mono); font-size: 0.9rem; margin: 0 0 1.2em; max-width: 100%; overflow-x: auto; }
.endpoint .method { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; }
.endpoint .path { white-space: nowrap; }
.endpoint .path em { font-style: normal; color: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--border); }
.table thead th { border-top: 0; border-bottom: 2px solid var(--border); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table tr:first-child td { border-top: 0; }
.table td p { margin: 0 0 0.5em; }
.table td p:last-child { margin-bottom: 0; }
.table td .meta { color: var(--muted); font-size: 0.86rem; }
.table--params td.param { width: 38%; }
.table--params td.param code { font-weight: 600; white-space: nowrap; }
.table--params .type { display: block; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; margin-top: 4px; }
.pill { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; margin: 6px 4px 0 0; }
.pill--req { color: var(--danger); border-color: currentColor; }
.table--codes td:first-child { white-space: nowrap; }
.table--codes td code { font-weight: 700; }
.code-success { color: var(--success) !important; border-color: var(--success) !important; }
.code-warning, .code-pending { color: var(--warning) !important; border-color: var(--warning) !important; }
.code-pending { color: var(--pending) !important; border-color: var(--pending) !important; }
.code-client_error { color: var(--danger) !important; border-color: var(--danger) !important; }
.code-server_error { color: var(--muted) !important; }
.enum-list code { margin: 0 4px 6px 0; display: inline-block; }

/* Callouts */
.callout { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; margin: 0 0 1.5em; font-size: 0.95rem; }
.callout > :last-child { margin-bottom: 0; }
.callout--warning { border-left-color: var(--warning); }
.callout--danger { border-left-color: var(--danger); }
.callout--confirm { border-left-color: var(--pending); border-style: dashed; }
.callout strong:first-child { display: block; margin-bottom: 4px; }

/* Code blocks and tabs */
.code-block { margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--code-border); background: var(--code-bg); color: var(--code-text); }
.code-block:last-child { margin-bottom: 0; }
.code__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; background: var(--code-bar); font-size: 0.78rem; color: #94a3b8; font-family: var(--mono); }
.code__copy { font: inherit; font-family: var(--font); font-size: 0.78rem; color: #cbd5e1; background: transparent; border: 1px solid #334155; border-radius: 5px; padding: 3px 9px; cursor: pointer; }
.code__copy:hover { background: #1e293b; }
.code__copy.is-done { color: #86efac; border-color: #14532d; }
pre.code { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 0.82rem; line-height: 1.55; tab-size: 4; }
pre.code code { font-size: inherit; background: none; border: 0; padding: 0; white-space: pre; }

.code-tabs { margin: 0 0 16px; }
.code-tabs__bar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.code-tabs__bar [role="tab"] { font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px; margin-bottom: -1px; cursor: pointer; }
.code-tabs__bar [role="tab"]:hover { color: var(--text); }
.code-tabs__bar [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.code-tabs .code-block { margin-bottom: 0; }

/* Prism theme overrides (dark panel in both site themes) */
pre.code .token.comment, pre.code .token.prolog, pre.code .token.doctype, pre.code .token.cdata { color: #7c8ba1; font-style: italic; }
pre.code .token.punctuation { color: #94a3b8; }
pre.code .token.property, pre.code .token.tag, pre.code .token.boolean, pre.code .token.number, pre.code .token.constant, pre.code .token.symbol { color: #fca5a5; }
pre.code .token.selector, pre.code .token.attr-name, pre.code .token.string, pre.code .token.char, pre.code .token.builtin { color: #a5d6a7; }
pre.code .token.operator, pre.code .token.entity, pre.code .token.url, pre.code .token.variable { color: #e2e8f0; }
pre.code .token.atrule, pre.code .token.attr-value, pre.code .token.keyword { color: #93c5fd; }
pre.code .token.function, pre.code .token.class-name { color: #fde68a; }
pre.code .token.regex, pre.code .token.important { color: #f9a8d4; }
pre.code .token.namespace { opacity: 0.8; }

/* Misc */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 1.5em; font-size: 0.93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.figure { margin: 0 0 1.5em; }
.figure img { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.figure figcaption { color: var(--muted); font-size: 0.86rem; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0 0 1.5em; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.card h3, .card h4 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 12px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.footer { padding: 32px 40px; color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.changelog h3 { margin-top: 2rem; }
.changelog time { color: var(--muted); font-weight: 400; font-size: 0.9rem; margin-left: 8px; }

/* Responsive */
@media (max-width: 1180px) {
  .section { grid-template-columns: 1fr; gap: 24px; padding: 40px 32px; }
  .aside .sticky { position: static; }
}
@media (max-width: 860px) {
  :root { --nav-w: 0px; }
  .layout { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .header { padding: 0 12px; gap: 10px; }
  .header__links { display: none; }
  .header__search input { width: 150px; }
  .search-results { width: min(360px, calc(100vw - 24px)); }
  .sidebar { position: fixed; top: 56px; left: 0; width: 280px; max-width: 85vw; background: var(--bg); transform: translateX(-100%); transition: transform 0.2s; z-index: 30; box-shadow: 0 0 0 100vw rgba(0,0,0,0); }
  .sidebar.is-open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,0.35); }
  .section, .hero, .footer { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 1.8rem; }
  .table--params td.param { width: auto; }
}
