/* Fibril admin design system.
 *
 * One accent (flesh) re-keyed from a single token pair per theme - keep it
 * that way, the brand accent is expected to change when the mascot palette
 * lands. Semantic state colors are separate from the accent and mean the same
 * thing everywhere: --active blue = leased/in-flight, --ok green = completed/
 * healthy, --warn amber = needs attention (never plain "waiting"), --bad red =
 * failed/dead-lettered. Identifiers and aligned numerals are always mono with
 * tabular figures. */

:root {
  color-scheme: dark;
  /* Text placed ON an accent-filled surface (primary buttons). Dark themes
     use bright accents, so near-black; light themes override to white. */
  --on-accent: #16110c;
  --bg: #0f1013;
  --panel: #16181d;
  --panel-2: #1c1f25;
  --text: #e9e7e2;
  --muted: #8e9098;
  --dim: #5c5e66;
  --line: #272b33;
  --line-2: #323641;
  --accent: #e8907c;
  --accent-soft: rgba(232, 144, 124, .15);
  --accent-line: rgba(232, 144, 124, .48);
  --active: #6fb2f0;
  --ok: #3bd68f;
  --ok-soft: rgba(59, 214, 143, .13);
  --warn: #e6ac47;
  --warn-soft: rgba(230, 172, 71, .13);
  --bad: #ef5350;
  --bad-soft: rgba(239, 83, 80, .13);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 9px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --on-accent: #ffffff;
  --bg: #e8e6e0;
  --panel: #f5f4f0;
  --panel-2: #fbfaf7;
  --text: #292723;
  --muted: #68665f;
  --dim: #9c9992;
  --line: #d2cec5;
  --line-2: #c2bdb1;
  --accent: #ae5644;
  --accent-soft: rgba(174, 86, 68, .10);
  --accent-line: rgba(174, 86, 68, .45);
  --active: #3e77ad;
  --ok: #2e8b61;
  --ok-soft: rgba(46, 139, 97, .10);
  --warn: #a9761b;
  --warn-soft: rgba(169, 118, 27, .12);
  --bad: #c8443a;
  --bad-soft: rgba(200, 68, 58, .10);
  --shadow: 0 8px 28px rgba(60, 50, 40, .18);
}

/* ---------------- base ---------------- */

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  margin: 0;
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

a,
a:visited {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  border-radius: var(--radius-sm);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code,
pre,
kbd {
  font-family: var(--mono);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 .6rem;
  text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
  html.theme-transition,
  html.theme-transition * {
    transition:
      background-color .22s ease,
      border-color .22s ease,
      box-shadow .22s ease,
      color .22s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------- utilities ---------------- */

.text-right {
  text-align: right;
}

.narrow {
  max-width: 880px;
}

.mono {
  font-family: var(--mono);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.micro {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

/* ---------------- shell ---------------- */

.admin-body {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: flex;
  gap: 9px;
  padding: 14px 16px 12px;
}

.brand:visited {
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand svg {
  flex: none;
}

.brand .word {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}

.brand .word em {
  color: var(--accent);
  font-style: normal;
}

.nav-links {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  padding: 10px 8px;
}

.nav-section {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  margin: 10px 8px 4px;
  text-transform: uppercase;
}

.nav-link {
  align-items: center;
  border-radius: var(--radius-md);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 9px;
  padding: 6px 10px;
}

.nav-link:visited {
  color: var(--muted);
}

.nav-link:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-link .icon,
.nav-link .icon-svg {
  color: var(--dim);
  flex: none;
}

.nav-link.active .icon,
.nav-link.active .icon-svg {
  color: var(--accent);
}

.side-foot {
  border-top: 1px solid var(--line);
  color: var(--dim);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 4px;
  padding: 10px 16px;
}

.side-foot a,
.side-foot a:visited {
  color: var(--muted);
}

.side-foot .foot-links {
  display: flex;
  gap: 12px;
}

.main-container {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  height: 48px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.crumb {
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.searchbtn {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 12.5px;
  gap: 8px;
  padding: 4px 10px;
}

.searchbtn:hover {
  background: var(--panel-2);
}

.searchbtn kbd {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 10.5px;
  padding: 0 5px;
}

.icon-link {
  align-items: center;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12.5px;
  gap: 6px;
  padding: 4px 8px;
}

.icon-link:visited {
  color: var(--muted);
}

.icon-link:hover,
.theme-toggle:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  height: 26px;
  line-height: 1;
  width: 30px;
}

.admin-auth-pill {
  background: var(--warn-soft);
  border-radius: 999px;
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
}

.content-container {
  flex: 1 0 auto;
  width: 100%;
}

.content-area {
  padding: 20px 24px 60px;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
  padding: 12px 22px;
}

/* ---------------- icons (tabler masks) ---------------- */

.icon {
  background: currentColor;
  display: inline-block;
  height: 1rem;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  width: 1rem;
}

.icon-logout {
  -webkit-mask-image: url("/static/vendor/tabler-icons/logout.svg");
  mask-image: url("/static/vendor/tabler-icons/logout.svg");
}

.icon-github {
  -webkit-mask-image: url("/static/vendor/tabler-icons/brand-github.svg");
  mask-image: url("/static/vendor/tabler-icons/brand-github.svg");
}

.icon-user {
  -webkit-mask-image: url("/static/vendor/tabler-icons/user.svg");
  mask-image: url("/static/vendor/tabler-icons/user.svg");
}

/* ---------------- buttons ---------------- */

.btn,
.quarantine-repair,
.message-payload-open,
.queue-delete-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
}

.btn:hover,
.quarantine-repair:hover,
.message-payload-open:hover,
.queue-delete-btn:hover {
  background: var(--panel-2);
}

.btn:disabled {
  cursor: default;
  opacity: .5;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.07);
}

.btn-sm,
.message-payload-open {
  font-size: 11.5px;
  padding: 2px 9px;
}

.btn-warning,
.queue-delete-btn {
  color: var(--bad);
}

.btn-warning:hover,
.queue-delete-btn:hover {
  background: var(--bad-soft);
}

.view-toggle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 10px;
}

.view-toggle:hover {
  color: var(--text);
}

.view-toggle[aria-pressed="true"],
.view-toggle.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text);
}

/* ---------------- pills and small status ---------------- */

.queue-state-pill,
.message-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
}

.replica-status-caught_up {
  color: var(--ok);
}

.replica-status-pending_retry {
  color: var(--warn);
}

.replica-status-checkpoint_required {
  color: var(--bad);
}

/* ---------------- headings ---------------- */

.metrics-header {
  font-size: 17px;
  font-weight: 600;
  margin: 2px 0 14px;
}

h5.metrics-header,
.queue-group-heading,
.settings-section-heading,
.settings-group-heading {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  margin: 18px 0 10px;
}

.queue-group-note,
.settings-note,
.overview-help,
.settings-help,
.message-muted {
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------------- cards and panels ---------------- */

.overview-panel,
.settings-section,
.settings-panel,
.messages-panel,
.queue-create-panel,
.queue-summary-card,
.diagnostics-grid > section,
.message-replay-report {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.overview-panel + .overview-panel,
.settings-section + .settings-section,
.overview-panel + .overview-grid,
.overview-grid + .overview-panel {
  margin-top: 14px;
}

.overview-panel-heading h5 {
  margin: 0 0 2px;
}

.overview-panel-heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
}

.overview-panel-secondary {
  background: var(--bg);
}

.overview-grid {
  /* start-aligned so an expanded disk breakdown grows only its own card,
     not the whole row */
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  margin-bottom: 14px;
}

.overview-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
}

.overview-card-primary strong {
  color: var(--accent);
}

.overview-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.overview-card strong {
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.01em;
}

.overview-latency-grid,
.overview-reconnect-summary,
.settings-readonly-grid {
  display: grid;
  gap: 10px 18px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0;
}

.overview-latency-grid dt,
.overview-reconnect-summary dt,
.settings-readonly-grid dt {
  color: var(--muted);
  font-size: 11.5px;
}

.overview-latency-grid dd,
.overview-reconnect-summary dd,
.settings-readonly-grid dd {
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin: 2px 0 0;
}

.overview-details {
  color: var(--muted);
  font-size: 12px;
}

.diagnostics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.queue-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 14px;
}

/* ---------------- tables ---------------- */

.table,
.metric-table,
.admin-table,
.message-table,
.queue-table {
  border-collapse: collapse;
  font-size: 12.5px;
  width: 100%;
}

.table th,
.metric-table th,
.admin-table th,
.message-table th,
.queue-table th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  padding: 9px 12px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td,
.metric-table td,
.admin-table td,
.message-table td,
.queue-table td {
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  padding: 8px 12px;
  vertical-align: middle;
}

.table tbody tr:last-child td,
.metric-table tbody tr:last-child td,
.admin-table tbody tr:last-child td,
.message-table tbody tr:last-child td,
.queue-table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover,
.metric-table tbody tr:hover,
.admin-table tbody tr:hover,
.message-table tbody tr:hover,
.queue-table tbody tr:hover {
  background: var(--panel-2);
}

.table-compact th,
.table-compact td {
  padding: 5px 10px;
}

/* Breathing room between the group cards (mockup uses 14px). */
.queue-table-wrap + .queue-table-wrap {
  margin-top: 14px;
}

.queue-table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.queue-table-wrap .queue-table th {
  padding-top: 11px;
}

.queue-row {
  cursor: pointer;
}

.queue-topic-cell {
  font-family: var(--mono);
}

.queue-caret {
  color: var(--dim);
  display: inline-block;
  font-size: 10px;
  width: 14px;
}

.queue-agg-row td {
  color: var(--muted);
}

.queue-part-cell {
  font-family: var(--mono);
}

.queue-messages-link {
  font-size: 12px;
  white-space: nowrap;
}

.queue-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.queue-create-fields {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ---------------- forms ---------------- */

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 5px 9px;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--accent-line);
  outline: none;
}

/* The disk card's breakdown, folded by default so the stat row stays
   compact. */
.disk-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 10.5px;
  margin-top: 6px;
  user-select: none;
}

.disk-details summary:hover {
  color: var(--text);
}

/* Cluster membership at a glance in the top bar: live/registered nodes. */
.nodes-pill {
  align-items: center;
  background: var(--ok-soft);
  border-radius: 999px;
  color: var(--ok);
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  gap: 6px;
  padding: 3px 10px;
}

.nodes-pill.short {
  background: var(--warn-soft);
  color: var(--warn);
}

/* The chip's data source stopped answering: last-known numbers, visibly
   untrusted. */
.nodes-pill.stale {
  background: transparent;
  border: 1px dashed var(--line-2);
  color: var(--dim);
}

/* Cluster list view: per-broker cards + the placement matrix. */
.node-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.node-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.node-card-dead {
  opacity: .65;
}

.node-card-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  padding: 11px 14px;
}

.node-card-name {
  font-weight: 600;
}

.node-dot {
  border-radius: 999px;
  flex: none;
  height: 8px;
  width: 8px;
}

.node-dot-ok { background: var(--ok); }
.node-dot-bad { background: var(--bad); }

.node-card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  padding: 10px 14px;
}

.node-kv {
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.node-kv b {
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}

.node-card-foot {
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  padding: 9px 14px;
}

/* A table row spotlighted from the connections diagram. */
.row-spot {
  background: var(--accent-soft);
}

/* Checks and radios pick up the flavor accent instead of the OS default. */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

.settings-grid {
  display: grid;
  gap: 12px 18px;
  /* auto-fill, not auto-fit: a row's lone field keeps its column width
     instead of stretching across the page. */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.settings-grid-two {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-label {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}

.settings-duration {
  align-items: center;
  display: flex;
  gap: 6px;
}

/* Every numeric control the same width, paired with a unit or not - the
   ragged mix of tiny and page-wide inputs was the whole complaint. */
.settings-field input[type="number"] {
  max-width: 150px;
}

/* Inside a value+unit pair the input yields before the unit select does,
   so tight grid cells never push the select into the neighbour column. */
.settings-duration input[type="number"] {
  flex: 1 1 90px;
  min-width: 60px;
}

.settings-duration select {
  flex: none;
}

/* Controls anchor to the cell bottom, so a row's inputs line up even when
   their help texts run different lengths. */
.settings-field > .settings-duration,
.settings-field > input,
.settings-field > select {
  margin-top: auto;
}

.duration-unit {
  color: var(--muted);
  font-size: 12px;
}

.settings-lock {
  color: var(--warn);
  display: block;
  font-size: 11.5px;
  margin-top: .25rem;
}

.settings-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.settings-inline-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-form-secondary {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.checkbox-label {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 12.5px;
  gap: 7px;
}

/* Settings checkbox rows: the label sits beside the box and the help
   drops to its own line - inline, the pair read as one run-on sentence
   ("Streaming replication Use credit-based streaming..."). The row also
   spans the grid and takes a little air above, so it breaks cleanly from
   the fields around it. */
.settings-section .checkbox-label {
  align-items: flex-start;
  grid-column: 1 / -1;
  margin: 8px 0 2px;
}

.settings-section .checkbox-label input[type="checkbox"] {
  flex: none;
  margin-top: 2px;
}

.settings-section .checkbox-label > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-message {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  margin: 10px 0;
  padding: 8px 12px;
}

/* No message, no box: an empty outcome element must not render its chrome
   (the hollow pill next to the notify picker, the empty bar over Users). */
.settings-message:empty {
  display: none;
}

.settings-message[data-kind="info"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}

.settings-message[data-kind="success"] {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
  color: var(--ok);
}

.settings-message[data-kind="warning"] {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 42%, transparent);
  color: var(--warn);
}

.settings-inline-warning,
.message-warning-note {
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 42%, transparent);
  border-radius: var(--radius-md);
  color: var(--warn);
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
}

.settings-message[data-kind="error"] {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  color: var(--bad);
}

.op-message {
  color: var(--muted);
  font-size: 12.5px;
  margin: 8px 0;
}

/* ---------------- messages page ---------------- */

.message-inspection-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.message-status-filter {
  flex-basis: 100%;
  min-width: 0;
  margin: 4px 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.message-status-filter legend {
  padding: 0 6px;
}

.message-status-filter > .settings-help {
  display: block;
  margin-bottom: 10px;
}

.message-status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-status-filter label {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 5px 10px;
}

.message-status-filter-input {
  margin: 0;
}

.message-status-filter label:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.message-status-filter label:has(.message-status-filter-input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.message-status-filter label:has(.message-status-filter-input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text);
}

.message-select {
  accent-color: var(--accent);
}

.message-results {
  margin-top: 12px;
}

.message-empty {
  color: var(--muted);
  padding: 30px 16px;
  text-align: center;
}

.message-payload-cell {
  font-family: var(--mono);
  font-size: 11.5px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-modal {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(8, 8, 10, .55);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 100;
}

.message-modal-card {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-height: 82vh;
  max-width: min(760px, 92vw);
  overflow: auto;
  padding: 16px 18px;
  width: 100%;
}

.message-modal-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.message-modal-header h5 {
  margin: 0;
}

.message-modal-meta {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: .65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0;
}

.message-modal pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
  padding: 10px 12px;
}

/* ---------------- topology diagram ---------------- */

.broker-list-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.broker-list-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 8px 12px;
}

.broker-list-item:hover {
  background: var(--panel-2);
}

.broker-list-item.node-selected {
  border-color: var(--accent-line);
}

.node-active {
  stroke: var(--ok);
}

.node-selected {
  stroke: var(--accent);
}

.edge-active {
  stroke: var(--accent);
}

.has-focus {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

/* ---------------- quarantine banner ---------------- */

.quarantine-banner {
  background: var(--bad-soft);
  border: 1px solid color-mix(in srgb, var(--bad) 55%, var(--line));
  border-radius: var(--radius-lg);
  box-shadow: 0 0 12px color-mix(in srgb, var(--bad) 11%, transparent);
  margin-bottom: 16px;
  padding: 12px 16px;
}

.quarantine-banner:hover {
  box-shadow: 0 0 18px color-mix(in srgb, var(--bad) 22%, transparent);
}

.quarantine-title {
  color: var(--bad);
  font-weight: 600;
  margin-bottom: 8px;
}

.quarantine-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.quarantine-item {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.quarantine-item strong {
  font-family: var(--mono);
  font-weight: 600;
}

.quarantine-reason {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}

.quarantine-note {
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------------- command palette ---------------- */

.palette-overlay {
  background: rgba(8, 8, 10, .55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding-top: 14vh;
  position: fixed;
  z-index: 110;
}

.palette {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  height: fit-content;
  overflow: hidden;
  width: min(520px, 92vw);
}

.palette input {
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  padding: 12px 16px;
  width: 100%;
}

.palette input:focus {
  border-color: var(--line);
  outline: none;
}

.palette-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
}

.palette-item {
  align-items: center;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 10px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}

.palette-item:hover,
.palette-item.sel {
  background: var(--accent-soft);
  text-decoration: none;
}

.palette-item .kind {
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: .07em;
  margin-left: auto;
  text-transform: uppercase;
}

.palette-empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

/* ---------------- login ---------------- */

.login-body {
  align-items: center;
  background: var(--bg);
  color: var(--text);
  display: flex;
  font: 13.5px/1.5 var(--sans);
  justify-content: center;
  margin: 0;
  min-height: 100vh;
}

.login-shell {
  width: min(360px, 92vw);
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.login-card h1 {
  font-size: 17px;
  margin: 14px 0 4px;
}

.login-card p {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 14px;
}

.login-brand {
  align-items: center;
  display: flex;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  gap: 9px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  font-weight: 500;
  gap: 4px;
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .admin-body {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .brand .word,
  .nav-section,
  .nav-link span,
  .side-foot {
    display: none;
  }

  .nav-link {
    justify-content: center;
  }

  .searchbtn .searchlabel {
    display: none;
  }
}

/* ---------------- overview charts + attention ---------------- */

.overview-two {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 360px;
  margin: 14px 0;
}

@media (max-width: 1100px) {
  .overview-two {
    grid-template-columns: 1fr;
  }
}

.chart {
  display: block;
  width: 100%;
}

.chart-tall {
  height: 170px;
}

.chart-short {
  height: 110px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  margin: 0 4px 0 10px;
  width: 7px;
}

.legend-dot:first-child {
  margin-left: 0;
}

.chart-current {
  color: var(--muted);
  float: right;
  font-size: 12px;
  font-weight: 400;
}

.chart-current b {
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.trend-word {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.v-accent {
  color: var(--accent);
}

.v-ok {
  color: var(--ok);
}

.v-active {
  color: var(--active);
}

.v-bad {
  color: var(--bad);
}

.attention-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.attention-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 11px;
  padding: 9px 0;
}

.attention-item:last-child {
  border-bottom: none;
}

.attention-stripe {
  align-self: stretch;
  border-radius: 2px;
  flex: none;
  width: 3px;
}

.attention-stripe.crit {
  background: var(--bad);
}

.attention-stripe.warn {
  background: var(--warn);
}

.attention-body {
  min-width: 0;
}

.attention-headline {
  font-size: 12.5px;
}

.attention-subject {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-item .btn {
  flex: none;
  margin-left: auto;
}

.attention-empty {
  color: var(--muted);
  font-size: 12.5px;
  padding: 12px 0 4px;
}

.queue-spark-cell {
  min-width: 96px;
}

.queue-spark {
  display: block;
  height: 22px;
  width: 90px;
}

/* ---------------- queue detail ---------------- */

.queue-detail-back {
  font-size: 12px;
  margin: 0 0 6px;
}

.queue-detail-head {
  align-items: center;
  display: flex;
  gap: 10px;
}

.chip-group {
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 7px;
  white-space: nowrap;
}

.chip-plain {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  padding: 1px 7px;
  white-space: nowrap;
}

.part-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.part-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.part-card.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 50%, var(--line));
}

.part-id {
  align-items: center;
  display: flex;
  font-family: var(--mono);
  font-size: 12px;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.part-row {
  color: var(--muted);
  display: flex;
  font-size: 11.5px;
  justify-content: space-between;
  margin-top: 4px;
}

.part-row b {
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.part-warn {
  color: var(--warn);
  font-size: 11px;
  font-weight: 600;
  margin-top: 7px;
}

.ident-name {
  font-size: 12px;
}

.ident-sub {
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 1px;
}

/* ---------------- mock-alignment pass ---------------- */

/* Value colors round out the state palette on numerals. */
.v-warn {
  color: var(--warn);
}

.v-dim {
  color: var(--dim);
}

/* Card-integrated header row, the mock's "chead": a micro label plus chips
   inside the card, instead of a plain heading floating above it. */
.card-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 10px 14px;
}

.card-head .micro {
  flex: none;
}

.card-head .queue-group-note {
  margin-left: auto;
}

/* Queue memory-state pills, colored by state instead of samey outlines. */
.queue-state-pill.queue-state-loaded {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

.queue-state-pill.queue-state-active {
  background: color-mix(in srgb, var(--active) 13%, transparent);
  border-color: transparent;
  color: var(--active);
}

.queue-state-pill.queue-state-unloading {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.queue-state-pill.queue-state-unloaded {
  color: var(--dim);
}

/* Queues summary cards match the overview stat cards. */
.queue-summary-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.queue-summary-card span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.queue-summary-card strong {
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* Page header row: title left, primary page action right. */
.page-head-row {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.page-head-row .metrics-header {
  margin: 0;
}

.page-head-row .btn {
  margin-left: auto;
}

.queue-create-panel {
  margin-bottom: 14px;
}

/* Compact one-line stat strip: the counts without the card weight. */
.stat-strip {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px 20px;
  margin: 0 0 14px;
}

.stat-strip b {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.queue-actions {
  white-space: nowrap;
}

.queue-actions .queue-delete-btn {
  margin-left: 8px;
}

/* Page description: one plain-language line under the title (bunqueue's
   header formula). */
.page-desc {
  color: var(--muted);
  font-size: 12.5px;
  margin: -6px 0 14px;
  max-width: 78ch;
}

/* Generic colored chips for state-bearing labels. */
.chip-ok {
  background: var(--ok-soft);
  border-radius: var(--radius-sm);
  color: var(--ok);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  white-space: nowrap;
}

.chip-warn {
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  color: var(--warn);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  white-space: nowrap;
}

.chip-bad {
  background: var(--bad-soft);
  border-radius: var(--radius-sm);
  color: var(--bad);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  white-space: nowrap;
}

/* ---------------- broker switcher ---------------- */

.broker-switch {
  position: relative;
}

.broker-switch-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  font-size: 11.5px;
  padding: 3px 10px;
}

.broker-switch-btn:hover {
  background: var(--panel-2);
}

.broker-switch-menu {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  left: 0;
  min-width: 180px;
  padding: 4px;
  position: absolute;
  top: calc(100% + 4px);
  z-index: 60;
}

.broker-switch-item {
  border-radius: var(--radius-sm);
  color: var(--text);
  display: block;
  font-size: 12px;
  padding: 5px 9px;
}

.broker-switch-item:visited {
  color: var(--text);
}

a.broker-switch-item:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.broker-switch-item.is-self {
  color: var(--dim);
}

.fp-row {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  font-size: 11.5px;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 12px;
}

.fp-row .btn {
  flex: none;
  margin-left: auto;
}

/* ---------------- flavors ----------------
   A flavor re-keys the accent family and, in dark mode, tints the grounds
   toward its hue. Plain dark/light stay the default edges. Semantic state
   colors stay put in every flavor: the accent lives on chrome, links, and
   chips, never on health. Names from the tissue-and-stain family. */

html[data-flavor="neuronic"]:not([data-theme="light"]) {
  --accent: #f2c230;
  --accent-soft: rgba(242, 194, 48, .17);
  --accent-line: rgba(242, 194, 48, .55);
  --bg: #121108;
  --panel: #191710;
  --panel-2: #201d14;
}

html[data-flavor="chlorophyll"]:not([data-theme="light"]) {
  --accent: #41d066;
  --accent-soft: rgba(65, 208, 102, .17);
  --accent-line: rgba(65, 208, 102, .55);
  --bg: #0d120e;
  --panel: #141a15;
  --panel-2: #1a211b;
}

html[data-flavor="crimson"]:not([data-theme="light"]) {
  --accent: #e02e4d;
  --accent-soft: rgba(224, 46, 77, .15);
  --accent-line: rgba(224, 46, 77, .48);
  --bg: #130e10;
  --panel: #1a1417;
  --panel-2: #211a1d;
}

html[data-flavor="eosin"]:not([data-theme="light"]) {
  --accent: #f0537e;
  --accent-soft: rgba(240, 83, 126, .17);
  --accent-line: rgba(240, 83, 126, .55);
  --bg: #120e12;
  --panel: #191419;
  --panel-2: #201a20;
}

html[data-flavor="azure"]:not([data-theme="light"]) {
  --accent: #3ba4ff;
  --accent-soft: rgba(59, 164, 255, .17);
  --accent-line: rgba(59, 164, 255, .55);
  --bg: #0e1014;
  --panel: #14181e;
  --panel-2: #1a1f26;
}

html[data-flavor="iris"]:not([data-theme="light"]) {
  --accent: #a582f5;
  --accent-soft: rgba(165, 130, 245, .17);
  --accent-line: rgba(165, 130, 245, .55);
  --bg: #100f14;
  --panel: #16141c;
  --panel-2: #1c1a23;
}

/* The original design mockup's burnt-orange scheme - carotene, the
   pigment, keeps the flavor family organic. */
html[data-flavor="carotene"]:not([data-theme="light"]) {
  --accent: #e08a52;
  --accent-soft: rgba(224, 138, 82, .16);
  --accent-line: rgba(224, 138, 82, .52);
  --bg: #12100d;
  --panel: #191613;
  --panel-2: #201c18;
}

/* Light mode keeps the boring paper grounds; a flavor only re-keys the
   accent, darkened for contrast. */
html[data-theme="light"][data-flavor="neuronic"] {
  --accent: #97731a;
  --accent-soft: rgba(151, 115, 26, .12);
  --accent-line: rgba(151, 115, 26, .45);
}

html[data-theme="light"][data-flavor="chlorophyll"] {
  --accent: #2f7d3c;
  --accent-soft: rgba(47, 125, 60, .11);
  --accent-line: rgba(47, 125, 60, .45);
}

html[data-theme="light"][data-flavor="crimson"] {
  --accent: #a81e38;
  --accent-soft: rgba(168, 30, 56, .11);
  --accent-line: rgba(168, 30, 56, .45);
}

html[data-theme="light"][data-flavor="eosin"] {
  --accent: #a83349;
  --accent-soft: rgba(168, 51, 73, .11);
  --accent-line: rgba(168, 51, 73, .45);
}

html[data-theme="light"][data-flavor="azure"] {
  --accent: #2f6ea8;
  --accent-soft: rgba(47, 110, 168, .11);
  --accent-line: rgba(47, 110, 168, .45);
}

html[data-theme="light"][data-flavor="iris"] {
  --accent: #6b4fb0;
  --accent-soft: rgba(107, 79, 176, .11);
  --accent-line: rgba(107, 79, 176, .45);
}

html[data-theme="light"][data-flavor="carotene"] {
  --accent: #a05a24;
  --accent-soft: rgba(160, 90, 36, .11);
  --accent-line: rgba(160, 90, 36, .45);
}

/* ---------------- flavor picker ---------------- */

.flavor-pick {
  position: relative;
}

.flavor-pick-btn {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  width: 30px;
}

.flavor-pick-btn:hover {
  background: var(--panel-2);
}

.flavor-dot {
  background: var(--accent);
  border-radius: 999px;
  display: inline-block;
  height: 11px;
  width: 11px;
}

.flavor-menu {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
}

.flavor-item {
  align-items: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  gap: 9px;
  padding: 5px 9px;
  text-align: left;
  white-space: nowrap;
}

.flavor-item:hover,
.flavor-item.on {
  background: var(--accent-soft);
}

.flavor-item .swatch {
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 11px;
  width: 11px;
}

/* ---------------- toast, live pill, nav badge, spark popover ---------------- */

.toast {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  bottom: 22px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  left: 50%;
  opacity: 0;
  padding: 9px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 8px);
  transition: opacity .18s, transform .18s;
  z-index: 120;
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.live-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  gap: 6px;
  padding: 3px 10px;
}

.live-pill .dot {
  border-radius: 999px;
  height: 6px;
  width: 6px;
}

.live-pill.live {
  background: var(--accent-soft);
  color: var(--accent);
}

.live-pill.live .dot {
  animation: live-pulse 2.4s infinite;
  background: var(--accent);
}

.live-pill.stale {
  background: var(--warn-soft);
  color: var(--warn);
}

.live-pill.stale .dot {
  background: var(--warn);
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.nav-badge {
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  padding: 1px 7px;
}

.nav-badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.nav-badge.crit {
  background: var(--bad-soft);
  box-shadow: 0 0 8px color-mix(in srgb, var(--bad) 25%, transparent);
  color: var(--bad);
}

.spark-pop {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  position: fixed;
  width: 330px;
  z-index: 90;
}

.spark-pop-head {
  align-items: baseline;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.spark-pop-head .close {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  margin-left: auto;
}

.spark-pop-vals {
  color: var(--muted);
  display: flex;
  font-size: 11.5px;
  gap: 16px;
  margin-top: 8px;
}

.spark-pop-vals b {
  color: var(--text);
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.live-pill.dead {
  background: var(--bad-soft);
  color: var(--bad);
}

.live-pill.dead .dot {
  background: var(--bad);
}

/* Chart hover readout. */
.chart-host {
  position: relative;
}

.chart-tip {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: flex;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  gap: 4px;
  padding: 4px 9px;
  pointer-events: none;
  position: absolute;
  white-space: nowrap;
  z-index: 30;
}

.chart-tip .tip-dot {
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  margin-right: 3px;
  width: 7px;
}

.chart-tip .tip-when {
  color: var(--muted);
}

/* ---- storage breakdown bar (Overview disk card) ---- */
.storage-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
  background: var(--line);
}
.storage-bar > span { display: block; min-width: 2px; }
.storage-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 16px; margin: 14px 0; }
.storage-usage-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.storage-usage-grid strong { font: 16px var(--mono); }
.storage-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.storage-bar-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}
/* Segment hues stay off the semantic ok/warn/bad set: accent, active, and
   panel-mixed variants keep the bar readable in every theme and flavor. */
.seg-0 { background: var(--accent); }
.seg-1 { background: var(--active); }
.seg-2 { background: color-mix(in srgb, var(--accent) 55%, var(--panel)); }
.seg-3 { background: color-mix(in srgb, var(--active) 55%, var(--panel)); }
.seg-other { background: var(--dim); }

/* ---- optional resource graphs (Overview, collapsed by default) ---- */
.resource-grid {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}
.resource-grid .micro { margin: 0 0 4px; }

.settings-actions-note {
  color: var(--muted);
  font-size: 12px;
  align-self: center;
  max-width: 480px;
}

/* The runtime-settings save row marks a semantic frontier: everything above
   it is what the button applies, everything below is separate machinery.
   Draw the line and give it room. */
#settings-form .settings-actions {
  margin: 20px 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-2);
}

/* Zero values sit quiet; state color engages only when the number does. */
.is-zero.is-zero { color: var(--dim); }

/* ---- mascot placements (S0: login, 404, favicon - never data views) ---- */
.login-mascot {
  display: block;
  height: auto;
  margin: 2px auto 14px;
  width: 106px;
}

.notfound-hero {
  padding: 56px 0;
  text-align: center;
}

.notfound-hero img {
  height: auto;
  margin-bottom: 20px;
  width: 128px;
}

.notfound-hero h2 {
  margin: 0 0 6px;
}

.live-pill.connecting {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
}

.live-pill.connecting .dot {
  background: var(--muted);
}

/* Reserve room so the label appearing after the topology fetch does not
   shove the top bar around. */
.broker-switch-btn {
  min-width: 96px;
}

/* Per-group tables repeat down the Queues and Streams pages. Pin their
   column widths so every instance shares one grid and a column reads
   straight down the page across groups, instead of each table auto-sizing
   to its own content. The first (name) column takes the remainder. */
.queue-grid-table,
.stream-parts-table,
.stream-cursors-table {
  table-layout: fixed;
  width: 100%;
}

/* The queues grid carries many pinned columns - keep the topic column
   roomy and let the wrap scroll sideways when the viewport is narrower. */
.queue-grid-table {
  min-width: 1280px;
}

.queue-grid-table th:nth-child(2) { width: 92px; }
.queue-grid-table th:nth-child(3) { width: 64px; }
.queue-grid-table th:nth-child(4) { width: 158px; }
.queue-grid-table th:nth-child(5) { width: 64px; }
.queue-grid-table th:nth-child(6) { width: 64px; }
.queue-grid-table th:nth-child(7) { width: 64px; }
.queue-grid-table th:nth-child(8) { width: 84px; }
.queue-grid-table th:nth-child(9) { width: 84px; }
.queue-grid-table th:nth-child(10) { width: 112px; }
.queue-grid-table th:nth-child(11) { width: 128px; }
.queue-grid-table th:nth-child(12) { width: 110px; }

.stream-parts-table th:nth-child(2) { width: 84px; }
.stream-parts-table th:nth-child(3) { width: 84px; }
.stream-parts-table th:nth-child(4) { width: 84px; }
.stream-parts-table th:nth-child(5) { width: 90px; }
.stream-parts-table th:nth-child(6) { width: 84px; }
.stream-parts-table th:nth-child(7) { width: 64px; }
.stream-parts-table th:nth-child(8) { width: 118px; }

.stream-cursors-table th:nth-child(2) { width: 84px; }
.stream-cursors-table th:nth-child(3) { width: 100px; }
.stream-cursors-table th:nth-child(4) { width: 84px; }
.stream-cursors-table th:nth-child(5) { width: 84px; }
.stream-cursors-table th:nth-child(6) { width: 130px; }

/* Recovery observations share the dashboard palette in both themes. */
.recovery-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; margin-bottom: 20px; }
.recovery-controls label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; width: min(520px, 100%); max-width: 100%; font-size: 12px; color: var(--muted); }
.recovery-controls select { min-width: 0; max-width: 100%; width: 100%; }
.recovery-controls .settings-note { margin: 0; }
.recovery-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; overflow-wrap: anywhere; }
.recovery-heading p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.recovery-total { display: grid; text-align: right; flex: none; }
.recovery-total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.recovery-total span { font-size: 12px; }
.recovery-axis { display: flex; justify-content: space-between; margin: 0 168px 8px 170px; color: var(--muted); font-size: 11px; }
.recovery-row { display: grid; grid-template-columns: 158px minmax(0, 1fr) 156px; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.recovery-stage, .recovery-measure { display: grid; gap: 2px; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.recovery-stage strong, .recovery-measure strong { font-weight: 500; }
.recovery-stage span, .recovery-measure span { color: var(--muted); font-size: 11px; }
.recovery-measure { text-align: right; font-variant-numeric: tabular-nums; }
.recovery-track { position: relative; height: 20px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.recovery-bar { position: absolute; top: 3px; height: 14px; min-width: 2px; background: currentColor; border-radius: 2px; }
.recovery-ok { color: var(--ok); }
.recovery-error { color: var(--bad); }
.recovery-running { color: var(--active); }
.recovery-cancelled { color: var(--warn); }
.recovery-identity { margin-top: 16px; font-size: 12px; color: var(--muted); }
.recovery-identity summary { cursor: pointer; }
.recovery-identity code { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .recovery-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .recovery-track { grid-column: 1 / -1; grid-row: 2; }
  .recovery-axis { margin-left: 0; margin-right: 0; }
  .recovery-total strong { font-size: 20px; }
}

.recovery-phases { display: flex; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; gap: 6px; }
.recovery-phases li { display: grid; flex: 1 1 80px; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-top: 3px solid currentColor; border-radius: 4px; font-size: 11px; }
.recovery-phases strong { font-weight: 500; }
.recovery-phases span { color: var(--muted); font-size: 10px; }
.recovery-unobserved { color: var(--muted); background: var(--panel-2); }
.recovery-legend { margin: 9px 0 16px; color: var(--muted); font-size: 11px; }
.recovery-issues { padding: 10px 12px; margin-bottom: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.recovery-issues p { margin: 3px 0; }
.recovery-bar.recovery-cancelled { background: repeating-linear-gradient(135deg, currentColor 0 4px, transparent 4px 7px); border: 1px solid currentColor; }
