/* DDBoost Business console. Operate mode: familiar patterns, one accent, status colour only for status.
   Tokens first; dark is the default scene (developers at a desk, late), light follows the OS or the toggle. */
:root {
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #0b0e11; --rail: #0f1317; --panel: #12171c; --panel-2: #181e24; --line: #232b33; --line-2: #2d3740;
  --text: #e8ecef; --muted: #98a3ad; --faint: #6c7781;
  /* Brand accent = the main site's red (#FF0604). Users can pick another highlight (same set as ddboost.com); red stays the default. */
  --accent: #ff4a46; --accent-fill: #e10503; --accent-ink: #ffffff; --accent-soft: rgba(255,6,4,.14);
  --ok: #52c98e; --ok-soft: rgba(82,201,142,.14);
  --warn: #eaa93f; --warn-soft: rgba(234,169,63,.15);
  --bad: #f07a6e; --bad-soft: rgba(240,122,110,.15);
  --info: #74a9ff; --info-soft: rgba(116,169,255,.15);
  --sbx: #8f9bff; --sbx-soft: rgba(143,155,255,.12);
  --focus: #9cc4ff;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --r: 8px; --r-sm: 6px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f1ec; --rail: #ebe8e1; --panel: #ffffff; --panel-2: #f8f6f2; --line: #e1dcd1; --line-2: #cfc8ba;
  --text: #16181b; --muted: #555d65; --faint: #7a828a;
  --accent: #d40503; --accent-fill: #e10503; --accent-ink: #ffffff; --accent-soft: rgba(255,6,4,.1);
  --ok: #17794f; --ok-soft: rgba(23,121,79,.1);
  --warn: #8f5a00; --warn-soft: rgba(143,90,0,.1);
  --bad: #b3261e; --bad-soft: rgba(179,38,30,.09);
  --info: #1d55b8; --info-soft: rgba(29,85,184,.09);
  --sbx: #4a54c9; --sbx-soft: rgba(74,84,201,.08);
  --focus: #1d55b8;
  --shadow: 0 1px 2px rgba(20,20,20,.06), 0 8px 24px -14px rgba(20,20,20,.25);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f1ec; --rail: #ebe8e1; --panel: #ffffff; --panel-2: #f8f6f2; --line: #e1dcd1; --line-2: #cfc8ba;
    --text: #16181b; --muted: #555d65; --faint: #7a828a;
    --accent: #d40503; --accent-fill: #e10503; --accent-ink: #ffffff; --accent-soft: rgba(255,6,4,.1);
    --ok: #17794f; --ok-soft: rgba(23,121,79,.1);
    --warn: #8f5a00; --warn-soft: rgba(143,90,0,.1);
    --bad: #b3261e; --bad-soft: rgba(179,38,30,.09);
    --info: #1d55b8; --info-soft: rgba(29,85,184,.09);
    --sbx: #4a54c9; --sbx-soft: rgba(74,84,201,.08);
    --focus: #1d55b8;
    --shadow: 0 1px 2px rgba(20,20,20,.06), 0 8px 24px -14px rgba(20,20,20,.25);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-fill); color: var(--accent-ink); }
a { color: var(--info); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; line-height: 1.3; }
h3 { font-size: 14px; }
p { margin: 0 0 .75em; text-wrap: pretty; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
input, textarea, select { caret-color: var(--accent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent-fill); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 650; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-fill); color: var(--accent-ink); display: grid; place-items: center; font: 700 13px var(--mono); }
.brand-mark img { width: 18px; height: 18px; display: block; }
.brand small { display: block; font-weight: 400; color: var(--faint); font-size: 11.5px; letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav a[aria-current="page"] .ico { color: var(--accent); }
.nav .grp { margin: 14px 10px 4px; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); padding: 0 8px; }
.rail-foot form { margin-top: 8px; }

.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.topbar .grow { flex: 1; }
.btn.menu-btn { display: none; }
.content { padding: 26px 28px 64px; width: 100%; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 62ch; }

/* The environment is the loudest thing in the chrome. */
.env { display: inline-flex; padding: 3px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px; }
.env button { all: unset; cursor: pointer; padding: 5px 14px; border-radius: 999px; font-weight: 600; font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; }
.env button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.env button[aria-pressed="true"].live { background: var(--accent-fill); color: var(--accent-ink); }
.env button[aria-pressed="true"].sbx { background: var(--sbx); color: #0b0e11; }
:root[data-theme="light"] .env button[aria-pressed="true"].sbx { color: #fff; }
.env .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sbx-band { background: repeating-linear-gradient(135deg, var(--sbx-soft) 0 10px, transparent 10px 20px); border-bottom: 1px solid var(--sbx); color: var(--text); padding: 6px 28px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.sbx-band b { color: var(--sbx); }

/* ---------- surfaces ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-b { padding: 18px; }
.stack { display: grid; gap: 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

/* figures: a ledger strip, not four identical cards */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.ledger > div { padding: 16px 18px; border-right: 1px solid var(--line); min-width: 0; }
.ledger > div:last-child { border-right: 0; }
.ledger dt { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.ledger dd { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ledger dd small { font-size: 13px; color: var(--muted); font-weight: 500; margin-right: 3px; }
.ledger .sub { color: var(--faint); font-size: 12.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); }
td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
td .sub { color: var(--faint); font-size: 12.5px; }
.cell-mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* ---------- status + chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.pill.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.pill.run::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.chip { display: inline-block; padding: 1px 8px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); font: 500 12px var(--mono); color: var(--muted); margin: 0 4px 4px 0; }

/* ---------- forms ---------- */
label.f { display: block; font-weight: 500; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; font: inherit; min-height: 38px;
}
textarea { min-height: 88px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.is-invalid { border-color: var(--bad) !important; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); font-weight: 500; color: var(--muted); }
.opt input:checked + span { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.opt input:disabled + span { opacity: .45; cursor: not-allowed; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

.btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; min-height: 36px; border-radius: var(--r-sm); font: 600 13.5px var(--font); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--faint); background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn.primary { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .7; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ---------- callouts, reveal, dialog ---------- */
.note { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); }
.note .ico { margin-top: 2px; }
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.note.warn .ico { color: var(--warn); }
.note.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.note.bad .ico { color: var(--bad); }
.note.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.note.ok .ico { color: var(--ok); }
.note.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.note.info .ico { color: var(--info); }
.note p:last-child { margin-bottom: 0; }
.secret { display: flex; gap: 8px; align-items: stretch; margin: 8px 0 12px; }
.secret code { flex: 1; min-width: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow-wrap: anywhere; user-select: all; font-size: 13px; }
.reveal { border-color: var(--accent); background: var(--accent-soft); }
dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(5,7,9,.72); backdrop-filter: blur(3px); }
dialog .d-b { padding: 22px; } dialog .d-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
details.fold { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
details.fold > summary { cursor: pointer; padding: 8px 12px; font-weight: 500; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > .fold-b { padding: 14px; }

/* ---------- chart + checklist ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0 0; }
.bars .b { flex: 1; min-width: 3px; background: var(--accent); border-radius: 2px 2px 0 0; position: relative; opacity: .9; }
.bars .b:hover { opacity: 1; filter: brightness(1.1); }
.bars .b i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bad); border-radius: 0 0 0 0; }
.bars-x { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; }
.steps .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; }
.steps .done .tick { background: var(--ok); border-color: var(--ok); color: #06150d; }
.steps .done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin-inline: auto; }

/* skeleton for the few async bits */
.skel { background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: sh 1.2s linear infinite; border-radius: 4px; min-height: 1em; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- docs (Read mode) ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }
.docs nav { position: sticky; top: 76px; align-self: start; display: grid; gap: 2px; max-height: calc(100vh - 100px); overflow: auto; }
.docs nav a { padding: 5px 10px; color: var(--muted); text-decoration: none; border-radius: 6px; font-weight: 500; }
.docs nav a:hover { color: var(--text); background: var(--panel-2); }
.docs article { min-width: 0; max-width: 74ch; }
.docs h1 { font-size: 30px; margin-bottom: 8px; }
.docs h2 { font-size: 20px; margin: 44px 0 10px; padding-top: 6px; }
.docs h3 { font-size: 15px; margin: 22px 0 6px; }
.docs p, .docs li { line-height: 1.65; font-size: 15px; }
.docs pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); }
.docs :not(pre) > code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.docs table { margin: 10px 0 18px; font-size: 14px; }
.docs th, .docs td { padding: 8px 12px; }
.method { font: 600 11.5px var(--mono); padding: 2px 7px; border-radius: 4px; margin-right: 8px; }
.method.get { background: var(--info-soft); color: var(--info); } .method.post { background: var(--ok-soft); color: var(--ok); }
.endpoint { font-family: var(--mono); font-size: 14px; margin: 18px 0 6px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ---------- accent choices (data-accent on <html>) ---------- */
:root[data-accent="orange"] { --accent: #fc6e51; --accent-fill: #d4401f; --accent-ink: #ffffff; --accent-soft: rgba(252,110,81,.15); }
:root[data-theme="light"][data-accent="orange"] { --accent: #c2410c; --accent-soft: rgba(252,110,81,.16); }
:root[data-accent="yellow"] { --accent: #ffce54; --accent-fill: #ffce54; --accent-ink: #16130a; --accent-soft: rgba(255,206,84,.15); }
:root[data-theme="light"][data-accent="yellow"] { --accent: #8a6100; --accent-soft: rgba(255,206,84,.16); }
:root[data-accent="green"] { --accent: #a0d468; --accent-fill: #a0d468; --accent-ink: #16130a; --accent-soft: rgba(160,212,104,.15); }
:root[data-theme="light"][data-accent="green"] { --accent: #3f7d12; --accent-soft: rgba(160,212,104,.16); }
:root[data-accent="mint"] { --accent: #48cfad; --accent-fill: #48cfad; --accent-ink: #16130a; --accent-soft: rgba(72,207,173,.15); }
:root[data-theme="light"][data-accent="mint"] { --accent: #0c7a62; --accent-soft: rgba(72,207,173,.16); }
:root[data-accent="blue"] { --accent: #5d9cec; --accent-fill: #2f6fd0; --accent-ink: #ffffff; --accent-soft: rgba(93,156,236,.15); }
:root[data-theme="light"][data-accent="blue"] { --accent: #1d55b8; --accent-soft: rgba(93,156,236,.16); }
:root[data-accent="magenta"] { --accent: #ac92ec; --accent-fill: #7c58d6; --accent-ink: #ffffff; --accent-soft: rgba(172,146,236,.15); }
:root[data-theme="light"][data-accent="magenta"] { --accent: #6b3fc4; --accent-soft: rgba(172,146,236,.16); }
:root[data-accent="brown"] { --accent: #baa286; --accent-fill: #8a6d45; --accent-ink: #ffffff; --accent-soft: rgba(186,162,134,.15); }
:root[data-theme="light"][data-accent="brown"] { --accent: #7a5a2f; --accent-soft: rgba(186,162,134,.16); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { all: unset; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line-2); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pop { position: relative; }
.pop > .panel { position: absolute; right: 0; top: calc(100% + 8px); padding: 14px; width: 230px; z-index: 50; display: none; }
.pop.open > .panel { display: block; }

/* ---------- ask-the-docs ---------- */
.ask-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; }
.ask { position: fixed; right: 20px; bottom: 72px; top: 12px; z-index: 31; width: min(440px, calc(100vw - 24px)); display: none; flex-direction: column; } /* tall: from just under the top of the window down to the button, from the first open */
.ask.open { display: flex; }
.ask .log { overflow-y: auto; padding: 14px; display: grid; gap: 10px; flex: 1; min-height: 120px; }
.ask .msg { padding: 9px 12px; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask .me { background: var(--accent-soft); justify-self: end; max-width: 88%; }
.ask .support { border-color: var(--accent); }
/* The copy button sits just OUTSIDE the bubble, under it (the bubble keeps its own padding and background): left edge for replies, right edge for the member's own messages. */
.ask .msg.has-copy { position: relative; margin-bottom: 24px; }
.ask .msg .foot { position: absolute; top: 100%; left: 2px; display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.ask .me .foot { left: auto; right: 2px; }
.ask .msg .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.ask .msg .copy { display: inline-flex; align-items: center; padding: 3px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; opacity: .75; }
.ask .msg .copy:hover, .ask .msg .copy:focus-visible { opacity: 1; background: var(--panel-2); color: var(--text); }
.ask .msg .copy.done { color: var(--accent); opacity: 1; }
.ask .thinking { animation: askPulse 1.8s ease-in-out infinite; }
.ask .thinking .ph { display: inline-block; transition: opacity .18s ease, transform .18s ease; }
.ask .thinking .ph.swap { opacity: 0; transform: translateY(4px); }
.ask .dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.ask .dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: askBounce 1s infinite ease-in-out; }
.ask .dots i:nth-child(2) { animation-delay: .15s; } .ask .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes askBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes askPulse { 50% { opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .ask .thinking, .ask .dots i { animation: none; } .ask .thinking .ph { transition: none; } }
.ask-foot { padding: 6px 12px 10px; font-size: 12px; text-align: center; }
.ask-privacy { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; background: var(--panel); border-radius: inherit; }
.ask-privacy[hidden] { display: none; }
.ask-privacy-body { flex: 1; overflow-y: auto; padding: 18px; display: grid; gap: 8px; align-content: start; }
.ask-privacy-body h3 { margin: 0 0 4px; } .ask-privacy-body h4 { margin: 8px 0 0; font-size: 14px; }
.ask-privacy-body p, .ask-privacy-body li { color: var(--muted); line-height: 1.55; margin: 0; } .ask-privacy-body ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ask-privacy-body strong { color: var(--text); }
.ask-privacy-actions { padding: 12px 18px 18px; border-top: 1px solid var(--line); } .ask-privacy-actions .btn { width: 100%; }
.ask .who { font-size: 12px; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; }
.ask .who .who-ic { display: inline-flex; }
.ask .panel-h { gap: 10px; }
.ask .ask-new { margin-left: auto; padding: 4px 10px; font-size: 13px; }
.ask .ask-x { padding: 4px 6px; margin-left: 4px; line-height: 0; }
.ask .bot { background: var(--panel-2); border: 1px solid var(--line); max-width: 96%; }
.ask form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.ask-field { flex: 1; min-width: 0; display: grid; gap: 4px; }
/* looks like a one-line input until it is used; then it opens up (the script grows it with the text, up to the max height) */
.ask textarea { min-height: 38px; max-height: 220px; height: 38px; resize: none; overflow-y: auto; line-height: 1.45; padding-top: 8px; padding-bottom: 8px; transition: height .12s ease; }
.ask textarea.expanded { min-height: 104px; }
.ask .ask-hint { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .ask textarea { transition: none; } }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.landing .card { width: min(440px, 100%); padding: 28px; }

/* ---------- responsive: structural, not fluid ---------- */
@media (max-width: 1000px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger > div:nth-child(2) { border-right: 0; }
  .ledger > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .docs { grid-template-columns: 1fr; } .docs nav { position: static; max-height: none; grid-auto-flow: column; overflow-x: auto; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 40; transform: translateX(-102%); transition: transform .2s ease-out; height: 100%; }
  .rail.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(5,7,9,.6); z-index: 35; display: none; }
  .scrim.open { display: block; }
  .btn.menu-btn { display: inline-flex; }
  .topbar, .sbx-band { padding-inline: 16px; }
  .content { padding: 20px 16px 64px; }
  td, th { padding: 10px 12px; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) { .ledger dd { font-size: 20px; } .topbar .env button { padding: 5px 10px; } }
/* ---------- Preloader: the home page's brand ring + logo + counting percentage, in the dashboard's colours ---------- */
#bizPreloader { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 200; display: flex; align-items: center; justify-content: center; background: var(--bg); transition: opacity .35s ease, visibility .35s ease; }
#bizPreloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.biz-preloader__inner { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.biz-preloader__ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent-fill); animation: biz-spin .85s linear infinite; }
.biz-preloader__logo { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 0 12px var(--accent-soft)); animation: biz-logo-pulse 1.6s ease-in-out infinite; }
.biz-preloader__pct { position: absolute; bottom: -36px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--muted); min-width: 3ch; text-align: center; }
@keyframes biz-spin { to { transform: rotate(360deg); } }
@keyframes biz-logo-pulse { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.07); opacity: 1; } }

/* ---------- Fresh data: a part of the page that is being re-read fades out and in under a soft ash sheen until the new content lands ---------- */
[data-fresh].is-refreshing { position: relative; pointer-events: none; }
[data-fresh].is-refreshing > * { animation: biz-ash 1.15s ease-in-out infinite; }
[data-fresh].is-refreshing::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--text) 10%, transparent) 50%, transparent 80%); background-size: 220% 100%; animation: biz-sheen 1.3s linear infinite; }
[data-fresh].fresh-in > * { animation: biz-fresh-in .4s ease both; }
@keyframes biz-ash { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }
@keyframes biz-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes biz-fresh-in { from { opacity: .35; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Background-form feedback (assets/business/app.js): a small message tray that never moves the page. */
.toasts { position: fixed; right: 16px; top: 16px; z-index: 80; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
/* The tray is a manual popover (top layer, above any open dialog): undo the popover's own centred-box defaults. */
.toasts[popover] { inset: auto; top: 16px; right: 16px; left: auto; bottom: auto; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible; width: auto; height: auto; }
.toast, .toast.note, .toast.note.ok, .toast.note.bad { background: #14181d; color: #f4f6f8; border: 1px solid #2c333b; border-left-width: 4px; font-size: 14px; line-height: 1.45; opacity: 1; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: opacity .25s ease; }
.toast.note.ok { border-left-color: #3fc982; }
.toast.note.bad { border-left-color: #f2554a; }
.toast.out { opacity: 0; }

/* Documentation: contents list with the section being read, "/" search, AI bar, anchors that clear the sticky header */
.docs h1, .docs h2, .docs h3, .docs [id], .docs .endpoint, .docs p, .docs li, .docs tr, .docs pre { scroll-margin-top: 92px; }
.docs nav a { border-left: 2px solid transparent; border-radius: 0 6px 6px 0; }
.docs nav a.sub { padding-left: 22px; font-size: 13px; }
.docs nav a.active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent-fill); font-weight: 600; }
.docs-search-open { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); color: var(--muted); font: 500 13.5px var(--font); }
.docs-search-open:hover, .docs-search-open:focus-visible { color: var(--text); border-color: var(--accent-fill); }
.docs-search-open span { flex: 1; }
.docs-search-open .ico { width: 15px; height: 15px; }
.docs kbd, .docs-search kbd { font: 600 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); color: var(--muted); }
.docs-ai { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.docs-ai-text { display: grid; gap: 2px; min-width: 220px; flex: 1; }
.docs-ai-text b { font-size: 14px; }
.docs-ai-text span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.docs-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.docs-ai-actions .btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.docs-flash { animation: docsFlash 1.8s ease-out; }
@keyframes docsFlash { 0%, 35% { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
dialog.docs-search { padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); color: var(--text); width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px)); margin: 72px auto auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); overflow: hidden; }
dialog.docs-search[open] { display: flex; flex-direction: column; }
dialog.docs-search::backdrop { background: rgba(0, 0, 0, .55); }
.docs-search-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.docs-search-box .ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.docs-search-box input { all: unset; flex: 1; min-width: 0; font: 500 16px var(--font); color: var(--text); }
.docs-search-box input::placeholder { color: var(--muted); }
.docs-search-results { overflow-y: auto; padding: 6px; min-height: 80px; }
.docs-search-empty { margin: 0; padding: 26px 14px; text-align: center; color: var(--muted); font-size: 14px; }
.docs-hit { all: unset; box-sizing: border-box; display: grid; gap: 2px; width: 100%; padding: 9px 12px; border-radius: 8px; cursor: pointer; border-left: 2px solid transparent; }
.docs-hit.on { background: var(--accent-soft); border-left-color: var(--accent-fill); }
.docs-hit-sec { font-size: 12px; font-weight: 600; color: var(--accent); }
.docs-hit-txt { font-size: 14px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.docs-hit-txt mark { background: transparent; color: var(--accent); font-weight: 700; }
.docs-search-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.docs-search-foot kbd { margin-right: 3px; }
@media (max-width: 1000px) { .docs nav a { border-left: 0; } .docs nav a.sub { padding-left: 10px; } .docs-search-open { white-space: nowrap; } }
@media (prefers-reduced-motion: reduce) { .docs-flash { animation: none; } }

/* Documentation: code samples in several languages */
.docs .code-tabs { margin: 12px 0 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.docs .code-tabs > pre { margin: 0; border: 0; border-radius: 0; background: transparent; }
.docs .code-tabs > pre[hidden] { display: none; }
.docs .code-tabs:not(.ready) > pre[data-lang]::before { content: attr(data-lang); display: block; margin-bottom: 8px; font: 600 11px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.code-tabs-bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); background: var(--panel-2); overflow-x: auto; }
.code-tabs-bar button { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 12px; font: 600 13px var(--font); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.code-tabs-bar button:hover, .code-tabs-bar button:focus-visible { color: var(--text); }
.code-tabs-bar button.on { color: var(--accent); border-bottom-color: var(--accent-fill); }
.docs .responses { margin: 8px 0 22px; }
.docs .resp-title { margin: 14px 0 4px; }
.docs .resp-head { margin: 12px 0 4px; font-size: 14px; }
.docs .resp-head + pre { margin-top: 0; }
.docs .status { font: 600 12px var(--mono); padding: 2px 7px; border-radius: 4px; margin-right: 6px; background: var(--panel-2); color: var(--text); }
.docs .status.s2xx { background: var(--ok-soft); color: var(--ok); }
.docs .status.s4xx, .docs .status.s5xx { background: var(--bad-soft); color: var(--bad); }
.code-tabs-bar .code-copy { margin-left: auto; margin-bottom: 4px; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 12px; color: var(--muted); border-bottom-width: 1px; }
.code-tabs-bar .code-copy:hover { color: var(--text); border-color: var(--accent-fill); }

/* Orders: cancellation allowance charts (numbers and emails side by side) */
.cancel-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 4px 16px 16px; }
.cancel-chart { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.cancel-chart.on { border-color: var(--accent-fill); }
.cancel-chart h3 { margin: 0 0 2px; font-size: 14px; }
.cancel-chart p { margin: 0 0 4px; font-size: 13.5px; }
@media (max-width: 720px) { .cancel-charts { grid-template-columns: 1fr; } }

/* Line charts, period picker, API requests, audit log */
.lc-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.lc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lc-plot { position: relative; }
.lc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.lc-grid { stroke: var(--line); stroke-width: 1; }
.lc-tick { fill: var(--faint); font: 500 11px var(--font); }
.lc-guide { position: absolute; top: 14px; bottom: 26px; width: 1px; background: var(--line-2); pointer-events: none; }
.lc-tip { position: absolute; top: 0; z-index: 3; padding: 8px 10px; border-radius: var(--r-sm); background: #14181d; color: #f4f6f8; border: 1px solid #2c333b; font-size: 12.5px; line-height: 1.5; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.lc-tip b { display: block; margin-bottom: 2px; }
.lc-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.range { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg a { padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border-right: 1px solid var(--line-2); background: var(--panel); }
.seg a:last-child { border-right: 0; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--accent-soft); color: var(--accent); }
.range-custom { display: flex; align-items: center; gap: 6px; }
.range-custom input[type=date] { width: auto; min-height: 34px; padding: 4px 8px; }
.meter { margin: 0 0 12px; }
.meter-h { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 99px; }
.panel-sub { margin: 16px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
a.chip { text-decoration: none; color: var(--text); }
a.chip:hover { border-color: var(--accent-fill); }
.kv-list { margin: 0; padding: 4px 16px 14px; }
.kv-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
pre.json { margin: 0; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; font: 13px/1.6 var(--mono); max-height: 460px; }
.ask-left { font-size: 12px; margin-left: 8px; white-space: nowrap; cursor: help; }
.ask-left.low { color: var(--bad); font-weight: 600; }

/* Documentation on a phone (2026-11-24): long values wrap instead of pushing the page sideways, and every table stays inside the screen. */
.docs article { overflow-wrap: break-word; }
.docs code, .docs td, .docs th { overflow-wrap: anywhere; }
.docs :not(pre) > code { word-break: break-word; }
.docs .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0 18px; }
.docs .table-scroll > table { margin: 0; }
@media (max-width: 700px) {
  .docs { padding: 20px 16px 64px; gap: 20px; }
  .docs h1 { font-size: 25px; }
  .docs h2 { font-size: 18px; margin-top: 34px; }
  .docs p, .docs li { font-size: 15px; }
  .docs table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 13px; }
  .docs th, .docs td { padding: 7px 9px; min-width: 96px; vertical-align: top; }
  .docs th:first-child, .docs td:first-child { min-width: 0; }
  .docs pre { font-size: 12.5px; padding: 12px; }
  .docs .code-tabs-bar { padding: 6px 6px 0; }
  .docs-ai-text { min-width: 0; }
}
