/* WarnFlux admin UI — dark theme. Fonts (Inter, JetBrains Mono, SIL OFL)
   and everything else are embedded; no CDN, fully offline. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --canvas: #0d1117;
  --surface: #161b22;
  --surface-hi: #1c2129;
  --border: #30363d;
  --border-hi: #3d444d;
  --text: #c9d1d9;
  --muted: #8b949e;
  --link: #58a6ff;
  --ok: #3fb950;
  --ok-bg: rgba(63, 185, 80, 0.15);
  --warn: #d29922;
  --warn-bg: rgba(210, 153, 34, 0.18);
  --bad: #f85149;
  --bad-bg: rgba(248, 81, 73, 0.15);
  --muted-bg: rgba(139, 148, 158, 0.15);
  --btn-primary: #238636;
  --btn-primary-hi: #2ea043;
  --header: #010409;
  --tab-active: #f78166;
  --sidebar-w: 220px;
  --radius: 6px;
  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
}

h1 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin: 0; }
h2 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; color: var(--text); }
h3 { font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600; margin: 0.75rem 0 0.5rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.mono, .reason { font-family: var(--font-mono); font-size: 0.8rem; }

/* Icons: local SVG sprite via <use>; block display avoids inline-baseline
   offsets, 18px keeps them optically balanced with the 0.9rem UI text. */
.icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
  shape-rendering: geometricPrecision;
}

/* ---- left sidebar ---- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem 0.75rem;
  background: var(--header);
  border-right: 1px solid var(--border);
  z-index: 20;
}

/* The brand row is exactly as tall as the top bar: together they form one
   continuous header band across the top of the app shell. */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  flex: none;
  padding: 0 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: #fff; }

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-hi); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--surface-hi); color: var(--text); font-weight: 600; }

.sidebar-spacer { flex: 1; }

.logout { margin: 0; display: flex; }
.logout .btn-ghost {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: var(--radius);
}

/* ---- screen-wide top bar (drawer toggle, title, user, sign out) ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 48px;
  padding: 0 1rem;
  margin-left: var(--sidebar-w);
  background: var(--header);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.topbar-spacer { flex: 1; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.menu-btn:hover { color: var(--text); background: var(--surface-hi); }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ---- buttons ---- */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-hi); border-color: var(--muted); }

.btn-primary {
  background: var(--btn-primary);
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover { background: var(--btn-primary-hi); }

/* ---- layout ---- */
/* The dashboard grid stretches to the full width of the window (minus the
   drawer) so panels use all the space that is available. Mobile-first: one
   column below 900px, then the two-column placement. */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.5rem 1.25rem 2rem;
}

/* Dashboard placement: System (1) and the extended MQTT card (2) form the
   top row; Weather (3) sits under System, so the two top cards end on the
   same line as the Weather card. Warnings (4) spans the full width. */
@media (min-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid > .card:nth-child(1) { grid-column: 1; grid-row: 1; }
  .grid > .card:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
  .grid > .card:nth-child(3) { grid-column: 1; grid-row: 2; }
  .grid > .card:nth-child(4) { grid-column: 1 / -1; }
  .grid > .card:nth-child(5) { grid-column: 1; }
  .grid > .card:nth-child(6) { grid-column: 2; }
}

/* Dashboard layout: a column flex keeps the footer mounted to the bottom of
   the viewport even when the content is short; content and footer sit to
   the right of the fixed sidebar. */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app .grid { flex: 1 0 auto; }
.app .grid, .app .footer { margin-left: var(--sidebar-w); }
.app .footer { flex: 0 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  min-width: 0;
}

.card h2 { display: flex; align-items: center; gap: 0.45rem; line-height: 1; }
.card h2 .icon { color: var(--muted); }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
}
.footer .sep { color: var(--border-hi); margin: 0 0.4rem; }
.footer-name { color: var(--text); font-weight: 600; }
.footer-tagline { color: var(--muted); }

.commit-link { color: var(--muted); }
.commit-link:hover { color: var(--link); }

.gh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--muted);
}
.gh-link:hover { color: var(--text); background: var(--surface-hi); text-decoration: none; }
.gh-link .icon { width: 18px; height: 18px; }

/* ---- key/value system panel ---- */
.kv-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
}
.kv { display: contents; }
.kv .k { color: var(--muted); }
.kv .v { font-variant-numeric: tabular-nums; }

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(63, 185, 80, 0.4); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(210, 153, 34, 0.4); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: rgba(248, 81, 73, 0.4); }
.badge.muted { background: var(--muted-bg); color: var(--muted); border-color: var(--border); }
.badge.healthy { background: var(--ok-bg); color: var(--ok); }
.badge.degraded { background: var(--warn-bg); color: var(--warn); }
.badge.disabled { background: var(--bad-bg); color: var(--bad); }

.count {
  background: var(--muted-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 0.75rem;
}

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }

table.plugins {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.plugins th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.plugins td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.plugins tr:last-child td { border-bottom: none; }
table.plugins tr:hover td { background: var(--surface-hi); }

.reason { color: var(--muted); margin-top: 0.15rem; }

/* ---- weather cards ---- */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.weather-card {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
}
.wc-head { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; }
.wc-temp { font-size: 1.5rem; font-weight: 600; margin: 0.35rem 0; }
.wc-cond { color: var(--muted); font-size: 0.85rem; }
.wc-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; color: var(--muted); font-size: 0.75rem; margin-top: 0.4rem; }
.wc-time { font-size: 0.72rem; margin-top: 0.4rem; }

/* ---- warnings ---- */
.warnings { display: grid; gap: 0.75rem; }
.warning {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}
.w-head { display: flex; align-items: center; gap: 0.6rem; }
.w-head h3 { margin: 0; font-size: 0.95rem; }
.w-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }
.w-areas { color: var(--muted); font-size: 0.78rem; margin-top: 0.3rem; }
.warning details { margin-top: 0.4rem; }
.warning summary { cursor: pointer; color: var(--link); font-size: 0.8rem; }
.warning details p { color: var(--text); font-size: 0.85rem; margin: 0.4rem 0 0; }

.sev {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  flex: none;
}
.sev-extreme { background: var(--bad-bg); color: var(--bad); border-color: rgba(248, 81, 73, 0.4); }
.sev-severe { background: rgba(255, 123, 67, 0.15); color: #ff7b43; border-color: rgba(255, 123, 67, 0.4); }
.sev-moderate { background: var(--warn-bg); color: var(--warn); border-color: rgba(210, 153, 34, 0.4); }
.sev-minor { background: rgba(88, 166, 255, 0.15); color: var(--link); border-color: rgba(88, 166, 255, 0.4); }
.sev-unknown { background: var(--muted-bg); color: var(--muted); border-color: var(--border); }

.empty { color: var(--muted); font-style: italic; }

/* ---- warnings pager ---- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}
.page-link {
  color: var(--link);
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
}
.page-link:hover { text-decoration: none; background: var(--surface-hi); }
.page-link.disabled { color: var(--muted); pointer-events: none; opacity: 0.6; }
.page-info { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- login ---- */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: auto 1rem;
}
.login-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(88, 166, 255, 0.25);
}
.login-tagline {
  margin: 0.25rem 0 0;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}
.login-sub {
  margin: 0.3rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}
.login-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}
.login-card h1 { display: flex; align-items: center; gap: 0.5rem; justify-content: center; font-size: 1.1rem; }
.login-card form { display: grid; gap: 0.85rem; margin-top: 1rem; }
.login-card label { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 500; color: var(--text); }
.login-card input {
  background: var(--canvas);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  width: 100%;
}
.login-card input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25); }
.login-error {
  background: var(--bad-bg);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: var(--bad);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ---- collapsed desktop drawer: icon-only rail ---- */
.app.drawer-collapsed { --sidebar-w: 56px; }
.app.drawer-collapsed .brand { justify-content: center; padding: 0; }
.app.drawer-collapsed .brand-text,
.app.drawer-collapsed .nav-label { display: none; }
.app.drawer-collapsed .nav-item { justify-content: center; padding: 0.45rem 0; }

/* ---- narrow screens: drawer overlays the content ---- */
@media (max-width: 860px) {
  .app .sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: none;
  }
  .app.drawer-open .sidebar {
    transform: none;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  .app .topbar, .app .grid, .app .footer, .app .users-main { margin-left: 0; }
  .logout-label { display: none; }
}

/* ---- test signal page ---- */
.test-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.test-form .field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}
.test-form .field span { color: var(--muted); font-weight: 500; }
.test-form input,
.test-form select {
  background: var(--canvas);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  width: 100%;
}
.test-form input:focus,
.test-form select:focus { outline: none; border-color: var(--link); }
.test-form .field-wide { grid-column: 1 / -1; }
.test-actions { grid-column: 1 / -1; display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.test-actions .btn-primary { width: auto; }
.test-ok {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ok-bg);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--ok);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 1rem 0 0;
}

/* ---- users administration ---- */
/* The administration pages stretch to the full available width and height;
   the table area scrolls inside the card so the footer stays at the bottom. */
.users-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-left: var(--sidebar-w);
  padding: 1.5rem 1.25rem 1.5rem;
}
.users-main .card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.users-main .user-form,
.users-main .pager { flex: 0 0 auto; }
.users-main .table-wrap { overflow: visible; }
.user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.user-form input {
  background: var(--canvas);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}
.user-form input:focus { outline: none; border-color: var(--link); }
.user-form input[name="username"] { width: 180px; }
.user-form input[name="phone"], .user-form input[name="discord"] { width: 150px; }
.user-form input[name="email"] { flex: 1 1 220px; }
.btn-add { width: auto; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius);
}
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; align-items: center; }
.inline-form { margin: 0; display: inline-flex; }
.users-main .pager { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.9rem; }

/* ---- users table: group assignment ---- */
.groups-cell { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.group-chip {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text);
  white-space: nowrap;
}
.group-picker { position: relative; }
.group-picker summary { list-style: none; cursor: pointer; }
.group-picker summary::-webkit-details-marker { display: none; }
.group-picker[open] summary { border-color: var(--link); }
.group-form {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
  padding: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.group-opt { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; cursor: pointer; }

/* ---- groups table: routing assignment ---- */
.routing-count { white-space: nowrap; }
.routing-form { width: 420px; max-width: calc(100vw - 2rem); }
.routing-hint { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.25rem; }
.routing-form select {
  background: var(--canvas);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}
.routing-form select:focus { outline: none; border-color: var(--link); }
.checklist { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
}
.check-item:hover { border-color: var(--muted); }
.check-item input { accent-color: var(--link); margin: 0; }
.routing-empty { margin: 0.75rem 0 0; }

/* Routing matrix: a grid of severity selects, one per source × action
   cell. Column count is set inline from the action list. */
.matrix-grid { display: grid; gap: 0.3rem; align-items: center; }
.matrix-head {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matrix-corner { text-align: left; }
.matrix-src {
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.matrix-grid .matrix-sev { width: 100%; max-width: 100%; }
.matrix-sev {
  background: var(--canvas);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}
.matrix-sev:focus { outline: none; border-color: var(--link); }

/* Compact per-channel chips in the groups table. */
.routing-matrix { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.matrix-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  color: var(--text);
  white-space: nowrap;
}
.matrix-chip .sev { font-size: 0.62rem; padding: 0.1rem 0.45rem; }
.matrix-chip .matrix-src {
  opacity: 0.75;
  border-right: 1px solid var(--border);
  padding-right: 0.4rem;
  margin-right: 0.1rem;
}
