/* ===== System Tab ===== */

/* ===== Testing Tab — Announcements sub-tab ===== */

.ann-active-note {
  font-size: 0.82rem;
  color: var(--text-sub);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  max-width: 480px;
}
/* who the announcement goes to, above what is live · a machine with nobody clocked in warns */
.ann-audience { font-size: 0.82rem; font-weight: 600; color: var(--text); margin: 0 0 0.45rem; }
.ann-audience-none { color: var(--warning); }


/* Only the cap · 23 tiles want the whole tab width, and the archetype's own auto-fill then picks the count. Every group is the same width, so they all land on the same number of columns anyway. */
#tab-system .card-grid {
  max-width: none;
}


/* ===== Server Diagnostics Dashboard ===== */

#sys-server {
  margin-bottom: 1.5rem;
}

.srv-dashboard {
  background: var(--surface);
  border: 1px solid var(--cell-border-h);
  border-radius: 10px;
  overflow: hidden;
}

.srv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--cell-border-h);
  /* --surface-deep, not --surface — the header sits directly on .srv-dashboard, which is
     also --surface; the border-bottom alone isn't enough separation on the other 3 sides. */
  background: var(--surface-deep);
}

.srv-identity {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-faint);
}

.srv-identity-sep {
  color: var(--border);
}

.srv-uptime-pre {
  opacity: 0.5;
}

.srv-uptime {
  color: var(--text-muted);
}

.srv-header-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.67rem;
  color: var(--text-faint);
}

.srv-refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.srv-refresh-btn:hover {
  color: var(--text);
  background: var(--row-hover);
}

.srv-error {
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  color: var(--danger);
  border-bottom: 1px solid var(--cell-border-h);
}

/* Three-column body */
.srv-columns {
  display: flex;
  align-items: stretch;
}

.srv-col {
  flex: 1;
  padding: 0.85rem 1rem;
  border-right: 1px solid var(--cell-border-h);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.srv-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.srv-col--last {
  border-right: none;
}

.srv-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.55rem;
}

/* Metric rows: value left, label right */
.srv-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.18rem 0;
}

.srv-row-val {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.srv-row-val--sm {
  font-size: 0.82rem;
}

.srv-row-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.srv-row-unit {
  font-size: 0.6rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}

/* Memory progress bar */
.srv-mem-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.srv-mem-bar {
  flex: 1;
  height: 4px;
  background: var(--cell-border-h);
  border-radius: 2px;
  overflow: hidden;
}

.srv-mem-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--chart-running);
  transition: width 0.4s ease, background 0.4s ease;
}

.srv-mem-bar-fill--warn { background: var(--warning); }
.srv-mem-bar-fill--crit { background: var(--danger); }

.srv-mem-pct-inline {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 2.8rem;
  text-align: right;
}

/* Services table */
.srv-services {
  border-top: 1px solid var(--cell-border-h);
  padding: 0.75rem 1rem;
}

.srv-services-header {
  margin-bottom: 0.5rem;
}

.srv-svc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.srv-svc-table th {
  text-align: left;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 0.6rem 0.4rem 0;
  border-bottom: 1px solid var(--cell-border-h);
}

.srv-svc-table td {
  padding: 0.3rem 0.6rem 0.3rem 0;
  border-bottom: 1px solid var(--cell-border-h);
  color: var(--text);
}

.srv-svc-table tr:last-child td {
  border-bottom: none;
}

.srv-svc-name {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.8rem;
  color: var(--text);
}

.srv-svc-mono {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.srv-svc-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
}

.srv-svc-badge--active     { background: color-mix(in srgb, var(--chart-running) 15%, transparent); color: var(--chart-running); }
.srv-svc-badge--failed     { background: color-mix(in srgb, var(--danger) 15%, transparent);       color: var(--danger); }
.srv-svc-badge--activating { background: color-mix(in srgb, var(--warning) 15%, transparent);      color: var(--warning); }
.srv-svc-badge--inactive   { background: color-mix(in srgb, var(--text-faint) 15%, transparent);   color: var(--text-faint); }

.srv-section-title-sub {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
  opacity: 0.7;
}

.srv-svc-empty {
  font-size: 0.75rem;
  color: var(--text-faint);
  padding: 0.4rem 0;
}

@media (max-width: 700px) {
  .srv-columns {
    flex-direction: column;
  }
  .srv-col {
    border-right: none;
    border-bottom: 1px solid var(--cell-border-h);
  }
  .srv-col--last {
    border-bottom: none;
  }
}


/* ===== Daemon Console (inside the Daemons modal) =====
   Extends the Server Diagnostics Dashboard pattern above (same status-badge language via
   .srv-svc-badge) into a per-daemon live view: connection health, live state, config editor,
   restart/stop. Shape is generic — a daemon's /status can report any connection set, not just
   opc-consensus's modbus/opc/db. */

.dcon {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dcon-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dcon-status-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dcon-status-col {
  flex: 1;
  min-width: 160px;
  background: var(--table-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
}

.dcon-status-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}

.dcon-status-note {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dcon-section {
  border-top: 1px solid var(--cell-border-h);
  padding-top: 0.85rem;
}

.dcon-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

.dcon-store-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.dcon-store-cell {
  background: var(--table-surface);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  min-width: 0;
}

.dcon-store-key {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.dcon-store-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dcon-config-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.65rem;
}

.dcon-config-tab {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.dcon-config-tab:hover { color: var(--text); }
.dcon-config-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.dcon-config-textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--table-surface);
  color: var(--text);
}

.dcon-config-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.dcon-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}

.dcon-danger-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 46ch;
}
.dcon-danger-copy b { color: var(--text); }

.dcon-danger-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.dcon-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
}
.dcon-hint--error { color: var(--danger); }

@media (max-width: 700px) {
  .dcon-store-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ===== System Map (Nodes) ===== */

.sysmap-file-cell {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sysmap-reason {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-faint);
  font-weight: 400;
}


/* ===== DB ERD =====
   One schema at a time (a dropdown, not swimlanes — there are ~20 schemas, too many for an
   all-schemas canvas to stay readable). Internal tables render on top with real connector
   lines; anything crossing schema boundaries rolls up into one card per foreign schema along
   the bottom rail, never a card per foreign table. */

.erd-schema-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.erd-schema-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.erd-legend {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.erd-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.erd-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  border: 1px solid var(--cell-border-h);
  background: var(--surface);
}

.erd-legend-swatch.external {
  border: 1.5px dashed var(--accent);
  background: var(--info-bg);
}

.erd-legend-line {
  width: 1.6rem;
  height: 0;
  border-top: 2px solid var(--text-faint);
}

.erd-legend-line.cross {
  border-top: 2px dashed var(--accent);
}

.erd-canvas-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--cell-border-h);
  border-radius: 8px;
  background: var(--table-surface);
  min-height: 560px;
}

#erd-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.erd-internal-area {
  flex: none;
  padding: 1.5rem;
  display: flex;
  flex-flow: row wrap;
  gap: 1rem;
  align-items: flex-start;
  align-content: flex-start;
}

.erd-external-rail {
  flex: none;
  border-top: 1.5px dashed var(--cell-border-h);
  background: var(--table-surface);
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.erd-rail-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 0.2rem 0 0;
}

.erd-external-cards {
  display: flex;
  flex-flow: row wrap;
  gap: 1rem;
  align-items: flex-start;
}

/* Above the boxes so lines/markers paint over table backgrounds instead of vanishing at their
   edges — without this, a line only shows in the gap between boxes, never touching a row. */
svg#erd-links {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.erd-link { fill: none; stroke: var(--text-faint); stroke-width: 1.4; opacity: 0.55; }
.erd-link.cross-schema { stroke: var(--accent); stroke-dasharray: 5 3; opacity: 0.7; }
.erd-link.poly { stroke: var(--exceptional-color); stroke-dasharray: 1.5 3; stroke-linecap: round; opacity: 0.8; }
.erd-link.dim { opacity: 0.08; }
.erd-link.emph { stroke: var(--primary); stroke-width: 2.2; opacity: 1; }

.erd-link-anchor { fill: var(--surface); stroke: var(--text-faint); stroke-width: 1.4; r: 3; }
.erd-link-anchor.cross-schema { stroke: var(--accent); }
.erd-link-anchor.poly { stroke: var(--exceptional-color); }
.erd-link-anchor.emph { r: 3.5; stroke-width: 2; }
.erd-link-anchor.dim { opacity: 0.15; }

/* Cardinality glyphs — "*" (many, the FK side) / "1" (one, the PK side) at each line end */
.erd-link-label { font-size: 0.68rem; font-weight: 800; fill: var(--text-faint); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.erd-link-label.cross-schema { fill: var(--accent); }
.erd-link-label.poly-value { fill: var(--exceptional-color); font-style: italic; font-weight: 700; }
.erd-link-label.emph { fill: var(--primary); }
.erd-link-label.dim { opacity: 0.15; }

.erd-table-box {
  background: var(--surface);
  border: 1px solid var(--cell-border-h);
  border-radius: 8px;
  width: 224px;
  box-shadow: 0 1px 2px var(--shadow-sm);
  position: relative;
  z-index: 2;
  transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
}

/* A FROZEN table — frosted in the info tint, columns desaturated the same way .snapshot-mode says frozen */
.erd-table-box.deprecated {
  background: linear-gradient(160deg, var(--info-bg), var(--surface) 60%);
  border-color: var(--info-color);
  border-style: dashed;
}

.erd-table-box.deprecated .erd-column-row {
  filter: grayscale(0.85) saturate(0.4);
  opacity: 0.7;
}

.erd-table-box.deprecated .chip svg {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
}

.erd-table-box.collapsed .erd-column-row,
.erd-table-box.collapsed .erd-via-row {
  display: none;
}

.erd-table-box.collapsed .erd-table-title {
  border-bottom: none;
}

.erd-table-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--cell-border-h);
  cursor: pointer;
  user-select: none;
}

.erd-table-title .erd-title-count {
  color: var(--text-faint);
  font-weight: 500;
}

.erd-caret {
  display: inline-block;
  font-size: 0.6rem;
  transition: transform 0.12s ease;
  color: var(--text-faint);
}

.erd-table-box.collapsed .erd-caret {
  transform: rotate(-90deg);
}

.erd-column-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  font-size: 0.74rem;
  border-bottom: 1px solid var(--border);
}

.erd-column-row .erd-dir-arrow {
  color: var(--accent);
  flex: none;
}

.erd-column-row.poly-row {
  border-bottom-style: dotted;
}

.erd-column-row:last-child {
  border-bottom: none;
}

.erd-column-name {
  color: var(--text);
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.erd-column-type {
  color: var(--text-faint);
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.68rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.erd-pk-badge,
.erd-fk-badge,
.erd-poly-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  flex: none;
}

.erd-pk-badge {
  background: var(--badge-warning-bg);
  color: var(--warning);
}

.erd-fk-badge {
  background: var(--badge-success-bg);
  color: var(--success);
}

/* Its own cute little badge — distinct from a plain FK, since the target table isn't fixed */
.erd-poly-badge {
  background: var(--exceptional-bg);
  color: var(--exceptional-color);
}

/* A FROZEN column — the same info tint the frozen table wears, on the one row it applies to */
.erd-frozen-badge {
  display: inline-flex;
  align-items: center;
  color: var(--info-color);
  flex: none;
}

.erd-frozen-badge svg {
  width: 11px;
  height: 11px;
}

.erd-column-row.deprecated .erd-column-name {
  text-decoration: line-through;
  text-decoration-color: var(--info-color);
}

.erd-column-row.deprecated {
  opacity: 0.72;
}

.erd-via-row {
  font-size: 0.68rem;
  color: var(--text-faint);
  padding: 0.3rem 0.55rem;
  border-top: 1px solid var(--border);
}

.erd-via-row b {
  color: var(--text-sub);
  font-weight: 600;
}

/* External-reference card: a distinct, deliberately smaller "table type" — one card per
   foreign schema (never per foreign table), each row just the table.column relation touched */
.erd-table-box.external {
  width: 100%;
  max-width: 260px;
  border-style: dashed;
  border-color: var(--accent);
  background: var(--info-bg);
}

.erd-table-box.external .erd-table-title {
  border-bottom-color: var(--accent);
  color: var(--info-color);
}

.erd-table-box.external .erd-column-row {
  border-bottom-color: var(--border-light);
}

/* Focus / dim states — driven by JS on hover or search */
#erd-canvas.focus-active .erd-table-box { opacity: 0.28; }
#erd-canvas.focus-active .erd-table-box.is-focus-member { opacity: 1; }
#erd-canvas.focus-active .erd-table-box.is-focus-root { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

.erd-table-box.hidden {
  display: none;
}



/* ===== Sys Logs Terminal ===== */

.sys-logs-dt-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sys-logs-dt-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sys-logs-dt-input {
  padding: 0.32rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--text);
}

/* Terminal-specific styling only — background/border/radius/overflow/padding come from .scroll-panel */
.sys-log-terminal {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.8rem;
  height: 560px;
}

.sys-log-line {
  display: flex;
  gap: 10px;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.sys-log-ts {
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.sys-log-lvl {
  width: 60px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.sys-log-src {
  width: 140px;
  flex-shrink: 0;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sys-log-msg {
  flex: 1;
  word-break: break-word;
  color: var(--text);
}

.sys-log-error   .sys-log-lvl { color: var(--danger); }
.sys-log-warning .sys-log-lvl { color: var(--warning); }
.sys-log-info    .sys-log-lvl { color: var(--success); }
.sys-log-debug   .sys-log-lvl { color: var(--text-faint); }

/* ── System · Process ─────────────────────────────────────────────────────── */

/* Stage order caption above the alerts table — informational, not a control */
.process-flowline {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin: -0.25rem 0 0.85rem;
}

.process-muted { color: var(--text-faint); }

/* Channel column: one icon per delivery channel, dimmed when the alert doesn't use it */
.col-channels { width: 96px; }

td.col-channels {
  text-align: center;
  white-space: nowrap;
}

.channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  cursor: help;
}

.channel-icon.is-on  { color: var(--primary); }
/* Off channels stay visible rather than hidden, so the row shows all three every time */
.channel-icon.is-off { color: var(--border); }

/* Condition cell — a real condition reads as a value, "always" recedes */
.cond {
  font-size: 0.78rem;
  color: var(--warning);
  background: var(--warning-bg);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
}

.cond-any {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* A stage change draws a rule, so the table reads grouped without spending header rows */
#process-alerts-table tbody tr.stage-start td { border-top: 2px solid var(--border); }
.stage-cell { font-weight: 600; color: var(--text-sub); white-space: nowrap; }

/* Audience editor inside the modal */
.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  min-height: 1.9rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 0.35rem;
}

.chip-add-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.35rem;
}

.chip-add-row select { flex: 1; min-width: 0; }

.chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.7em;
  padding: 0 0 0 0.15rem;
  opacity: 0.7;
}

.chip-remove:hover { opacity: 1; }

.field-hint {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-top: 0.2rem;
}

/* ─── Standards → Performance ─────────────────────────────────────────────── */

#standards-perf-chart {
  width: 100%;
  height: 300px;
  display: block;
}

/* Start/end of each series and the gap between them, under the chart */
.diverge-table {
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.diverge-table th {
  text-align: right;
  padding: 0.15rem 0 0.35rem 1.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.diverge-table th:first-child { text-align: left; }

.diverge-table th small {
  font-size: 0.6rem;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

.diverge-table td {
  border-top: 1px solid var(--border-light);
  padding: 0.3rem 0 0.3rem 1.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.diverge-table td:first-child {
  text-align: left;
  padding-left: 0;
  color: var(--text);
}

.diverge-table td:last-child { font-weight: 700; }

.diverge-table .diverge-attrib td {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ─── Standards: card rows ─────────────────────────────────────────────────
   One row per file, replacing a dense table so each value can carry its own
   label. Shared with the Experimentation pane so both read as one feature. */

/* ── Commit timing ────────────────────────────────────────────────────────────
   When a commit lands, said before it is made. The bar carries the choice and the count of what
   that choice moves, because a commit that only reaches forward and one that rewrites eight
   months of figures used to look identical up to the moment they landed. */
.commit-timing {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 5px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.ct-head { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.ct-title {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
}
.ct-modes { display: flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.ct-mode {
  border: none; border-right: 1px solid var(--border); background: var(--surface);
  color: var(--text-sub); padding: 0.35rem 0.8rem; font: 500 0.75rem inherit; cursor: pointer;
}
.ct-mode:last-child { border-right: none; }
.ct-mode:hover { background: var(--row-hover); }
.ct-mode.is-on { background: var(--primary); color: var(--on-primary); font-weight: 600; }

.ct-from-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ct-preset {
  border: 1px solid var(--border); background: var(--table-surface); color: var(--text-sub);
  border-radius: 4px; padding: 0.3rem 0.6rem; font: 500 0.72rem inherit; cursor: pointer;
}
.ct-preset:hover { background: var(--row-hover); }
.ct-preset.is-on { border-color: var(--primary); background: var(--info-bg); color: var(--info-color); }
.ct-preset-at { color: var(--text-muted); font-weight: 400; margin-left: 0.25rem; }
.ct-preset.is-on .ct-preset-at { color: var(--info-color); }
.ct-custom { display: flex; align-items: center; gap: 0.4rem; margin-left: 0.3rem; }
.ct-custom-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
}
/* the date and time wear the shared .dt-input, so only the reason box is styled here */
.ct-note { flex: 1; margin-left: 0; }
.ct-note input {
  flex: 1; min-width: 12rem;
  border: 1px solid var(--border); border-radius: 4px; padding: 0.28rem 0.45rem;
  font: 0.72rem inherit; color: var(--text);
}

.ct-consequence { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.ct-line { font-size: 0.78rem; color: var(--text); }
.ct-count {
  font-size: 0.72rem; font-weight: 600; border-radius: 4px; padding: 0.22rem 0.55rem;
  white-space: nowrap;
}
.ct-count.is-quiet   { background: var(--surface-deep); color: var(--text-muted); }
.ct-count.is-warning { background: var(--warning-bg);   color: var(--warning); }
.ct-count.is-danger  { background: var(--danger-bg);    color: var(--danger); }

/* when a standard took effect, beside the grain that supplied it · text-muted rather than
   text-faint, which sits near 3:1 on this surface and fails at this size */
/* under the grain rather than beside it · 130px does not hold a chip and a date on one line */
.std-from-at { display: block; margin-top: 0.1rem; font-size: 0.7rem; color: var(--text-muted); }
.std-from-inherit { font-size: 0.75rem; color: var(--text-muted); }

/* derives .card-row (shared.css); only the column track is its own */
/* the last track holds the row's controls · the module row puts four there (lock, use-nominal,
   history, Commit) and 108px fits three, so the overflow ran left over the column before it */
.std-row {
  grid-template-columns: minmax(150px, 1.2fr) 80px 108px 108px minmax(190px, 1.6fr) 130px 152px;
}

/* the figures and the timing bar sit inside the header panel, which owns the chrome for both */
.std-header > .summary-strip--inline,
.std-header > .commit-timing { background: none; border: none; border-radius: 0; margin: 0; padding-inline: 0; }
.std-header > .summary-strip--inline { padding-block: 0; }
.std-header > .commit-timing { padding-bottom: 0; }

/* one table, so the rows drop the card chrome and are split by a hairline instead */
.std-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.std-table:has(.std-rows.hidden) { display: none; }
.std-rows > .std-row {
  border: none; border-bottom: 1px solid var(--border-light);
  border-radius: 0; margin: 0; background: var(--surface);
}
.std-rows > .std-row:last-child { border-bottom: none; }
.std-rows > .std-row:hover { background: var(--row-hover); }

/* the module default every file falls back to, the parent row its files drop down from */
.std-rows > .std-row.is-module { background: var(--info-bg); border-bottom-color: var(--border); cursor: pointer; }
/* folded, only the parent row shows · a search looks through the fold, so its matches show either way */
.std-rows.is-collapsed:not(.is-searching) > .std-row:not(.is-module),
.std-rows > .std-row.is-search-miss { display: none; }
/* color marks state only · staged is amber, locked is dimmed, an own standard is its chip */
.std-rows > .std-row.is-dirty { background: var(--warning-bg); }
.std-row.is-locked { opacity: 0.75; }

.std-name { font-weight: 600; }
.std-sub { font-size: 0.72rem; color: var(--text-muted); }

/* One header for the whole table · it wears .std-row only for the column track, not the card */
.std-head {
  /* the grid itself lives on .card-row, which the header does not wear, so it is restated here */
  display: grid;
  gap: 0.9rem;
  align-items: center;
  background: var(--table-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
/* the names sit past the caret, so the first caption does too */
.std-head > :first-child { padding-left: 1.75rem; }
/* with a header above them, the per-cell captions would be a second labelling of the same columns */
.std-rows .cell-k { display: none; }

/* every cell names its own value, since a card has no header row to inherit from */

.std-util-cell { display: flex; align-items: center; gap: 0.5rem; }
.std-util-cell input[type="range"] { width: 100%; accent-color: var(--primary); }
.std-util-val { min-width: 2.4rem; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.std-row-actions { display: flex; gap: 0.35rem; justify-content: flex-end; align-items: center; }


@media (max-width: 1000px) {
  .std-row { grid-template-columns: 1fr 1fr 1fr; }
  /* reflowed to three columns, nothing lines up under the header, so each cell names itself again */
  .std-head { display: none; }
  .std-rows .cell-k { display: block; }
}

/* ─── Experimentation pane ─────────────────────────────────────────────────── */

/* a pane's unsaved-work line, sat in the subtab bar's end slot · always in view, since the section never scrolls the page */
.exp-banner {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin: 0.25rem 0; padding: 0.2rem 0.3rem 0.2rem 0.7rem; border-radius: 4px;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  color: var(--warning); font-size: 0.76rem; font-weight: 600;
}
/* only the open pane's line shows · the bar is shared, so the other pane's would be a control for work not on screen */
#config-standards[data-pane="table"] [data-for-pane="experimentation"],
#config-standards[data-pane="experimentation"] [data-for-pane="table"] { display: none; }

/* derives .card-row (shared.css); the track is shared with .exp-file-row so an expanded
   file always lines up under its module — add a column here and both grains follow */
.exp-row, .exp-file-row {
  /* capped tracks, not shares · an fr name track left hundreds of px empty, and Module default wants 169 where it had 96 */
  grid-template-columns: minmax(240px, 20rem) minmax(200px, 16rem) 128px minmax(200px, 1fr) 120px;
}
.exp-row.is-up { border-left-color: var(--success); }
.exp-row.is-down { border-left-color: var(--danger); }
.exp-row.is-empty { opacity: 0.72; }

/* block, so the effective line below starts fresh without the info button being pushed onto a row of its own */
.exp-std { display: block; font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.exp-input { width: 4.6rem; text-align: right; font-variant-numeric: tabular-nums; }

/* before → after on one track: where the change reads at a glance */

.exp-nodata { font-size: 0.78rem; color: var(--text-muted); }
.exp-row-actions { display: flex; gap: 0.35rem; justify-content: flex-end; align-items: center; }
.exp-delta {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 3px; white-space: nowrap;
}
.exp-delta.is-up { background: var(--success-bg); color: var(--success); }
.exp-delta.is-down { background: var(--danger-bg); color: var(--danger); }
.exp-remove { font-size: 0.95rem; line-height: 1; padding: 0.15rem 0.45rem; }

.add-panel { margin-top: 0.9rem; padding: 0.75rem 0.9rem; border: 1px dashed var(--border); border-radius: 5px; }
.add-title {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 0.55rem;
}

/* collapsible chart panel shared by the pane */
.graph-panel { border: 1px solid var(--border); border-radius: 5px; margin-bottom: 1.1rem; background: var(--table-surface); }
/* the chart is the pane's point, so it is always open · its head is a title row, not a disclosure */
.graph-panel-head {
  padding: 0.5rem 0.85rem; font-size: 0.78rem; font-weight: 600;
  color: var(--text-sub); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.graph-panel-body { padding: 0.25rem 0.85rem 0.85rem; }
.graph-main { min-width: 0; }
.graph-body { overflow-x: auto; }
/* the module tabs sit on the chart, so they take its width rather than the panel's */
.graph-tabs { margin-bottom: 0.35rem; }
.graph-tabs .subtab { display: inline-flex; align-items: center; }

/* The chart and its figures, side by side as two panels · the figures were part of the chart's box and got clipped with it */
.exp-top { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 0.6rem; align-items: stretch; margin-bottom: 0.6rem; }
.exp-top > .graph-panel { margin-bottom: 0; min-width: 0; }
/* its own surface and title, so it reads as a readout beside the chart rather than part of the plot */
.graph-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 0.5rem 0.85rem 0.6rem;
}
.graph-side-title { flex: none; font-size: 0.78rem; font-weight: 600; color: var(--text-sub); margin-bottom: 0.4rem; }
/* it scrolls on its own when the chart is short, rather than being cut off at the chart's height */
#exp-summary { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#exp-summary > div { padding-block: 0.3rem; }

@media (max-width: 1100px) {
  /* too narrow to read a chart beside a column of figures, so they go back under it */
  .exp-top { grid-template-columns: minmax(0, 1fr); }
}
.graph-legend { margin-left: auto; display: flex; gap: 0.85rem; font-weight: 500; color: var(--text-muted); font-size: 0.72rem; }
.graph-legend i { display: inline-block; width: 0.85rem; vertical-align: middle; margin-right: 0.3rem; }
.lg-line { height: 0; border-top: 2.5px solid currentColor; }
.lg-recorded { color: var(--primary); }
.lg-experimental { color: var(--exceptional-color); border-top-style: dashed; }
.lg-baseline { color: var(--text-sub); border-top-style: dotted; }

/* the box the chart has is whatever the controls leave · setupCanvas sizes the backing store from it */
#exp-chart { width: 100%; height: 100%; display: block; }

/* ── Standards fits the window · the tab is full-bleed while it is up (pathbar.js), so each pane scrolls inside itself ── */
#config-standards:not(.hidden) { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; padding: 0.85rem 1.1rem; }
#config-standards > .subtab-bar { margin-bottom: 0.6rem; }
/* on a short screen the chart's floor outgrows the window, so the pane scrolls rather than cutting it off */
#config-standards > .subtab-pane:not(.hidden) { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
#config-standards > .subtab-pane > * { flex: none; }
/* a status line with nothing to say takes no height · the library sections' one above, and the pane's own */
#tab-system.is-fullbleed > #lib-status:empty,
#config-standards .status-text:empty { display: none; }

/* Rates · the table is what scrolls, so the figures, timing and banner stay in view above it */
#config-standards .std-table { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#config-standards .std-head { position: sticky; top: 0; z-index: var(--z-raise-1); }

/* Experiment · the chart takes the height the controls leave, and the rows scroll beneath it */
#config-standards #exp-pane-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* one row as tall as the space left, so neither the chart nor its figures can push past it */
#config-standards #exp-graph { flex: 1 1 0; min-height: 280px; grid-template-rows: minmax(0, 1fr); }
#exp-graph > .graph-panel { display: flex; flex-direction: column; min-height: 0; }
#exp-graph .graph-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#exp-graph .graph-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#exp-graph .graph-body { flex: 1; min-height: 0; }
/* capped, so a long experiment never squeezes the chart below its floor */
#exp-rows { flex: 0 1 auto; min-height: 0; max-height: 30%; overflow-y: auto; }
/* nothing added yet · the message fills the space the chart would take */
#config-standards > .subtab-pane > .empty-state { flex: 1 1 auto; }
/* while that message is up the body has nothing in it · it stops growing, or the two split the pane between them */
#config-standards > .subtab-pane:has(> .empty-state:not(.hidden)) > #exp-pane-body { flex: none; }

/* too narrow to split the height sensibly, so it scrolls as a page again, the way the console does */
@media (max-width: 960px) {
  #tab-system.is-fullbleed.active { height: auto; overflow: visible; }
  #config-standards #exp-graph { flex: none; grid-template-rows: none; }
  #exp-chart { height: clamp(260px, 46vh, 520px); }
  #exp-rows, #config-standards .std-table { max-height: none; overflow: visible; }
}

/* The one mark that names a module · the same colour in the strip lane, its chart and its row */
.exp-chip, .ps-lane-chip {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  flex: none;
  margin-right: 0.3rem;
  vertical-align: middle;
}
/* the row's chip sits beside the caret rather than in the text, so names still line up */
.exp-row .exp-chip { align-self: center; margin: 0 0.1rem 0 0; }

@media (max-width: 900px) {
  .exp-row { grid-template-columns: 1fr 1fr; }
  .exp-row > .exp-track-wrap { grid-column: 1 / -1; }
}

/* Expanded module: its files, indented under the row they belong to */
.exp-name-cell { display: flex; align-items: flex-start; gap: 0.4rem; }
/* the text column shrinks rather than pushing the track wider, so the line below can end in an ellipsis */
.exp-name-cell > div { min-width: 0; }
/* the sub reads as one identifier · it trails off instead of wrapping to a second line */
.exp-name-cell .std-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-name-cell .std-name { overflow-wrap: anywhere; }

.exp-caret {
  flex: none; width: 1.35rem; height: 1.35rem; padding: 0; margin-top: 0.05rem;
  border: none; background: none; color: var(--text-muted);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.exp-caret:hover { color: var(--text); }
.exp-caret.is-empty { cursor: default; }

.exp-file-row {
  background: var(--surface); border-color: var(--border-light);
  border-left-color: var(--border-light);
  padding: 0.5rem 0.9rem;
  margin: 0.25rem 0 0 1.6rem;   /* indented, so the file belongs to the row above it */
}
.exp-file-row:hover { background: var(--row-hover); }
.exp-file-row.is-empty { opacity: 0.6; }
.exp-file-row .std-name { font-size: 0.8rem; }

/* A refetch is never silent: the figures dim and stop responding until they are current */
/* Legend key for the idle shading on the experiment chart */
.lg-band {
  height: 0.65rem; border-radius: 2px;
  background: var(--chart-running); opacity: 0.45;
}

/* the standard in force now · inline-block, so the info button after it shares this line instead of starting another */
.exp-inforce {
  display: inline-block; margin-top: 0.1rem; vertical-align: middle;
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* the button belongs to the line it explains, a hair clear of the text */
.exp-inforce + .info-btn { vertical-align: middle; margin-left: 0.25rem; }

/* a file listed under the module it belongs to, in a commit confirmation */
.diverge-table .diverge-sub td:first-child { padding-left: 1.2rem; color: var(--text-muted); }

/* the "skipped - locked" divider inside a commit confirmation */
.diverge-table .diverge-head {
  padding-top: 0.6rem; font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600;
}
.diverge-table .diverge-locked td { color: var(--text-muted); }

/* a superseded version is kept for the record but no longer read by anything */
.history-entry.is-superseded { border-style: dashed; opacity: 0.8; }
.history-entry.is-superseded .history-entry-version { color: var(--text-muted); }

/* the Correct action, and what it warns will move */
.btn-correct { color: var(--warning); }
.correct-impact {
  background: var(--danger-bg); border-left: 3px solid var(--danger);
  padding: 0.55rem 0.65rem; border-radius: 3px; margin-top: 0.6rem;
  display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem;
}
.correct-impact b { color: var(--danger); font-variant-numeric: tabular-nums; }
.req { color: var(--danger); }

/* the period strip is the field panel's end group, which spaces it, so it carries no margin of its own */
.period-strip { margin: 0; display: flex; flex-direction: column; }
/* a narrower start than the fields beside it, so all four groups keep to one row at laptop width */
.exp-timeline-group { flex-basis: 14rem; }
/* nothing to draw until a module is in, so the group steps aside with its strip */
.exp-timeline-group:has(> .period-strip.hidden) { display: none; }

/* the rate the work was priced at when it ran, beside the rate it would be priced at now */
.exp-was { color: var(--warning); }

/* how far the module default reaches, and where each file's standard comes from */
.exp-applied {
  display: block; margin-top: 0.1rem; font-size: 0.66rem; font-weight: 600;
  color: var(--text-faint);
}
.exp-applied.is-all { color: var(--success); }
.exp-applied.is-none { color: var(--warning); }
.exp-applied.is-unset { color: var(--danger); cursor: help; }

.exp-src {
  display: block; margin-top: 0.05rem; font-size: 0.62rem; font-weight: 600;
  color: var(--text-faint);
}
.exp-src.is-override { color: var(--exceptional-color); }
.exp-src.is-unset { color: var(--danger); }

/* the module default moved inside the selected window, so no one value governed it */
.exp-varied {
  display: block; margin-top: 0.1rem; font-size: 0.66rem; font-weight: 700;
  color: var(--warning); cursor: help; font-variant-numeric: tabular-nums;
}

/* ─── Sentinel overview — what needs a person first, then figures, then the jobs ─── */

.sentinel-attention {
  border: 1px solid var(--danger); border-left-width: 4px;
  background: var(--danger-bg); border-radius: 6px;
  padding: 0.6rem 0.75rem; margin-bottom: 0.85rem;
}
.sentinel-attention-head {
  font-size: 0.85rem; font-weight: 700; color: var(--danger); margin-bottom: 0.45rem;
}
.sentinel-attention-item {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.45rem 0.6rem;
}
.sentinel-attention-item + .sentinel-attention-item { margin-top: 0.35rem; }
.sentinel-attention-text { min-width: 0; }
.sentinel-attention-title { font-weight: 600; font-size: 0.82rem; overflow-wrap: anywhere; }
.sentinel-attention-sub {
  font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; overflow-wrap: anywhere;
}
.sentinel-attention-item .btn-primary { margin-left: auto; flex: none; }

/* Sent · the note under an outcome chip, mirroring the attention item's sub line */
.outbound-note {
  display: block;
  font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; overflow-wrap: anywhere;
}
/* The part of the app that asked for the send · quiet, since it reads as a key rather than prose */
.outbound-source { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }

.sentinel-allclear {
  display: flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--border); border-left: 4px solid var(--success);
  background: var(--success-bg); border-radius: 6px;
  padding: 0.6rem 0.75rem; margin-bottom: 0.85rem;
  font-weight: 600; color: var(--success);
}

/* Sentinel's panes give their contents a column to sit in, the way Standards' do, so an empty one fills the shell */
#sys-process > .subtab-pane:not(.hidden) { display: flex; flex-direction: column; min-height: 26rem; }
#sys-process > .subtab-pane > * { flex: none; }
/* nothing sent, no alerts, no events · the message takes the room the table would have had */
#sys-process > .subtab-pane > .empty-state { flex: 1 1 auto; }

.sentinel-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; margin-bottom: 0.85rem;
}
.sentinel-stat { background: var(--surface); padding: 0.45rem 0.65rem; }
.sentinel-stat-label {
  font-size: 0.63rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700;
}
.sentinel-stat-value {
  font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25;
}
.sentinel-stat-value.is-danger  { color: var(--danger); }
.sentinel-stat-value.is-warning { color: var(--warning); }
.sentinel-stat-value.is-success { color: var(--success); }
.sentinel-stat-sub { font-size: 0.66rem; color: var(--text-faint); min-height: 0.95rem; }

.sentinel-levels {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.65rem;
}
.sentinel-level {
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); padding: 0.55rem 0.65rem;
}
.sentinel-level-head {
  display: flex; align-items: baseline; gap: 0.45rem; margin-bottom: 0.4rem;
}
.sentinel-level-name { font-size: 0.9rem; font-weight: 700; }
.sentinel-level-rule { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }

.sentinel-job {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0; border-top: 1px solid var(--border); font-size: 0.8rem;
}
.sentinel-job.is-unwritten { color: var(--text-faint); }
.sentinel-job-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sentinel-job-schedule {
  margin-left: auto; font-size: 0.7rem; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.sentinel-job .btn-secondary { flex: none; padding: 0.1rem 0.45rem; font-size: 0.72rem; }

/* Shared with the control panel's rail — a job is running, halted, or nothing yet */
.state-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.state-dot.running { background: var(--success); }
.state-dot.paused  { background: var(--text-faint); }
