/* RedSwitches API docs. No build step, no external fonts or scripts. Light and dark follow the system setting. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #f3f4f6;
  --text: #1c1f24;
  --muted: #5b6370;
  --border: #e2e5ea;
  --accent: #c8102e;
  --accent-text: #a50d26;
  --link: #0b5cad;
  --beta-bg: #fff6e0;
  --beta-border: #e6b84c;
  --note-bg: #eef5ff;
  --note-border: #8bb4ea;
  --get: #12795a;
  --post: #0b5cad;
  --delete: #b42318;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --bg-soft: #181b20;
    --bg-code: #1d2127;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --border: #2c3139;
    --accent: #ff5a6e;
    --accent-text: #ff8a98;
    --link: #79b4ff;
    --beta-bg: #2a2312;
    --beta-border: #8a6a1f;
    --note-bg: #142033;
    --note-border: #2f5b93;
    --get: #4cc79c;
    --post: #79b4ff;
    --delete: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--link); text-underline-offset: 2px; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--bg-code); border: 1px solid var(--border); border-radius: 4px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; line-height: 1.5; margin: 0 0 1.2em; }
pre code { font-size: 0.86rem; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.badge { font-size: 12px; font-weight: 600; color: var(--accent-text); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.top-link { margin-left: auto; font-size: 14px; }

/* layout */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.side { position: sticky; top: 56px; align-self: start; max-height: calc(100vh - 56px); overflow-y: auto; padding: 20px 16px 40px; border-right: 1px solid var(--border); font-size: 14px; }
.side ul, .mobile-nav ul { list-style: none; margin: 0 0 14px; padding: 0; }
.side li a, .mobile-nav li a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--text); text-decoration: none; }
.side li a:hover, .mobile-nav li a:hover { background: var(--bg-soft); }
.side li a[aria-current="page"], .mobile-nav li a[aria-current="page"] { background: var(--bg-soft); color: var(--accent-text); font-weight: 600; }
.nav-group { margin: 10px 0 4px; padding: 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
main { min-width: 0; padding: 28px 40px 40px; }
article { max-width: 820px; }
.mobile-nav { display: none; }
.foot { max-width: 820px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

/* content */
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; margin: 2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--border); line-height: 1.3; }
h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
h4 { font-size: 1rem; margin: 1.4em 0 0.4em; }
h2 .anchor, h3 .anchor, h4 .anchor { color: inherit; text-decoration: none; }
h2 .anchor:hover::after, h3 .anchor:hover::after { content: " #"; color: var(--muted); }
p, ul, ol { margin: 0 0 1em; }
li { margin: 0.2em 0; }
.lead { font-size: 1.12rem; color: var(--muted); }
.table { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.callout { margin: 0 0 1.2em; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); border-left-width: 4px; background: var(--bg-soft); }
.callout p { margin: 0; }
.callout.beta { background: var(--beta-bg); border-color: var(--beta-border); }
.callout.note { background: var(--note-bg); border-color: var(--note-border); }
.toc { margin: 0 0 1.5em; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.92rem; }
.toc p { margin: 0 0 4px; font-weight: 600; }
.toc ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.toc li { margin: 0 0 2px; break-inside: avoid; }
[id] { scroll-margin-top: 72px; }

/* code tabs: radio inputs, CSS only */
.tabs { margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label { display: inline-block; padding: 8px 14px; font-size: 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs > input:focus-visible + label { outline: 2px solid var(--link); outline-offset: -2px; }
.tabs > input:checked + label { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .panels { border-top: 1px solid var(--border); }
.tabs .panel { display: none; }
.tabs .panel pre { margin: 0; border: 0; border-radius: 0; }
.tabs > input:nth-of-type(1):checked ~ .panels .panel:nth-child(1),
.tabs > input:nth-of-type(2):checked ~ .panels .panel:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ .panels .panel:nth-child(3),
.tabs > input:nth-of-type(4):checked ~ .panels .panel:nth-child(4) { display: block; }

/* API reference */
.op { margin: 0 0 2.2em; }
.op-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 0.6em; }
.method { font: 700 12px/1 var(--mono); padding: 5px 8px; border-radius: 5px; color: #fff; }
.method.get { background: var(--get); } .method.post { background: var(--post); } .method.delete { background: var(--delete); }
@media (prefers-color-scheme: dark) { .method { color: #111317; } }
.path { font: 600 15px var(--mono); overflow-wrap: anywhere; }
.pill { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--muted); white-space: nowrap; }
.pill.beta { border-color: var(--beta-border); background: var(--beta-bg); color: var(--text); }
.type { font-family: var(--mono); font-size: 0.85em; color: var(--muted); overflow-wrap: anywhere; }
.req { color: var(--accent-text); font-size: 12px; font-weight: 600; }

/* phones and small tablets: stack, no sidebar */
@media (max-width: 900px) {
  .layout { display: block; }
  .side { display: none; }
  main { padding: 16px 16px 32px; }
  .mobile-nav { display: block; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); }
  .mobile-nav summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
  .mobile-nav nav { padding: 0 8px 8px; font-size: 15px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  .toc ul { columns: 1; }
}
@media (max-width: 600px) {
  .table table { min-width: 540px; }
}
@media (max-width: 420px) {
  .top { gap: 8px; }
  .top-link { display: none; }
  th, td { padding: 6px 8px; }
  .tabs > label { padding: 8px 10px; font-size: 13px; }
}
@media (min-width: 1600px) {
  .layout { max-width: 1480px; }
  article, .foot { max-width: 900px; }
}
