/*
 * The reading pages: /docs, /privacy, /terms.
 *
 * All three used to carry a copy of the same near-black page inline -- teal and
 * blue gradients, Inter from Google Fonts, `--violet` variables holding greens
 * -- with a light override layered on top. The shared header and footer above
 * and below them had already moved to the site's own brand, so every one of
 * these pages was two designs stacked: the product's green lockup, and then a
 * body from a palette the product does not use.
 *
 * This is one sheet, on the brand: Roboto (already self-hosted by the shell),
 * the green the site header sets the name in, mint surfaces, ink on white. It
 * follows the theme rather than forcing a mode, because the toggle in the header
 * is right there and did nothing on these pages before.
 *
 * Tokens are namespaced --dl-* and scoped to .doc-page rather than :root, so
 * page-base.css (still serving the manny pages) and this file cannot fight over
 * a variable name.
 */

.doc-page {
  --dl-ink: #0d1526;
  --dl-ink-2: #16233a;
  --dl-copy: #41506b;
  --dl-muted: #5c6b83;
  --dl-green: #0a8a45;
  --dl-green-lit: #0aa05f;
  --dl-green-deep: #037a3f;
  --dl-mint: #e9f7f0;
  --dl-mint-soft: #f1faf5;
  --dl-mint-line: #e2f0e9;
  --dl-line: #e8eef1;
  --dl-line-soft: #eef3f5;
  --dl-surface: #ffffff;
  --dl-page: #fbfdfd;
  --dl-code-bg: #f4f8f6;
  --dl-shadow: 0 10px 30px -18px rgba(15, 50, 40, .28);
  --dl-shadow-lift: 0 18px 44px -22px rgba(15, 50, 40, .34);
  --dl-radius: 18px;

  background: var(--dl-page);
  color: var(--dl-copy);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.7;
}

html[data-theme="dark"] .doc-page {
  --dl-ink: #f4f7f5;
  --dl-ink-2: #e5ede9;
  --dl-copy: #b1c0b9;
  --dl-muted: #8fa198;
  --dl-green: #3add91;
  --dl-green-lit: #45e39a;
  --dl-green-deep: #62e3a5;
  --dl-mint: #153329;
  --dl-mint-soft: #10271f;
  --dl-mint-line: #234438;
  --dl-line: #263a31;
  --dl-line-soft: #1d3028;
  --dl-surface: #101e18;
  --dl-page: #07110d;
  --dl-code-bg: #0e2019;
  --dl-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6);
  --dl-shadow-lift: 0 18px 44px -22px rgba(0, 0, 0, .7);
}

/*
 * The page owns its own ground, and the root behind it: the tokens live on the
 * body, so a var() read at the html level resolves to nothing and leaves a white
 * band under a dark page wherever the body does not reach -- overscroll, or a
 * page shorter than the viewport.
 */
.doc-page { min-height: 100vh; }
html:has(.doc-page) { background: #fbfdfd; }
html[data-theme="dark"]:has(.doc-page) { background: #07110d; }

.doc-page * { box-sizing: border-box; }
.doc-page main:focus { outline: none; }
.doc-page .wrap { width: min(100% - 40px, 940px); margin-inline: auto; }
.doc-page .wrap.wide { width: min(100% - 40px, 1240px); }

.doc-page a { color: var(--dl-green-deep); text-decoration: none; }
.doc-page a:hover { text-decoration: underline; }
.doc-page ::selection { background: var(--dl-mint); color: var(--dl-ink); }

.doc-page .skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--dl-ink);
  color: var(--dl-surface);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform .16s ease;
}
.doc-page .skip-link:focus { transform: translateY(0); text-decoration: none; }

/* ── Page head ────────────────────────────────────────────────────────────
   Left-aligned, no glow behind it: the pill, the title, and one line saying
   what the page is. */
.doc-page .pagehead { padding: 56px 0 34px; background: var(--dl-page); }
.doc-page .pagehead .wrap { display: flex; flex-direction: column; }
.doc-page .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 7px 13px;
  border: 1px solid var(--dl-mint-line);
  border-radius: 999px;
  background: var(--dl-mint);
  color: var(--dl-green-deep);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.doc-page .pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc-page .pagehead h1 {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--dl-ink);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.08;
}
/* The name's second half, in the green the header sets it in -- flat colour,
   not a gradient clipped to text, which is what the old pages did and what
   Windows high-contrast mode renders as an empty box. */
.doc-page .pagehead h1 .g { color: var(--dl-green); }
.doc-page .updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 16px;
  color: var(--dl-muted);
  font-size: 14px;
}
.doc-page .updated::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dl-green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dl-green) 14%, transparent);
}

/* ── The document ─────────────────────────────────────────────────────── */
.doc-page main { padding-bottom: 84px; }
.doc-page .doc {
  padding: 40px 44px 44px;
  border: 1px solid var(--dl-line);
  border-radius: var(--dl-radius);
  background: var(--dl-surface);
  box-shadow: var(--dl-shadow);
}
.doc-page .doc > .lead {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--dl-mint-line);
  border-left: 3px solid var(--dl-green);
  border-radius: 12px;
  background: var(--dl-mint-soft);
  color: var(--dl-ink-2);
  font-size: 16.5px;
  line-height: 1.65;
}
.doc-page .doc h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 38px 0 12px;
  color: var(--dl-ink);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  scroll-margin-top: 96px;
}
.doc-page .doc h2:first-of-type { margin-top: 8px; }
/* The section number on the legal pages, as a chip rather than a run-in. */
.doc-page .doc h2 .n {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--dl-mint);
  color: var(--dl-green-deep);
  font-size: 11.5px;
  font-weight: 700;
}
.doc-page .doc h3 {
  margin: 28px 0 10px;
  color: var(--dl-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  scroll-margin-top: 96px;
}
.doc-page .doc p,
.doc-page .doc li { color: var(--dl-copy); font-size: 15.5px; }
.doc-page .doc p { margin: 0 0 14px; }
.doc-page .doc ul,
.doc-page .doc ol { margin: 0 0 16px; padding-left: 22px; }
.doc-page .doc li { margin-bottom: 8px; }
.doc-page .doc li::marker { color: var(--dl-green); }
.doc-page .doc strong { color: var(--dl-ink); font-weight: 600; }
.doc-page .doc hr { margin: 30px 0; border: 0; border-top: 1px solid var(--dl-line); }
.doc-page .doc code {
  padding: 2px 6px;
  border: 1px solid var(--dl-line);
  border-radius: 6px;
  background: var(--dl-code-bg);
  color: var(--dl-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
}

/* ── The legal pages' section index ─────────────────────────────────────
   Every section was numbered on screen and unaddressable. These are anchors,
   in a two-column list, so "see clause 7" can actually be linked. */
.doc-page .doc-index {
  margin: 0 0 30px;
  padding: 18px 20px 14px;
  border: 1px solid var(--dl-line);
  border-radius: 14px;
  background: var(--dl-mint-soft);
}
.doc-page .doc-index b {
  display: block;
  margin-bottom: 10px;
  color: var(--dl-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.doc-page .doc-index ol {
  columns: 2;
  column-gap: 26px;
  margin: 0;
  padding-left: 20px;
}
.doc-page .doc-index li { margin-bottom: 6px; break-inside: avoid; }
.doc-page .doc-index li::marker { color: var(--dl-muted); font-size: 12px; }
.doc-page .doc-index a { color: var(--dl-copy); font-size: 14.5px; }
.doc-page .doc-index a:hover { color: var(--dl-green-deep); }

.doc-page .doc-related { margin: 0; color: var(--dl-muted); font-size: 14.5px; }

@media (max-width: 640px) {
  .doc-page .doc-index ol { columns: 1; }
}
/* ── Docs layout: sidebar and article ─────────────────────────────────── */
.doc-page .docs-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 34px; align-items: start; }
.doc-page .docs-sidebar { position: sticky; top: 88px; }
.doc-page .sidebar-nav { display: flex; flex-direction: column; gap: 20px; padding: 18px; border: 1px solid var(--dl-line); border-radius: 14px; background: var(--dl-surface); }
.doc-page .side-group { display: flex; flex-direction: column; gap: 2px; }
.doc-page .side-group b {
  margin-bottom: 6px;
  color: var(--dl-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.doc-page .side-group a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--dl-copy);
  font-size: 14px;
  line-height: 1.4;
}
.doc-page .side-group a:hover { background: var(--dl-mint-soft); color: var(--dl-ink); text-decoration: none; }
.doc-page .side-group a.active {
  background: var(--dl-mint);
  color: var(--dl-green-deep);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--dl-green);
}

.doc-page .mobile-toc { display: none; margin: 0 0 24px; border: 1px solid var(--dl-line); border-radius: 12px; background: var(--dl-mint-soft); }
.doc-page .mobile-toc summary { padding: 13px 16px; color: var(--dl-ink); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.doc-page .mobile-toc[open] summary { border-bottom: 1px solid var(--dl-mint-line); }
.doc-page .mobile-toc-links { display: flex; flex-direction: column; padding: 8px; }
.doc-page .mobile-toc-links a { padding: 8px 10px; border-radius: 8px; color: var(--dl-copy); font-size: 14px; }
.doc-page .mobile-toc-links a:hover { background: var(--dl-mint); text-decoration: none; }

/* ── The copyable server URL ──────────────────────────────────────────── */
.doc-page .snippet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--dl-line);
  border-radius: 11px;
  background: var(--dl-code-bg);
}
.doc-page .snippet code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dl-ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.doc-page .copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--dl-mint-line);
  border-radius: 9px;
  background: var(--dl-surface);
  color: var(--dl-green-deep);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.doc-page .copy-btn:hover { background: var(--dl-mint); }
.doc-page .copy-btn.copied { border-color: var(--dl-green); background: var(--dl-mint); }
.doc-page .copy-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Example prompts ──────────────────────────────────────────────────── */
.doc-page .prompts { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0 22px; }
.doc-page .prompts span {
  padding: 9px 14px;
  border: 1px solid var(--dl-mint-line);
  border-radius: 999px;
  background: var(--dl-mint-soft);
  color: var(--dl-ink-2);
  font-size: 14px;
}

/* ── Tool tables ──────────────────────────────────────────────────────── */
.doc-page .legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 20px; }
.doc-page .legend > span { display: inline-flex; align-items: center; gap: 8px; color: var(--dl-muted); font-size: 13px; }

.doc-page .tools-wrap { margin: 12px 0 26px; border: 1px solid var(--dl-line); border-radius: 14px; overflow-x: auto; }
.doc-page table.tools { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc-page table.tools th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--dl-line);
  background: var(--dl-mint-soft);
  color: var(--dl-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-align: left;
}
.doc-page table.tools td { padding: 12px 16px; border-bottom: 1px solid var(--dl-line-soft); color: var(--dl-copy); vertical-align: top; }
.doc-page table.tools tr:last-child td { border-bottom: 0; }
.doc-page table.tools td:first-child { white-space: nowrap; }
.doc-page table.tools code { font-size: 13px; }

.doc-page .badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  vertical-align: 1px;
}
/* Read-only, write, destructive: the one place this page needs three tones,
   and the only place it uses a colour that is not the brand's green. */
.doc-page .badge.ro { border: 1px solid var(--dl-mint-line); background: var(--dl-mint); color: var(--dl-green-deep); }
.doc-page .badge.wr { border: 1px solid #ffe2b8; background: #fff6e8; color: #9a5b00; }
.doc-page .badge.de { border: 1px solid #f6d6d2; background: #fdf1f0; color: #a4291f; }
html[data-theme="dark"] .doc-page .badge.wr { border-color: #4b3410; background: #241a08; color: #f0b45f; }
html[data-theme="dark"] .doc-page .badge.de { border-color: #4d2320; background: #2a1413; color: #f0918a; }

/* ── Format conventions ───────────────────────────────────────────────── */
.doc-page .formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px; margin: 14px 0 26px; }
.doc-page .formats .f {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 16px;
  border: 1px solid var(--dl-line);
  border-radius: 12px;
  background: var(--dl-surface);
}
.doc-page .formats .f b { color: var(--dl-ink); font-size: 14px; }
.doc-page .formats .f span { color: var(--dl-copy); font-size: 13.5px; line-height: 1.55; }

/* ── Cards, where a page uses them ───────────────────────────────────── */
.doc-page .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 30px; }
.doc-page .card {
  padding: 20px;
  border: 1px solid var(--dl-line);
  border-radius: 14px;
  background: var(--dl-surface);
  box-shadow: var(--dl-shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.doc-page .card:hover { transform: translateY(-3px); border-color: var(--dl-mint-line); }
.doc-page .card .ci {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 13px;
  border: 1px solid var(--dl-mint-line);
  border-radius: 11px;
  background: var(--dl-mint);
  color: var(--dl-green-deep);
}
.doc-page .card .ci svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.doc-page .card h3 { margin: 0 0 6px; }
.doc-page .card p { margin: 0; font-size: 14px; line-height: 1.6; }

/* ── Troubleshooting ─────────────────────────────────────────────────── */
.doc-page .faq { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 8px; }
.doc-page .faq details { border: 1px solid var(--dl-line); border-radius: 12px; background: var(--dl-surface); overflow: hidden; }
.doc-page .faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  color: var(--dl-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.doc-page .faq summary::-webkit-details-marker { display: none; }
.doc-page .faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--dl-green);
  border-bottom: 2px solid var(--dl-green);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
.doc-page .faq details[open] summary { border-bottom: 1px solid var(--dl-line-soft); }
.doc-page .faq details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.doc-page .faq details > p { margin: 0; padding: 14px 17px 16px; font-size: 14.5px; }
.doc-page .faq summary:hover { background: var(--dl-mint-soft); }

/* ── Narrower ────────────────────────────────────────────────────────── */
@media (max-width: 1040px) {
  .doc-page .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-page .docs-sidebar { display: none; }
  .doc-page .mobile-toc { display: block; }
}

@media (max-width: 640px) {
  .doc-page .wrap,
  .doc-page .wrap.wide { width: min(100% - 24px, 940px); }
  .doc-page .pagehead { padding: 36px 0 24px; }
  .doc-page .doc { padding: 26px 18px 30px; border-radius: 14px; }
  .doc-page .doc > .lead { padding: 15px 16px; font-size: 15.5px; }
  .doc-page .doc h2 { margin-top: 30px; font-size: 20px; }
  .doc-page .doc h2 .n { width: 26px; height: 26px; border-radius: 8px; }
  .doc-page .snippet { flex-direction: column; align-items: stretch; }
  .doc-page .copy-btn { justify-content: center; min-height: 42px; }
  .doc-page table.tools td:first-child { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-page .card,
  .doc-page .copy-btn,
  .doc-page .faq summary::after { transition: none; }
  .doc-page .card:hover { transform: none; }
}
