.ls-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--tg-badge-bg);
  color: var(--tg-variant);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.ls-pending::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ls-pending[data-state="pending"] {
  background: rgba(var(--tg-accent-rgb), 0.1);
  color: var(--tg-accent);
}

.ls-hub,
.ls-device {
  position: absolute;
  border-radius: 14px;
  background: var(--tg-surface-card);
  border: 1px solid var(--tg-line);
  box-shadow: var(--tg-card-shadow);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease;
}

.ls-hub {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-color: rgba(var(--tg-accent-rgb), 0.4);
}

.ls-hub.is-receiving {
  box-shadow: 0 0 0 4px rgba(var(--tg-accent-rgb), 0.1),
    0 14px 28px -14px rgba(var(--tg-accent-rgb), 0.55);
}

.ls-hub__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(var(--tg-accent-rgb), 0.1);
  color: var(--tg-accent);
}

.ls-hub__icon .ls-glyph {
  width: 22px;
  height: 22px;
}

.ls-hub__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.ls-hub__title {
  font-size: 0.9rem;
  font-weight: 600;
}

.ls-hub__provider {
  font-weight: 600;
  color: var(--tg-accent);
}

.ls-hub__caption {
  font-size: 0.72rem;
  color: var(--tg-muted);
}

.ls-glyph {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ls-device {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.8rem 0.9rem;
}

.ls-device[data-net="offline"] {
  background: var(--tg-node-blocked-bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ls-device__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ls-device__name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.ls-device__name .ls-glyph {
  color: var(--tg-variant);
}

.ls-net {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tg-muted);
  white-space: nowrap;
}

.ls-net__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9e3c6;
  box-shadow: inset 0 0 0 1.5px #4caf72;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

[data-net="offline"] .ls-net {
  color: #8f8a9c;
}

[data-net="offline"] .ls-net__dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #b3aec0;
}

[data-net="syncing"] .ls-net {
  color: var(--tg-accent);
}

[data-net="syncing"] .ls-net__dot {
  background: var(--tg-accent);
  box-shadow: 0 0 0 0 rgba(var(--tg-accent-rgb), 0.5);
  animation: tg-live 1s ease-out infinite;
}

.ls-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--tg-ink);
}

.ls-task {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 -0.4rem;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.ls-task .tg-icon {
  width: 15px;
  height: 15px;
}

.ls-task.is-changed {
  animation: ls-changed 1.4s ease-out;
}

.ls-task__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.35s ease;
}

.ls-task[data-state="done"] .ls-task__title {
  color: var(--tg-outline);
  text-decoration: line-through;
  text-decoration-color: rgba(163, 158, 174, 0.6);
}

.ls-device__foot {
  font-size: 0.72rem;
  color: var(--tg-muted);
  white-space: nowrap;
}

.ls-edge__line {
  fill: none;
  stroke: var(--tg-edge-base);
  stroke-width: 1.5;
  transition: stroke 0.3s ease, opacity 0.3s ease;
}

.ls-edge[data-net="offline"] .ls-edge__line {
  stroke-dasharray: 4 5;
  opacity: 0.7;
}

.ls-edge.is-flowing .ls-edge__line {
  stroke: rgba(var(--tg-accent-rgb), 0.55);
  stroke-width: 2;
}

.ls-edge .tg-port {
  opacity: 1;
}

.ls-edge[data-net="offline"] .tg-port {
  opacity: 0.4;
}

.ls-edge.is-flowing .tg-port {
  fill: var(--tg-accent);
  stroke: var(--tg-surface);
}

.ls-edge.is-flowing .tg-edge__head {
  opacity: 1;
}

.ls.is-complete .ls-hub {
  border-color: rgba(var(--tg-accent-rgb), 0.7);
}

.ls-swatch {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.ls-swatch--data {
  background: var(--tg-accent);
  box-shadow: 0 0 0 3px rgba(var(--tg-accent-rgb), 0.18);
}

.ls-swatch--signal {
  box-shadow: inset 0 0 0 1.5px var(--tg-outline);
}

@keyframes ls-changed {
  0% {
    background: rgba(var(--tg-accent-rgb), 0.16);
  }
  100% {
    background: rgba(var(--tg-accent-rgb), 0);
  }
}

@media (max-width: 520px) {
  .ls .tg-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

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