@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.meshcore-stream-status-text {
  color: var(--app-text);
  font-weight: 500;
}

.meshcore-view-switch {
  .btn {
    border-color: rgba(173, 205, 255, 0.45);
    color: var(--app-text);
  }

  .btn.btn-primary {
    background: rgba(90, 146, 255, 0.5);
    border-color: rgba(173, 205, 255, 0.75);
  }

  .btn:hover,
  .btn:focus {
    color: #ffffff;
    border-color: rgba(225, 237, 255, 0.8);
  }
}



.meshcore-node-type-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem !important;
  border: none !important;
}

.meshcore-node-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  svg {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    background-color: transparent;
  }
}




.meshcore-filters {
  background: rgba(13, 36, 82, 0.6);
  padding: 0.75rem !important;
}

.meshcore-filter-dropdown {
  .meshcore-dropdown-toggle {
    border-color: rgba(173, 205, 255, 0.35) !important;
    color: var(--app-text) !important;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem !important;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;

    &:hover,
    &:focus {
      background: rgba(90, 146, 255, 0.2) !important;
      border-color: rgba(173, 205, 255, 0.6) !important;
      color: #ffffff !important;
    }

    svg {
      width: 1rem;
      height: 1rem;
      transition: transform 0.2s ease;
    }

    &[aria-expanded='true'] svg {
      transform: rotate(180deg);
    }
  }

  .meshcore-dropdown-menu {
    background: rgba(8, 24, 56, 0.95);
    border-color: rgba(173, 205, 255, 0.25);
    min-width: 200px;

    .meshcore-dropdown-item {
      padding: 0.5rem 1rem;
      color: var(--app-text);

      &:hover {
        background: rgba(90, 146, 255, 0.2);
      }

      .form-check {
        margin-bottom: 0;
      }

      .form-check-input {
        background: rgba(8, 24, 56, 0.8);
        border-color: rgba(173, 205, 255, 0.3);
        cursor: pointer;

        &:checked {
          background: rgba(90, 146, 255, 0.6);
          border-color: rgba(173, 205, 255, 0.75);
        }

        &:focus {
          border-color: rgba(173, 205, 255, 0.5);
          box-shadow: 0 0 0 0.25rem rgba(90, 146, 255, 0.25);
        }
      }

      .form-check-label {
        color: var(--app-text);
        cursor: pointer;
        margin-bottom: 0;
      }
    }

    .dropdown-divider {
      border-color: rgba(173, 205, 255, 0.2);
    }
  }
}

.meshcore-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.25rem;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(173, 205, 255, 0.05);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(173, 205, 255, 0.2);
    border-radius: 3px;

    &:hover {
      background: rgba(173, 205, 255, 0.4);
    }
  }
}

.meshcore-filter-check {
  font-size: 0.875rem;

  .form-check-input {
    background: rgba(8, 24, 56, 0.8);
    border-color: rgba(173, 205, 255, 0.25);
    cursor: pointer;

    &:checked {
      background: rgba(90, 146, 255, 0.6);
      border-color: rgba(173, 205, 255, 0.75);
    }

    &:focus {
      border-color: rgba(173, 205, 255, 0.5);
      box-shadow: 0 0 0 0.25rem rgba(90, 146, 255, 0.25);
    }
  }

  .form-check-label {
    color: var(--app-text);
    cursor: pointer;
    margin-bottom: 0;
  }
}





.data-table {
  &.table-hover > tbody > tr:hover .meshcore-hash-button,
  &.table-hover > tbody > tr:hover .meshcore-expand-button {
    color: #f2f7ff;
  }

  tr.is-selected .meshcore-hash-button,
  tr.is-selected .meshcore-hash-button:hover {
    color: var(--app-accent-yellow);
  }

  td.meshcore-node-type-cell {
    border-bottom: transparent !important;
  }

  tr.meshcore-packet-green td:nth-child(4) svg {
    color: #22c55e !important;
  }

  tr.meshcore-packet-green td:nth-child(5) {
    color: #22c55e;
    font-weight: 500;
  }

  tr.meshcore-packet-purple td:nth-child(4) svg {
    color: #a855f7 !important;
  }

  tr.meshcore-packet-purple td:nth-child(5) {
    color: #a855f7;
    font-weight: 500;
  }

  tr.meshcore-packet-amber td:nth-child(4) svg {
    color: #f59e0b !important;
  }

  tr.meshcore-packet-amber td:nth-child(5) {
    color: #f59e0b;
    font-weight: 500;
  }
}

.meshcore-hash-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b8d1ff;
  font-family: monospace;
  padding: 0;

  &:hover {
    color: #f2f7ff;
    text-decoration: underline;
  }
}

.meshcore-expand-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b8d1ff;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease-in-out;

  &:hover {
    color: #f2f7ff;
  }

  svg {
    transition: transform 0.2s ease-in-out;
  }
}

.meshcore-duplicate-badge {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b8d1ff;
  background: rgba(102, 157, 255, 0.16);
  border: 1px solid rgba(173, 205, 255, 0.25);
  border-radius: 0.25rem;
}

.meshcore-duplicate-row {
  td {
    border-color: rgba(173, 205, 255, 0.08);
    background: rgba(13, 36, 82, 0.2);
    font-size: 0.875rem;
    color: var(--app-text-muted);
  }
}

.meshcore-detail-stack {
  overflow-y: auto;
  padding-right: 0.25rem;
}

.meshcore-wire-subtitle {
  color: var(--app-text-muted);
  font-size: 0.85rem;
}

.meshcore-ws-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.meshcore-ws-panel {
  border: 1px solid rgba(173, 205, 255, 0.25);
  background: rgba(8, 24, 56, 0.45);
  border-radius: 0.375rem;
  overflow: hidden;
}

.meshcore-ws-panel-title {
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--app-text-muted);
  background: rgba(13, 36, 82, 0.45);
  border-bottom: 1px solid rgba(173, 205, 255, 0.2);
  padding: 0.35rem 0.55rem;
}

.meshcore-ws-tree {
  margin: 0;
  padding: 0.55rem 0.7rem 0.7rem 1.15rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--app-text);

  ul {
    margin: 0.2rem 0 0.2rem 0.95rem;
    padding-left: 0.75rem;
  }

  li {
    margin: 0.15rem 0;
  }

  code {
    color: #b8d1ff;
  }
}

.meshcore-ws-node {
  color: #d7e7ff;
}

.meshcore-bit-art {
  margin: 0.25rem 0 0;
  padding: 0.35rem 0.5rem;
  background: rgba(13, 36, 82, 0.35);
  border: 1px solid rgba(173, 205, 255, 0.2);
  border-radius: 0.25rem;
  color: #b8d1ff;
  font-family: monospace;
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: pre;
  overflow-x: auto;
}

.meshcore-bitart-toggle {
  appearance: none;
  border: 1px solid rgba(173, 205, 255, 0.35);
  background: rgba(13, 36, 82, 0.3);
  color: var(--app-text);
  border-radius: 0.25rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;

  &:hover,
  &:focus {
    border-color: rgba(173, 205, 255, 0.65);
    background: rgba(90, 146, 255, 0.2);
    color: #ffffff;
  }
}

.meshcore-ws-legend {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.5rem 0.6rem 0;
  font-size: 0.75rem;
  color: var(--app-text-muted);

  span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
  }
}

.meshcore-ws-chip {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  border: 1px solid rgba(173, 205, 255, 0.35);
}

.meshcore-ws-hexdump {
  padding: 0.45rem 0.55rem 0.65rem;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--app-text);
  overflow-x: auto;
}

.meshcore-ws-hexdump-row {
  display: grid;
  grid-template-columns: 44px minmax(420px, 1fr) 150px;
  gap: 0.5rem;
  align-items: center;
  line-height: 1.35;
  white-space: nowrap;
}

.meshcore-ws-offset {
  color: #82aeff;
}

.meshcore-ws-bytes,
.meshcore-ws-ascii {
  display: inline-flex;
  gap: 0.15rem;
}

.meshcore-ws-byte,
.meshcore-ws-char {
  display: inline-block;
  text-align: center;
  border-radius: 2px;
}

.meshcore-ws-byte {
  min-width: 1.35rem;
}

.meshcore-ws-char {
  min-width: 0.65rem;
}

.meshcore-ws-byte-empty {
  opacity: 0.35;
}

.meshcore-ws-zone-header {
  background: rgba(90, 146, 255, 0.2);
}

.meshcore-ws-zone-path {
  background: rgba(168, 85, 247, 0.2);
}

.meshcore-ws-zone-payload {
  background: rgba(34, 197, 94, 0.2);
}

.meshcore-fact-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 4px 0;
}

.meshcore-fact-label {
  color: var(--app-text-muted);
}

.meshcore-fact-value {
  color: var(--app-text);
  word-break: break-all;
}

.meshcore-message-item {
  padding: 0.75rem;
  border: 1px solid rgba(173, 205, 255, 0.12);
  border-radius: 0.375rem;
  background: rgba(13, 36, 82, 0.3);
  color: var(--app-text);
}

.meshcore-message-sender {
  color: #b8d1ff;
}

.meshcore-message-text {
  color: var(--app-text);
  word-break: break-word;
  line-height: 1.5;
}

.meshcore-hash-code {
  font-family: monospace;
  color: #82aeff;
  font-size: 0.8125rem;
  word-break: break-all;
}

.meshcore-map-view {
  min-height: 0;
}

.meshcore-map-canvas {
  position: relative;
  width: 100%;
  min-height: 220px;
  border: 1px solid rgba(173, 205, 255, 0.25);
  border-radius: 0.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(130, 174, 255, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(13, 35, 79, 0.9), rgba(8, 24, 56, 0.9));
  overflow: hidden;
}

.meshcore-map-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a8c9ff;
  box-shadow: 0 0 10px rgba(168, 201, 255, 0.9);
  transform: translate(-50%, -50%);
}
