
:root, .light-mode {
  /* Fonts — match hosted Redocly (system-ui stack → Segoe UI on Windows, SF Pro on Mac) */
  --scalar-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  --scalar-font-code: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', Consolas, 'Courier New', monospace;

  /* Font-size scale — tighter, matches hosted Redocly density */
  --scalar-font-size-1: 14px;   /* base paragraph */
  --scalar-font-size-2: 13.5px; /* sidebar + secondary */
  --scalar-font-size-3: 12.5px; /* method badges, micro */
  --scalar-font-size-4: 11px;
  --scalar-font-size-5: 10px;
  --scalar-font-size-6: 9px;
  --scalar-font-size-7: 8px;

  /* Heading scale */
  --scalar-heading-1: 1.625rem;  /* ~26px */
  --scalar-heading-2: 1.25rem;   /* ~20px */
  --scalar-heading-3: 1.05rem;   /* ~17px */
  --scalar-heading-4: 1rem;
  --scalar-heading-5: 0.9rem;
  --scalar-heading-6: 0.85rem;

  /* Base palette */
  --scalar-color-1: #111111;
  --scalar-color-2: #374151;
  --scalar-color-3: #6b7280;
  --scalar-color-accent: #e61168;
  --scalar-background-1: #ffffff;
  --scalar-background-2: #f9fafb;
  --scalar-background-3: #f3f4f6;
  --scalar-background-accent: rgba(230, 17, 104, 0.08);
  --scalar-border-color: #e5e7eb;

  /* Weights */
  --scalar-bold: 700;
  --scalar-semibold: 600;
  --scalar-regular: 400;

  /* Radii */
  --scalar-radius: 4px;
  --scalar-radius-md: 5px;
  --scalar-radius-lg: 6px;

  /* Method colors */
  --scalar-color-green: #059669;
  --scalar-color-blue: #2563eb;
  --scalar-color-orange: #ea580c;
  --scalar-color-red: #dc2626;
  --scalar-color-yellow: #ca8a04;
  --scalar-color-purple: #7c3aed;

  /* Sidebar variables (real Scalar tokens) */
  --scalar-sidebar-width: 290px;
  --scalar-sidebar-padding: 0 12px;
  --scalar-sidebar-indent: 14px;
  --scalar-sidebar-background-1: #ffffff;
  --scalar-sidebar-color-1: #111111;
  --scalar-sidebar-color-2: #374151;
  --scalar-sidebar-color-active: #111111;
  --scalar-sidebar-item-hover-background: #f3f4f6;
  --scalar-sidebar-item-hover-color: #111111;
  --scalar-sidebar-item-active-background: transparent;
  --scalar-sidebar-border-color: #e5e7eb;
  --scalar-sidebar-font-weight: 400;
  --scalar-sidebar-font-weight-active: 700;
  --scalar-sidebar-search-background: #f9fafb;
  --scalar-sidebar-search-border-color: #e5e7eb;
  --scalar-sidebar-search-color: #6b7280;
}

/* Global antialiasing + base size for Inter */
body, .scalar-app, .scalar-api-reference {
  font-family: var(--scalar-font) !important;
  font-size: 14px !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Content paragraphs — 14px to match hosted */
.scalar-api-reference p,
.scalar-api-reference li,
.section-description,
.rendered-description {
  font-size: 14px !important;
  line-height: 1.55 !important;
}

/* ─── Category/tagGroup headers — more breathing room above ─── */
.tag-group-name,
.tag-section-group > .sidebar-heading,
[class*="tag-group"] {
  font-weight: 700 !important;
  font-size: 12.5px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #111 !important;
  padding-top: 22px !important;
  padding-bottom: 6px !important;
}

/* ─── Sidebar rows — looser vertical spacing to match hosted ─── */
.sidebar-heading {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  line-height: 1.3 !important;
  font-size: 13.5px !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

/* ─── Chevron / arrow → push to far right (hosted pattern) ─── */
.sidebar-heading > svg:first-child,
.sidebar-heading > [class*="chevron"],
.sidebar-heading > [class*="arrow"],
.sidebar-heading .scalar-sidebar-indent svg {
  order: 99 !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}
/* If the chevron is inside a button/span wrapper, also push the wrapper */
.sidebar-heading > button:last-of-type,
.sidebar-heading > .sidebar-heading-chevron {
  margin-left: auto !important;
  order: 99 !important;
}

/* Active state — bold only, no strong background */
.sidebar-heading.active,
.sidebar-heading[aria-current="page"],
.scalar-sidebar-indent-selected {
  font-weight: 700 !important;
  color: #111 !important;
}

/* ─── Method badge inside sidebar rows ─── */
.sidebar-heading-type {
  font-weight: 700 !important;
  font-size: 9.5px !important;
  letter-spacing: 0.06em !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  min-width: 34px !important;
  text-align: center !important;
  background: transparent !important;
}

/* ─── Endpoint method in main content list (right-side panel: "Operations") ─── */
.endpoint-method,
.endpoint-label-name {
  font-weight: 700 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.06em !important;
}

/* ─── Main content headings ─── */
/* The API client (Test Request) sits inside .scalar-api-reference and uses h2 for its section titles —
   keep these off it, or Authentication / Variables / Headers render at 20px bold. */
.scalar-api-reference h1:not(.scalar-client *) { font-size: 1.625rem !important; font-weight: 700 !important; letter-spacing: -0.01em; }
.scalar-api-reference h2:not(.scalar-client *) { font-size: 1.25rem !important; font-weight: 700 !important; }
.scalar-api-reference h3:not(.scalar-client *) { font-size: 1.05rem !important; font-weight: 700 !important; }

/* Code — smaller inline */
code, pre, .hljs { font-size: 12.5px !important; }

/* ─── Search box ─── */
.sidebar-search,
.sidebar-search input {
  border-radius: 6px !important;
  font-size: 13px !important;
}

/* ─── Description tables ─── */
/* Auto layout so a column widens to its content instead of being clipped. */
/* Never the API client's parameter grids — they are <table> elements laid out as CSS grid. */
.scalar-api-reference table:not(.scalar-client *),
.rendered-description table,
.section-description table,
.markdown table {
  table-layout: auto !important;
  width: 100% !important;
}

/* Inline code must never break mid-token — SCOPE_NOT_GRANTED wrapped in the Code column. */
.scalar-api-reference table:not(.scalar-client *) code,
.rendered-description table code,
.section-description table code,
.markdown table code {
  white-space: nowrap !important;
}

/*
 * Test Request panel: draw the parameter checkboxes as boxes. Scalar shows a bare checkmark in the
 * same column, size and weight as the section chevrons, so the two read as the same control. Its own
 * box outline only appears on hover; keep it visible, and fill it with the accent when checked.
 */
.scalar-client .scalar-data-table input[type="checkbox"] + div > div {
  opacity: 1 !important;
  width: 16px !important;
  height: 16px !important;
  inset: 0 !important;
  margin: auto !important;
  border: 1.5px solid var(--scalar-color-3) !important;
  border-radius: 4px !important;
  background: var(--scalar-background-1) !important;
}
.scalar-client .scalar-data-table input[type="checkbox"]:checked + div > div {
  background: var(--scalar-color-accent) !important;
  border-color: var(--scalar-color-accent) !important;
}
.scalar-client .scalar-data-table input[type="checkbox"] + div > svg {
  position: relative;
  z-index: 1;
  width: 10px !important;
  height: 10px !important;
  color: transparent !important;
}
.scalar-client .scalar-data-table input[type="checkbox"]:checked + div > svg {
  color: #fff !important;
}
.scalar-client .scalar-data-table input[type="checkbox"]:focus-visible + div > div {
  outline: 2px solid var(--scalar-color-accent);
  outline-offset: 2px;
}

/* Test Request panel: section titles (Authentication, Variables, Headers, …) a step above the row text. */
.scalar-client h2 {
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* Map keys (language-code maps): the row is labelled by propertyNames.title — drop Scalar's generic "additionalProperty" badge. */
.property-key-kind {
  display: none !important;
}

/*
 * Opening a link to an operation (#tag/…/GET/…) makes Scalar focus that operation's <section> so screen
 * readers start there. The focus outline then frames a section taller than the screen, which shows as two
 * thin accent lines down the page. The section is not a control, so it needs no focus ring; links, buttons
 * and inputs inside it keep theirs.
 */
.scalar-api-reference section.section:focus,
.scalar-api-reference section.section:focus-visible {
  outline: none !important;
}
