:root {
  --bg: #f8f7f4;
  --panel: #ffffff;
  --text: #1c1b18;
  --muted: #6e6a63;
  --accent: #16695b;
  --border: #ddd7ce;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 10%, #ffffff, #f8f7f4 45%, #efeae2);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: #fffdf9;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-banner {
  margin: 0 20px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.status-banner.error {
  background: #fff2f2;
  border-color: #e8a6a6;
  color: #7d1e1e;
}

.status-banner.warn {
  background: #fff8ea;
  border-color: #e8cf99;
  color: #674700;
}

.token-box {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.token-box input,
button,
.tabs a,
#inspector-filter,
#state-prefix,
.control-card input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

button {
  cursor: pointer;
}

button:hover,
.tabs a:hover {
  border-color: var(--accent);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
}

.tabs .active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tabs a {
  text-decoration: none;
}

main {
  padding: 20px;
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.panel.active {
  display: block;
}

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

.card {
  background: #fcfaf6;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.card .label {
  color: var(--muted);
  font-size: 12px;
}

.card .value {
  font-size: 18px;
  margin-top: 4px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.chart-card {
  background: #0f1318;
  border: 1px solid #243140;
  border-radius: 12px;
  padding: 10px;
  color: #dbe7f2;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chart-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #c0d2e4;
}

.chart-stat {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #8de0ff;
}

.chart-canvas {
  display: block;
  width: 100%;
  height: 140px;
  border-radius: 8px;
}

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

.control-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfaf6;
  padding: 12px;
}

.control-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d7f4e8;
  color: #0f5132;
  border: 1px solid #a7e3c7;
  font-size: 12px;
}

.pill.pill-paused {
  background: #ffe6e2;
  color: #7f1d1d;
  border-color: #f5b5a8;
}

#muted-services-output,
#muted-topics-output,
#clear-queues-result,
#control-output {
  margin-top: 10px;
  max-height: 180px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}

pre {
  margin: 0;
  background: #111;
  color: #f5f5f5;
  padding: 12px;
  border-radius: 10px;
  overflow: auto;
  max-height: 560px;
  font-size: 12px;
}

.row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }
}
