/* KTX Console — command center.
 * Same DNA as the original console: near-black glass, orange → green accent,
 * Space Grotesk headings, Inter body, JetBrains Mono for anything a machine wrote.
 */
:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --orange: #ff6b35;
  --orange-soft: rgba(255, 107, 53, 0.12);
  --orange-line: rgba(255, 107, 53, 0.3);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --blue: #60a5fa;
  --violet: #a78bfa;
  --slate: #94a3b8;
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --text-faint: #6b7280;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.06);
  --gradient: linear-gradient(135deg, #ff6b35, #10b981);
  --ease: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --rail-w: 232px;
  --top-h: 56px;
  --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  /* legacy names the log renderer still uses */
  --level-info: var(--blue);
  --level-warn: var(--amber);
  --level-error: var(--red);
  --level-debug: var(--violet);
  --level-trace: var(--slate);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
  background: var(--bg);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); }
[hidden] { display: none !important; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255, 107, 53, 0.35); border-radius: 4px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 107, 53, 0.6); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 107, 53, 0.4) transparent; }

/* ───────────────────────── shell ───────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  grid-template-areas: 'rail top' 'rail main';
  height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(255, 107, 53, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 110%, rgba(16, 185, 129, 0.05), transparent 60%),
    var(--bg);
}
.app.rail-collapsed { --rail-w: 64px; }

.rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px) saturate(160%);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.rail-brand {
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.rail-brand img { width: 26px; height: 26px; object-fit: contain; }
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.rail-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0.5rem; }
.rail-group { margin-bottom: 1rem; }
.rail-group-label {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 0.65rem 0.35rem;
  white-space: nowrap;
}
.rail-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
  font-size: 0.88rem;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.rail-item:hover { background: var(--glass-2); color: #fff; }
.rail-item.active { color: var(--orange); background: var(--orange-soft); border-left-color: var(--orange); }
.rail-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.rail-item .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--glass-2);
  color: var(--text-dim);
}
.rail-item .count.hot { background: var(--red-soft); color: var(--red); }
.rail-item .count.live { background: var(--orange-soft); color: var(--orange); }
.rail-foot { border-top: 1px solid var(--line); padding: 0.6rem 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.rail-user { font-size: 0.75rem; color: var(--text-dim); padding: 0.2rem 0.65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app.rail-collapsed .rail-group-label,
.app.rail-collapsed .rail-item span,
.app.rail-collapsed .rail-item .count,
.app.rail-collapsed .brand-name,
.app.rail-collapsed .rail-user { display: none; }
.app.rail-collapsed .rail-item { justify-content: center; padding: 0.55rem 0; }

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(20px) saturate(160%);
  min-width: 0;
}
.topbar-title { min-width: 0; display: flex; align-items: baseline; gap: 0.6rem; }
.topbar-title h1 { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.topbar-title .sub { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.health-dots { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); cursor: pointer; }
.health-dots .dot { width: 8px; height: 8px; }
.health-dots .lbl { font-size: 0.72rem; color: var(--text-dim); margin-left: 0.2rem; }
.kbd-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text-dim);
  cursor: pointer; font-size: 0.8rem; white-space: nowrap;
}
.kbd-btn:hover { color: #fff; border-color: var(--line-2); }
kbd { font-family: var(--mono); font-size: 0.68rem; padding: 0.05rem 0.3rem; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text-dim); }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-dim); cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--glass-2); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

.main { grid-area: main; min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; padding: 1.25rem 1.5rem 2rem; }
.view.fill { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 1rem; }
.view-inner { max-width: 1480px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; }
.view.fill .view-inner { flex: 1; min-height: 0; width: 100%; }

.mobile-bar { display: none; }

/* ───────────────────────── primitives ───────────────────────── */
.panel {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(20px);
}
.panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient);
  opacity: 0.5;
  pointer-events: none;
}
.panel.quiet::before { display: none; }
.panel-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  min-height: 46px;
  flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 { font-family: var(--display); font-size: 0.95rem; font-weight: 600; }
.panel-head .meta { color: var(--text-dim); font-size: 0.78rem; }
.panel-head .grow { flex: 1; }
.panel-body { padding: 1rem; }
.panel-body.flush { padding: 0; }

.section-title { font-family: var(--display); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 500;
  padding: 0.42rem 0.75rem;
  border: 0; border-left: 2px solid transparent; border-radius: 2px;
  background: transparent; color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  touch-action: manipulation;
}
.btn:hover:not(:disabled) { background: var(--glass-2); border-left-color: var(--orange); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { color: var(--orange); border-left-color: var(--orange); }
.btn-primary:hover:not(:disabled) { background: var(--orange-soft); }
.btn-danger { color: var(--red); border-left-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); border-left-color: var(--red); }
.btn-ghost { color: var(--text-dim); }
.btn-sm { font-size: 0.75rem; padding: 0.3rem 0.55rem; }
.btn-solid {
  border: 0; border-radius: 10px; padding: 0.6rem 1.1rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #ea580c 0%, #ff6b35 45%, #059669 160%);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25);
}
.btn-solid:hover:not(:disabled) { filter: brightness(1.07); background: linear-gradient(135deg, #ea580c 0%, #ff6b35 45%, #059669 160%); }
.btn-solid.danger { background: linear-gradient(135deg, #b91c1c, #ef4444); box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25); }

.input, .select {
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  min-width: 0;
}
.input:focus, .select:focus { border-color: rgba(255, 107, 53, 0.55); box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12); }
.input::placeholder { color: var(--text-faint); }
.select option { background: var(--bg-3); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; display: inline-block; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.dot.warn { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.dot.bad { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }
.dot.live { background: var(--orange); animation: pulse 1.2s infinite; }
.dot.unknown { background: transparent; border: 1.5px dashed var(--text-faint); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--orange-line); border-top-color: var(--orange); animation: spin 0.8s linear infinite; display: inline-block; }

.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 500;
  padding: 0.12rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-dim); background: var(--glass);
  white-space: nowrap;
}
.chip.ok { color: var(--green); border-color: rgba(16, 185, 129, 0.3); background: var(--green-soft); }
.chip.bad { color: var(--red); border-color: rgba(248, 113, 113, 0.3); background: var(--red-soft); }
.chip.warn { color: var(--amber); border-color: rgba(251, 191, 36, 0.3); background: var(--amber-soft); }
.chip.live { color: var(--orange); border-color: var(--orange-line); background: var(--orange-soft); }
.chip.info { color: var(--blue); border-color: rgba(96, 165, 250, 0.3); background: rgba(96, 165, 250, 0.1); }
.chip.mono { font-family: var(--mono); }
button.chip { cursor: pointer; }
button.chip:hover { color: #fff; border-color: var(--line-2); }
button.chip.on { color: var(--orange); border-color: var(--orange-line); background: var(--orange-soft); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.seg button { border: 0; background: transparent; color: var(--text-dim); padding: 0.32rem 0.65rem; font-size: 0.76rem; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--orange-soft); color: var(--orange); }

.empty { padding: 1.5rem 1rem; color: var(--text-dim); font-size: 0.85rem; text-align: center; }
.empty strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 0.2rem; }
.unreadable {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.9rem; border-radius: 10px;
  border: 1px dashed rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.06);
  color: #fcd34d; font-size: 0.8rem;
}
.unreadable b { color: var(--amber); }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ───────────────────────── overview ───────────────────────── */
.services { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.svc {
  position: relative; text-align: left; cursor: pointer;
  padding: 0.85rem 0.9rem 0.8rem;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass);
  display: flex; flex-direction: column; gap: 0.35rem; min-width: 0;
  transition: border-color var(--ease), background var(--ease);
}
.svc:hover { border-color: var(--line-2); background: var(--glass-2); }
.svc.bad { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.05); }
.svc.warn { border-color: rgba(251, 191, 36, 0.4); }
.svc-head { display: flex; align-items: center; gap: 0.5rem; }
.svc-name { font-family: var(--display); font-weight: 600; font-size: 0.92rem; }
.svc-role { font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-facts { display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; font-size: 0.72rem; color: var(--text-dim); }
.svc-facts .num { color: var(--text); }
.svc-err { font-size: 0.72rem; color: var(--red); }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.kpi {
  text-align: left; cursor: pointer;
  padding: 0.8rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--glass);
  display: flex; flex-direction: column; gap: 0.15rem;
  transition: border-color var(--ease);
}
.kpi:hover { border-color: var(--line-2); }
.kpi-value { font-family: var(--display); font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 0.75rem; color: var(--text-dim); }
.kpi.hot .kpi-value { color: var(--red); }
.kpi.live .kpi-value { color: var(--orange); }
.kpi.good .kpi-value { color: var(--green); }
.kpi-value.unknown { color: var(--text-faint); }

.attention { display: flex; flex-direction: column; }
.att-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
  cursor: pointer; text-align: left; background: transparent; border-left: 3px solid transparent; width: 100%;
  border-top: 0; border-right: 0;
}
.att-item:last-child { border-bottom: 0; }
.att-item:hover { background: var(--glass-2); }
.att-item.bad { border-left-color: var(--red); }
.att-item.warn { border-left-color: var(--amber); }
.att-item.info { border-left-color: var(--blue); }
.att-title { font-weight: 500; font-size: 0.86rem; color: var(--text); }
.att-detail { font-size: 0.76rem; color: var(--text-dim); margin-top: 0.1rem; word-break: break-word; }
.att-action { margin-left: auto; flex-shrink: 0; align-self: center; }
.all-clear { display: flex; align-items: center; gap: 0.6rem; padding: 1rem; color: var(--green); font-size: 0.86rem; }

/* ───────────────────────── pipeline ───────────────────────── */
.jobs { display: flex; flex-direction: column; }
.job {
  display: grid;
  grid-template-columns: 22px minmax(170px, 1.3fr) minmax(220px, 2fr) 92px 92px minmax(90px, 0.7fr);
  gap: 0.9rem; align-items: center;
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background var(--ease);
  background: transparent; border-top: 0; border-left: 0; border-right: 0; width: 100%; text-align: left;
}
.job:hover { background: var(--glass-2); }
.job.selected { background: var(--orange-soft); }
.job:last-child { border-bottom: 0; }
.job-head { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); cursor: default; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.job-head:hover { background: transparent; }
.job-app { font-weight: 500; font-size: 0.86rem; }
.job-sub { font-size: 0.72rem; color: var(--text-faint); display: flex; gap: 0.4rem; align-items: center; min-width: 0; }
.job-live { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.25rem; }
.job-fail { font-size: 0.72rem; color: var(--red); margin-top: 0.25rem; }
.job-cell-r { text-align: right; font-size: 0.78rem; }
.status-icon { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; }
.status-icon svg { width: 16px; height: 16px; }
.st-running { color: var(--orange); }
.st-completed { color: var(--green); }
.st-failed { color: var(--red); }
.st-degraded { color: var(--amber); }
.st-queued, .st-cancelled { color: var(--text-faint); }

.stagebar { display: flex; gap: 3px; align-items: center; }
.stagebar .s {
  flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); position: relative; min-width: 8px;
}
.stagebar .s.done { background: rgba(16, 185, 129, 0.55); }
.stagebar .s.now { background: var(--orange); box-shadow: 0 0 10px rgba(255, 107, 53, 0.55); animation: pulse 1.4s infinite; }
.stagebar .s.fail { background: var(--red); }
.stagebar .s.warn { background: var(--amber); }
.stage-label { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.3rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.stage-label .now { color: var(--orange); }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 80; opacity: 0; pointer-events: none; transition: opacity var(--ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(640px, 100vw);
  background: linear-gradient(180deg, #141414, #0d0d0d);
  border-left: 1px solid var(--line-2);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.drawer.open { transform: none; }
.drawer::before { content: ''; height: 2px; background: var(--gradient); opacity: 0.8; flex-shrink: 0; }
.drawer-head { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem 1.1rem 0.8rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--display); font-size: 1.1rem; font-weight: 600; word-break: break-word; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.1rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.callout { border-radius: 10px; padding: 0.8rem 0.9rem; border: 1px solid rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.07); }
.callout.warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.callout-title { font-weight: 600; color: var(--red); font-size: 0.88rem; }
.callout.warn .callout-title { color: var(--amber); }
.callout pre { margin-top: 0.4rem; font-family: var(--mono); font-size: 0.74rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; font-size: 0.8rem; }
.kv dt { color: var(--text-faint); }
.kv dd { color: var(--text); min-width: 0; word-break: break-all; display: flex; align-items: center; gap: 0.35rem; }
.copyable { cursor: pointer; font-family: var(--mono); font-size: 0.76rem; }
.copyable:hover { color: var(--orange); }

.timeline { display: flex; flex-direction: column; gap: 0.3rem; }
.tl-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 0.6rem; align-items: center; font-size: 0.76rem; }
.tl-name { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 12px; background: rgba(255, 255, 255, 0.04); border-radius: 3px; }
.tl-bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: rgba(16, 185, 129, 0.55); min-width: 3px; }
.tl-bar.now { background: var(--orange); animation: pulse 1.4s infinite; }
.tl-bar.fail { background: var(--red); }
.tl-dur { text-align: right; font-family: var(--mono); color: var(--text-dim); }
.log-tail { margin: 0.25rem 0 0.3rem 136px; font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; border-left: 2px solid var(--line-2); padding-left: 0.5rem; }
.events { font-family: var(--mono); font-size: 0.72rem; display: flex; flex-direction: column; gap: 0.15rem; max-height: 320px; overflow-y: auto; }
.events div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 0.5rem; color: var(--text); }
.events time { color: var(--text-faint); }
.gates { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ───────────────────────── failures ───────────────────────── */
.histo { display: flex; align-items: flex-end; gap: 3px; height: 84px; padding: 0.4rem 0; }
.histo .b { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; height: 100%; cursor: default; position: relative; }
.histo .b span { display: block; width: 100%; border-radius: 2px; min-height: 0; }
.histo .b .f { background: var(--red); }
.histo .b .d { background: var(--amber); opacity: 0.8; }
.histo .b .z { background: rgba(255, 255, 255, 0.06); height: 2px; }
.histo-axis { display: flex; justify-content: space-between; font-size: 0.66rem; color: var(--text-faint); }
.fgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0.9rem; }
.fgroup { display: flex; flex-direction: column; }
.fgroup-head { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 1rem 0.6rem; }
.fgroup-count { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1; color: var(--red); min-width: 2.2rem; }
.fgroup.degraded .fgroup-count { color: var(--amber); }
.fgroup-title { font-weight: 600; font-size: 0.9rem; word-break: break-word; }
.fgroup-meta { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.15rem; }
.fgroup-detail { margin: 0 1rem 0.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.6rem; white-space: pre-wrap; word-break: break-word; max-height: 7.5em; overflow: hidden; }
.fgroup-ex { border-top: 1px solid var(--line); }
.fgroup-ex button { width: 100%; display: flex; gap: 0.5rem; align-items: center; padding: 0.45rem 1rem; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 0.76rem; color: var(--text-dim); text-align: left; }
.fgroup-ex button:last-child { border-bottom: 0; }
.fgroup-ex button:hover { background: var(--glass-2); color: #fff; }

/* ───────────────────────── ship ───────────────────────── */
.ship { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.1rem; flex: 1; min-height: 0; }
.ship-catalog { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 1rem; padding-right: 0.25rem; }
.tgroup-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 0.4rem 0.2rem; }
.targets { display: flex; flex-direction: column; gap: 0.4rem; }
.target {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.6rem; align-items: center;
  padding: 0.6rem 0.75rem; border-radius: 10px; border: 1px solid var(--line); background: var(--glass);
  transition: border-color var(--ease), background var(--ease);
}
.target:hover { border-color: var(--line-2); }
.target.running { border-color: var(--orange-line); background: var(--orange-soft); }
.target-name { font-weight: 500; font-size: 0.86rem; }
.target-desc { font-size: 0.72rem; color: var(--text-faint); grid-column: 1; }
.target-last { font-size: 0.72rem; color: var(--text-dim); display: flex; gap: 0.35rem; align-items: center; grid-column: 1 / -1; flex-wrap: wrap; }
.target-last button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.target-run { grid-row: 1 / span 2; grid-column: 2; }
.target .toggle { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; color: var(--text-dim); grid-column: 1 / -1; cursor: pointer; }
.target .toggle input { accent-color: var(--orange); }
.branches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.branches label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.7rem; color: var(--text-dim); min-width: 0; }
.branches .select { width: 100%; }
.branch-status { font-size: 0.72rem; color: var(--text-dim); min-height: 1rem; }
.branch-status.ok { color: var(--green); }
.branch-status.err { color: var(--red); }
.branch-summary { font-size: 0.76rem; color: var(--text-dim); }
.branch-summary b { color: var(--text); font-weight: 500; }
.branch-summary .off-main { color: var(--amber); }

.term { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.term-tabs { display: flex; align-items: flex-end; gap: 0.15rem; padding: 0.4rem 0.5rem 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); flex-shrink: 0; }
.term-tab {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.6rem; font-size: 0.76rem;
  border: 0; border-radius: 6px 6px 0 0; background: transparent; color: var(--text-dim); cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.term-tab:hover { color: #fff; background: var(--glass-2); }
.term-tab.active { color: var(--orange); background: var(--orange-soft); }
.term-tab .x { opacity: 0.6; padding: 0 0.15rem; border-radius: 3px; }
.term-tab .x:hover { color: var(--red); opacity: 1; }
.term-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.term-out {
  flex: 1; min-height: 0; overflow-y: auto; padding: 0.8rem 1rem;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
}
.term-status { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.9rem; font-size: 0.76rem; color: var(--text-dim); border-top: 1px solid var(--line); flex-shrink: 0; }
.term-status .ok { color: var(--green); }
.term-status .bad { color: var(--red); }
.term-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.to-bottom {
  position: absolute; right: 1rem; bottom: 0.8rem; padding: 0.35rem 0.7rem; font-size: 0.74rem;
  border-radius: 8px; background: rgba(255, 107, 53, 0.92); color: #fff; border: 0; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity var(--ease);
}
.to-bottom.show { opacity: 1; pointer-events: auto; }
.run-history { max-height: 240px; overflow-y: auto; }
.run-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; width: 100%; padding: 0.4rem 0.75rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 0.76rem; color: var(--text-dim); text-align: left; }
.run-row:hover { background: var(--glass-2); color: #fff; }
.run-row b { color: var(--text); font-weight: 500; }
.panel.max { position: fixed; inset: 0; z-index: 95; border-radius: 0; display: flex; flex-direction: column; background: var(--bg); }

/* output lines (shared by runs and log streams) */
.output-line { margin-bottom: 0.1em; }
.output-line.stderr { color: var(--red); }
.output-line.stdout { color: var(--text); }
.output-line.exit { color: var(--green); margin-top: 0.4rem; }
.output-line.exit.bad { color: var(--red); }
.output-line.cmd { color: var(--orange); }
.output-line.level-info { color: var(--blue); }
.output-line.level-warn { color: var(--amber); }
.output-line.level-error { color: var(--red); }
.output-line.level-debug { color: var(--violet); }
.output-line.level-trace { color: var(--slate); }
.output-line.hidden { display: none; }
.highlight { background: rgba(255, 107, 53, 0.4); border-radius: 2px; }

/* ───────────────────────── logs ───────────────────────── */
.streams { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0.9rem; flex: 1; min-height: 0; }
.stream { display: flex; flex-direction: column; min-height: 320px; }
.stream .term-out { min-height: 200px; }
.stream.max { position: fixed; inset: 0; z-index: 95; border-radius: 0; background: var(--bg); }
.ktx-story-root { display: flex; flex-direction: column; gap: 0.35rem; }
.ktx-log-group { border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, 0.02); }
.ktx-log-group > summary { cursor: pointer; padding: 0.4rem 0.6rem; font-size: 0.75rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; position: sticky; top: 0; background: rgba(17, 17, 17, 0.96); z-index: 1; flex-wrap: wrap; }
.ktx-log-group > summary::-webkit-details-marker { display: none; }
.ktx-log-group-body { padding: 0.25rem 0.5rem 0.5rem 0.9rem; border-top: 1px solid var(--line); }
.ktx-story-line { padding: 0.25rem 0.15rem; font-size: 0.76rem; line-height: 1.4; word-break: break-word; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.ktx-story-line-clean { display: grid; grid-template-columns: 4.2rem 3.2rem minmax(0, 1fr); gap: 0.45rem; align-items: start; }
.ktx-story-time { color: var(--text-dim); font-size: 0.7rem; padding-top: 0.1rem; }
.ktx-story-outcome { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding-top: 0.15rem; }
.ktx-story-msg { color: var(--text); white-space: pre-wrap; }
.ktx-story-line.outcome-ok .ktx-story-outcome, .ktx-story-line.outcome-ok .ktx-story-msg { color: var(--green); }
.ktx-story-line.outcome-fail .ktx-story-outcome, .ktx-story-line.outcome-fail .ktx-story-msg { color: var(--red); }
.ktx-story-line.outcome-warn .ktx-story-outcome, .ktx-story-line.outcome-warn .ktx-story-msg { color: var(--amber); }
.ktx-story-line.outcome-start .ktx-story-outcome, .ktx-story-line.outcome-end .ktx-story-outcome { color: var(--blue); }
.ktx-story-dup { color: var(--text-dim); font-size: 0.68rem; margin-left: 0.35rem; }
.ktx-story-raw summary { cursor: pointer; color: var(--text-faint); font-size: 0.64rem; }
.ktx-story-raw pre { font-size: 0.65rem; margin: 0.2rem 0 0; color: var(--text-dim); white-space: pre-wrap; }
.ktx-story-badge { font-size: 0.64rem; padding: 0.05rem 0.35rem; border-radius: 4px; background: var(--glass-2); color: var(--text-dim); }
.ktx-story-badge-project { color: #93c5fd; border: 1px solid rgba(147, 197, 253, 0.25); }
.ktx-trace-chip { color: var(--text-dim); font-size: 0.72rem; cursor: pointer; padding: 0.15rem 0; }
.ktx-trace-chip:hover { color: var(--orange); }

/* ───────────────────────── tables ───────────────────────── */
.table-wrap { overflow: auto; flex: 1; min-height: 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.tbl th, .tbl td { padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl th { position: sticky; top: 0; background: #151515; color: var(--text-dim); font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; z-index: 1; }
.tbl td { font-family: var(--mono); font-size: 0.72rem; color: var(--text); }
.tbl tr:hover td { background: var(--glass); }
.tbl .wrap { word-break: break-all; max-width: 22rem; }
.tbl td.st-bad { color: var(--red); }
.tbl td.st-ok { color: var(--green); }

/* guide */
.guide { font-size: 0.9rem; line-height: 1.65; max-width: 920px; }
.guide h1 { font-family: var(--display); font-size: 1.4rem; margin-bottom: 0.8rem; color: var(--orange); }
.guide h2 { font-family: var(--display); font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.guide h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
.guide p { margin: 0.5rem 0; color: var(--text); }
.guide ul { margin: 0.5rem 0; padding-left: 1.4rem; }
.guide code { font-size: 0.82em; background: var(--orange-soft); padding: 0.1rem 0.35rem; border-radius: 4px; color: #fdba8c; }
.guide pre { background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem; font-family: var(--mono); font-size: 0.78rem; overflow-x: auto; margin: 0.5rem 0; }
.guide pre code { background: none; padding: 0; color: var(--text); }
.guide .block { background: var(--glass); border-left: 3px solid var(--orange); padding: 0.9rem 1rem; margin: 0.75rem 0; border-radius: 0 8px 8px 0; }
.guide .block-title { font-weight: 600; color: var(--orange); margin-bottom: 0.4rem; }
.guide table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; font-size: 0.82rem; display: block; overflow-x: auto; }
.guide th, .guide td { border: 1px solid var(--line); padding: 0.45rem 0.7rem; text-align: left; }
.guide th { background: var(--orange-soft); color: var(--orange); }
.guide .copy-hint { font-size: 0.75rem; color: var(--text-dim); }
.guide .guide-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

/* ───────────────────────── overlays ───────────────────────── */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(4px); }
.modal { width: min(460px, 100%); border-radius: 14px; border: 1px solid var(--line-2); background: linear-gradient(165deg, #171717, #0e0e0e); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); overflow: hidden; }
.modal::before { content: ''; display: block; height: 3px; background: var(--gradient); }
.modal-body { padding: 1.2rem 1.25rem 0.5rem; }
.modal-body h3 { font-family: var(--display); font-size: 1.1rem; margin-bottom: 0.4rem; }
.modal-body p { color: var(--text-dim); font-size: 0.85rem; }
.modal-body .facts { margin-top: 0.7rem; font-size: 0.78rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.9rem 1.25rem 1.1rem; }

.palette-back { position: fixed; inset: 0; z-index: 210; background: rgba(0, 0, 0, 0.55); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; backdrop-filter: blur(3px); }
.palette { width: min(620px, 100%); border-radius: 14px; border: 1px solid var(--line-2); background: #121212; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.palette input { width: 100%; padding: 1rem 1.1rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 1rem; outline: none; color: #fff; }
.palette-list { overflow-y: auto; padding: 0.35rem; }
.pal-group { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); padding: 0.5rem 0.7rem 0.25rem; }
.pal-item { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.5rem 0.7rem; border-radius: 8px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 0.86rem; }
.pal-item .hint { margin-left: auto; color: var(--text-faint); font-size: 0.72rem; }
.pal-item.on { background: var(--orange-soft); color: var(--orange); }
.pal-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim); }

.toasts { position: fixed; z-index: 300; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast { pointer-events: auto; padding: 0.6rem 0.9rem; border-radius: 10px; border: 1px solid var(--line-2); background: #181818; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 0.82rem; max-width: 360px; animation: toast-in 0.2s ease; }
.toast.bad { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }
.toast.ok { border-color: rgba(16, 185, 129, 0.45); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.sheet-back { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, 0.55); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 160; background: #131313; border-top: 1px solid var(--line-2); border-radius: 16px 16px 0 0; padding: 0.6rem 0.75rem calc(0.9rem + env(safe-area-inset-bottom)); }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 0.6rem; }
.sheet .rail-item { padding: 0.75rem 0.8rem; font-size: 0.95rem; border-radius: 8px; }

/* ───────────────────────── auth ───────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 1.5rem;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 107, 53, 0.12), transparent 50%),
    radial-gradient(ellipse 100% 60% at 100% 100%, rgba(16, 185, 129, 0.08), transparent 45%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.12); background: linear-gradient(165deg, rgba(22, 22, 22, 0.98), rgba(14, 14, 14, 0.99)); box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.06), 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 80px rgba(255, 107, 53, 0.04); overflow: hidden; }
.auth-card-top { height: 3px; background: var(--gradient); opacity: 0.85; }
.auth-card-inner { padding: 1.75rem 1.75rem 1.5rem; }
.auth-card-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.auth-card-brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
.auth-card-title { font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.auth-card-sub { font-size: 0.8125rem; color: var(--text-dim); margin: 0.35rem 0 1.25rem; }
.auth-err { font-size: 0.8125rem; color: var(--red); margin: 0 0 1rem; min-height: 1.25rem; }
.auth-hint { font-size: 0.8125rem; color: var(--text-dim); line-height: 1.55; margin: 0 0 1.35rem; padding: 0.85rem 1rem; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.06); }
.auth-status { font-size: 0.8125rem; color: var(--text-dim); margin: 0.75rem 0 0; }
.auth-status:empty { display: none; }
.auth-field { margin-bottom: 1.1rem; }
.auth-label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; }
.auth-input { width: 100%; padding: 0.65rem 0.85rem; font-size: 0.9rem; color: var(--text); background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; outline: none; }
.auth-input:focus { border-color: rgba(255, 107, 53, 0.55); box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12); }
.auth-actions { display: flex; flex-direction: column; gap: 0.65rem; }
.auth-actions .btn-solid { width: 100%; justify-content: center; }

/* ───────────────────────── responsive ───────────────────────── */
@media (max-width: 1280px) {
  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .job { grid-template-columns: 22px minmax(150px, 1.2fr) minmax(180px, 1.6fr) 84px 84px; }
  .job .job-owner { display: none; }
}
@media (max-width: 1100px) {
  .app { --rail-w: 64px; }
  .app .rail-group-label, .app .rail-item span, .app .rail-item .count, .app .brand-name, .app .rail-user { display: none; }
  .app .rail-item { justify-content: center; padding: 0.55rem 0; }
  .ship { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(420px, 1fr); }
  .view.fill.ship-view { overflow-y: auto; }
  .ship-catalog { overflow: visible; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .branches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #railCollapse { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(var(--top-h) + env(safe-area-inset-top)) minmax(0, 1fr) calc(60px + env(safe-area-inset-bottom));
    grid-template-areas: 'top' 'main' 'bar';
  }
  .rail { display: none; }
  .topbar { padding-left: max(0.9rem, env(safe-area-inset-left)); padding-right: max(0.9rem, env(safe-area-inset-right)); gap: 0.5rem; }
  .topbar-title .sub, .kbd-btn .kbd-label, .kbd-btn kbd, .health-dots .lbl { display: none; }
  .topbar .mobile-brand { display: block !important; width: 24px; height: 24px; }
  .view { padding: 0.9rem max(0.9rem, env(safe-area-inset-left)) 1.5rem max(0.9rem, env(safe-area-inset-right)); }
  .view.fill { overflow-y: auto; display: block; }
  .view.fill .view-inner { display: flex; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .services .svc:last-child { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .kpis .kpi:first-child { grid-column: 1 / -1; }
  .kpi-value { font-size: 1.45rem; }
  .job { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 0.3rem 0.6rem; padding: 0.75rem 0.85rem; }
  .job .job-stage { grid-column: 2 / -1; grid-row: 2; }
  .job .job-dur { grid-column: 3; grid-row: 1; align-self: start; }
  .job .job-when, .job .job-owner { display: none; }
  .job-head { display: none; }
  .fgroups { grid-template-columns: minmax(0, 1fr); }
  .streams { grid-template-columns: minmax(0, 1fr); }
  .stream { min-height: 60vh; }
  .ship { display: flex; flex-direction: column; }
  .ship .term { min-height: 70vh; }
  .branches { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tl-row { grid-template-columns: 96px minmax(0, 1fr) 56px; }
  .log-tail { margin-left: 0; }
  .drawer { width: 100vw; }
  .mobile-bar {
    grid-area: bar;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: rgba(10, 10, 10, 0.92); backdrop-filter: blur(20px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
    border: 0; background: transparent; color: var(--text-dim); font-size: 0.66rem; cursor: pointer; position: relative;
  }
  .mobile-bar button svg { width: 21px; height: 21px; }
  .mobile-bar button.active { color: var(--orange); }
  .mobile-bar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 0.6rem; display: flex; align-items: center; justify-content: center; font-family: var(--mono); }
  .mobile-bar .badge.live { background: var(--orange); }
  .input, .select { font-size: 16px; }
  .toasts { left: 1rem; right: 1rem; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .palette-back { padding-top: 8vh; }
  .tbl-cards thead { display: none; }
  .tbl-cards tr { display: block; border-bottom: 1px solid var(--line); padding: 0.5rem 0.2rem; }
  .tbl-cards td { display: flex; gap: 0.6rem; border: 0; padding: 0.12rem 0.6rem; }
  .tbl-cards td::before { content: attr(data-l); color: var(--text-faint); min-width: 5.5rem; font-family: 'Inter', sans-serif; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* fixes after the first render pass */
.svc-facts svg { width: 12px; height: 12px; vertical-align: -2px; }
.svc-facts > span { display: inline-flex; align-items: center; gap: 0.25rem; }
.jobs.compact .job { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.2fr) 74px; }
.jobs.compact .job-when, .jobs.compact .job-owner { display: none; }
@media (max-width: 760px) {
  .jobs.compact .job { grid-template-columns: 20px minmax(0, 1fr) auto; }
}
.ship-catalog > * { flex-shrink: 0; }
.fgroup-ex svg { width: 14px; height: 14px; flex-shrink: 0; }
@media (max-width: 760px) {
  .ov-now { order: 1; }
  .ov-kpis { order: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-kpis .kpi:first-child { grid-column: auto; }
  .ov-kpis .kpi { padding: 0.6rem 0.7rem; }
  .ov-kpis .kpi-value { font-size: 1.25rem; }
  .ov-kpis .kpi-label { font-size: 0.68rem; }
  .view-inner > .grid-2:not(.ov-now) { order: 3; }
}
.term-out .empty { font-family: "Inter", sans-serif; }
/* Deploy below 1100px: one scrolling column — catalog, then terminal, then history. */
@media (max-width: 1100px) {
  .view.fill.ship-view { display: block; overflow-y: auto; }
  .ship-view .view-inner { display: flex; }
  .ship { display: flex; flex-direction: column; }
  .ship-catalog { overflow: visible; padding-right: 0; }
  .ship .term { min-height: 60vh; flex: none; }
  .ship [data-r="termSlot"] { flex: none; }
}

/* ───────────────────────── canister dashboards ───────────────────────── */
.toolbar .grow, .row .grow { flex: 1; }
.btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.sm { width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.sm svg { width: 13px; height: 13px; }
.input.sm { padding: 0.35rem 0.6rem; font-size: 0.78rem; }
svg.flip { transform: scaleX(-1); }
.kpi-sub { font-size: 0.7rem; color: var(--text-faint); line-height: 1.35; }
.subhead { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 0.7rem 0 0.35rem; }
.subhead:first-child { margin-top: 0; }
.meter-row { display: flex; justify-content: space-between; font-size: 0.78rem; margin: 0.5rem 0 0.25rem; color: var(--text-dim); }
.meter { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gradient); }
.meter span.warn { background: var(--amber); }
.meter span.hot { background: var(--red); }
.spark { width: 100%; height: 42px; display: block; margin-bottom: 0.6rem; }
details.raw { margin-top: 0.6rem; font-size: 0.74rem; }
details.raw summary { cursor: pointer; color: var(--text-dim); }
details.raw pre { margin-top: 0.4rem; max-height: 22rem; overflow: auto; font-family: var(--mono); font-size: 0.7rem; white-space: pre-wrap; word-break: break-all; color: var(--text); background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 0.6rem; }
pre.loglines { max-height: 26rem; overflow: auto; font-family: var(--mono); font-size: 0.7rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: rgba(0, 0, 0, 0.35); border-radius: 8px; padding: 0.7rem; color: var(--text); }
.ws-head { gap: 0.6rem; }
.ws-title { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.ws-tabs { flex-wrap: wrap; max-width: 100%; }
.ws-tabs button { display: inline-flex; align-items: center; gap: 0.35rem; }
.ws-tabs svg { width: 14px; height: 14px; }
.panel .table-wrap { max-height: 28rem; }
/* A panel that fills the view lets its table fill it too (AI requests). */
.panel.fill-panel .table-wrap { max-height: none; }
@media (max-width: 760px) {
  .ws-tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; }
}
.findings { border-radius: 10px; border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.05); padding: 0.4rem 0.9rem; }
.findings.bad { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.06); }
.finding { display: grid; grid-template-columns: 10px 9.5rem minmax(0, 1fr); gap: 0.6rem; align-items: baseline; padding: 0.35rem 0; font-size: 0.82rem; }
.finding + .finding { border-top: 1px solid var(--line); }
.finding b { font-weight: 600; text-transform: capitalize; }
.finding .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); align-self: center; }
.finding .dot.bad { background: var(--red); }
@media (max-width: 760px) { .finding { grid-template-columns: 10px minmax(0, 1fr); } .finding > span:last-child { grid-column: 2; } }
.owner-link { color: var(--orange); text-decoration: none; } .owner-link:hover { text-decoration: underline; }
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(255,255,255,0.05); }
.stackbar span { display: block; height: 100%; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.5rem; font-size: 0.74rem; color: var(--text-dim); }
.stack-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }

/* Access (Users) view */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.9rem; margin-bottom: 0.9rem; }
.door { border: 1px solid var(--line); border-radius: 10px; background: var(--glass-1, rgba(255,255,255,0.02)); padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.door-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.door-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.door.on .door-dot { background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.door-detail { font-size: 0.78rem; color: var(--text-dim); line-height: 1.45; }
.door-detail code { font-family: var(--mono); font-size: 0.74rem; }
.addform { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 0.5rem; align-items: center; }
@media (max-width: 760px) { .addform { grid-template-columns: 1fr; } }
/* Sortable column headers (User management list). */
.th-sort { all: unset; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.th-sort:hover { color: var(--text); }
/* Agent pipeline stages. */
.stage-cell { font-size: .72rem; display: inline-block; max-width: 13rem; }
.warn-text { color: var(--amber, #f59e0b); }
.tbl tr.detail td { background: rgba(255, 255, 255, .02); }
.tbl td.checks-cell { min-width: 16rem; max-width: 30rem; white-space: normal; word-break: normal; overflow-wrap: anywhere; font-family: var(--sans, inherit); }

/* Assess + Ask AI */
.modal.ai-modal { width: min(760px, 100%); max-height: 86vh; overflow: auto; }
.ai-headline { font-size: 0.92rem; color: var(--text); padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--glass); }
.ai-item, .as-item { padding: 0.65rem 0.8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ai-item.tier-critical, .as-item.tier-critical { border-left: 3px solid var(--red); }
.ai-item.tier-warning, .as-item.tier-warning { border-left: 3px solid var(--amber); }
.ai-item.tier-ok { border-left: 3px solid var(--green); }
.ai-evidence, .as-evidence { font-size: 0.72rem; color: var(--text-dim); overflow-wrap: anywhere; }
.ai-action { font-size: 0.8rem; color: var(--text); }
.as-tier h3 { display: flex; align-items: center; gap: 0.5rem; }
.as-title { font-size: 0.84rem; color: var(--text); overflow-wrap: anywhere; }
.as-links { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.as-group { padding: 0.75rem 0.9rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); display: flex; flex-direction: column; gap: 0.45rem; }
.as-group.tier-critical { border-left: 3px solid var(--red); }
.as-group.tier-warning { border-left: 3px solid var(--amber); }
.as-group .as-cites { display: flex; flex-direction: column; gap: 0.3rem; }
.as-green { display: flex; align-items: center; gap: 0.5rem; color: var(--green); font-size: 0.8rem; }
.as-facts summary { cursor: pointer; font-size: 0.72rem; }
.as-facts pre { font-size: 0.68rem; max-height: 22rem; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0.3rem 0 0; color: var(--text-dim); }
.assess-btn { position: relative; }
.assess-count { margin-left: 0.35rem; min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem; border-radius: 999px; background: var(--red); color: #111; font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.as-since { font-size: 0.7rem; }
.as-hist { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.76rem; }
.as-hist-row { display: grid; grid-template-columns: 6.5rem 9rem 1fr; gap: 0.6rem; align-items: baseline; min-width: 0; }
.as-hist-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .as-hist-row { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ── Ask about this page ───────────────────────────────────────────────── */
.ph-fab { position: fixed; right: 18px; bottom: 18px; z-index: 900; display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-3); color: inherit; font: inherit; font-size: .8rem; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.ph-fab:hover { border-color: var(--orange-line); color: var(--orange); }
.ph-fab svg { width: 15px; height: 15px; }
.ph-panel { position: fixed; right: 18px; bottom: 70px; z-index: 901; width: min(460px, calc(100vw - 32px)); height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 14px 48px rgba(0,0,0,.5); overflow: hidden; }
.ph-head { display: flex; align-items: center; gap: .45rem; padding: .6rem .7rem; border-bottom: 1px solid var(--line); font-size: .8rem; }
.ph-head b { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.ph-head .select { max-width: 170px; font-size: .72rem; }
.ph-thread { flex: 1; overflow-y: auto; padding: .7rem; display: flex; flex-direction: column; gap: .6rem; font-size: .82rem; line-height: 1.45; }
.ph-q { align-self: flex-end; max-width: 85%; padding: .45rem .65rem; border-radius: 10px; background: var(--bg-3); white-space: pre-wrap; }
.ph-a p { margin: 0 0 .45rem; }
.ph-a ul { margin: .1rem 0 .45rem 1.1rem; padding: 0; }
.ph-a code { font-family: var(--mono); font-size: .75rem; }
.ph-meta { font-size: .68rem; margin-top: .2rem; color: var(--text-dim); }
.ph-empty { font-size: .78rem; color: var(--text-dim); }
.ph-ask { display: flex; gap: .45rem; padding: .6rem .7rem; border-top: 1px solid var(--line); align-items: flex-end; }
.ph-ask textarea { flex: 1; resize: none; font: inherit; font-size: .82rem; }
@media (max-width: 640px) { .ph-panel { right: 8px; left: 8px; width: auto; bottom: 64px; } .ph-fab { right: 12px; bottom: 12px; } }

/* Loading — a view or panel that is waiting says so with presence, not a 14px dot.
   The small .spinner stays for buttons, chips and inline meta. */
.loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; min-height: 220px; padding: 2.5rem 1rem; text-align: center; animation: loader-in 0.35s var(--ease, ease) 0.12s both; }
.panel .loader, .stack .stack .loader { min-height: 150px; padding: 1.75rem 1rem; }
.loader-orb { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.loader-orb::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg, var(--orange-soft, rgba(255,140,40,.15)) 90deg, var(--orange) 300deg, #ffd29a 350deg, transparent 360deg); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); animation: spin 1.15s cubic-bezier(.55,.15,.45,.85) infinite; filter: drop-shadow(0 0 6px var(--orange)); }
.loader-orb::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; border: 1px dashed var(--orange-line); animation: spin 6s linear infinite reverse; }
.loader-orb > i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe0b8, var(--orange) 60%); box-shadow: 0 0 18px 4px var(--orange-line), 0 0 42px 10px var(--orange-soft, rgba(255,140,40,.12)); animation: loader-core 1.6s ease-in-out infinite; }
.loader-text { max-width: 34rem; font-size: 0.9rem; letter-spacing: 0.01em; color: var(--text-dim); background: linear-gradient(90deg, var(--text-dim) 0%, var(--text-dim) 40%, var(--text) 50%, var(--text-dim) 60%, var(--text-dim) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: loader-shimmer 2.4s linear infinite; }
@keyframes loader-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes loader-core { 0%, 100% { transform: scale(0.82); opacity: 0.8; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes loader-shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }
@media (prefers-reduced-motion: reduce) {
  .loader-orb::before { animation: spin 2.4s linear infinite !important; animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
  .loader-text { -webkit-text-fill-color: currentColor; background: none; }
}

/* ── Infrastructure ─────────────────────────────────────────────────────── */
.infra-view { gap: 1rem; }
.view.fill .infra-view { flex: 1; min-height: 0; }
.itabs { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; padding: 0.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.3); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); }
.itabs [data-tab] { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.95rem; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-dim); font-weight: 500; font-size: 0.86rem; cursor: pointer; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.itabs [data-tab]:hover { color: var(--text); background: var(--glass-2); }
.itabs [data-tab].on { color: #fff; background: var(--orange); border-color: var(--orange); box-shadow: 0 4px 18px rgba(255, 107, 53, 0.28); }
.itabs .grow { flex: 1; }
.itabs-meta { font-size: 0.74rem; margin-right: 0.3rem; }
.ibody { display: flex; flex-direction: column; gap: 1.1rem; }
.ibody-fill { flex: 1; min-height: 0; }
.ibody-fill > .view-inner { flex: 1; min-height: 0; width: 100%; max-width: none; display: flex; flex-direction: column; }
.ibody > .view-inner { max-width: none; width: 100%; margin: 0; }

.ibigs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.ibig { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--glass-2), var(--glass)); }
.ibig-v { font-family: var(--display); font-size: 2.1rem; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ibig-v small { font-size: 1rem; color: var(--text-faint); font-weight: 500; margin-left: 0.1rem; }
.ibig-l { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem; }
.ibig-s { font-size: 0.72rem; color: var(--text-faint); margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibig.good .ibig-v { color: var(--green); }
.ibig.hot .ibig-v { color: var(--red); }

.itiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.85rem; }
.itile { display: flex; flex-direction: column; gap: 0.55rem; padding: 1rem 1.05rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); position: relative; overflow: hidden; }
.itile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--green); opacity: 0.7; }
.itile.st-warn::before { background: var(--amber); }
.itile.st-bad::before { background: var(--red); }
.itile.st-bad { border-color: rgba(248, 113, 113, 0.35); }
.itile-head { display: flex; align-items: center; gap: 0.5rem; }
.itile-head b { font-family: var(--display); font-size: 1.02rem; flex: 1; }
.itile-role { font-size: 0.74rem; color: var(--text-faint); margin-top: -0.3rem; }
.itile-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.9rem; margin: 0.15rem 0 0; font-size: 0.8rem; }
.itile-facts dt { color: var(--text-faint); }
.itile-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.itile-actions { display: flex; gap: 0.4rem; margin-top: auto; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.link-btn { display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.link-btn:hover { color: var(--orange); }
.warn-text { color: var(--amber); }

.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0.85rem; }
.scard { display: flex; flex-direction: column; gap: 0.8rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.scard.short { border-color: rgba(251, 191, 36, 0.35); }
.scard-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.scard-head b { font-family: var(--display); font-size: 1rem; }
.scard-head .grow { flex: 1; }
.snums { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.snum { flex: 1; min-width: 4.6rem; padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.snum b { display: block; font-family: var(--display); font-size: 1.55rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.snum span { font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.snum.good b { color: var(--green); }
.snum.warn b { color: var(--amber); }
.snum.hot b { color: var(--orange); }
.pods { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pods i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line-2); background: transparent; }
.pods i.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.45); }
.pods i.want { border-color: var(--amber); border-style: dashed; }
.pods i.min { border-color: var(--text-faint); }
.scard-ctl { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.srow { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.82rem; }
.srow label { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-dim); }

.mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 0.85rem; }
.mcard { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.mcard.self { border-color: var(--orange-line); background: linear-gradient(180deg, rgba(255, 107, 53, 0.06), var(--glass)); }
.mcard-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.mcard-head b { font-family: var(--display); font-size: 1rem; }
.mcard-head .grow, .mcard-foot .grow { flex: 1; }
.mcard-spec { font-size: 0.76rem; color: var(--text-dim); }
.mcard-foot { display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.74rem; padding-top: 0.55rem; border-top: 1px solid var(--line); margin-top: auto; }
.mcard-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.igs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.ig-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.74rem; color: var(--text-dim); }
.ig-top b { font-family: var(--display); font-size: 1.15rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ig-top b.ok { color: var(--green); } .ig-top b.warn { color: var(--amber); } .ig-top b.bad { color: var(--red); }
.ig-bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 0.35rem 0 0.25rem; }
.ig-bar i { display: block; height: 100%; border-radius: 4px; background: var(--green); transition: width 0.6s var(--ease); }
.ig-bar i.warn { background: var(--amber); } .ig-bar i.bad { background: var(--red); }
.ig-sub { font-size: 0.7rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .ibigs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scards, .mcards { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .itabs { position: static; overflow-x: auto; flex-wrap: nowrap; }
  .itabs [data-tab] span { display: none; }
  .itabs [data-tab].on span { display: inline; }
  .itabs-meta { display: none; }
  .ibig-v { font-size: 1.6rem; }
}

/* ── Agent runs ─────────────────────────────────────────────────────────── */
.aruns { display: flex; flex-direction: column; }
.arun-head, .arun-row { display: grid; grid-template-columns: 22px minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1.6fr) 74px 84px; gap: 0.75rem; align-items: center; padding: 0.55rem 1rem; }
.arun-head { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); border-bottom: 1px solid var(--line); }
.arun-row { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; cursor: pointer; font: inherit; font-size: 0.82rem; }
.arun-row:hover { background: var(--glass-2); }
.arun.failed .arun-row { box-shadow: inset 3px 0 0 var(--red); }
.arun.running .arun-row, .arun.queued .arun-row { box-shadow: inset 3px 0 0 var(--orange); }
.arun-name { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.arun-rt, .arun-facts { color: var(--text-dim); font-size: 0.76rem; }
.arun .num { font-size: 0.76rem; color: var(--text-dim); text-align: right; }
.arun-detail { padding: 0.6rem 1rem 0.9rem 2.6rem; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 0.5rem; }
.arun-detail pre { max-height: 16em; overflow: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 760px) {
  .arun-head { display: none; }
  .arun-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .arun-rt, .arun-facts, .arun-row .num:last-child { display: none; }
  .arun-detail { padding-left: 1rem; }
}
