@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0b0c;
  --ink-hover: #2c2c30;
  --muted: #66666b;
  --placeholder: #737378;
  --line: #e7e7ea;
  --line-strong: #d4d4d8;
  --line-input: #8e8e94;
  --canvas: #ffffff;
  --rail: #f8f8f8;
  --wash: #f1f1f2;
  --code: #fafafa;
  --error: #b42318;
  --error-wash: #fef3f2;
  --success: #067647;
  --data: #3056f5;
  --kind-text: #2563eb;
  --kind-checkbox: #0a8f5a;
  --kind-signature: #c2410c;

  --radius-card: 16px;
  --radius-control: 10px;
  --shadow-pop: 0 1px 2px rgb(11 11 12 / 5%), 0 8px 24px -12px rgb(11 11 12 / 14%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  color-scheme: light;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
::selection { color: var(--canvas); background: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.025em; }
h2 { font-size: 16px; line-height: 1.35; }
h3 { font-size: 14px; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
code, kbd, pre { font-family: var(--mono); font-size: 12.5px; }
:not(pre) > code { padding: 1px 6px; background: var(--wash); border-radius: 6px; }
table, .num { font-variant-numeric: tabular-nums; }
svg.icon { width: 18px; height: 18px; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Controls */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); }
input, select, textarea {
  min-height: 38px; padding: 8px 12px; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--line-input); border-radius: var(--radius-control); caret-color: var(--ink);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
input::placeholder { color: var(--placeholder); }
input:hover, select:hover { border-color: #5c5c61; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(11 11 12 / 10%); border-radius: var(--radius-control); }
input[type="file"] { padding: 3px; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 5px 12px; font: inherit; font-weight: 500; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer;
}

button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 16px; font: inherit; font-weight: 500; line-height: 1.2;
  color: var(--canvas); background: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius-control);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
button:hover, a.button:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
button:disabled { color: var(--muted); background: var(--wash); border-color: var(--wash); cursor: default; }
button.secondary, a.button.secondary { color: var(--ink); background: var(--canvas); border-color: var(--line-strong); }
button.secondary:hover, a.button.secondary:hover { background: var(--wash); border-color: var(--line-strong); }
button.secondary[aria-pressed="true"] { color: var(--canvas); background: var(--ink); border-color: var(--ink); }
button.small, a.button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
button.link { min-height: 0; padding: 0; font-weight: 500; color: var(--ink); background: none; border: 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
button.link:hover { text-decoration-color: currentColor; }
button.danger:hover { color: var(--error); }
a.button[hidden], button[hidden] { display: none; }

/* Messages */
.error { color: var(--error); }
.notice { color: var(--muted); }
.alert { padding: 10px 14px; color: var(--error); background: var(--error-wash); border: 1px solid #fecdca; border-radius: var(--radius-control); }
.success { color: var(--success); }

/* Auth pages */
.auth { display: grid; min-height: 100vh; place-items: center; padding: 48px 16px; background: var(--rail); }
.auth-panel { display: grid; gap: 24px; width: min(400px, 100%); }
.auth-panel > .wordmark { justify-self: center; }
.auth-panel header { display: grid; gap: 6px; text-align: center; }
.auth-panel header p { color: var(--muted); }
.auth-panel .aside { text-align: center; color: var(--muted); }
.auth-panel .aside a { color: var(--ink); font-weight: 500; }
.auth-panel form button[type="submit"], .auth-panel a.button { width: 100%; }
.consent-actions { display: grid; gap: 8px; }

.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); text-decoration: none; }
.wordmark svg { width: 22px; height: 22px; }

/* App shell */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; display: flex; flex-direction: column; gap: 20px; height: 100vh;
  padding: 20px 12px 16px; background: var(--rail); border-right: 1px solid var(--line);
}
.rail > .wordmark { padding: 4px 10px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px;
  color: #3a3a3e; font-weight: 500; text-decoration: none; border-radius: var(--radius-control);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav a svg { color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--wash); }
.nav a[aria-current="page"] { color: var(--ink); background: #e9e9eb; }
.nav a[aria-current="page"] svg { color: var(--ink); }
.account { display: grid; gap: 10px; margin-top: auto; padding: 12px; background: var(--canvas); border: 1px solid var(--line); border-radius: 14px; }
.account .who { display: grid; min-width: 0; }
.account .who strong, .account .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who span { font-size: 12.5px; color: var(--muted); }
.account form { margin: 0; }
.account button { width: 100%; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 32px;
  background: rgb(255 255 255 / 92%); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px);
}
.crumbs { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font-weight: 500; }
.crumbs li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid var(--line-strong); border-right: 1.5px solid var(--line-strong); transform: rotate(45deg); margin-right: 4px; }
.crumbs li:last-child { color: var(--ink); }
.crumbs a { text-decoration: none; }
.topbar .spacer { flex: 1; }
.menu-toggle, .scrim { display: none; }

.page { width: 100%; max-width: 1180px; padding: 32px 32px 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head > div { display: grid; gap: 6px; max-width: 68ch; }
.page-head p { color: var(--muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section { display: grid; gap: 14px; margin-top: 40px; }
.section > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section > header p { color: var(--muted); }

/* Surfaces */
.card { display: grid; gap: 16px; padding: 24px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-card); }
.card > header { display: grid; gap: 4px; }
.card > header p { color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form label { flex: 1 1 240px; }

.created { margin-bottom: 16px; gap: 12px; border-color: #abefc6; background: #f6fef9; }
.created p { color: #054f31; }
.copy-row { display: flex; align-items: stretch; gap: 8px; }
.secret { flex: 1; min-width: 0; padding: 9px 12px; overflow-wrap: anywhere; color: var(--ink); background: var(--canvas); border: 1px solid #abefc6; border-radius: var(--radius-control); user-select: all; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); }
.table { width: 100%; border-collapse: collapse; background: var(--canvas); }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--rail); }
.table td.end, .table th.end { text-align: right; }
.table tbody tr { transition: background-color 150ms var(--ease); }
.table tbody tr:hover { background: #fcfcfc; }
.table td a { font-weight: 500; }
.table form { display: inline; margin: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.status.live { color: var(--ink); }
.status.live::before { background: var(--success); }

.empty { display: grid; justify-items: center; gap: 12px; padding: 48px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-card); }
.empty .glyph { display: grid; place-items: center; width: 48px; height: 48px; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
.empty .glyph svg { width: 22px; height: 22px; }
.empty p { max-width: 46ch; color: var(--muted); }

/* Overview */
.quickstart { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; padding: 28px; }
.quickstart .intro { display: grid; gap: 12px; align-content: center; }
.quickstart .intro p { color: var(--muted); }
.quickstart .intro .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.steps { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; gap: 10px; color: var(--muted); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 1px; font-size: 11.5px; font-weight: 600; color: var(--ink); background: var(--wash); border-radius: 50%; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: ""; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }

.code { position: relative; min-width: 0; background: var(--code); border: 1px solid var(--line); border-radius: 14px; }
.code .code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; line-height: 1.7; color: #1f1f23; }
.code .tok-cmd { color: #7a2ad6; }
.code .tok-str { color: #067647; }
.code .tok-flag { color: #1f4fd6; }
.copy { gap: 6px; }
.copy svg { width: 15px; height: 15px; }
.copy .when-idle, .copy .when-done, .copy .when-failed { align-items: center; gap: 6px; }
.copy .when-idle { display: inline-flex; }
.copy .when-failed { display: none; color: var(--error); }
.copy.failed .when-failed { display: inline-flex; }
.copy.failed .when-idle { display: none; }
.copy .when-done { display: none; }
.copy.done .when-done { display: inline-flex; }
.copy.done .when-idle { display: none; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 40px; }
.overview-grid > section { display: grid; gap: 14px; align-content: start; }
.meter-card { display: grid; gap: 14px; }
.meter-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.meter-line strong { font-size: 15px; }
.meter { height: 8px; overflow: hidden; background: var(--wash); border-radius: 999px; }
.meter span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.meter.full span { background: var(--error); }
.meter-card .foot { font-size: 13px; color: var(--muted); }
.meter-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.links a {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; font-weight: 500; text-decoration: none;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.links a:hover { border-color: var(--line-strong); box-shadow: var(--shadow-pop); }
.links a svg { color: var(--muted); }
.links a .go { width: 15px; height: 15px; margin-left: auto; opacity: 0; transition: opacity 150ms var(--ease); }
.links a:hover .go, .links a:focus-visible .go { opacity: 1; }

/* Usage */
.stats { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }
.stats div { display: grid; gap: 2px; }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bar-cell { width: 42%; }
.bar { display: block; height: 8px; min-width: 3px; background: var(--data); border-radius: 999px; }

/* Billing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { display: grid; gap: 16px; align-content: start; }
.plan .price { display: flex; align-items: baseline; gap: 6px; }
.plan .price strong { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.plan .price span { color: var(--muted); }
.plan ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; margin-top: 2px; color: var(--ink); }
.plan form, .plan form button { width: 100%; }
.plan.current { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; font-size: 12px; font-weight: 500; color: var(--ink); background: var(--wash); border-radius: 999px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Playground */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0; color: var(--muted); font-size: 13px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border: 2px solid; border-radius: 3px; }
.legend[hidden] { display: none; }
.upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.upload label { flex: 1 1 320px; }
.status-line { min-height: 21px; margin-top: 16px; color: var(--muted); }
.editor {
  position: sticky; top: 56px; z-index: 3; display: grid; gap: 12px; margin-top: 16px; padding: 16px;
  background: rgb(255 255 255 / 95%); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-pop);
  backdrop-filter: blur(8px);
}
.editor[hidden], .toolbar[hidden] { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.toolbar label { flex: 1 1 200px; }
#inspector { padding-top: 12px; border-top: 1px solid var(--line); }
.hint { margin: 0; font-size: 13px; }
.pages { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; margin-top: 24px; padding: 24px; background: var(--rail); border: 1px solid var(--line); border-radius: var(--radius-card); }
.pages:empty { display: none; }
.sheet { position: relative; max-width: 100%; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgb(11 11 12 / 8%), 0 12px 32px -16px rgb(11 11 12 / 24%); touch-action: none; }
.sheet canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }
.box { position: absolute; border: 2px solid; border-radius: 3px; cursor: move; transition: box-shadow 120ms var(--ease); }
.kind-text { border-color: var(--kind-text); background: rgb(37 99 235 / 12%); }
.kind-checkbox { border-color: var(--kind-checkbox); background: rgb(10 143 90 / 14%); }
.kind-signature { border-color: var(--kind-signature); background: rgb(194 65 12 / 12%); }
.box:hover { box-shadow: 0 0 0 3px rgb(11 11 12 / 10%); }
.box.selected { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 1; }
.handle { position: absolute; right: -6px; bottom: -6px; display: none; width: 11px; height: 11px; background: var(--canvas); border: 2px solid var(--ink); border-radius: 3px; cursor: nwse-resize; }
.box.selected .handle { display: block; }
.pages.adding .sheet { cursor: crosshair; }

/* Docs */
.prose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 76ch; line-height: 1.65; }
.prose > * { margin: 0; }
.prose h1 { margin-bottom: 4px; }
.prose h2 { margin-top: 24px; font-size: 18px; }
.prose h3 { margin-top: 12px; }
.prose p, .prose li { color: #2c2c30; }
.prose ul, .prose ol { display: grid; gap: 6px; padding-left: 20px; }
.prose a { font-weight: 500; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--rail); }
.prose thead th:first-child { border-top-left-radius: 10px; }
.prose thead th:last-child { border-top-right-radius: 10px; }
.code-block { position: relative; }
.code-block .copy { position: absolute; top: 8px; right: 8px; }
.prose pre { margin: 0; padding: 16px 96px 16px 16px; overflow-x: auto; line-height: 1.7; color: #1f1f23; background: var(--code); border: 1px solid var(--line); border-radius: 14px; }
.prose pre code { padding: 0; background: none; }

/* Code highlighting: syntect's scope classes, in the same palette as the dashboard snippets. */
.hl-comment { color: var(--muted); }
.hl-string { color: #067647; }
.hl-keyword, .hl-storage { color: #7a2ad6; }
.hl-constant { color: #b54708; }
.hl-entity.hl-name.hl-function, .hl-support.hl-function { color: #1f4fd6; }
.hl-variable.hl-parameter { color: #1f4fd6; }

/* API reference: Redoc takes the full width below the docs bar. */
.reference-bar .wordmark { margin-right: 8px; }
.reference { min-height: calc(100vh - 57px); }

/* Small screens: the rail becomes a drawer. */
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(288px, 86vw); transform: translateX(-100%);
    visibility: hidden; box-shadow: var(--shadow-pop); transition: transform 200ms var(--ease), visibility 0ms 200ms;
  }
  .app.nav-open .rail { transform: none; visibility: visible; transition: transform 200ms var(--ease); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 10; background: rgb(11 11 12 / 30%); }
  .menu-toggle { display: inline-flex; min-height: 34px; padding: 6px 8px; }
  .topbar { padding: 0 16px; }
  .page { padding: 24px 16px 48px; }
  .quickstart { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .prose table { display: block; overflow-x: auto; }
}
@media (max-width: 520px) {
  .code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .links { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 22px; }
  .pages { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
}
