:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --bg-soft: #101318;
  --surface: #11151b;
  --surface-raised: #161b22;
  --surface-hover: #1a2029;
  --line: #242a33;
  --line-strong: #303844;
  --text: #e6e6e6;
  --text-soft: #c8cdd6;
  --muted: #8b919a;
  --muted-2: #626a75;
  --link: #8ab4f8;
  --green: #7dd88f;
  --green-bg: #14251a;
  --blue: #8ab4f8;
  --blue-bg: #17243a;
  --orange: #d8b47d;
  --red: #f08a8a;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --header-height: 57px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
}

.site-header {
  box-sizing: border-box;
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 18, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 30;
  font: 14px/1.55 var(--font-sans);
}
.site-header *,
.site-header *::before,
.site-header *::after { box-sizing: border-box; }

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.site-brand img { width: 24px; height: 24px; border-radius: 6px; }
.site-spacer { flex: 1; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a,
.site-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font: 500 12px/1 var(--font-sans);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav button:hover,
.site-nav a[aria-current="page"],
.site-nav .nav-dropdown:has(.nav-dropdown-panel:popover-open) > .nav-dropdown-trigger,
.site-nav .nav-dropdown.is-current > .nav-dropdown-trigger {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--line);
}
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { cursor: pointer; }
.nav-dropdown-trigger::after {
  width: 5px;
  height: 5px;
  margin: -3px 0 0 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 120ms ease, margin 120ms ease;
}
.nav-dropdown:has(.nav-dropdown-panel:popover-open) > .nav-dropdown-trigger::after { margin-top: 3px; transform: rotate(225deg); }
.nav-dropdown-panel {
  position: fixed;
  inset: auto;
  min-width: 178px;
  margin: 0;
  padding: 6px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
}
.site-nav .nav-dropdown-panel a {
  display: flex;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
}
.site-nav .nav-primary {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
  font-weight: 650;
}
.site-nav .nav-primary:hover { background: #fff; color: #080a0d; border-color: #fff; }

.account-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font-sans);
}
.account-main { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.auth-page .account-main { max-width: 540px; }
.account-heading { margin-bottom: 24px; }
.account-eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.account-heading h1 { margin: 5px 0 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
.account-main a { color: var(--link); }
.account-page .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 0 0 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset;
}
.account-page .card h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.account-page .card p:first-of-type { margin-top: 8px; }
.account-page .card p:last-child { margin-bottom: 0; }
.account-page label { color: var(--text-soft); font-size: 13px; font-weight: 550; }
.account-page input,
.account-page select,
.account-page textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
}
.account-page input:focus,
.account-page select:focus,
.account-page textarea:focus { outline: none; border-color: #596577; box-shadow: 0 0 0 3px rgba(138,180,248,.08); }
.account-page textarea { min-height: 180px; font: 12px/1.55 var(--font-mono); }
.account-page button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--bg);
  background: var(--text);
  font: 650 13px var(--font-sans);
  cursor: pointer;
}
.account-page button:hover { background: #fff; }
.account-page button.ghost { color: var(--text-soft); background: transparent; border: 1px solid var(--line-strong); }
.account-page button.ghost:hover { color: var(--text); background: var(--surface-hover); }
.account-page .muted { color: var(--muted); }
.account-page .ok { color: var(--green); }
.account-page .warn { color: var(--orange); }
.account-page .err { color: var(--red); }
.account-page code,
.account-page .key { font-family: var(--font-mono); }
.account-page code { padding: 2px 5px; background: var(--surface-hover); border: 1px solid var(--line); border-radius: 5px; font-size: .9em; }
.account-page .key { font-size: 12px; }
.account-page .row { display: flex; gap: 10px; flex-wrap: wrap; }
.account-page ul, .account-page ol { color: var(--text-soft); padding-left: 22px; }
.account-page li { margin: 6px 0; }
.account-page form { margin: 0; }

.provider-usage { margin-bottom: 30px; }
.provider-usage-card { padding: 22px !important; }
.provider-usage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.provider-usage-heading h2 { margin-top: 4px !important; font-size: 23px !important; }
.provider-plan-badge { padding: 5px 9px; color: var(--green); background: var(--green-bg); border: 1px solid #2c4434; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.provider-limit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.provider-limit { padding: 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.provider-limit.reached { border-color: rgba(255, 126, 126, .45); }
.provider-limit-top, .provider-limit-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.provider-limit-top strong { color: var(--text); font-size: 15px; white-space: nowrap; }
.provider-window-label { display: block; color: var(--text); font-size: 14px; font-weight: 700; }
.provider-limit-name { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.provider-progress { height: 7px; margin: 13px 0 10px; overflow: hidden; background: #252a31; border-radius: 999px; }
.provider-progress span { display: block; height: 100%; background: linear-gradient(90deg, #5da96b, var(--green)); border-radius: inherit; transition: width .25s ease; }
.provider-limit.reached .provider-progress span { background: var(--red); }
.provider-limit-meta { color: var(--muted); font-size: 11px; }
.provider-limit-meta time { color: var(--text-soft); }
.provider-usage-note { margin: 14px 0 0; background: transparent; }
.usage-section-heading { margin: 0 0 12px; }
.usage-section-heading span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.usage-section-heading h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.015em; }

.usage-callout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  padding: 22px;
  background: var(--green-bg);
  border: 1px solid #2c4434;
  border-radius: var(--radius-lg);
}
.usage-callout strong { display: block; color: var(--green); font-size: 32px; letter-spacing: -.04em; }
.usage-callout p { margin: 0; color: var(--text-soft); }
.usage-kicker { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.usage-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.usage-stat { padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.usage-stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.usage-stat strong { display: block; margin-top: 5px; font-size: 21px; letter-spacing: -.02em; }
.usage-stat.accent strong { color: var(--green); }
.usage-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.usage-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.usage-table th, .usage-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.usage-table th { color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.usage-table tbody tr:last-child td { border-bottom: 0; }
.usage-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.usage-table .usage-cost { color: var(--green); font-weight: 650; }
.usage-equivalent-model { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.usage-note, .usage-footnote { color: var(--muted); font-size: 12px; }
.usage-note { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.usage-footnote { margin-top: 14px; }
.usage-empty { text-align: center; padding: 38px !important; }

.docs-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font-sans);
}
.docs-page .site-header { position: sticky; top: 0; }
.docs-mobile-toggle { display: none !important; }
.docs-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - var(--header-height)); }
.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 18px 40px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}
.docs-sidebar .sidebar-label {
  margin: 19px 10px 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.docs-sidebar .sidebar-label:first-child { margin-top: 0; }
.docs-sidebar a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
}
.docs-sidebar a:hover { color: var(--text); background: var(--surface-hover); }
.docs-sidebar a.active { color: var(--text); background: #1b2028; }
.docs-sidebar .mini-method { width: 29px; color: var(--green); font: 700 9px var(--font-mono); }
.docs-sidebar .mini-method.post { color: var(--blue); }
.docs-content { min-width: 0; }
.docs-intro,
.docs-section { scroll-margin-top: calc(var(--header-height) + 20px); }
.docs-intro { max-width: 1120px; margin: 0 auto; padding: 62px 52px 42px; }
.docs-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font: 600 12px var(--font-mono); }
.docs-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(125,216,143,.09); }
.docs-intro h1 { margin: 14px 0 12px; font-size: clamp(38px, 5vw, 58px); line-height: 1.02; letter-spacing: -.045em; }
.docs-intro .lead { max-width: 700px; color: var(--muted); font-size: 17px; }
.base-url {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
  margin-top: 28px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  overflow-x: auto;
}
.base-url span { color: var(--muted); font: 600 10px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.docs-callout { max-width: 760px; margin-top: 18px; padding: 13px 15px; color: var(--muted); background: #151711; border: 1px solid #32311f; border-radius: var(--radius); }
.docs-callout a { color: var(--link); }
.docs-section { border-top: 1px solid var(--line); }
.docs-section-inner { max-width: 1120px; margin: 0 auto; padding: 52px; }
.docs-section h2 { margin: 0 0 10px; font-size: 27px; line-height: 1.2; letter-spacing: -.025em; }
.docs-section h3 { margin: 30px 0 10px; font-size: 17px; }
.docs-section p { max-width: 680px; color: var(--muted); }
.docs-page code, .docs-page pre { font-family: var(--font-mono); }
.docs-page :not(pre) > code { padding: 2px 5px; color: var(--text-soft); background: var(--surface-hover); border: 1px solid var(--line); border-radius: 5px; font-size: .88em; }
.endpoint-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.endpoint-heading h2 { margin: 0; font: 600 21px/1.25 var(--font-mono); letter-spacing: -.02em; overflow-wrap: anywhere; }
.method-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 43px; padding: 4px 7px; border-radius: 6px; color: var(--green); background: var(--green-bg); font: 750 10px var(--font-mono); letter-spacing: .04em; }
.method-badge.post { color: var(--blue); background: var(--blue-bg); }
.endpoint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr); gap: 42px; align-items: start; }
.endpoint-copy p:first-child { margin-top: 0; }
.param-table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.param-table th, .param-table td { padding: 11px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.param-table th { color: var(--muted-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.param-table td:first-child { width: 34%; color: var(--text-soft); font-family: var(--font-mono); font-size: 12px; }
.param-table td:last-child { color: var(--muted); font-size: 13px; }
.code-panel { position: sticky; top: calc(var(--header-height) + 24px); min-width: 0; background: #090b0e; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.18); }
.code-panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 41px; padding: 0 13px; color: var(--muted); background: #11151a; border-bottom: 1px solid var(--line); font-size: 11px; }
.code-panel pre { margin: 0; padding: 16px; overflow: auto; color: #cbd5e1; font: 12px/1.65 var(--font-mono); white-space: pre; }
.code-panel .token-key { color: #8ab4f8; }
.code-panel .token-string { color: #a8d5a2; }
.code-panel .token-bool { color: #d8b47d; }
.response-note { margin: 0; padding: 10px 16px; color: var(--muted); border-top: 1px solid var(--line); background: #0d1014; font-size: 12px; }
.docs-footer { padding: 34px 52px 60px; color: var(--muted-2); border-top: 1px solid var(--line); }
.docs-footer a { color: var(--link); }

@media (max-width: 920px) {
  .docs-shell { grid-template-columns: 220px minmax(0,1fr); }
  .docs-intro, .docs-section-inner { padding-left: 34px; padding-right: 34px; }
  .endpoint-grid { grid-template-columns: 1fr; gap: 26px; }
  .code-panel { position: relative; top: auto; }
}

@media (max-width: 700px) {
  .site-header { padding: 0 12px; gap: 8px; overflow: hidden; }
  .site-brand span { display: none; }
  .site-spacer { display: none; }
  .site-nav { flex: 1; min-width: 0; gap: 1px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a, .site-nav button { flex: none; padding: 5px 8px; }
  .account-main { width: min(100% - 24px, 900px); padding-top: 28px; }
  .account-page .card { padding: 18px; }
  .provider-usage-heading, .provider-limit-meta { align-items: flex-start; flex-wrap: wrap; }
  .provider-limit-grid { grid-template-columns: 1fr; }
  .usage-callout { grid-template-columns: 1fr; gap: 10px; }
  .usage-summary { grid-template-columns: 1fr 1fr; }
  .docs-mobile-toggle { display: inline-flex !important; }
  .docs-shell { display: block; }
  .docs-sidebar { position: fixed; inset: var(--header-height) auto 0 0; z-index: 25; width: min(84vw, 290px); height: auto; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.32); }
  .docs-page.docs-nav-open .docs-sidebar { transform: translateX(0); }
  .docs-intro { padding: 42px 20px 34px; }
  .docs-intro h1 { font-size: 39px; }
  .docs-section-inner { padding: 38px 20px; }
  .docs-section h2 { font-size: 23px; }
  .endpoint-heading { align-items: flex-start; }
  .endpoint-heading h2 { font-size: 16px; padding-top: 2px; }
  .docs-footer { padding: 28px 20px 50px; }
}
