/* The ROUTIX Help Center (W5-DOC1). The app's dark look, its fonts and its tokens (client/src/index.css :root):
   background #0A0A0A, text at 92 / 58 / 32 % white, hairlines at 6–10 % white, radii 8–16 px, Inter for reading,
   Space Grotesk for headings, JetBrains Mono for code. One column on a phone; nothing is wider than the screen. */
:root {
  --bg: #0a0a0a;
  --surface-1: rgba(16, 16, 16, 0.85);
  --surface-2: rgba(22, 22, 22, 0.7);
  --surface-3: rgba(30, 30, 30, 0.55);
  --text: rgba(255, 255, 255, 0.92);
  --text-2: rgba(255, 255, 255, 0.58);
  --text-3: rgba(255, 255, 255, 0.32);
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --hover: rgba(255, 255, 255, 0.07);
  --accent: oklch(0.8 0 0);
  --info: oklch(0.6 0.12 250);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --top: 60px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr, .nav-toggle {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--text); color: var(--bg); border-radius: var(--radius-sm); }
.skip:focus { top: 12px; }

/* ── The top bar ── */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: var(--top); padding: 0 20px;
  background: rgba(10, 10, 10, 0.86);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { display: block; height: 20px; width: auto; }
.hc {
  flex: none; padding-left: 16px; border-left: 1px solid var(--line-2);
  font: 500 14px/1 var(--font-display); color: var(--text-2); text-decoration: none; letter-spacing: 0.01em;
}
.hc:hover { color: var(--text); }
.search { position: relative; flex: 1 1 auto; max-width: 420px; margin-left: auto; }
.search[hidden] { display: none; }
.search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  background: var(--surface-2) no-repeat 11px 50% / 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23999' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--text); font: 400 14px/1 var(--font-body);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: rgba(255, 255, 255, 0.24); }
.results {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 40;
  max-height: min(70vh, 480px); overflow-y: auto; padding: 6px;
  background: #121212; border: 1px solid var(--line-2); border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.results[hidden] { display: none; }
.results a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; }
.results a[aria-selected="true"], .results a:hover { background: var(--hover); }
.results .r-title { display: block; font-weight: 600; font-size: 14px; }
.results .r-where { display: block; font-size: 12px; color: var(--text-3); }
.results .r-text { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .r-none { padding: 12px; font-size: 14px; color: var(--text-2); }
.studio {
  flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  background: var(--text); color: #0a0a0a; border-radius: 10px;
  font: 600 14px/1 var(--font-body); text-decoration: none; white-space: nowrap;
}
.no-js .studio, .js .search[hidden] + .studio { margin-left: auto; }
.studio:hover { background: #fff; }
.menu { display: none; }

/* ── The three columns ── */
.shell {
  display: grid; grid-template-columns: 264px minmax(0, 1fr) 220px; gap: 40px;
  max-width: 1360px; margin: 0 auto; padding: 0 24px;
}
.sidebar {
  position: sticky; top: var(--top); align-self: start;
  max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 4px 40px 0;
  scrollbar-width: thin;
}
.group + .group { margin-top: 22px; }
.group-title {
  display: block; margin: 0 0 6px; padding: 0 10px;
  font: 600 12px/1.4 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  text-decoration: none;
}
.group-title:hover { color: var(--text-2); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block; padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.45; color: var(--text-2); text-decoration: none;
}
.sidebar li a:hover { color: var(--text); background: var(--hover); }
.sidebar li a[aria-current="page"] { color: var(--text); background: var(--surface-3); font-weight: 500; }
.scrim { display: none; }
main { min-width: 0; padding: 36px 0 64px; outline: none; }
.toc {
  position: sticky; top: var(--top); align-self: start;
  max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 36px 0 40px;
}
.toc-title { margin: 0 0 10px; font: 600 12px/1.4 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13px; line-height: 1.45; color: var(--text-2); text-decoration: none; }
.toc li.d3 a { padding-left: 24px; }
.toc li a:hover { color: var(--text); border-left-color: var(--text-2); }

/* ── Headings, the lede, the meta line ── */
h1, h2, h3 { font-family: var(--font-display); color: var(--text); letter-spacing: -0.01em; }
h1 { margin: 6px 0 10px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; font-weight: 600; }
.lede { margin: 0 0 18px; font-size: 18px; line-height: 1.55; color: var(--text-2); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--text-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text-3); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-bottom: 22px; margin-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.copy-page {
  margin-left: auto; display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none;
}
.copy-page:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }

/* ── The article's words ── */
.prose { font-size: 16px; }
.prose h2 { margin: 44px 0 12px; font-size: 24px; line-height: 1.3; font-weight: 600; }
.prose h3 { margin: 30px 0 8px; font-size: 18px; line-height: 1.4; font-weight: 600; }
.prose h2, .prose h3 { position: relative; }
.prose .anchor { position: absolute; left: -22px; padding-right: 6px; color: var(--text-3); text-decoration: none; opacity: 0; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose p { margin: 0 0 16px; color: rgba(255, 255, 255, 0.82); }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; color: rgba(255, 255, 255, 0.82); }
.prose li { margin: 6px 0; padding-left: 2px; }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose ol > li::marker { color: var(--text-2); font-weight: 600; }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); font: 0.88em/1.4 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.prose hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.code { position: relative; margin: 0 0 20px; }
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  background: #101010; border: 1px solid var(--line-2); border-radius: var(--radius-md);
  font: 13.5px/1.65 var(--font-mono); color: rgba(255, 255, 255, 0.86); white-space: pre-wrap; word-break: break-word;
}
.code pre code { padding: 0; border: 0; background: none; font: inherit; overflow-wrap: inherit; }
.code-copy {
  position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-1);
  color: var(--text-2); font: 500 12px/1 var(--font-body); cursor: pointer;
}
.code-copy:hover { color: var(--text); }
.note {
  margin: 0 0 20px; padding: 14px 16px 2px 16px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--info); border-radius: var(--radius-md);
}
.note p { color: rgba(255, 255, 255, 0.86); }
.table { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-md); }
.table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { font-weight: 600; color: var(--text); background: var(--surface-2); white-space: nowrap; }
.table td { color: rgba(255, 255, 255, 0.82); }
.table tr:last-child td { border-bottom: 0; }

/* ── Cards, lists, related, previous / next ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  text-decoration: none; transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.card:hover { border-color: rgba(255, 255, 255, 0.2); background: var(--surface-3); }
.card-title { font: 600 16px/1.35 var(--font-display); color: var(--text); }
.card-text { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.home h1 { margin-top: 8px; }
/* The Help home's one feature ("Why ROUTIX") and the help's own drawings (inline SVG, never wider than the column). */
.feature { margin-top: 32px; padding: 20px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--radius-lg); background: var(--surface-1); }
.feature .home-h { margin-top: 0; }
.feature p { margin: 0 0 16px; color: var(--text-2); }
.diagram { margin: 8px 0 24px; }
.diagram svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.diagram figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-2); text-align: center; }
.home-h { margin: 40px 0 14px; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.popular { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.popular li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.popular a { font-weight: 500; text-decoration: none; }
.popular a:hover { text-decoration: underline; text-underline-offset: 3px; }
.popular span { font-size: 14px; color: var(--text-2); }
.related { margin-top: 48px; }
.related h2 { margin: 0 0 14px; font-size: 18px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius-md); text-decoration: none; font-weight: 500; font-size: 15px;
}
.pager a:hover { border-color: rgba(255, 255, 255, 0.2); }
.pager span { font-size: 12px; font-weight: 400; color: var(--text-3); }
.pager .next { text-align: right; }
.missing .code { margin: 8px 0 0; font: 600 14px/1 var(--font-mono); color: var(--text-3); letter-spacing: 0.1em; }
.missing .lede a { color: var(--text); }

/* ── The footer ── */
.foot { border-top: 1px solid var(--line); padding: 28px 24px 40px; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.foot a { font-size: 14px; color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot p { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }

/* ── Narrower screens: "On this page" goes; then the sections become a drawer ── */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .top { gap: 10px; padding: 0 12px; }
  .menu {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; margin-left: -6px; border-radius: 10px; cursor: pointer;
  }
  .menu:hover { background: var(--hover); }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 1.6px; background: var(--text); border-radius: 2px; }
  .menu-icon { position: relative; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }
  .hc { display: none; }
  .search { max-width: none; min-width: 0; }
  .studio { padding: 0 12px; font-size: 13px; }
  .shell { display: block; padding: 0 18px; }
  .sidebar {
    position: fixed; top: var(--top); left: 0; bottom: 0; z-index: 25;
    width: min(86vw, 320px); max-height: none; padding: 20px 14px 40px;
    background: #0d0d0d; border-right: 1px solid var(--line-2);
    transform: translateX(-102%); transition: transform 250ms var(--ease); visibility: hidden;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; visibility: visible; }
  .nav-toggle:checked ~ .shell .scrim {
    display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 20; background: rgba(0, 0, 0, 0.6);
  }
  main { padding: 24px 0 48px; }
  .lede { font-size: 16px; }
  .prose .anchor { display: none; }
  .copy-page { margin-left: 0; }
}
@media (max-width: 480px) {
  .top { gap: 8px; }
  .brand img { height: 16px; }
  .search input { padding-left: 30px; background-position: 9px 50%; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .prose h2 { font-size: 21px; }
  .table th { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
