/* InCruiter Proctoring — documentation styling.
 *
 * PUBLISHED FILE. The palette matches the customer dashboard so the docs and the product a
 * customer signs into are visibly the same thing.
 */

:root {
  --navy:        #0e3163;
  --navy-mid:    #123a75;
  --navy-soft:   #eaf0f9;
  --teal:        #12b6bc;
  --teal-soft:   #e6f7f8;

  --page:        #ffffff;
  --sunken:      #f8fafc;
  --border:      #e7eaf0;
  --ink:         #0f1b2d;
  --ink-muted:   #64748b;

  --good:        #12a565;  --good-bg: #e7f7ef;
  --warn:        #d98b0b;  --warn-bg: #fdf3e0;
  --bad:         #d9453f;  --bad-bg:  #fdeceb;

  --code-bg:     #0f1b2d;
  --code-ink:    #e6edf6;

  --radius:      10px;
  --sidebar:     264px;
  --measure:     760px;

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* Dark mode follows the OS, and the toggle in the header overrides it in BOTH directions —
 * `[data-theme]` has to win over the media query, which is why it is written second. */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b1220; --sunken: #111a2b; --border: #1f2b40;
    --ink: #e6edf6; --ink-muted: #8da2bd;
    --navy-soft: #14243f; --teal-soft: #0f2b2d;
    --code-bg: #05090f; --code-ink: #e6edf6;
    --good-bg: #0d2a1e; --warn-bg: #2e2312; --bad-bg: #2e1614;
  }
}
:root[data-theme="dark"] {
  --page: #0b1220; --sunken: #111a2b; --border: #1f2b40;
  --ink: #e6edf6; --ink-muted: #8da2bd;
  --navy-soft: #14243f; --teal-soft: #0f2b2d;
  --code-bg: #05090f; --code-ink: #e6edf6;
  --good-bg: #0d2a1e; --warn-bg: #2e2312; --bad-bg: #2e1614;
}
:root[data-theme="light"] {
  --page: #ffffff; --sunken: #f8fafc; --border: #e7eaf0;
  --ink: #0f1b2d; --ink-muted: #64748b;
  --navy-soft: #eaf0f9; --teal-soft: #e6f7f8;
  --code-bg: #0f1b2d; --code-ink: #e6edf6;
  --good-bg: #e7f7ef; --warn-bg: #fdf3e0; --bad-bg: #fdeceb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: var(--font); background: var(--page); color: var(--ink);
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}

/* ── header ───────────────────────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 64px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em;
         color: var(--ink); text-decoration: none; font-size: 15px; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 140%);
  color: #fff; font-size: 13px; font-weight: 800;
}
.brand .sub { color: var(--ink-muted); font-weight: 600; }
.hdr nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.hdr nav a {
  padding: 7px 13px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--ink-muted); text-decoration: none;
}
.hdr nav a:hover { background: var(--sunken); color: var(--ink); }
.hdr nav a.on { background: var(--navy-soft); color: var(--navy-mid); }
:root[data-theme="dark"] .hdr nav a.on { color: #9ec3ff; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 15px;
  display: grid; place-items: center;
}
.iconbtn:hover { background: var(--sunken); color: var(--ink); }

/* ── layout ───────────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 48px;
         max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.side { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px);
        overflow-y: auto; padding: 32px 0 48px; }
.side h4 { margin: 22px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
           color: var(--ink-muted); font-weight: 800; }
.side h4:first-child { margin-top: 0; }
.side a { display: block; padding: 6px 12px; margin-left: -12px; border-radius: 7px;
          font-size: 14px; color: var(--ink-muted); text-decoration: none; }
.side a:hover { background: var(--sunken); color: var(--ink); }
.side a.on { background: var(--navy-soft); color: var(--navy-mid); font-weight: 700; }
:root[data-theme="dark"] .side a.on { color: #9ec3ff; }
main { padding: 40px 0 120px; max-width: var(--measure); min-width: 0; }

/* ── hero ─────────────────────────────────────────────────────────────────────── */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 44px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
           border-radius: 999px; background: var(--teal-soft); color: #0b7f84;
           font-size: 12px; font-weight: 800; letter-spacing: .03em; margin-bottom: 18px; }
:root[data-theme="dark"] .eyebrow { color: #5fd8dd; }
.hero h1 { font-size: clamp(34px, 5vw, 46px); line-height: 1.08; letter-spacing: -.03em;
           margin: 0 0 16px; font-weight: 800; }
.hero p { font-size: 18px; color: var(--ink-muted); margin: 0 0 28px; max-width: 60ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 9px;
       font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-mid); }
.btn-ghost { border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--sunken); }

/* ── typography ───────────────────────────────────────────────────────────────── */
h2 { font-size: 27px; letter-spacing: -.02em; margin: 56px 0 14px; font-weight: 800;
     scroll-margin-top: 84px; }
h2:first-of-type { margin-top: 0; }
h3 { font-size: 18px; margin: 32px 0 10px; font-weight: 750; scroll-margin-top: 84px; }
p, li { font-size: 15.5px; }
a { color: var(--navy-mid); }
:root[data-theme="dark"] a { color: #7fb0ff; }
.lead { font-size: 17px; color: var(--ink-muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }

/* ── code ─────────────────────────────────────────────────────────────────────── */
code { font-family: var(--mono); font-size: .88em; background: var(--sunken);
       border: 1px solid var(--border); border-radius: 5px; padding: 1.5px 5px; }
pre { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 18px 20px;
      overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 13px; }

.snippet { margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius);
           overflow: hidden; background: var(--code-bg); }
.snippet .tabs { display: flex; gap: 2px; padding: 7px 8px 0; background: var(--code-bg);
                 border-bottom: 1px solid rgba(255,255,255,.07); overflow-x: auto; }
.snippet .tabs button {
  border: 0; background: transparent; color: #90a4bd; font-family: var(--font);
  font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 7px 7px 0 0;
  cursor: pointer; white-space: nowrap;
}
.snippet .tabs button:hover { color: #d7e4f5; }
.snippet .tabs button.on { background: rgba(255,255,255,.09); color: #fff; }
.snippet .panes { position: relative; }
.snippet .pane { display: none; }
.snippet .pane.on { display: block; }
.copy { position: absolute; top: 10px; right: 10px; z-index: 2;
        border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07);
        color: #cfdcee; border-radius: 7px; padding: 5px 10px; font-size: 11.5px;
        font-weight: 700; cursor: pointer; font-family: var(--font); }
.copy:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ── callouts ─────────────────────────────────────────────────────────────────── */
.note { border-left: 3px solid var(--navy); background: var(--navy-soft);
        padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 22px 0; }
.note.warn { border-color: var(--warn); background: var(--warn-bg); }
.note.bad  { border-color: var(--bad);  background: var(--bad-bg); }
.note.good { border-color: var(--good); background: var(--good-bg); }
.note p:first-child { margin-top: 0; } .note p:last-child { margin-bottom: 0; }
.note strong { font-weight: 800; }

/* ── steps ────────────────────────────────────────────────────────────────────── */
.steps { counter-reset: s; padding: 0; margin: 28px 0; list-style: none; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 32px 46px;
              border-left: 2px solid var(--border); margin-left: 15px; }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: -16px; top: -3px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 800;
  font-family: var(--font); border: 3px solid var(--page);
}
.steps > li > h3 { margin-top: 0; }

/* ── tables ───────────────────────────────────────────────────────────────────── */
.tw { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border);
      border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; padding: 11px 15px; background: var(--sunken); font-weight: 750;
     border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
        font-weight: 800; font-family: var(--mono); }
.pill.get  { background: var(--good-bg); color: var(--good); }
.pill.post { background: var(--navy-soft); color: var(--navy-mid); }
:root[data-theme="dark"] .pill.post { color: #9ec3ff; }

/* ── cards ────────────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
         gap: 14px; margin: 28px 0; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
        background: var(--page); text-decoration: none; color: inherit; display: block; }
.card:hover { border-color: var(--teal); background: var(--sunken); }
.card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 750; }
.card p { margin: 0; font-size: 13.5px; color: var(--ink-muted); }

footer { border-top: 1px solid var(--border); margin-top: 80px; padding: 28px 0 60px;
         color: var(--ink-muted); font-size: 13.5px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .side { display: none; }
  .hdr nav a.hide-sm { display: none; }
}

/* [2026-09-15] ADDED — stop the page scrolling sideways on a phone.
 *
 * The header is brand + three links + the theme toggle on one row. Below roughly 560px that row is
 * wider than the viewport, and because the header is the widest thing on the page it set the whole
 * document's scrollWidth — so EVERY page scrolled horizontally on a phone, not just the header.
 * Measured at 390px (iPhone): document scrollWidth 466 against a 390 viewport, on all three pages.
 *
 * The fix is to let the header shrink rather than to hide navigation. A docs site whose nav
 * disappears on mobile is worse than one that scrolls. The wordmark drops to the "In" badge, the
 * links tighten, and all three remain reachable.
 */
@media (max-width: 560px) {
  .hdr { padding: 0 14px; gap: 10px; }
  .brand > span:not(.mark) { display: none; }
  .hdr nav { gap: 2px; }
  .hdr nav a { padding: 6px 8px; font-size: 13px; }
}

/* A long path, a JSON body or a wide table must scroll INSIDE its own box. Without this the widest
 * code block on the page becomes the page's own width, which is the same sideways-scroll bug in a
 * different costume. `.tw` already does this for tables; `pre` needs saying too. */
pre { overflow-x: auto; max-width: 100%; }
.tw { overflow-x: auto; max-width: 100%; }

/* ── the integration sequence ─────────────────────────────────────────────────
 *
 * Built from this file's own tokens rather than an image or a diagram library. It stays sharp at
 * any zoom, reads correctly in dark mode without a second asset, is selectable as text, and adds
 * no runtime dependency to a page whose whole point is that it always loads.
 */
.flow { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 6px;
        margin: 26px 0; background: var(--sunken); }
/* A LEGEND, not column headings. The rows are request -> result pairs and step 5 runs the other
 * way, so fixed lane labels would have been wrong about half the diagram. */
.flow-key { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 14px 30px; }
.flow-key span { font-size: 11.5px; font-weight: 700; color: var(--ink-muted);
                 display: inline-flex; align-items: center; gap: 6px; }
.flow-key span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.flow-key .k-you::before     { background: var(--navy); }
.flow-key .k-browser::before { background: var(--teal); }
.flow-key .k-us::before      { background: var(--good); }

.flow-row { display: grid; grid-template-columns: 30px 1fr 28px 1fr; gap: 10px;
            align-items: stretch; margin-bottom: 10px; }
.flow-n { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff;
          font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
          align-self: center; font-family: var(--font); }
.flow-b { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
          background: var(--page); font-size: 13.5px; line-height: 1.45; }
.flow-b em { display: block; font-style: normal; font-size: 12px; color: var(--ink-muted);
             margin-top: 2px; }
.flow-b code { font-size: 12px; }
.flow-b.from-you   { border-left: 3px solid var(--navy); }
.flow-b.at-browser { border-left: 3px solid var(--teal); }
.flow-b.at-us      { border-left: 3px solid var(--good); }
.flow-arrow { display: grid; place-items: center; color: var(--ink-muted); font-size: 15px; }
.flow-row.highlight .flow-b { border-color: var(--warn); background: var(--warn-bg); }
.flow-row.highlight .flow-n { background: var(--warn); }
.flow-note { font-size: 13.5px; color: var(--ink-muted); margin: 14px 0 12px 30px; }

@media (max-width: 720px) {
  .flow-key { margin-left: 0; }
  .flow-row { grid-template-columns: 30px 1fr; }
  .flow-arrow { display: none; }
  .flow-row .flow-b:last-child { grid-column: 2; }
}
