:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f3f2ef; --hover: rgba(11, 11, 11, .04);
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781; --grid: #e1e0d9; --axis: #c3c2b7;
  --border: rgba(11, 11, 11, .10); --accent: #2a78d6; --accent-wash: rgba(42, 120, 214, .10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --up-good: #006300; --down-bad: #b42828;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --hover: rgba(255, 255, 255, .05);
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
    --border: rgba(255, 255, 255, .10); --accent: #3987e5; --accent-wash: rgba(57, 135, 229, .14);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --up-good: #0ca30c; --down-bad: #e66767; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --hover: rgba(255, 255, 255, .05);
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255, 255, 255, .10); --accent: #3987e5; --accent-wash: rgba(57, 135, 229, .14);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --up-good: #0ca30c; --down-bad: #e66767; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
[hidden] { display: none !important; }

/* ---- header ---- */
header.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; white-space: nowrap; color: var(--ink); }
.brand svg { color: var(--accent); }
nav.main { display: flex; gap: 2px; }
nav.main a { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
nav.main a:hover { background: var(--hover); text-decoration: none; }
nav.main a.on { background: var(--accent-wash); color: var(--accent); }
.omni { flex: 1 1 320px; min-width: 220px; position: relative; }
.omni input { width: 100%; padding: 8px 12px 8px 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); outline: none; }
.omni input:focus { border-color: var(--accent); background: var(--surface); }
.omni svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.omni .hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); pointer-events: none; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 5px 9px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.icon { padding: 5px 7px; }
select.sel { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.demo { background: rgba(250, 178, 25, .15); border-color: rgba(250, 178, 25, .5); color: var(--ink); }
.updated { font-size: 12px; color: var(--muted); white-space: nowrap; }

main { padding: 18px 20px 60px; max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; font-weight: 650; }
.page-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--surface-2); border-radius: 99px; padding: 0 6px; margin-left: 4px; color: var(--ink-2); }

/* ---- grid & cards ---- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c3 { grid-column: span 3; } .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; }
@media (max-width: 1200px) { .c3, .c4 { grid-column: span 6; } .c5, .c7, .c8, .c6 { grid-column: span 12; } }
@media (max-width: 720px) { .c3, .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; } main { padding: 14px 16px 60px; } .top-row { padding: 10px 16px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card .card-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.card-tools { display: flex; gap: 6px; align-items: center; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.linkbtn:hover { color: var(--ink); background: var(--hover); }
.empty { color: var(--muted); padding: 22px 6px; text-align: center; font-size: 13px; }
.empty b { color: var(--ink-2); font-weight: 600; display: block; margin-bottom: 2px; }
.err { color: var(--critical); background: rgba(208, 59, 59, .07); border: 1px solid rgba(208, 59, 59, .25); padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.loading { color: var(--muted); font-size: 13px; padding: 20px 4px; display: flex; align-items: center; gap: 10px; }
.loading::before { content: ''; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation-duration: 3s; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--hover), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---- KPI tiles ---- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.tile .label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile .value { font-size: 24px; font-weight: 620; margin-top: 2px; letter-spacing: -.01em; white-space: nowrap; }
.tile .value small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.tile .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: 4px; min-height: 26px; }
.tile .delta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.delta.good { color: var(--up-good); } .delta.bad { color: var(--down-bad); }
.tile .spark { flex: 0 0 auto; }
.tile.hero { grid-column: span 2; }
.tile.hero .value { font-size: 40px; }
@media (max-width: 720px) { .tile.hero { grid-column: span 1; } }

/* ---- status ---- */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.status i { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; font-weight: 800; flex: none; }
.status.good i { background: var(--good); } .status.warning i { background: var(--warning); color: #3a2a00; }
.status.serious i { background: var(--serious); } .status.critical i { background: var(--critical); }
.status.info i { background: var(--accent); }

.banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 14px; flex-wrap: wrap; box-shadow: var(--shadow); }
.banner .what { font-weight: 600; }
.banner .why { color: var(--ink-2); font-size: 13px; flex: 1; min-width: 200px; }
.banner.critical { border-left: 4px solid var(--critical); } .banner.warning { border-left: 4px solid var(--warning); }
.banner.good { border-left: 4px solid var(--good); } .banner.serious { border-left: 4px solid var(--serious); }

/* ---- fleet tiles ---- */
.fleet-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.app-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: block; color: var(--ink); position: relative; min-width: 0; }
.app-tile:hover { border-color: var(--accent); text-decoration: none; }
.app-tile .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.app-tile .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-tile .kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.app-tile .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; font-size: 12px; }
.app-tile .stats b { display: block; font-size: 14px; font-weight: 600; }
.app-tile .stats span { color: var(--muted); font-size: 11px; }
.app-tile .why { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-tile.critical { box-shadow: inset 3px 0 0 var(--critical); } .app-tile.warning { box-shadow: inset 3px 0 0 var(--warning); } .app-tile.serious { box-shadow: inset 3px 0 0 var(--serious); }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.filters input[type=search] { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 10px; min-width: 200px; outline: none; }
.filters input[type=search]:focus { border-color: var(--accent); }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 3px 10px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th .arrow { color: var(--accent); font-size: 10px; margin-left: 3px; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.tbl td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl .wrap { max-width: 520px; overflow-wrap: anywhere; }
.tbl .clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; font-size: 12px; color: var(--muted); }
.cellbar { display: inline-block; height: 6px; border-radius: 0 3px 3px 0; background: var(--s1); vertical-align: middle; margin-right: 6px; opacity: .85; }
.pct-bad { color: var(--down-bad); font-weight: 600; }

/* ---- charts ---- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bars .b { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; cursor: default; }
.bars .b.click { cursor: pointer; }
.bars .b.click:hover .lbl { color: var(--accent); }
.bars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bars .track { height: 10px; position: relative; }
.bars .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .fill.bad { background: var(--critical); }
.bars .val { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; min-width: 54px; text-align: right; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .14); max-width: 360px; }
.tip .t { color: var(--muted); margin-bottom: 4px; font-size: 11.5px; }
.tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .r span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip .r b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.small-multiples { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ---- drawer (transaction, ask, blob viewer) ---- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); border-left: 1px solid var(--border); z-index: 50; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); transform: translateX(100%); transition: transform .2s ease; }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { padding: 14px 18px; overflow: auto; flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }

.wf { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.wf-row { display: grid; grid-template-columns: minmax(200px, 44%) 1fr; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.wf-row:hover { background: var(--hover); }
.wf-row .nm { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wf-row .typ { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.wf-row .typ.exception { background: rgba(208, 59, 59, .14); color: var(--critical); }
.wf-row .lane { position: relative; height: 14px; }
.wf-row .bar { position: absolute; top: 3px; height: 8px; border-radius: 2px; background: var(--s1); min-width: 2px; }
.wf-row .bar.fail { background: var(--critical); }
.wf-row .bar.point { width: 8px !important; height: 8px; border-radius: 50%; }
.wf-detail { grid-column: 1 / -1; background: var(--surface-2); border-radius: 6px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: auto; }

pre.code { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; max-height: 520px; overflow: auto; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.check:last-child { border-bottom: 0; }
.check .area { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.check .ttl { font-weight: 600; }
.check .det { color: var(--ink-2); font-size: 13px; }
.check details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; margin-top: 4px; }

/* ---- ask ---- */
.ask-log { display: flex; flex-direction: column; gap: 14px; }
.msg.user { align-self: flex-end; background: var(--accent-wash); padding: 8px 12px; border-radius: 10px 10px 2px 10px; max-width: 85%; }
.msg.bot { font-size: 13.5px; }
.msg.bot h1, .msg.bot h2, .msg.bot h3 { font-size: 14px; margin: 12px 0 4px; }
.msg.bot p { margin: 6px 0; }
.msg.bot ul, .msg.bot ol { margin: 6px 0; padding-left: 20px; }
.msg.bot code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.msg.bot pre { background: var(--surface-2); padding: 8px 10px; border-radius: 6px; overflow: auto; }
.msg.bot table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.msg.bot td, .msg.bot th { border: 1px solid var(--grid); padding: 4px 6px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.steps span { font-size: 11px; font-family: var(--mono); background: var(--surface-2); color: var(--ink-2); padding: 1px 6px; border-radius: 4px; }
.steps span.bad { color: var(--critical); }
.ask-input { border-top: 1px solid var(--border); padding: 12px 18px; display: flex; gap: 8px; }
.ask-input textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); min-height: 42px; max-height: 160px; outline: none; }
.ask-input textarea:focus { border-color: var(--accent); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dots::after { content: '…'; animation: dots 1s steps(3) infinite; }

.blob-view { font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; max-height: 70vh; overflow: auto; }
.blob-view mark { background: rgba(250, 178, 25, .45); color: inherit; border-radius: 2px; }
.blob-view .err-line { color: var(--critical); }
.pathbar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 10px; }
.pathbar a { cursor: pointer; }
kbd { font: 11px var(--mono); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface-2); }

/* incident signals */
.sig-line { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-top: 1px solid var(--grid); color: var(--ink); flex-wrap: wrap; }
.sig-line:hover { background: var(--surface-2); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 200px; }
.sig-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px 2px 8px; font-size: 12px; color: var(--ink-2); background: var(--surface); }
.sig-chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sig-chip .status i { width: 14px; height: 14px; }
.sig-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
pre.code.sample { margin: 6px 0; max-height: 96px; overflow: auto; white-space: pre-wrap; font-size: 12px; }
.sig-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.steps { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; }
.step { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 10px; cursor: pointer; text-align: left; color: var(--ink); flex: none; }
.step:hover { border-color: var(--accent); }
.step.bad { border-color: var(--critical); }
.step b { display: block; font-size: 12.5px; font-weight: 600; }
.step small { color: var(--muted); font-size: 11px; }
.steps .gap { font-size: 11px; color: var(--muted); flex: none; white-space: nowrap; }
.steps .gap::before { content: '→ '; }

/* order trace */
.omni.small { position: static; width: 220px; }
.omni.small input { width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.tr-run { border: 1px solid var(--border); border-left: 4px solid var(--good); border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; background: var(--surface); }
.tr-run.bad { border-left-color: var(--critical); }
.tr-run.blob { border-left-color: var(--s3); }
.tr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tr-head .muted { font-size: 12px; }
.tr-head .linkbtn { margin-left: auto; color: var(--accent); }
.lane-chip { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; color: var(--ink); background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.tr-step { display: grid; grid-template-columns: 18px 70px 1fr; gap: 6px; padding: 3px 0 3px 4px; font-size: 12.5px; color: var(--ink-2); }
.tr-step.hit .tx { color: var(--ink); font-weight: 600; }
.tr-step.hit .tx .muted { font-weight: 400; }
.tr-step.bad .tx { color: var(--critical); }
.tr-step .ic { text-align: center; }
.tr-step .tm { color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-step .tx .muted { font-size: 12px; overflow-wrap: anywhere; }
.tr-gap { margin: -2px 0 8px 20px; padding-left: 12px; border-left: 2px dashed var(--border); color: var(--muted); font-size: 12px; line-height: 22px; }
.badge.warn { border-color: var(--warning); color: var(--ink); }

/* sign-in */
#gate { position: fixed; inset: 0; z-index: 60; background: var(--page); display: grid; place-items: start center; overflow: auto; padding: 12vh 16px 32px; }
.gate-box { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.gate-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); }
.gate-box h2 { margin: 0; font-size: 18px; }
.gate-box form { display: grid; gap: 10px; }
.gate-box label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.gate-box label.check { display: flex; align-items: center; gap: 8px; }
.gate-box input:not([type=checkbox]) { font-size: 15px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.gate-err { color: var(--critical); min-height: 1em; font-size: 13.5px; margin: 0; }
.gate-hint { color: var(--muted); font-size: 13px; margin: 0; }
.acct { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* admin */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 14px; }
.form-grid label, .inline-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.form-grid input, .form-grid select, .inline-form input, .inline-form select { font-size: 13.5px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--ink); min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 10px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.steps-list { margin-top: 10px; }
.note { font-size: 12.5px; color: var(--muted); }
.tr-run.warn { border-left-color: var(--warning); }
.badge.bad { border-color: var(--critical); color: var(--critical); }
.badge.warn { border-color: var(--warning); }
.tr-run.info { border-left-color: var(--muted); }
.tr-run.other { opacity: .65; }
.tr-run.send { border-left-color: var(--s4); }
.ic-send { color: var(--s4); font-weight: 700; }
a.step { text-decoration: none; }

/* order story trees */
.tflow { margin-bottom: 14px; }
.tflow-head { font-size: 14px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.tbranch { border-left: 2px solid var(--border); margin: 0 0 10px 8px; padding: 2px 0 2px 12px; }
.tsend { font-size: 13px; margin: 2px 0 4px; display: flex; gap: 8px; align-items: center; }
.tchild { margin-left: 18px; padding-left: 12px; border-left: 2px dotted var(--border); }
.tnode { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tnode:hover { background: var(--hover); }
.tnode .why { font-size: 12px; color: var(--ink-2); }
.tnode .why.warn { color: var(--ink); } .tnode .why.failed { color: var(--critical); }
.hop { font-size: 12px; color: var(--muted); padding: 2px 6px; }
.hop.slow { color: var(--ink); background: color-mix(in srgb, var(--warning) 14%, transparent); border-radius: 6px; display: inline-block; }

/* drill-down tiles */
a.tile.drill { color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color .12s, transform .12s; }
a.tile.drill:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile .label .more { margin-left: auto; color: var(--muted); font-size: 15px; line-height: 1; }
a.tile.drill:hover .label .more { color: var(--accent); }

/* order flowchart */
.fc { display: grid; gap: 16px; margin-top: 4px; }
.fc-sec h4 { margin: 0 0 8px; font-size: 14px; }
.fc-row { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; padding: 10px 0; border-top: 1px solid var(--grid); }
.fc-row:first-of-type { border-top: 0; }
.fc-label { width: 104px; flex: none; display: flex; flex-direction: column; gap: 2px; font-size: 13px; padding: 6px 8px 6px 0; }
.fc-label small { color: var(--muted); font-size: 11.5px; }
.fc-label .linkbtn { align-self: flex-start; padding: 0; color: var(--accent); }
.fc-box { display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 170px; max-width: 240px; padding: 8px 10px; border: 1px solid var(--border); border-left: 4px solid var(--good); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.fc-box:hover { border-color: var(--accent); }
.fc-box.warn { border-left-color: var(--warning); } .fc-box.excluded { border-left-color: var(--muted); } .fc-box.failed { border-left-color: var(--critical); }
.fc-box.ghost { border-style: dashed; border-left-width: 1px; background: transparent; color: var(--muted); cursor: default; }
.fc-top { display: flex; gap: 6px; align-items: center; }
.fc-top b { font-weight: 600; font-size: 12.5px; }
.fc-box small { color: var(--muted); font-size: 11.5px; }
.fc-box .fc-why { color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fc-box.failed .fc-why { color: var(--critical); }
.fc-retry { align-self: flex-start; margin-top: 2px; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: color-mix(in srgb, var(--warning) 18%, transparent); }
.fc-hop { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 96px; padding: 0 6px; font-size: 11px; color: var(--muted); text-align: center; }
.fc-hop .fc-q { color: var(--ink-2); max-width: 170px; overflow-wrap: anywhere; line-height: 1.3; }
.fc-arrow { display: block; width: 100%; height: 2px; background: var(--axis); position: relative; margin: 4px 0; }
.fc-arrow::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--axis); border-right: 0; }
.fc-hop.slow small { color: var(--ink); font-weight: 600; }
.fc-hop.slow .fc-arrow { background: var(--warning); } .fc-hop.slow .fc-arrow::after { border-left-color: var(--warning); }
.fc-legend { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) { .fc-row { flex-direction: column; } .fc-hop { min-width: 0; flex-direction: row; gap: 8px; padding: 4px 0 4px 18px; } .fc-arrow { width: 2px; height: 14px; } .fc-arrow::after { display: none; } .fc-box { max-width: none; } .fc-label { width: auto; flex-direction: row; gap: 8px; } }
.fc-note { align-self: center; font-size: 12px; color: var(--ink-2); max-width: 220px; padding: 6px 4px; }
.update-note { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: 13px; }
.fc-box.unknown { border-left-color: var(--border); border-left-style: dashed; }
.fc-story { font-size: 13.5px; margin: 0 0 8px; }
.fc-flag { color: var(--ink); font-weight: 600; }
.fc-label .fc-flag { font-size: 11px; }

/* rickshaw loader */
.ride { display: flex; flex-direction: column; gap: 10px; padding: 18px 6px 14px; }
.ride-road { position: relative; height: 34px; max-width: 520px; border-bottom: 2px dashed var(--border); overflow: hidden; }
.ride-auto { position: absolute; bottom: 2px; left: 0; font-size: 26px; line-height: 1; animation: ride 4.8s ease-in-out infinite; }
@keyframes ride {
  0% { left: 0; transform: scaleX(-1) translateY(0); }
  10% { transform: scaleX(-1) translateY(-2px); }
  20% { transform: scaleX(-1) translateY(0); }
  30% { transform: scaleX(-1) translateY(-2px); }
  45% { left: calc(100% - 32px); transform: scaleX(-1) translateY(0); }
  50% { left: calc(100% - 32px); transform: scaleX(1) translateY(0); }
  65% { transform: scaleX(1) translateY(-2px); }
  80% { transform: scaleX(1) translateY(0); }
  95% { left: 0; transform: scaleX(1) translateY(0); }
  100% { left: 0; transform: scaleX(-1) translateY(0); }
}
.ride-text { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ride-text b { font-weight: 600; }
.ride-text small { color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .ride-auto { animation: none; left: 8px; } }
