/* MeshBuddy MQTT Ops Console */

:root {
  --mqtt-font-display: "Saira Condensed", system-ui, sans-serif;
  --mqtt-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body.mqtt-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #050807;
  color: #d9e6dc;
  font-family: var(--mqtt-font-mono);
}

body.mqtt-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 16%, rgba(55, 225, 120, .18), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(61, 171, 255, .14), transparent 30%),
    radial-gradient(circle at 62% 86%, rgba(255, 184, 77, .10), transparent 32%),
    #050807;
}

body.mqtt-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .25;
  background:
    linear-gradient(90deg, rgba(91, 255, 140, .10) 1px, transparent 1px),
    linear-gradient(rgba(91, 255, 140, .08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}

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

button {
  cursor: pointer;
}

.mqtt-page {
  --panel: rgba(9, 15, 13, .74);
  --panel-strong: rgba(8, 12, 16, .88);
  --line: rgba(126, 160, 135, .34);
  --line-strong: rgba(86, 239, 127, .62);
  --soft: rgba(86, 239, 127, .11);
  --green: #43f070;
  --green-2: #9affba;
  --cyan: #55c7ff;
  --amber: #ffbf47;
  --magenta: #ff75bf;
  --red: #ff6b5d;
  --text: #d9e6dc;
  --muted: #92a796;
  --dark: #050807;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: clamp(10px, 1.7vw, 24px);
  color: var(--text);
}

.mqtt-page a {
  color: inherit;
}

.mqtt-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: clamp(14px, 2vw, 24px);
  min-height: 360px;
  margin: 0 0 12px;
  padding: clamp(18px, 3vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(121, 255, 166, .34);
  border-radius: 8px;
  background:
    linear-gradient(125deg, rgba(7, 13, 11, .96), rgba(4, 9, 14, .82) 48%, rgba(13, 10, 6, .90)),
    radial-gradient(circle at 18% 12%, rgba(67, 240, 112, .24), transparent 34%),
    radial-gradient(circle at 84% 28%, rgba(85, 199, 255, .18), transparent 32%);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, .36),
    inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.mqtt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 24%, rgba(255, 255, 255, .07) 25%, transparent 39%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 56px);
  opacity: .35;
}

.mqtt-hero::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(67, 240, 112, .18);
  border-radius: 6px;
}

.mqtt-hero-copy,
.mqtt-hero-visual {
  position: relative;
  z-index: 1;
}

.mqtt-kicker,
.label,
.panel-head,
.mqtt-hero-meta,
.mqtt-card-code {
  font-family: var(--mqtt-font-display);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mqtt-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.mqtt-kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(67, 240, 112, .8);
}

.mqtt-hero h1 {
  max-width: 900px;
  margin: 12px 0 12px;
  color: #f4fbf5;
  font: 700 clamp(46px, 7vw, 118px) var(--mqtt-font-display);
  letter-spacing: 0;
  line-height: .86;
  text-transform: uppercase;
}

.mqtt-hero p {
  max-width: 780px;
  margin: 0;
  color: #b8c8bc;
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.45;
}

.mqtt-hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mqtt-hero-actions {
  margin-top: 22px;
}

.mqtt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(126, 160, 135, .42);
  border-radius: 4px;
  background: rgba(12, 20, 16, .75);
  color: #d9e6dc;
  font: 700 14px var(--mqtt-font-display);
  letter-spacing: .09em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}

.mqtt-btn:hover,
.mqtt-btn:focus-visible {
  border-color: rgba(67, 240, 112, .88);
  background: rgba(67, 240, 112, .12);
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

.mqtt-btn.primary {
  border-color: rgba(67, 240, 112, .86);
  background: linear-gradient(135deg, rgba(67, 240, 112, .24), rgba(85, 199, 255, .08));
  color: #effff2;
  box-shadow: inset 3px 0 0 rgba(67, 240, 112, .95), 0 0 24px rgba(67, 240, 112, .10);
}

.mqtt-btn.ghost {
  border-color: rgba(255, 191, 71, .48);
  color: #ffe3a5;
}

.mqtt-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  color: rgba(194, 214, 199, .72);
  font-size: 12px;
  font-weight: 700;
}

.mqtt-hero-meta span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(126, 160, 135, .28);
  border-radius: 3px;
  background: rgba(0, 0, 0, .22);
  overflow-wrap: anywhere;
}

.mqtt-hero-meta b {
  color: #f2fff5;
  font-weight: 700;
}

.mqtt-hero-visual {
  display: grid;
  align-content: stretch;
  min-height: 280px;
}

.mqtt-radar {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(85, 199, 255, .26);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(67, 240, 112, .10), rgba(0, 0, 0, .05) 40%, rgba(0, 0, 0, .45) 100%),
    linear-gradient(135deg, rgba(85, 199, 255, .08), rgba(255, 191, 71, .03));
}

.mqtt-radar .ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(67, 240, 112, .26);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mqtt-radar .r1 { width: 38%; aspect-ratio: 1; }
.mqtt-radar .r2 { width: 68%; aspect-ratio: 1; }
.mqtt-radar .r3 { width: 96%; aspect-ratio: 1; }

.mqtt-radar .sweep {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 50%;
  background: conic-gradient(from 0deg, rgba(67, 240, 112, .44), transparent 24deg);
  transform-origin: 0 0;
  animation: mqttSweep 6s linear infinite;
  opacity: .72;
}

.mqtt-radar .ping {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(67, 240, 112, .54);
  border-radius: 4px;
  background: rgba(4, 12, 9, .84);
  color: #dfffe7;
  font: 700 12px var(--mqtt-font-display);
  letter-spacing: .11em;
  box-shadow: 0 0 20px rgba(67, 240, 112, .12);
}

.mqtt-radar .p1 { left: 16%; top: 18%; }
.mqtt-radar .p2 { right: 12%; top: 24%; border-color: rgba(85, 199, 255, .65); color: #d8f4ff; }
.mqtt-radar .p3 { left: 22%; bottom: 18%; border-color: rgba(255, 191, 71, .65); color: #ffe7b0; }
.mqtt-radar .p4 { right: 18%; bottom: 16%; border-color: rgba(255, 117, 191, .62); color: #ffd6ea; }

@keyframes mqttSweep {
  to { transform: rotate(360deg); }
}

.mqtt-status-console {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid rgba(126, 160, 135, .38);
  border-radius: 8px;
  background: rgba(5, 10, 9, .76);
  backdrop-filter: blur(16px);
}

.mqtt-status-led {
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: currentColor;
  color: var(--red);
  box-shadow: 0 0 22px currentColor;
}

.mqtt-status-console[data-state="connecting"] .mqtt-status-led,
.mqtt-status-console[data-state="bridge"] .mqtt-status-led,
.mqtt-status-console[data-state="reconnecting"] .mqtt-status-led {
  color: var(--amber);
}

.mqtt-status-console[data-state="connected"] .mqtt-status-led {
  color: var(--green);
}

.mqtt-status-console .value {
  color: #ffffff;
  font: 700 28px var(--mqtt-font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mqtt-status-console .meta,
.mqtt-reconnect-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mqtt-reconnect-state {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 7px;
  border: 1px solid rgba(85, 199, 255, .24);
  border-radius: 3px;
  background: rgba(85, 199, 255, .07);
  color: #d7f3ff;
  font-family: var(--mqtt-font-display);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mqtt-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mqtt-card {
  position: relative;
  min-width: 0;
  min-height: 128px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(126, 160, 135, .32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(67, 240, 112, .12), transparent 60%),
    rgba(9, 15, 13, .70);
  backdrop-filter: blur(16px);
}

.mqtt-card::before,
.mqtt-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, .08), transparent 24%);
  opacity: .55;
}

.mqtt-card-code {
  position: absolute;
  top: 9px;
  right: 10px;
  color: rgba(85, 199, 255, .82);
  font-size: 11px;
  font-weight: 700;
}

.mqtt-card .label {
  display: block;
  color: rgba(154, 255, 186, .78);
  font-size: 12px;
  font-weight: 700;
}

.mqtt-card b {
  display: block;
  margin: 9px 0 4px;
  color: #f5fff7;
  font: 700 clamp(28px, 3.4vw, 48px) var(--mqtt-font-display);
  letter-spacing: 0;
  line-height: .9;
}

.mqtt-card small {
  display: block;
  min-height: 30px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.mqtt-card.alert-card[data-state="medium"] {
  border-color: rgba(255, 191, 71, .65);
  background: linear-gradient(135deg, rgba(255, 191, 71, .17), transparent 60%), rgba(14, 12, 8, .76);
}

.mqtt-card.alert-card[data-state="high"] {
  border-color: rgba(255, 107, 93, .72);
  background: linear-gradient(135deg, rgba(255, 107, 93, .18), transparent 60%), rgba(16, 8, 8, .78);
}

.mqtt-card.wide {
  grid-column: span 2;
}

.mqtt-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
}

.mqtt-pipeline span {
  min-width: 0;
  padding: 8px 7px;
  border: 1px solid rgba(85, 199, 255, .25);
  border-radius: 3px;
  background: rgba(85, 199, 255, .06);
  color: #dff5ff;
  font: 700 12px var(--mqtt-font-display);
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.mqtt-workbench {
  display: grid;
  grid-template-columns: minmax(310px, 420px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.mqtt-rail,
.mqtt-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.mqtt-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(126, 160, 135, .32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(67, 240, 112, .06), transparent 180px),
    var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(126, 160, 135, .24);
  color: #effff2;
  font-size: 16px;
  font-weight: 700;
}

.panel-head small {
  color: rgba(154, 255, 186, .58);
  font-size: 10px;
}

.panel-body {
  position: relative;
  z-index: 1;
  padding: 14px;
}

.panel-note {
  margin: 0 0 12px;
  color: #9eb2a3;
  font-size: 12px;
  line-height: 1.45;
}

.field,
.check-inline {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span,
.switch-grid span,
.check-inline span {
  color: rgba(154, 255, 186, .68);
  font: 700 11px var(--mqtt-font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select,
.feed-toolbar input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(126, 160, 135, .30);
  border-radius: 4px;
  background: rgba(1, 5, 4, .78);
  color: #effff2;
  outline: none;
}

.field input,
.field select,
.feed-toolbar input {
  height: 44px;
  padding: 0 11px;
}

.field textarea {
  min-height: 96px;
  padding: 11px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.feed-toolbar input:focus {
  border-color: rgba(67, 240, 112, .84);
  box-shadow: 0 0 0 2px rgba(67, 240, 112, .10);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, .36fr);
  gap: 10px;
  margin-top: 10px;
}

.field-row .tiny {
  min-width: 86px;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.switch-grid label,
.check-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 8px;
  border: 1px solid rgba(126, 160, 135, .22);
  border-radius: 4px;
  background: rgba(0, 0, 0, .18);
}

.switch-grid input,
.check-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.preset-grid button {
  min-height: 38px;
  border: 1px solid rgba(126, 160, 135, .30);
  border-radius: 4px;
  background: rgba(8, 16, 13, .78);
  color: #d9e6dc;
  font: 700 13px var(--mqtt-font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preset-grid button:hover,
.preset-grid button:focus-visible {
  border-color: rgba(67, 240, 112, .80);
  color: #ffffff;
  outline: none;
}

.button-row {
  margin-top: 12px;
}

.mini-log {
  min-height: 38px;
  max-height: 190px;
  margin-top: 12px;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(126, 160, 135, .24);
  border-radius: 4px;
  background: rgba(0, 0, 0, .26);
  color: #aebfb2;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mini-log.tall {
  min-height: 260px;
  max-height: 420px;
}

.mini-log .ok { color: var(--green-2); }
.mini-log .warn { color: var(--amber); }
.mini-log .bad { color: var(--red); }

.feed-panel .panel-body {
  padding: 0;
}

.feed-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, .9fr) repeat(4, auto);
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(126, 160, 135, .22);
  background: rgba(4, 8, 7, .62);
}

.mqtt-page.pin-filters .feed-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(14px);
}

.message-stream {
  display: grid;
  gap: 9px;
  max-height: min(72vh, 820px);
  min-height: 420px;
  padding: 12px;
  overflow: auto;
}

.message-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) minmax(160px, .55fr);
  gap: 10px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(126, 160, 135, .26);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(67, 240, 112, .10), transparent 62%),
    rgba(5, 10, 8, .72);
  color: inherit;
  text-align: left;
}

.message-card:hover,
.message-card:focus-visible,
.message-card.selected {
  border-color: rgba(67, 240, 112, .80);
  outline: none;
  box-shadow: inset 3px 0 0 rgba(67, 240, 112, .9), 0 0 22px rgba(67, 240, 112, .08);
}

.message-card.kind-packet {
  background: linear-gradient(90deg, rgba(85, 199, 255, .12), transparent 62%), rgba(5, 10, 8, .72);
}

.message-card.kind-raw,
.message-card.kind-binary,
.message-card.kind-encrypted {
  background: linear-gradient(90deg, rgba(255, 117, 191, .12), transparent 62%), rgba(5, 10, 8, .72);
}

.message-card.kind-status {
  background: linear-gradient(90deg, rgba(67, 240, 112, .13), transparent 62%), rgba(5, 10, 8, .72);
}

.msg-time {
  display: grid;
  align-content: start;
  gap: 6px;
  color: #d7e2d9;
  font-size: 12px;
}

.msg-time b,
.msg-event b {
  color: #ffffff;
  font: 700 19px var(--mqtt-font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.msg-topic {
  min-width: 0;
}

.topic-path {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 7px;
}

.topic-path span {
  max-width: 170px;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid rgba(85, 199, 255, .24);
  border-radius: 3px;
  background: rgba(85, 199, 255, .06);
  color: #d9f4ff;
  font: 700 11px var(--mqtt-font-display);
  letter-spacing: .07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.msg-summary {
  color: #bdcbbf;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.msg-event {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.badge-row,
.route-chips,
.field-grid,
.payload-tabs,
.topic-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(126, 160, 135, .28);
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  color: #dbe9df;
  font: 700 11px var(--mqtt-font-display);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.badge.green { border-color: rgba(67, 240, 112, .55); color: #dfffe7; }
.badge.cyan { border-color: rgba(85, 199, 255, .55); color: #dcf5ff; }
.badge.amber { border-color: rgba(255, 191, 71, .55); color: #ffe7ad; }
.badge.magenta { border-color: rgba(255, 117, 191, .55); color: #ffd6ea; }
.badge.red { border-color: rgba(255, 107, 93, .65); color: #ffd1cc; }

.mqtt-page.compact .message-card {
  grid-template-columns: 88px minmax(0, 1fr) minmax(120px, .42fr);
  padding: 8px;
}

.mqtt-page.compact .message-stream {
  gap: 6px;
}

.mqtt-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 12px;
}

.inspector-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(126, 160, 135, .30);
  border-radius: 6px;
  color: #91a393;
  text-align: center;
}

.inspector-grid {
  display: grid;
  gap: 12px;
}

.inspector-title {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(126, 160, 135, .24);
  border-radius: 6px;
  background: rgba(0, 0, 0, .20);
}

.inspector-title h3 {
  margin: 0;
  color: #ffffff;
  font: 700 26px var(--mqtt-font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.inspector-title code {
  color: #c6f1ff;
  overflow-wrap: anywhere;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.field-tile {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(126, 160, 135, .22);
  border-radius: 5px;
  background: rgba(0, 0, 0, .20);
}

.field-tile span {
  display: block;
  margin-bottom: 5px;
  color: rgba(154, 255, 186, .68);
  font: 700 10px var(--mqtt-font-display);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.field-tile b,
.field-tile code {
  color: #f4fff6;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.payload-box {
  min-width: 0;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(126, 160, 135, .22);
  border-radius: 6px;
  background: rgba(1, 4, 4, .78);
  color: #dbe9df;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.payload-box.good {
  border-color: rgba(67, 240, 112, .46);
}

.payload-box.warn {
  border-color: rgba(255, 191, 71, .50);
}

.payload-box.bad {
  border-color: rgba(255, 107, 93, .56);
}

.route-chips span {
  padding: 5px 8px;
  border: 1px solid rgba(85, 199, 255, .30);
  border-radius: 999px;
  background: rgba(85, 199, 255, .07);
  color: #daf3ff;
  font-size: 12px;
}

.meter {
  position: relative;
  height: 11px;
  overflow: hidden;
  border: 1px solid rgba(126, 160, 135, .30);
  border-radius: 999px;
  background: rgba(0, 0, 0, .32);
}

.meter i {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
}

.anomaly-list {
  display: grid;
  gap: 8px;
  min-height: 180px;
}

.anomaly {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(126, 160, 135, .26);
  border-radius: 5px;
  background: rgba(0, 0, 0, .20);
}

.anomaly b {
  color: #ffffff;
  font: 700 15px var(--mqtt-font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.anomaly small {
  color: #aebfb2;
  line-height: 1.35;
}

.anomaly.warn {
  border-color: rgba(255, 191, 71, .54);
}

.anomaly.bad {
  border-color: rgba(255, 107, 93, .60);
}

.topic-grid {
  display: grid;
  gap: 8px;
  min-height: 220px;
}

.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 92px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(126, 160, 135, .22);
  border-radius: 5px;
  background: rgba(0, 0, 0, .18);
}

.topic-row code {
  color: #d9f4ff;
  overflow-wrap: anywhere;
}

.topic-row b {
  color: #ffffff;
  font: 700 19px var(--mqtt-font-display);
}

.topic-row small {
  color: #91a393;
  font-size: 11px;
}

.topic-meter {
  gap: 2px;
  margin-top: 6px;
}

.topic-meter i {
  width: 6px;
  height: 16px;
  border-radius: 2px;
  background: rgba(85, 199, 255, .18);
}

.topic-meter i.on {
  background: linear-gradient(180deg, var(--green), var(--cyan));
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(126, 160, 135, .26);
  border-radius: 6px;
  color: #91a393;
  text-align: center;
}

.copy-link {
  color: #cfeeff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@supports not (backdrop-filter: blur(1px)) {
  .mqtt-status-console,
  .mqtt-card,
  .mqtt-panel {
    background-color: rgba(7, 13, 11, .94);
  }
}

@media (max-width: 1320px) {
  .mqtt-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mqtt-card.wide {
    grid-column: span 3;
  }

  .mqtt-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .mqtt-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .mqtt-page {
    padding: 10px;
  }

  .mqtt-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .mqtt-hero h1 {
    font-size: clamp(42px, 13vw, 70px);
  }

  .mqtt-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mqtt-card.wide {
    grid-column: span 2;
  }

  .mqtt-rail,
  .mqtt-two-col {
    grid-template-columns: 1fr;
  }

  .feed-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .message-card {
    grid-template-columns: 1fr;
  }

  .message-stream {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .mqtt-page {
    padding: 8px;
  }

  .mqtt-hero {
    min-height: 0;
    padding: 14px;
  }

  .mqtt-hero h1 {
    font-size: 40px;
  }

  .mqtt-hero p {
    font-size: 14px;
  }

  .mqtt-hero-visual {
    min-height: 0;
  }

  .mqtt-radar {
    min-height: 210px;
  }

  .mqtt-metrics {
    grid-template-columns: 1fr;
  }

  .mqtt-card.wide {
    grid-column: auto;
  }

  .mqtt-pipeline {
    grid-template-columns: 1fr 1fr;
  }

  .field-row,
  .switch-grid,
  .preset-grid,
  .feed-toolbar,
  .topic-row {
    grid-template-columns: 1fr;
  }

  .mqtt-btn {
    width: 100%;
  }

  .button-row .mqtt-btn,
  .mqtt-hero-actions .mqtt-btn {
    flex: 1 1 140px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
