/* Control components. Every colour, size, radius, shadow and font comes from
   tokens.css, so the app is re-skinned there and stays the same brand as the
   site. Colour carries meaning only: teal = allowed / OK, orange = stopped /
   error, yellow = primary actions, the gate and "waiting", violet = the signed
   record. No third-party anything; no inline styles (CSP). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/1.55 var(--sans); letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11"; font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-strong); }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: 0.93em; letter-spacing: 0; }
[hidden] { display: none !important; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 6px; }
.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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 90; background: var(--action); color: var(--on-action); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip:focus { top: 12px; }
.tabular, .figure__value { font-variant-numeric: tabular-nums; }
.dim, .muted { color: var(--text-2); }
.small { font-size: var(--fs-small); }
.wrap { overflow-wrap: anywhere; }
.t-right { text-align: right; justify-self: end; }
.is-bad { color: var(--bad); }
.is-wait-text { color: var(--wait); }
.label { font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--inline { width: 14px; height: 14px; vertical-align: -2px; }
.icon--flip { transform: rotate(180deg); }
.is-spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- the brand: bird mark + wordmark, exactly as in the site nav ------------- */
.brandmark { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .08em; font-size: 18px; line-height: 1; color: var(--text); flex: none; }
.brandmark:hover { color: var(--text); }
.mark { width: 40px; height: 23px; flex: none; color: var(--brand-mark); }
@media (max-width: 640px) {
  .mark { width: 35px; height: 20px; }
  .brandmark { gap: 9px; font-size: 15.5px; }
}
.mark path { fill: currentColor; }
.wordmark__product { color: var(--text-2); font-weight: 500; letter-spacing: 0; margin-left: 2px; }

/* --- app shell: one sticky top bar like the site's nav ------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: var(--bar);
  -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar__row { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); height: var(--bar-h); display: flex; align-items: center; gap: 14px; }
.topbar__slash { color: var(--line-hover); font-size: 22px; font-weight: 300; margin: 0 2px; }
.org { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.org__badge { display: inline-flex; width: 24px; height: 24px; border-radius: 7px; align-items: center; justify-content: center; font: 700 12px/1 var(--sans); background: var(--bone); color: var(--on-bone); flex: none; }
.org__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.org__name--unset { color: var(--text-3); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.nav::-webkit-scrollbar { display: none; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: var(--radius-pill); color: var(--text-2); font-weight: 500; font-size: 14px; flex: none; }
.nav__link:hover { color: var(--text); background: var(--bone-wash); }
.nav__link.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.nav__count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--wait); color: var(--on-action); font: 700 11px/18px var(--sans); text-align: center; }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.me__who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; min-width: 0; }
.me__name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.me__role { font: 500 10px/1.3 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); }
.me__form { margin: 0; }
.avatar { display: inline-flex; width: 30px; height: 30px; border-radius: var(--radius-pill); align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); flex: none; }
.avatar--wait { border-color: var(--wait-line); color: var(--wait); background: var(--wait-wash); }

.main {
  flex: 1; min-width: 0; width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding: 0 var(--pad) 96px; display: flex; flex-direction: column; gap: 24px;
}
.foot { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 22px var(--pad) 32px; background: linear-gradient(var(--line), var(--line)) center top / calc(100% - 2 * var(--pad)) 1px no-repeat; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-3); font-size: var(--fs-caption); }
.foot a:hover { color: var(--text); }
.foot__spacer { flex: 1; }

/* --- page header: big, tight, with a serif italic accent -------------------------- */
.phead { position: relative; padding: 48px 0 30px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }
.crumbs::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.crumbs a:hover { color: var(--text); }
.crumbs__sep { color: var(--text-3); }
.phead__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.phead__main { min-width: 0; }
.phead__title { font-size: var(--fs-h1); line-height: 1; font-weight: var(--fw-heading); letter-spacing: var(--tracking-heading); text-wrap: balance; }
.phead__title em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: 1.08em; color: var(--text-2); }
.mono-title { font-family: var(--mono); font-weight: 500; letter-spacing: -0.03em; font-size: 36px; }
.phead__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; color: var(--text-2); max-width: 74ch; font-size: 15px; }
.phead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dot-sep { width: 3px; height: 3px; border-radius: 99px; background: var(--text-3); }

/* --- buttons: pills, primary is yellow (as the site's nav) ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--bone-wash); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer;
  transition: transform .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.btn:hover { border-color: var(--text-2); color: var(--text); transform: translateY(-1px); }
.btn--primary { background: var(--action); color: var(--on-action); border-color: var(--action); box-shadow: var(--shadow-action); }
.btn--primary:hover { background: var(--action); color: var(--on-action); border-color: var(--action); filter: brightness(1.06); }
.btn--danger { background: var(--bad); color: var(--on-action); border-color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: var(--on-action); border-color: var(--bad); filter: brightness(1.06); }
.btn--ghost-danger { color: var(--text-2); background: transparent; }
.btn--ghost-danger:hover { color: var(--bad); border-color: var(--bad-line); }
.btn--ok { background: var(--ok); color: var(--on-ok); border-color: var(--ok); }
.btn--ok:hover { background: var(--ok); color: var(--on-ok); border-color: var(--ok); filter: brightness(1.06); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--quiet:hover { color: var(--text); border-color: var(--line-strong); }
.btn--sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 26px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.iconbtn { display: inline-flex; width: 32px; height: 32px; border-radius: var(--radius-pill); align-items: center; justify-content: center; background: none; border: 1px solid transparent; color: var(--text-2); cursor: pointer; }
.iconbtn:hover { border-color: var(--line-strong); color: var(--text); }
.iconbtn--bad:hover { color: var(--bad); border-color: var(--bad-line); }

/* --- figures ------------------------------------------------------------------------ */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.figure { padding: 22px 26px 24px; border-left: 1px solid var(--line); min-width: 0; }
.figure:first-child { border-left: 0; }
.figure__label { font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }
.figure__value { font-size: var(--fs-figure); font-weight: 700; letter-spacing: -0.05em; line-height: 1.05; margin-top: 12px; overflow-wrap: anywhere; }
.figure__value.is-ok { color: var(--ok); }
.figure__value.is-wait { color: var(--wait); }
.figure__value.is-bad { color: var(--bad); }
.figure__value.is-record { color: var(--record); }
.figure__sub { font-size: var(--fs-caption); color: var(--text-3); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- cards ---------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; min-width: 0; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card__title { font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.015em; }
.card__hint { font-size: var(--fs-small); color: var(--text-2); margin-top: 4px; max-width: 64ch; }
.card__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card--record { border-color: var(--record-line); box-shadow: inset 0 3px 0 var(--record); }
.card--wait { border-color: var(--wait-line); box-shadow: inset 0 3px 0 var(--wait); }
.card--plain { background: transparent; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split--form { grid-template-columns: minmax(0, 1fr) 420px; }
.split__main, .split__side { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.split__side.stack-lg, aside.split__side { display: flex; flex-direction: column; gap: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.sticky { position: sticky; top: calc(var(--bar-h) + 24px); }

/* --- status pills and tags (dot colour = meaning) ---------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 9px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); font-size: var(--fs-caption); font-weight: 500; color: var(--text); white-space: nowrap; background: var(--bg);
}
.pill__dot { width: 7px; height: 7px; border-radius: 99px; background: var(--text-3); position: relative; flex: none; }
.pill--ok, .pill--live { color: var(--ok); border-color: var(--ok-line); background: var(--ok-wash); }
.pill--ok .pill__dot, .pill--live .pill__dot { background: var(--ok); }
.pill--bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-wash); }
.pill--bad .pill__dot { background: var(--bad); }
.pill--wait { color: var(--wait); border-color: var(--wait-line); background: var(--wait-wash); }
.pill--wait .pill__dot { background: var(--wait); }
.pill--record { color: var(--record); border-color: var(--record-line); background: var(--record-wash); }
.pill--record .pill__dot { background: var(--record); }
.pill--muted { color: var(--text-2); }
.pill--done { color: var(--text-2); }
.pill--done .pill__dot { background: var(--text-2); }
.is-pulsing::after { content: ""; position: absolute; inset: -4px; border-radius: 99px; border: 1px solid currentColor; opacity: 0; animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .is-pulsing::after, .is-spinning { animation: none; } .btn:hover { transform: none; } }

.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 9px; border-radius: var(--radius-pill); font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; }
.tag--ok { color: var(--ok); border-color: var(--ok-line); }
.tag--bad { color: var(--bad); border-color: var(--bad-line); }
.tag--wait { color: var(--wait); border-color: var(--wait-line); }
.tag--record { color: var(--record); border-color: var(--record-line); }
.tag--admin { color: var(--text); border-color: var(--line-hover); }
.stack > .tag { align-self: flex-start; }
.tag--soon { color: var(--wait); border-color: var(--wait-line); border-style: dashed; }

/* --- tabs ----------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: -8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--text); }
.tabs__tab.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--action); border-radius: 2px; }
.tabs__count { font-size: 11px; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }

/* --- tables / rows ------------------------------------------------------------------- */
.table { display: flex; flex-direction: column; margin: 0 -24px -24px; }
.table__head, .table__row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, 1fr) 70px; gap: 16px; align-items: center; padding: 0 24px; }
.table__head { height: 40px; font: 500 var(--fs-label)/1 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.table__row { min-height: 62px; border-bottom: 1px solid var(--line); transition: background .12s var(--ease); }
.table__row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
a.table__row:hover { background: var(--surface-2); color: var(--text); }
.table__row--3, .table__head--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.table__head--audit, .table__row--audit { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.table__row--audit { min-height: 52px; }
.table__head--people, .table__row--people { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 120px 110px 36px; }
.table__head--pending, .table__row--pending { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 100px 410px; }
.table__row--pending { min-height: 72px; }
.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table__row--audit .cell-main { flex-direction: row; align-items: center; gap: 8px; }
.cell-sub { font-size: var(--fs-caption); color: var(--text-3); }
.cell-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.rows { display: flex; flex-direction: column; margin: 0 -24px -24px; border-top: 1px solid var(--line); }
.rows__row { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); transition: background .12s var(--ease); }
.rows li:last-child .rows__row, .rows__row:last-child { border-bottom: 0; }
a.rows__row:hover { background: var(--surface-2); color: var(--text); }
.rows__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rows__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows__sub { font-size: var(--fs-caption); color: var(--text-3); }
.rows__chev { color: var(--text-3); }
.inline-form { margin: 0; }

/* --- host cards ------------------------------------------------------------------------ */
.hostcard { display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; transition: border-color .15s var(--ease); }
.hostcard:hover { border-color: var(--line-hover); color: var(--text); }
.hostcard__top { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.hostcard__icon { display: inline-flex; width: 38px; height: 38px; border-radius: var(--radius-sm); align-items: center; justify-content: center; border: 1px solid var(--line-strong); background: var(--bg); }
.hostcard__name { font-weight: 600; font-size: 15px; }
.hostcard__addr { font-size: var(--fs-caption); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.hostcard__foot { font-size: var(--fs-caption); color: var(--text-3); border-top: 1px solid var(--line); padding-top: 14px; }

.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kv dt { font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); }
.kv dd { font-weight: 500; margin-top: 4px; }
.kv--stack { grid-template-columns: 1fr; gap: 16px; }
.kv--stack dd { font-weight: 400; overflow-wrap: anywhere; }
.kv--inline { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* --- checks -------------------------------------------------------------------------- */
.checks { display: flex; flex-direction: column; margin: 0 -24px; border-top: 1px solid var(--line); }
.checks__row { display: grid; grid-template-columns: 22px 170px minmax(0, 1fr); gap: 14px; align-items: center; padding: 13px 24px; border-bottom: 1px solid var(--line); }
.checks__row:last-child { border-bottom: 0; }
.checks__mark { display: inline-flex; width: 22px; height: 22px; border-radius: 99px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); color: var(--text-3); }
.checks__mark .icon { width: 13px; height: 13px; stroke-width: 2; }
.checks__row.is-ok .checks__mark { color: var(--ok); border-color: var(--ok-line); }
.checks__row.is-bad .checks__mark { color: var(--bad); border-color: var(--bad-line); }
.checks__row.is-wait .checks__mark { color: var(--wait); border-color: var(--wait-line); }
.checks__label { font-weight: 500; }
.checks__what { color: var(--text-2); font-size: var(--fs-small); }
.card > .checks:last-child { margin-bottom: -24px; }

/* --- timeline ------------------------------------------------------------------------ */
.timeline { display: flex; flex-direction: column; position: relative; }
.timeline__item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 14px; padding-bottom: 22px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ""; position: absolute; left: 13.5px; top: 28px; bottom: 2px; width: 1px; background: var(--line-strong); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { grid-row: span 2; width: 28px; height: 28px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--bg); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.timeline__dot .icon { width: 14px; height: 14px; stroke-width: 2; }
.timeline__label { font-weight: 500; padding-top: 3px; }
.timeline__note { color: var(--text-2); font-size: var(--fs-small); }
.timeline__item.is-done .timeline__dot { color: var(--ok); border-color: var(--ok-line); }
.timeline__item.is-done::before { background: var(--ok-line); }
.timeline__item.is-failed .timeline__dot { color: var(--bad); border-color: var(--bad-line); }
.timeline__item.is-failed .timeline__note { color: var(--bad); }
.timeline__item.is-active .timeline__dot { border-color: var(--wait-line); }
.timeline__item.is-active .timeline__dot::after { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--wait); box-shadow: 0 0 0 4px var(--wait-wash); }
.timeline__item.is-pending .timeline__label { color: var(--text-2); }
.timeline--plan .timeline__dot { width: 10px; height: 10px; margin: 6px 9px 0; background: var(--line-strong); border: 0; }
.timeline--plan .timeline__item::before { left: 13.5px; top: 18px; }

/* --- step log ---------------------------------------------------------------------------- */
.steps { display: flex; flex-direction: column; margin: 0 -24px -24px; border-top: 1px solid var(--line); }
.steps__item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 2px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.steps__item:last-child { border-bottom: 0; }
.steps__n { grid-row: span 2; width: 34px; height: 26px; border-radius: 7px; border: 1px solid var(--ok-line); display: inline-flex; align-items: center; justify-content: center; font: 500 12px var(--mono); color: var(--ok); }
.steps__item.is-failed .steps__n { color: var(--bad); border-color: var(--bad-line); }
.steps__item.is-waiting .steps__n { color: var(--wait); border-color: var(--wait-line); }
.steps__title { font-weight: 500; }
.steps__time { color: var(--text-3); font-size: var(--fs-caption); white-space: nowrap; }
.steps__sub { grid-column: 2 / 4; color: var(--text-2); font-size: var(--fs-small); }

/* --- agent page ---------------------------------------------------------------------------- */
.subhead { margin-top: -8px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-small); }
.agenthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.agenthead__name { font: 500 20px/1.3 var(--mono); letter-spacing: -0.02em; }
.agenthead__sub { color: var(--text-2); font-size: var(--fs-small); margin-top: 4px; }

.places { display: flex; flex-direction: column; gap: 8px; }
.places__row { display: grid; grid-template-columns: minmax(0, auto) 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.places__row .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.places__arrow { color: var(--ok); display: inline-flex; }
.places__host { font-weight: 500; overflow-wrap: anywhere; }

.grant { padding: 16px 0; border-top: 1px solid var(--line); }
.grant:first-child { border-top: 0; padding-top: 0; }
.grant__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.grant__agent { font: 500 14px var(--mono); }
.grant__src { font-size: 12px; color: var(--text-3); }

/* --- egress feed --------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--bg); }
.seg__btn { height: 26px; padding: 0 12px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; font-size: var(--fs-small); color: var(--text-2); cursor: pointer; }
.seg__btn.is-on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend { display: flex; gap: 14px; font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.legend__item::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; margin-right: 7px; vertical-align: 0; }
.legend__item.is-ok { color: var(--ok); }
.legend__item.is-ok::before { background: var(--ok); }
.legend__item.is-bad { color: var(--bad); }
.legend__item.is-bad::before { background: var(--bad); }

.feed { display: flex; flex-direction: column; margin: 0 -24px -24px; border-top: 1px solid var(--line); max-height: 640px; overflow-y: auto; }
.ev { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev__verdict { grid-row: span 2; align-self: start; font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); border: 1px solid; }
.ev--allow .ev__verdict { color: var(--ok); border-color: var(--ok-line); }
.ev--deny .ev__verdict { color: var(--bad); border-color: var(--bad-line); }
.ev__host { font: 500 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev__time { color: var(--text-3); font-size: var(--fs-caption); white-space: nowrap; }
.ev__why { grid-column: 2 / 4; color: var(--text-2); font-size: var(--fs-small); }
.feed--compact { margin: 0 -24px -24px; }
.feed__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 24px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed__row:last-child { border-bottom: 0; }
.feed__who { color: var(--text-2); font-size: var(--fs-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.feed__when { color: var(--text-3); font-size: var(--fs-caption); white-space: nowrap; }

/* --- approvals (waiting = yellow, the gate) ------------------------------------------------- */
.appr { display: flex; flex-direction: column; margin: 0 -24px -24px; border-top: 1px solid var(--line); }
.appr__row { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.appr__row:last-child { border-bottom: 0; }
.appr__title { font-weight: 500; }
.appr__title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--wait); margin-right: 10px; vertical-align: 1px; }
.appr__sub { color: var(--text-2); font-size: var(--fs-small); margin-top: 4px; max-width: 70ch; }
.appr__btns { display: flex; gap: 8px; flex: none; }

/* --- the signed record (violet) --------------------------------------------------------------- */
.claims { display: flex; flex-direction: column; margin: 0 -24px; border-top: 1px solid var(--line); }
.claims__row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.claims__row dt { color: var(--text-2); font-size: var(--fs-small); padding-top: 1px; }
.claims__row dd { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.claims__detail { flex-basis: 100%; color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
.howto { counter-reset: s; display: flex; flex-direction: column; gap: 18px; }
.howto li { counter-increment: s; position: relative; padding-left: 34px; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.howto li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 99px; border: 1px solid var(--record-line); font: 500 11.5px/20px var(--mono); text-align: center; color: var(--record); }
.cmd { display: block; width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-caption); line-height: 1.65; }
.card__foot { height: 20px; }
.fine { color: var(--text-3); font-size: var(--fs-caption); margin-top: 14px; }

/* --- notices, empty, skeleton ------------------------------------------------------------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-size: 13.5px; }
.notice .icon { margin-top: 2px; }
.notice--bad { border-color: var(--bad-line); background: var(--bad-wash); color: var(--text); }
.notice--bad .icon { color: var(--bad); }
.notice--wait { border-color: var(--wait-line); background: var(--wait-wash); color: var(--text); }
.notice--wait .icon { color: var(--wait); }
.notice--ok { border-color: var(--ok-line); background: var(--ok-wash); color: var(--text); }
.notice--ok .icon { color: var(--ok); }
.card .notice { margin-top: 16px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 16px 44px; }
.empty__icon { width: 48px; height: 48px; border-radius: var(--radius); border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); margin-bottom: 18px; background: var(--bg); }
.empty__icon .icon { width: 20px; height: 20px; }
.empty__title { font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.empty__text { color: var(--text-2); max-width: 48ch; margin-top: 8px; }
.empty__actions { margin-top: 22px; display: flex; gap: 8px; }

.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton span { height: 14px; border-radius: 6px; background: var(--surface-2); animation: shimmer 1.4s ease-in-out infinite; }
.skeleton span:nth-child(2) { width: 82%; }
.skeleton span:nth-child(3) { width: 64%; }
@keyframes shimmer { 50% { opacity: .45; } }

.ticks { display: flex; flex-direction: column; gap: 12px; color: var(--text-2); }
.ticks li { position: relative; padding-left: 22px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 7px; height: 7px; border-radius: 99px; background: var(--ok); }
.ticks--muted li::before { background: transparent; border: 1px solid var(--wait); }

.danger-zone { display: flex; gap: 20px; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; }
.danger-zone__title { font-weight: 600; }
.danger-zone__text { color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }

/* --- settings: facts with a status dot ------------------------------------------------------ */
.facts { display: flex; flex-direction: column; margin: 0 -24px -24px; border-top: 1px solid var(--line); }
.facts__row { display: grid; grid-template-columns: 22px 180px minmax(0, 1fr); gap: 14px; align-items: start; padding: 15px 24px; border-bottom: 1px solid var(--line); }
.facts__row:last-child { border-bottom: 0; }
.facts__dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ok); margin: 7px 0 0 7px; }
.facts__row.is-soon .facts__dot { background: transparent; border: 1px solid var(--wait); }
.facts__row.is-wait .facts__dot { background: var(--wait); }
.kv--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts__k { font-weight: 500; }
.facts__v { color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* --- forms ------------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label { font-size: var(--fs-small); font-weight: 500; color: var(--text); }
.field__hint { font-size: var(--fs-caption); color: var(--text-3); }
.field__head { display: flex; align-items: center; gap: 6px; }
/* (i) tooltips: what a setting means, on hover, focus or tap */
.tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; }
.field__head .tip { margin-left: 0; }
.tip__btn {
  width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line-hover); background: transparent;
  color: var(--text-2); font: 600 11px/1 var(--mono); display: inline-grid; place-items: center;
  cursor: help; padding: 0;
}
.tip__btn:hover, .tip__btn:focus-visible { color: var(--text-strong); border-color: var(--text-2); outline: none; }
.tip__body {
  position: absolute; z-index: 30; left: -8px; bottom: calc(100% + 8px); width: max-content; max-width: min(300px, 80vw);
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); font-size: var(--fs-caption); font-weight: 400; line-height: 1.45; letter-spacing: normal; text-transform: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .12s var(--ease), transform .12s var(--ease), visibility .12s; pointer-events: none;
}
.tip:hover .tip__body, .tip:focus-within .tip__body { opacity: 1; visibility: visible; transform: none; }
.field__error { font-size: var(--fs-caption); color: var(--bad); }
.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font-size: 14.5px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder { color: var(--text-placeholder); }
.input:hover { border-color: var(--line-hover); }
.input:focus { outline: none; border-color: var(--text-2); box-shadow: 0 0 0 3px var(--focus-ring); }
.input[readonly] { color: var(--text-2); background: var(--surface); }
.input--area { height: auto; min-height: 96px; padding: 10px 14px; line-height: 1.6; resize: vertical; }
.input--select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: var(--select-chevron);
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.input--sm { height: 32px; font-size: var(--fs-small); width: auto; padding: 0 12px; }
.input--sm.input--select { padding-right: 30px; }
.has-error .input { border-color: var(--bad-line); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line-hover); background: var(--bg); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; transition: background .12s var(--ease); }
.check__box .icon { width: 12px; height: 12px; stroke-width: 2.4; color: var(--on-action); opacity: 0; }
.check input:checked + .check__box { background: var(--action); border-color: var(--action); }
.check input:checked + .check__box .icon { opacity: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--action); outline-offset: 2px; }
.check__text { display: flex; flex-direction: column; gap: 2px; }
.check__label { font-weight: 500; }
.check__label a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-3); }
.check__label a:hover { text-decoration-color: var(--text); }
.check__hint { font-size: var(--fs-caption); color: var(--text-3); }
.check.has-error .check__box { border-color: var(--bad); }

.toolrow { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.toolrow:first-of-type { margin-top: 0; }
.toolrow__head { display: flex; align-items: center; gap: 12px; }
.toolrow__n { font: 500 12px var(--mono); color: var(--text-2); }
.toolrow__place { flex: 1; font-size: var(--fs-small); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.toolrow__place .icon { color: var(--ok); }
.toolrow__place strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.toolrow__grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; }
.toolrow__url { grid-column: 1 / -1; }

.verdict { display: flex; align-items: center; gap: 8px; font-weight: 500; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
.verdict.is-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-wash); }
.verdict.is-bad { color: var(--text); border-color: var(--bad-line); }
.verdict.is-bad .icon { color: var(--bad); }
.problems { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-small); color: var(--text-2); }
.problems li { padding-left: 12px; border-left: 2px solid var(--bad-line); }
.code { margin: 14px 0 16px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font: 12.5px/1.75 var(--mono); color: var(--text); overflow: auto; max-height: 460px; white-space: pre; }

/* --- sizes ------------------------------------------------------------------------- */
.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.size { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.size:hover { border-color: var(--line-hover); }
.size.is-selected { border-color: var(--action); box-shadow: 0 0 0 1px var(--action); }
.size:disabled { opacity: .4; cursor: not-allowed; }
.size__key { font: 700 24px/1.2 var(--sans); letter-spacing: -0.04em; }
.size__name { font-size: var(--fs-small); color: var(--text-2); }
.size__spec { font: 500 var(--fs-caption) var(--mono); margin-top: 10px; color: var(--text); }
.size__note { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* --- dialog, toasts ------------------------------------------------------------------ */
.dialog { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog[hidden] { display: none; }
.dialog__scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog__panel { position: relative; width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-pop); }
.dialog__title { font-size: 22px; font-weight: 700; letter-spacing: -0.035em; }
.dialog__body { color: var(--text-2); margin-top: 10px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 26px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 440px; padding: 12px 16px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); cursor: pointer; font-size: 13.5px; }
.toast .icon { color: var(--ok); }
.toast--bad .icon { color: var(--bad); }
.toast--muted .icon { color: var(--text-2); }
.toast__close { color: var(--text-3); margin-left: 6px; }

/* --- sign in / sign up: the site's hero, with the form beside it ---------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth__top { position: sticky; top: 0; z-index: 30; background: var(--bar); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid var(--line); }
.auth__toprow { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); height: var(--bar-h); display: flex; align-items: center; gap: 16px; }
.auth__links { margin-left: auto; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.auth__link { color: var(--text-2); padding: 8px 13px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; }
.auth__link:hover { color: var(--text); background: var(--bone-wash); }
.auth__link.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.auth__main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: clamp(32px, 5vw, 72px) var(--pad); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 440px); gap: clamp(32px, 5vw, 80px); align-items: start; }
.auth__hero { min-width: 0; }
.eyebrow-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: 13.5px; color: var(--text-2); margin: 0 0 var(--space-5); }
.eyebrow-pill b { background: var(--bone); color: var(--on-bone); border-radius: var(--radius-pill); padding: 2px 10px; font-weight: 600; font-size: 12px; }
.hero-title { font-size: var(--fs-hero); letter-spacing: -0.06em; line-height: .93; font-weight: 700; margin: 0 0 var(--space-5); }
.hero-title .hl { background: var(--action); color: var(--on-action); padding: 0 .1em; border-radius: .06em; display: inline-block; transform: rotate(-2deg); }
.hero-title em { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: 1.08em; color: var(--ok); }
.auth__sub { color: var(--text-2); font-size: clamp(1.02rem, .96rem + .3vw, 1.16rem); line-height: 1.55; max-width: 34em; margin: 0 0 var(--space-5); }
.auth__sub b { color: var(--text); font-weight: 600; }
.volary { margin: 0; position: relative; }
.volary canvas { display: block; width: 100%; height: 520px; }
.vol-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.vol-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.vol-legend .w { background: var(--bone); }
.vol-legend .t { background: var(--ok); }
.vol-legend .o { background: var(--bad); }
.vol-legend .v { background: var(--record); }
.auth__panel { position: relative; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 32px 30px 26px; box-shadow: var(--shadow-pop); }
.auth__panel--wait { border-color: var(--wait-line); box-shadow: inset 0 3px 0 var(--wait), var(--shadow-pop); }
.auth__title { font-size: 34px; font-weight: 700; letter-spacing: -0.05em; line-height: 1.02; }
.auth__title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: 1.08em; color: var(--text-2); }
.auth__lede { color: var(--text-2); margin: 10px 0 24px; }
.auth__panel .notice { margin-bottom: 16px; }
.auth__switch { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.auth__switch a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--action); }
.auth__fine { color: var(--text-3); font-size: var(--fs-caption); margin-top: 16px; }
.auth__steps { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 22px; counter-reset: s; }
.auth__steps li { counter-increment: s; position: relative; padding-left: 34px; color: var(--text-2); }
.auth__steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 99px; border: 1px solid var(--wait-line); color: var(--wait); font: 500 11.5px/20px var(--mono); text-align: center; }
.auth__steps li b { color: var(--text); font-weight: 600; }
.auth__foot { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 22px var(--pad) 30px; background: linear-gradient(var(--line), var(--line)) center top / calc(100% - 2 * var(--pad)) 1px no-repeat; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-3); font-size: var(--fs-caption); }
.auth__foot a:hover { color: var(--text); }

/* --- responsive ---------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .split, .split--form { grid-template-columns: minmax(0, 1fr); }
  .split--even { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .me__who { display: none; }
}

@media (max-width: 960px) {
  .auth__main { grid-template-columns: minmax(0, 1fr); }
  .auth__panel { order: -1; }
  .volary canvas { height: 440px; }
}

@media (max-width: 900px) {
  :root { --pad: 16px; --bar-h: 56px; }
  .topbar__row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 0; row-gap: 6px; }
  .org__name { max-width: 140px; }
  .nav { order: 3; flex-basis: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 8px; border-top: 1px solid var(--line); }
  .me { gap: 6px; }
  .main { padding-bottom: 72px; gap: 16px; }
  .phead { padding: 28px 0 20px; }
  .phead__title { font-size: var(--fs-h1-sm); }
  .mono-title { font-size: 24px; }
  .phead__actions { width: 100%; }
  .phead__actions .btn { flex: 1; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure { padding: 16px; }
  .figure:nth-child(3) { border-left: 0; }
  .figure:nth-child(n+3) { border-top: 1px solid var(--line); }
  .figure__value { white-space: normal; font-size: 26px; }
  .card { padding: 18px; }
  .table, .rows, .steps, .feed, .appr, .feed--compact, .facts { margin: 0 -18px -18px; }
  .checks, .claims { margin: 0 -18px; }
  .card > .checks:last-child { margin-bottom: -18px; }
  .table__head, .table__row { grid-template-columns: minmax(0, 1fr) auto 48px; padding: 0 18px; }
  .table__head--audit, .table__row--audit { grid-template-columns: minmax(0, 1fr) auto; }
  .table__row--audit .dim:not(.t-right) { display: none; }
  .table__head--audit span:nth-child(2) { display: none; }
  .table__row--3, .table__head--3 { grid-template-columns: minmax(0, 1fr) auto; }
  .table__row--3 > :last-child, .table__head--3 > :last-child { display: none; }
  .table__head--people, .table__row--people { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .table__head--pending, .table__row--pending { grid-template-columns: minmax(0, 1fr); padding-top: 12px; padding-bottom: 12px; }
  .table__head--pending { display: none; }
  .cell-actions { justify-content: flex-start; }
  .hide-sm { display: none; }
  .rows__row, .steps__item, .ev, .appr__row, .feed__row, .checks__row, .claims__row, .facts__row { padding-left: 18px; padding-right: 18px; }
  .checks__row { grid-template-columns: 22px minmax(0, 1fr); }
  .checks__what { grid-column: 2; }
  .facts__row { grid-template-columns: 22px minmax(0, 1fr); }
  .facts__v { grid-column: 2; }
  .claims__row { grid-template-columns: 1fr; gap: 4px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appr__row { flex-direction: column; align-items: stretch; }
  .appr__btns .btn { flex: 1; }
  .feed__who { display: none; }
  .feed__row { grid-template-columns: minmax(0, 1fr) auto; }
  .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv.kv--stack { grid-template-columns: minmax(0, 1fr); }
  .kv.kv--inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checks__row { row-gap: 0; padding-top: 10px; padding-bottom: 10px; }
  .danger-zone { flex-direction: column; align-items: stretch; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; border-radius: var(--radius); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .toolrow__grid { grid-template-columns: minmax(0, 1fr) 104px; }
  .tabs { margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); padding: 0 8px; }
  .auth__toprow { gap: 8px; }
  .auth__link--site { display: none; }
  .auth__panel { padding: 24px 20px 20px; }
  .auth__title { font-size: 28px; }
  .foot__spacer { display: none; }
}

/* Vertical rhythm inside cards: every block after the header is spaced. */
.card > :not(.card__head) + :not(.card__head):not(.table):not(.rows):not(.steps):not(.feed):not(.appr):not(.checks):not(.claims):not(.facts) { margin-top: var(--space-4); }
.card > .table:first-child, .card > .rows:first-child { margin-top: -24px; }
.card > .table:first-child .table__head { border-top: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.show-sm { display: none; }
@media (max-width: 900px) {
  .show-sm { display: inline; }
  .card > .table:first-child, .card > .rows:first-child { margin-top: -18px; }
  .table__row--audit .cell-main > * { white-space: normal; }
  .table__row--audit { padding-top: 10px; padding-bottom: 10px; }
}

/* ---- model picker (agent form) ---------------------------------------- */
.model { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.model .field { margin: 0; }
.input--select optgroup { color: var(--text-3); font-style: normal; font-weight: 600; background: var(--surface); }
.input--select option { color: var(--text); background: var(--surface); }
.model__note { color: var(--text-2); font-size: var(--fs-small); margin: -4px 0 0; }
.model__ollama { color: var(--text-3); font-size: var(--fs-caption); display: flex; align-items: center; gap: 6px; margin: 0; }
.model__facts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.mfact { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.mfact:first-child { border-top: 0; }
.mfact__k { font: 500 10.5px/1.6 var(--mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.mfact__v { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-small); color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.mfact__v strong { color: var(--text); font-weight: 600; }
.mfact__line .icon { vertical-align: -2px; margin-right: 4px; }
.mfact__ok { color: var(--ok); }
.mfact__status { font-size: var(--fs-caption); padding: 6px 10px; border-radius: var(--radius-xs); border: 1px solid var(--line); }
.mfact__status.is-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-wash); }
.mfact__status.is-bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-wash); }
.mfact__status.is-wait { color: var(--wait); border-color: var(--wait-line); background: var(--wait-wash); }
.model__local { border: 1px solid var(--wait-line); background: var(--wait-wash); border-radius: var(--radius-sm); padding: 12px 14px; font-size: var(--fs-small); color: var(--text-2); }
.model__local summary { cursor: pointer; color: var(--text); font-weight: 600; }
.model__local p, .model__local ol { margin: 10px 0 0; }
.model__local ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 640px) { .mfact { grid-template-columns: 1fr; gap: 4px; } }

/* ---- new-agent flow ----------------------------------------------------- */
.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.template { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.template:hover, .template:focus-visible { border-color: var(--wait-line); background: var(--surface-2); }
.template__title { font-weight: 600; }
.template__blurb { font-size: var(--fs-small); color: var(--text-3); }
.field--big .input--area { min-height: 180px; font-size: 15px; line-height: 1.55; }
.model__chosen { margin: 0; font-size: 15px; color: var(--text); }
.model__chosen .muted { color: var(--text-3); font-size: var(--fs-small); }
.model__status { margin: 0; font-size: var(--fs-small); padding: 8px 12px; border-radius: var(--radius-xs); border: 1px solid var(--line); color: var(--text-2); }
.model__status.is-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-wash); }
.model__status.is-bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-wash); }
.model__status.is-wait { color: var(--wait); border-color: var(--wait-line); background: var(--wait-wash); }
.reach { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.reach__summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; color: var(--text); font-weight: 500; }
.reach__summary::-webkit-details-marker { display: none; }
.reach__change { font-size: var(--fs-small); color: var(--wait); }
.reach[open] .reach__change { visibility: hidden; }
.reach__body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.reach__only { margin: 14px 0 0; font-size: var(--fs-small); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.reach__only .icon { color: var(--ok); }
.reach__only strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.choice.is-selected { border-color: var(--wait-line); background: var(--wait-wash); }
.choice input { margin-top: 3px; accent-color: var(--wait); }
.choice__text { display: flex; flex-direction: column; gap: 3px; }
.choice__label { font-weight: 600; color: var(--text); font-size: var(--fs-small); }
.choice__hint { font-size: var(--fs-caption); color: var(--text-3); }
.advanced > .advanced__summary { cursor: pointer; list-style: none; }
.advanced > .advanced__summary::-webkit-details-marker { display: none; }
.advanced > .advanced__summary .card__title::after { content: " +"; color: var(--text-3); }
.advanced[open] > .advanced__summary .card__title::after { content: " −"; }
.advanced[open] > .advanced__summary { margin-bottom: 16px; }
@media (max-width: 720px) { .templates, .choices { grid-template-columns: 1fr; } }
.advanced > .advanced__summary { margin-bottom: 0; }
.advanced[open] > .advanced__summary { margin-bottom: 16px; }

/* ---- last run's answer ---- */
.answer__meta { margin: 0; font-size: var(--fs-small); color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.answer__outcome { font-weight: 600; }
.answer__outcome.is-ok { color: var(--ok); }
.answer__outcome.is-bad { color: var(--bad); }
.answer__outcome.is-wait { color: var(--wait); }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 15px; line-height: 1.6; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); max-height: 480px; overflow: auto; }
.runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.run { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.run:first-child { border-top: 0; padding-top: 0; }
.run__input { margin: 0; color: var(--text-2); font-size: var(--fs-small); overflow-wrap: anywhere; }
.run__n { font-family: var(--mono); font-size: var(--fs-caption); color: var(--text-3); padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); }
.waitbadge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--wait-line); background: var(--wait-wash); color: var(--wait); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; flex: none; }
.waitbadge:hover { color: var(--wait); border-color: var(--wait); }
.waitbadge__dot { width: 7px; height: 7px; border-radius: 99px; background: var(--wait); }
.appr__row { align-items: flex-start; }
.appr__what { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.appr__title strong { font-weight: 700; }
.appr__args { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: var(--fs-small); }
.appr__args > div { display: contents; }
.appr__args dt { color: var(--text-3); }
.appr__args dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.appr__raw summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-small); }
.appr__raw .code { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; }
.appr__btns { flex-wrap: wrap; align-items: center; }
.appr__row--single { padding: 0; border: 0; }
.fix { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--wait-line); background: var(--wait-wash); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.fix__what { margin: 0; font-size: var(--fs-small); color: var(--text-2); }
.fix__cmd { display: flex; gap: 10px; align-items: center; width: 100%; flex-wrap: wrap; }
.fix__cmd .cmd { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fine.is-bad { color: var(--bad); }
.notice--wait { border-color: var(--wait-line); background: var(--wait-wash); }
.nomodel { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 16px; }
.nomodel p { margin: 0; }
.model__status p { margin: 0 0 6px; }
