/* Workflow Agents dashboard (static/js/workflows-dashboard.js) — the home of
   the Workflow Agents screen. Uses ren-workflows.css's --rf-* tokens (light on
   :root, dark on html[data-theme="dark"]); the KPI band is the navy band the
   Portfolios overview used to have (.pfo-kpi-bar, since replaced). */

.rd {
  container: rd / inline-size;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* The agent pages' .wf-shell padding, so nothing jumps between them. */
  padding: 16px 16px 18px;
  box-sizing: border-box;
  overflow-y: auto;
  font-family: "Work Sans", sans-serif;
  color: var(--rf-text);
}
.rd *,
.rd-pop * { box-sizing: border-box; }
.rd button,
.rd-pop button { font-family: inherit; }
.rd .rf-ic,
.rd-pop .rf-ic { width: 16px; height: 16px; }
.rd .rd-ic-xs,
.rd-pop .rd-ic-xs { width: 13px; height: 13px; vertical-align: -2px; }
.rd .rd-ic-lg { width: 28px; height: 28px; opacity: 0.45; }
.rd-muted { color: var(--rf-text-3); }
.rd-sep { margin: 0 6px; color: var(--rf-text-3); }

.rd-link {
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--rf-brand);
  font-family: "Work Sans", sans-serif; font-weight: 600; font-size: inherit;
}
.rd-link:hover { text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────────────────── */
.rd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-shrink: 0; }
.rd-head-l { min-width: 0; }
.rd-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; color: var(--rf-text); }
.rd-subtitle { font-size: 13px; color: var(--rf-text-2); margin-top: 4px; }
.rd-head-r { display: flex; gap: 8px; flex-shrink: 0; }

.rd-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--rf-line); background: var(--rf-card); color: var(--rf-text);
  font: 600 13px "Work Sans", sans-serif; cursor: pointer; white-space: nowrap;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.rd-btn:hover:not([disabled]) { border-color: var(--rf-brand); color: var(--rf-brand); }
.rd-btn-primary { background: #4369f4; border-color: #4369f4; color: #fff; box-shadow: 0 1px 2px rgba(67, 105, 244, 0.35); }
.rd-btn-primary:hover:not([disabled]) { color: #fff; background: #3558e0; border-color: #3558e0; }
.rd-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.rd-btn[disabled] { opacity: 0.5; cursor: default; }

.rd :focus-visible,
.rd-pop :focus-visible { outline: 2px solid var(--rf-brand); outline-offset: 2px; }

/* Unsaved builder work; load errors */
.rd-draft,
.rd-banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; border-radius: 10px;
  font-size: 13px; flex-shrink: 0;
}
.rd-draft { background: var(--rf-brand-soft); border: 1px solid rgba(67, 105, 244, 0.25); }
.rd-draft > .rf-ic { color: var(--rf-ai); }
.rd-draft > span,
.rd-banner > span { flex: 1; min-width: 0; }
.rd-banner { background: var(--rf-err-bg); color: var(--rf-err); border: 1px solid rgba(220, 38, 38, 0.25); }

/* ── KPI band ───────────────────────────────────────────────────────── */
.rd-kpis {
  flex-shrink: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #01012c; border: 1px solid #273348; border-radius: 14px; overflow: hidden;
}
.rd-kpi {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 13px 20px 14px;
  border: 0; background: transparent; text-align: left; cursor: pointer; color: #fff;
}
.rd-kpi + .rd-kpi::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: rgba(255, 255, 255, 0.09);
}
.rd-kpi:hover { background: rgba(255, 255, 255, 0.045); }
.rd-kpi:focus-visible { outline: 2px solid #8ea8ff; outline-offset: -3px; border-radius: 12px; }
.rd-kpi-lbl {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8a9bb8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rd-kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; height: 38px; }
.rd-kpi-val { font-size: 30px; font-weight: 800; line-height: 1.15; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-kpi-of { font-size: 14px; font-weight: 600; color: #8a9bb8; }
.rd-kpi-sub { font-size: 12px; color: #a8bfff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-kpi-bad .rd-kpi-val { color: #f08a8a; }
.rd-kpi-warn .rd-kpi-val { color: #f5b955; }
.rd-kpi-ok .rd-kpi-val { color: #5ee0a0; }
.rd-kpi-next .rd-kpi-val { font-size: 28px; }
.rd-spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 32px; padding-bottom: 5px; flex-shrink: 0; }
.rd-spark-bar { display: flex; flex-direction: column-reverse; gap: 1px; width: 7px; }
.rd-spark-bar i { display: block; width: 100%; border-radius: 2px; }
.rd-s-success { background: #4ade80; }
.rd-s-stopped { background: #e3a008; }
.rd-s-failed { background: #f87171; }
.rd-s-running { background: #8ea8ff; }
.rd-spark-bar .rd-s-none { height: 2px; background: rgba(255, 255, 255, 0.16); }

/* ── Grid of cards ──────────────────────────────────────────────────── */
.rd-grid {
  flex: 1; min-height: 440px; display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 29%, 430px);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "agents runs" "agents conns";
}
.rd-agents { grid-area: agents; container: agents / inline-size; }
.rd-runs { grid-area: runs; }
.rd-conns { grid-area: conns; }

.rd-card {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--rf-card); border: 1px solid var(--rf-line); border-radius: 14px; box-shadow: var(--rf-shadow);
}
.rd-card.rd-flash { animation: rd-flash 1.1s ease-out; }
@keyframes rd-flash { 0% { box-shadow: 0 0 0 3px rgba(67, 105, 244, 0.45); } 100% { box-shadow: 0 0 0 3px rgba(67, 105, 244, 0); } }
.rd-card-hdr {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  padding: 11px 14px 11px 16px; border-bottom: 1px solid var(--rf-line-2); flex-shrink: 0; min-height: 54px;
}
.rd-card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.rd-count {
  font-size: 11.5px; font-weight: 700; color: var(--rf-text-2); background: var(--rf-line-2);
  border-radius: 999px; padding: 1px 8px; line-height: 1.5;
}
.rd-card-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rd-scroll { overflow-y: auto; min-height: 0; }

.rd-seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 2px; background: var(--rf-card-2); border: 1px solid var(--rf-line); border-radius: 8px; }
.rd-seg-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 0; border-radius: 6px;
  background: transparent; color: var(--rf-text-2); font: 600 12px "Work Sans", sans-serif; cursor: pointer; white-space: nowrap;
}
.rd-seg-btn:hover { color: var(--rf-text); }
.rd-seg-btn.on { background: var(--rf-card); color: var(--rf-text); box-shadow: 0 1px 2px rgba(1, 1, 44, 0.12); }
.rd-seg-n { font-size: 11px; font-weight: 600; color: var(--rf-text-3); }
.rd-seg-warn .rd-seg-n { color: var(--rf-warn); font-weight: 700; }
html[data-theme="dark"] .rd-seg-btn.on { background: var(--rf-line); box-shadow: none; }

.rd-search {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; width: 180px; padding: 0 10px;
  border: 1px solid var(--rf-line); border-radius: 8px; background: var(--rf-card); color: var(--rf-text-3);
}
.rd-search:focus-within { border-color: var(--rf-brand); }
.rd-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--rf-text); font: 13px "Work Sans", sans-serif; }
.rd .rd-search input:focus-visible { outline: 0; }
.rd-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--rf-text-2); cursor: pointer; white-space: nowrap; }
.rd-check input { accent-color: var(--rf-brand); margin: 0; }

.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 0; flex-shrink: 0; }
.rd-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--rf-brand-soft); color: var(--rf-brand); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rd-chip-x {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; padding: 0;
}
.rd-chip-x:hover { background: rgba(67, 105, 244, 0.18); }

/* ── Agents table ───────────────────────────────────────────────────── */
.rd-table { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rd-thead,
.rd-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 80px 150px 112px 100px; column-gap: 12px; align-items: center;
  padding-left: 16px; padding-right: 14px;
}
.rd-thead { height: 34px; flex-shrink: 0; border-bottom: 1px solid var(--rf-line-2); }
.rd-th {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: 700 11px "Work Sans", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-text-3);
}
.rd-th:hover,
.rd-th-on { color: var(--rf-text); }
.rd-th-dir { font-size: 8px; }
span.rd-th { cursor: default; }

.rd-row { min-height: 68px; padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--rf-line-2); cursor: pointer; transition: background 0.12s; }
.rd-row:hover { background: var(--rf-card-2); }
.rd-c-agent { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.rd-kind { display: flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; }
.rd-kind-custom { background: rgba(124, 58, 237, 0.1); color: var(--rf-ai); }
.rd-kind-classic { background: var(--rf-brand-soft); color: var(--rf-brand); }
html[data-theme="dark"] .rd-kind-custom { background: rgba(167, 139, 250, 0.15); }
.rd-agent-body { flex: 1; min-width: 0; }
.rd-agent-name {
  display: block; max-width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: 700 13.5px/1.35 "Work Sans", sans-serif; color: var(--rf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rd-row:hover .rd-agent-name { color: var(--rf-brand); }
.rd-agent-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--rf-text-2); }
.rd-meta-kind { font-weight: 600; }
.rd-sends { display: inline-flex; align-items: center; gap: 8px; }
.rd-send { display: inline-flex; align-items: center; gap: 4px; }
.rd-arrow { margin: 0 -2px; color: var(--rf-text-3); }
.rd-twin { color: var(--rf-text-3); font-style: italic; }
.rd-issue { display: flex; align-items: flex-start; gap: 5px; margin-top: 5px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.rd-issue > .rf-ic { margin-top: 2px; flex-shrink: 0; }
.rd-issue > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rd-issue-err { color: var(--rf-err); }
.rd-issue-warn { color: var(--rf-warn); }
.rd-issue-why { font-weight: 400; }
.rd-agent-next { display: none; margin-top: 3px; font-size: 12px; color: var(--rf-text-2); }
.rd-agent-next:empty { display: none !important; }

.rd-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.rd-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rd-pill-active { background: rgba(22, 163, 74, 0.1); color: #15803d; }
.rd-pill-paused { background: var(--rf-line-2); color: var(--rf-text-2); }
.rd-pill-draft { padding: 2px 9px 2px 7px; border: 1px dashed var(--rf-line); color: var(--rf-text-3); }
html[data-theme="dark"] .rd-pill-active { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.rd-sending { display: block; margin-top: 5px; font-size: 11.5px; font-weight: 600; color: var(--rf-brand); }

.rd-c-runs { min-width: 0; }
.rd-dots { display: inline-flex; align-items: center; gap: 4px; height: 14px; }
.rd-dot {
  width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  transition: transform 0.1s;
}
.rd-dot:hover { transform: scale(1.35); }
.rd-dot-success { background: var(--rf-ok); color: var(--rf-ok); }
.rd-dot-failed { background: var(--rf-err); color: var(--rf-err); }
.rd-dot-stopped { background: var(--rf-logic); color: var(--rf-logic); }
.rd-dot-running { background: var(--rf-brand); color: var(--rf-brand); animation: rd-pulse 1.4s ease-in-out infinite; }
.rd-dot.rd-dot-test { background: transparent; border: 2px solid currentColor; }
.rd-dots-none { font-size: 12px; color: var(--rf-text-3); }
.rd-c-runs-last { margin-top: 4px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-last { font-weight: 600; }
.rd-last-success { color: var(--rf-ok); }
.rd-last-failed { color: var(--rf-err); }
.rd-last-stopped { color: var(--rf-logic); }
.rd-last-running { color: var(--rf-brand); }
.rd-row .rd-c-next { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-next { display: flex; flex-direction: column; color: var(--rf-text-2); font-size: 12px; }
.rd-next b { font-size: 13px; font-weight: 600; color: var(--rf-text); }

.rd-c-act { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.rd-act {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--rf-text-2);
  font: 600 12px "Work Sans", sans-serif; cursor: pointer; white-space: nowrap;
}
.rd-act .rf-ic { width: 13px; height: 13px; }
.rd-row:hover .rd-act:not([disabled]),
.rd-act:focus-visible { border-color: var(--rf-line); background: var(--rf-card); color: var(--rf-text); }
.rd-act:hover:not([disabled]) { border-color: var(--rf-brand) !important; color: var(--rf-brand) !important; }
.rd-act[disabled] { opacity: 0.45; cursor: not-allowed; }
.rd-act-hover { visibility: hidden; }
.rd-row:hover .rd-act-hover,
.rd-row:focus-within .rd-act-hover { visibility: visible; }
@media (hover: none) { .rd-act-hover { display: none; } }
.rd-more {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--rf-text-3); cursor: pointer;
}
.rd-more .rf-ic { width: 18px; height: 18px; stroke-width: 3; }
.rd-more:hover { background: var(--rf-line-2); color: var(--rf-text); }

.rd-add-row {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 12px 16px 16px; padding: 12px 14px;
  border: 1px dashed var(--rf-line); border-radius: 10px; background: transparent; color: var(--rf-text-2);
  font: 600 13px "Work Sans", sans-serif; cursor: pointer; text-align: left;
}
.rd-add-row .rf-ic { color: var(--rf-ai); }
.rd-add-row:hover { border-color: var(--rf-brand); color: var(--rf-brand); background: var(--rf-brand-soft); }
.rd-empty-row { padding: 22px 16px; font-size: 13px; color: var(--rf-text-2); }

/* Narrower agent lists: next run moves under the name, then the table folds. */
@container agents (max-width: 780px) {
  .rd-thead,
  .rd-row { grid-template-columns: minmax(0, 1fr) 80px 150px 100px; }
  .rd-c-next { display: none; }
  .rd-agent-next { display: block; }
  /* The tile already says which kind it is (and its tooltip, in words). */
  .rd-meta-kind,
  .rd-meta-kind + .rd-sep { display: none; }
}
@container agents (max-width: 600px) {
  .rd-thead { display: none; }
  .rd-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "agent agent" "runs act"; row-gap: 8px;
  }
  .rd-c-agent { grid-area: agent; }
  .rd-c-status { display: none; }
  .rd-c-runs { grid-area: runs; padding-left: 46px; display: flex; align-items: center; gap: 10px; }
  .rd-c-runs-last { margin-top: 0; }
  .rd-c-act { grid-area: act; }
}

/* ── Run history ────────────────────────────────────────────────────── */
.rd-feed { flex: 1; padding: 0 8px 10px; }
.rd-day {
  position: sticky; top: 0; z-index: 1; padding: 10px 8px 5px; background: var(--rf-card);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-text-3);
}
.rd-run {
  display: flex; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 9px; background: transparent;
  color: inherit; text-align: left; cursor: pointer;
}
.rd-run:hover { background: var(--rf-card-2); }
.rd-run-ic {
  display: flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; color: #fff;
}
.rd-run-ic .rf-ic { width: 12px; height: 12px; stroke-width: 3; }
.rd-run-success { background: var(--rf-ok); }
.rd-run-failed { background: var(--rf-err); }
.rd-run-stopped { background: var(--rf-logic); }
.rd-run-running { background: var(--rf-brand); animation: rd-pulse 1.4s ease-in-out infinite; }
html[data-theme="dark"] .rd-run-ic { color: #0f1923; }
.rd-run-ic.rd-run-test { background: transparent; border: 1.5px dashed; }
html .rd-run-ic.rd-run-test.rd-run-success { color: var(--rf-ok); }
html .rd-run-ic.rd-run-test.rd-run-failed { color: var(--rf-err); }
html .rd-run-ic.rd-run-test.rd-run-stopped { color: var(--rf-logic); }
html .rd-run-ic.rd-run-test.rd-run-running { color: var(--rf-brand); }
.rd-run-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-run-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rd-run-name { flex: 0 1 auto; min-width: 0; font-size: 13px; font-weight: 600; color: var(--rf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-tag {
  flex-shrink: 0; padding: 0 5px; border: 1px solid var(--rf-line); border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; line-height: 16px; text-transform: uppercase; color: var(--rf-text-2);
}
.rd-run-time { flex-shrink: 0; margin-left: auto; font-size: 12px; color: var(--rf-text-3); font-variant-numeric: tabular-nums; }
.rd-run-sub { font-size: 12px; color: var(--rf-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-run-err { color: var(--rf-err); }
.rd-more-runs {
  display: block; margin: 8px auto 4px; padding: 6px 14px; border: 1px solid var(--rf-line); border-radius: 999px;
  background: var(--rf-card); color: var(--rf-text-2); font: 600 12px "Work Sans", sans-serif; cursor: pointer;
}
.rd-more-runs:hover:not([disabled]) { border-color: var(--rf-brand); color: var(--rf-brand); }
.rd-feed-end { padding: 10px 8px 4px; text-align: center; font-size: 12px; color: var(--rf-text-3); }

/* ── Connections ────────────────────────────────────────────────────── */
.rd-conn-list { padding: 6px 8px; max-height: 190px; }
.rd-conn { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 9px; }
.rd-conn-ic { display: flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; }
.rd-ck-email { background: var(--rf-brand-soft); color: var(--rf-brand); }
.rd-ck-slack { background: rgba(224, 30, 90, 0.1); color: #c21a55; }
.rd-ck-teams { background: rgba(80, 89, 201, 0.12); color: #4b53bc; }
.rd-ck-jira { background: rgba(38, 132, 255, 0.12); color: #1868db; }
.rd-ck-webhook { background: rgba(15, 159, 110, 0.12); color: #0b7d57; }
html[data-theme="dark"] .rd-ck-slack { background: rgba(244, 114, 182, 0.14); color: #f49ac1; }
html[data-theme="dark"] .rd-ck-teams { background: rgba(139, 147, 255, 0.16); color: #a5abff; }
html[data-theme="dark"] .rd-ck-jira { background: rgba(106, 165, 255, 0.16); color: #8ab8ff; }
html[data-theme="dark"] .rd-ck-webhook { background: rgba(52, 211, 153, 0.14); color: #5ee0a0; }
.rd-conn-body { flex: 1; min-width: 0; }
.rd-conn-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-conn-kind { font-size: 11.5px; font-weight: 500; color: var(--rf-text-3); }
.rd-conn-meta { font-size: 12px; color: var(--rf-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-warn-text { color: var(--rf-warn); font-weight: 600; }
.rd-conn-use { flex-shrink: 0; text-align: right; font-size: 12px; line-height: 1.5; }
.rd-used { font-size: 12px; }
.rd-conn-add { padding: 10px 14px 14px 16px; border-top: 1px solid var(--rf-line-2); flex-shrink: 0; }
.rd-conn-add-lbl { margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-text-3); }
.rd-conn-add-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rd-conn-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 30px; padding: 0 8px 0 4px; border: 1px solid var(--rf-line);
  border-radius: 999px; background: var(--rf-card); color: var(--rf-text); font: 600 12px "Work Sans", sans-serif; cursor: pointer;
}
.rd-conn-chip:hover { border-color: var(--rf-brand); color: var(--rf-brand); }
.rd-conn-chip-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; }

/* ── States ─────────────────────────────────────────────────────────── */
.rd-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 36px 20px; text-align: center; font-size: 13px; color: var(--rf-text-2); }
.rd-state-err { color: var(--rf-err); }
.rd-state-err > .rf-ic { width: 22px; height: 22px; }
.rd-state-big { flex: 0 0 auto; padding: 48px 20px; }
.rd-state .rd-muted { margin-top: 3px; }

.rd-skel-row,
.rd-skel-run { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rf-line-2); }
.rd-skel-run { padding: 11px 16px; border: 0; }
.rd-skel-row i,
.rd-skel-run i { flex: 0 0 34px; height: 34px; border-radius: 9px; }
.rd-skel-run i { flex-basis: 22px; height: 22px; border-radius: 50%; }
.rd-skel-row span,
.rd-skel-run span { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.rd-skel-row b,
.rd-skel-run b { height: 11px; width: 46%; border-radius: 4px; }
.rd-skel-row em,
.rd-skel-run em { height: 9px; width: 72%; border-radius: 4px; }
.rd-skel-row i, .rd-skel-row b, .rd-skel-row em,
.rd-skel-run i, .rd-skel-run b, .rd-skel-run em,
.rd-kpis-skel span {
  display: block; background: linear-gradient(90deg, var(--rf-line-2) 0%, var(--rf-line) 50%, var(--rf-line-2) 100%);
  background-size: 200% 100%; animation: rd-shimmer 1.3s linear infinite;
}
.rd-kpis-skel { gap: 0; padding: 0; }
.rd-kpis-skel span { height: 86px; margin: 0; background: transparent; animation: none; border-left: 1px solid rgba(255, 255, 255, 0.06); }
@keyframes rd-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes rd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ── First visit ────────────────────────────────────────────────────── */
.rd-hero {
  flex-shrink: 0; padding: 38px 40px 30px; background: var(--rf-card); border: 1px solid var(--rf-line);
  border-radius: 16px; box-shadow: var(--rf-shadow);
}
.rd-hero-main { max-width: 760px; margin: 0 auto; text-align: center; }
.rd-hero-ic {
  display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; margin: 0 auto 14px;
  border-radius: 14px; background: rgba(124, 58, 237, 0.1); color: var(--rf-ai);
}
.rd .rd-hero-ic .rf-ic { width: 26px; height: 26px; }
.rd-hero-title { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.rd-hero-sub { max-width: 600px; margin: 0 auto 20px; font-size: 14px; line-height: 1.55; color: var(--rf-text-2); }
.rd-hero-box {
  display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 14px; text-align: left;
  border: 1px solid var(--rf-line); border-radius: 14px; background: var(--rf-card-2);
}
.rd-hero-box:focus-within { border-color: var(--rf-brand); box-shadow: 0 0 0 3px rgba(67, 105, 244, 0.12); }
.rd-hero-box textarea {
  flex: 1; min-height: 46px; resize: none; border: 0; outline: 0; background: transparent; color: var(--rf-text);
  font: 14px/1.5 "Work Sans", sans-serif;
}
.rd .rd-hero-box textarea:focus-visible { outline: 0; }
.rd-hero-ex { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 12px; }
.rd-ex {
  max-width: 100%; padding: 6px 12px; border: 1px solid var(--rf-line); border-radius: 999px; background: var(--rf-card);
  color: var(--rf-text-2); font: 12px/1.4 "Work Sans", sans-serif; text-align: left; cursor: pointer;
}
.rd-ex:hover { border-color: var(--rf-brand); color: var(--rf-brand); }
.rd-hero-tpl { max-width: 920px; margin: 30px auto 0; }
.rd-hero-or {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-text-3);
}
.rd-hero-or::before,
.rd-hero-or::after { content: ""; flex: 1; height: 1px; background: var(--rf-line-2); }
.rd-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rd-tpl {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--rf-line); border-radius: 11px;
  background: var(--rf-card); color: var(--rf-text); text-align: left; cursor: pointer;
}
.rd-tpl:hover { border-color: var(--rf-brand); background: var(--rf-brand-soft); }
.rd-tpl > .rf-ic { margin-top: 1px; color: var(--rf-brand); }
.rd-tpl b { display: block; font-size: 13px; }
.rd-tpl span span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--rf-text-2); }
.rd-conns-wide { flex-shrink: 0; }
.rd-conns-wide .rd-conn-list { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 24px; }
.rd-conns-wide .rd-conn-add-row { display: flex; flex-wrap: wrap; }
.rd-conns-wide .rd-conn-chip { padding-right: 14px; }
.rd-grid-skel { grid-template-rows: minmax(0, 1fr); grid-template-areas: "agents runs"; }

/* ── Menus ──────────────────────────────────────────────────────────── */
.rd-pop {
  position: fixed; z-index: 10001; min-width: 210px; max-width: 330px; max-height: 70vh; overflow-y: auto; padding: 6px;
  background: var(--rf-card); border: 1px solid var(--rf-line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(1, 1, 44, 0.18); font-family: "Work Sans", sans-serif; color: var(--rf-text);
}
html[data-theme="dark"] .rd-pop { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); }
.rd-pop-hdr { padding: 8px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-text-3); }
.rd-pop-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--rf-text); font-size: 13px; text-align: left; cursor: pointer;
}
.rd-pop-item:hover,
.rd-pop-item:focus-visible { background: var(--rf-brand-soft); outline: 0; }
.rd-pop-item > .rf-ic { margin-top: 1px; color: var(--rf-brand); }
.rd-pop-item b { display: block; font-weight: 600; }
.rd-pop-item span span { display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; color: var(--rf-text-2); }
.rd-pop-simple { align-items: center; }
.rd-pop-danger,
.rd-pop-danger > .rf-ic { color: var(--rf-err); }
.rd-pop-danger:hover { background: var(--rf-err-bg); }
.rd-pop-sep { height: 1px; margin: 4px 6px; background: var(--rf-line-2); }

/* ── "‹ Workflow Agents / …" on the agent pages (navy headers) ──────── */
.rd-crumb { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font: 500 12px "Work Sans", sans-serif; }
.rd-crumb-home {
  display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 12px "Work Sans", sans-serif; color: #a8bfff;
}
.rd-crumb-home:hover { color: #fff; text-decoration: underline; }
.rd-crumb-home:focus-visible { outline: 2px solid #8ea8ff; outline-offset: 2px; border-radius: 3px; }
.rd-crumb-sep { color: rgba(247, 245, 240, 0.3); }
.rd-crumb-here { color: rgba(247, 245, 240, 0.6); }
.rd-crumb .rd-ic-xs { width: 13px; height: 13px; }

/* ── Smaller screens: one column, the page scrolls ───────────────────── */
@container rd (max-width: 900px) {
  .rd-grid { flex: none; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "agents" "runs" "conns"; }
  .rd-agents .rd-tbody { overflow: visible; }
  .rd-runs { max-height: 560px; }
  .rd-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rd-kpi { grid-column: span 2; }
  .rd-kpi:nth-child(n + 4) { grid-column: span 3; border-top: 1px solid rgba(255, 255, 255, 0.07); }
  .rd-kpi:nth-child(4)::before { display: none; }
}
@container rd (max-width: 640px) {
  .rd-head { flex-direction: column; align-items: stretch; }
  .rd-head-r { flex-wrap: wrap; }
  .rd-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rd-kpi,
  .rd-kpi:nth-child(n + 4) { grid-column: span 1; }
  .rd-kpi::before { display: none; }
  .rd-search { width: 100%; }
}
/* Shorter screens: a tighter header, KPI band and connections list, so the
   run history keeps room. */
@media (max-height: 880px) {
  .rd { gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .rd-subtitle { display: none; }
  .rd-head { align-items: center; }
  .rd-kpi { padding-top: 10px; padding-bottom: 10px; }
  .rd-kpi-row { height: 32px; }
  .rd-kpi-val { font-size: 26px; }
  .rd-kpi-next .rd-kpi-val { font-size: 24px; }
  .rd-conn { padding: 6px 8px; }
  .rd-conn-list { max-height: 168px; }
  .rd-conn-use .rd-muted { display: none; }
  .rd-conn-add { padding-top: 8px; padding-bottom: 10px; }
  .rd-conn-add-lbl { display: none; }
}
@media (max-height: 720px) {
  .rd-grid { flex: none; min-height: 0; grid-template-rows: 560px auto; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-card.rd-flash,
  .rd-dot-running,
  .rd-run-running,
  .rd-skel-row i, .rd-skel-row b, .rd-skel-row em,
  .rd-skel-run i, .rd-skel-run b, .rd-skel-run em { animation: none; }
}

/* Agent library — its own screen (libraryHtml) */
.rd-lib-crumb { margin-bottom: 10px; }
.rd-lib-sec { margin-top: 22px; }
.rd-lib-hdr { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--rf-text-3); margin-bottom: 10px; }
.rd-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rd-lib-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px;
  min-height: 180px; border: 1px solid var(--rf-line); border-radius: 14px; background: var(--rf-card); color: var(--rf-text);
  box-shadow: var(--rf-shadow); cursor: pointer; font-family: "Work Sans", sans-serif; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.rd-lib-card:hover, .rd-lib-card:focus-visible { border-color: var(--rf-brand); box-shadow: 0 6px 18px rgba(67, 105, 244, 0.14); transform: translateY(-1px); outline: none; }
.rd-lib-ic { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--rf-brand-soft); color: var(--rf-brand); margin-bottom: 4px; }
.rd-lib-ic-ren { background: rgba(124, 58, 237, 0.1); color: var(--rf-ai); }
.rd-lib-title { font-size: 14px; font-weight: 700; }
.rd-lib-tag { font-size: 11px; font-weight: 600; color: var(--rf-text-3); }
.rd-lib-desc { font-size: 12.5px; line-height: 1.45; color: var(--rf-text-2); flex: 1; }
.rd-lib-cta { font-size: 12px; font-weight: 600; color: var(--rf-brand); margin-top: 4px; }
/* On the library the crumb sits on the page, not on the navy agent header. */
.rd-lib-crumb .rd-crumb-home { color: var(--rf-brand); }
.rd-lib-crumb .rd-crumb-sep { color: var(--rf-text-3); }
.rd-lib-crumb .rd-crumb-here { color: var(--rf-text-2); }
.rd-lib-crumb .rd-crumb-home:hover { color: var(--rf-brand); }

/* The agents' on/off switch — index.html's .wf-toggle-sw, coloured for the dashboard. */
.rd-switch { margin-right: 6px; vertical-align: middle; }
.rd-switch .wf-toggle-slider { background: #d6d9e0; }
.rd-switch .wf-toggle-slider::before { background: #fff; box-shadow: 0 1px 2px rgba(1, 1, 44, 0.2); }
.rd-switch .wf-toggle-input:checked + .wf-toggle-slider { background: #22c55e; }
.rd-switch .wf-toggle-input:disabled + .wf-toggle-slider { opacity: 0.45; cursor: not-allowed; }
.rd-switch .wf-toggle-input:focus-visible + .wf-toggle-slider { outline: 2px solid var(--rf-brand); outline-offset: 2px; }
html[data-theme="dark"] .rd-switch .wf-toggle-slider { background: rgba(247, 245, 240, 0.18); }
html[data-theme="dark"] .rd-switch .wf-toggle-input:checked + .wf-toggle-slider { background: #22c55e; }

/* ── Governance: runs the agent policy blocked or held, and the Agent policy screen
   (static/js/agent-policy.js) ─────────────────────────────────────────── */
.rd-dot-blocked { background: var(--rf-err); color: var(--rf-err); }
.rd-dot-awaiting_approval { background: var(--rf-warn); color: var(--rf-warn); }
.rd-dot-rejected { background: var(--rf-text-3); color: var(--rf-text-3); }
.rd-last-blocked { color: var(--rf-err); }
.rd-last-awaiting_approval { color: var(--rf-warn); }
.rd-last-rejected { color: var(--rf-text-3); }
.rd-run-blocked { background: var(--rf-err); }
.rd-run-awaiting_approval { background: var(--rf-warn); }
.rd-run-rejected { background: var(--rf-text-3); }
.rd-run-wait { color: var(--rf-warn); font-weight: 600; }

/* Waiting for approval, above the agents */
.rd-appr { flex-shrink: 0; border-color: rgba(180, 83, 9, 0.35); }
.rd-appr .rd-card-hdr { min-height: 0; }
.rd-appr .rd-card-title > .rf-ic { color: var(--rf-warn); }
.rd-appr-sub { font-size: 12px; }
.rd-appr-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.rd-appr-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--rf-line-2); }
.rd-appr-row:first-child { border-top: 0; }
.rd-appr-ic {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--rf-warn-bg); color: var(--rf-warn);
}
.rd-appr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-appr-top { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-appr-why { font-size: 12px; color: var(--rf-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-appr-meta { font-size: 11.5px; color: var(--rf-text-3); }

/* Agent policy screen */
.rp-status {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 13px; flex-shrink: 0;
  background: var(--rf-brand-soft); border: 1px solid rgba(67, 105, 244, 0.25);
}
.rp-status > .rf-ic { color: var(--rf-brand); margin-top: 1px; }
.rp-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) clamp(280px, 30%, 380px); align-items: start; }
.rp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rp-main .rd-card-hdr { min-height: 0; }
.rp-strict { font-size: 12px; }
.rp-new { width: 28px; padding: 0; justify-content: center; }
.rp-rules { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.rp-pad { padding: 12px 16px 14px; }
.rp-rule { border: 1px solid var(--rf-line); border-radius: 10px; padding: 12px 14px; background: var(--rf-card); display: flex; flex-direction: column; gap: 6px; }
.rp-rule-edit { background: var(--rf-card-2); gap: 10px; }
.rp-rule-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.rp-rule-top .rp-rule-title { flex-basis: 160px; }
.rp-rule-edit .rp-rule-top { flex-wrap: nowrap; }
.rp-rule-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.rp-id { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--rf-text-3); white-space: nowrap; }
.rp-rule-line { font-size: 12.5px; color: var(--rf-text-2); line-height: 1.5; }
.rp-rule-line b { color: var(--rf-text); font-weight: 600; }
.rp-k { display: inline-block; min-width: 92px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rf-text-3); }
.rp-eff {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.rp-eff-allow { background: var(--rf-ok-bg); color: var(--rf-ok); border-color: rgba(22, 163, 74, 0.3); }
.rp-eff-require_approval { background: var(--rf-warn-bg); color: var(--rf-warn); border-color: rgba(180, 83, 9, 0.35); }
.rp-eff-deny { background: var(--rf-err-bg); color: var(--rf-err); border-color: rgba(220, 38, 38, 0.3); }

.rp-field { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: start; gap: 4px 10px; }
.rp-field > .rp-k { padding-top: 7px; }
.rp-field > .rp-hint, .rp-field > .rp-check { grid-column: 2; }
.rp-hint { font-size: 11.5px; color: var(--rf-text-3); line-height: 1.45; }
.rp-in, .rp-rule-edit select, .rp-def select {
  font: 12.5px "Work Sans", sans-serif; padding: 6px 8px; min-width: 0; border: 1px solid var(--rf-line); border-radius: 7px;
  background: var(--rf-card); color: var(--rf-text);
}
.rp-in { width: 100%; }
.rp-in:focus, .rp-rule-edit select:focus, .rp-def select:focus { outline: none; border-color: var(--rf-brand); }
.rp-in-title { font-weight: 600; font-size: 13px; }
.rp-in-id { max-width: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.rp-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--rf-card); border: 1px solid var(--rf-line); border-radius: 8px; justify-self: start; }
.rp-seg-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--rf-text-2); font: 600 12px "Work Sans", sans-serif;
}
.rp-seg-btn.on.rp-seg-allow { background: var(--rf-ok-bg); color: var(--rf-ok); }
.rp-seg-btn.on.rp-seg-require_approval { background: var(--rf-warn-bg); color: var(--rf-warn); }
.rp-seg-btn.on.rp-seg-deny { background: var(--rf-err-bg); color: var(--rf-err); }
.rp-chips { display: flex; flex-direction: column; gap: 6px; }
.rp-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.rp-chiplbl { width: 56px; font-size: 11px; font-weight: 600; color: var(--rf-text-3); }
.rp-chip {
  padding: 3px 9px; border: 1px solid var(--rf-line); border-radius: 999px; background: var(--rf-card); color: var(--rf-text-2);
  font: 500 12px "Work Sans", sans-serif; cursor: pointer;
}
.rp-chip:hover:not([disabled]) { border-color: var(--rf-brand); color: var(--rf-brand); }
.rp-chip.on { background: var(--rf-brand-soft); border-color: var(--rf-brand); color: var(--rf-brand); font-weight: 600; }
.rp-chip[disabled] { opacity: 0.45; cursor: default; }
.rp-conds { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rp-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.rp-cond .rp-in { flex: 1 1 140px; width: auto; }
.rp-cond .rp-in-arg { flex: 0 1 140px; }
.rp-cond select { max-width: 100%; }
.rp-x {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--rf-text-3); cursor: pointer;
}
.rp-x:hover { background: var(--rf-err-bg); color: var(--rf-err); }
.rp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rf-text-2); }
.rp-add-cond { font-size: 12px; }
.rp-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 4px 2px; font-size: 12px; }
.rp-savebar { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--rf-line-2); }

.rp-def { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px solid var(--rf-line-2); }
.rp-def:last-of-type { border-bottom: 0; }
.rp-side .rp-hint { margin-top: 8px; }
.rp-domains { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-domains span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--rf-line-2); }
.rp-hist { max-height: 220px; padding: 6px 8px; }
.rp-ver { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; font-size: 12px; color: var(--rf-text-2); }
.rp-ver > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rp-ver-n { flex-shrink: 0; min-width: 30px; font-weight: 700; color: var(--rf-text-3); font-variant-numeric: tabular-nums; }
.rp-ver-n.on { color: var(--rf-brand); }
.rp-verify { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 600; }
.rp-verify-ok { color: var(--rf-ok); }
.rp-verify-bad { color: var(--rf-err); }

@container rd (max-width: 900px) {
  .rp-grid { grid-template-columns: minmax(0, 1fr); }
}
@container rd (max-width: 640px) {
  .rp-field { grid-template-columns: minmax(0, 1fr); }
  .rp-field > .rp-hint, .rp-field > .rp-check { grid-column: 1; }
  .rp-field > .rp-k { padding-top: 0; }
  .rp-rule-top { flex-wrap: wrap; }
  .rp-savebar { flex-direction: column; }
  .rd-appr-row { flex-wrap: wrap; }
}
