:root {
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", "DejaVu Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-w: 224px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

[data-theme="light"] {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e9eaee;
  --border: #e4e5e9;
  --border-strong: #d1d4da;
  --fg: #111318;
  --fg-2: #3b3f48;
  --muted: #6b707c;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-fg: #ffffff;
  --accent-soft: #eef0ff;
  --focus: rgba(79, 70, 229, .35);
  --ok: #15803d;      --ok-soft: #e7f6ec;
  --warn: #b45309;    --warn-soft: #fdf3e2;
  --err: #c81e1e;     --err-soft: #fdecec;
  --serious: #c2410c; --serious-soft: #fff0e6;
  --info: #1d63d8;    --info-soft: #e8f0fd;
  --neutral: #5f6571; --neutral-soft: #eff0f2;
  --meter-track: #eceef2;
  --meter-fill: #4f46e5;
  --meter-ext: #a5b4fc;
  --shadow: 0 1px 2px rgba(16, 18, 24, .05), 0 1px 1px rgba(16, 18, 24, .03);
  --shadow-lg: 0 12px 40px rgba(16, 18, 24, .18), 0 2px 6px rgba(16, 18, 24, .08);
  --backdrop: rgba(17, 19, 24, .38);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0c0d10;
  --surface: #14161a;
  --surface-2: #1b1d22;
  --surface-3: #24272d;
  --border: #25282e;
  --border-strong: #353941;
  --fg: #e8eaee;
  --fg-2: #c3c7cf;
  --muted: #8a909b;
  --accent: #8b93ff;
  --accent-hover: #a2a8ff;
  --accent-fg: #0c0d10;
  --accent-soft: #1f2140;
  --focus: rgba(139, 147, 255, .4);
  --ok: #4ade80;      --ok-soft: #12291b;
  --warn: #fbbf24;    --warn-soft: #2d2410;
  --err: #f87171;     --err-soft: #2e1515;
  --serious: #fb923c; --serious-soft: #2f1b0d;
  --info: #60a5fa;    --info-soft: #132238;
  --neutral: #9aa0ab; --neutral-soft: #202329;
  --meter-track: #23262c;
  --meter-fill: #8b93ff;
  --meter-ext: #4b4f8f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --backdrop: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
[hidden] { display: none !important; }

/* boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-spinner { width: 22px; height: 22px; }

/* shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); min-height: 100vh; }
.sidebar-inner {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 600; }
.brand img { width: 26px; height: 26px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--fg-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--fg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; }
.sidebar-foot .segmented button { padding: 0 8px; }
.sidebar-foot { margin-top: auto; padding: 10px 4px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); }
.version { font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 16px; }
.topbar .menu-btn { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.page > div:empty { display: none; }
.page { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head .lead { color: var(--muted); max-width: 720px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; gap: 10px; }
.section-head .count { color: var(--muted); font-size: 12.5px; }
.section-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.drawer-backdrop { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: 264px; min-height: 0;
    transform: translateX(-100%); transition: transform .2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .shell.nav-open .sidebar { transform: none; }
  .sidebar-inner { height: 100%; }
  .shell.nav-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: var(--backdrop); }
  .topbar { padding: 0 12px; }
  .topbar .menu-btn { display: inline-flex; }
  .page { padding: 16px 12px; gap: 20px; }
  .hide-mobile { display: none !important; }
}

/* buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn .btn-label { display: inline-flex; align-items: center; gap: 6px; }
.btn .spinner { position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; opacity: 0; }
.btn.busy { pointer-events: none; }
.btn.busy .btn-label { visibility: hidden; }
.btn.busy .spinner { opacity: 1; }
.spinner {
  display: inline-block; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-weight: 500; font-size: 13px; color: var(--fg-2); }
.field .help { font-size: 12px; color: var(--muted); }
.field .req { color: var(--err); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); font: 13.5px var(--font);
  transition: border-color .12s, box-shadow .12s;
}
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.textarea { height: auto; min-height: 84px; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--err); }
.input-group { display: flex; gap: 6px; }
.input-group .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
}
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 32px; height: 18px; flex: none; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .15s, border-color .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s var(--ease); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--focus); }
.switch .switch-text { font-size: 13px; color: var(--fg-2); }

.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { height: 26px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button svg { width: 15px; height: 15px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-body { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 52px; }
.card-head h2, .card-head h3 { min-width: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 12px; }
.grid.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cards-lg { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
@media (max-width: 1000px) { .grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid.cards, .grid.cards-lg { grid-template-columns: minmax(0, 1fr); } }

.tile { padding: 14px 16px; height: 88px; display: flex; flex-direction: column; justify-content: space-between; }
.tile .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tile .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.tile .value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.stats > div { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats .n { font-size: 18px; font-weight: 600; line-height: 1.1; }
.stats .l { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* badges */
.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; flex: none;
}
.badge.fixed { min-width: 104px; }
.badge.fixed-sm { min-width: 76px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.serious { background: var(--serious-soft); color: var(--serious); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.pulse::before { animation: pulse 1.6s ease-in-out var(--pulse-delay, 0s) infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--fg-2); white-space: nowrap; gap: 4px; }
.chip.mono { font-family: var(--mono); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-badge { background: var(--warn-soft); color: var(--warn); }

/* meter */
.meter { position: relative; height: 8px; border-radius: 99px; background: var(--meter-track); overflow: visible; }
.meter .fill, .meter .ext { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; max-width: 100%; transition: width .4s var(--ease); }
.meter .ext { background: var(--meter-ext); }
.meter .fill { background: var(--meter-fill); }
.meter .fill.warn { background: var(--warn); }
.meter .fill.err { background: var(--err); }
.meter .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--fg-2); box-shadow: 0 0 0 2px var(--surface); }
.meter.unlimited { background: repeating-linear-gradient(135deg, var(--meter-track) 0 6px, transparent 6px 12px); }
.meter-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 17px; }
.meter-legend b { color: var(--fg); font-weight: 600; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.table th, .table td { padding: 0 12px; height: 40px; text-align: left; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table th { height: 36px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table td.num, .table th.num { text-align: right; }
.table .sub { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.table td.two { line-height: 1.25; }
.table .empty-row td { height: 120px; text-align: center; color: var(--muted); white-space: normal; }
.table .skel-row td { height: 40px; }

/* skeleton / empty / error */
.skel { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); min-height: 180px; }
.empty svg { width: 28px; height: 28px; opacity: .7; }
.empty strong { color: var(--fg); font-weight: 600; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--fg-2); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent); }
.callout.err { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); background: var(--err-soft); color: var(--fg); }
.callout.err svg { color: var(--err); }
.callout.warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); background: var(--warn-soft); }
.callout.warn svg { color: var(--warn); }
.callout .grow > * + * { margin-top: 4px; }

/* code */
.code { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.code pre { margin: 0; padding: 10px 44px 10px 12px; overflow: auto; font: 12.5px/1.55 var(--mono); color: var(--fg); max-height: 420px; }
.code .copy { position: absolute; top: 5px; right: 5px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button { height: 36px; padding: 0 12px; border: 0; background: none; color: var(--muted); font: 500 13.5px var(--font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .select, .toolbar .input { width: auto; min-width: 150px; height: 32px; }
@media (max-width: 600px) { .toolbar .select, .toolbar .input { flex: 1 1 140px; min-width: 0; } }

/* dialog */
dialog.dlg { padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 48px); }
dialog.dlg.wide { width: min(760px, calc(100vw - 24px)); }
dialog.dlg.narrow { width: min(440px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: var(--backdrop); }
dialog.dlg[open] { display: flex; flex-direction: column; animation: dlg-in .16s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { font-size: 15px; }
.dlg-head .close { margin-left: auto; }
.dlg-body { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; align-items: center; }
.dlg-foot .left { margin-right: auto; min-width: 0; }
.dlg-error { min-height: 18px; font-size: 12.5px; color: var(--err); }

/* toasts */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; width: min(380px, calc(100vw - 32px)); padding: 10px 12px; border-radius: var(--radius); background: var(--surface); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13px; animation: dlg-in .18s var(--ease); }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }
.toast.info svg { color: var(--info); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
.login .brand { padding: 0 0 18px; }
.login-tools { position: fixed; top: 12px; right: 12px; display: flex; gap: 6px; }

/* dashboard */
.conn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap; min-height: 68px; }
.conn .gh { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.conn .gh svg { width: 20px; height: 20px; }
.class-card .card-body, .prov-card .card-body { display: flex; flex-direction: column; gap: 12px; }
.runner-states { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.countdown { font-variant-numeric: tabular-nums; }
.prov-err { font-size: 12px; color: var(--err); min-height: 17px; }
.card-title { display: flex; flex-direction: column; min-width: 0; }
.card-title .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* CI pressure */
.pressure .card-head { gap: 8px; }
.info-tip { display: inline-grid; place-items: center; color: var(--muted); cursor: help; border-radius: 50%; }
.info-tip svg { width: 15px; height: 15px; }
.pressure-err { color: var(--err); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pressure-body { display: grid; grid-template-columns: 252px minmax(220px, 1fr) minmax(280px, 1.25fr); gap: 28px; padding: 18px 20px 20px; min-height: 236px; transition: opacity .2s; }
.pressure-body.stale { opacity: .45; }
.pressure-gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge { width: 236px; height: 130px; display: block; overflow: visible; --lv: var(--ok); }
.gauge.lv-busy { --lv: var(--warn); }
.gauge.lv-high { --lv: var(--serious); }
.gauge.lv-critical { --lv: var(--err); }
.g-track { fill: none; stroke: var(--meter-track); stroke-width: 16; }
.g-fill { fill: none; stroke: var(--lv); stroke-width: 16; transition: stroke-dasharray .6s var(--ease), stroke .3s; }
.g-zone { fill: none; stroke-width: 4; opacity: .55; }
.g-zone.lv-calm, .g-zone.lv-normal { stroke: var(--ok); }
.g-zone.lv-busy { stroke: var(--warn); }
.g-zone.lv-high { stroke: var(--serious); }
.g-zone.lv-critical { stroke: var(--err); }
.g-marker { transform-origin: 120px 120px; transform-box: view-box; transition: transform .6s var(--ease); }
.g-marker circle { fill: var(--lv); stroke: var(--surface); stroke-width: 3; transition: fill .3s; }
.g-value { font: 600 44px/1 var(--font); fill: var(--fg); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.g-level { height: 24px; display: flex; align-items: center; justify-content: center; }
.factors { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.factor { display: grid; grid-template-columns: 76px minmax(0, 1fr) 26px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: help; }
.factor .fv { text-align: right; color: var(--fg-2); font-weight: 600; }
.meter.thin { height: 4px; }
.meter.thin .fill { background: var(--fg-2); opacity: .55; }
.pressure-eta { display: flex; flex-direction: column; min-width: 0; }
.eta-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.eta-value { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 6px; min-height: 40px; white-space: nowrap; }
.eta-sub { font-size: 12.5px; color: var(--fg-2); min-height: 36px; margin-top: 2px; }
.pressure-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.pressure-facts .fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pressure-facts dt { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pressure-facts dd { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.warn-text { color: var(--warn); }
/* aging gate card (dashboard) */
.aging .card-head { gap: 8px; }
.aging-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px 24px; padding: 16px 20px 18px; }
.aging-body.stale { opacity: .55; }
.aging-facts { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding-top: 0; border-top: 0; grid-column: 1 / -1; }
.aging-holds { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.aging-hold { display: flex; align-items: center; gap: 8px; min-width: 0; }
.aging-history { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.aging-series-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.aging-bars { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); align-items: end; gap: 2px; height: 34px; }
.aging-bar { display: block; background: var(--warn); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.aging-bar.zero { background: var(--border); opacity: 1; }
@media (max-width: 900px) {
  .aging-body { grid-template-columns: minmax(0, 1fr); }
  .aging-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pressure-history { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sparks { position: relative; display: flex; flex-direction: column; gap: 22px; padding-top: 6px; }
.spark { display: grid; grid-template-columns: 64px minmax(0, 1fr) 34px; align-items: end; gap: 10px; }
.sp-label { font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.sp-now { font-size: 17px; font-weight: 600; text-align: right; line-height: 1; }
.sp-plot { position: relative; height: 52px; }
.sp-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sp-base { stroke: var(--border-strong); stroke-width: 1; }
.sp-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.sp-area { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.sp-waiting .sp-line { stroke: var(--accent); }
.sp-running .sp-line { stroke: var(--fg-2); }
.sp-running .sp-area { fill: color-mix(in srgb, var(--fg-2) 12%, transparent); }
.sp-grid { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.sp-max { position: absolute; top: -3px; left: 0; font-size: 10.5px; color: var(--muted); line-height: 1; padding-right: 5px; background: var(--surface); }
.sp-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.sp-running .sp-dot { background: var(--fg-2); }
.sp-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: -14px 44px 0 74px; }
.sp-overlay { position: absolute; top: 6px; bottom: 18px; left: 74px; right: 44px; }
.sp-hit { position: absolute; inset: -6px 0; cursor: crosshair; }
.sp-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong); pointer-events: none; }
.sp-tip { position: absolute; top: -34px; z-index: 5; display: flex; gap: 10px; align-items: center; white-space: nowrap; padding: 5px 9px; border-radius: 6px; font-size: 12px; color: var(--fg-2); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); pointer-events: none; }
.sp-tip b { color: var(--fg); font-weight: 600; }
.class-eta { min-height: 18px; color: var(--fg-2); }
.class-blocked { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); min-height: 17px; }
.class-blocked svg { width: 14px; height: 14px; flex: none; }
.class-oldest { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 22px; color: var(--fg-2); min-width: 0; }
.class-oldest b { font-variant-numeric: tabular-nums; }
.class-oldest .wait-reason { max-width: 100%; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; }
.budget-alerts { display: flex; flex-direction: column; gap: 8px; }
.budget-alerts:empty { display: none; }
.budget-alert { align-items: center; }
.budget-alert .grow { min-width: 0; }
.budget-alert-text { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; }
.budget-alert-link { flex: none; }
.fact-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .budget-alert { flex-wrap: wrap; align-items: flex-start; }
  .budget-alert .grow { flex: 1 1 calc(100% - 30px); }
  .budget-alert-link { margin-left: 28px; }
}
.queue-more { min-height: 17px; }
.queue-more:empty { display: none; }
@media (max-width: 1180px) {
  .pressure-body { grid-template-columns: 252px minmax(0, 1fr); }
  .pressure-history { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .pressure-body { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 16px; }
  .pressure-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pressure .card-head .small.muted { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .g-fill, .g-marker, .g-marker circle, .meter .fill { transition: none; }
}

/* routing */
.routing { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.class-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.class-list button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--fg-2); cursor: pointer; font: inherit; min-height: 50px; }
.class-list button:hover { background: var(--surface-2); }
.class-list button[aria-current="true"] { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); color: var(--fg); }
.class-list .nm { font-family: var(--mono); font-size: 12.5px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-list .meta { font-size: 11.5px; color: var(--muted); }
.class-list .count { margin-left: auto; font-size: 11.5px; color: var(--muted); min-width: 20px; text-align: right; }
.class-select { display: none; }
@media (max-width: 860px) {
  .routing { grid-template-columns: minmax(0, 1fr); }
  .class-list { display: none; }
  .class-select { display: block; }
}
.chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; min-height: 26px; }
.chain .step { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); white-space: nowrap; }
.chain .step.first { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chain .step.job { background: var(--surface-2); }
.chain .arrow { color: var(--muted); }
.chain .arrow svg { width: 14px; height: 14px; display: block; }

.routes { display: flex; flex-direction: column; gap: 8px; }
.route {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 22px 28px minmax(160px, 1.1fr) minmax(220px, 1.4fr) auto auto auto;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: opacity .12s, border-color .12s, box-shadow .12s;
}
.route.disabled .prov, .route.disabled .prio { opacity: .5; }
.route.dragging { opacity: .4; }
.route.drop-before { box-shadow: 0 -3px 0 0 var(--accent), var(--shadow); }
.route.drop-after { box-shadow: 0 3px 0 0 var(--accent), var(--shadow); }
.route .handle { cursor: grab; color: var(--muted); display: grid; place-items: center; height: 32px; touch-action: none; }
.route .handle svg { width: 16px; height: 16px; }
.route .prio { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--fg-2); }
.route:first-child .prio { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.route .prov { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.route .prov .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route .prov .meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); min-width: 0; }
.route .mt { min-width: 0; }
.route .wait { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.route .wait .input { width: 64px; text-align: right; }
.chain .wait-tag { font-size: 11.5px; color: var(--muted); }
.route .order { display: flex; gap: 2px; }
.route .tail { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1100px) {
  .route { grid-template-columns: 22px 28px minmax(0, 1fr) auto; }
  .route .mt { grid-column: 3 / -1; grid-row: 2; }
  .route .wait { grid-column: 3 / -1; grid-row: 3; }
  .route .order { grid-column: 4; grid-row: 1; }
  .route .tail { grid-column: 1 / 3; grid-row: 2; justify-content: flex-start; }
  .route .tail .switch-text { display: none; }
}
@media (max-width: 520px) {
  .route { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; }
  .route .prio { display: none; }
  .route .prov { grid-column: 2; }
  .route .order { grid-column: 3; }
  .route .mt { grid-column: 1 / -1; grid-row: 2; }
  .route .wait { grid-column: 1 / -1; grid-row: 3; }
  .route .tail { grid-column: 1 / -1; grid-row: 4; justify-content: space-between; }
  .route .tail .switch-text { display: inline; }
}
.add-route { display: flex; gap: 8px; flex-wrap: wrap; }
.add-route .select { flex: 1 1 220px; width: auto; }
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.savebar .dirty { font-size: 12.5px; color: var(--muted); min-width: 0; }
.savebar .dirty.on { color: var(--warn); }
.savebar .btns { margin-left: auto; display: flex; gap: 8px; }

/* classes / providers */
.entity-card, .class-card, .prov-card { display: flex; flex-direction: column; }
.entity-card .card-body, .class-card .card-body, .prov-card .card-body { flex: 1; }
.entity-card .card-body { display: flex; flex-direction: column; gap: 12px; }
.entity-card .desc { color: var(--fg-2); font-size: 13px; min-height: 19px; }
.snippet { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font: 12.5px var(--mono); }
.snippet code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet .k { color: var(--muted); }
.kind-list { display: grid; gap: 8px; }
.kind-option { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); cursor: pointer; font: inherit; }
.kind-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.kind-option .ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); flex: none; font-weight: 700; font-size: 13px; color: var(--accent); }
.kind-option p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.test-result { font-size: 12.5px; min-height: 18px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.test-result svg { width: 15px; height: 15px; flex: none; }
.test-result.ok { color: var(--ok); }
.test-result.err { color: var(--err); }
.test-result span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret-wrap { position: relative; }
.secret-wrap .input { padding-right: 38px; }
.secret-wrap .btn { position: absolute; right: 3px; top: 3px; height: 28px; width: 28px; box-shadow: none; }
.mult-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* events */
.lvl { display: inline-block; min-width: 46px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.lvl.info { color: var(--info); }
.lvl.warn { color: var(--warn); }
.lvl.error { color: var(--err); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 900px; }

/* GitHub targets */
.group-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.target-list { display: flex; flex-direction: column; }
.target-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.target-row:first-child { border-top: 0; padding-top: 0; }
.target-row .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.target-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.target-row .test-result { grid-column: 1 / -1; }
@media (max-width: 640px) { .target-row { grid-template-columns: minmax(0, 1fr); } .target-row .acts { justify-content: flex-start; } }

/* statistics */
.stats-page { transition: opacity .15s; }
.stats-page.is-busy .stats-body, .stats-page.is-busy .tiles { opacity: .55; pointer-events: none; }
.stats-page.is-error .skel { animation: none; }
.stats-body { display: flex; flex-direction: column; gap: 24px; }
.stats-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .stats-pair { grid-template-columns: minmax(0, 1fr); } }
.stats-card .card-head { flex-wrap: wrap; }
.stats-card .card-title .sub { min-height: 17px; }
.stat-tile { height: 100px; }
.stat-tile .tile-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 17px; }
.ts-host { height: 220px; position: relative; }
.ts-chart { display: block; overflow: visible; }
.ts-grid line { stroke: var(--border); stroke-width: 1; }
.ts-grid line.base { stroke: var(--border-strong); }
.ts-grid text, .ts-x text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ts-bars path { fill: var(--meter-fill); }
.ts-bars path.on { fill: var(--accent-hover); }
.ts-bars:has(path.on) path:not(.on) { opacity: .55; }
.ts-hits rect { fill: transparent; cursor: default; outline: none; }
.ts-hits rect:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.rank-list { --row-h: 32px; display: flex; flex-direction: column; min-height: calc(var(--rows) * var(--row-h)); }
.rank-list.has-sub { --row-h: 44px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr) 84px; align-items: center; gap: 12px; height: var(--row-h); padding: 0 6px; margin: 0 -6px; border-radius: var(--radius-sm); outline: none; }
.rank-row:not(.skel-row):hover, .rank-row:focus-visible { background: var(--surface-2); }
.rank-row:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.rank-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rank-name .nm { font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name .sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { position: relative; height: 8px; border-radius: 99px; background: var(--meter-track); }
.rank-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--meter-fill); }
.rank-bar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--fg-2); }
.rank-row:hover .rank-bar i, .rank-row:focus-visible .rank-bar i { background: var(--accent-hover); }
.rank-val { text-align: right; font-size: 13px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-empty { flex: 1; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.rank-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.rank-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rank-legend .lg-bar { width: 16px; height: 8px; border-radius: 99px; background: var(--meter-fill); }
.rank-legend .lg-mark { width: 2px; height: 14px; border-radius: 1px; background: var(--fg-2); }
.stats-tip { position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; min-width: 150px; max-width: min(320px, calc(100vw - 16px)); padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 12px; }
.stats-tip .tip-title { font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-tip .tip-line { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.stats-tip .tip-line b { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table th.sortable { padding: 0 6px; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 28px; padding: 0 6px; border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; cursor: pointer; }
.sort-btn:hover { background: var(--surface-3); color: var(--fg); }
.sort-arrow { width: 10px; flex: none; visibility: hidden; }
.sort-arrow.on { visibility: visible; color: var(--fg); }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--fg-2); }
@media (max-width: 520px) {
  .rank-row { grid-template-columns: minmax(0, 1fr) 72px; grid-template-rows: auto 8px; row-gap: 4px; }
  .rank-list { --row-h: 50px; }
  .rank-list.has-sub { --row-h: 62px; }
  .rank-row { align-content: center; padding-bottom: 4px; }
  .rank-name { grid-column: 1; grid-row: 1; }
  .rank-val { grid-column: 2; grid-row: 1; }
  .rank-bar { grid-column: 1 / -1; grid-row: 2; }
  .rank-legend { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .rank-bar i { transition: width .4s var(--ease); }
  .ts-bars path { transition: opacity .12s, fill .12s; }
}

/* workflows */
.search-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.search-wrap > svg { position: absolute; left: 9px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-left: 30px; }
.wf-toolbar .search-wrap { flex: 1 1 220px; max-width: 340px; }
.wf-toolbar .search-wrap .input { width: 100%; }
.wf-toolbar .input.mono { width: 150px; min-width: 120px; }
.grp-ctl { gap: 8px; }
.grp-ctl .select { width: auto; min-width: 120px; height: 32px; }
.wf-stale { min-height: 17px; color: var(--warn); margin: -20px 0 -21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-stale:empty { visibility: hidden; }
.wf-more { display: flex; align-items: center; gap: 8px; min-height: 32px; }
@media (max-width: 600px) {
  .wf-toolbar .search-wrap { flex: 1 1 100%; max-width: none; }
  .wf-toolbar .input.mono { flex: 1 1 140px; width: auto; }
  .grp-ctl { flex: 1 1 100%; }
  .grp-ctl .select { flex: 1 1 0; min-width: 0; }
}

.empty .btn svg { width: 15px; height: 15px; opacity: 1; }

/* run list */
.run-table .run-row { cursor: pointer; }
.run-table td { height: 52px; }
.run-table.compact td { height: 46px; }
.run-table .run-link { display: block; color: var(--fg); font-weight: 500; }
.run-table .run-row:hover .run-link { color: var(--accent); }
.mono-sub { display: flex !important; align-items: center; gap: 4px; font-family: var(--mono); font-size: 11px !important; }
.mono-sub svg { width: 11px; height: 11px; flex: none; }
.jobs-bar { display: flex; align-items: center; gap: 8px; }
.jb-track { flex: 1; display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--meter-track); gap: 1px; min-width: 48px; }
.jb-track.empty { background: repeating-linear-gradient(135deg, var(--meter-track) 0 4px, transparent 4px 8px); border: 1px solid var(--border); }
.jb-track i { display: block; height: 100%; min-width: 3px; }
.jb-track .ok { background: var(--ok); }
.jb-track .err { background: var(--err); }
.jb-track .cancel { background: var(--neutral); }
.jb-track .skip { background: color-mix(in srgb, var(--neutral) 40%, var(--meter-track)); }
.jb-track .run { background: var(--accent); background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.jb-track .queue { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 55%, transparent) 0 3px, transparent 3px 6px); }
.jb-n { width: 38px; flex: none; font-size: 11.5px; color: var(--muted); text-align: right; }

/* grouped */
.grp-list { display: flex; flex-direction: column; gap: 8px; }
.grp { overflow: hidden; }
.grp-head {
  display: grid; grid-template-columns: 20px minmax(180px, 1.6fr) minmax(190px, 1fr) minmax(120px, .8fr) 84px 150px; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; padding: 10px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.grp-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.skel-grp .grp-head { cursor: default; }
.grp-chev { display: grid; place-items: center; color: var(--muted); transition: transform .15s var(--ease); }
.grp-chev svg { width: 16px; height: 16px; }
.grp-head[aria-expanded="true"] .grp-chev { transform: rotate(90deg); }
.grp-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.25; }
.grp-name .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-name .nm.mono { font-size: 12.5px; }
.grp-name .sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grp-stat { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.grp-stat b { font-size: 15px; font-weight: 600; }
.grp-stat b.on { color: var(--accent); }
.grp-stat b.bad { color: var(--err); }
.grp-stat small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-rate { display: flex; align-items: center; gap: 8px; min-width: 0; }
.grp-rate .meter { flex: 1; height: 6px; }
.grp-rate .fill.ok { background: var(--ok); }
.grp-rate-n { width: 44px; flex: none; text-align: right; font-size: 12.5px; color: var(--fg-2); }
.grp-avg { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }
.grp-avg svg { width: 13px; height: 13px; color: var(--muted); }
.grp-last { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.grp-body { border-top: 1px solid var(--border); padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.grp-body .table-wrap { box-shadow: none; }
.grp-foot { display: flex; justify-content: flex-end; }
.grp-foot a { display: inline-flex; align-items: center; gap: 4px; }
.grp-foot svg { width: 14px; height: 14px; }
@media (max-width: 1000px) {
  .grp-head { grid-template-columns: 20px minmax(0, 1fr) 132px; grid-template-areas: "c n l" "c k r"; row-gap: 10px; }
  .grp-chev { grid-area: c; }
  .grp-name { grid-area: n; }
  .grp-last { grid-area: l; }
  .grp-counts { grid-area: k; }
  .grp-rate { grid-area: r; }
  .grp-avg { display: none; }
}
@media (max-width: 520px) {
  .grp-head { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; grid-template-areas: "c n l" "c k k" "c r r"; }
}

/* status glyph */
.st-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--neutral-soft); color: var(--neutral); }
.st-dot svg { width: 11px; height: 11px; stroke-width: 3; }
.st-dot.ok { background: var(--ok-soft); color: var(--ok); }
.st-dot.err { background: var(--err-soft); color: var(--err); }
.st-dot.warn { background: var(--warn-soft); color: var(--warn); }
.st-dot.accent { background: var(--accent-soft); color: var(--accent); }
.st-dot.spin svg { animation: spin 1.4s linear infinite; }
.chip svg { width: 12px; height: 12px; flex: none; }
.chip .ellipsis { min-width: 0; }
.chip-link { color: var(--fg-2); max-width: 220px; }
.chip-link:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.muted-chip { color: var(--muted); }
.routed-chip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); color: var(--accent); }

/* run detail */
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: -12px; align-self: flex-start; }
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--accent); text-decoration: none; }
.run-head { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 138px; }
.rh-top { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 28px; }
.rh-title { font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 13px; color: var(--fg-2); min-height: 30px; }
.rh-wf { display: inline-flex; align-items: center; gap: 6px; }
.rh-wf svg { width: 15px; height: 15px; color: var(--muted); }
.rh-repo { color: var(--muted); }
.rh-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.head-link { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); font-size: 12.5px; }
.head-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.head-link svg { width: 13px; height: 13px; }
.attempt-sw { gap: 6px; }
.attempt-sw .segmented button { height: 22px; padding: 0 8px; }
.rh-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); min-height: 39px; }
.mono-wrap { font-family: var(--mono); font-size: 12px; word-break: break-word; }
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.run-main, .run-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.run-elapsed { white-space: nowrap; }
@media (max-width: 1100px) { .run-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .run-head { padding: 14px; }
  .rh-top { align-items: flex-start; flex-direction: column; gap: 8px; }
  .rh-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; }
  .rh-actions .btn { flex: 1 1 auto; }
  .rh-actions .grow { display: none; }
}

/* gantt */
.gantt { display: flex; flex-direction: column; gap: 2px; }
.gantt-skel { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; }
.gantt-empty { min-height: 80px; display: grid; place-items: center; }
.g-row { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) 68px; gap: 12px; align-items: center; }
.g-rows { position: relative; display: flex; flex-direction: column; gap: 2px; }
.g-axis { height: 20px; }
.g-axis .g-track { height: 20px; }
.g-tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.g-tick:first-child { transform: none; }
.g-job { height: 30px; padding: 0 6px; margin: 0 -6px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.g-job:hover { background: var(--surface-2); }
.g-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.g-label .st-dot { width: 16px; height: 16px; }
.g-track { position: relative; height: 14px; border-radius: 4px;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: var(--tick, 25%) 100%; }
.g-axis .g-track, .g-now-row .g-track { background: none; }
.g-q, .g-r { position: absolute; top: 1px; bottom: 1px; border-radius: 3px; min-width: 2px; }
.g-q { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 35%, transparent) 0 3px, transparent 3px 6px); border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); }
.g-r { background: var(--neutral); }
.g-r.ok { background: var(--ok); }
.g-r.err { background: var(--err); }
.g-r.warn { background: var(--warn); }
.g-r.accent { background: var(--accent); }
.g-r.live { background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.g-reused { display: none; position: absolute; left: 0; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-style: italic; line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-job.reused .g-reused { display: block; }
.g-job.reused .g-label { color: var(--muted); }
.g-dur { font-size: 12px; color: var(--fg-2); text-align: right; white-space: nowrap; }
.g-now-row { position: absolute; inset: 0; pointer-events: none; }
.g-now-row .g-track { height: 100%; }
.g-now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--accent); opacity: .6; border-radius: 1px; }
.g-legend { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.g-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g-legend .lg { position: static; display: inline-block; width: 18px; height: 9px; }
.g-legend .lg-run { background: linear-gradient(90deg, var(--accent) 0 33%, var(--ok) 33% 66%, var(--err) 66%); }
@media (max-width: 600px) {
  .g-row { grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 8px; }
  .g-label .st-dot { display: none; }
}

/* jobs */
.job-list { display: flex; flex-direction: column; }
.job { border-top: 1px solid var(--border); }
.job:first-child { border-top: 0; }
.job-head { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; align-items: center; gap: 2px 10px; min-height: 48px; padding: 6px 12px 8px 6px; }
.job-head .job-chips { grid-column: 1 / -1; grid-row: 2; padding: 0 8px 0 38px; }
.job-head .job-chips:empty { display: none; }
.skel-job .job-head { display: flex; padding: 0 16px; }
.job-toggle { display: flex; align-items: center; gap: 8px; min-width: 0; height: 34px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--fg); font: 500 13px var(--font); text-align: left; cursor: pointer; }
.job-toggle:hover { background: var(--surface-2); }
.job-toggle .chev { display: grid; place-items: center; color: var(--muted); transition: transform .15s var(--ease); }
.job-toggle .chev svg { width: 14px; height: 14px; }
.job.open .job-toggle .chev { transform: rotate(90deg); }
.job-name { min-width: 0; }
.job-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.job-dur { font-size: 12.5px; color: var(--fg-2); text-align: right; white-space: nowrap; }
.job-acts { display: flex; gap: 2px; align-items: center; }
.icon-gap { display: inline-block; width: 28px; }
.job-steps { padding: 0 16px 12px 46px; }
.steps { list-style: none; margin: 0; padding: 6px 0 0; display: flex; flex-direction: column; border-left: 2px solid var(--border); }
.step { display: grid; grid-template-columns: 18px 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; height: 30px; padding-left: 12px; font-size: 12.5px; color: var(--fg-2); }
.step .st-dot { width: 16px; height: 16px; }
.step-n { color: var(--muted); font-size: 11.5px; text-align: right; }
.step-dur { color: var(--muted); font-size: 12px; white-space: nowrap; }
.step.st-skipped .step-name { color: var(--muted); }
.step.st-failure .step-name { color: var(--err); font-weight: 500; }
.step-empty { padding: 8px 0; }
.job-empty { padding: 16px; }
.job-empty .empty { min-height: 140px; }
@media (max-width: 760px) {
  .job-head { padding-right: 8px; }
  .job-acts .btn:not(.icon) .btn-label span { display: none; }
  .job-acts .btn:not(.icon) { width: 28px; padding: 0; }
  .job-steps { padding-left: 24px; }
}

/* trigger panel */
.run-kv { grid-template-columns: max-content minmax(0, 1fr); gap: 9px 14px; margin: 0; align-items: center; }
.run-kv dd { text-align: left; display: flex; align-items: center; min-height: 20px; }
.run-kv dd > span, .run-kv dd > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-ico { width: 14px; height: 14px; color: var(--muted); flex: none; }
.sha-row { display: flex !important; align-items: center; gap: 2px; min-width: 0; }
.sha-row code { min-width: 0; font-size: 11.5px; }
.sha-row .btn { height: 22px; width: 22px; flex: none; }
.commit-msg { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cm-head { display: flex; align-items: center; gap: 5px; }
.cm-head svg { width: 14px; height: 14px; }
.cm-title { font-weight: 500; word-break: break-word; }
.cm-body { white-space: pre-wrap; font-size: 12.5px; color: var(--muted); max-height: 140px; overflow: auto; word-break: break-word; }

/* tags */
.tag-list { min-height: 24px; margin-bottom: 10px; }
.tag-chip { padding-right: 2px; max-width: 100%; }
.tag-x { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.tag-x:hover { background: var(--err-soft); color: var(--err); }
.tag-x svg { width: 11px; height: 11px; }
.tag-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; }
.tag-form .input { height: 28px; font-size: 12px; }
.tagsBody .dlg-error, .tag-form + .dlg-error { margin: 4px 0; }

/* history */
.hist { display: flex; flex-direction: column; max-height: 380px; overflow: auto; padding: 6px 0; }
.hist-item { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; padding: 6px 16px; min-height: 44px; }
.hist-item::before { content: ""; position: absolute; left: 21.5px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.hist-item:first-child::before { top: 14px; }
.hist-item:last-child::before { bottom: calc(100% - 14px); }
.hist-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; background: var(--neutral); box-shadow: 0 0 0 3px var(--surface); }
.hist-dot.ok { background: var(--ok); }
.hist-dot.err { background: var(--err); }
.hist-dot.warn { background: var(--warn); }
.hist-dot.accent, .hist-dot.info { background: var(--accent); }
.hist-main { min-width: 0; }
.hist-text { display: flex; gap: 6px; font-size: 13px; min-width: 0; }
.hist-text b { font-weight: 600; flex: none; }
.hist-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-empty { padding: 12px 16px; }

/* raw json */
details.raw > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600; min-height: 48px; }
details.raw > summary::-webkit-details-marker { display: none; }
details.raw > summary svg { width: 16px; height: 16px; color: var(--muted); }
details.raw[open] > summary { border-bottom: 1px solid var(--border); }
details.raw .code pre { max-height: 520px; }

/* logs dialog */
dialog.dlg.logs { width: min(1120px, calc(100vw - 24px)); height: min(820px, calc(100vh - 48px)); }
dialog.dlg.logs .dlg-body { flex: 1; min-height: 0; gap: 10px; padding: 12px 18px; }
dialog.dlg.logs .dlg-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-toolbar .search-wrap { flex: 1 1 220px; max-width: 360px; }
.log-toolbar .search-wrap .input { width: 100%; }
.log-toolbar .select { min-width: 150px; }
.log-view { flex: 1; min-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0d1117; color: #e6edf3; font: 12px/1.6 var(--mono); padding: 6px 0; transition: opacity .15s; }
.log-view.busy { opacity: .75; }
.log-view .skel { background: linear-gradient(90deg, #1b2130, #262d3d, #1b2130); background-size: 200% 100%; margin: 4px 0; }
.ll { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 0 12px 0 0; min-height: 19px; }
.ll:hover { background: rgba(255, 255, 255, .04); }
.ll .ln { color: #6e7681; text-align: right; user-select: none; }
.ll .lt { white-space: pre-wrap; word-break: break-word; }
.ll.grp .lt { color: #fff; font-weight: 600; }
.ll.grp .lt::before { content: "▸ "; color: #8b949e; }
.ll.endgrp { min-height: 6px; }
.ll.err { background: rgba(248, 81, 73, .12); }
.ll.err .lt { color: #ff7b72; }
.ll.warn .lt { color: #e3b341; }
.ll.meta .lt { color: #8b949e; }
.ll mark { background: #9e6a03; color: #fff; border-radius: 2px; padding: 0 1px; }
.log-empty { padding: 40px; text-align: center; color: #8b949e; }
.log-err { padding: 14px; font-family: var(--font); color: var(--fg); }
.log-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-height: 17px; }
@media (max-width: 600px) {
  dialog.dlg.logs .dlg-body { padding: 10px; }
  .ll { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .log-toolbar .select { flex: 1 1 120px; min-width: 0; }
}
.run-name { color: inherit; }
.run-name:hover { color: var(--accent); text-decoration: underline; }
/* end workflows */

/* integrations */
.integ-lead { max-width: 760px; margin-top: -8px; }
.integ-body { gap: 20px; }
.integ-body > div:empty { display: none; }
.integ-body .empty .btn svg { width: 16px; height: 16px; opacity: 1; }
.integ-body.is-error .skel { animation: none; }
.integ-head-ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.integ-nowrap { flex-wrap: nowrap; overflow: hidden; }
.integ-nowrap .chip svg { width: 12px; height: 12px; }
.integ-chip-err { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--border)); background: var(--err-soft); }
.integ-acts { gap: 2px; justify-content: flex-end; }
.integ-err-text { color: var(--err); }
.integ-code-bad { color: var(--err); font-weight: 600; }
.integ-secret { height: auto; min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
.integ-secret code { white-space: normal; word-break: break-all; font-weight: 600; color: var(--fg); }
.integ-kv-dl { margin: 0; grid-template-columns: max-content minmax(0, 1fr); }
.integ-kv-dl dd { text-align: left; }
.integ-scope-help { min-height: 17px; }
.integ-exp .select { flex: 1 1 auto; min-width: 0; }
.integ-exp .input { flex: 0 0 170px; }
.integ-exp .input:disabled { opacity: .5; }
.integ-fs { display: flex; flex-direction: column; gap: 10px; }
.integ-fs legend { padding: 0; }
.integ-fs-help { margin-top: -6px; }
.integ-wh-form { gap: 24px; }
.integ-evts-host { min-height: 120px; }
.integ-evts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.integ-evt { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; min-width: 0; min-height: 52px; }
.integ-evt:hover { border-color: var(--border-strong); }
.integ-evt.wild { background: var(--surface-2); }
.integ-evt input { margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.integ-evt.covered { opacity: .6; cursor: default; }
.integ-evt-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.integ-evt-text code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.integ-kv-rows { display: flex; flex-direction: column; gap: 6px; }
.integ-kv-rows:empty { display: none; }
.integ-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 28px; gap: 6px; align-items: center; }
.integ-dl-list .table-wrap { height: 260px; overflow: auto; }
.integ-dl-list .table th { z-index: 1; }
.integ-dl-table tr.integ-click { cursor: pointer; }
.integ-dl-table tr.integ-click:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.integ-dl-table tr[aria-selected="true"] td { background: var(--accent-soft); }
.integ-dl-detail { min-height: 220px; }
.integ-dl-hint { display: grid; place-items: center; min-height: 220px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.integ-dl-skel { height: 140px; border-radius: var(--radius-sm); background: var(--surface-2); }
.integ-dl-kv { margin: 0; grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
.integ-dl-kv dd { text-align: left; }
.integ-dl-detail .code pre { max-height: 260px; }
.integ-configs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.integ-configs .code pre { white-space: pre; min-height: 82px; }
.integ-sync-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.integ-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.integ-stats > div { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; min-height: 58px; min-width: 0; }
.integ-stats > div + div { border-left: 1px solid var(--border); }
.integ-stats .n { font-size: 18px; font-weight: 600; line-height: 1.1; }
.integ-stats .l { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.integ-lasterr:empty { display: none; }
.integ-secret-row .input { font-family: var(--mono); font-size: 12.5px; }
.integ-secret-row .integ-w-reveal { min-width: 108px; }
.integ-secret-note { min-height: 34px; }
.field .help.err { color: var(--err); }
.textarea[aria-invalid="true"], .input[aria-invalid="true"] { border-color: var(--err); }
@media (max-width: 900px) {
  .integ-sync-grid, .integ-configs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .integ-evts { grid-template-columns: minmax(0, 1fr); }
  .integ-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integ-stats > div:nth-child(3) { border-left: 0; }
  .integ-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .integ-dl-kv { grid-template-columns: max-content minmax(0, 1fr); }
  .integ-secret-row { flex-wrap: wrap; }
  .integ-secret-row .input { flex-basis: 100%; }
}
.integ-state { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.integ-state .sub { max-width: 100%; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
/* end integrations */

/* ---------- network & cache ---------- */
[data-theme="light"] { --k0: #4f46e5; --k1: #0d9488; --k2: #9ca3af; --k3: #d97706; --k4: #db2777; --hatch: rgba(255, 255, 255, .75); }
[data-theme="dark"] { --k0: #8b93ff; --k1: #2dd4bf; --k2: #6b7280; --k3: #fbbf24; --k4: #f472b6; --hatch: rgba(12, 13, 16, .7); }
.net-bars .k-0 { fill: var(--k0); }
.net-bars .k-1 { fill: var(--k1); }
.net-bars .k-2 { fill: var(--k2); }
.net-bars .k-3 { fill: var(--k3); }
.net-bars .k-4 { fill: var(--k4); }
.net-bars g.partial path { opacity: .55; }
.net-bars .hatch { pointer-events: none; }
.net-chart .hatch-bg { fill: transparent; }
.net-chart .hatch-line { stroke: var(--hatch); stroke-width: 2; }
.net-bars:has(g.on) g:not(.on) { opacity: .5; }
.net-legend { flex-wrap: wrap; }
.net-legend .lg-sw { width: 10px; height: 10px; border-radius: 2px; background: var(--k0); }
.net-legend .lg-sw.k-1 { background: var(--k1); }
.net-legend .lg-sw.k-2 { background: var(--k2); }
.net-legend .lg-sw.k-3 { background: var(--k3); }
.net-legend .lg-sw.k-4 { background: var(--k4); }
.net-legend .lg-sw.hatch-sw { background: repeating-linear-gradient(45deg, var(--k0) 0 2px, var(--surface) 2px 4px); opacity: .7; }
.stats-card.flush > .card-body { padding: 0; }
.stats-card.flush .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
.net-cache td { height: 52px; }
.net-page .meter.thin .fill { background: var(--meter-fill); opacity: 1; }
.net-page .meter.thin .fill.warn { background: var(--warn); }
.net-page .meter.thin .fill.err { background: var(--err); }
.eff, .disk { display: grid; grid-template-columns: minmax(40px, 1fr) auto; align-items: center; gap: 10px; min-width: 0; }
.disk .small { color: var(--fg-2); white-space: nowrap; }
.eff-val { font-weight: 600; min-width: 48px; text-align: right; }
.eff .nm-dash { min-width: 48px; text-align: right; }
.meter.muted-meter { background: repeating-linear-gradient(135deg, var(--meter-track) 0 4px, transparent 4px 8px); }
.nm-dash { cursor: help; }
.neg, .err-text { color: var(--err); }
.ov-dot { display: inline-flex; color: var(--muted); cursor: help; }
.ov-dot svg, .inline-ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.tile-meter { margin-top: -4px; }
.net-page .stat-tile { height: 108px; }
.net-page .stat-tile .tile-sub .warn-text { display: inline; }
.token-code pre { white-space: pre-wrap; word-break: break-all; }
.net-empty { padding: 16px; }
.net-page .section { margin-top: 24px; }
@media (max-width: 600px) { .net-page .page-head .actions { margin-left: 0; width: 100%; } .net-page .page-head .actions .segmented { overflow-x: auto; max-width: 100%; } }
.bypass-name { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 6px; }
.bypass-arrow { color: var(--muted); flex: none; }
.net-cache tr.is-bypass td { background: var(--surface-2); }
.net-page .narrow-only { display: none; }
.m-cards { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.section .m-cards { padding: 0; }
.m-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.m-card.is-bypass { background: var(--surface-2); margin-left: 14px; }
.m-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.m-fact, .m-disk { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.m-label { font-size: 11.5px; color: var(--muted); }
.m-val { font-variant-numeric: tabular-nums; min-width: 0; }
@media (max-width: 640px) {
  .net-page .wide-only { display: none; }
  .net-page .narrow-only { display: block; }
}
.eff .badge { justify-self: start; }
.m-card .sub { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-page .stat-tile .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-page .table-wrap .table tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); }
.net-page .table-wrap .table thead tr > :first-child { z-index: 2; background: var(--surface-2); }
.net-page .table-wrap .table tbody tr:hover > :first-child { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.net-cache tr.is-bypass > :first-child { background: var(--surface-2); }
@media (max-width: 480px) { .net-page .grid.tiles { grid-template-columns: minmax(0, 1fr); } .net-page .stat-tile { height: 100px; } }
.aging-fact-sub { display: block; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
