/* connect dashboard, served at /dashboard.css. The core block is shared with
   rail and depot; connect's own rules follow it (ADR 0024). */

/* tint: the only per-app values */
:root {
  --accent: #3b82f6;
  --accent-light: #93c5fd;
  --accent-hover: #60a5fa;
  --accent-dim: rgba(59, 130, 246, 0.16);
}

/* core:start -- shared by rail, depot and connect. Byte-identical in all
   three; a test pins its hash. Change it in every repo or in none. The four
   --accent tokens above this block are the only per-app values. */

:root {
  --bg: #0f172a;
  --card: rgba(31, 41, 55, 0.5);
  --well: rgba(15, 23, 42, 0.6);
  --border: #374151;
  --border-strong: #4b5563;
  --rule: rgba(55, 65, 81, 0.6);
  --row-rule: rgba(55, 65, 81, 0.45);
  --text: #e2e8f0;
  --body: #d1d5db;
  --muted: #9ca3af;
  --dim: #828a99;
  --indigo: #4f46e5;
  --ok: #34d399;
  --ok-bg: rgba(5, 150, 105, 0.16);
  --ok-border: rgba(5, 150, 105, 0.38);
  --warn: #fbbf24;
  --warn-bg: rgba(217, 119, 6, 0.16);
  --warn-border: rgba(217, 119, 6, 0.45);
  --bad: #fb7185;
  --bad-bg: rgba(225, 29, 72, 0.16);
  --bad-border: rgba(225, 29, 72, 0.45);
  --neutral: #94a3b8;
  --neutral-bg: rgba(100, 116, 139, 0.16);
  --neutral-border: rgba(100, 116, 139, 0.38);
  --info: #a5b4fc;
  --info-bg: rgba(79, 70, 229, 0.18);
  --info-border: rgba(79, 70, 229, 0.38);
  --series: #64748b;
  --series-hi: #94a3b8;
  --series-err: #f43f5e;
  --grid: #263043;
  --tip: #1f2937;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, pre { margin: 0; }
a { color: var(--accent-light); text-decoration: none; }
a:hover { color: #ffffff; }
svg { display: block; }
form { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 12px; }
.hidden { display: none !important; }
.right { text-align: right; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* Identity bar */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--rule);
}
.brand-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { color: inherit; }
.mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--indigo);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-name { display: flex; align-items: baseline; gap: 8px; font-size: 18px; font-weight: 600; color: #ffffff; }
.brand-name .sep { color: var(--muted); }
.brand-name .accent { color: var(--accent-light); }
.chip {
  margin-left: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-light);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill-age { font-size: 11px; color: var(--muted); }
.pill.warn { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn); }
.pill.bad { border-color: var(--bad-border); background: var(--bad-bg); color: var(--bad); }
.session { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.session form { display: inline; }
.session select {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: #ffffff;
}
.role {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Buttons. The transparent border keeps a filled button the same height as
   an outlined one. Text on the accent is the page ground, for contrast. */
.btn-ghost, .btn-accent, .btn-danger {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-ghost { background: none; border-color: var(--border-strong); color: #ffffff; }
.btn-ghost:hover { border-color: var(--muted); color: #ffffff; }
.btn-accent { background: var(--accent); color: var(--bg); font-weight: 600; }
.btn-accent:hover { background: var(--accent-hover); color: var(--bg); }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger { background: none; border-color: var(--bad-border); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-small { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 9px 16px; font-size: 14px; }
.link-danger, .link-action { font: inherit; font-size: 13px; background: none; border: none; padding: 0; cursor: pointer; }
.link-danger { color: var(--bad); }
.link-action { color: var(--accent-light); }
.link-danger:hover, .link-action:hover { color: #ffffff; }

/* Navigation: the working pages, then a subordinate row. */
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 44px;
  padding: 0 32px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
}
.nav a {
  font-size: 14px;
  color: var(--body);
  height: 43px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: #ffffff; }
.nav a.active { color: #ffffff; border-bottom-color: var(--accent-light); }
.subnav {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 38px;
  padding: 0 32px;
  background: var(--well);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
}
.subnav-group { display: flex; align-items: center; gap: 10px; }
.subnav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.09em; color: var(--muted); text-transform: uppercase; }
.subnav a { font-size: 13px; color: var(--body); white-space: nowrap; }
.subnav a:hover, .subnav a.active { color: #ffffff; }
.subnav a.active { font-weight: 600; text-decoration: underline 2px var(--accent-light); text-underline-offset: 6px; }

/* Tabs inside a page */
.page-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; overflow-x: auto; }
.page-tabs a { font-size: 14px; color: var(--body); height: 40px; display: flex; align-items: center; border-bottom: 2px solid transparent; white-space: nowrap; }
.page-tabs a:hover { color: #ffffff; }
.page-tabs a.active { color: #ffffff; border-bottom-color: var(--accent-light); }
.page-tabs .count { margin-left: 6px; color: var(--muted); font-size: 12px; }

/* Content */
.content { flex: 1; width: 100%; max-width: 1152px; margin: 0 auto; padding: 32px; }
.page-title { font-size: 24px; font-weight: 700; color: #ffffff; margin-bottom: 20px; }
.page-title.mono { font-size: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.page-head .page-title { margin-bottom: 0; }
.lede { font-size: 13px; color: var(--muted); margin: -12px 0 20px; max-width: 780px; line-height: 1.5; }
.legend { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0 0 22px; max-width: 780px; }
.breadcrumb { font-size: 13px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 14px; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { font-size: 16px; font-weight: 600; color: #ffffff; }
.section-title a { font-size: 14px; }
.section-title .note { font-size: 12px; color: var(--dim); }

/* Health strip: the conditions that fail silently. Each tile states the
   reading and its age, so a check that froze cannot read as a passing one. */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 28px; }
.health-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.health-tile .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); flex-shrink: 0; }
.health-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.health-label { font-size: 13px; font-weight: 600; color: #ffffff; }
.health-detail { font-size: 12.5px; color: var(--muted); }
.health-tile.warn { border-color: var(--warn-border); background: rgba(217, 119, 6, 0.10); }
.health-tile.warn .dot { background: var(--warn); }
.health-tile.warn .health-detail { color: var(--warn); }
.health-tile.bad { border-color: var(--bad-border); background: rgba(225, 29, 72, 0.10); }
.health-tile.bad .dot { background: var(--bad); }
.health-tile.bad .health-detail { color: var(--bad); }

/* Tiles. The text stacks; an optional mark sits to its right. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.tile {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.tile-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.tile-value { font-size: 22px; font-weight: 600; color: #ffffff; overflow-wrap: anywhere; }
.tile-note, .tile-delta { font-size: 12px; color: var(--muted); }
.tile-delta.ok { color: var(--ok); }
.tile-delta.bad { color: var(--bad); }

/* Chart: small multiples on one time axis. Text wears text tokens; only
   the marks carry the series color. */
.chart {
  position: relative;
  padding: 16px 16px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 28px;
}
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.chart-title { display: flex; align-items: baseline; gap: 10px; }
.chart-title b { font-size: 15px; font-weight: 600; color: #ffffff; }
.chart-title span { font-size: 12px; color: var(--muted); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .panel-title { font-size: 12px; font-weight: 600; fill: var(--text); }
.chart .peak { font-size: 11px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--series); }
.chart .bar.hi { fill: var(--series-hi); }
.chart .bar.err { fill: var(--series-err); }
.chart .bar.err.hi { fill: var(--bad); }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; opacity: 0.7; }
.chart-tip {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  background: var(--tip);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  min-width: 150px;
}
.chart-tip .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.chart-tip .key { width: 12px; height: 2px; border-radius: 1px; background: var(--series); flex-shrink: 0; }
.chart-tip .key.err { background: var(--series-err); }
.chart-tip b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart details { margin-top: 6px; }
.chart summary { font-size: 13px; color: var(--accent-light); cursor: pointer; list-style: none; width: max-content; }
.chart summary:hover { color: #ffffff; }
.chart details table { margin-top: 8px; }
.chart details td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Tables. Console 13, dense on purpose. */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.table-wrap + .table-wrap { margin-top: 28px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 11px 16px;
  background: var(--well);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 11px 16px; border-bottom: 1px solid var(--row-rule); color: var(--body); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.mono { font-size: 12.5px; }
td.name { color: var(--text); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
td.wrap { white-space: normal; max-width: 420px; }
td.empty { color: var(--dim); text-align: center; padding: 40px 16px; white-space: normal; }
td.actions { text-align: right; }
td.actions form { display: inline; margin-left: 12px; }
.table-title { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; color: #ffffff; }
.chart .table-wrap { border: none; background: none; border-radius: 0; }
.chart th { background: none; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Status badges: the one place color carries meaning in the console. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--neutral-border);
  background: var(--neutral-bg);
  color: var(--neutral);
  font-size: 12px;
  font-weight: 500;
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge.ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.badge.pending, .badge.warn { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn); }
.badge.bad { border-color: var(--bad-border); background: var(--bad-bg); color: var(--bad); }
.badge.accent { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-light); }
.badge.info { border-color: var(--info-border); background: var(--info-bg); color: var(--info); }

/* Pagination */
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; font-size: 13px; color: var(--muted); }
.pager-links { display: flex; gap: 8px; }
.pager-links a, .pager-links .disabled { padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; color: #ffffff; }
.pager-links a:hover { border-color: var(--muted); }
.pager-links .disabled { border-color: var(--border); color: var(--border-strong); }

/* Cards and detail grids */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.card h2 { font-size: 16px; font-weight: 600; color: #ffffff; margin-bottom: 18px; }
.card.narrow { max-width: 520px; }
.card + .card { margin-top: 16px; }
.detail dl { display: grid; grid-template-columns: 160px 1fr; gap: 12px 24px; font-size: 14px; }
.detail dt { color: var(--muted); }
.detail dd { color: var(--body); overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 24px; }
.fact-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.fact-value { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field, .fields > * + * { margin-top: 16px; }
.field label, .field .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field .req { color: var(--bad); }
.field input, .field select, .field textarea, .filters input, .filters select {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.field textarea { font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field .help { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 .field + .field { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.filters .field + .field { margin-top: 0; }
.filters label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.filters input, .filters select { width: auto; max-width: 100%; min-width: 0; padding: 7px 12px; font-size: 13px; }

/* Notices */
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); font-size: 14px; color: var(--text); margin-bottom: 16px; }
.notice.bad { border-color: var(--bad-border); background: rgba(225, 29, 72, 0.12); }
.notice.ok { border-color: var(--ok-border); background: rgba(5, 150, 105, 0.12); }
.notice.warn { border-color: var(--warn-border); background: rgba(217, 119, 6, 0.12); }
.notice code {
  flex: 1;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  user-select: all;
  overflow-wrap: anywhere;
  white-space: normal;
}
code.inline { padding: 1px 5px; background: var(--well); border-radius: 4px; font-size: 12.5px; color: var(--text); }

/* Login and the other single-card pages */
.content.login { display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 19px; font-weight: 700; color: #ffffff; margin-bottom: 6px; }
.login-card p { font-size: 13px; line-height: 1.5; color: var(--muted); margin-bottom: 20px; }
.login-card .field + .btn-accent, .login-card .field + .btn-block { margin-top: 16px; }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 32px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.footer .mono { font-size: 13px; }

/* Phone */
@media (max-width: 640px) {
  .bar, .nav, .subnav, .footer { padding-left: 20px; padding-right: 20px; }
  .content { padding: 20px; }
  .chip, .pill { display: none; }
  .session .mono, .session .role { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .detail dl { grid-template-columns: 1fr; gap: 4px 0; }
  .detail dt { margin-top: 10px; }
}

/* core:end */

/* connect-specific rules, below the core */
.version { margin-left: 6px; font-size: 11px; color: var(--dim); }
.score-ok { color: var(--ok); }
.score-warn { color: var(--warn); }
.score-bad { color: var(--bad); }

/* Attempt and block rows: one card per row, status first. */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row-card { padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.row-card.bad { border-color: rgba(225, 29, 72, 0.35); }
.row-head { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.row-head .name { font-weight: 600; color: var(--text); }
.row-head .when { margin-left: auto; font-size: 12px; color: var(--dim); }
.row-head .reason { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-error { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(225, 29, 72, 0.10); border: 1px solid rgba(225, 29, 72, 0.25); font-size: 12.5px; color: var(--muted); }
.row-error b { color: var(--bad); font-weight: 500; }

/* Version list */
.versions { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.versions a { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 13px; color: var(--body); border-bottom: 1px solid rgba(55, 65, 81, 0.45); }
.versions a:last-child { border-bottom: none; }
.versions a:hover { background: var(--well); color: #ffffff; }
.versions .current { margin-left: 8px; font-size: 11px; color: var(--ok); }
.body-card { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.body-card + .body-card { margin-top: 16px; }
.body-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--well); font-size: 13px; font-weight: 600; color: var(--text); }
.body-head .when { font-size: 11px; font-weight: 400; color: var(--muted); }
.body-content { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.body-content pre { white-space: pre-wrap; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; line-height: 1.5; color: var(--text); }

/* Tabs on the template editor */
.tabs { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.tab-bar { display: flex; border-bottom: 1px solid var(--border); background: var(--well); overflow-x: auto; }
.tab-bar button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
}
.tab-bar button:hover { color: #ffffff; }
.tab-bar button.active { color: #ffffff; border-bottom-color: var(--accent-light); }
.tab-panel { padding: 20px; }
.status-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.placeholders { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.placeholders .ph { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--well); font-family: var(--mono); font-size: 12px; color: var(--text); }
.placeholders .ph .req { font-family: "Inter", sans-serif; font-size: 10px; color: var(--ok); }
.placeholders .ph .def { font-family: "Inter", sans-serif; font-size: 10px; color: var(--warn); }

/* Workflow editor: the pipeline on the left, the pool on the right. */
.workflow { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; margin-top: 8px; }
.wf-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
#pool { gap: 8px; }
.wf-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 12px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.wf-card.bad { border-color: var(--bad-border); }
.wf-card.warn { border-color: var(--warn-border); }
#pool .wf-card { border: 1px dashed var(--border-strong); background: none; }
#pipeline .wf-in-pool, #pool .wf-in-pipeline, #pool .wf-note { display: none; }
.wf-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.wf-row .drag-handle { display: flex; color: var(--dim); cursor: grab; }
.wf-row .drag-handle svg { width: 16px; height: 16px; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; background: var(--accent-dim); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--accent-light); font-size: 11px; font-weight: 600; }
.wf-name { font-size: 14px; font-weight: 600; color: var(--text); }
#pool .wf-name { font-weight: 500; color: var(--body); }
.wf-row .btn-small { margin-left: auto; }
.wf-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.wf-timeout { display: flex; align-items: center; gap: 8px; margin-right: 8px; font-size: 12px; color: var(--muted); }
.wf-timeout select { padding: 5px 8px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; background: none; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--body); cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent-light); color: #ffffff; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 14px; height: 14px; }
.wf-note { padding-left: 62px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.wf-note.bad { color: var(--bad); }
.wf-note.warn { color: var(--warn); }
.wf-then { display: flex; align-items: center; gap: 8px; padding: 8px 0 8px 18px; font-size: 12px; color: var(--muted); }
.wf-then svg { width: 12px; height: 12px; flex-shrink: 0; }
.terminal { padding: 12px 16px; border: 1px dashed var(--bad-border); border-radius: 12px; background: rgba(225, 29, 72, 0.06); text-align: center; font-size: 13px; color: var(--bad); }
.ghost { opacity: 0.3; }

/* Login and the other single-card pages */
.login-card .providers { display: flex; flex-direction: column; gap: 10px; }
.login-card .providers a { width: 100%; }
.login-card .providers svg { width: 16px; height: 16px; }
.login-card .divider { margin: 20px 0 14px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); text-align: center; }
.login-card .foot { margin-top: 20px; margin-bottom: 0; font-size: 13px; text-align: center; }
.login-card .icon { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-dim); display: flex; align-items: center; justify-content: center; color: var(--accent-light); }
.login-card .icon svg { width: 22px; height: 22px; }
.login-card.center { text-align: center; }

/* Phone */
@media (max-width: 640px) {
  .workflow { grid-template-columns: 1fr; }
}

/* Template editor: compose and review within the existing dashboard shell. */
.template-page-head .lede { margin: 8px 0 0; }
.template-page-head .page-title { overflow-wrap: anywhere; }
.template-workspace .tab-bar { flex-wrap: wrap; }
.template-workspace .channel-tab { display: flex; align-items: center; gap: 8px; }
.template-channel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 32px; font-size: 13px; }
.template-enable { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.template-enable input { accent-color: var(--accent); }
.template-compose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.template-compose > .field { margin-top: 0; }
.template-compose .label, .template-compose label { line-height: 20px; }
.template-compose textarea, .template-preview { height: 280px; min-height: 280px; }
.template-channel-settings { margin-bottom: 32px; }
.template-channel-settings.grid-2 { gap: 32px; }
#template-form .field input, #template-form .field select { height: 40px; box-sizing: border-box; }
#template-form .field select { appearance: menulist-button; }
#description { font-family: inherit; font-size: 14px; }
.template-preview-values { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.template-preview-values > summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.template-preview-values > .help { margin: 16px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.template-variable-help { margin-top: 8px; color: var(--muted); font-size: 13px; }
.template-variable-help > summary { cursor: pointer; }
.template-variable-help .help { margin-top: 12px; }
[data-preview-note]:empty { display: none; }
.template-status-actions { display: flex; gap: 12px; margin-bottom: 16px; }
.template-status-actions:has(> .hidden):not(:has(> :not(.hidden))) { display: none; }
.template-preview { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; overflow: auto; }
.template-preview-subject { padding: 16px 20px 0; font-weight: 600; overflow-wrap: anywhere; }
.template-preview-body { padding: 20px; min-height: 200px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: 14px; }
.template-preview-body > * + * { margin-top: 12px; }
.template-samples { display: grid; grid-template-columns: 1fr; gap: 16px; font-size: 14px; color: var(--muted); }
.template-samples .field { display: grid; grid-template-columns: minmax(100px, 180px) minmax(0, 1fr); align-items: center; gap: 16px; }
.template-samples .field label { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.template-samples.fields > * + * { margin-top: 0; }
.template-provider-details { margin-top: 24px; font-size: 13px; color: var(--muted); }
.template-provider-details summary, .template-history summary { cursor: pointer; padding: 12px 0; }
.template-provider-details dl { margin-top: 12px; }
.template-save-bar, .save-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding: 16px 20px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg); }
.template-save-bar > span, .save-bar > span { font-size: 13px; color: var(--muted); }
.save-bar.dirty { border-color: var(--warn-border); }
.save-bar.dirty > span { color: var(--warn); }
.save-actions { display: flex; gap: 12px; }
.save-actions .btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.template-history { margin-top: 24px; border-top: 1px solid var(--border); }
@media (max-width: 850px) { .template-compose { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .template-samples .field { grid-template-columns: minmax(90px, 30%) minmax(0, 1fr); } .template-save-bar, .save-bar { flex-direction: column; align-items: stretch; } }

.template-language-picker { position: relative; }
.template-language-options { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 4; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); box-shadow: 0 12px 28px rgba(0, 0, 0, .3); }
.template-language-options > div { padding: 10px 12px; border-radius: 4px; font-size: 14px; }
.template-language-options [role="option"] { cursor: pointer; }
.template-language-options [role="option"]:hover, .template-language-options .active { background: var(--accent-dim); }
.template-language-options [aria-selected="true"] { color: var(--accent); font-weight: 600; }

/* Overview (ADR 0027) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.range { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.range a { padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--body); }
.range a + a { border-left: 1px solid var(--border-strong); }
.range a:hover { color: #ffffff; }
.range a[aria-current="page"] { background: var(--accent-dim); color: #ffffff; font-weight: 600; }
a.health-tile, a.health-tile:hover { color: inherit; }
a.health-tile:hover { border-color: var(--border-strong); }
.list-card { margin-bottom: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.list-card .table-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.list-card .table-title .note { font-size: 12px; font-weight: 400; color: var(--muted); }
.list-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px; }
.list-row + .list-row { border-top: 1px solid var(--row-rule); }
.list-row > .badge { flex-shrink: 0; min-width: 92px; justify-content: center; }
.list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list-text b { font-size: 14px; font-weight: 600; color: var(--text); }
.list-text > span { font-size: 13px; line-height: 1.5; color: var(--muted); }
.list-text pre { margin-top: 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist .list-row { padding: 18px 24px; }
.check-mark { width: 28px; height: 28px; flex-shrink: 0; border: 1px solid var(--border-strong); border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text); }
.check-mark svg { width: 14px; height: 14px; }
.done .check-mark { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.done .list-text b { color: var(--muted); }
figure.chart { margin: 0 0 28px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--series); }
.chart-legend i.err { background: var(--series-err); }
.chart-caption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.table-wrap + .legend { margin-top: 10px; }
.error-text { color: var(--bad); }
@media (max-width: 640px) { .list-row { flex-wrap: wrap; } }

/* Message list (ADR 0027) */
.filters .filter-search { flex: 1 1 280px; }
.filters .filter-search input { width: 100%; }
.filters .filter-clear { align-self: center; font-size: 13px; }
td.stack > * { display: block; }
td.stack > .badge { display: inline-flex; }
td .sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
td .sub.error-text { color: var(--bad); }

/* Message detail (ADR 0027) */
.detail-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.detail-head .page-title { margin-bottom: 0; }
.detail-head + .lede { margin: 8px 0 20px; }
.copy-row { display: flex; align-items: center; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 14px; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 12px; height: 12px; margin-top: 16px; flex-shrink: 0; border: 2px solid var(--neutral); border-radius: 999px; background: var(--bg); }
.timeline-dot.ok { border-color: var(--ok); background: var(--ok); }
.timeline-dot.warn { border-color: var(--warn); }
.timeline-dot.bad { border-color: var(--bad); }
.timeline-dot.info { border-color: var(--info); }
.timeline-line { flex: 1; width: 2px; margin-top: 4px; background: var(--border); }
.timeline > li:last-child .timeline-line { display: none; }
.timeline .row-card { margin-bottom: 12px; }
.timeline-detail { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.timeline-end { margin-left: 42px; }
.sent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.sent-grid .body-card + .body-card { margin-top: 0; }
.data-list { display: grid; grid-template-columns: minmax(100px, max-content) minmax(0, 1fr); gap: 10px 20px; font-family: var(--mono); font-size: 12.5px; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* Channels (ADR 0027) */
.channel-list { display: flex; flex-direction: column; gap: 12px; }
.channel-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); scroll-margin-top: 16px; }
.channel-card.bad { border-color: var(--bad-border); }
.channel-card.warn { border-color: var(--warn-border); }
.channel-card.open { border-color: var(--accent); }
.channel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.channel-head h3 { font-size: 15px; font-weight: 600; color: #ffffff; }
.channel-summary { font-size: 13px; color: var(--muted); }
.channel-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.channel-actions form { display: inline; }
.channel-card .facts { margin-top: 16px; }
.channel-card dd { margin: 0; }
.fact-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.channel-card .notice { margin: 16px 0 0; font-size: 13px; line-height: 1.5; }
.setup-steps { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 20px; padding-left: 20px; font-size: 13px; line-height: 1.5; color: var(--body); }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.setup-grid .field + .field { margin-top: 0; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.input-row input[readonly] { background: var(--well); }
