/* Shared by the product page and the documentation. Colours are tokens, with
   a dark set used when the visitor's system asks for it. */
:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --surface-2: #F1F0EC;
  --line: #E4E2DC;
  --line-strong: #CFCCC4;
  --text: #1D1F23;
  --text-2: #3A3D42;
  --muted: #6B6F76;
  --accent: #1F5F8B;
  --accent-hover: #164766;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3ECF4;
  --accent-text: #1F4C6E;
  --amber: #B3741A;
  --green: #2F7A4B;
  --code-bg: #1D1F23;
  --code-text: #E6E8EB;
  --code-btn: #33373D;
  --shadow: 0 18px 50px rgba(29, 31, 35, .14);
  --night: #1D1F23;
  --night-2: #2C2F34;
  --night-3: #3A3E45;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171A;
    --surface: #1E2125;
    --surface-2: #262A2F;
    --line: #30343A;
    --line-strong: #444950;
    --text: #E8EAED;
    --text-2: #C3C7CC;
    --muted: #959AA1;
    --accent: #6FA6D0;
    --accent-hover: #8DB9DB;
    --accent-ink: #0F1A24;
    --accent-soft: #1F3242;
    --accent-text: #A9CBE6;
    --amber: #E0A54F;
    --green: #6CBF8B;
    --code-bg: #0F1113;
    --code-btn: #2A2E33;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --night: #0F1113;
    --night-2: #1B1E22;
    --night-3: #2A2E33;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171A;
  --surface: #1E2125;
  --surface-2: #262A2F;
  --line: #30343A;
  --line-strong: #444950;
  --text: #E8EAED;
  --text-2: #C3C7CC;
  --muted: #959AA1;
  --accent: #6FA6D0;
  --accent-hover: #8DB9DB;
  --accent-ink: #0F1A24;
  --accent-soft: #1F3242;
  --accent-text: #A9CBE6;
  --amber: #E0A54F;
  --green: #6CBF8B;
  --code-bg: #0F1113;
  --code-btn: #2A2E33;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --night: #0F1113;
  --night-2: #1B1E22;
  --night-3: #2A2E33;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.serif { font-family: "Source Serif 4", Georgia, serif; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { height: 64px; display: flex; align-items: center; gap: 26px; }
.top.full .wrap { max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand:hover { color: var(--text); }
.topnav { display: flex; gap: 22px; font-size: 15px; }
.topnav a { color: var(--text-2); text-decoration: none; }
.topnav a:hover, .topnav a[aria-current] { color: var(--accent); }
.topnav a[aria-current] { font-weight: 600; }
.spacer { flex: 1; }
.star { display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.star:hover { color: var(--text); border-color: var(--accent); }
.star > span { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; }
.star .count { border-left: 1px solid var(--line-strong); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.star .count:empty { display: none; }
.gh { width: 18px; height: 18px; fill: currentColor; }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 38px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer; flex: none; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn .ti { display: none; }
:root:not([data-theme]) .theme-btn .ti-system, :root[data-theme="light"] .theme-btn .ti-light, :root[data-theme="dark"] .theme-btn .ti-dark { display: block; }
.menu-btn { display: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; width: 40px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }

/* Buttons and chips */
.btn { height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--text); border-color: var(--accent); }
.btn.primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.small { height: 38px; padding: 0 16px; font-size: 14px; }
.chip { min-height: 34px; padding: 6px 14px; display: inline-flex; align-items: center; border-radius: 17px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tile { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.tile.plain { padding: 0 14px; font-weight: 600; }
.mono { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #FFFFFF; box-shadow: inset 0 0 0 1px #E1DFD9; flex: none; }
.mono img { width: 17px; height: 17px; display: block; }

/* Code */
.code { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--code-bg); color: var(--code-text); font: 13.5px/1.6 ui-monospace, Consolas, monospace; }
.code > code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; }
.copy { flex: none; border: 0; background: var(--code-btn); color: var(--code-text); border-radius: 5px; height: 26px; padding: 0 10px; font: 12px Inter, sans-serif; cursor: pointer; }
.copy:hover { filter: brightness(1.3); }

/* Footer */
.foot { padding: 48px 0; background: var(--night); color: #C9CDD2; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.foot a { color: #C9CDD2; }
.foot a:hover { color: #FFFFFF; }
.foot small { display: block; width: 100%; color: #8E949B; font-size: 12.5px; line-height: 1.6; }

@media (max-width: 860px) {
  .topnav { display: none; }
  .topnav.open { display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .topnav.open a { padding: 12px 8px; }
  .menu-btn { display: inline-flex; }
  .top .dl { display: none; }
  .wrap { padding: 0 16px; }
}
