:root {
  --bg: #ffffff;
  --bg-raised: #f6f7f9;
  --text: #1a1d21;
  --text-muted: #565d66;
  --border: #dfe3e8;
  --accent: #0a5cd8;
  --accent-text: #ffffff;
  --code-bg: #1a1d21;
  --code-text: #e8eaed;
  --warn-bg: #fff8e6;
  --warn-border: #e8b93a;
  --ok-bg: #eef7ee;
  --ok-border: #3f9142;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-raised: #1c1f24;
    --text: #e8eaed;
    --text-muted: #9aa2ad;
    --border: #2c3038;
    --accent: #5b9dff;
    --accent-text: #0a1020;
    --code-bg: #0d0f12;
    --code-text: #e8eaed;
    --warn-bg: #2a2410;
    --warn-border: #a5821f;
    --ok-bg: #10241b;
    --ok-border: #2f7a3c;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  font-size: 16px;
}

a {
  color: var(--accent);
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

.site-header .brand .devanagari {
  color: var(--text-muted);
  font-weight: 400;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-header nav a {
  text-decoration: none;
  color: var(--text-muted);
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--text);
}

main {
  padding: 2.5rem 0 4rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

section:first-of-type h2:first-child,
main > .lede + h2 {
  border-top: none;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0.75rem 0;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 60ch;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-raised);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem 1.1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin: 1rem 0;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.endpoint-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-raised);
}

.endpoint-card:hover,
.endpoint-card:focus-visible {
  border-color: var(--accent);
}

.endpoint-card .method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.endpoint-card .path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.endpoint-card .desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  margin-left: 0.4em;
  vertical-align: middle;
}

.badge-beta {
  background: var(--warn-bg);
  color: #8a6a10;
  border: 1px solid var(--warn-border);
}

@media (prefers-color-scheme: dark) {
  .badge-beta {
    color: #e0bd5a;
  }
}

.callout {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.callout-warn {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.error-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  scroll-margin-top: 5rem;
}

.error-entry:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.error-entry h3 {
  margin-top: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.site-footer p {
  margin: 0.4rem 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}
