@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600&family=Roboto+Mono:wght@400;500&display=swap');
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-500.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* docs.magmarouter.com -------------------------------------------------------
   The docs' own stylesheet. Nothing else loads it and the docs load nothing
   else, so a change here cannot move a marketing page and a change there
   cannot move the docs. Served at /docs.css on the docs host.

   Plain on purpose: a sidebar with a short grouped list and one button, one
   narrow column, copyable values as cards, a hairline and Previous / Next at
   the foot. House rules held here: no small uppercase labels anywhere, hover
   changes colour only (nothing lifts or moves), the current page is marked by
   colour and a tint and never by a stripe down its edge, no sheen, and the
   scrollbars are neutral grey. */

:root {
  /* Brand tokens, the same values magmarouter.css carries. */
  --bg: #0b0a0c;
  --ink: #f3f3f5;
  --muted: #9096a0;
  --faint: #6e737b;
  --magma: linear-gradient(96deg, #e10600 0%, #ff4d0a 46%, #ff9a1f 100%);
  --magma-btn: linear-gradient(96deg, #d81f00 0%, #f2610a 100%);
  --magma-btn-hover: linear-gradient(96deg, #e52a05 0%, #ff6d14 100%);
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Manrope, Figtree, 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Docs surfaces. */
  --side: #0e0d10;
  --panel: #121114;
  --hair: rgba(255, 255, 255, .08);
  --body: #a9adb5;
  --hi: #ff8a44;
  --hi-soft: rgba(255, 138, 68, .10);
  --bar: 60px;

  color-scheme: dark;
  scrollbar-color: #3a3940 var(--bg);
}

* { box-sizing: border-box; }
* { font-synthesis: none; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body.docs {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:where(body.docs) a { color: inherit; text-decoration: none; }
body.docs :is(a, button):focus-visible {
  outline: 2px solid rgba(255, 255, 255, .32);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Neutral grey scrollbars wherever something scrolls. */
.docs :is(.ds-nav, .code pre, .tablewrap, .ds-drawer) {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.docs ::-webkit-scrollbar { width: 8px; height: 8px; }
.docs ::-webkit-scrollbar-track { background: transparent; }
.docs ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 999px; }
.docs ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); }

/* Frame ---------------------------------------------------------------------- */

.docs-app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Sidebar. */
.ds {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--hair);
  z-index: 20;
}
.ds-top {
  display: flex; align-items: center; gap: 10px;
  height: var(--bar); flex: none;
  padding: 0 12px 0 18px;
}
.ds-logo { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); font-size: 19px; font-weight: 400; letter-spacing: -0.03em; }
.ds-logo .mark-svg { flex: none; display: block; }
.ds-word { white-space: nowrap; }
.ds-tag { color: var(--faint); font-weight: 400; font-size: 14px; letter-spacing: 0; transform: translateY(1px); }

.ds-collapse, .ds-menu {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; margin-left: auto; padding: 0;
  border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--faint);
  transition: color .15s, background-color .15s;
}
.ds-collapse:hover, .ds-menu:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.ds-menu { display: none; }
.ds-menu .i-close { display: none; }

.ds-drawer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ds-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 20px; }
.ds-group + .ds-group { margin-top: 20px; }
/* A group name is plain muted text in sentence case. Not small capitals. */
.ds-group-h { margin: 0 0 4px; padding: 0 10px; font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--faint); }
.ds-nav a {
  display: block; padding: 6px 10px; border-radius: 8px;
  font-size: 14px; line-height: 1.45; color: var(--muted);
  transition: color .15s, background-color .15s;
}
.ds-nav a:hover { color: var(--ink); }
.ds-nav a { display: flex; align-items: center; gap: 12px; }
.ds-nav a svg { flex: none; opacity: .8; }
.ds-nav a.on { color: var(--hi); background: var(--hi-soft); }

.ds-bottom { flex: none; padding: 14px 16px 18px; border-top: 1px solid var(--hair); }
.ds-site { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 2px 12px; }
.ds-site a { font-size: 13px; color: var(--faint); transition: color .15s; }
.ds-site a:hover { color: var(--ink); }
.ds-cta {
  display: block; padding: 10px 14px; border-radius: 10px;
  background: var(--magma-btn); color: #fff;
  font-size: 14px; font-weight: 500; text-align: center;
}
.ds-cta:hover { background: var(--magma-btn-hover); }

/* Collapsed: the sidebar keeps the mark and the button to open it again. */
@media (min-width: 901px) {
  .docs-collapsed .docs-app { grid-template-columns: 64px minmax(0, 1fr); }
  .docs-collapsed .ds-top { flex-direction: column; justify-content: center; gap: 10px; height: auto; padding: 16px 0; }
  .docs-collapsed .ds-word, .docs-collapsed .ds-tag, .docs-collapsed .ds-drawer { display: none; }
  .docs-collapsed .ds-collapse { margin-left: 0; }
}

/* Column --------------------------------------------------------------------- */

.dm { min-width: 0; padding: 64px 32px 96px; }
.dm-col { max-width: 620px; margin: 0 auto; }

.dm h1 {
  margin: 0 0 14px;
  font: 400 clamp(30px, 3.6vw, 38px)/1.15 var(--sans);
  letter-spacing: -0.025em; color: var(--ink);
  text-wrap: balance;
}
.dm-lede { margin: 0 0 32px; font-size: 17px; line-height: 1.6; color: var(--muted); }

.dm section { margin-top: 44px; }
.dm h2 { margin: 0 0 12px; font: 400 22px/1.3 var(--sans); letter-spacing: -0.015em; color: var(--ink); }
.dm h3 { margin: 26px 0 8px; font: 500 16px/1.4 var(--sans); color: var(--ink); }
.dm p, .dm ul, .dm ol { margin: 0 0 16px; font-size: 15.5px; line-height: 1.75; color: var(--body); }
.dm ul, .dm ol { padding-left: 22px; }
.dm li { margin-bottom: 8px; padding-left: 2px; }
.dm li::marker { color: var(--faint); }
.dm strong { color: var(--ink); font-weight: 600; }
.dm em { font-style: italic; }

.dm-col p a, .dm-col li a, .dm-col td a, .callout a {
  color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: rgba(255, 138, 68, .55); text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.dm-col p a:hover, .dm-col li a:hover, .dm-col td a:hover, .callout a:hover { color: var(--hi); text-decoration-color: var(--hi); }

.dm :not(pre) > code {
  padding: .12em .42em; border-radius: 6px;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .05);
  font: 400 .86em/1.4 var(--mono); color: #e6e8ec;
  overflow-wrap: anywhere;
}

.doc-step { margin: 0 0 26px; }
.doc-step > h3 { margin-top: 0; }
.doc-step > :last-child { margin-bottom: 0; }

/* Value cards: a label in plain small text, the value, a copy button. */
.vals { display: grid; gap: 10px; margin: 0 0 8px; }
.val {
  position: relative;
  padding: 12px 56px 12px 16px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 12px;
}
.val-l { display: block; margin-bottom: 3px; font-size: 13px; line-height: 1.4; color: var(--faint); }
.dm .val-v {
  display: block; padding: 0; border: 0; background: none;
  font: 400 14px/1.5 var(--mono); color: var(--ink);
  overflow-wrap: anywhere;
}

.copy {
  position: absolute; top: 50%; right: 10px; margin-top: -16px;
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--hair); border-radius: 8px; cursor: pointer;
  background: var(--panel); color: var(--muted);
  transition: color .15s, background-color .15s;
}
.copy:hover { color: var(--ink); background: #1b1a1f; }
.copy .i-done { display: none; }
.copy.done { color: var(--hi); }
.copy.done .i-copy { display: none; }
.copy.done .i-done { display: block; }

/* Code. The block scrolls inside itself; the page never does. */
.code {
  position: relative;
  margin: 16px 0 22px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 12px;
}
/* The scrolling area stops short of the copy button, so text never slides
   under it. */
.code pre {
  margin: 0 50px 0 0; padding: 16px 8px 16px 18px;
  overflow-x: auto; white-space: pre;
  font: 400 13px/1.75 var(--mono); color: #e4e6ea;
}
.code pre code { font: inherit; }
.code .c { color: #717171; }
.code .s { color: #8ed4a6; }
.code .k { color: #f5b98a; }
.code .kw { color: #ff7a45; }
.code .n { color: #c9a7ff; }
.code .copy { top: 10px; margin-top: 0; }

/* Callouts: a tinted box with a hairline all the way round. */
.callout {
  margin: 20px 0 22px; padding: 14px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--hair);
  font-size: 15px; line-height: 1.7; color: var(--body);
}
.callout strong { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 500; }

/* Tables scroll inside their own box. */
.tablewrap { margin: 16px 0 22px; overflow-x: auto; border: 1px solid var(--hair); border-radius: 12px; }
.tablewrap table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.tablewrap th {
  padding: 10px 14px; text-align: left; white-space: nowrap;
  background: rgba(255, 255, 255, .025); border-bottom: 1px solid var(--hair);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.tablewrap td { padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--hair); color: var(--body); line-height: 1.6; }
.tablewrap td.mono { color: var(--ink); font: 400 12.5px/1.6 var(--mono); white-space: nowrap; }
.tablewrap tbody tr:last-child td { border-bottom: 0; }

/* The index. */
.dm-start { color: var(--ink); font-size: 15.5px; transition: color .15s; }
.dm-start span { color: var(--hi); }
.dm-start:hover { color: var(--hi); }
.idx-list { list-style: none; margin: 0; padding: 0 !important; }
.idx-list li { margin: 0 0 14px; padding: 0; }
.idx-list li a { color: var(--ink); font-size: 15.5px; font-weight: 500; text-decoration: none; transition: color .15s; }
.dm-col p a.dm-start { text-decoration: none; }
.idx-list li a:hover { color: var(--hi); }
.idx-list li p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* Previous and next: a hairline, then two plain links. */
.pg {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px;
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--hair);
}
.pg a { font-size: 15px; line-height: 1.45; color: var(--ink); transition: color .15s; }
.pg a:hover { color: var(--hi); }
.pg-k { color: var(--faint); }
.pg-next { margin-left: auto; text-align: right; }

/* Phone ---------------------------------------------------------------------- */

@media (max-width: 900px) {
  .docs-app { display: block; }
  .ds {
    position: sticky; top: 0; height: auto;
    border-right: 0; border-bottom: 1px solid var(--hair);
    /* Solid, not blurred: a backdrop-filter here would become the containing
       block of the fixed drawer and squash it into the bar. */
    background: var(--side);
  }
  .ds-top { height: 56px; padding: 0 8px 0 16px; }
  .ds-collapse { display: none; }
  .ds-menu { display: grid; }
  .ds-drawer { display: none; }

  .docs-nav-open body { overflow: hidden; }
  .docs-nav-open .ds-drawer {
    display: flex;
    position: fixed; top: 57px; left: 0; right: 0; bottom: 0;
    background: var(--side);
    overflow-y: auto;
  }
  .docs-nav-open .ds-nav { flex: none; overflow: visible; padding: 10px 8px 20px; }
  .docs-nav-open .ds-menu .i-open { display: none; }
  .docs-nav-open .ds-menu .i-close { display: block; }

  .dm { padding: 32px 16px 72px; }
  .dm h1 { font-size: 30px; }
  .dm-lede { font-size: 16px; margin-bottom: 26px; }
  .dm section { margin-top: 36px; }
  .code pre { padding: 14px 6px 14px 14px; font-size: 12.5px; }
}

@media (max-width: 520px) {
  .pg { flex-direction: column; align-items: stretch; }
  .pg > span:empty { display: none; }
  .pg-next { margin-left: 0; text-align: left; }
}

/* Same grey as the chat and the dashboard, so moving between them does not change the room.
   The sidebar is the dashboard rail: #1a191c, neutral rows, the current page a lighter grey
   rather than orange. */
:root {
  --bg: #222125;
  --side: #1a191c;
  --panel: #2b2a2e;
  --hair: #38363c;
  scrollbar-color: #4a4850 var(--bg);
}
.ds-nav a { color: #d9d8dc; font-size: 14.5px; }
.ds-nav a:hover { color: var(--ink); background: #232226; }
.ds-nav a.on { color: var(--ink); background: #2a292d; }
.copy:hover { background: #333236; }

/* Get Started on the overview: the dashboard's key bar and copy tiles, in the docs' own tokens. */
.gs { margin: 28px 0 8px; }
.gs .lbl { display: block; margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.keybar { display: flex; gap: 12px; align-items: stretch; }
.keyfield { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; min-height: 48px; border: 1px solid var(--hair); border-radius: 10px; background: var(--panel); }
.keyfield code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 14.5px var(--mono); color: var(--ink); background: none; padding: 0; border: 0; }
.keyfield code.none { color: var(--muted); font-family: var(--sans); }
.keyfield code:not(.none) { cursor: pointer; }
.keyfield .copy { position: static; flex: none; }
.gs-btn { flex: none; display: inline-flex; align-items: center; padding: 0 18px; min-height: 48px; border-radius: 10px; background: #333236; color: var(--ink); font-size: 14.5px; text-decoration: none; transition: background-color .15s; }
.gs-btn:hover { background: #3a383e; text-decoration: none; }
.keynote { margin: 10px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.gs-sec { margin-top: 36px; }
.gs-sec h2 { margin: 0 0 6px; }
.gs-sec > p { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.gs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gs-tile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px 14px 18px; border: 0; border-radius: 10px; background: var(--panel); color: var(--ink); font: 400 15px var(--sans); text-align: left; cursor: pointer; transition: background-color .15s; }
.gs-tile:hover { background: #333236; }
.gs-ic { flex: none; width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--side); overflow: hidden; }
.gs-ic img { width: 24px; height: 24px; object-fit: contain; filter: grayscale(1); }
.gs-ic img[data-logo="claude-code"] { filter: brightness(0) invert(1); }
.gs-ic img[data-logo="openclaw"] { filter: grayscale(1) brightness(2.6); }
.gs-ic svg { width: 22px; height: 22px; color: #d9d8dc; }
.gs-tx { flex: 1; min-width: 0; line-height: 1.3; }
.gs-tx b { display: block; font-weight: 500; }
.gs-tx span { font-size: 14px; color: var(--muted); }
.gs-cp { flex: none; width: 16px; height: 16px; color: var(--muted); }
.gs-tile.done .gs-tx span { color: var(--ink); }
.gs-after { margin-top: 44px; }
@media (max-width: 900px) { .gs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .gs-grid { grid-template-columns: minmax(0, 1fr); }
  .keybar { flex-wrap: wrap; }
  .keyfield { flex: 1 1 100%; }
  .gs-btn { flex: 1; justify-content: center; }
}
.keyfield .copy { margin-top: 0; }
/* The overview carries the tiles, so it gets the dashboard's width rather than a reading column. */
.dm-col:has(#gs) { max-width: 880px; }

/* Title row and "Copy page". The control wears the copy button's skin (panel,
   hairline, muted ink that brightens on hover) and only changes colour. */
.dm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 14px; }
.dm-head h1 { flex: 1 1 auto; min-width: 0; margin: 0; }
.cp { position: relative; flex: none; display: flex; margin-top: 6px; }
.cp > button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px; margin: 0;
  border: 1px solid var(--hair); background: var(--panel); color: var(--muted);
  font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.cp > button:hover, .cp.open .cp-more { color: var(--ink); background: #333236; }
.cp > .cp-main { border-radius: 8px 0 0 8px; }
.cp > .cp-more { border-left: 0; border-radius: 0 8px 8px 0; padding: 0 8px; }
.cp .i-done { display: none; }
.cp.done .cp-main { color: var(--hi); }
.cp.done .cp-main .i-copy { display: none; }
.cp.done .cp-main .i-done { display: block; }
.cp-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  min-width: 248px; padding: 5px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.cp.open .cp-menu { display: block; }
.cp-menu button {
  display: block; width: 100%; padding: 8px 10px; margin: 0;
  border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer;
  font: 400 13.5px/1.35 var(--sans); color: var(--ink);
  transition: background-color .15s;
}
.cp-menu button:hover { background: #333236; }
.cp-t { display: block; }
.cp-d { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 520px) {
  .dm-head { flex-direction: column; gap: 0; }
  .cp { order: -1; margin: 0 0 14px; }
  .cp-menu { right: auto; left: 0; }
}

/* Pages swap in place (nav.js). One that takes a moment dims a little, after a
   short wait so a quick swap shows nothing at all. */
.dm-col { transition: opacity .12s ease; }
.docs-loading .dm-col { opacity: .55; transition-delay: .18s; }
.dm h1[tabindex="-1"]:focus { outline: none; }

/* The bar across the top of every docs page. */
.dh { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.dh-logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; font-family: var(--sans); font-size: 16px; font-weight: 500; }
.dh-logo svg { flex: none; width: 26px; height: 26px; }
.dh-word { color: var(--ink); }
.dh-tag { color: var(--muted); font-weight: 400; }
.dh-chat { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--magma); color: #fff; font-family: var(--sans); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.dh-chat:hover { filter: brightness(1.08); color: #fff; text-decoration: none; }
