:root {
  --bg: #06131a;
  --bg-alt: #0b2028;
  --panel: rgba(5, 18, 24, 0.9);
  --line: rgba(89, 239, 208, 0.28);
  --text: #d6f7ee;
  --muted: #89b7ae;
  --accent: #59efd0;
  --accent-hot: #a9ff4d;
  --read-accent: #58e7ff;
  --read-accent-soft: rgba(88, 231, 255, 0.18);
  --write-accent: #8cff4f;
  --write-accent-soft: rgba(140, 255, 79, 0.18);
  --error: #ff7b72;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  background:
    radial-gradient(circle at top, rgba(89, 239, 208, 0.15), transparent 30%),
    linear-gradient(180deg, #051018 0%, #09151d 45%, #050b10 100%);
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(89, 239, 208, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 239, 208, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
  pointer-events: none;
}

.shell {
  width: 100%;
  padding: 0 0 48px;
}

.shell-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

/* ── App navbar ── */
.hero {
  position: sticky;
  top: 0;
  z-index: 200;
  margin-bottom: 28px;
  background: rgba(6, 19, 26, 0.97);
  border-bottom: 1px solid rgba(89, 239, 208, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex-shrink: 0;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-home-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.brand-logo {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.auth-brand {
  margin-bottom: 22px;
  align-items: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.auth-logo {
  height: auto;
  width: clamp(200px, 28vw, 280px);
}

.auth-brand .lede {
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(89, 239, 208, 0.1);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.auth-footer p {
  margin: 0 0 6px;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.auth-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
  padding: 0 20px;
}

.session-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 0;
  min-width: 0;
}

.session-user {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  padding-right: 10px;
  border-right: 1px solid rgba(89, 239, 208, 0.14);
}

.session-box strong {
  display: block;
  font-size: 0.88rem;
  margin: 0;
  color: var(--text);
}

.session-box small {
  display: block;
}

.session-box .button-secondary {
  width: auto;
  min-height: 32px;
  margin-top: 0;
  padding: 0 12px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.session-box .session-link-button {
  width: auto;
  min-height: 32px;
  margin-top: 0;
  padding: 0 12px;
  line-height: 30px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.session-box form {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-hot);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.lede,
.panel-header p,
.field span,
.meta-label,
.status,
small {
  color: var(--muted);
}

.lede {
  margin-top: 12px;
  max-width: 720px;
  font-size: 1.15rem;
}

.panel {
  position: relative;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 26, 33, 0.92), rgba(4, 12, 17, 0.92));
  box-shadow: 0 0 0 1px rgba(89, 239, 208, 0.08), 0 18px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(89, 239, 208, 0.08), transparent 35%);
  pointer-events: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.field-inline-details {
  padding: 10px 12px;
  border: 1px solid rgba(89, 239, 208, 0.18);
  background: rgba(7, 23, 30, 0.72);
}

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

.field-inline-detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-inline-details strong,
.field-inline-details small {
  display: block;
}

.field-inline-details strong {
  color: var(--text);
  font-size: 0.95rem;
}

.field-inline-details small {
  line-height: 1.4;
  word-break: break-word;
}

.field span,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

select,
button,
input,
textarea {
  border: 1px solid rgba(89, 239, 208, 0.35);
  background: rgba(2, 10, 14, 0.95);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.95rem;
}

select {
  min-height: 46px;
  padding: 10px 12px;
}

.command-select-theme.command-theme-read {
  border-color: rgba(88, 231, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(88, 231, 255, 0.08);
}

.command-select-theme.command-theme-write {
  border-color: rgba(140, 255, 79, 0.4);
  box-shadow: inset 0 0 0 1px rgba(140, 255, 79, 0.08);
}

input {
  min-height: 46px;
  padding: 10px 12px;
}

textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  resize: vertical;
}

.device-meta {
  flex: 0 0 100%;
  display: block;
  margin: 0;
  order: 2;
}

/* Command bar: single compact horizontal line instead of vertical card */
.meta-card[data-meta-card="command"] {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 12px;
}
.meta-card[data-meta-card="command"] .meta-label { display: none; }
.meta-card[data-meta-card="command"] strong {
  display: inline;
  margin: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}
.meta-card[data-meta-card="command"] small {
  display: inline;
  font-size: 0.85rem;
  color: var(--muted);
}

.meta-card {
  padding: 10px 12px;
  border: 1px solid rgba(169, 255, 77, 0.18);
  background: rgba(4, 13, 16, 0.78);
}

.meta-card.command-theme-read {
  border-color: var(--read-accent-soft);
  background: linear-gradient(180deg, rgba(88, 231, 255, 0.06), rgba(4, 13, 16, 0.78));
}

.meta-card.command-theme-write {
  border-color: var(--write-accent-soft);
  background: linear-gradient(180deg, rgba(140, 255, 79, 0.06), rgba(4, 13, 16, 0.78));
}

.meta-card strong,
.meta-card small {
  display: block;
}

.meta-card strong {
  margin: 4px 0 3px;
  font-size: 1rem;
}

.ssh-status-card {
  border-color: rgba(89, 239, 208, 0.18);
}

.ssh-status-card.is-connected {
  border-color: rgba(140, 255, 79, 0.3);
  background: linear-gradient(180deg, rgba(140, 255, 79, 0.08), rgba(4, 13, 16, 0.78));
}

.ssh-status-card.is-connecting {
  border-color: rgba(88, 231, 255, 0.3);
  background: linear-gradient(180deg, rgba(88, 231, 255, 0.08), rgba(4, 13, 16, 0.78));
}

.ssh-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ssh-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(89, 239, 208, 0.24);
  background: rgba(255, 123, 114, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 123, 114, 0.08);
}

.ssh-indicator.is-connected {
  border-color: rgba(140, 255, 79, 0.38);
  background: var(--accent-hot);
  box-shadow: 0 0 10px rgba(169, 255, 77, 0.65);
}

.ssh-indicator.is-connecting {
  border-color: rgba(88, 231, 255, 0.38);
  background: var(--read-accent);
  box-shadow: 0 0 10px rgba(88, 231, 255, 0.55);
  animation: pulse 1.1s ease-in-out infinite;
}

.ssh-indicator.is-disconnected {
  border-color: rgba(255, 123, 114, 0.3);
  background: rgba(255, 123, 114, 0.45);
  box-shadow: 0 0 8px rgba(255, 123, 114, 0.28);
}

.device-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.device-status-copy {
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.command-type-pill {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 8px;
  border: 1px solid transparent;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-type-pill.command-theme-read {
  color: var(--read-accent);
  border-color: rgba(88, 231, 255, 0.28);
  background: rgba(88, 231, 255, 0.08);
}

.command-type-pill.command-theme-write {
  color: var(--write-accent);
  border-color: rgba(140, 255, 79, 0.26);
  background: rgba(140, 255, 79, 0.08);
}

.action-row {
  flex: 0 0 100%;
  margin-top: 4px;
}

.action-row-inline {
  margin-top: 0;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row-inline .inline-action-form {
  display: inline-flex;
}

.route-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
}

.command-help {
  flex: 0 0 100%;
  margin-top: 0;
  order: 4;
}
.command-help:empty { display: none; }

.dynamic-fields {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  align-self: center;
  order: 3;
}

/* Full-width controls (multiselect, peer tables, textarea) drop to their own row */
.dynamic-fields:has(.checkbox-list),
.dynamic-fields:has(textarea),
.dynamic-fields:has(.table-wrap) {
  flex: 0 0 100%;
}

.command-plan-live {
  flex: 0 0 100%;
  margin-top: 0;
  order: 5;
}

.command-plan-header {
  margin-bottom: 12px;
}

.command-plan-copy {
  color: var(--muted);
  font-size: 1rem;
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(89, 239, 208, 0.18);
  background: rgba(4, 13, 16, 0.78);
}

.loading-panel strong,
.loading-panel small {
  display: block;
}

.loading-panel strong {
  color: var(--text);
  margin-bottom: 4px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(89, 239, 208, 0.18);
  border-top-color: var(--accent-hot);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex: 0 0 auto;
}

.dynamic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.field-wide {
  grid-column: span 2;
}

.field-full {
  grid-column: 1 / -1;
}

.dynamic-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.dynamic-row .field {
  flex: 0 0 auto;
}

.dynamic-row .field input[type="text"],
.dynamic-row .field input[type="search"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 160px;
}

.dynamic-row .field:has(input[type="text"]),
.dynamic-row .field:has(input[type="search"]) {
  flex: 1 1 200px;
}

.field-submit {
  flex: 0 0 auto;
}

.dynamic-submit-button {
  padding: 8px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.dynamic-submit-button:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.hidden {
  display: none !important;
}

.checklist-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.checklist-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  margin-bottom: 10px;
}

.checklist-filter-input {
  min-height: 40px;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-x: auto;
  overflow-y: auto;
  padding: 0 12px 12px;
  border: 1px solid rgba(89, 239, 208, 0.18);
  background: rgba(2, 10, 14, 0.95);
}

.checkbox-table {
  display: grid;
  min-width: 1180px;
}

.checkbox-table-head,
.checkbox-row {
  display: grid;
  grid-template-columns: 14px 170px 240px 90px 120px 110px 100px 210px 210px;
  gap: 0;
}

.checkbox-table-peer-compact {
  min-width: 860px;
}

.checkbox-table-peer-compact .checkbox-table-head,
.checkbox-table-peer-compact .checkbox-row {
  grid-template-columns: 14px 180px 280px 110px 120px 120px;
}

.checkbox-table-peer-mini {
  min-width: 860px;
}

.checkbox-table-peer-mini .checkbox-table-head,
.checkbox-table-peer-mini .checkbox-row {
  grid-template-columns: 14px 180px minmax(200px, 1fr) 110px 140px;
}

.checkbox-list-compact {
  max-height: 280px;
}

.checkbox-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(8, 26, 33, 0.98);
  color: var(--accent-hot);
  font-family: "Space Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkbox-table-head > div {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(89, 239, 208, 0.18);
}

.checkbox-item {
  border: 1px solid rgba(89, 239, 208, 0.08);
  background: rgba(89, 239, 208, 0.03);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.checkbox-row {
  align-items: stretch;
  cursor: pointer;
}

.checkbox-row > div {
  padding: 10px 12px;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(89, 239, 208, 0.08);
  word-break: break-word;
}

.checkbox-row > .checkbox-cell,
.checkbox-table-head > div:first-child {
  padding-left: 2px;
  padding-right: 2px;
}

.checkbox-row:hover > div {
  background: rgba(89, 239, 208, 0.04);
}

.checkbox-row.is-selected {
  border-color: rgba(169, 255, 77, 0.24);
  box-shadow: 0 0 0 1px rgba(169, 255, 77, 0.08);
  transform: translateY(-1px);
}

.checkbox-row.is-selected > div {
  background: linear-gradient(180deg, rgba(169, 255, 77, 0.05), rgba(89, 239, 208, 0.04));
}

.checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  line-height: 0;
}

.checkbox-input {
  position: absolute;
  inset: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.checkbox-indicator {
  width: 6px;
  height: 6px;
  border: 1px solid rgba(89, 239, 208, 0.24);
  border-radius: 50%;
  background: transparent;
  display: block;
  pointer-events: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

.checkbox-row:hover .checkbox-indicator {
  border-color: rgba(89, 239, 208, 0.46);
}

.checkbox-input:focus-visible + .checkbox-indicator {
  box-shadow: 0 0 0 2px rgba(89, 239, 208, 0.12);
}

.checkbox-input:checked + .checkbox-indicator {
  border-color: rgba(169, 255, 77, 0.44);
  background: var(--accent-hot);
  box-shadow: 0 0 0 1px rgba(169, 255, 77, 0.08);
  transform: scale(0.94);
}

.checkbox-empty {
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.9rem;
}

button {
  min-height: 36px;
  padding: 0 18px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(89, 239, 208, 0.35);
  background: transparent;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 0;
  width: auto;
}

.button-secondary:hover {
  border-color: rgba(89, 239, 208, 0.6);
  color: var(--accent);
}

.session-link-button {
  display: block;
  min-height: 36px;
  margin-top: 12px;
  width: 100%;
  padding: 0 18px;
  border: 1px solid rgba(89, 239, 208, 0.35);
  background: rgba(2, 10, 14, 0.95);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  line-height: 34px;
}

.session-link-button:hover {
  color: var(--accent-hot);
}

.checklist-action {
  margin-top: 0;
  width: auto;
}

.inline-action-form {
  margin: 0;
}

.peer-link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: "Space Mono", monospace;
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
}

.peer-link-button:hover {
  color: var(--accent-hot);
  text-decoration: underline;
}

.peer-action-cell {
  position: relative;
  display: inline-block;
}

.peer-action-toggle {
  display: inline-block;
}

.peer-action-menu {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 40;
  min-width: 190px;
  max-width: min(240px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid rgba(89, 239, 208, 0.24);
  background: rgba(3, 9, 13, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 6px;
}

.peer-action-option {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 1.45rem;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 14px;
  border: 1px solid rgba(89, 239, 208, 0.24);
  background: rgba(4, 13, 16, 0.82);
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

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

.summary-grid-routing {
  gap: 10px;
  margin-bottom: 14px;
}

.summary-grid-routing-meta {
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, 0.34fr) minmax(170px, 0.5fr);
}

.summary-grid-routing-stats {
  grid-template-columns: minmax(96px, 0.24fr) minmax(96px, 0.24fr) minmax(360px, 1.52fr);
}

.summary-card-routing {
  padding: 11px 13px;
}

.summary-card-routing strong {
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.3;
}

.summary-card-routing-command strong {
  font-size: 0.94rem;
  word-break: break-word;
}

.community-change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.community-card {
  padding: 14px;
  border: 1px solid rgba(89, 239, 208, 0.24);
  background: rgba(4, 13, 16, 0.82);
}

.community-card h3 {
  margin: 10px 0 8px;
  font-size: 1rem;
  color: var(--accent-hot);
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(89, 239, 208, 0.18);
  background: rgba(3, 9, 13, 0.9);
}

.table-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(89, 239, 208, 0.12);
  background: rgba(89, 239, 208, 0.03);
}

.peer-table-filters {
  grid-template-columns: minmax(180px, 1.45fr) minmax(170px, 0.9fr) minmax(110px, 0.52fr) minmax(160px, 0.9fr) minmax(210px, 1.55fr);
}

.peer-filter-as input {
  max-width: 12ch;
}

.type-filter-toggle-group {
  display: flex;
  gap: 8px;
  min-height: 46px;
}

.dynamic-toggle-group {
  display: flex;
  gap: 8px;
  min-height: 46px;
  flex-wrap: wrap;
}

.dynamic-toggle-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(89, 239, 208, 0.2);
  background: rgba(4, 13, 16, 0.82);
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.dynamic-toggle-button.is-active {
  color: var(--accent-hot);
  border-color: rgba(140, 255, 79, 0.36);
  background: rgba(140, 255, 79, 0.08);
  box-shadow: inset 0 0 0 1px rgba(140, 255, 79, 0.12);
}

.type-filter-toggle {
  flex: 1 1 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(89, 239, 208, 0.2);
  background: rgba(4, 13, 16, 0.82);
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.type-filter-toggle.is-active {
  color: var(--accent-hot);
  border-color: rgba(140, 255, 79, 0.36);
  background: rgba(140, 255, 79, 0.08);
  box-shadow: inset 0 0 0 1px rgba(140, 255, 79, 0.12);
}

.type-filter-toggle:hover {
  border-color: rgba(89, 239, 208, 0.34);
  color: var(--text);
}

.type-filter-toggle:focus-visible {
  outline: none;
  border-color: rgba(89, 239, 208, 0.52);
  box-shadow: 0 0 0 2px rgba(89, 239, 208, 0.14);
}

.table-empty {
  padding: 14px;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.9rem;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
  font-family: "Space Mono", monospace;
  font-size: 0.84rem;
}

.peer-result-table-ipv6 {
  min-width: 1360px;
  font-size: 0.8rem;
}

.peer-result-table-ipv6 th,
.peer-result-table-ipv6 td {
  padding: 9px 10px;
}

.history-table {
  min-width: 1200px;
}

.history-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 220px;
  gap: 14px;
  margin-bottom: 18px;
}

.history-status-pill {
  display: inline-block;
  min-width: 90px;
  padding: 4px 10px;
  border: 1px solid rgba(89, 239, 208, 0.22);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.history-status-success {
  color: var(--accent-hot);
  border-color: rgba(169, 255, 77, 0.28);
  background: rgba(169, 255, 77, 0.08);
}

.history-status-error {
  color: var(--error);
  border-color: rgba(255, 123, 114, 0.3);
  background: rgba(255, 123, 114, 0.08);
}

.history-operation-read {
  color: var(--read-accent);
  border-color: rgba(88, 231, 255, 0.28);
  background: rgba(88, 231, 255, 0.08);
}

.history-operation-write {
  color: var(--write-accent);
  border-color: rgba(140, 255, 79, 0.28);
  background: rgba(140, 255, 79, 0.08);
}

.history-command-details {
  margin-top: 10px;
}

.history-command-details summary {
  cursor: pointer;
  color: var(--accent);
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-command-details .terminal {
  margin-top: 10px;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(89, 239, 208, 0.12);
  text-align: left;
  vertical-align: top;
}

.result-table th {
  color: var(--accent-hot);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(89, 239, 208, 0.06);
}

.result-table tr:hover td {
  background: rgba(89, 239, 208, 0.04);
}

.peer-group-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(89, 239, 208, 0.16);
  color: var(--muted);
  background: rgba(89, 239, 208, 0.05);
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.peer-grouped-0 td {
  background: rgba(89, 239, 208, 0.045);
}

.peer-grouped-1 td {
  background: rgba(140, 255, 79, 0.045);
}

.peer-grouped-2 td {
  background: rgba(88, 231, 255, 0.045);
}

.peer-grouped:hover td {
  filter: brightness(1.04);
}

.peer-alert td {
  background: rgba(255, 166, 87, 0.06);
}

.peer-alert td:first-child {
  box-shadow: inset 2px 0 0 rgba(255, 123, 114, 0.42);
}

.peer-alert:hover td {
  background: rgba(255, 166, 87, 0.09);
}

.peer-state-alert {
  color: #ffbe7a;
  text-shadow: 0 0 10px rgba(255, 166, 87, 0.12);
}

.metric-cell {
  white-space: nowrap;
}

.nowrap-cell {
  white-space: nowrap;
}

.peer-address-cell,
.peer-type-cell,
.peer-router-id-cell,
.peer-as-cell,
.peer-state-cell,
.peer-uptime-cell {
  white-space: nowrap;
}

.peer-as-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.88rem;
  line-height: 1.1;
  white-space: normal;
}

.peer-description-cell,
.peer-policy-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.peer-result-table-ipv6 .peer-description-cell {
  max-width: 18ch;
}

.peer-result-table-ipv6 .peer-policy-cell {
  max-width: 14ch;
}

.routing-result-table {
  min-width: 1220px;
}

.routing-result-table-ipv6 {
  min-width: 900px;
}

.routing-cell-network,
.routing-cell-prefix,
.routing-cell-next-hop,
.routing-cell-interface,
.routing-cell-from,
.routing-cell-peer-router-id,
.routing-cell-duration,
.routing-cell-med,
.routing-cell-local-pref,
.routing-cell-pref-val,
.routing-cell-status {
  white-space: nowrap;
}

.routing-cell-description,
.routing-cell-attributes,
.routing-cell-path {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.routing-cell-from-combined {
  min-width: 14ch;
}

.route-from-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.route-from-peer {
  white-space: nowrap;
}

.route-from-router-id {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.routing-cell-metrics {
  white-space: nowrap;
}

.route-metrics-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.route-metric-key {
  display: inline-block;
  min-width: 4ch;
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.as-path-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.as-path-raw {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.as-path-origin {
  color: var(--accent-hot);
}

.as-names-wrap {
  display: inline-block;
}

.as-names-toggle {
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.72rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.as-names-toggle:hover {
  text-decoration: underline;
}

.as-path-chip-list[hidden] {
  display: none;
}

.as-path-chip-list {
  /* position/top/left set by JS via getBoundingClientRect to escape overflow containers */
  position: fixed;
  z-index: 300;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-alt);
  border: 1px solid rgba(89, 239, 208, 0.2);
  min-width: 14rem;
  max-width: 40rem;
}

.as-path-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 24ch;
  padding: 6px 8px;
  border: 1px solid rgba(89, 239, 208, 0.16);
  background: rgba(89, 239, 208, 0.04);
}

.as-path-chip strong {
  color: var(--accent-hot);
  font-size: 0.72rem;
}

.as-path-chip small {
  color: var(--muted);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.82rem;
  line-height: 1.1;
}

.metric-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  display: inline-block;
  min-width: 52px;
  margin-right: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.metric-value {
  display: inline-block;
}

.status {
  margin-bottom: 12px;
  font-family: "Space Mono", monospace;
}

.status.success {
  color: var(--accent-hot);
}

.status.warning {
  color: #ffd866;
}

.status.info {
  color: var(--accent);
}

.status.error {
  color: var(--error);
}

.loading-output {
  margin-bottom: 16px;
}

#output-content.is-loading {
  opacity: 0.35;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.terminal {
  margin: 0;
  padding: 18px;
  min-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(89, 239, 208, 0.18);
  background: #03090d;
  color: #ccefe8;
  font-family: "Space Mono", monospace;
  line-height: 1.5;
}

.terminal-compact {
  min-height: 0;
  padding: 12px;
}

.raw-output {
  margin-top: 18px;
}

.raw-output summary {
  cursor: pointer;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.raw-output h3 {
  margin: 14px 0 10px;
  font-size: 0.95rem;
  color: var(--accent-hot);
  font-family: "Space Mono", monospace;
}

.command-plan {
  margin-top: 18px;
}

.command-plan h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--accent-hot);
  font-family: "Space Mono", monospace;
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(0.88);
    opacity: 0.55;
  }
}

.auth-panel {
  width: min(560px, calc(100vw - 24px));
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form .action-row {
  display: flex;
  justify-content: center;
}

.auth-form .field span {
  text-align: left;
}

@media (max-width: 900px) {
  .field-grid,
  .device-meta,
  .summary-grid,
  .dynamic-grid,
  .community-change-grid {
    grid-template-columns: 1fr;
  }

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

  .table-filters {
    grid-template-columns: 1fr;
  }

  .peer-filter-as input {
    max-width: none;
  }

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

  .hero-bar {
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
  }

  .session-box {
    flex-wrap: wrap;
    gap: 8px;
  }

  .field-wide {
    grid-column: auto;
  }

  .shell {
    width: min(100vw - 20px, 1450px);
    padding-top: 20px;
  }

  .panel {
    padding: 16px;
  }

  .route-filter-form {
    grid-template-columns: 1fr;
  }

  .field-inline-detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .loading-panel {
    align-items: flex-start;
  }
}

/* ── Site footer ── */
.site-footer {
  margin-top: 32px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.footer-sep {
  opacity: 0.4;
}

.footer-version {
  color: var(--muted);
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer-version:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.footer-feedback-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer-feedback-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ── Changelog page ── */
.changelog-panel {
}

.changelog-panel .panel-header p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 24px;
}

.changelog-entry {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.changelog-entry:last-child {
  border-bottom: none;
}

.changelog-version-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.changelog-version {
  font-family: "Space Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.changelog-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 4px;
}

.changelog-tag-current {
  background: rgba(89, 239, 208, 0.15);
  color: var(--accent);
  border: 1px solid rgba(89, 239, 208, 0.35);
}

.changelog-items {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.changelog-items li {
  color: var(--muted);
}

/* ── Feedback form ── */
.feedback-panel {
}

.feedback-panel .panel-header p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.feedback-type-row {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.feedback-type-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.feedback-type-option input[type="radio"] {
  display: none;
}

.feedback-type-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.feedback-type-bug {
  border-color: var(--error);
  color: var(--error);
}

.feedback-type-suggestion {
  border-color: var(--accent-hot);
  color: var(--accent-hot);
}

.feedback-type-option input[type="radio"]:checked + .feedback-type-bug {
  background: rgba(255, 123, 114, 0.18);
}

.feedback-type-option input[type="radio"]:checked + .feedback-type-suggestion {
  background: rgba(169, 255, 77, 0.18);
}

.feedback-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.file-input {
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--muted);
  cursor: pointer;
  width: 100%;
}

.file-input:hover {
  border-color: var(--accent);
}

.feedback-sent {
  margin-bottom: 20px;
}

.muted-text {
  color: var(--muted);
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-sep {
  color: var(--muted);
  opacity: 0.4;
  font-size: 0.7rem;
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  min-height: 0;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}

.lang-btn:hover {
  border-color: var(--line);
  color: var(--text);
}

.lang-btn.lang-active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Admin panel ── */
.admin-panel {
  display: flex;
  flex-direction: row;
  padding: 0;        /* sidebar goes edge-to-edge; content has its own padding */
  overflow: visible;
}
/* cmd-sidebar inside admin-panel must stretch to full panel height */
.admin-panel .cmd-sidebar { align-self: stretch; }

.admin-panel .panel-header p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Inline create bar (top row above table) */
.admin-create-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(89, 239, 208, 0.14);
  background: rgba(4, 13, 16, 0.65);
}

.admin-create-bar .field {
  flex: 1 1 140px;
  min-width: 0;
  margin: 0;
}

.admin-create-bar .field-narrow {
  flex: 0 1 120px;
}

.admin-create-bar .field span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-family: "Space Mono", monospace;
}

.admin-create-bar .field input,
.admin-create-bar .field select {
  width: 100%;
  min-width: 0;
}

.admin-create-bar .bar-action {
  flex: 0 0 auto;
  align-self: flex-end;
}

.admin-create-bar .bar-action button {
  margin-top: 0;
}

.admin-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-family: "Space Mono", monospace;
}

.admin-user-note {
  font-size: 0.78rem;
  margin: 0 0 14px;
}

.admin-users-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
}

.admin-users-table td {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) { width: 9%;  }  /* username */

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) { width: 13%; }  /* company */

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) { width: 10%; }  /* password */

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) { width: 9%;  }  /* level */

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) { width: 8%;  }  /* language */

.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) { width: 8%;  }  /* created */

.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7) { width: 10%; }  /* last login */

.admin-users-table th:nth-child(8),
.admin-users-table td:nth-child(8) { width: 19%; }  /* last hit */

/* Actions (9th): fills remaining ~14% */
.admin-users-table th:nth-child(9),
.admin-users-table td:nth-child(9) { overflow: hidden; }

.admin-users-table input,
.admin-users-table select {
  width: 100%;
  min-width: 0;
}

/* Companies table (simpler, fewer columns) */
.admin-companies-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}

.admin-companies-table td {
  vertical-align: middle;
}

.admin-companies-table td:nth-child(1) {
  min-width: 200px;
}

.admin-hit-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.admin-delete-form {
  display: inline;
}

.admin-save-button,
.admin-delete-button {
  width: auto;
  min-height: 34px;
  margin-top: 0;
  padding: 0 12px;
}

.button-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.button-danger:hover {
  background: rgba(255, 123, 114, 0.15);
}

/* ── Admin sticky header ── */
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 22px;
  overflow-y: auto;
}

/* Admin navigation tabs */
.admin-nav {
  display: flex;
  gap: 4px;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.admin-nav-link {
  display: inline-block;
  padding: 10px 18px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.admin-nav-link:hover {
  color: var(--text);
}

.admin-nav-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Sub-nav (device tree: List | Register) */
.admin-subnav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 0 0 36px;
  border-top: 1px solid rgba(89, 239, 208, 0.08);
}

.admin-subnav-tree {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.45;
  padding-right: 10px;
  user-select: none;
}

.admin-subnav-link {
  display: inline-block;
  padding: 6px 14px;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.admin-subnav-link:hover {
  color: var(--text);
}

.admin-subnav-active {
  color: var(--accent-hot);
  border-bottom-color: var(--accent-hot);
}

/* Admin layout wider variant for devices page */
.admin-layout-wide {
  flex-direction: column;
}

.admin-layout-wide .admin-create-section {
  max-width: 600px;
}

/* SSH tester inline row */
.ssh-tester-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.ssh-test-result {
  font-size: 0.8rem;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.ssh-test-ok {
  color: var(--success, #3fb950);
}

.ssh-test-fail {
  color: var(--error);
}

/* Command checkboxes in device form */
.command-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.command-checkboxes .checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.command-checkboxes .checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Inline checkbox field */
.field-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.field-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Disabled device row */
.row-disabled td {
  opacity: 0.45;
}

/* Admin toggle button */
.admin-toggle-button {
  width: auto;
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
}

/* ── Panel header with action button ── */

.panel-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header-actions .panel-header {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Device list ── */

.device-list-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 0;
  border: 1px solid rgba(89, 239, 208, 0.12);
  border-bottom: none;
  background: rgba(89, 239, 208, 0.03);
}

.device-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-filter-bar select {
  min-width: 200px;
}

.device-count-label {
  margin-left: auto;
  font-size: 0.78rem;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-on  { background: #3fb950; }
.status-dot-off { background: #f85149; opacity: 0.45; }

/* Device list table — override global min-width */
.device-list-table {
  min-width: 860px;
  table-layout: fixed;
}

.device-list-table td,
.device-list-table th {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-list-table .col-actions {
  overflow: visible;
  white-space: normal;
}

.device-list-table .col-status   { width: 30px;  text-align: center; }
.device-list-table .col-company  { width: 15%; }
.device-list-table .col-display  { width: 18%; }
.device-list-table .col-name     { width: 14%; }
.device-list-table .col-ip       { width: 15%; }
.device-list-table .col-template { width: 10%; }
.device-list-table .col-cmds     { width: 8%;   text-align: center; }
.device-list-table .col-actions  { width: auto; }

.device-port {
  opacity: 0.5;
  font-size: 0.8em;
}

.device-list-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

/* Shared base for all device row action buttons */
.device-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 0;
  color: inherit;
}

.device-action-edit {
  border-color: rgba(89, 239, 208, 0.45);
  color: var(--accent);
}

.device-action-edit:hover {
  background: rgba(89, 239, 208, 0.08);
}

.device-action-enabled {
  border-color: rgba(140, 255, 79, 0.45);
  color: var(--accent-hot);
}

.device-action-enabled:hover {
  background: rgba(140, 255, 79, 0.08);
}

.device-action-disabled {
  border-color: rgba(137, 183, 174, 0.3);
  color: var(--muted);
}

.device-action-disabled:hover {
  background: rgba(137, 183, 174, 0.06);
}

.device-action-delete {
  border-color: rgba(255, 123, 114, 0.45);
  color: var(--error);
}

.device-action-delete:hover {
  background: rgba(255, 123, 114, 0.08);
}

/* Disabled row */
.row-disabled td { opacity: 0.45; }

/* Form page header — h2 inline with cancel button */
.panel-form-title {
  font-size: 1.45rem;
  text-transform: uppercase;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.panel-form-sub {
  margin: 4px 0 18px;
  font-size: 0.9rem;
}

/* ── Device form ── */

.device-form-wrap {
  width: 100%;
}

/* 2-column grid: identity+naming side by side, rest full-width */
.device-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

/* Sections that should span both columns */
.device-form-section-full {
  grid-column: 1 / -1;
}

.device-form-section {
  padding: 14px 16px;
  border: 1px solid rgba(89, 239, 208, 0.14);
  background: rgba(4, 13, 16, 0.65);
}

.device-form-section-label {
  margin: 0 0 12px;
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* IP + Port 3:1 */
.field-grid-ip {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

/* SSH connection: IP(3fr) Port(1fr) User(2fr) Pass(2fr) Timeout(1fr) */
.device-form-conn-grid {
  display: grid;
  grid-template-columns: 3fr 1fr 2fr 2fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

/* Command checkboxes */
/* Command Read/Write 2-column grid */
.cmd-rw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid rgba(89, 239, 208, 0.12);
}

.cmd-rw-col {
  padding: 14px;
}

.cmd-rw-col:first-child {
  border-right: 1px solid rgba(89, 239, 208, 0.12);
}

.cmd-col-label {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(89, 239, 208, 0.1);
}

.cmd-col-label-read  { color: var(--read-accent); }
.cmd-col-label-write { color: var(--write-accent); }

.cmd-col-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.3;
}

.cmd-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.cmd-type {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.cmd-type-write { background: rgba(245, 166, 35, 0.15); color: #f5a623; }
.cmd-type-read  { background: rgba(63, 185, 80, 0.12);  color: #3fb950; }

/* Form footer */
.device-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Primary submit button — green */
.device-form .action-row button[type="submit"] {
  border-color: rgba(140, 255, 79, 0.6);
  color: var(--accent-hot);
}

.device-form .action-row button[type="submit"]:hover {
  border-color: var(--accent-hot);
  background: rgba(140, 255, 79, 0.08);
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Inline checkbox */
.field-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.field-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* SSH tester */
.field-grid-ssh-footer {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 8px;
}

.ssh-tester-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
}

.field-ssh-timeout {
  flex: 0 0 160px;
}

.field-ssh-timeout input {
  width: 100%;
}

.ssh-test-result  { font-size: 0.8rem; flex: 1; min-width: 0; word-break: break-word; }
.ssh-test-ok      { color: #3fb950; }
.ssh-test-fail    { color: var(--error); }

/* ── Workspace layout (sidebar + split pane) ── */
.workspace {
  display: flex;
  flex-direction: row;
  margin-top: 18px;
  min-height: 640px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 26, 33, 0.92), rgba(4, 12, 17, 0.92));
  box-shadow: 0 0 0 1px rgba(89, 239, 208, 0.08), 0 18px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.cmd-sidebar {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: rgba(4, 12, 17, 0.55);
}

.csb-section { padding: 10px 0 6px; }

/* Device section — heading mirrors the Alerts item exactly (same font/weight/size, no tint) */
.csb-section-device .csb-heading {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.7;
  padding: 6px 10px 6px 16px;
}
.csb-section-device .csb-heading:hover { opacity: 1; }
/* Caret dimmed + same glyph font (Rajdhani) as the other sections — the heading
   text is Space Mono to match Alerts, but Space Mono's ▾ renders as a tiny dot. */
.csb-section-device .csb-caret { color: var(--muted); font-family: Rajdhani, sans-serif; }

/* Stats section (Alerts) — plain, no tint */
.csb-section-stats .csb-item.dash-active { opacity: 1; }

/* Flow section — amber/warm tint (same as Alerts) */
.csb-section-flow { background: rgba(230, 175, 60, 0.05); border-left: 2px solid rgba(230, 175, 60, 0.3); }
.csb-section-flow .csb-heading { color: rgba(230, 175, 60, 0.85); }
.csb-section-flow .csb-item:hover { background: rgba(230, 175, 60, 0.10); border-left-color: #e6af3c; color: #f0c96e; }
.csb-section-flow .csb-item.dash-active { background: rgba(230, 175, 60, 0.16); border-left-color: #e6af3c; color: #f0c96e; opacity: 1; }

/* Fixed (non-collapsible) sidebar entry — e.g. Alerts */
.csb-section-fixed { padding: 6px 0; }
.csb-item-fixed { font-weight: 700; letter-spacing: .04em; opacity: 0.9; }

/* Analytics section — purple tint */
.csb-section-analytics { background: rgba(192, 140, 255, 0.05); border-left: 2px solid rgba(192, 140, 255, 0.28); }
.csb-section-analytics .csb-heading { color: rgba(192, 140, 255, 0.85); }
.csb-section-analytics .csb-item:hover { background: rgba(192, 140, 255, 0.10); border-left-color: #c08cff; color: #d4adff; }
.csb-section-analytics .csb-item.dash-active { background: rgba(192, 140, 255, 0.16); border-left-color: #c08cff; color: #d4adff; opacity: 1; }

/* Read section — blue tint */
.csb-section-read { background: rgba(30, 136, 229, 0.06); border-left: 2px solid rgba(30, 136, 229, 0.35); }
.csb-section-read .csb-heading { color: rgba(100, 181, 246, 0.85); }
.csb-section-read .csb-item:hover { background: rgba(30, 136, 229, 0.12); border-left-color: #64b5f6; color: #90caf9; }
.csb-section-read .csb-item.active { background: rgba(30, 136, 229, 0.18); border-left-color: #1e88e5; color: #90caf9; }

/* Write section — green tint */
.csb-section-write { background: rgba(67, 160, 71, 0.06); border-left: 2px solid rgba(67, 160, 71, 0.35); }
.csb-section-write .csb-heading { color: rgba(129, 199, 132, 0.85); }
.csb-section-write .csb-item:hover { background: rgba(67, 160, 71, 0.12); border-left-color: #81c784; color: #a5d6a7; }
.csb-section-write .csb-item.active { background: rgba(67, 160, 71, 0.18); border-left-color: #43a047; color: #a5d6a7; }

/* Admin section — teal accent (matches the system/privileged role) */
.csb-section-admin { background: rgba(89, 239, 208, 0.04); border-left: 2px solid rgba(89, 239, 208, 0.28); }
.csb-section-admin .csb-heading { color: rgba(89, 239, 208, 0.75); }
.csb-section-admin .csb-item:hover { background: rgba(89, 239, 208, 0.08); border-left-color: var(--accent); color: var(--accent); opacity: 1; }
.csb-section-admin .csb-item.active { background: rgba(89, 239, 208, 0.12); border-left-color: var(--accent); color: var(--accent); opacity: 1; }
/* The admin sidebar has no sub-items: per-device pages are tabs on the page
   itself (.dev-tabs), so the nav never changes shape between pages. */

/* Generic stat-item hover (fallback for items not inside a coloured section) */
.csb-item-stat:hover,
.csb-item-stat.dash-active {
  border-left-color: var(--accent);
  color: var(--accent);
  opacity: 1;
  background: rgba(89, 239, 208, 0.08);
}

/* ── Per-device admin context header ──
   Names the device you are inside and switches to a sibling without a trip
   back to the list. The static admin sidebar deliberately does not name it. */
.dev-ctx {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 .7rem;
}
.dev-ctx-back {
  font-family: 'Rajdhani', sans-serif; font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.dev-ctx-back:hover { color: var(--accent); }
.dev-ctx-select {
  background: #0b2028; border: 1px solid rgba(89,239,208,.2);
  border-radius: 4px; color: var(--text);
  font-family: 'Rajdhani', sans-serif; font-size: 1rem; font-weight: 700;
  padding: 3px 10px; outline: none; cursor: pointer; max-width: 24rem;
}
.dev-ctx-select:focus { border-color: rgba(89,239,208,.5); }
.dev-ctx-meta {
  font-family: 'Space Mono', monospace; font-size: .72rem; color: var(--muted);
}

/* ── Per-device admin tabs (Settings / NetFlow export / Blackhole) ── */
.dev-tabs {
  display: flex; gap: 4px; margin: 0 0 1.2rem;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.dev-tab {
  font-family: 'Rajdhani', sans-serif; font-size: .8rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 3px 3px 0 0;
  border: 1px solid transparent; border-bottom: none;
  color: var(--muted); text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.dev-tab:hover { color: var(--text); background: rgba(89, 239, 208, 0.05); }
.dev-tab.active {
  color: var(--accent); border-color: var(--line);
  background: rgba(89, 239, 208, 0.08);
}

/* ── Dashboard tabs ── */
.dash-tabs {
  display: flex; gap: 4px; margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.dash-tab {
  font-family: inherit; font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 3px 3px 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: none; color: var(--muted); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active {
  color: var(--accent); border-color: var(--line);
  background: var(--bg-alt); border-bottom: 1px solid var(--bg-alt);
  margin-bottom: -9px;
}

/* ── Pie chart (SVG donut) ── */
.dash-pie-wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.dash-pie-legend { display: flex; flex-direction: column; gap: .5rem; font-size: .80rem; }
.dash-pie-legend-row { display: flex; align-items: center; gap: .55rem; }
.dash-pie-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

.csb-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 12px 6px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: none;
  border: none;
  cursor: default;
  text-align: left;
}
.csb-collapsible { cursor: pointer; }
.csb-caret { font-size: 9px; transition: transform 0.15s; }
.csb-collapsible[aria-expanded="false"] .csb-caret { transform: rotate(-90deg); }

.csb-sep { height: 1px; background: var(--line); margin: 0 12px; }

.csb-list { display: flex; flex-direction: column; gap: 1px; padding: 2px 0; }
.csb-list.hidden { display: none; }

/* A block with no commands available to the user is hidden with its divider. */
.csb-section.hidden, .csb-sep.hidden { display: none; }

.csb-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px 6px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: none;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.12s, border-color 0.12s, background 0.12s;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}
.csb-item:hover { opacity: 1; background: rgba(89, 239, 208, 0.05); }

.csb-item-read:hover,
.csb-item-read.active {
  border-left-color: var(--read-accent);
  color: var(--read-accent);
  opacity: 1;
  background: var(--read-accent-soft);
}
.csb-item-write:hover,
.csb-item-write.active {
  border-left-color: var(--write-accent);
  color: var(--write-accent);
  opacity: 1;
  background: var(--write-accent-soft);
}

.csb-empty-hint {
  display: block;
  padding: 3px 16px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.4;
}

.csb-history-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.csb-history-list { flex: 1; overflow-y: auto; }
.csb-history-list .csb-item {
  font-size: 10.5px;
  opacity: 0.55;
  border-left: none;
  padding-left: 14px;
}
.csb-history-list .csb-item:hover { opacity: 0.9; border-left: none; background: rgba(89, 239, 208, 0.04); }

/* ── Split pane ── */
.workspace-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.workspace-pane { overflow-y: auto; padding: 18px 22px; }
.workspace-pane-input { flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.workspace-pane-output { flex: 1; min-width: 0; }

/* Input pane form: flex-wrap so meta-card + controls sit on same row */
#command-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
#wp-cmd-label {
  flex: 0 0 100%;
  order: 1;
}
#action-row {
  order: 6;
}

.wp-cmd-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0;
  min-height: 14px;
}
.wp-cmd-label .wp-cmd-name { color: var(--accent); letter-spacing: 0.04em; font-size: 12px; font-weight: 600; text-transform: none; }

@media (max-width: 900px) {
  .cmd-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; overflow-x: auto; overflow-y: hidden; max-height: 180px; }
  .workspace-main { flex-direction: column; }
  .workspace-pane-input { flex: none; border-right: none; border-bottom: 1px solid var(--line); }
}

/* ── Inline dashboard pane ── */
.workspace-pane-dashboard { flex: 1; overflow-y: auto; padding: 22px; }

.dash-toolbar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.dash-toolbar select {
  font-family: inherit; font-size: .8rem; font-weight: 600;
  letter-spacing: .05em; padding: 5px 14px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--bg-alt);
  color: var(--text); cursor: pointer; transition: border-color .15s, color .15s;
}
.dash-toolbar select:hover { border-color: var(--accent); color: var(--accent); }
.period-btn {
  font-family: inherit; font-size: .8rem; font-weight: 600;
  letter-spacing: .05em; padding: 5px 12px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--bg-alt);
  color: var(--text); cursor: pointer; transition: border-color .15s, color .15s;
}
.period-btn:hover { border-color: var(--accent); color: var(--accent); }
.period-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(89,239,208,.08); }
.dash-apply-btn { font-family: inherit; font-size: .75rem; padding: 4px 12px; border-radius: 3px; border: 1px solid var(--accent); color: var(--accent); background: rgba(89,239,208,.08); cursor: pointer; }
.dash-apply-btn:hover { background: rgba(89,239,208,.18); }
.dash-export-btn { margin-left: auto; }

/* ── Inline horizontal time range (Zabbix-style) ── */
.tp-device-sel {
  font-family: inherit; font-size: .8rem; font-weight: 600;
  letter-spacing: .05em; padding: 5px 14px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--bg-alt);
  color: var(--text); cursor: pointer; transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.tp-device-sel:hover { border-color: var(--accent); color: var(--accent); }

.tp-inline { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 6px; }

.tp-chip-row {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
}

.tp-chip {
  font-family: 'Space Mono', monospace; font-size: 10.5px; font-weight: 400;
  letter-spacing: .04em; padding: 4px 9px; border-radius: 3px;
  border: 1px solid transparent;
  background: transparent; color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: background .1s, color .1s, border-color .1s;
}
.tp-chip:hover { color: var(--text); background: rgba(89,239,208,.06); border-color: rgba(89,239,208,.2); }
.tp-chip.active {
  color: var(--accent); background: rgba(89,239,208,.1);
  border-color: rgba(89,239,208,.35); font-weight: 700;
}
.tp-chip-sep { width: 1px; height: 14px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
/* Calendar chips — slightly different font to visually distinguish from numeric presets */
.tp-cal-chip { font-family: inherit; font-size: 10.5px; }
.tp-chip-custom { font-family: inherit; font-size: 10.5px; }
.tp-chip-custom.active { color: var(--accent); }

.tp-custom-inline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px;
  background: rgba(89,239,208,.03); border: 1px solid rgba(89,239,208,.12);
  border-radius: 4px;
}
.tp-il-label {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); white-space: nowrap;
}
.tp-il-input {
  font-family: 'Space Mono', monospace; font-size: 11px;
  background: var(--bg); border: 1px solid rgba(89,239,208,.2);
  border-radius: 3px; color: var(--text); padding: 4px 8px;
  outline: none; transition: border-color .13s;
  color-scheme: dark;
}
.tp-il-input:focus { border-color: rgba(89,239,208,.5); }
.tp-il-input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.4) sepia(1) hue-rotate(120deg) saturate(3);
  opacity: .8; cursor: pointer;
}
.tp-il-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.tp-il-apply {
  font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: .05em;
  padding: 5px 14px; border-radius: 3px;
  border: 1px solid var(--accent); background: rgba(89,239,208,.1);
  color: var(--accent); cursor: pointer; transition: background .13s;
  white-space: nowrap;
}
.tp-il-apply:hover { background: rgba(89,239,208,.2); }
.tp-il-cancel {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px;
}
.tp-il-cancel:hover { color: var(--text); }

/* Keep old styles for any remaining references (backward compat) */
.time-picker-wrap { position: relative; }
.time-picker-btn { display: none; }   /* hidden — replaced by inline chips */
.time-picker-panel { display: none !important; }

.tp-section-label {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .11em;
  color: var(--muted); padding: 2px 8px 7px; pointer-events: none;
}
.tp-preset {
  font-family: inherit; font-size: .78rem; font-weight: 500; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 3px; border: none;
  background: transparent; color: var(--muted);
  cursor: pointer; text-align: left; transition: background .1s, color .1s; white-space: nowrap;
}
.tp-preset:hover { background: rgba(89,239,208,.07); color: var(--text); }
.tp-preset.active { color: var(--accent); background: rgba(89,239,208,.1); font-weight: 600; }
.tp-sep { width: 0; }

.tp-custom {
  display: flex; flex-direction: column; gap: .65rem;
  padding: 10px 14px 14px; min-width: 210px;
}

.tp-field { display: flex; flex-direction: column; gap: .22rem; }

.tp-field-label {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}

.tp-datetime {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 5px 8px; border-radius: 3px;
  font-family: 'Space Mono', monospace; font-size: .72rem;
  width: 100%; color-scheme: dark;
  transition: border-color .15s;
}
.tp-datetime:focus { outline: none; border-color: var(--accent); }

.tp-apply-btn {
  font-family: inherit; font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  padding: 6px 16px; border-radius: 3px;
  border: 1px solid var(--accent); background: rgba(89,239,208,.1); color: var(--accent);
  cursor: pointer; margin-top: .2rem; align-self: flex-start;
  transition: background .15s;
}
.tp-apply-btn:hover { background: rgba(89,239,208,.22); }

.dash-totals { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.dash-total-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; }
.dash-total-val { font-family: 'Space Mono', monospace; font-size: 1.4rem; color: var(--accent); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: 1.2rem 1.4rem; }
.dash-card.dash-card-wide { grid-column: 1 / -1; }
.dash-card h3 { font-size: .80rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 1rem; }

#dash-chart { width: 100%; height: 140px; display: block; overflow: visible; }
.chart-empty { font-size: .78rem; color: var(--muted); text-align: center; padding: 2rem 0; }

.bar-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; font-size: .74rem; }
.bar-row-click { border-radius: 3px; transition: background .12s; padding: 2px 4px; margin-left: -4px; margin-right: -4px; }
.bar-row-click:hover { background: rgba(255,255,255,.06); }
.bar-row-click:hover .bar-label { color: var(--read-accent); }

/* Conversations tab: sub-filters, direction balance, sortable log */
.conv-filters { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.conv-filters .tm-subseg { margin: 0; }
.conv-hint { font-size: .68rem; color: var(--muted); line-height: 1.4; margin-bottom: .6rem; }
/* A full pair label is two "ASxxxxx · Org" strings — give it most of the row
   and keep the bar wide enough to read the split. */
.conv-bal-row { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr 84px; align-items: center;
  gap: .6rem; font-size: .72rem; padding: 3px 4px; margin: 0 -4px; border-radius: 4px;
  cursor: pointer; transition: background .12s; }
.conv-bal-row:hover { background: rgba(255,255,255,.06); }
.conv-bal-row:hover .conv-bal-label { color: var(--read-accent); }
.conv-bal-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-bal-track { display: flex; height: 10px; border-radius: 3px; overflow: hidden;
  background: rgba(255,255,255,.06); }
.conv-bal-seg { height: 100%; }
.conv-bal-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.conv-th-sort { cursor: pointer; user-select: none; }
.conv-th-sort:hover { color: var(--read-accent); }

/* Spoofed flow IP samples table */
.spoof-cidr-hint { font-size: .68rem; color: var(--muted); margin-bottom: .6rem; line-height: 1.4; }
.spoof-samp-wrap { display: flex; flex-direction: column; gap: .05rem; }
.spoof-samp-row { display: grid; grid-template-columns: 150px 150px 1fr 1fr 90px; align-items: center;
  gap: .6rem; font-size: .72rem; padding: 3px 5px; border-radius: 4px; }
.spoof-samp-head { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 5px; margin-bottom: 2px; }
.spoof-samp-click { transition: background .12s; }
.spoof-samp-click:hover { background: rgba(255,255,255,.06); }
.spoof-samp-ip { font-family: 'Space Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spoof-samp-forged { color: #ff7b72; }
.spoof-samp-click:hover .spoof-samp-forged { color: var(--read-accent); }
.spoof-samp-owner { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spoof-samp-iface { color: var(--read-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spoof-samp-dim { color: var(--muted); opacity: .5; }
.spoof-samp-unres { color: #d29922; }
.spoof-samp-click:hover .spoof-samp-unres { color: var(--read-accent); }
.spoof-samp-tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.spoof-samp-tag-unres { color: #d29922; border: 1px solid #d29922; opacity: .8; }
.spoof-samp-row .r { text-align: right; }
.bar-label { width: 200px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: .72rem; }
.bar-track { flex: 1; background: rgba(255,255,255,.05); border-radius: 2px; height: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 2px; transition: width .4s; }
.bar-val { width: 64px; flex-shrink: 0; text-align: right; color: var(--muted); font-size: .68rem; font-family: 'Space Mono', monospace; }
.proto-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dash-no-data { font-size: .82rem; color: var(--muted); }
.chart-legend { display: flex; gap: 1.2rem; margin-top: .5rem; }
.chart-legend-item { display: flex; align-items: center; gap: .35rem; font-size: .68rem; color: var(--muted); }
.chart-legend-swatch { width: 16px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.top-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.top-table thead th { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .62rem; padding: .3rem .4rem; border-bottom: 1px solid var(--line); text-align: right; font-weight: 600; }
.top-table thead th:first-child { text-align: left; }
.top-table tbody td { padding: .28rem .4rem; border-bottom: 1px solid rgba(255,255,255,.03); text-align: right; font-family: 'Space Mono', monospace; font-size: .67rem; color: var(--muted); white-space: nowrap; }
.top-table tbody td:first-child { text-align: left; color: var(--text); font-family: inherit; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.top-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.chart-tooltip { position: fixed; z-index: 9999; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: .5rem .7rem; pointer-events: none; font-size: .72rem; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.ctt-time { color: var(--muted); font-size: .65rem; margin-bottom: .3rem; font-family: 'Space Mono', monospace; }
.ctt-row { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; color: var(--text); }
.ctt-sw { width: 10px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.ctt-val { margin-left: auto; font-family: 'Space Mono', monospace; color: var(--muted); }
.cdn-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: 1.2rem; }
@media (max-width: 1000px) { .cdn-cards-grid { grid-template-columns: repeat(2, 1fr); } }
.cdn-provider-card { background: var(--bg-alt); border: 1px solid var(--line); border-left: 3px solid var(--cdn-accent, #59efd0); border-radius: 6px; padding: 1rem 1.1rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.cdn-logo { width: 130px; height: 44px; object-fit: contain; opacity: .85; filter: brightness(1.1); }
.cdn-logo-placeholder { width: 130px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: .95rem; font-weight: 700; letter-spacing: .05em; }
.cdn-card-donut-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.cdn-card-donut-center { position: absolute; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.cdn-card-donut-pct { font-size: 1rem; font-weight: 700; font-family: 'Space Mono', monospace; color: var(--text); }
.cdn-card-donut-lbl { font-size: .55rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cdn-card-legend { width: 100%; display: flex; flex-direction: column; gap: .3rem; }
.cdn-card-legend-row { display: flex; align-items: center; gap: .4rem; font-size: .68rem; color: var(--text); }
.cdn-card-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cdn-card-legend-val { margin-left: auto; font-family: 'Space Mono', monospace; font-size: .62rem; color: var(--muted); }
.cdn-card-legend-rest { color: var(--muted); }

/* ── Spoofing panel ── */
.spoof-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.3rem; border-radius: 5px; margin-bottom: 1.4rem;
  border: 1px solid;
}
.spoof-clean { background: rgba(89,239,208,.06); border-color: rgba(89,239,208,.3); }
.spoof-warn  { background: rgba(255,166,87,.06); border-color: rgba(255,166,87,.35); }
.spoof-alert { background: rgba(255,123,114,.08); border-color: rgba(255,123,114,.4); }

.spoof-banner-icon {
  font-size: 1.3rem; font-weight: 700; flex-shrink: 0;
  width: 2rem; text-align: center;
}
.spoof-clean .spoof-banner-icon { color: var(--accent); }
.spoof-warn  .spoof-banner-icon { color: #ffa657; }
.spoof-alert .spoof-banner-icon { color: var(--error); }

.spoof-banner-body { flex: 1; }
.spoof-banner-title { font-size: .9rem; font-weight: 700; letter-spacing: .03em; }
.spoof-clean .spoof-banner-title { color: var(--accent); }
.spoof-warn  .spoof-banner-title { color: #ffa657; }
.spoof-alert .spoof-banner-title { color: var(--error); }
.spoof-banner-sub { font-size: .72rem; color: var(--muted); margin-top: .15rem; }

.spoof-banner-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  padding: 3px 10px; border-radius: 2px; flex-shrink: 0;
}
.spoof-clean .spoof-banner-badge { background: rgba(89,239,208,.15); color: var(--accent); }
.spoof-warn  .spoof-banner-badge { background: rgba(255,166,87,.15); color: #ffa657; }
.spoof-alert .spoof-banner-badge { background: rgba(255,123,114,.15); color: var(--error); }

.spoof-method {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem;
}
@media (max-width: 900px) { .spoof-method { grid-template-columns: 1fr; } }
.spoof-method-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 700; color: var(--text); margin-bottom: .4rem;
}
.spoof-method-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.spoof-method-desc {
  font-size: .72rem; color: var(--muted); line-height: 1.6;
}
.spoof-method-desc code {
  font-family: 'Space Mono', monospace; font-size: .68rem;
  background: rgba(89,239,208,.08); padding: 1px 5px; border-radius: 2px;
  color: var(--accent);
}

/* ── Mitigation panel ── */
.mit-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.4rem; }
.mit-chip {
  display: inline-flex; align-items: baseline; gap: .45rem;
  padding: 4px 10px; border-radius: 3px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
}
.mit-chip-k { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mit-chip-v { font-family: 'Space Mono', monospace; font-size: .7rem; color: var(--text); }

.mit-chart { width: 100%; height: 190px; display: block; overflow: visible; }

/* Target column has to hold a full IPv6 address (39 chars in Space Mono), so it
   grows with the card instead of ellipsing every v6 target at 190px. */
.mit-gauge-row {
  display: grid; grid-template-columns: minmax(190px, 360px) minmax(120px, 170px) 1fr 82px 70px;
  align-items: center; gap: .6rem; font-size: .72rem;
  padding: 3px 5px; border-radius: 4px;
}
.mit-gauge-head {
  color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 5px; margin-bottom: 2px;
}
.mit-gauge-click { cursor: pointer; transition: background .12s; }
.mit-gauge-click:hover { background: rgba(255,255,255,.06); }
.mit-gauge-click:hover .mit-gauge-ip { color: var(--read-accent); }
.mit-gauge-ip { font-family: 'Space Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mit-gauge-vec { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mit-gauge-bar { display: flex; align-items: center; gap: .5rem; }
.mit-gauge-bar .bar-track { flex: 1; display: block; }
.mit-gauge-pct { width: 40px; flex-shrink: 0; text-align: right; font-family: 'Space Mono', monospace; font-size: .68rem; }
.mit-r { text-align: right; font-family: 'Space Mono', monospace; font-size: .68rem; color: var(--muted); }
.mit-gauge-head .mit-r { font-family: inherit; font-size: .62rem; }

/* Learning window progress — shown only until the device is arm-eligible. */
.mit-learn {
  display: flex; flex-direction: column; gap: .45rem;
  margin: -.6rem 0 1.4rem; padding: .7rem .9rem; border-radius: 4px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
}
.mit-learn-row { display: grid; grid-template-columns: 170px 1fr 48px; align-items: center; gap: .7rem; }
.mit-learn-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mit-learn-row .bar-track { display: block; }
.mit-learn-row .bar-fill { display: block; background: var(--read-accent); }
.mit-learn-pct { text-align: right; font-family: 'Space Mono', monospace; font-size: .68rem; color: var(--text); }

.mit-bar-n { color: var(--muted); }
/* Learned-prefix bars pack prefix + class + IP count into one label; the shared
   200px .bar-label cut every IPv6 prefix on a wide screen. */
#mit-prof-prefixes .bar-label { width: clamp(200px, 30vw, 430px); }
/* p99 rates read "749.3 Mbps" — the shared 64px .bar-val wrapped every one. */
#mit-prof-prefixes .bar-val { width: 82px; }
.mit-pill {
  display: inline-block; font-size: .62rem; padding: 1px 7px;
  border-radius: 3px; border: 1px solid currentColor; white-space: nowrap;
}
/* One line under a card title, for panels whose value is not obvious from the
   numbers alone (a near miss means nothing until you know it is a rejection). */
.mit-card-hint {
  font-size: .66rem; line-height: 1.45; color: var(--muted);
  margin: -.35rem 0 .9rem;
}
/* Near-miss labels carry IP + kind + shape, same crowding as the prefix bars. */
#mit-near .bar-label { width: clamp(200px, 30vw, 430px); }
#mit-amp-targets { margin-top: 1rem; }

/* ── Analytics panel ── */
.an-sub { font-size: .62rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: .4rem; }
.an-table { width: 100%; border-collapse: collapse; font-size: .72rem; margin-top: .2rem; }
.an-table thead th {
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  font-size: .62rem; padding: .3rem .5rem; border-bottom: 1px solid var(--line);
  text-align: right; font-weight: 600;
}
.an-table thead th.left { text-align: left; }
.an-table tbody td {
  padding: .28rem .5rem; border-bottom: 1px solid rgba(255,255,255,.03);
  text-align: right; font-family: 'Space Mono', monospace; font-size: .67rem;
  color: var(--muted); white-space: nowrap;
}
.an-table tbody td:first-child { text-align: left; color: var(--text); font-family: inherit; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.an-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.an-share { display: flex; align-items: center; gap: .3rem; min-width: 100px; }
.an-share .bar-track { flex: 1; }

/* ── Device picker (sidebar dropdown) ── */
.csb-device-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; }
.csb-diagram-btn {
  padding: 5px 12px; font-family: inherit; font-size: 0.72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; border-radius: 3px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: background .15s, color .15s;
}
.csb-diagram-btn:hover { color: var(--accent); border-color: var(--accent); }
.csb-diagram-btn.view-toggle-btn-disabled { opacity: .3; cursor: not-allowed; }

/* ── Company filter dropdown ── */
.picker-company-filter { position: relative; }
.pcf-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px; background: transparent;
  border: 1px solid var(--line); border-radius: 3px;
  color: var(--fg); font-family: "Space Mono", monospace;
  font-size: 0.82rem; font-weight: 400; letter-spacing: .04em;
  cursor: pointer; transition: border-color .15s, color .15s; white-space: nowrap;
}
.pcf-toggle:hover { border-color: var(--accent); color: var(--accent); }
.pcf-caret { font-size: 0.7rem; opacity: .5; }
.pcf-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 180px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; z-index: 200; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.pcf-dropdown.pcf-open { display: block; }
.pcf-option {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  padding: 9px 16px; background: transparent; border: none;
  color: var(--muted); font-family: "Space Mono", monospace;
  font-size: 0.82rem; letter-spacing: .04em; cursor: pointer;
  transition: background .12s, color .12s;
}
.pcf-option + .pcf-option { border-top: 1px solid rgba(255,255,255,.04); }
.pcf-option:hover { background: rgba(89,239,208,.07); color: var(--fg); }
.pcf-option-active { color: var(--accent); }

.view-toggle { display: flex; gap: 4px; }
.view-toggle-btn {
  padding: 4px 14px; font-family: inherit; font-size: 0.78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; border-radius: 3px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: background .15s, color .15s;
}
.view-toggle-btn.active {
  background: rgba(89,239,208,.12); color: var(--accent); border-color: var(--accent);
}

.picker-company-filter .pcf-toggle { width: 100%; justify-content: space-between; }
.picker-company-filter .pcf-dropdown { width: 100%; }
.device-cards { display: flex; flex-direction: column; gap: 6px; }
.device-card {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 5px; cursor: pointer;
  background: transparent; color: var(--text); text-align: left; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.device-card:hover { border-color: var(--accent); background: rgba(89,239,208,.05); }
.device-card.is-selected { border-color: var(--accent); background: rgba(89,239,208,.1); }
.device-card-name { font-weight: 700; font-size: 0.88rem; }
.device-card-hostname { font-size: 0.72rem; color: var(--muted); margin-top: 2px; font-family: "Space Mono", monospace; opacity: .7; }
.device-card-meta { font-size: 0.72rem; color: var(--accent); margin-top: 4px; font-family: "Space Mono", monospace; opacity: .8; }
.view-toggle-btn-disabled { opacity: .3; cursor: not-allowed !important; }

/* ── Picker diagram (full-width overlay) ── */
.picker-diagram-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(2,10,14,.72);
  align-items: center; justify-content: center; padding: 24px;
}
.picker-diagram-overlay.open { display: flex; }
#picker-diagram-wrap {
  position: relative; display: flex; flex-direction: column;
  width: min(1400px, 96vw); height: min(88vh, 900px);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--bg-alt); box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.diagram-title { margin: 0 8px 0 0; font-size: 0.82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#picker-cy { flex: 1; width: 100%; height: auto; min-height: 0; }

.diagram-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: rgba(5,18,24,.8); flex-wrap: wrap;
}
.diagram-mode-btn, .picker-mode-btn {
  padding: 3px 12px; font-family: inherit; font-size: 0.75rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; border-radius: 3px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: background .15s, color .15s;
}
.diagram-mode-btn.active, .picker-mode-btn.active {
  background: rgba(89,239,208,.12); color: var(--accent); border-color: var(--accent);
}
.diagram-refresh-btn {
  padding: 3px 12px; font-family: inherit; font-size: 0.75rem; font-weight: 600;
  letter-spacing: .06em; cursor: pointer; border-radius: 3px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: background .15s, color .15s; margin-left: auto;
}
.diagram-refresh-btn:hover { color: var(--accent); border-color: var(--accent); }
.diagram-maxmin-btn {
  padding: 3px 10px; font-family: "Space Mono", monospace; font-size: 0.7rem;
  cursor: pointer; border-radius: 3px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
}
.diagram-status { font-size: 0.72rem; color: var(--muted); margin-left: 6px; }
.diagram-legend {
  display: flex; gap: 14px; font-size: 0.7rem; color: var(--muted);
  padding: 0 12px 8px; flex-wrap: wrap;
}
.legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.legend-dot-dashed {
  background: transparent !important; border: 1.5px dashed #4a7a8a;
}
.legend-dot-lldp { border-color: #6a9a55; }

/* Responsive */
@media (max-width: 700px) {
  .cmd-rw-grid      { grid-template-columns: 1fr; }
  .cmd-rw-col:first-child { border-right: none; border-bottom: 1px solid rgba(89, 239, 208, 0.12); }
  .field-grid-ip    { grid-template-columns: 2fr 1fr; }
  .panel-header-actions { flex-wrap: wrap; align-items: flex-start; }
}

/* ── Device health bar ── */
.device-health-bar {
  display: grid;
  grid-template-columns: minmax(160px,200px) auto minmax(180px,1fr) auto 160px auto 160px auto 200px auto 120px auto 120px auto;
  align-items: stretch;
  background: rgba(6, 14, 20, 0.97);
  border-top: 1px solid rgba(89, 239, 208, 0.06);
  border-bottom: 1px solid rgba(89, 239, 208, 0.14);
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  position: sticky; top: 0; z-index: 200;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  overflow: visible;
}
.device-health-bar.hidden { display: none; }

/* Graphs collapse toggle — rides on the bottom border, no extra height */
.dh-graphs-toggle {
  position: absolute;
  bottom: -9px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,14,20,0.97);
  border: 1px solid rgba(89,239,208,0.18);
  border-radius: 10px;
  cursor: pointer;
  color: rgba(89,239,208,0.35);
  font-size: 0.55rem;
  width: 40px; height: 14px;
  padding: 0;
  z-index: 201;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dh-graphs-toggle:hover {
  color: rgba(89,239,208,0.9);
  border-color: rgba(89,239,208,0.5);
  background: rgba(89,239,208,0.06);
}
.dh-graphs-toggle .dh-toggle-line { display: none; }
.dh-graphs-toggle .dh-toggle-chevron { transition: transform 0.2s; line-height: 1; }
.dh-graphs-toggle.collapsed .dh-toggle-chevron { transform: rotate(180deg); }

/* No pinned graphs: the toggle would have nothing to collapse, so hide it */
.dh-graphs-toggle.no-pins { display: none; }

/* Collapsed state: hide pinned strips without disrupting .hidden logic */
.ddp-pinned-strip.manually-hidden { display: none !important; }

/* Vertical divider */
.dh-vdiv {
  width: 1px;
  background: rgba(89, 239, 208, 0.14);
  align-self: stretch;
}

/* Section base */
.dh-sec {
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 8px 16px;
  gap: 4px;
  min-height: 72px;
}

.dh-sec-label {
  font-size: 0.60rem; letter-spacing: 0.12em;
  color: rgba(89,239,208,0.5);
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* Device section */
.dh-sec-device { min-width: 0; }
.dh-dev-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dh-vendor-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0.75;
  filter: saturate(0.7) brightness(0.9);
}
.dh-dev-name {
  font-size: 0.88rem; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.dh-dev-os {
  font-size: 0.65rem; color: rgba(89,239,208,0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dh-ssh-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.70rem; font-weight: 600;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(89,239,208,0.12);
  width: fit-content;
}
.dh-ssh-pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(89,239,208,0.2);
}
.csb-device-hdr { display: flex; align-items: center; gap: 6px; }
.csb-device-hdr .csb-heading { flex: 1; min-width: 0; }
.csb-device-close {
  flex: 0 0 auto; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  width: 20px; height: 20px; border-radius: 4px; line-height: 1; font-size: 0.72rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.csb-device-close[hidden] { display: none; }
.csb-device-close:hover { color: #dc5050; border-color: #dc5050; }
/* Empty state (no device selected) */
.ws-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-height: 320px; color: var(--muted); text-align: center;
}
.ws-empty-state[hidden] { display: none; }
.ws-empty-icon { font-size: 2.4rem; opacity: .5; }
.ws-empty-msg { font-size: 0.9rem; letter-spacing: .02em; }
/* No device: hide only the command panes — Flow/Alerts dashboards are device-independent */
.workspace-main.no-device > #wp-input,
.workspace-main.no-device > #wp-output { display: none !important; }
.dh-ssh-ok   { color: #4ecd95; }
.dh-ssh-ok::before  { background: #4ecd95; box-shadow: 0 0 6px rgba(78,205,149,0.6); }
.dh-ssh-err  { color: #dc5050; }
.dh-ssh-err::before { background: #dc5050; }
.dh-ssh-warn { color: #e6af3c; }

/* Count sections */
.dh-counts { display: flex; flex-direction: column; gap: 4px; }
.dh-count-row {
  font-size: 0.84rem; font-weight: 700; line-height: 1.1;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dh-count-row::before { content: "●"; font-size: 0.58rem; flex-shrink: 0; opacity: 0.8; }
.dh-count-row.dh-down::before { content: "●"; opacity: 0.65; }

/* Sparkline sections */
.dh-spark-row {
  display: flex; align-items: center; gap: 5px;
}
/* Replaced arrows ↑↓ with text labels RX/TX */
.dh-lbl {
  font-size: 0.60rem; font-weight: 700; letter-spacing: 0.04em;
  width: 18px; flex-shrink: 0; opacity: 0.75;
}
.dh-spark {
  width: 80px; height: 24px; flex-shrink: 0;
  overflow: visible;
}
.dh-spark-val {
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  min-width: 42px; text-align: right;
  color: var(--text);
}

/* CPU / RAM / Flow single stat */
.dh-sec-cpu, .dh-sec-ram, .dh-sec-flow { align-items: flex-start; }
.dh-flow-val { font-size: .78rem; font-weight: 600; color: var(--text); font-family: 'Space Mono', monospace; }
.flow-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted, #8b949e); transition: background .3s;
}
.flow-dot.active   { background: #3fb950; box-shadow: 0 0 6px #3fb95066; }
.flow-dot.inactive { background: #f85149; }
.dh-stat-pct {
  font-size: 1.2rem; font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Color tokens */
.dh-up   { color: #4ecd95; }
.dh-down { color: #dc5050; }
.dh-tx   { color: #5bd3ff; }
.dh-warn { color: #e6af3c; }

/* Live dot */
.dh-dot {
  position: absolute; right: 10px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(89,239,208,0.25);
  transition: background 0.4s;
}
.dh-dot.active { background: #4ecd95; box-shadow: 0 0 5px rgba(78,205,149,0.5); }

/* Hide the legacy SSH device card — health bar replaces it */
[data-meta-card="device"] { display: none !important; }

@keyframes dh-flash {
  0%   { background: rgba(89,239,208,0.2); }
  100% { background: transparent; }
}
.dh-changed {
  animation: dh-flash 1.8s ease-out forwards;
  border-radius: 3px; padding: 0 3px;
}

/* Expandable bar sections */
.dh-expandable {
  cursor: pointer; user-select: none;
  transition: background 0.15s;
  position: relative;
}
.dh-expandable::after {
  content: '';
  position: absolute; bottom: 0; left: 10px; right: 10px;
  height: 2px; border-radius: 1px;
  background: transparent;
  transition: background 0.2s;
}
.dh-expandable:hover { background: rgba(89,239,208,0.04); }
.dh-expandable:hover::after { background: rgba(89,239,208,0.25); }
.dh-expandable[aria-expanded="true"] { background: rgba(89,239,208,0.06); }
.dh-expandable[aria-expanded="true"]::after { background: rgba(78,205,149,0.55); }
.dh-expand-caret {
  font-size: 0.65rem; opacity: 0.55;
  transition: transform 0.2s, opacity 0.2s;
  display: inline-block;
}
.dh-expand-caret.open { transform: scaleY(-1); opacity: 0.85; }

/* ── Drop-down detail panels ──────────────────────────────────────── */
.ddp-panel {
  background: rgba(8, 18, 24, 0.98);
  border-bottom: 1px solid rgba(89,239,208,0.08);
  border-top: 1px solid rgba(89,239,208,0.06);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 10px 18px 14px;
  grid-column: 1 / -1;
}
.ddp-panel.hidden { display: none; }

.ddp-panel-hdr {
  font-size: 0.58rem; letter-spacing: 0.1em;
  color: rgba(89,239,208,0.35); text-transform: uppercase;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.ddp-loading   { color: rgba(89,239,208,0.3); }
.ddp-if-counts { color: rgba(89,239,208,0.5); font-size: 0.65rem; }

/* Time-range toggle buttons in panel header */
.ddp-time-toggle { display: flex; gap: 2px; margin-left: auto; }
.ddp-tt-btn {
  background: none; border: 1px solid rgba(89,239,208,0.18);
  color: rgba(89,239,208,0.35); font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem; padding: 1px 5px; border-radius: 3px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ddp-tt-btn:hover { color: rgba(89,239,208,0.65); border-color: rgba(89,239,208,0.4); }
.ddp-tt-btn.active { color: #4ecd95; border-color: rgba(78,205,149,0.5); }
.ddp-tt-btn.disabled { opacity: 0.3; cursor: default; }
.ddp-tt-long { color: rgba(91,211,255,0.3); border-color: rgba(91,211,255,0.15); }
.ddp-tt-long:hover { color: rgba(91,211,255,0.65); border-color: rgba(91,211,255,0.4); }
.ddp-tt-long.active { color: #5bd3ff; border-color: rgba(91,211,255,0.5); }
.ddp-tt-sep { width: 1px; background: rgba(89,239,208,0.15); margin: 1px 3px; align-self: stretch; }
.ddp-detail-loading { padding: 20px 8px; font-size: 0.65rem; color: rgba(89,239,208,0.35); text-align: center; }

/* Event console section */
/* ── Events panel ── */
.dh-sec-events { padding: 8px 16px 10px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dh-sec-events-hdr { display: flex; align-items: center; gap: 8px; }
.dh-sec-events-hdr .dh-sec-label { flex-shrink: 0; }
.dh-ev-ftabs { display: flex; gap: 6px; align-items: center; }
.dh-ev-ftab {
  font-size: 0.58rem; font-family: 'Space Mono', monospace; letter-spacing: .05em;
  color: rgba(89,239,208,0.28); cursor: pointer; user-select: none;
  transition: color .15s;
}
.dh-ev-ftab:hover { color: rgba(89,239,208,0.6); }
.dh-ev-ftab.active { color: rgba(89,239,208,0.9); border-bottom: 1px solid rgba(89,239,208,0.6); }
.dh-ev-alerts-link {
  margin-left: auto; background: none; border: none;
  color: rgba(89,239,208,0.4); font-size: 0.6rem; font-family: inherit;
  cursor: pointer; padding: 0; letter-spacing: .04em;
  transition: color 0.15s;
}
.dh-ev-alerts-link:hover { color: rgba(89,239,208,0.8); }
.dh-ev-colhdr {
  display: grid; grid-template-columns: 138px 36px 26px 1fr;
  gap: 4px; padding: 0 0 2px;
  border-bottom: 1px solid rgba(89,239,208,0.12);
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: .07em;
  color: rgba(89,239,208,0.3);
}
.dh-console {
  display: flex; flex-direction: column; gap: 0;
  height: 88px; overflow-y: auto; overflow-x: hidden;
  font-size: 0.65rem; font-family: 'JetBrains Mono', monospace;
}
.dh-console::-webkit-scrollbar { width: 3px; }
.dh-console::-webkit-scrollbar-thumb { background: rgba(89,239,208,0.15); border-radius: 2px; }
.dh-console-empty { color: rgba(89,239,208,0.3); font-size: 0.65rem; font-style: italic; padding: 6px 0; }
/* Zabbix-style compact row: time | status | type | description */
.dh-ev {
  display: grid; grid-template-columns: 138px 36px 26px 1fr;
  gap: 4px; align-items: center; padding: 2px 0;
  border-bottom: 1px solid rgba(89,239,208,0.04);
  white-space: nowrap; overflow: hidden;
}
.dh-ev:last-child { border-bottom: none; }
.dh-ev-time  { font-size: 0.6rem; color: rgba(89,239,208,0.35); white-space: nowrap; }
.dh-ev-badge { font-size: 0.55rem; font-weight: 700; letter-spacing: .03em; text-align: center;
               border-radius: 2px; padding: 1px 2px; }
.dh-ev-badge.ok   { color: #0d1117; background: #4ecd95; }
.dh-ev-badge.prob { color: #0d1117; background: #dc5050; }
.dh-ev-badge.warn { color: #0d1117; background: #e6af3c; }
.dh-ev-badge.info { color: #0d1117; background: rgba(89,239,208,0.6); }
.dh-ev-type  { font-size: 0.55rem; color: rgba(89,239,208,0.4); text-align: center; }
.dh-ev-desc  { overflow: hidden; text-overflow: ellipsis; cursor: default; }
/* level colors */
.dh-ev[data-level="up"]   .dh-ev-icon, .dh-ev[data-level="up"]   .dh-ev-title { color: #4ecd95; }
.dh-ev[data-level="down"] .dh-ev-icon, .dh-ev[data-level="down"] .dh-ev-title { color: #dc5050; }
.dh-ev[data-level="warn"] .dh-ev-icon, .dh-ev[data-level="warn"] .dh-ev-title { color: #e6af3c; }
.dh-ev[data-level="info"] .dh-ev-icon, .dh-ev[data-level="info"] .dh-ev-title { color: rgba(89,239,208,0.7); }
.dh-ev[data-level="error"] .dh-ev-icon, .dh-ev[data-level="error"] .dh-ev-title { color: #dc5050; }

/* Interface rows */
.ddp-iface-scroll { max-height: 320px; overflow-y: auto; }
.ddp-iface-list   { display: flex; flex-direction: column; gap: 1px; }
.ddp-empty        { color: rgba(89,239,208,0.25); font-size: 0.72rem; }

.ddp-iface-row {
  display: grid;
  grid-template-columns: 8px minmax(100px,1fr) 52px auto 24px;
  align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 3px;
  transition: background 0.15s;
}
.ddp-iface-row:hover     { background: rgba(89,239,208,0.04); }
.ddp-iface-row.is-pinned { background: rgba(78,205,149,0.04); }

.ddp-if-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; justify-self: center;
}
.ddp-if-info  { min-width: 0; }
.ddp-if-name  {
  font-size: 0.78rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.ddp-if-sep    { color: rgba(89,239,208,0.2); font-weight: 400; }
.ddp-if-status { font-size: 0.65rem; white-space: nowrap; }

.ddp-if-graph {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.ddp-mini-graph { display: block; overflow: visible; }
.ddp-if-rates   { font-size: 0.58rem; white-space: nowrap; line-height: 1; }

.ddp-pin-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.72rem; padding: 2px;
  color: rgba(89,239,208,0.18);
  transition: color 0.2s; line-height: 1;
}
.ddp-pin-btn:hover     { color: rgba(89,239,208,0.6); }
.ddp-pin-btn.is-pinned { color: #4ecd95; }

/* BGP rows */
.ddp-bgp-scroll { max-height: 340px; overflow-y: auto; }
.ddp-bgp-list   { display: flex; flex-direction: column; gap: 3px; }

/* AS group container */
.ddp-bgp-group { display: flex; flex-direction: column; border-radius: 4px; overflow: hidden; }
.ddp-bgp-group.is-pinned > .ddp-bgp-group-hdr { background: rgba(89,239,208,0.08); }

/* Group header — AS number + name, flow graph, pin button */
.ddp-bgp-group-hdr {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 6px 10px;
  background: rgba(89,239,208,0.07);
  border-bottom: 1px solid rgba(89,239,208,0.1);
}
.ddp-bgp-group-as { display: flex; flex-direction: column; min-width: 0; }
.ddp-bgp-group-as-num  { font-size: 0.75rem; color: rgba(89,239,208,0.75); font-weight: 600; white-space: nowrap; }
.ddp-bgp-group-as-name { font-size: 0.65rem; color: rgba(89,239,208,0.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pin button (BGP group) */
.ddp-bgp-pin-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; line-height: 1; padding: 2px 3px;
  color: rgba(89,239,208,0.25); transition: color 0.15s;
  flex-shrink: 0;
}
.ddp-bgp-pin-btn:hover, .ddp-bgp-pin-btn.is-pinned { color: rgba(89,239,208,0.8); }

/* Per-peer sub-row inside a group */
.ddp-bgp-sub-row {
  display: grid;
  grid-template-columns: 14px minmax(140px, 1fr) 80px 180px 100px;
  align-items: center; gap: 10px;
  padding: 4px 10px 4px 28px;
  background: rgba(89,239,208,0.02);
  border-left: 2px solid rgba(89,239,208,0.08);
  cursor: pointer;
  transition: background 0.15s;
  min-width: 0;
}
.ddp-bgp-sub-row:hover { background: rgba(89,239,208,0.05); }
.ddp-bgp-sub-row.is-expanded { background: rgba(89,239,208,0.06); }
.ddp-bgp-peer-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

/* Expanded detail chart area (below a sub-row) */
.ddp-bgp-detail {
  padding: 6px 8px 8px 24px;
  background: rgba(89,239,208,0.02);
  border-top: 1px solid rgba(89,239,208,0.06);
}
.ddp-bgp-detail.hidden { display: none; }

.ddp-bgp-dot-wrap {
  position: relative; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ddp-change-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid #e6af3c;
  animation: ddp-ring-pulse 2s ease-in-out infinite;
}
@keyframes ddp-ring-pulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%       { opacity: 0.2; transform: scale(1.5); }
}

.ddp-bgp-peer    { font-size: 0.75rem; color: var(--text); font-family: 'Space Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ddp-bgp-desc    { font-size: 0.70rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ddp-bgp-state   { font-size: 0.70rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ddp-bgp-updown  { font-size: 0.68rem; color: rgba(89,239,208,0.5); white-space: nowrap; text-align: right; min-width: 0; }
.ddp-bgp-routes  { font-size: 0.70rem; white-space: nowrap; text-align: right; font-family: 'Space Mono', monospace; }

.ddp-bgp-graph {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.ddp-bgp-graph .ddp-mini-graph { width: 200px; flex-shrink: 0; }
.ddp-bgp-graph .ddp-if-rates {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 0.6rem; white-space: nowrap; text-align: right; line-height: 1.25;
}

/* Expanded interface detail chart */
.ddp-iface-detail {
  padding: 6px 6px 8px 24px;
  background: rgba(89,239,208,0.02);
  border-radius: 0 0 4px 4px;
  border-top: 1px solid rgba(89,239,208,0.06);
}
.ddp-iface-detail.hidden { display: none; }
.ddp-iface-row.is-expanded { background: rgba(89,239,208,0.05); border-radius: 4px 4px 0 0; }
.ddp-iface-row { cursor: pointer; }
.ddp-big-graph { display: block; overflow: visible; max-width: 100%; height: auto; }

.ddp-detail-controls {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px 4px;
  border-bottom: 1px solid rgba(89,239,208,0.06);
}
.ddp-dt-btn {
  background: none; border: 1px solid rgba(89,239,208,0.18); border-radius: 3px;
  color: rgba(89,239,208,0.38); font-size: 0.62rem; font-family: inherit;
  padding: 2px 7px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.ddp-dt-btn:hover  { color: rgba(89,239,208,0.7); border-color: rgba(89,239,208,0.45); }
.ddp-dt-btn.active { color: #59efd0; border-color: rgba(89,239,208,0.55); font-weight: 600; }
.ddp-detail-chart { overflow: hidden; transition: opacity 0.18s ease; }
.ddp-bgp-detail .ddp-detail-controls { justify-content: flex-end; }

@keyframes ddp-now-ping {
  0%   { r: 3;  opacity: 0.7; }
  100% { r: 11; opacity: 0;   }
}
.ddp-now-ping { animation: ddp-now-ping 2.4s ease-out infinite; }
.ddp-detail-nodata {
  padding: 20px 8px;
  font-size: 0.7rem; color: rgba(89,239,208,0.35);
  text-align: center; line-height: 1.8;
}
.ddp-detail-nodata span { font-size: 0.6rem; }

/* Persistent pinned interfaces strip */
.ddp-pinned-strip {
  display: flex; flex-wrap: wrap; gap: 0; align-items: stretch;
  border-top: 1px solid rgba(89,239,208,0.16);
  background: rgba(4,12,18,0.5);
  padding: 0;
  font-family: 'JetBrains Mono', monospace;
  grid-column: 1 / -1;
}
.ddp-pinned-strip.hidden { display: none; }
.ddp-pinned-item {
  display: flex; flex-direction: column; gap: 4px;
  flex: 0 0 220px;
  overflow: hidden;
  padding: 8px 14px 8px 12px;
  border-right: 1px solid rgba(89,239,208,0.1);
  border-left: 3px solid rgba(89,239,208,0.25);
  cursor: pointer;
  transition: background 0.15s, border-left-color 0.15s;
  margin: 0;
}
.ddp-pinned-item:hover {
  background: rgba(89,239,208,0.05);
  border-left-color: rgba(89,239,208,0.6);
}
.ddp-pinned-item:hover .ddp-pinned-name,
.ddp-pinned-item:hover .ddp-bgp-group-as-num { color: rgba(89,239,208,0.9); }
.ddp-pinned-item:last-child { border-right: none; }
.ddp-pinned-name {
  font-size: 0.68rem; color: rgba(89,239,208,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; letter-spacing: 0.02em;
}
/* BGP pinned strip: AS number + org name stacked vertically */
.ddp-pinned-bgp-name {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;  /* required for text-overflow ellipsis inside flex */
}
.ddp-pinned-bgp-name .ddp-bgp-group-as-num  { font-size: 0.7rem; }
.ddp-pinned-bgp-name .ddp-bgp-group-as-name { font-size: 0.6rem; min-width: 0; }
/* ddp-pinned-graph-row only used for legacy BGP flow mini-graph layout */
.ddp-pinned-graph-row {
  display: flex; align-items: center; gap: 12px;
}
.ddp-pinned-graph-row .ddp-mini-graph { flex: 1 1 0; min-width: 0; width: 0; }
/* Mini-graph inside pinned item (direct child, no wrapper) */
.ddp-pinned-item > .ddp-mini-graph { width: 100%; display: block; margin: 2px 0; }
/* Replaced .ddp-pinned-rates with .ddp-pinned-stats (last/avg/max) */
.ddp-pinned-stats {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 3px;
}
.ddp-stat-row {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 0.62rem; line-height: 1.25; white-space: nowrap;
}
.ddp-stat-lbl {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.05em;
  width: 16px; flex-shrink: 0; opacity: 0.75;
}
.ddp-stat-val {
  font-weight: 700; min-width: 36px;
}
.ddp-stat-meta {
  color: rgba(89,239,208,0.38); font-size: 0.58rem;
}

/* Tooltip stat sub-row (avg/max below the value) */
.ctt-stat-row {
  font-size: 0.62rem; color: rgba(89,239,208,0.45);
  padding: 0 8px 4px 20px; letter-spacing: 0.02em;
}

/* ── Data Explorer ── */
.exp-topbar {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .75rem 1rem; background: rgba(0,0,0,.2);
  border-bottom: 1px solid var(--line);
}
.exp-pills {
  display: flex; gap: .4rem; flex-wrap: wrap;
}
.exp-pill {
  padding: .3rem .9rem; background: transparent;
  border: 1px solid var(--line); border-radius: 20px;
  color: var(--muted); font-family: "Rajdhani", sans-serif;
  font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.exp-pill:hover { border-color: var(--accent); color: var(--accent); }
.exp-pill-active {
  border-color: var(--accent); color: var(--accent);
  background: rgba(89,239,208,.08);
}
.exp-filter-row { display: flex; align-items: center; gap: .5rem; min-height: 30px; }
.exp-filter-group { display: flex; align-items: center; gap: .4rem; }
.exp-input {
  padding: .28rem .6rem; background: rgba(0,0,0,.3);
  border: 1px solid var(--line); border-radius: 3px;
  color: var(--text); font-family: "Space Mono", monospace;
  font-size: .74rem; width: 200px; outline: none;
}
.exp-input:focus { border-color: var(--accent); }
.exp-select {
  padding: .28rem .6rem; background: rgba(0,0,0,.3);
  border: 1px solid var(--line); border-radius: 3px;
  color: var(--text); font-family: "Space Mono", monospace;
  font-size: .74rem; outline: none; cursor: pointer;
}
.exp-select:focus { border-color: var(--accent); }
.exp-apply-btn {
  padding: .28rem .8rem; background: rgba(89,239,208,.1);
  border: 1px solid var(--accent); border-radius: 3px;
  color: var(--accent); font-family: "Rajdhani", sans-serif;
  font-size: .76rem; font-weight: 700; letter-spacing: .06em;
  cursor: pointer; transition: background .15s;
}
.exp-apply-btn:hover { background: rgba(89,239,208,.2); }
.exp-clear-val {
  padding: .18rem .5rem; background: transparent;
  border: 1px solid rgba(255,255,255,.12); border-radius: 3px;
  color: var(--muted); font-size: .8rem; cursor: pointer;
  line-height: 1; transition: color .15s, border-color .15s;
}
.exp-clear-val:hover { color: var(--error); border-color: var(--error); }

/* Protocol pill buttons (replaces native select) */
.exp-proto-pills {
  display: flex; gap: .25rem; flex-wrap: wrap;
}
.exp-proto-pill {
  padding: .22rem .65rem; background: transparent;
  border: 1px solid var(--line); border-radius: 3px;
  color: var(--muted); font-family: "Space Mono", monospace;
  font-size: .72rem; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.exp-proto-pill:hover { border-color: var(--accent); color: var(--accent); }
.exp-proto-active {
  border-color: var(--accent); color: var(--accent);
  background: rgba(89,239,208,.1);
}

/* Active filter tag */
.exp-active-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .6rem; margin: .3rem 1rem;
  background: rgba(89,239,208,.08); border: 1px solid rgba(89,239,208,.3);
  border-radius: 20px; font-size: .75rem; color: var(--accent);
  font-family: "Space Mono", monospace;
}
.exp-tag-x {
  background: transparent; border: none; color: var(--muted);
  font-size: .85rem; cursor: pointer; padding: 0 .1rem;
  line-height: 1; transition: color .15s;
}
.exp-tag-x:hover { color: var(--error); }

/* 2×2 grid */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  padding: 12px;
}
.exp-card-a { grid-column: 1; grid-row: 1; }
.exp-card-b { grid-column: 2; grid-row: 1; }
.exp-card-c { grid-column: 1; grid-row: 2; }
.exp-card-d { grid-column: 2; grid-row: 2; }

.exp-card-title {
  margin: 0 0 .7rem; font-size: .84rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}

/* Explorer tables */
.exp-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.exp-table thead th {
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  font-size: .70rem; padding: .38rem .55rem; border-bottom: 1px solid var(--line);
  text-align: right; font-weight: 600; white-space: nowrap;
}
.exp-table thead th.exp-th-left { text-align: left; }
.exp-table thead th.exp-sortable { cursor: pointer; user-select: none; }
.exp-table thead th.exp-sortable:hover { color: var(--accent); }
.exp-arrow { opacity: .3; font-size: .70rem; }
.exp-arrow.exp-arrow-on { opacity: 1; color: var(--accent); }
.exp-table tbody td {
  padding: .38rem .55rem; border-bottom: 1px solid rgba(255,255,255,.035);
  text-align: right; font-family: 'Space Mono', monospace; font-size: .78rem;
  color: var(--muted); white-space: nowrap;
}
.exp-td-left { text-align: left !important; color: var(--text) !important;
  font-family: inherit !important; font-size: .84rem !important;
  overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.exp-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.exp-td-share { min-width: 80px; }
.exp-share-bar { display: block; height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; }
.exp-share-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .3s; }

.exp-dir-badge {
  display: inline-block; margin-left: .4rem; padding: .05rem .35rem;
  background: rgba(89,239,208,.08); border: 1px solid rgba(89,239,208,.2);
  border-radius: 3px; font-size: .6rem; color: var(--muted); font-weight: 400;
  letter-spacing: .04em; vertical-align: middle;
}
.exp-pfx-link {
  color: var(--read-accent); cursor: pointer; text-decoration: underline;
  text-decoration-style: dotted; font-family: 'Space Mono', monospace;
}
.exp-pfx-link:hover { color: var(--accent); }
.exp-pfx-row { cursor: pointer; }
.exp-pfx-row:hover td { background: rgba(89,239,208,.04) !important; }
/* Pie container inside card C (prefix mode) */
#exp-pfx-pie-wrap .dash-pie-wrap {
  padding-top: .4rem; flex-wrap: wrap;
}
.exp-no-data {
  color: var(--muted); font-size: .82rem; text-align: center;
  padding: 1.5rem; opacity: .6;
}

/* ── Prefix multi-section dashboard (exp-pfx-dashboard) ────────────────────── */
#exp-pfx-dashboard {
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  padding-bottom: 12px;
}
.ep-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 12px 0;
}
.ep-row-full {
  grid-template-columns: 1fr;
}
.ep-row:last-child {
  padding-bottom: 12px;
}
/* Horizontal bar chart */
.ep-hbar-wrap { padding: .3rem 0; }
.ep-hbar-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .28rem 0;
  border-bottom: 1px solid rgba(255,255,255,.035);
}
.ep-hbar-label {
  font-size: .77rem;
  color: var(--text);
  min-width: 140px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.ep-hbar-track {
  flex: 1;
  height: 12px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
}
.ep-hbar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s;
}
.ep-hbar-val {
  font-size: .74rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  min-width: 78px;
  text-align: right;
}

/* Clickable link cells in prefix dashboard tables */
.ep-link {
  color: var(--read-accent);
  cursor: pointer;
  text-decoration: none;
}
.ep-link:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.ep-link.ep-ip { color: var(--read-accent); }   /* monospace IP keeps the link colour */
/* IP address cell */
.ep-ip {
  font-family: 'Space Mono', monospace;
  font-size: .77rem;
  color: var(--text);
}
/* Clickable row highlight */
.ep-clickable-row { cursor: pointer; }
.ep-clickable-row:hover td { background: rgba(89,239,208,.05) !important; }
/* Sortable header in ep tables */
.ep-sortable { cursor: pointer; user-select: none; }
.ep-sortable:hover { color: var(--accent); }


/* ── Detail chart modal ── */
.dm {
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center;
}
.dm.hidden { display: none; }
.dm-bd {
  position: absolute; inset: 0;
  background: rgba(5,12,18,0.78);
  backdrop-filter: blur(4px);
}
.dm-dlg {
  position: relative; z-index: 1;
  width: min(1320px, 94vw);
  background: rgba(8,18,24,0.98);
  border: 1px solid rgba(89,239,208,0.18);
  border-radius: 6px;
  padding: 14px 18px 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  font-family: 'JetBrains Mono', monospace;
}
.dm-hdr {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(89,239,208,0.08);
  padding-bottom: 10px;
}
.dm-title {
  font-size: 0.82rem; font-weight: 600; color: rgba(89,239,208,0.8);
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-tabs { display: flex; gap: 3px; }
.dm-close {
  background: none; border: 1px solid rgba(89,239,208,0.2); border-radius: 4px;
  color: rgba(89,239,208,0.45); font-size: 1rem; width: 26px; height: 26px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s; flex-shrink: 0;
}
.dm-close:hover { color: rgba(89,239,208,0.9); border-color: rgba(89,239,208,0.55); }
.dm-body { min-height: 320px; }
.dm .ddp-detail-close { display: none; }

/* Inline detail close button */
.ddp-detail-close {
  margin-left: auto;
  background: none; border: 1px solid rgba(89,239,208,0.18); border-radius: 3px;
  color: rgba(89,239,208,0.35); font-size: 0.6rem; font-family: inherit;
  padding: 2px 7px; cursor: pointer; line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}
.ddp-detail-close:hover { color: rgba(89,239,208,0.8); border-color: rgba(89,239,208,0.5); }

/* ── Alerts tab ──────────────────────────────────────── */
.alerts-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.alerts-filters { display: flex; gap: 2px; }
.alerts-filter {
  background: none; border: 1px solid transparent; border-radius: 3px;
  color: rgba(89,239,208,0.45); font-family: 'Space Mono', monospace;
  font-size: .6rem; padding: 2px 7px; cursor: pointer; transition: color .15s, border-color .15s;
}
.alerts-filter:hover { color: rgba(89,239,208,.75); border-color: rgba(89,239,208,.25); }
.alerts-filter.active { color: #59efd0; border-color: rgba(89,239,208,.45); }
.alerts-range { margin-left: auto; }
.alerts-table { width: 100%; border-collapse: collapse; font-size: .7rem; font-family: 'JetBrains Mono', monospace; }
.alerts-table th {
  text-align: left; font-size: .6rem; text-transform: uppercase; letter-spacing: .06em;
  color: rgba(89,239,208,.4); border-bottom: 1px solid rgba(89,239,208,.1);
  padding: 4px 8px; white-space: nowrap;
}
.alerts-table td { padding: 4px 8px; border-bottom: 1px solid rgba(89,239,208,.04); vertical-align: top; }
.alerts-table tr:last-child td { border-bottom: none; }
.alerts-table tr:hover td { background: rgba(89,239,208,.03); }
.alerts-td-time   { white-space: nowrap; color: rgba(89,239,208,.5); }
.alerts-td-recov  { white-space: nowrap; color: #4ecd95; }
.alerts-td-dur    { white-space: nowrap; color: rgba(89,239,208,.35); }
.alerts-td-status .dh-ev-badge { display: inline-block; }
.alerts-td-type   { color: rgba(89,239,208,.4); }
.alerts-td-event  { color: rgba(89,239,208,.85); max-width: 340px; }
.alerts-td-detail { color: rgba(89,239,208,.35); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerts-empty { text-align: center; color: rgba(89,239,208,.25); padding: 2rem 0 !important; font-style: italic; }

/* ── CDN Provider Detail tab ─────────────────────────────── */
.cdnp-selector { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.cdnp-pill {
  display: flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 4px 12px 4px 8px;
  cursor: pointer; font-size: .7rem; color: rgba(89,239,208,.55);
  transition: all .15s;
}
.cdnp-pill:hover { border-color: rgba(89,239,208,.4); color: rgba(89,239,208,.9); }
.cdnp-pill.active { border-color: var(--pill-color, #59efd0); color: #fff; background: rgba(89,239,208,.08); }
.cdnp-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pill-color, #59efd0); }
.cdnp-kpis { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: .75rem; padding: .6rem 1rem; background: var(--bg-alt); border-radius: 6px; border: 1px solid var(--line); }
.cdnp-kpi { display: flex; flex-direction: column; gap: .15rem; }
.cdnp-kpi-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cdnp-kpi-val { font-size: 1rem; font-weight: 700; font-family: 'Space Mono', monospace; color: var(--text); }
.cdnp-charts { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; margin-bottom: 1rem; }
.cdnp-chart-main { display: flex; flex-direction: column; gap: .4rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; }
.cdnp-chart-side { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.cdnp-chart-title { font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cdnp-chart-legend { display: flex; gap: 1.2rem; font-size: .65rem; color: var(--muted); }
.cdnp-legend-item { display: flex; align-items: center; gap: .3rem; }
.cdnp-legend-dot { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.cdnp-empty { color: var(--muted); font-size: .75rem; padding: 2rem 0; text-align: center; font-style: italic; }
.cdnp-section { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.cdnp-section-title { font-size: .80rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .25rem; }
.cdnp-kpi-table { font-size: .7rem; font-family: 'Space Mono',monospace; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .4rem; }
.cdnp-kpi-hdr, .cdnp-kpi-row { display: grid; grid-template-columns: 100px 1fr 1fr 1fr 1fr; gap: .4rem; padding: 2px 0; }
.cdnp-kpi-hdr { color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; }
.cdnp-kpi-label-in  { color: #4ecd95; }
.cdnp-kpi-label-out { color: rgba(89,239,208,.5); }
.cdnp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.cdnp-half { margin-bottom: 0; }
.cdnp-donuts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }
.cdnp-donut-wrap { margin-bottom: 0; min-height: 200px; }

/* ── CDN Filter Pills ────────────────────────────────── */
.cdn-breadcrumb { display: flex; align-items: center; gap: .35rem; margin-bottom: .75rem; flex-wrap: wrap; }

/* Unified pill style — CDN home + provider pills share same base */
.cdn-bc-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  background: none; border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 2px 8px 2px 6px;
  cursor: pointer; font-size: .62rem; color: rgba(255,255,255,.4);
  font-family: 'Space Mono', monospace; letter-spacing: .03em;
  transition: border-color .15s, color .15s, background .15s; white-space: nowrap;
}
.cdn-bc-pill:hover { border-color: var(--pill-color, #59efd0); color: #fff; }
.cdn-bc-pill.cdn-bc-active {
  border-color: var(--pill-color, #59efd0);
  color: #fff;
  background: rgba(255,255,255,.05);
}
/* CDN home pill — teal accent */
.cdn-bc-home { --pill-color: #59efd0; }
.cdn-bc-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pill-color, #59efd0); flex-shrink: 0; }

/* ── CDN Overview top row — two equal cards ─────────── */
.cdn-overview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }

/* Card 1: CDN vs Total — horizontal: donut left, KPI block right */
.cdn-vs-card h3 { margin-bottom: .65rem; }
.cdn-vs-layout { display: flex; align-items: center; gap: 1.6rem; }
.cdn-vs-donut-el { flex-shrink: 0; }
.cdn-vs-kpis { flex: 1; display: flex; flex-direction: column; gap: .55rem; }
.cdn-vs-kpi-row { display: flex; align-items: center; gap: .75rem; }
.cdn-vs-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.cdn-vs-dot-gen { background: #2a3a45; border: 1px solid rgba(255,255,255,.2); }
.cdn-vs-kpi-body { display: flex; flex-direction: column; gap: .05rem; }
.cdn-vs-kpi-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cdn-vs-kpi-val { font-size: 1.9rem; font-weight: 700; font-family: 'Space Mono', monospace; color: #59efd0; line-height: 1.1; }
.cdn-vs-kpi-val-gen { color: var(--text); }
.cdn-vs-kpi-pct { font-size: .88rem; font-family: 'Space Mono', monospace; color: var(--muted); }
.cdn-vs-kpi-divider { height: 1px; background: rgba(255,255,255,.06); margin: .5rem 0; }

/* Card 2: By Provider — donut left, list right; align to top */
.cdn-by-prov-pie { align-items: flex-start; }

/* ── Donut slice hover + tooltip ───────────────────── */
svg path[data-idx] { cursor: pointer; transition: opacity .12s, filter .12s; }
svg path[data-idx]:hover { opacity: 1 !important; filter: brightness(1.18) drop-shadow(0 0 4px currentColor); }

#_donut-tt {
  position: fixed; display: none; pointer-events: none; z-index: 9999;
  align-items: center; gap: .45rem;
  background: rgba(6,14,20,.97);
  border: 1px solid rgba(89,239,208,.3);
  border-radius: 5px; padding: 5px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.55);
}
.donut-tt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-tt-label { font-size: .72rem; font-family: inherit; color: #fff; white-space: nowrap; }
.donut-tt-pct { font-size: .72rem; font-family: 'Space Mono', monospace; color: #59efd0; white-space: nowrap; margin-left: .2rem; }
.donut-tt-bytes { font-size: .68rem; font-family: 'Space Mono', monospace; color: var(--muted); white-space: nowrap; }

/* ════════════════════════════════════════════════════════════
   COOKBOOK ADMIN COMPONENTS  — edgeguard-cookbook.css §§ 5–7
   Class names: setcard, setrow, metricgrid, logtable, pill…
   Only one conflict with existing codebase: cookbook's .field
   is renamed .ck-field here (existing .field is vertical stack).
   ════════════════════════════════════════════════════════════ */

/* ── Typography helpers ───────────────────────────────────── */
.label {
  font-family: var(--display, 'Rajdhani', sans-serif);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.h-block {
  font-family: var(--display, 'Rajdhani', sans-serif);
  font-weight: 600; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0;
}

/* ── Panel head / body ───────────────────────────────────── */
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(89,239,208,.12);
}
.panel-body { padding: 18px; }

/* ── Status pill ─────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Space Mono', monospace; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok  { color: var(--accent); background: rgba(89,239,208,.08); border-color: rgba(89,239,208,.28); }
.pill.warn{ color: #f0bd55;       background: rgba(240,189,85,.14);  border-color: rgba(240,189,85,.3); }
.pill.err { color: var(--error);  background: rgba(255,123,114,.14); border-color: rgba(255,93,93,.3); }
.pill.off { color: var(--muted);  border-color: rgba(89,239,208,.12); }

/* ── Metric grid (read-only KPIs) ────────────────────────── */
.metricgrid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  background: rgba(8,20,28,.70);
  border: 1px solid rgba(89,239,208,.12);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.metricgrid .metric {
  padding: 20px 22px; border-left: 1px solid rgba(89,239,208,.12);
}
.metricgrid .metric:first-child { border-left: none; }
.metricgrid .metric .label { margin-bottom: 14px; }
.metricgrid .metric .val {
  font-family: 'Space Mono', monospace; font-size: 30px; font-weight: 500;
  color: var(--accent); line-height: 1; letter-spacing: -.01em;
}
.metricgrid .metric .val.muted { color: var(--muted); }
.metricgrid .metric .val .unit { font-size: 18px; color: var(--muted); margin-left: 4px; }
.metricgrid .metric .rule { height: 1px; background: rgba(89,239,208,.12); margin: 16px 0 12px; }
.metricgrid .metric .sub { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); }

/* ── Stat list ───────────────────────────────────────────── */
.statlist .statrow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-top: 1px solid rgba(89,239,208,.12);
}
.statlist .statrow:first-child { border-top: none; }
.statlist .statrow .k b  { display: block; color: #dde7e3; font-size: 13px; font-weight: 600; }
.statlist .statrow .k span{ color: var(--muted); font-size: 11.5px; }
.statlist .statrow .v  { font-family: 'Space Mono', monospace; font-size: 15px; color: var(--text); }

/* ── KPI row ─────────────────────────────────────────────── */
.kpirow { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid rgba(89,239,208,.12); }
.kpi { padding: 18px 20px; border-left: 1px solid rgba(89,239,208,.12); text-align: left; }
.kpi:first-child { border-left: none; }
.kpi .big { font-family: 'Space Mono', monospace; font-size: 26px; line-height: 1; }
.kpi .big.ok      { color: var(--accent); }
.kpi .big.err     { color: var(--error); }
.kpi .big.neutral { color: #eaf2ef; }
.kpi .label { margin-top: 8px; }

/* ── Log / audit table ───────────────────────────────────── */
.logtable { width: 100%; border-collapse: collapse; font-family: 'Space Mono', monospace; font-size: 12.5px; }
.logtable th {
  text-align: left; padding: 12px 18px;
  border-bottom: 1px solid rgba(89,239,208,.12);
  font-family: 'Rajdhani', sans-serif; font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.logtable td { padding: 13px 18px; border-bottom: 1px solid rgba(89,239,208,.06); color: var(--muted); }
.logtable tr:last-child td { border-bottom: none; }
.logtable tr:hover td { background: rgba(255,255,255,.015); }
.logtable td.t { color: var(--text); }
.logtable .st { font-family: 'Rajdhani', sans-serif; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.logtable .st.ok  { color: var(--accent); }
.logtable .st.err { color: var(--error); }

/* ── Segmented control ───────────────────────────────────── */
.segmented {
  display: inline-flex; border: 1px solid rgba(89,239,208,.12); border-radius: 6px; overflow: hidden;
}
.segmented button {
  background: transparent; border: none; border-left: 1px solid rgba(89,239,208,.12);
  color: var(--muted); font-family: 'Space Mono', monospace; font-size: 11px;
  padding: 6px 12px; cursor: pointer;
}
.segmented button:first-child { border-left: none; }
.segmented button.on { background: rgba(89,239,208,.08); color: var(--accent); }
.segmented button:hover:not(.on) { color: var(--text); }

/* ── Settings card ───────────────────────────────────────── */
.setcard {
  background: rgba(8,20,28,.70);
  border: 1px solid rgba(89,239,208,.12);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.setcard > .panel-head { background: rgba(89,239,208,.04); }

/* ── Setting row ─────────────────────────────────────────── */
.setrow {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 24px;
  padding: 18px 20px; border-top: 1px solid rgba(89,239,208,.06);
}
.setrow:first-child { border-top: none; }
.setrow .meta b { display: block; color: #dde7e3; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.setrow .meta p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 560px; }
.setrow .control { display: flex; align-items: center; gap: 12px; justify-self: end; }
.setrow .state { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); }
.setrow.is-dirty { box-shadow: inset 2px 0 0 #f0bd55; }

/* ── Toggle ──────────────────────────────────────────────── */
.toggle {
  position: relative; width: 42px; height: 23px; border-radius: 999px;
  border: 1px solid rgba(89,239,208,.12); background: #0b2028;
  cursor: pointer; transition: .18s; flex: none;
  appearance: none; -webkit-appearance: none;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--muted); transition: .18s;
}
.toggle:checked { background: rgba(89,239,208,.08); border-color: rgba(89,239,208,.28); }
.toggle:checked::after { left: 21px; background: var(--accent); }

/* ── Duration input ──────────────────────────────────────── */
.duration {
  display: inline-flex; align-items: stretch;
  border: 1px solid rgba(89,239,208,.12); border-radius: 6px;
  background: #0b2028; overflow: hidden;
}
.duration input {
  width: 54px; background: transparent; border: none; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 13px;
  text-align: right; padding: 7px 8px; outline: none;
}
.duration input:focus { color: var(--accent); }
.duration .unit {
  display: flex; align-items: center; border-left: 1px solid rgba(89,239,208,.12);
  color: var(--muted); font-family: 'Space Mono', monospace; font-size: 12px;
  padding: 0 10px; background: #0b2028;
}
.duration select {
  background: #0b2028; border: none; border-left: 1px solid rgba(89,239,208,.12);
  color: var(--muted); font-family: 'Space Mono', monospace; font-size: 12px;
  padding: 0 6px; outline: none; cursor: pointer;
}

/* ── Inline field (input box) ────────────────────────────── */
.ck-field {
  display: inline-flex; align-items: center;
  border: 1px solid rgba(89,239,208,.12); border-radius: 6px;
  background: #0b2028; overflow: hidden;
}
.ck-field input {
  background: transparent; border: none; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 13px;
  padding: 7px 10px; outline: none; min-width: 120px;
}
.ck-field input:focus { color: var(--accent); }
.ck-field .suffix { color: var(--muted); font-family: 'Space Mono', monospace; font-size: 12px; padding: 0 10px 0 0; }

/* ── Select ──────────────────────────────────────────────── */
.ck-select {
  background: #0b2028; border: 1px solid rgba(89,239,208,.12);
  border-radius: 6px; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 13px;
  padding: 7px 28px 7px 10px; cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%237e8c87' stroke-width='1.5' fill='none'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.ck-select:focus { border-color: rgba(89,239,208,.28); }

/* ── Setting table (retention / compression) ─────────────── */
.settable { width: 100%; border-collapse: collapse; }
.settable th {
  text-align: left; padding: 10px 16px;
  border-bottom: 1px solid rgba(89,239,208,.12);
  font-family: 'Rajdhani', sans-serif; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.settable th.r, .settable td.r { text-align: right; }
.settable th.c, .settable td.c { text-align: center; }
.settable td { padding: 14px 16px; border-bottom: 1px solid rgba(89,239,208,.06); font-size: 13px; }
.settable tr:last-child td { border-bottom: none; }
.settable .src b   { color: #dde7e3; font-size: 13px; }
.settable .src span{ display: block; color: var(--muted); font-size: 11px; }
.settable .size { font-family: 'Space Mono', monospace; color: var(--read-accent); }

/* ── Usage bar (in settings context) ────────────────────── */
.usebar { display: grid; grid-template-columns: 120px 1fr 72px; align-items: center; gap: 14px; padding: 9px 18px; }
.usebar .nm  { font-size: 12.5px; color: var(--muted); }
.usebar .track { height: 6px; background: #10303a; border-radius: 999px; overflow: hidden; }
.usebar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--read-accent), rgba(88,160,240,.5)); }
.usebar .track i.agg { background: rgba(89,239,208,.5); }
.usebar .amt { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--read-accent); text-align: right; }

/* ── Save bar ────────────────────────────────────────────── */
.savebar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 18px; border-top: 1px solid rgba(89,239,208,.12);
  background: #0b2028; border-radius: 0 0 8px 8px;
}
.savebar .msg { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.savebar .msg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.savebar.dirty .msg { color: #f0bd55; }
.savebar.dirty .msg::before { background: #f0bd55; }
.savebar.saved .msg { color: var(--accent); }
.savebar.saved .msg::before { background: var(--accent); }
.savebar .acts { display: flex; gap: 10px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: 'Rajdhani', sans-serif; font-size: 11.5px;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; transition: .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: #a9ff4d; color: #04110d; font-weight: 600; border-color: #a9ff4d; }
.btn-primary:not(:disabled):hover { box-shadow: 0 0 0 1px #a9ff4d, 0 0 18px rgba(84,255,200,.25); }
.btn-link { background: transparent; color: var(--muted); border-color: transparent; }
.btn-link:not(:disabled):hover { color: var(--text); }
.btn-ghost-sm {
  background: transparent; border: 1px solid rgba(89,239,208,.2);
  color: var(--muted); font-family: 'Space Mono', monospace; font-size: 11px;
  padding: 5px 12px; border-radius: 4px; cursor: pointer; transition: .12s;
}
.btn-ghost-sm:hover { color: var(--accent); border-color: rgba(89,239,208,.5); }

/* ── Callout note ────────────────────────────────────────── */
.ck-note {
  border: 1px solid rgba(89,239,208,.12); border-left: 2px solid var(--accent);
  background: rgba(89,239,208,.08); padding: 12px 16px; border-radius: 6px;
  font-size: 13px; color: var(--text); margin: 16px 0;
}
.ck-note.warn { border-left-color: #f0bd55; background: rgba(240,189,85,.14); }

/* The blackhole settings form runs mode → thresholds → BGP → upstreams →
   learned classes, so a submit button at its end is off-screen from every field
   above it and reads as "there is no save button". Pin it to the viewport for
   as long as the form is on screen. */
/* `.admin-content` is `overflow-y: auto`, which makes it the nearest scrollport
   even though it never scrolls (the page does) — a sticky child inside it can
   therefore never stick. Opt this page out so the save bar pins to the viewport. */
.admin-content-sticky { overflow-y: visible; }
.bh-save-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 1.4rem; padding: 12px 16px;
  border: 1px solid rgba(89,239,208,.16); border-radius: 8px;
  background: rgba(8,20,28,.94);
  box-shadow: 0 -6px 18px rgba(2,6,10,.55);
}
.bh-save-note { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); }

/* Generated text (letter, router config, notes) is reference material, not
   something to scroll past on every visit — collapsed by default. */
.bh-fold {
  border: 1px solid rgba(89,239,208,.12); border-radius: 8px;
  background: rgba(8,20,28,.5); margin-bottom: 1rem;
}
.bh-fold > summary {
  cursor: pointer; list-style: none; padding: 12px 16px;
  font-family: 'Rajdhani', sans-serif; font-size: 1rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
}
.bh-fold > summary::-webkit-details-marker { display: none; }
.bh-fold > summary::before { content: '▸ '; }
.bh-fold[open] > summary::before { content: '▾ '; }
.bh-fold-body { padding: 0 16px 16px; }

/* Inline hint under a form field (mitigation settings). */
.bh-hint {
  display: block; margin-top: 4px;
  font-family: 'Space Mono', monospace; font-size: 10.5px;
  color: var(--muted); line-height: 1.45;
}

/* Addresses EdgeGuard derives and always spares — read-only, so chips not inputs. */
.bh-prot { display: flex; flex-wrap: wrap; gap: 6px; }
.bh-prot-chip {
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid rgba(89,239,208,.22); background: rgba(89,239,208,.07);
  font-family: 'Space Mono', monospace; font-size: 11px; color: var(--accent);
}

/* Candidates for the never-blackhole list. Cards in a responsive grid, not
   rows in a 172px scroll box: the earlier version showed three of ~40 entries
   at a time, which is unreadable for a list you decide from. Full width and
   auto-fill means the whole set is on screen at any window size. */
.bh-suggest {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.bh-suggest-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr);
  align-items: center; gap: 4px 10px;
  padding: 8px 10px; cursor: pointer;
  border: 1px solid rgba(89,239,208,.12); border-radius: 5px;
  background: #0b2028;
}
.bh-suggest-row:hover { border-color: rgba(89,239,208,.34); background: rgba(89,239,208,.05); }
.bh-suggest-row:has(input:checked) { border-color: rgba(89,239,208,.34); background: rgba(89,239,208,.06); }
.bh-suggest-row:has(input:disabled) { cursor: default; opacity: .6; }
.bh-suggest-ip {
  font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bh-suggest-meta {
  grid-column: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: 'Space Mono', monospace;
}
.bh-suggest-kind {
  padding: 1px 6px; border-radius: 3px; font-size: 9.5px;
  letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid rgba(89,239,208,.22); background: rgba(89,239,208,.08);
  color: var(--accent);
}
.bh-suggest-detail { font-size: 10.5px; color: var(--muted); }

/* The default browser checkbox is a light-theme square on a dark form.
   min-height/padding are reset because the global `input` rule sets 46px and
   10px 12px, which turned this into a tall pill. */
.bh-ck {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0;
  border: 1px solid rgba(89,239,208,.35); border-radius: 3px;
  background: #071a20; cursor: inherit; position: relative;
}
.bh-ck:checked { background: rgba(89,239,208,.9); border-color: rgba(89,239,208,.9); }
.bh-ck:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px; border: solid #06171d;
  border-width: 0 2px 2px 0; transform: rotate(40deg);
}

/* Address-space classes. The class is the blocking group (FastNetMon's CIDR
   group), so its floors live on the card and its prefixes below them. */
.bh-class-grid {
  display: grid; gap: 10px;
  /* 400px is what fits a /48 prefix + IP count + class chip + the override
     select without ellipsing the prefix, which is the row's identifier. */
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}
.bh-class-card {
  border: 1px solid rgba(89,239,208,.14); border-radius: 6px;
  background: rgba(8,20,28,.55); padding: 12px 14px;
}
.bh-class-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bh-class-badge {
  font-family: 'Rajdhani', sans-serif; font-size: .95rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent);
}
.bh-class-stats { font-family: 'Space Mono', monospace; font-size: 10.5px; color: var(--muted); }
.bh-class-floors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.bh-class-floor { display: flex; flex-direction: column; gap: 3px; }
.bh-class-floor > span {
  font-family: 'Space Mono', monospace; font-size: 10px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.bh-class-pfx { display: flex; flex-direction: column; gap: 5px; }
.bh-class-pfx-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 128px;
  align-items: center; gap: 8px;
  padding-top: 5px; border-top: 1px solid rgba(89,239,208,.08);
}
.bh-class-pfx-name {
  font-family: 'Space Mono', monospace; font-size: 11.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bh-class-pfx-ips { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--muted); }
/* Always in the DOM so every row keeps the same four grid columns; only a
   forced prefix has text in it. */
.bh-class-pfx-learned:empty { border-color: transparent; padding: 0; }
.bh-class-pfx-learned {
  padding: 1px 5px; border-radius: 3px;
  font-family: 'Space Mono', monospace; font-size: 9.5px;
  letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid rgba(89,239,208,.16); color: var(--muted);
}
/* One row per prefix, so the 46px global input height has to go or the card
   turns into a column of buttons. */
.bh-class-pfx-row .frm-input { padding: 4px 6px; min-height: 30px; font-size: 10.5px; }
.bh-class-floor .frm-input { min-height: 34px; padding: 6px 10px; }

/* ── Admin form fields inside a .setcard ──────────────────
   Shared by every admin form (device settings, NetFlow export, blackhole).
   Lived inline in admin_devices_form.html until a second page needed it. */
.frm-input, .frm-select {
  background: #0b2028; border: 1px solid rgba(89,239,208,.15);
  border-radius: 4px; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 12.5px;
  padding: 6px 10px; outline: none;
}
.frm-select { cursor: pointer; }
.frm-input:focus, .frm-select:focus { border-color: rgba(89,239,208,.4); }
.frm-input[disabled] { opacity: .5; cursor: not-allowed; }

.frm-grid { display: grid; gap: 10px; padding: 14px 20px; }
.frm-grid-2 { grid-template-columns: 1fr 1fr; }
.frm-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .frm-grid-2, .frm-grid-3 { grid-template-columns: 1fr; } }
.frm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px 14px; }
@media (max-width: 640px) { .frm-row { grid-template-columns: 1fr; } }
.frm-cell { display: flex; flex-direction: column; gap: 4px; }
.frm-cell .label { margin-bottom: 0; }
.frm-cell input, .frm-cell select, .frm-cell textarea { width: 100%; }

.test-row { display: flex; align-items: center; gap: 10px; padding: 0 20px 14px; }
.test-result { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); }
.test-result.ok  { color: var(--accent); }
.test-result.err { color: var(--error); }

/* ── Admin content tint ──────────────────────────────────── */
.admin-content { background: rgba(2,6,10,.35); }

/* ── Section spacing ─────────────────────────────────────── */
.ck-section { margin-bottom: 2rem; }
.ck-section-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.ck-section-hd h3 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 20px;
  margin: 0; color: #eaf2ef; line-height: 1.15;
}
.ck-section-hd .desc { color: var(--muted); font-size: 13px; }

/* ══════════════════════════════════════════════════════════════════
   Flow Query tab — all scoped to .fq-* to avoid global collisions
   ══════════════════════════════════════════════════════════════════ */

/* Filter section */
.fq-filter-row { padding: 14px 16px 0; }
.fq-section-label {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.fq-hint { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--warning); }
.fq-panel {
  border: 1px solid rgba(89,239,208,.2); border-radius: 7px;
  background: linear-gradient(180deg,rgba(89,239,208,.02),transparent), rgba(11,32,40,.8);
  padding: 16px 20px 12px;
}
.fq-form {
  display: grid;
  grid-template-columns: auto minmax(200px,1fr) auto minmax(200px,1fr);
  gap: 12px 18px; align-items: center;
}
@media (max-width: 860px) { .fq-form { grid-template-columns: auto 1fr; } }

.fq-flabel {
  justify-self: end; text-align: right;
  font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.fq-flabel.fq-origem { color: #58e7ff; }
.fq-flabel.fq-destino { color: var(--accent); }
.fq-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fq-dot-src { background: #58e7ff; box-shadow: 0 0 6px #58e7ff; }
.fq-dot-dst { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

.fq-fctrl { display: flex; align-items: center; gap: 7px; min-width: 0; position: relative; }
.fq-sep { color: var(--muted); font-family: 'Space Mono', monospace; font-size: 12px; }

/* Swap source ↔ destination — straddles the gap between the two input rows */
.fq-swap {
  position: absolute; right: 4px; top: calc(100% + 6px);
  transform: translateY(-50%); z-index: 4;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid rgba(89,239,208,.35);
  color: var(--accent); cursor: pointer; font-size: 15px; line-height: 1;
  box-shadow: 0 0 0 3px rgba(11,32,40,.85);
  transition: background .13s, transform .13s, box-shadow .13s;
}
.fq-swap:hover { background: rgba(89,239,208,.18); transform: translateY(-50%) scale(1.12); }
.fq-swap:active { transform: translateY(-50%) scale(.95); }

.fq-inp {
  background: var(--bg); border: 1px solid rgba(89,239,208,.15);
  border-radius: 5px; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 11.5px;
  padding: 6px 9px; outline: none; transition: .13s; height: 32px;
}
.fq-inp::placeholder { color: rgba(89,239,208,.25); }
.fq-inp:focus { border-color: rgba(89,239,208,.4); background: rgba(4,18,24,.9); }
.fq-inp-as   { width: 80px; flex-shrink: 0; }
.fq-inp-addr { flex: 1; min-width: 110px; }
.fq-inp-port { width: 100px; }

.fq-seg {
  display: inline-flex; border: 1px solid rgba(89,239,208,.15);
  border-radius: 5px; overflow: hidden; background: var(--bg);
}
.fq-seg button {
  background: transparent; border: none; border-left: 1px solid rgba(89,239,208,.1);
  color: var(--muted); font-family: 'Space Mono', monospace; font-size: 10.5px;
  padding: 6px 11px; cursor: pointer; transition: .12s; white-space: nowrap;
}
.fq-seg button:first-child { border-left: none; }
.fq-seg button:hover:not(.on) { color: var(--text); }
.fq-seg button.on { background: rgba(89,239,208,.1); color: var(--accent); }

/* Top Metrics sub-tab badges + per-block layout */
.tm-badges { display: flex; margin: 0 0 1rem; }
.tm-badges button { font-size: 11.5px; padding: 7px 16px; }
.tm-subseg { margin: 0 0 .85rem; }
.tm-block > .ep-row:first-child { margin-top: 0; }
/* CIDR line charts — one leader group per row, Download|Upload side by side */
#tm-cidr-charts { padding: 12px; display: flex; flex-direction: column; gap: 16px; }
.cidr-leader-title { margin: 0 0 8px; }
.cidr-dir-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 1 row : 2 cols (Download | Upload) */
  gap: 12px;
}
.cidr-dir-grid .cidr-chart-card { margin: 0; min-width: 0; }
.cidr-dir-title { margin: 0 0 4px; font-size: .8rem; color: var(--muted, #8b949e); font-weight: 600; }
/* Many subnet lines → wrap legend to multiple rows instead of overflowing */
#tm-cidr-charts .chart-legend { flex-wrap: wrap; gap: .35rem .9rem; }
.cidr-donut-row { grid-template-columns: repeat(3, 1fr); }
.cidr-asn { font-size: .78em; color: var(--read-accent, #59efd0); font-weight: 400; opacity: .85; }
/* Leader-title ASN: prominent chip so "AS268168 · FAST PROVEDOR…" reads clearly */
.cidr-leader-title .cidr-asn {
  opacity: 1;
  font-size: .8em;
  font-weight: 500;
  color: var(--read-accent, #59efd0);
  background: rgba(89, 239, 208, .12);
  border: 1px solid rgba(89, 239, 208, .25);
  padding: 1px 8px;
  border-radius: 5px;
  letter-spacing: .02em;
  text-transform: none;
  vertical-align: middle;
}
/* Row: tudão chart (3 cols) + leaders tree (2 cols) */
.cidr-top-grid { grid-template-columns: 3fr 2fr; }
@media (max-width: 1100px) { .cidr-top-grid { grid-template-columns: 1fr; } }
/* Leaders CIDR tree/folder */
.cidr-tree { font-size: .82rem; }
.cidr-tree-head, .cidr-tree-row {
  display: grid;
  grid-template-columns: 1fr 5.2em 5.2em 5.6em;
  gap: .4rem; align-items: center;
  padding: 3px 4px;
}
.cidr-tree-head { color: rgba(139,148,158,.7); border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 2px; }
.cidr-tree-head .ctr-v, .cidr-tree-row .ctr-v { text-align: right; font-variant-numeric: tabular-nums; }
.cidr-tree-row.cidr-tree-child { background: rgba(255,255,255,.015); }
.cidr-tree-row .ctr-name { display: flex; align-items: center; gap: .35rem; padding-left: calc(var(--depth,0) * 1.2rem); min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.cidr-tree-row .ctr-name .ep-link { flex-shrink: 0; }
.cidr-tree-row .cidr-asn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cidr-tree-row .ctr-tot { color: #e6edf3; }
.ctr-chev { cursor: pointer; width: 1rem; text-align: center; color: var(--read-accent,#59efd0); user-select: none; flex-shrink: 0; }
.ctr-nochev { width: 1rem; flex-shrink: 0; display: inline-block; }
.cidr-tree .ep-link { cursor: pointer; }
.cidr-tree .ep-link:hover { text-decoration: underline; }
/* Donut legend as aligned IP | AS | Org columns */
.asn-donut-legend.donut-cols { font-size: .72rem; }
.asn-donut-legend.donut-cols .leg-label.leg-cols {
  display: grid;
  grid-template-columns: 18ch 8ch minmax(0, 1fr);
  gap: .45rem; align-items: baseline;
}
.donut-cols .lc-ip  { color: var(--read-accent,#59efd0); }
.donut-cols .lc-as  { color: #c9d1d9; opacity: .9; }
.donut-cols .lc-org { color: rgba(139,148,158,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dash-pie-legend-row { border-radius: 4px; transition: background .1s; }
.dash-pie-legend-row.leg-hi { background: rgba(255,255,255,.06); }
.tm-block .cidr-chart-card .chart-legend { flex-wrap: wrap; gap: .35rem .9rem; }
@media (max-width: 1000px) { .cidr-donut-row { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .cidr-dir-grid { grid-template-columns: 1fr; } }
/* Overview strip inside the IP block — align with .ep-row's 12px side padding */
.tm-ov-totals { padding: 0 12px; margin-bottom: .6rem; }
/* 3-card overview row: Traffic-over-time (2fr) | IPv4-vs-IPv6 timeline (2fr) | share donut (1fr) */
.tm-ov-grid { grid-template-columns: 2fr 2fr 1fr; }
.tm-ov-grid .dash-pie-wrap { flex-direction: column; align-items: center; gap: .6rem; }
@media (max-width: 1100px) { .tm-ov-grid { grid-template-columns: 1fr; } }
/* Interface cell: name (bright) + alias/description (accent, readable) */
.if-name  { color: var(--text); }
.if-alias { color: var(--accent); margin-left: .55ch; }

/* Share donut (ASN, Protocol, Ports, Interfaces): chart on top, legend below */
#ep-asn-src-pie, #ep-asn-dst-pie, #ep-proto-pie, #ep-port-pie,
#ep-if-in-pie, #ep-if-out-pie, #ep-peers-mbps-pie, #ep-peers-vol-pie,
.tm-share-pie { display: block; }
.asn-donut-chart { display: flex; justify-content: center; margin: .4rem 0 .9rem; }
.asn-donut-legend { display: flex; flex-direction: column; gap: .12rem; }
.asn-donut-legend .dash-pie-legend-row { display: flex; align-items: center; gap: .5rem; font-size: .72rem; }
.asn-donut-legend .leg-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asn-donut-legend .leg-pct,
.asn-donut-legend .leg-bytes { flex: 0 0 auto; text-align: right; font-family: 'Space Mono', monospace; font-size: .66rem; color: var(--muted); }
.asn-donut-legend .leg-pct { width: 46px; }
.asn-donut-legend .leg-bytes { width: 82px; }

/* Concentration panel: one 100% bar cut into rank bands. Deliberately short —
   it sits beside a full-height donut and must not stretch the grid row. */
.cb-bar {
  display: flex; height: 26px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,.04); margin: .3rem 0 .7rem;
}
.cb-seg { height: 100%; transition: filter .12s; }
.cb-seg:hover { filter: brightness(1.25); }
.cb-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .7rem; color: var(--muted); }
.cb-leg { display: inline-flex; align-items: center; gap: 6px; }
.cb-leg i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.cb-leg b { color: var(--text); font-family: 'Space Mono', monospace; font-weight: 600; }
.cc-insight { margin-top: .7rem; font-size: .7rem; color: var(--muted); }

.fq-actions {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(89,239,208,.08);
}
.fq-btn {
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 12px;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 8px 22px; border-radius: 5px; cursor: pointer;
  border: 1px solid rgba(89,239,208,.25); background: transparent;
  color: var(--muted); transition: .13s;
}
.fq-btn:hover { color: var(--text); border-color: rgba(89,239,208,.5); }
.fq-btn-primary {
  background: #a9ff4d; color: #04110d; border-color: transparent; font-weight: 700;
}
.fq-btn-primary:hover { background: #b9ff66; box-shadow: 0 0 14px rgba(169,255,77,.3); color: #04110d; }

/* Insights strip */
.fq-insights {
  display: grid; grid-template-columns: repeat(6,1fr);
  border-top: 1px solid rgba(89,239,208,.08); margin-top: 12px;
}
@media (max-width: 860px) { .fq-insights { grid-template-columns: repeat(3,1fr); } }
.fq-kpi {
  padding: 12px 16px;
  border-right: 1px solid rgba(89,239,208,.06);
}
.fq-kpi:last-child { border-right: none; }
.fq-kpi-label {
  font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.fq-kpi-val {
  font-family: 'Space Mono', monospace; font-size: 22px; color: var(--accent); line-height: 1;
}
.fq-kpi-val .fq-u { font-size: 12px; color: var(--muted); margin-left: 2px; }
.fq-info   { color: #58e7ff !important; }
.fq-warn   { color: var(--warning) !important; }
.fq-neutral{ color: #eaf2ef !important; }
.fq-up     { color: var(--accent); }
.fq-dn     { color: var(--error); }
.fq-kpi-sub { font-family: 'Space Mono', monospace; font-size: 9.5px; color: var(--muted); margin-top: 5px; }

/* Result header + view switcher */
.fq-result-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px 8px; flex-wrap: wrap;
}
.fq-result-title {
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 15px; color: #eaf2ef;
}
.fq-vswitch {
  display: inline-flex; background: rgba(11,32,40,.8);
  border: 1px solid rgba(89,239,208,.15); border-radius: 5px; overflow: hidden;
}
.fq-vswitch button {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: none; border-left: 1px solid rgba(89,239,208,.1);
  color: var(--muted); font-family: 'Rajdhani', sans-serif; font-weight: 600;
  font-size: 11px; letter-spacing: .04em; padding: 7px 13px; cursor: pointer; transition: .13s;
}
.fq-vswitch button:first-child { border-left: none; }
.fq-vswitch button:hover:not(.on) { color: var(--text); background: rgba(255,255,255,.02); }
.fq-vswitch button.on { background: rgba(89,239,208,.1); color: var(--accent); }

/* Stage states */
.fq-empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.fq-empty-icon { font-size: 2.5rem; opacity: .25; margin-bottom: .75rem; }
.fq-empty-msg  { font-size: .82rem; }
.fq-error-banner {
  margin: .75rem 16px; padding: .65rem 1rem;
  background: rgba(248,81,73,.08); border: 1px solid rgba(248,81,73,.4);
  border-radius: 5px; font-size: .8rem; color: var(--error);
}
.fq-skeleton {
  height: 36px; background: rgba(89,239,208,.05); border-radius: 5px;
  margin: 8px 16px; animation: fq-pulse 1.4s ease-in-out infinite;
}
.fq-sk-wide { height: 48px; }
@keyframes fq-pulse { 0%,100%{opacity:.5} 50%{opacity:.15} }

/* Table view */
.fq-table-wrap { display: flex; gap: 16px; padding: 0 16px 16px; }
.fq-table {
  width: 100%; border-collapse: collapse;
  font-family: 'Space Mono', monospace; font-size: 11.5px;
}
.fq-table th {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(89,239,208,.12);
  font-family: 'Rajdhani', sans-serif; font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; cursor: pointer;
  white-space: nowrap; user-select: none;
}
.fq-table th:hover { color: var(--text); }
.fq-table th.r, .fq-table td.r { text-align: right; }
.fq-table td {
  padding: 9px 10px; border-bottom: 1px solid rgba(89,239,208,.04); color: var(--muted);
}
.fq-table tbody tr.fq-tr:hover td { background: rgba(89,239,208,.05); cursor: pointer; }
.fq-td-src  { color: #58e7ff; }
.fq-cell-sub {
  display: block; font-size: 10px; color: var(--muted);
  font-weight: 400; margin-top: 2px; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.fq-drill {
  display: inline-block; width: 0; overflow: hidden; opacity: 0;
  color: var(--accent); font-size: 12px; vertical-align: baseline;
  transition: opacity .12s, width .12s, margin .12s;
}
.fq-table tbody tr.fq-tr:hover .fq-drill { opacity: 1; width: 14px; margin-right: 2px; }
.fq-td-dst  { color: var(--text); }
.fq-td-bytes{ color: var(--accent); }
.fq-bar-wrap {
  display: inline-block; width: 56px; height: 5px;
  background: rgba(89,239,208,.08); border-radius: 999px; overflow: hidden;
  vertical-align: middle; margin-right: 6px;
}
.fq-bar-fill { height: 100%; background: linear-gradient(90deg,var(--accent),rgba(89,239,208,.4)); }
.fq-raw-row { display: none; }
.fq-raw-row.open { display: table-row; }
.fq-raw-cell { padding: 8px 12px 12px 12px !important; }
.fq-raw-block {
  font-family: 'Space Mono', monospace; font-size: 10px; color: var(--muted);
  background: rgba(4,13,17,.9); border: 1px solid rgba(89,239,208,.1);
  border-radius: 5px; padding: 10px 14px; line-height: 1.9; white-space: pre-wrap;
}
.fq-raw-k { color: #58e7ff; }
.fq-raw-v { color: var(--text); }
.fq-expand-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 4px; }
.fq-expand-btn:hover { color: var(--accent); }

/* Direction badge (table) */
.fq-dir-badge {
  display: inline-block; font-family: 'Space Mono', monospace; font-size: 9.5px;
  font-weight: 600; padding: 2px 6px; border-radius: 3px; white-space: nowrap;
  letter-spacing: .02em;
}
.fq-dir-dl      { color: #59efd0; background: rgba(89,239,208,.12); }
.fq-dir-ul      { color: #58e7ff; background: rgba(88,231,255,.12); }
.fq-dir-onnet   { color: var(--muted); background: rgba(255,255,255,.05); }
.fq-dir-transit { color: rgba(139,148,158,.6); background: transparent; }

/* Peers view: balance bar (download share vs upload share + total width) */
.fq-bal {
  display: flex; height: 7px; width: 100%; max-width: 160px;
  border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05);
}
.fq-bal-dl { background: #59efd0; }
.fq-bal-ul { background: #58e7ff; }
.fq-bal-w  { height: 2px; margin-top: 3px; background: rgba(89,239,208,.25); border-radius: 999px; max-width: 160px; }
.fq-peers-table { width: 100%; }

/* Share-of-total column (Partners view) */
.fq-share { display: flex; align-items: center; gap: 9px; }
.fq-share-pct {
  font-family: 'Space Mono', monospace; font-size: 11px; color: var(--accent);
  min-width: 44px; text-align: right; flex-shrink: 0;
}
.fq-share-track {
  flex: 1; max-width: 140px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.05); overflow: hidden;
}
.fq-share-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), rgba(89,239,208,.4)); }

/* Peers view dimension toggle */
.fq-peers-dim { display: flex; gap: 2px; margin-bottom: 10px; }
.fq-peers-dim button {
  font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 600;
  padding: 5px 12px; border: 1px solid rgba(89,239,208,.18); background: transparent;
  color: var(--muted); cursor: pointer; transition: all .12s;
}
.fq-peers-dim button:first-child { border-radius: 4px 0 0 4px; }
.fq-peers-dim button:last-child  { border-radius: 0 4px 4px 0; border-left: none; }
.fq-peers-dim button.on { color: var(--accent); background: rgba(89,239,208,.12); border-color: rgba(89,239,208,.4); }

/* Peer / Uplink selector (filter panel) */
.fq-peer-select {
  width: 100%; max-width: 320px; cursor: pointer; color-scheme: dark;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 26px;
}
.fq-peer-select option { background: var(--bg); color: var(--text); }
.fq-donut-empty { font-family: 'Space Mono', monospace; font-size: 10.5px; color: var(--muted); text-align: center; padding: 30px 8px; }

/* kind chip (uplink rows) */
.fq-kind-chip {
  display: inline-block; font-size: 8.5px; font-weight: 600; padding: 1px 5px;
  border-radius: 3px; margin-left: 6px; vertical-align: middle; letter-spacing: .03em;
}
.fq-kind-onnet { color: var(--muted);  background: rgba(255,255,255,.06); }
.fq-kind-peer  { color: #59efd0; background: rgba(89,239,208,.12); }
.fq-kind-ix    { color: #d8b25a; background: rgba(216,178,90,.12); }

/* Donut panel */
.fq-donut-panel {
  width: 320px; flex-shrink: 0;
  border: 1px solid rgba(89,239,208,.1); border-radius: 7px;
  padding: 14px 16px; background: rgba(11,32,40,.5);
}
.fq-donut-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.fq-donut-head .fq-panel-head { margin-bottom: 0; }
.fq-donut-toggle { display: flex; gap: 2px; flex-shrink: 0; }
.fq-donut-toggle button {
  font-family: 'Space Mono', monospace; font-size: 9px; font-weight: 600;
  padding: 3px 7px; border: 1px solid rgba(89,239,208,.18); background: transparent;
  color: var(--muted); cursor: pointer; border-radius: 3px; transition: all .12s; white-space: nowrap;
}
.fq-donut-toggle button.on { color: var(--accent); background: rgba(89,239,208,.12); border-color: rgba(89,239,208,.4); }
.fq-panel-head {
  font-family: 'Rajdhani', sans-serif; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
#fq-donut-svg { display: block; margin: 0 auto 10px; }
.fq-donut-legend { font-family: 'Space Mono', monospace; font-size: 12px; }
.fq-dl-row { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px solid rgba(89,239,208,.06); }
.fq-dl-row:last-child { border-bottom: none; }
.fq-dl-dot { margin-top: 4px; }
.fq-dl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.fq-dl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fq-dl-asn  { font-size: 13px; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-dl-org  { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-dl-pct  { color: var(--accent); font-size: 13px; font-weight: 600; min-width: 46px; text-align: right; flex-shrink: 0; align-self: center; }

/* Sankey view */
.fq-sankey-svg { display: block; height: 340px; }

/* Timeline view */
#fq-timeline-svg-rate, #fq-timeline-svg-vol { display: block; height: 160px; width: 100%; }
.fq-timeline-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 4px 4px; }
.fq-tl-grid { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 18px; align-items: start; }
.fq-tl-cell { min-width: 0; }
.fq-tl-divider { width: 1px; background: rgba(89,239,208,.12); align-self: stretch; }
.fq-tl-title {
  font-family: 'Rajdhani', sans-serif; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
@media (max-width: 860px) {
  .fq-tl-grid { grid-template-columns: 1fr; }
  .fq-tl-divider { display: none; }
}
.fq-tl-item { display: flex; align-items: center; gap: 5px; font-family: 'Space Mono', monospace; font-size: 10px; color: var(--muted); }
.fq-tl-swatch { width: 20px; height: 3px; border-radius: 2px; }

/* Cards view */
.fq-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 10px; padding: 0 16px 16px; }
.fq-card {
  background: rgba(10,29,37,.8); border: 1px solid rgba(89,239,208,.1);
  border-radius: 7px; padding: 13px; transition: .13s;
}
.fq-card:hover { border-color: rgba(89,239,208,.28); }
.fq-card-pair { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-family: 'Space Mono', monospace; font-size: 11px; }
.fq-card-src { color: #58e7ff; } .fq-card-dst { color: var(--accent); }
.fq-card-sub { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; }
.fq-card-body { display: flex; align-items: center; gap: 12px; }
.fq-card-nums { flex: 1; }
.fq-card-big { font-family: 'Space Mono', monospace; font-size: 19px; color: var(--accent); line-height: 1; }
.fq-card-big .fq-u { font-size: 11px; color: var(--muted); }
.fq-card-ln { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--muted); margin-top: 4px; }
.fq-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(89,239,208,.06);
  font-family: 'Space Mono', monospace; font-size: 9.5px; color: var(--muted);
}

/* Peering (Networks & Uplinks) screen */
.peer-insight { font-size: .78rem; color: var(--muted); margin: .35rem 0 .6rem; }
.peer-badge {
  display: inline-block; font-size: .62rem; font-weight: 600; padding: 1px 6px;
  border-radius: 3px; margin-left: 4px; vertical-align: middle; letter-spacing: .02em;
}
.peer-badge-cdn     { background: rgba(88,231,255,.15);  color: #58e7ff; }
.peer-badge-ix      { background: rgba(78,205,149,.15);  color: #4ecd95; }
.peer-badge-transit { background: rgba(230,175,60,.15);  color: #e6af3c; }
.peer-badge-cust    { background: rgba(169,139,255,.15); color: #a98bff; }
