/* ROYAL Ai API — the developer portal (2026-11-03). No frameworks, nothing
   loaded from anywhere but this host: the page's CSP allows only 'self'. The
   one font is the family's Montserrat, served from /client/fonts (2026-11-08). */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/client/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* The family tokens (2026-11-08): navy #253069, gold #CBA260 with its hover
   #b8914f, navy on gold, and the darker gold-ink for small gold text on white. */
:root {
  --navy: #253069; --navy-2: #171f49; --gold: #cba260; --gold-2: #b8914f; --gold-ink: #7a5e2a;
  --bg: #ffffff; --bg-2: #f6f7f9; --ink: #1b2430; --muted: #5b6675; --line: #e3e6ea;
  --code-bg: #0f1722; --code-ink: #e6edf3; --ok: #1f8a4c; --warn: #b7791f; --bad: #b42318;
  --link: #253069; --radius: 12px; --shadow: 0 10px 30px rgba(37, 48, 105, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-2: #111a2b; --ink: #e6edf3; --muted: #9aa6b2; --line: #22304a;
    --code-bg: #060b14; --link: #cba260; --gold-ink: #cba260; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-2: #111a2b; --ink: #e6edf3; --muted: #9aa6b2; --line: #22304a;
  --code-bg: #060b14; --link: #cba260; --gold-ink: #cba260; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Montserrat", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
/* Nothing is wider than the viewport except inside its own scrolling box
   (2026-11-08): images shrink, long inline code may break, and every grid
   track that holds code is minmax(0, …) with min-width: 0 on its children. */
img { max-width: 100%; height: auto; }
a { color: var(--link); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--navy); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 50; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .92em; overflow-wrap: anywhere; }
pre { background: var(--code-bg); color: var(--code-ink); padding: 14px 16px; border-radius: 10px; overflow-x: auto; max-width: 100%; font-size: 13.5px; line-height: 1.5; margin: 10px 0; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; margin: 8px 0 14px; letter-spacing: -.5px; }
h1 em { font-style: normal; color: var(--gold); }
h2 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.3px; }
h3 { font-size: 18px; margin: 22px 0 8px; }
section.wrap { padding: 56px 16px 8px; }
.sub { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.note { border-left: 4px solid var(--gold); background: var(--bg-2); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 16px 0; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.bar { display: flex; align-items: center; gap: 18px; height: 60px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .3px; white-space: nowrap; min-width: 0; }
.brand .face { border-radius: 50%; background: #fff; flex: none; }
/* The family lockup (2026-11-08), navy letters and the gold Ai, on a white
   plate so it reads on the navy bar the way the ROVER face does. */
.brand .lockup { width: 150px; height: auto; flex: none; background: #fff; padding: 5px 9px; border-radius: 8px; box-sizing: content-box; }
.brand .api { color: var(--gold); font-size: 14px; letter-spacing: 1.2px; }
.links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; min-width: 0; }
.links a { color: #c9d3e0; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.links + .tools { margin-left: 0; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #c9d3e0; white-space: nowrap; max-width: 36vw; overflow: hidden; text-overflow: ellipsis; }
.pill.ok { background: rgba(31,138,76,.25); color: #bdf0d0; } .pill.bad { background: rgba(180,35,24,.3); color: #ffd1cc; }
.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }

/* hero */
.hero { background: linear-gradient(180deg, var(--navy) 0, var(--navy-2) 100%); color: #fff; padding: 56px 0 24px; border-bottom: 1px solid var(--line); }
.hero .two { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 36px; align-items: start; }
.hero .two > * { min-width: 0; }
.eyebrow { color: var(--gold); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; font-size: 12px; margin: 0; }
.lead { font-size: 18px; color: #d9e1ec; max-width: 560px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; font-weight: 600; background: transparent; cursor: pointer; font: inherit; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn:disabled { opacity: .6; cursor: wait; }
main .btn:not(.gold) { color: var(--ink); border-color: var(--line); }
.hero .btn:not(.gold) { color: #fff; border-color: rgba(255,255,255,.35); }
.facts { list-style: none; padding: 0; margin: 10px 0 16px; color: #c9d3e0; font-size: 15px; }
.facts li { margin: 6px 0; padding-left: 18px; position: relative; }
.facts li::before { content: "◆"; color: var(--gold); position: absolute; left: 0; font-size: 10px; top: 7px; }
.facts b { color: #fff; }
.card { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.ask { margin-bottom: 8px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head img { border-radius: 50%; }
.card-head span { display: block; color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type=text], select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ask .row input { flex: 1; min-width: 0; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; resize: vertical; }
.answer { min-height: 96px; margin-top: 12px; white-space: pre-wrap; line-height: 1.55; }
.rail { color: var(--muted); font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.how { margin-top: 10px; font-size: 13px; } .how summary { cursor: pointer; color: var(--muted); }
.how pre { font-size: 12.5px; }

/* the overlay test */
.ov-form { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, .9fr) auto; gap: 10px; align-items: end; }
.ov-form > * { min-width: 0; }
.ov-field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; }
.ov-more { margin: 10px 0 0; }
.ov-more .btn { font-size: 14px; padding: 7px 12px; }
.ov-out { margin-top: 16px; }
.ov-books { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ov-book { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--bg-2); min-width: 0; }
.ov-book.ok { border-left-color: var(--ok); } .ov-book.bad { border-left-color: var(--bad); }
.ov-book-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ov-book-head b { font-size: 18px; }
.badge { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.ov-book.ok .badge { color: var(--ok); border-color: var(--ok); } .ov-book.bad .badge { color: var(--bad); border-color: var(--bad); }
.ov-income { font-size: 22px; font-weight: 700; margin: 8px 0 4px; }
.ov-income .muted { font-size: 14px; font-weight: 400; }
.ov-why { margin: 8px 0 2px; font-size: 14.5px; }
.ov-cite { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.ov-lenders { margin-top: 16px; }
.ov-lenders > p { margin: 6px 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.clear { color: var(--ok); border-color: var(--ok); } .chip.conflict { color: var(--bad); border-color: var(--bad); }

/* build grid */
.grid { display: grid; gap: 14px; list-style: none; padding: 0; margin: 0; }
.grid > * { min-width: 0; }
.grid.nine { grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: n; }
.grid.nine li { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px 16px; position: relative; }
.grid.nine li::before { counter-increment: n; content: counter(n); position: absolute; right: 12px; top: 10px; color: var(--gold); font-weight: 800; font-size: 22px; opacity: .7; }
.grid.nine b { display: block; margin-bottom: 4px; padding-right: 26px; }
.grid.nine span { color: var(--muted); font-size: 14.5px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.three .card p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

/* quickstart */
.steps { display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.step > * { min-width: 0; }
.step .n { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 800; display: grid; place-items: center; }
.tabs { margin-top: 8px; }
.tablist { display: flex; gap: 4px; }
.tablist button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: 0; background: var(--bg-2); color: var(--muted); cursor: pointer; }
.tablist button[aria-selected="true"] { background: var(--code-bg); color: var(--code-ink); border-color: var(--code-bg); }
.tabs pre { margin-top: 0; border-top-left-radius: 0; }

/* console */
.console { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pane { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.pane label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 4px; }
.pane label:first-child { margin-top: 0; }
.pane .row { margin-top: 12px; }
.pane.out { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; }
.pane.out > * { min-width: 0; }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); } .status.bad { color: var(--bad); }
.resp { margin: 0; max-height: 420px; overflow: auto; } .curl { margin: 0; font-size: 12px; color: #a9b7c6; }

/* reference */
.op { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; background: var(--bg); overflow: hidden; }
.op summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; flex-wrap: wrap; }
.op summary::-webkit-details-marker { display: none; }
.op[open] summary { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.method { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; color: #fff; min-width: 58px; text-align: center; }
.method.get { background: #1f6feb; } .method.post { background: #1f8a4c; } .method.patch { background: #b7791f; } .method.delete { background: #b42318; }
.path { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }
.sum { color: var(--muted); font-size: 14px; }
.scope { margin-left: auto; font-size: 12px; color: var(--gold-ink); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.op .body { padding: 12px 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.op .body > * { min-width: 0; }
.op .body h4 { margin: 8px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.op .desc { grid-column: 1 / -1; margin: 0; }
.op ul { margin: 4px 0; padding-left: 18px; font-size: 14.5px; }
.tag-head { margin: 26px 0 4px; font-size: 20px; }
.tag-head small { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 8px; }

/* webhooks + tables */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.two > * { min-width: 0; }
.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
td, th { border-top: 1px solid var(--line); padding: 8px 6px; vertical-align: top; text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-top: 0; }
.codes td:first-child { font-weight: 700; width: 56px; }
.plain { padding-left: 18px; } .plain li { margin: 6px 0; }
.status-card { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.status-card .kv b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.bad { background: var(--bad); }
.foot { padding: 40px 16px 56px; border-top: 1px solid var(--line); margin-top: 48px; font-size: 14px; }
/* The family legal block (2026-11-08). */
.foot .legal { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.foot .legal + .legal { margin-top: 6px; }

@media (max-width: 860px) {
  .hero .two, .two, .console, .op .body, .ov-books { grid-template-columns: minmax(0, 1fr); }
  .ov-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.nine, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .links { display: none; }
  .hero { padding-top: 36px; }
  section.wrap { padding-top: 40px; }
}
/* A phone: the bar keeps the face, the lockup and the pill, smaller. */
@media (max-width: 480px) {
  .bar { gap: 10px; }
  .brand { gap: 8px; }
  .brand .face { width: 28px; height: 28px; }
  .brand .lockup { width: 110px; padding: 4px 7px; }
  .brand .api { display: none; }
}
