/* Docs page (docs.html): the light page's look (styles-b.css), plus a dark version that follows the system like the Dark design (a.html). */
.docs-page { --code: #f4f3f0; --kbd: #ffffff; --accent-link: #c4560c; }
@media (prefers-color-scheme: dark) {
  .docs-page {
    --bg: #0c0c0e; --panel: #19191c; --card: #141416; --line: rgba(255, 255, 255, .1); --text: #f2f1ee; --muted: #9b9994; --soft: #77756f;
    --code: #1f1f23; --kbd: #232327; --accent-link: #ffa24d;
    color-scheme: dark;
  }
  .docs-page .nav { background: rgba(12, 12, 14, .82); }
  .docs-page .lang button[aria-pressed="true"] { background: #2b2b30; color: var(--text); }
  .docs-page .btn { background: #f2f1ee; color: #111; }
  .docs-page .brand { color: var(--text); }
}
.docs-page { background: var(--bg); color: var(--text); }
.docs-page .links a[aria-current] { opacity: 1; font-weight: 600; }
@media (min-width: 901px) { .docs-page .links a[href="feedback.html"] { display: inline; } } /* few links here: room for it */

.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 32px; }
.docs-side { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; padding-bottom: 20px; }
.docs-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 10px; background: var(--panel); color: var(--muted); }
.docs-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 15px var(--font); outline: none; }
.docs-search:focus-within { box-shadow: 0 0 0 2px var(--accent-link); }
.docs-toc { margin-top: 18px; }
.docs-toc summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 0 8px; list-style: none; }
.docs-toc summary::-webkit-details-marker { display: none; }
.docs-toc nav { display: flex; flex-direction: column; gap: 2px; }
.docs-toc nav a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 15px; opacity: .78; }
.docs-toc nav a span { width: 20px; text-align: center; }
.docs-toc nav a:hover { background: var(--panel); opacity: 1; }
.docs-toc nav a[aria-current] { background: var(--panel); opacity: 1; font-weight: 600; }

.docs-main { min-width: 0; max-width: 780px; }
.docs-head h1 { font-size: clamp(38px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
.docs-head .lead { color: var(--muted); font-size: 19px; margin: 14px 0 6px; }
.docs-results { margin: 24px 0 0; padding: 16px; border-radius: 14px; background: var(--panel); }
.docs-results .fine { margin: 0 0 8px; }
.docs-results .hit { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.docs-results .hit:hover, .docs-results .hit:focus { background: var(--card); }
.docs-results .hit span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.docs-results mark { background: color-mix(in srgb, var(--yellow) 55%, transparent); color: inherit; border-radius: 3px; }

.doc-section { padding-top: 40px; margin-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.doc-section:first-child { border-top: 0; }
.doc-section h2 { font-size: clamp(28px, 3.4vw, 36px); letter-spacing: -0.02em; margin: 0 0 12px; }
.doc-section h3 { font-size: 20px; margin: 30px 0 8px; scroll-margin-top: 70px; }
.doc-section h4 { font-size: 15px; margin: 24px 0 6px; color: var(--muted); }
.doc-section p, .doc-section li { line-height: 1.6; }
.doc-section ul, .doc-section ol { padding-left: 22px; }
.doc-section li { margin: 6px 0; }
.doc-section a { color: var(--accent-link); }
.doc-section h2, .doc-section h3 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--soft) !important; text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover > .anchor, h3:hover > .anchor, .anchor:focus { opacity: 1; }
.doc-section code { font: 13.5px var(--mono); background: var(--code); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.doc-section kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; text-align: center; font: 12.5px/1.5 var(--mono); color: var(--text);
  background: var(--kbd); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--line); white-space: nowrap; }
.doc-note { padding: 12px 16px; border-radius: 12px; background: var(--panel); border-left: 3px solid var(--yellow); }
.doc-top { margin-top: 28px; font-size: 14px; }
.doc-top a { color: var(--muted) !important; text-decoration: none; }
.os-tag { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 20px; color: var(--muted); background: var(--panel); white-space: nowrap; vertical-align: 1px; }

.doc-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc-table thead th { font-size: 13px; color: var(--muted); }
.doc-table tbody th { white-space: nowrap; }
.doc-table.keys td:last-child { white-space: nowrap; width: 1%; }
.keys-tabs { display: inline-flex; background: var(--panel); border-radius: 10px; padding: 3px; margin: 8px 0; }
.keys-tabs button { border: 0; background: none; color: var(--muted); font: 600 14px var(--font); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.keys-tabs button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }

@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 16px; }
  .docs-side { position: static; max-height: none; overflow: visible; padding-bottom: 0; }
  .docs-toc { margin-top: 10px; padding: 4px 12px; border-radius: 12px; background: var(--panel); }
  .docs-toc summary { padding: 8px 0; }
  .docs-toc summary::after { content: " ▾"; }
  .docs-toc nav { padding-bottom: 8px; }
  .docs-toc nav a:hover, .docs-toc nav a[aria-current] { background: var(--card); }
  .anchor { display: none; }
}
/* narrower screens (the docs sidebar takes room up to here): tables with a header (Free / Pro) as stacked cards,
   so no cell is squeezed to a word per line */
@media (max-width: 1180px) {
  .doc-table:has(thead) thead { display: none; }
  .doc-table:has(thead) tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .doc-table:has(thead) th, .doc-table:has(thead) td { display: block; padding: 2px 0; border: 0; white-space: normal; }
  .doc-table:has(thead) tbody th { font-size: 15px; }
  .doc-table:has(thead) td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; }
}
@media (max-width: 600px) {
  .doc-table { font-size: 14px; }
  .doc-table th, .doc-table td { padding: 8px 6px; }
  .doc-table tbody th { white-space: normal; }
  .doc-table.keys td:last-child { white-space: normal; }
}
