/* OtoQ console. DESIGN.md is the reference; change it there first.
   No script, no outbound request: fonts and this file are served by OtoQ itself. */

@font-face { font-family:"IBM Plex Sans"; font-weight:400; font-style:normal; font-display:swap; src:url("fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-weight:500; font-style:normal; font-display:swap; src:url("fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-weight:600; font-style:normal; font-display:swap; src:url("fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-weight:400; font-style:normal; font-display:swap; src:url("fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-weight:500; font-style:normal; font-display:swap; src:url("fonts/IBMPlexMono-Medium-Latin1.woff2") format("woff2"); }

/* ---- tokens: light ---------------------------------------------------------------------- */
:root {
  color-scheme:light dark;
  --page:#ffffff; --bg:#f5f7fa; --surface:#f5f7fa; --sunken:#edf0f5; --raised:#ffffff;
  --line:#e3e8ef; --line-2:#d5dbe3; --line-strong:#7f8a99;
  --ink:#0f1b2d; --ink-2:#3a4657; --muted:#5c6878;
  --qr-ground:#ffffff; --qr-ink:#0b1220;
  --oxford:#04172e; --sky:#0077b6; --sky-deep:#005e8f; --sky-tint:#e8f3fb; --sky-line:#c9e2f3;
  --ok:#146c43; --ok-bg:#e3f5ea; --ok-dot:#1f9d5c;
  --busy:#7a4e00; --busy-bg:#fff1d6; --busy-dot:#d99a0b;
  --bad:#a32d22; --bad-bg:#fbe9e7; --bad-solid:#b3261e; --bad-dot:#d23b2f;
  --quiet:#3f4a5a; --quiet-bg:#edf0f5; --quiet-dot:#9aa5b4;
  --nav-bg:#04172e; --nav-ink:#c3cedd; --nav-ink-strong:#ffffff; --nav-muted:#8798b0;
  --nav-hover:rgba(255,255,255,.06); --nav-current:rgba(79,179,232,.14); --nav-line:rgba(255,255,255,.08);
  --nav-accent:#4fb3e8; --nav-mark:#0a2a50; --nav-avatar:#0e3563; --nav-avatar-ink:#d7e6f5;
  --nav-warn:#f1c35b; --nav-warn-bg:rgba(241,195,91,.16);
  --sky-press:#004e78; --bad-press:#8f1d17;
  --shadow-pop:0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.08);
  --font:"IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:"IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-xs:2px; --r-sm:5px; --r-md:7px; --r-mark:8px; --r-lg:10px;
  --ease:cubic-bezier(.22,1,.36,1); --fast:160ms;
  --z-sticky:10; --z-nav:20;
}
/* ---- tokens: dark (the viewer's system setting) ------------------------------------------- */
@media (prefers-color-scheme:dark) {
  :root {
    --page:#0b1220; --bg:#0b1220; --surface:#111a2b; --sunken:#0f1727; --raised:#131e31;
    --line:#1e2a3e; --line-2:#26344b; --line-strong:#5b6b83;
    --ink:#e7edf5; --ink-2:#b7c2d1; --muted:#8e9bb0;
    --oxford:#e7edf5; --sky:#5cb8ea; --sky-deep:#1d72ad; --sky-tint:#10243a; --sky-line:#1b3a57;
    --ok:#74d8a0; --ok-bg:#0f2e20; --ok-dot:#3cc27a;
    --busy:#f1c35b; --busy-bg:#302409; --busy-dot:#e0a51f;
    --bad:#ff948a; --bad-bg:#371413; --bad-solid:#c8322a; --bad-dot:#f0564a;
    --quiet:#b7c2d1; --quiet-bg:#1a2537; --quiet-dot:#6b7a91;
    --nav-bg:#060d18; --nav-ink:#b8c4d4; --nav-muted:#7b8aa1; --nav-line:rgba(255,255,255,.06);
    --shadow-pop:0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.45);
    --sky-press:#2583c4; --bad-press:#e04237;
  }
}

/* ---- base ---------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font:400 14px/1.5 var(--font); color:var(--ink); background:var(--page); -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; font-feature-settings:"ss02" 0; }
a { color:var(--sky); text-decoration:none; }
a:hover { text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1px; }
:focus-visible { outline:2px solid var(--sky); outline-offset:2px; border-radius:var(--r-sm); }
code, .mono { font-family:var(--mono); font-size:12.5px; }
.muted { color:var(--muted); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
svg.i { width:16px; height:16px; flex:none; stroke:currentColor; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.skip { position:absolute; left:12px; top:-40px; padding:8px 12px; background:var(--sky-deep); color:#fff; border-radius:var(--r-md); z-index:var(--z-nav); }
.skip:focus { top:12px; }

/* ---- shell ------------------------------------------------------------------------------- */
.shell { display:grid; grid-template-columns:236px minmax(0, 1fr); min-height:100vh; }
.nav { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; background:var(--nav-bg); color:var(--nav-ink); padding:18px 12px 14px; overflow-y:auto; z-index:var(--z-nav); }
.nav .brand { display:flex; align-items:center; gap:10px; padding:2px 8px 18px; color:var(--nav-ink-strong); }
.nav .brand:hover { text-decoration:none; }
.brand .mark { width:28px; height:28px; border-radius:var(--r-mark); background:var(--nav-mark); border:1px solid var(--nav-line); display:grid; place-items:center; }
.brand .mark svg { width:16px; height:16px; stroke:var(--nav-accent); fill:none; stroke-width:2; stroke-linecap:round; }
.brand .word { display:block; font-size:16px; font-weight:600; letter-spacing:-.01em; line-height:1.1; }
.brand .by { display:block; font-size:11.5px; color:var(--nav-muted); margin-top:1px; }
.nav .group { margin:10px 0 4px; }
.nav .group-label { display:block; padding:0 10px 6px; font-size:11.5px; color:var(--nav-muted); font-weight:500; }
.nav a.item { display:flex; align-items:center; gap:10px; height:34px; padding:0 10px; border-radius:var(--r-md); color:var(--nav-ink); font-weight:500; font-size:13.5px; position:relative; transition:background var(--fast) var(--ease), color var(--fast) var(--ease); }
.nav a.item:hover { background:var(--nav-hover); color:var(--nav-ink-strong); text-decoration:none; }
.nav a.item[aria-current="page"] { background:var(--nav-current); color:var(--nav-ink-strong); }
.nav a.item[aria-current="page"] svg.i { color:var(--nav-accent); }
.nav a.item .end { margin-left:auto; display:inline-flex; gap:6px; align-items:center; }
.nav .tally { font-size:12px; color:var(--nav-muted); font-variant-numeric:tabular-nums; }
.nav .alarm { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:18px; padding:0 6px; border-radius:999px; background:var(--bad-solid); color:#fff; font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; }
.nav .warn { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:18px; padding:0 6px; border-radius:999px; background:var(--nav-warn-bg); color:var(--nav-warn); font-size:11px; font-weight:600; }
.nav .spacer { flex:1; }
.nav .me { display:flex; align-items:center; gap:10px; padding:12px 8px 0; border-top:1px solid var(--nav-line); margin-top:12px; }
.me .avatar { width:30px; height:30px; border-radius:999px; background:var(--nav-avatar); color:var(--nav-avatar-ink); display:grid; place-items:center; font-weight:600; font-size:13px; flex:none; text-transform:uppercase; }
.me .who { min-width:0; line-height:1.25; }
.me .who b { display:block; color:var(--nav-ink-strong); font-weight:500; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.me .who span { font-size:12px; color:var(--nav-muted); }
.me .me-link { display:flex; align-items:center; gap:10px; min-width:0; flex:1; padding:4px; margin:-4px; border-radius:var(--r-md); color:inherit; transition:background var(--fast) var(--ease); }
.me .me-link:hover, .me .me-link[aria-current="page"] { background:var(--nav-hover); text-decoration:none; }
.me form { margin:0 0 0 auto; }
.me button { height:30px; width:30px; padding:0; justify-content:center; background:transparent; border:1px solid var(--nav-line); color:var(--nav-ink); border-radius:var(--r-md); }
.me button:hover { background:var(--nav-hover); color:var(--nav-ink-strong); }
.content { min-width:0; }
.main { padding:28px 36px 64px; max-width:1480px; }

/* ---- page header ------------------------------------------------------------------------ */
.crumbs { display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted); margin:0 0 10px; flex-wrap:wrap; }
.crumbs a { color:var(--muted); }
.crumbs a:hover { color:var(--ink); }
.crumbs .sep { opacity:.6; }
.head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.head .title { min-width:0; }
h1 { margin:0; font-size:24px; font-weight:600; line-height:1.2; letter-spacing:-.015em; text-wrap:balance; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
h1 .kind { font-size:13px; font-weight:500; color:var(--muted); letter-spacing:0; }
.subline { display:flex; align-items:center; gap:8px 16px; flex-wrap:wrap; margin:8px 0 0; color:var(--ink-2); font-size:13px; }
.subline .sep { width:1px; height:14px; background:var(--line-2); }
.head .actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding-top:2px; }
.lede { max-width:72ch; color:var(--ink-2); margin:12px 0 0; text-wrap:pretty; }
.lede code, .note code { font-size:12px; background:var(--sunken); padding:1px 5px; border-radius:var(--r-sm); }
h2 { font-size:15px; font-weight:600; line-height:1.3; margin:0; letter-spacing:-.005em; }
.section { margin:28px 0 0; }
.section-head { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin:0 0 10px; flex-wrap:wrap; }
.section-head p { margin:0; color:var(--muted); font-size:13px; }

/* ---- tabs: object pages (real links, one per view) --------------------------------------- */
.tabs { display:flex; gap:22px; border-bottom:1px solid var(--line); margin:22px 0 0; overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tabs a { position:relative; display:inline-flex; align-items:center; gap:7px; padding:10px 0 11px; color:var(--muted); font-weight:500; font-size:13.5px; white-space:nowrap; }
.tabs a:hover { color:var(--ink); text-decoration:none; }
.tabs a[aria-current="page"] { color:var(--ink); }
.tabs a[aria-current="page"]::after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; border-radius:var(--r-xs) 2px 0 0; background:var(--sky); }
.tabs .n { display:inline-flex; align-items:center; height:18px; padding:0 6px; border-radius:999px; background:var(--sunken); color:var(--ink-2); font-size:11.5px; font-variant-numeric:tabular-nums; }
.tab-body { padding-top:22px; }

/* ---- segmented control: filters -------------------------------------------------------- */
.toolbar { display:flex; align-items:center; gap:12px 16px; flex-wrap:wrap; margin:20px 0 14px; }
.toolbar .grow { flex:1; }
.seg { display:inline-flex; gap:2px; padding:3px; background:var(--sunken); border-radius:var(--r-lg); max-width:100%; overflow-x:auto; scrollbar-width:none; }
.seg::-webkit-scrollbar { display:none; }
.seg a { flex:none; display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 11px; border-radius:var(--r-md); color:var(--ink-2); font-size:13px; font-weight:500; transition:background var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.seg a:hover { color:var(--ink); text-decoration:none; }
.seg a[aria-current="true"] { background:var(--raised); color:var(--ink); box-shadow:0 1px 2px rgba(15,27,45,.08), 0 0 0 1px var(--line); }
.filters { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0; }
.filters .field-inline { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12.5px; margin:0; }
.result-count { margin:0 0 10px; color:var(--muted); font-size:12.5px; }

/* ---- buttons ------------------------------------------------------------------------------ */
button, .btn { font:500 13px/1 var(--font); height:32px; padding:0 13px; border-radius:var(--r-md); border:1px solid var(--line-2); background:var(--raised); color:var(--ink); cursor:pointer; display:inline-flex; align-items:center; gap:7px; white-space:nowrap; transition:background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); box-shadow:0 1px 0 rgba(15,27,45,.03); }
button:hover, .btn:hover { background:var(--surface); border-color:var(--line-strong); text-decoration:none; }
button:active, .btn:active { transform:translateY(.5px); }
.btn-primary, button.btn-primary { background:var(--sky-deep); border-color:var(--sky-deep); color:#fff; box-shadow:0 1px 2px rgba(0,94,143,.25); }
.btn-primary:hover, button.btn-primary:hover { background:var(--sky-press); border-color:var(--sky-press); }
.btn-danger, button.btn-danger { color:var(--bad); }
.btn-danger:hover, button.btn-danger:hover { background:var(--bad-bg); border-color:var(--bad); }
.btn-solid-danger, button.btn-solid-danger { background:var(--bad-solid); border-color:var(--bad-solid); color:#fff; }
.btn-solid-danger:hover, button.btn-solid-danger:hover { background:var(--bad-press); border-color:var(--bad-press); }
.btn-ghost, button.btn-ghost { background:transparent; border-color:transparent; box-shadow:none; color:var(--ink-2); }
.btn-ghost:hover, button.btn-ghost:hover { background:var(--sunken); border-color:transparent; color:var(--ink); }
.btn-sm, button.btn-sm { height:28px; padding:0 10px; font-size:12.5px; }
.btn-xs, button.btn-xs { height:24px; padding:0 8px; font-size:12px; gap:5px; }
button:disabled, .btn[aria-disabled="true"] { background:var(--sunken); color:var(--muted); border-color:var(--line); cursor:not-allowed; box-shadow:none; }

/* ---- form controls ----------------------------------------------------------------------- */
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], input[type=number], input[type=file], select, textarea { font:400 13px/20px var(--font); color:var(--ink); background:var(--raised); border:1px solid var(--line-strong); border-radius:var(--r-md); padding:5px 9px; height:32px; transition:border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline:none; border-color:var(--sky); box-shadow:0 0 0 3px var(--sky-tint); border-radius:var(--r-md); }
input[type=file] { height:auto; padding:6px 9px; }
input.sm, select.sm { height:28px; font-size:12.5px; padding:3px 8px; }
textarea { height:auto; font-family:var(--mono); font-size:12.5px; line-height:1.5; }
::placeholder { color:var(--muted); opacity:1; }
select { padding-right:28px; appearance:none; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%237f8a99' stroke-width='1.5'/></svg>"); background-repeat:no-repeat; background-position:right 10px center; }
input[type=checkbox] { width:16px; height:16px; accent-color:var(--sky-deep); margin:0; flex:none; }
.field { display:grid; gap:6px; margin:0 0 16px; font-size:13px; font-weight:500; color:var(--ink); }
.field .hint { font-weight:400; color:var(--muted); font-size:12.5px; }
.field input:not([type=checkbox]), .field select, .field textarea { width:100%; }
.form { max-width:560px; }
.form-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:0 16px; align-items:end; }
.form-actions { display:flex; align-items:center; gap:10px; margin-top:8px; flex-wrap:wrap; }
.checklist { display:grid; gap:2px; margin:0 0 16px; padding:6px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--raised); max-height:340px; overflow-y:auto; }
.checklist label { display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border-radius:var(--r-md); cursor:pointer; font-size:13px; }
.checklist label:hover { background:var(--surface); }
.checklist label:has(input:checked) { background:var(--sky-tint); }
.checklist .q { font-family:var(--mono); font-size:12.5px; color:var(--ink); }
.checklist .used { display:block; color:var(--muted); font-size:12px; margin-top:1px; }
fieldset { border:0; padding:0; margin:0; min-width:0; }
legend { font-size:13px; font-weight:500; margin-bottom:6px; padding:0; }

/* ---- tables ------------------------------------------------------------------------------ */
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--raised); }
table { border-collapse:separate; border-spacing:0; width:100%; font-size:13px; line-height:1.4; font-variant-numeric:tabular-nums; }
thead th { position:sticky; top:0; z-index:var(--z-sticky); background:var(--surface); text-align:left; font-size:12px; font-weight:500; color:var(--muted); padding:9px 14px; border-bottom:1px solid var(--line); white-space:nowrap; }
thead th:first-child { border-top-left-radius:var(--r-lg); }
thead th:last-child { border-top-right-radius:var(--r-lg); }
th a.sort { color:inherit; display:inline-flex; align-items:center; gap:4px; }
th a.sort:hover { color:var(--ink); text-decoration:none; }
th a.sort.current { color:var(--ink); }
th a.sort .dir { width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; }
th a.sort .dir.desc { border-top:5px solid currentColor; }
th a.sort .dir.asc { border-bottom:5px solid currentColor; }
td { padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
tbody tr:last-child > td { border-bottom:0; }
tbody tr { transition:background var(--fast) var(--ease); }
tbody tr:hover > td { background:var(--surface); }
td.num, th.num { text-align:right; }
td.nowrap, th.nowrap { white-space:nowrap; }
td.wrap { min-width:18ch; max-width:48ch; }
td .sub { display:block; color:var(--muted); font-size:12px; margin-top:2px; }
td .working + .working { margin-top:6px; }
td .working a { white-space:nowrap; }
td a.row-link { color:var(--ink); font-weight:500; }
td a.row-link:hover { color:var(--sky); }
td .id { font-family:var(--mono); font-size:12px; color:var(--muted); }
tr:has(+ tr.detail) > td { border-bottom:0; padding-bottom:4px; }
tr.detail > td { padding-top:0; padding-bottom:12px; background:transparent !important; }
tfoot td, tfoot th { padding:10px 14px; border-top:1px solid var(--line-2); font-weight:600; text-align:left; background:var(--surface); }
.empty-row td { padding:0; }

/* ---- empty states -------------------------------------------------------------------------- */
.empty { display:grid; justify-items:center; gap:6px; padding:40px 20px; text-align:center; color:var(--muted); }
.empty .glyph { width:36px; height:36px; border-radius:999px; background:var(--sunken); display:grid; place-items:center; color:var(--ink-2); margin-bottom:4px; }
.empty b { color:var(--ink); font-weight:600; font-size:14px; }
.empty p { margin:0; max-width:52ch; }
.empty code { background:var(--sunken); padding:1px 5px; border-radius:var(--r-sm); }

/* ---- state pills, dots, chips, meters --------------------------------------------------- */
.pill { display:inline-flex; align-items:center; gap:6px; height:22px; padding:0 9px; border-radius:999px; font-size:12px; font-weight:500; white-space:nowrap; line-height:1; background:var(--quiet-bg); color:var(--quiet); }
.pill::before { content:""; width:6px; height:6px; border-radius:999px; background:var(--quiet-dot); }
.pill-completed, .pill-done { background:var(--ok-bg); color:var(--ok); }
.pill-completed::before, .pill-done::before { background:var(--ok-dot); }
.pill-running, .pill-leased, .pill-in_progress { background:var(--busy-bg); color:var(--busy); }
.pill-running::before, .pill-leased::before, .pill-in_progress::before { background:var(--busy-dot); }
.pill-failed, .pill-failed_business, .pill-timed_out { background:var(--bad-bg); color:var(--bad); }
.pill-failed::before, .pill-failed_business::before, .pill-timed_out::before { background:var(--bad-dot); }
.pill-blocked, .pill-held { background:var(--bad-solid); color:#fff; }
.pill-blocked::before, .pill-held::before { background:#fff; }
.pill-plain::before { display:none; }
.status { display:inline-flex; align-items:center; gap:8px; font-weight:500; white-space:nowrap; }
.status .dot { width:8px; height:8px; border-radius:999px; background:var(--quiet-dot); box-shadow:0 0 0 3px var(--quiet-bg); }
.status.online .dot { background:var(--ok-dot); box-shadow:0 0 0 3px var(--ok-bg); }
.status.silent .dot { background:var(--busy-dot); box-shadow:0 0 0 3px var(--busy-bg); }
.status.never .dot { background:var(--quiet-dot); }
.status.revoked { color:var(--muted); }
.chips { display:flex; flex-wrap:wrap; gap:4px; }
.chip { display:inline-flex; align-items:center; height:22px; padding:0 8px; border-radius:var(--r-sm); background:var(--sunken); color:var(--ink-2); font-family:var(--mono); font-size:11.5px; white-space:nowrap; }
.chip.gain { background:var(--ok-bg); color:var(--ok); }
.chip.loss { background:var(--bad-bg); color:var(--bad); }
.meter { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.meter .cells { display:inline-flex; gap:2px; }
.meter .cells i { width:8px; height:14px; border-radius:var(--r-xs); background:var(--sunken); box-shadow:inset 0 0 0 1px var(--line-2); }
.meter .cells i.on { background:var(--busy-dot); box-shadow:none; }

/* ---- facts strip (object summary) ------------------------------------------------------- */
.facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); margin:22px 0 0; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--raised); overflow:hidden; }
.facts > div { padding:14px 16px; border-right:1px solid var(--line); min-width:0; }
.facts > div:last-child { border-right:0; }
.facts dt { font-size:12px; color:var(--muted); margin:0 0 6px; }
.facts dd { margin:0; font-size:14px; font-weight:500; color:var(--ink); overflow-wrap:anywhere; }
.facts dd .sub { display:block; font-size:12px; font-weight:400; color:var(--muted); margin-top:2px; }

/* ---- definition list --------------------------------------------------------------------- */
dl.meta { display:grid; grid-template-columns:max-content 1fr; gap:10px 28px; margin:0; font-size:13px; }
dl.meta dt { color:var(--muted); }
dl.meta dd { margin:0; min-width:0; overflow-wrap:anywhere; }

/* ---- run progress: one row per step, segments per state ---------------------------------- */
.steps { display:grid; gap:0; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--raised); }
.step { display:grid; grid-template-columns:minmax(180px, 280px) minmax(0, 1fr) auto; align-items:center; gap:18px; padding:14px 16px; border-bottom:1px solid var(--line); }
.step:last-child { border-bottom:0; }
.step .name b { display:block; font-weight:500; }
.step .name span { font-family:var(--mono); font-size:12px; color:var(--muted); }
.bar { display:flex; height:10px; border-radius:999px; overflow:hidden; background:var(--sunken); gap:2px; }
.bar i { display:block; height:100%; min-width:6px; }
.bar i.s-ok { background:var(--ok-dot); } .bar i.s-busy { background:var(--busy-dot); } .bar i.s-bad { background:var(--bad-dot); } .bar i.s-held { background:var(--bad-solid); } .bar i.s-quiet { background:var(--quiet-dot); }
.step .legend { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; font-size:12px; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.step .legend span { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
.step .legend span::before { content:""; width:7px; height:7px; border-radius:var(--r-xs); background:var(--quiet-dot); }
.step .legend .s-ok::before { background:var(--ok-dot); } .step .legend .s-busy::before { background:var(--busy-dot); } .step .legend .s-bad::before { background:var(--bad-dot); } .step .legend .s-held::before { background:var(--bad-solid); }

/* ---- timeline: history and activity ------------------------------------------------------ */
.timeline { list-style:none; margin:0; padding:0; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--raised); }
.timeline li { display:grid; grid-template-columns:150px 28px minmax(0, 1fr); gap:0 12px; align-items:start; padding:12px 16px; border-bottom:1px solid var(--line); }
.timeline li:last-child { border-bottom:0; }
.timeline time { font-size:12.5px; color:var(--muted); font-variant-numeric:tabular-nums; padding-top:3px; white-space:nowrap; }
.timeline .ic { width:26px; height:26px; border-radius:999px; background:var(--sunken); color:var(--ink-2); display:grid; place-items:center; }
.timeline .ic.t-bad { background:var(--bad-bg); color:var(--bad); }
.timeline .ic.t-ok { background:var(--ok-bg); color:var(--ok); }
.timeline .ic.t-key { background:var(--sky-tint); color:var(--sky); }
.timeline .ic svg.i { width:14px; height:14px; }
.timeline .what { min-width:0; padding-top:3px; }
.timeline .what b { font-weight:500; }
.timeline .what .detail { display:block; color:var(--muted); font-size:12.5px; margin-top:3px; }

/* ---- notices ---------------------------------------------------------------------------- */
.notices { list-style:none; padding:0; margin:0 0 18px; display:grid; gap:8px; }
.notice { display:flex; align-items:flex-start; gap:10px; padding:11px 14px; border-radius:var(--r-lg); background:var(--sky-tint); color:var(--ink); border:1px solid var(--sky-line); font-size:13.5px; }
.notice svg.i { color:var(--sky); margin-top:2px; }
.notice.success { background:var(--ok-bg); border-color:transparent; }
.notice.success svg.i { color:var(--ok); }
.notice.error { background:var(--bad-bg); border-color:transparent; }
.notice.error svg.i { color:var(--bad); }
.notice.warning { background:var(--busy-bg); border-color:transparent; }
.notice.warning svg.i { color:var(--busy); }
.notice p { margin:0; }
.notice p + p { margin-top:4px; }

/* ---- folds -------------------------------------------------------------------------------- */
details.panel { border:1px solid var(--line); border-radius:var(--r-lg); background:var(--raised); margin-bottom:12px; }
details.panel > summary { list-style:none; cursor:pointer; padding:13px 16px; font-weight:500; display:flex; align-items:center; gap:10px; border-radius:var(--r-lg); }
details.panel > summary:hover { background:var(--surface); }
details.panel > summary::-webkit-details-marker { display:none; }
details.panel > summary::after { content:""; margin-left:auto; width:7px; height:7px; border-right:1.6px solid var(--muted); border-bottom:1.6px solid var(--muted); transform:rotate(45deg); transition:transform var(--fast) var(--ease); }
details.panel[open] > summary::after { transform:rotate(225deg); }
details.panel > summary .hint { color:var(--muted); font-weight:400; font-size:13px; }
details.panel > .body { padding:16px; border-top:1px solid var(--line); }
details.fold > summary { cursor:pointer; color:var(--muted); font-size:12.5px; font-weight:500; list-style:none; display:inline-flex; align-items:center; gap:6px; }
details.fold > summary:hover { color:var(--ink); }
details.fold > summary::-webkit-details-marker { display:none; }
details.fold > summary::before { content:""; width:5px; height:5px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); transition:transform var(--fast) var(--ease); }
details.fold[open] > summary::before { transform:rotate(45deg); }
pre { font:12px/1.55 var(--mono); background:var(--sunken); border:1px solid var(--line); border-radius:var(--r-md); padding:12px 14px; overflow:auto; max-height:26rem; margin:8px 0 4px; white-space:pre-wrap; word-break:break-word; }
.redacted { color:var(--muted); font-style:italic; }

/* ---- row actions -------------------------------------------------------------------------- */
.row-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.row-actions form { display:inline-flex; align-items:center; gap:6px; margin:0; }
.row-actions details.fold { position:relative; }
.row-actions details.fold form { margin-top:8px; }
form.inline { display:inline-flex; align-items:center; gap:6px; margin:0; flex-wrap:wrap; }

/* ---- one-time token ----------------------------------------------------------------------- */
.once { border:1px solid var(--busy-dot); border-radius:var(--r-lg); background:var(--raised); overflow:hidden; margin:18px 0 0; max-width:880px; }
.once .once-head { display:flex; align-items:center; gap:10px; padding:12px 16px; background:var(--busy-bg); color:var(--busy); font-weight:500; }
.once .once-body { padding:16px; display:grid; gap:14px; }
.once label { display:grid; gap:6px; font-size:12.5px; color:var(--muted); font-weight:500; }
.once input, .once textarea { width:100%; font-family:var(--mono); font-size:13px; background:var(--sunken); }
.once textarea { resize:vertical; }

/* ---- pagination ---------------------------------------------------------------------------- */
.pager { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin:14px 0 0; color:var(--muted); font-size:12.5px; }

/* ---- sign in and code page --------------------------------------------------------------- */
.auth { min-height:100vh; display:grid; place-items:center; padding:24px; background:var(--bg); }
.auth .card { width:min(400px, 100%); background:var(--raised); border:1px solid var(--line); border-radius:14px; padding:32px 30px 28px; box-shadow:var(--shadow-pop); }
.auth .brand { display:flex; align-items:center; gap:10px; margin-bottom:26px; color:var(--ink); }
.auth .brand .mark { background:var(--nav-mark); border-color:transparent; }
.auth .brand .by { color:var(--muted); }
.auth h1 { font-size:20px; margin-bottom:6px; }
.auth .lede { margin:0 0 20px; font-size:13.5px; }
.auth button { width:100%; justify-content:center; height:36px; margin-top:4px; }
.auth .notice { margin-bottom:16px; }
.auth .foot { margin:22px 0 0; font-size:12px; color:var(--muted); text-align:center; }
.auth .auth-step { margin:0 0 6px; font-size:12px; font-weight:500; color:var(--sky); }
.auth .note { text-align:center; }
.auth .btn-link, .btn-link { width:auto; height:auto; margin:0; padding:0; border:0; background:none; box-shadow:none; color:var(--muted); font-size:12px; font-weight:400; text-decoration:underline; text-underline-offset:2px; }
.auth .btn-link:hover, .btn-link:hover { background:none; color:var(--ink); }
.qr { margin:0 0 18px; display:grid; justify-items:center; gap:10px; }
.qr svg { width:188px; height:188px; padding:6px; background:var(--qr-ground); border:1px solid var(--line); border-radius:var(--r-md); }
.qr figcaption { font-size:12.5px; color:var(--muted); text-align:center; line-height:1.5; }
.qr .key { display:block; margin-top:6px; font-family:var(--mono); font-size:13px; letter-spacing:.06em; color:var(--ink); user-select:all; overflow-wrap:anywhere; }

/* ---- small screens: the sidebar becomes a top bar ---------------------------------------- */
@media (max-width:900px) {
  .shell { grid-template-columns:1fr; }
  .nav { position:sticky; top:0; height:auto; flex-direction:row; align-items:center; gap:6px; padding:10px 12px; overflow-x:auto; scrollbar-width:none; }
  .nav::-webkit-scrollbar { display:none; }
  .nav .brand { padding:0 10px 0 2px; }
  .nav .brand .by, .nav .group-label, .nav .spacer { display:none; }
  .nav .group { display:flex; margin:0; gap:2px; }
  .nav a.item { white-space:nowrap; height:32px; }
  .nav .me { border-top:0; margin:0 0 0 8px; padding:0; }
  .nav .me .who { display:none; }
  .main { padding:20px 16px 48px; }
  .step { grid-template-columns:1fr; gap:8px; }
  .step .legend { justify-content:flex-start; }
  .timeline li { grid-template-columns:28px minmax(0, 1fr); }
  .timeline time { grid-column:2; order:2; padding-top:0; }
  .facts > div { border-right:0; border-bottom:1px solid var(--line); }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { transition:none !important; animation:none !important; } }

/* ---- small utilities ---------------------------------------------------------------------- */
.seg .count { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:16px; padding:0 5px; border-radius:999px; background:var(--bad-solid); color:#fff; font-size:10.5px; font-weight:600; }
.flush { margin-top:0 !important; }
.note { margin:12px 0 0; color:var(--muted); font-size:12.5px; }
svg.i.sm { width:13px; height:13px; vertical-align:-2px; }
.code-input-sm { font-family:var(--mono); letter-spacing:.15em; width:9.5em; }
.code-input { font-family:var(--mono) !important; font-size:18px !important; letter-spacing:.2em; height:44px !important; text-align:center; }
.slots-input { width:90px; }
.row-actions.start { justify-content:flex-start; }
