/* Neutral, white-label-ready look (same tokens as the design canvas). --brand is the tenant's colour. */
:root {
  --brand: #1F4FA0;
  --bg: #F3F4F1; --surface: #FFFFFF; --sunk: #ECEEEA; --ink: #15181C; --muted: #545B64; --line: #D9DCD8;
  --good: #1D6B3A; --good-bg: #E3F1E7; --watch: #8A5300; --watch-bg: #FBEFD9; --risk: #B02A1E; --risk-bg: #FBE6E3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417; --surface: #1A1D21; --sunk: #22262B; --ink: #ECEEF0; --muted: #A3AAB3; --line: #30353B;
    --good: #6FCB8F; --good-bg: #18301F; --watch: #E8B05A; --watch-bg: #33280F; --risk: #F08A7E; --risk-bg: #3A1C19;
    --brand: #6E9BE8;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 'IBM Plex Sans', system-ui, sans-serif; }
a { color: var(--brand); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1 { font-size: 26px; font-weight: 600; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 20px; }
header { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.logo { width: 28px; height: 28px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
#nav { display: flex; flex-wrap: wrap; gap: 4px 20px; flex-grow: 1; }
#nav a { color: var(--muted); text-decoration: none; }
#nav a.on { color: var(--ink); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.row > .grow { flex: 999 1 560px; min-width: 0; }
.row > .side { flex: 1 1 320px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px 'IBM Plex Sans', sans-serif; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.small-btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select {
  min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 14px 'IBM Plex Sans', sans-serif; }
.check { display: flex; gap: 10px; align-items: center; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
table { width: 100%; border-collapse: collapse; }
th { font: 500 12px 'IBM Plex Sans', sans-serif; color: var(--muted); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; }
.scroll { overflow-x: auto; }
.pill { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill.good, .pill.done, .pill.green { background: var(--good-bg); color: var(--good); }
.pill.watch, .pill.needs_review, .pill.amber, .pill.resume { background: var(--watch-bg); color: var(--watch); }
.pill.risk, .pill.failed, .pill.red { background: var(--risk-bg); color: var(--risk); }
.pill.running, .pill.queued { background: var(--brand); color: #fff; }
.err { padding: 10px 14px; border-radius: 8px; background: var(--risk-bg); color: var(--risk); }
.ok { padding: 10px 14px; border-radius: 8px; background: var(--good-bg); color: var(--good); }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.drop.over { border-color: var(--brand); background: var(--sunk); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11px 'IBM Plex Mono', monospace;
  border: 1.5px solid var(--line); color: var(--muted); background: var(--surface); }
.dot.done { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.dot.now { background: var(--brand); border-color: var(--brand); color: #fff; }
.dot.wait { background: var(--watch-bg); border-color: var(--watch); color: var(--watch); }
.lines { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
pre { margin: 6px 0 0; padding: 10px; background: var(--sunk); border-radius: 8px; font: 12px/1.45 'IBM Plex Mono', monospace; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi .v { font: 500 24px/1.2 'IBM Plex Mono', monospace; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.barrow { display: grid; grid-template-columns: minmax(0, 1fr) 36px 90px; gap: 10px; align-items: center; font-size: 13px; }
.track { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.track span { display: block; height: 100%; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opts label { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.opts label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.opts input { accent-color: var(--brand); width: 18px; height: 18px; }
.login { max-width: 400px; margin: 10vh auto 0; }
.progress { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width .4s; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* public read-only demo: nothing that writes is shown */
body.readonly form, body.readonly .write, body.readonly #go, body.readonly #llm, body.readonly label:has(#llm) { display: none !important; }
.demo-banner { margin: 12px auto 0; max-width: 1200px; padding: 10px 14px; border-radius: 10px; font-size: 14px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
