/* Payezy developers.
   Reading surface: cool paper with steel-blue ink, from the Payezy mark (#537EB1 -> #A2C3DC).
   Console: the product's own dark surface (#0E1218), so "live" always looks like the app.
   One bold element: the journey trail, a ledger-like rail of the objects you created. */


:root {
  --paper: #f5f7fa;
  --paper-2: #ecf0f5;
  --raise: #ffffff;
  --ink: #121822;
  --body: #2f3a4b;
  --muted: #5d6a7e;
  --line: #d8dfe9;
  --line-2: #c4cedb;
  --steel: #315a8c;
  --steel-2: #537eb1;
  --steel-soft: #e2ebf5;
  --ok: #276b4f;
  --ok-soft: #e1f0e8;
  --warn: #8a5a0b;
  --warn-soft: #f8eedb;
  --bad: #a3352d;
  --bad-soft: #f8e4e2;

  --c-bg: #0e1218;
  --c-bg-2: #151b24;
  --c-bg-3: #1d2531;
  --c-ink: #eef2f8;
  --c-muted: #9aa7bb;
  --c-line: rgba(230, 234, 241, 0.12);
  --c-accent: #a2c3dc;
  --c-ok: #7fcfa8;
  --c-warn: #e6c178;
  --c-bad: #f19b92;

  --sans: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Saira", "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --nav-w: 264px;
  --pane-w: clamp(380px, 40vw, 560px);
  --top-h: 56px;
  --measure: 70ch;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #10151d;
  --paper-2: #0c1016;
  --raise: #161d27;
  --ink: #eef2f8;
  --body: #c7d0dd;
  --muted: #8f9cb0;
  --line: #243041;
  --line-2: #2f3d52;
  --steel: #a2c3dc;
  --steel-2: #7fa6cf;
  --steel-soft: #1a2738;
  --ok: #7fcfa8; --ok-soft: #12261d;
  --warn: #e6c178; --warn-soft: #2a2213;
  --bad: #f19b92; --bad-soft: #2c1715;
  --c-bg: #080b10;
  --c-bg-2: #0d1219;
  --c-bg-3: #151c26;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10151d; --paper-2: #0c1016; --raise: #161d27; --ink: #eef2f8; --body: #c7d0dd; --muted: #8f9cb0;
    --line: #243041; --line-2: #2f3d52; --steel: #a2c3dc; --steel-2: #7fa6cf; --steel-soft: #1a2738;
    --ok: #7fcfa8; --ok-soft: #12261d; --warn: #e6c178; --warn-soft: #2a2213; --bad: #f19b92; --bad-soft: #2c1715;
    --c-bg: #080b10; --c-bg-2: #0d1219; --c-bg-3: #151c26; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--body); font: 400 16px/1.6 var(--sans); }
a { color: var(--steel); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--steel-2); outline-offset: 2px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.35em; color: var(--ink); overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.4em; font-size: 0.78em; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--raise); padding: 8px 12px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; color: var(--muted); }
button { font: inherit; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 24px; padding: 0 20px; background: var(--c-bg); color: var(--c-ink); border-bottom: 1px solid var(--c-line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--c-ink); text-decoration: none; font: 600 18px/1 var(--display); letter-spacing: 0.01em; }
.brand-sub { font-weight: 500; color: var(--c-muted); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a { color: var(--c-muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 0.92rem; }
.tabs a:hover { color: var(--c-ink); background: var(--c-bg-3); }
.tabs a[aria-current="page"] { color: var(--c-ink); background: var(--c-bg-3); box-shadow: inset 0 -2px 0 var(--c-accent); }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-open { display: flex; align-items: center; gap: 24px; background: var(--c-bg-2); color: var(--c-muted); border: 1px solid var(--c-line); border-radius: 8px; padding: 5px 8px 5px 12px; cursor: pointer; font-size: 0.9rem; }
.search-open kbd { color: var(--c-muted); border-color: var(--c-line); }
.env { font: 500 0.78rem/1 var(--sans); color: var(--c-ok); border: 1px solid rgba(127, 207, 168, 0.35); border-radius: 999px; padding: 5px 10px; }
.theme { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-bg-2) center/16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa7bb' stroke-width='2'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E"); cursor: pointer; }
.nav-toggle { display: none; background: var(--c-bg-2); color: var(--c-ink); border: 1px solid var(--c-line); border-radius: 8px; padding: 5px 10px; }

/* ---------- Three panes ---------- */
.frame { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--pane-w); min-height: calc(100vh - var(--top-h)); }
.frame.no-aside { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
.sidenav { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 20px 12px 40px 16px; background: var(--paper-2); border-right: 1px solid var(--line); font-size: 0.92rem; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--body); text-decoration: none; line-height: 1.35; }
.sidenav li a:hover { background: var(--line); }
.sidenav li a[aria-current="page"] { background: var(--raise); color: var(--ink); font-weight: 500; box-shadow: inset 2px 0 0 var(--steel-2); }
.nav-heading { margin: 18px 8px 4px; font-weight: 600; color: var(--ink); font-size: 0.82rem; }
.nav-heading:first-child { margin-top: 0; }
.nav-group summary { cursor: pointer; padding: 6px 8px; font-weight: 600; color: var(--ink); border-radius: 6px; list-style-position: inside; }
.nav-group summary:hover { background: var(--line); }
.nav-group ul { margin: 2px 0 8px 6px; }
.content { min-width: 0; padding: 40px clamp(20px, 4vw, 56px) 96px; outline: none; }
.content > article { max-width: 760px; margin: 0 auto; }
.pane { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; background: var(--c-bg); color: var(--c-ink); border-left: 1px solid var(--c-line); }
.pane a { color: var(--c-accent); }
.pane-title { margin: 0 0 8px; font: 600 0.82rem/1.2 var(--sans); color: var(--c-muted); }
.pane-card { padding: 20px; }
.pane .toc { padding: 20px; border-top: 1px solid var(--c-line); }
.toc ul { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.toc li a { color: var(--c-muted); text-decoration: none; display: block; padding: 3px 0; }
.toc li a:hover { color: var(--c-ink); }
.toc .toc-3 { padding-left: 12px; }

/* ---------- Prose ---------- */
h1, h2, h3, h4 { color: var(--ink); font-family: var(--display); font-weight: 600; line-height: 1.2; letter-spacing: 0.005em; }
h1 { font-size: clamp(2rem, 3.2vw, 2.6rem); margin: 6px 0 14px; }
h2 { font-size: 1.45rem; margin: 2.4em 0 0.6em; }
h3 { font-size: 1.12rem; margin: 1.8em 0 0.5em; }
.prose p, .prose li { max-width: var(--measure); }
.anchor { float: left; margin-left: -0.9em; width: 0.9em; color: var(--line-2); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.crumbs { margin: 0; font-size: 0.88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lede-p, .lede p { font-size: 1.12rem; color: var(--body); max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.25em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.table-wrap { overflow-x: auto; margin: 1em 0; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
tr:last-child > * { border-bottom: 0; }
thead th { font-weight: 600; color: var(--ink); background: var(--paper-2); font-size: 0.85rem; }
.codeblock { position: relative; margin: 1em 0; }
.codeblock pre { margin: 0; padding: 14px 16px; background: var(--c-bg); color: var(--c-ink); border-radius: 10px; overflow-x: auto; line-height: 1.5; }
.codeblock .copy, .endpoint .copy { position: absolute; top: 8px; right: 8px; }
.copy { background: var(--c-bg-3); color: var(--c-muted); border: 1px solid var(--c-line); border-radius: 6px; font-size: 0.75rem; padding: 2px 8px; cursor: pointer; }
.copy:hover { color: var(--c-ink); }
.callout { border-left: 3px solid var(--steel-2); background: var(--steel-soft); border-radius: 0 10px 10px 0; padding: 12px 18px; margin: 1.4em 0; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.callout-warning { border-color: var(--warn); background: var(--warn-soft); }
.callout-tip { border-color: var(--ok); background: var(--ok-soft); }
.callout-regulatory { border-color: var(--ink); background: var(--paper-2); }
.steps > ol { counter-reset: step; list-style: none; padding: 0; }
.steps > ol > li { counter-increment: step; position: relative; padding: 0 0 18px 44px; margin: 0; border-left: 1px solid var(--line-2); margin-left: 14px; }
.steps > ol > li:last-child { border-left-color: transparent; }
.steps > ol > li::before { content: counter(step); position: absolute; left: -14px; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--raise); border: 1px solid var(--line-2); color: var(--ink); font: 600 0.85rem/26px var(--display); text-align: center; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--raise); }
.pager a span { display: block; font-size: 0.8rem; color: var(--muted); }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- Methods, chips, cards ---------- */
.method { display: inline-block; min-width: 4.1em; text-align: center; font: 600 0.68rem/1 var(--mono); padding: 4px 5px 3px; border-radius: 4px; border: 1px solid currentColor; letter-spacing: 0.02em; }
.method-get { color: var(--steel); }
.method-post { color: var(--ok); }
.method-put, .method-patch { color: var(--warn); }
.method-delete { color: var(--bad); }
.pane .method-get { color: var(--c-accent); } .pane .method-post { color: var(--c-ok); } .pane .method-put, .pane .method-patch { color: var(--c-warn); } .pane .method-delete { color: var(--c-bad); }
.tag { font-size: 0.7rem; font-weight: 500; color: var(--warn); border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; margin-left: auto; white-space: nowrap; }
.path-param { color: var(--steel-2); }
.op-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.op-link span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.chips { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 1.2em 0; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--body); background: var(--raise); }
.card:hover { border-color: var(--steel-2); }
.card strong { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.card em { font-style: normal; font-size: 0.84rem; color: var(--muted); margin-top: auto; }
.button { display: inline-flex; align-items: center; gap: 8px; background: var(--steel); color: #fff; border: 1px solid var(--steel); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; font-weight: 500; }
.button:hover { filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--steel); }
.button.small { padding: 4px 10px; font-size: 0.85rem; }
[data-theme="dark"] .button, .pane .button { color: var(--c-bg); background: var(--c-accent); border-color: var(--c-accent); }
.pane .button.ghost { background: transparent; color: var(--c-accent); }

/* ---------- Operation page ---------- */
.endpoint { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 76px 10px 12px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem; }
.endpoint code { background: none; border: 0; padding: 0; font-size: 0.92rem; }
.endpoint .copy { top: 50%; transform: translateY(-50%); }
.when { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 1.2em 0; background: var(--raise); }
.when-label { margin: 0 0 2px; font-weight: 600; color: var(--ink); font-size: 0.88rem; }
.when p:last-child { margin: 0; }
.requires { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.requires li { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); max-width: none; margin: 0; }
.requires li:last-child { border-bottom: 0; }
.requires li > span { color: var(--muted); font-size: 0.88rem; }
.fields td:first-child { width: 36%; padding-left: calc(14px + var(--depth, 0) * 14px); }
.field-name { background: none !important; border: 0 !important; padding: 0 !important; display: block; word-break: break-word; }
.field-name .parent { color: var(--muted); font-weight: 400; }
.field-type { display: block; color: var(--muted); font: 0.78rem/1.4 var(--mono); }
.req { display: inline-block; margin-top: 3px; font-size: 0.72rem; color: var(--warn); }
.enum { margin: 4px 0 0; font-size: 0.86rem; color: var(--muted); }
.fields tr.hl td { background: var(--steel-soft); }
.fix { margin: 6px 0 0; color: var(--ink); }
.fix::before { content: "Fix: "; font-weight: 600; }
.status-code { font: 500 0.8em var(--mono); color: var(--ok); border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; vertical-align: middle; }
.next-ops, .op-list { list-style: none; padding: 0; }
.next-ops a, .op-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.next-ops a:hover, .op-list a:hover { background: var(--paper-2); }
.op-list a code { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 0.8rem; text-align: right; }
.op-list .tag { margin-left: 8px; }
.ref-group { margin-top: 1.2em; }
.ref-group h2 a { color: inherit; text-decoration: none; }
.tryit-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--raise); margin: 1.2em 0; }
.tryit-card > div { display: flex; gap: 10px; align-items: center; }
.tryit-card code { background: none; border: 0; }
.tryit-card p { margin: 6px 0 0; display: flex; gap: 14px; align-items: center; }

/* ---------- Org tree ---------- */
.orgtree { margin: 1.6em 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); }
.orgtree figcaption { font-size: 0.92rem; color: var(--muted); margin-bottom: 14px; }
.org-row { display: flex; gap: 12px; justify-content: center; }
.org-mid { margin-top: 26px; position: relative; }
.org-mid::before { content: ""; position: absolute; top: -26px; left: 25%; right: 25%; height: 14px; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 8px 8px 0 0; }
.org-mid > * { flex: 1; }
.org-top .org-node { max-width: 320px; }
.org-node { display: flex; flex-direction: column; text-align: left; gap: 1px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); color: var(--body); cursor: pointer; font-size: 0.84rem; }
.org-node strong { color: var(--ink); font-size: 0.95rem; }
.org-node.accent { border-color: var(--steel-2); border-width: 2px; background: var(--steel-soft); }
.org-node[aria-expanded="true"] { outline: 2px solid var(--steel-2); outline-offset: 1px; }
.org-link-label { display: flex; justify-content: space-around; font-size: 0.8rem; color: var(--muted); margin: 8px 0; padding: 6px 0; border-left: 0; background: linear-gradient(var(--line-2), var(--line-2)) 25% 0/1px 100% no-repeat, linear-gradient(var(--line-2), var(--line-2)) 75% 0/1px 100% no-repeat; }
.org-link-label span { background: var(--raise); padding: 0 6px; }
.org-link-label span:first-child { font-weight: 500; color: var(--steel); }
.org-customer { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px; background: var(--paper-2); }
.org-customer-title { margin: 0 0 10px; font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.org-leaves > * { flex: 1; }
.org-detail { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--paper-2); font-size: 0.92rem; min-height: 3em; }
.org-detail h4 { margin: 0 0 4px; font-size: 1rem; }
.org-detail p { margin: 0 0 6px; }
.org-detail ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---------- Matrix ---------- */
.matrix th[scope="row"] { font-weight: 500; color: var(--ink); }
.matrix td { text-align: center; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--muted); }

/* ---------- Console (dark pane) ---------- */
.console { padding: 0 0 24px; }
.console-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 14px 20px 10px; background: var(--c-bg); border-bottom: 1px solid var(--c-line); flex-wrap: wrap; }
.console-head .pane-title { margin: 0; margin-right: auto; }
.console-static { padding: 16px 20px; }
.console select, .console input, .console textarea { font: 0.86rem var(--mono); color: var(--c-ink); background: var(--c-bg-2); border: 1px solid var(--c-line); border-radius: 6px; padding: 6px 8px; width: 100%; }
.console select { font-family: var(--sans); }
.console label { display: block; font-size: 0.8rem; color: var(--c-muted); margin: 0 0 3px; }
.console .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c-section { padding: 14px 20px; border-bottom: 1px solid var(--c-line); }
.c-section h3 { margin: 0 0 10px; color: var(--c-ink); font: 600 0.85rem var(--sans); display: flex; align-items: center; gap: 8px; }
.c-endpoint { display: flex; align-items: center; gap: 8px; font: 0.84rem var(--mono); color: var(--c-ink); word-break: break-all; }
.c-endpoint .proposed { margin-left: auto; }
.c-modes { display: inline-flex; background: var(--c-bg-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 2px; }
.c-modes button { background: none; border: 0; color: var(--c-muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.c-modes button[aria-pressed="true"] { background: var(--c-bg-3); color: var(--c-ink); }
.c-note { font-size: 0.8rem; color: var(--c-muted); margin: 8px 0 0; }
.c-note.warn { color: var(--c-warn); }
.c-params { display: grid; gap: 8px; }
.c-param { display: grid; grid-template-columns: 9em 1fr; align-items: center; gap: 8px; }
.c-param label { margin: 0; font-family: var(--mono); color: var(--c-ink); }
.c-param label em { font-style: normal; color: var(--c-muted); font-family: var(--sans); font-size: 0.72rem; display: block; }
.c-param.var-auto input { border-color: rgba(162, 195, 220, 0.5); }
.c-param.var-missing input { border-color: rgba(241, 155, 146, 0.6); }
.c-body textarea { min-height: 220px; resize: vertical; line-height: 1.45; tab-size: 2; }
.c-tabs { display: flex; gap: 4px; }
.c-tabs button { background: none; border: 0; color: var(--c-muted); padding: 2px 8px; border-radius: 5px; cursor: pointer; font-size: 0.78rem; }
.c-tabs button[aria-selected="true"] { color: var(--c-ink); background: var(--c-bg-3); }
.c-form { display: grid; gap: 8px; }
.c-form fieldset { border: 1px solid var(--c-line); border-radius: 8px; padding: 8px 10px 10px; margin: 0; display: grid; gap: 8px; }
.c-form legend { color: var(--c-muted); font: 0.78rem var(--mono); padding: 0 4px; }
.c-actions { display: flex; gap: 8px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--c-line); flex-wrap: wrap; }
.c-actions .send { min-width: 120px; justify-content: center; }
.c-actions .spacer { margin-left: auto; }
.c-btn { background: none; border: 1px solid var(--c-line); color: var(--c-muted); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 0.8rem; }
.c-btn:hover { color: var(--c-ink); border-color: var(--c-muted); }
.c-response .status { font: 600 0.85rem var(--mono); }
.status.ok { color: var(--c-ok); } .status.err { color: var(--c-bad); } .status.pending { color: var(--c-warn); }
.c-response pre, .c-snippet pre { margin: 8px 0 0; padding: 12px; background: var(--c-bg-2); border: 1px solid var(--c-line); border-radius: 8px; overflow: auto; max-height: 420px; font-size: 0.8rem; line-height: 1.5; color: var(--c-ink); }
.c-response .json-key { color: var(--c-accent); }
.c-response .json-str { color: #c9dfb4; }
.c-response .json-num { color: var(--c-warn); }
.c-response .json-id { cursor: pointer; border-bottom: 1px dotted var(--c-accent); }
.c-explain { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--c-bg-3); font-size: 0.86rem; }
.c-explain p { margin: 0 0 4px; }
.c-explain.bad { border-left: 3px solid var(--c-bad); }
.c-explain.good { border-left: 3px solid var(--c-ok); }
.c-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.c-var { font: 0.75rem var(--mono); background: var(--c-bg-2); border: 1px solid var(--c-line); color: var(--c-ink); border-radius: 999px; padding: 2px 8px; }
.c-var b { color: var(--c-accent); font-weight: 400; }
.c-events li { list-style: none; padding: 8px 10px; border: 1px solid var(--c-line); border-radius: 8px; margin-bottom: 6px; font-size: 0.82rem; }
.c-events ul { padding: 0; margin: 0; }
.c-events code { color: var(--c-ink); background: none; border: 0; }
.c-events .sig { color: var(--c-ok); font-size: 0.75rem; }

/* ---------- Journey ---------- */
.journey-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); }
.journey-meta { margin: 0; font-size: 0.92rem; color: var(--muted); }
.journey-actions { display: flex; gap: 8px; margin-left: auto; }
.stages { margin-top: 28px; position: relative; }
.stage { position: relative; padding: 0 0 8px 56px; }
.stage::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: -4px; width: 2px; background: var(--line); }
.stage:last-child::before { display: none; }
.stage-head { display: flex; align-items: center; gap: 12px; margin-left: -56px; }
.stage-head h2 { margin: 0; font-size: 1.2rem; }
.stage-num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--raise); border: 2px solid var(--line-2); color: var(--muted); font: 600 0.95rem var(--display); }
.stage-state { margin-left: auto; font-size: 0.8rem; color: var(--muted); }
.stage-body { padding: 10px 0 18px; }
.stage-body p { margin: 0 0 8px; }
.stage-why, .stage-do, .stage-what { margin-bottom: 12px; }
.stage-calls { list-style: none; padding: 0; margin: 4px 0; }
.stage-calls li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.stage-check { font-size: 0.9rem; }
.stage-check span { font-weight: 600; color: var(--ink); }
.js .stage .stage-body { display: none; }
.js .stage.current .stage-body, .js .stage.done.open .stage-body { display: block; }
.js .stage .stage-what { display: none; }
.js .stage.done .stage-what, .js .stage.checked .stage-what { display: block; border-left: 3px solid var(--ok); padding: 8px 12px; background: var(--ok-soft); border-radius: 0 8px 8px 0; }
.stage.current .stage-num { border-color: var(--steel-2); color: var(--steel); background: var(--steel-soft); }
.stage.done .stage-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.stage.done::before { background: var(--ok); }
.stage.done .stage-head { cursor: pointer; }
.stage-next { margin-top: 8px; }

/* The trail: the objects this journey created, as a ledger rail. */
.trail { margin-top: 22px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.trail .pane-title { color: var(--muted); padding: 0 8px; }
.trail-list { list-style: none; margin: 8px 0 0; padding: 0 8px; position: relative; }
.trail-list::before { content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.trail-list li { position: relative; display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; padding: 4px 0; max-width: none; }
.trail-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--line-2); margin-top: 5px; z-index: 1; }
.trail-label { color: var(--muted); font-size: 0.86rem; }
.trail-val { grid-column: 2; font-size: 0.74rem; color: var(--muted); background: none !important; border: 0 !important; padding: 0 !important; word-break: break-all; }
.trail-list li.set .trail-dot { background: var(--steel-2); border-color: var(--steel-2); }
.trail-list li.set .trail-label { color: var(--ink); font-weight: 500; }
.trail-list li.set .trail-val { color: var(--steel); }
.trail-list li.fresh .trail-dot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--steel-2) 25%, transparent); transition: box-shadow 600ms ease; }

/* ---------- Home ---------- */
.home .content > article { max-width: 880px; }
.hero { padding: 8px 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.3rem); max-width: 18ch; margin-bottom: 12px; }
.hero-trail { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 30px 0 24px; counter-reset: obj; }
.hero-trail li { list-style: none; position: relative; padding: 26px 10px 0 0; font-size: 0.86rem; color: var(--muted); max-width: none; margin: 0; }
.hero-trail li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--steel-2); }
.hero-trail li::after { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--steel-2); }
.hero-trail li:last-child::before { right: auto; width: 0; }
.hero-trail li:last-child::after { background: var(--steel-2); }
.hero-trail strong { display: block; color: var(--ink); font-size: 0.95rem; }
.hero-trail code { font-size: 0.72rem; }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }

/* ---------- Search ---------- */
.search { width: min(680px, 92vw); margin-top: 10vh; padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--raise); color: var(--body); }
.search::backdrop { background: rgba(8, 11, 16, 0.55); }
.search-box { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.search-box input { flex: 1; font: 1rem var(--sans); border: 0; background: none; color: var(--ink); outline: none; }
.search-box button { border: 1px solid var(--line); background: var(--paper-2); border-radius: 6px; color: var(--muted); font-size: 0.78rem; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.search-results a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--steel-soft); }
.search-results .where { margin-left: auto; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.search-results .excerpt { display: block; font-size: 0.82rem; color: var(--muted); }
.search-empty { padding: 16px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .frame { grid-template-columns: minmax(0, 1fr) var(--pane-w); }
  .frame.no-aside { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: fixed; z-index: 15; left: 0; top: var(--top-h); width: min(320px, 86vw); transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  .sidenav.open { transform: none; }
  .nav-toggle { display: inline-block; }
  .tabs { display: none; }
}
@media (max-width: 959px) {
  .frame { display: block; }
  .pane { position: static; height: auto; border-left: 0; border-top: 1px solid var(--c-line); }
  .search-open span, .search-open kbd { display: none; }
  .search-open { padding: 6px 10px; }
  .search-open::before { content: "Search"; }
  .topbar { gap: 12px; padding: 0 12px; }
  .brand-sub, .env { display: none; }
  .topbar-tools { gap: 6px; }
  .hero-trail { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .paths { grid-template-columns: 1fr; }
  .requires li { grid-template-columns: 1fr; gap: 2px; }
  .org-row { flex-direction: column; }
  .org-mid::before, .org-link-label { display: none; }
  .org-customer { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidenav, .pane { display: none; }
  .frame { display: block; }
}
