/* ds-app.css — the v3.7 surface stylesheet.
 *
 * Two jobs, kept in one file on purpose: the documentation shell under
 * /deckspace/docs/, and (further down) the live app-model scenes on the
 * marketing pages. They share a token set, and splitting them would mean two
 * files that must be kept in visual agreement by hand.
 *
 * ⚠️ THIS SITE HAS NO BUILD STEP AND NO CDN. Assets are served straight from
 * LiteSpeed with `cache-control: public, max-age=604800`, so a returning visitor
 * keeps a stale copy for a WEEK after you change these bytes. When you edit this
 * file, bump the query string on every <link> that loads it (?v=2, ?v=3 …). A
 * deploy that is genuinely live and looks like nothing shipped is this, every
 * time.
 *
 * ⚠️ It also does NOT restyle the rest of the site. index.html, the store pages
 * and the older guides each carry their own inline <style> block; only pages
 * that link this file are affected. That is deliberate — see website/README.md.
 */

/* ── tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg: #070b10;
  --panel: #0e141d;
  --panel2: #111927;
  --tx: #e9eef6;
  --muted: #9aa6bd;
  --grn: #1fe0a4;
  --blu: #2f8bff;
  --amb: #f5b544;
  --red: #ff6b6b;
  --line: rgba(154, 166, 189, .16);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--tx); font-family: var(--sans);
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: var(--blu); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── chrome shared with the older guides ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 16, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--tx); }
.brand img { width: 26px; height: 26px; }
.brand small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 2px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 12px;
  font-weight: 700; font-size: 15px; padding: 13px 22px;
  background: linear-gradient(135deg, var(--blu), #2f6fd8); color: #fff; border: none;
  box-shadow: 0 8px 28px rgba(47, 139, 255, .22);
}
.btn:hover { text-decoration: none; }
.btn.alt { background: var(--panel2); border: 1px solid var(--line); color: var(--tx); box-shadow: none; }
.crumbs { font-size: 13px; color: var(--muted); margin: 34px 0 6px; font-family: var(--mono); }
.crumbs a { color: var(--muted); }

/* ── docs layout: sidebar + prose, collapsing to one column ──────────────── */
.docs-wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.docs-grid { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 46px; align-items: start; }
@media (max-width: 900px) { .docs-grid { grid-template-columns: 1fr; gap: 0; } }

.docs-side { position: sticky; top: 84px; padding: 30px 0 60px; font-size: 14px; }
@media (max-width: 900px) {
  .docs-side {
    position: static; padding: 22px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 26px;
  }
}
.docs-side h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-family: var(--mono); font-weight: 600;
  margin: 20px 0 8px;
}
.docs-side h4:first-child { margin-top: 0; }
.docs-side a {
  display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px;
  color: var(--muted); line-height: 1.45;
}
.docs-side a:hover { background: var(--panel); color: var(--tx); text-decoration: none; }
.docs-side a[aria-current="page"] {
  background: var(--panel); color: var(--tx); font-weight: 700;
  box-shadow: inset 2px 0 0 var(--grn);
}

/* Keep the article visible on narrow screens while every section remains
   reachable by keyboard or horizontal scrolling. */
@media (max-width: 900px) {
  .docs-side { display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; padding: 12px 0; margin-bottom: 0; }
  .docs-side h4 { display: none; }
  .docs-side a { flex: 0 0 auto; margin-left: 0; padding: 8px 10px; font-size: 13px; }
}

.docs-main { padding: 30px 0 90px; min-width: 0; max-width: 760px; }
.docs-main h1 {
  font-size: clamp(28px, 4.4vw, 38px); font-weight: 800; letter-spacing: -.02em;
  margin: 8px 0 12px; line-height: 1.14;
}
.docs-main .sub { color: var(--muted); font-size: 17px; margin-bottom: 30px; }
.docs-main h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -.015em;
  margin: 40px 0 12px; scroll-margin-top: 78px;
}
.docs-main h3 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }
.docs-main p, .docs-main li { color: var(--muted); font-size: 15px; }
.docs-main p { margin: 12px 0; }
.docs-main b, .docs-main strong { color: var(--tx); }
.docs-main ul, .docs-main ol { margin: 12px 0 12px 22px; }
.docs-main li { padding: 3px 0; }

code {
  font-family: var(--mono); font-size: 13px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: #cfe4ff;
}
pre {
  background: #05080c; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 14px 0;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #cfd6e4;
}
pre code { background: none; border: none; padding: 0; }
.docs-main :not(pre) > code { overflow-wrap: anywhere; }

/* Wide content must scroll inside its own box, never the page. */
.scroller { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--tx); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); font-weight: 600; }
td { color: var(--muted); }
td b { color: var(--tx); }

/* ── callouts ─────────────────────────────────────────────────────────────
 * .note  neutral aside · .warn  you can lose work · .ok  reassurance
 * Colour is never the only signal — each carries a text label too. */
.callout {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px;
  background: var(--panel); padding: 14px 18px; margin: 18px 0; font-size: 14.5px;
}
.callout p { margin: 6px 0; font-size: 14.5px; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .lbl {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 6px;
}
.callout.note { border-left-color: var(--blu); }
.callout.note .lbl { color: var(--blu); }
.callout.warn { border-left-color: var(--amb); }
.callout.warn .lbl { color: var(--amb); }
.callout.ok { border-left-color: var(--grn); }
.callout.ok .lbl { color: var(--grn); }

/* Platform chips — a claim that is true on one OS and not another must say so. */
.plat { display: inline-flex; gap: 5px; align-items: center; font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--muted); }
.plat.yes { color: var(--grn); border-color: rgba(31, 224, 164, .35); }
.plat.no  { color: var(--muted); opacity: .75; text-decoration: line-through; }

/* ── docs index cards ────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 20px 0; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; color: var(--tx);
}
.card:hover { text-decoration: none; border-color: rgba(47, 139, 255, .4); background: var(--panel2); }
.card b { display: block; font-size: 15px; margin-bottom: 4px; }
.card i { font-style: normal; color: var(--muted); font-size: 13.5px; line-height: 1.5; display: block; }

/* ── next/prev ───────────────────────────────────────────────────────────── */
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; }
.pager a { display: block; }
.pager span { display: block; color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 480px) {
  .topbar .brand { font-size: 18px; }
  .topbar .brand small { display: none; }
  .topbar .btn { font-size: 13px; padding: 10px 12px; }
}

/* Long help-table answers become readable cards on narrow screens. */
@media (max-width: 600px) {
  .docs-main .docs-stacked-table,
  .docs-main .docs-stacked-table tbody,
  .docs-main .docs-stacked-table tr,
  .docs-main .docs-stacked-table td {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .docs-main .docs-stacked-table tr:has(th) { display: none; }
  .docs-main .docs-stacked-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .docs-main .docs-stacked-table td { border: 0; padding: 7px 12px; overflow-wrap: anywhere; }
  .docs-main .docs-stacked-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--tx);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
  }
}
