:root {
  --entity-lab-ink: #e8f0ff;
  --entity-lab-soft: rgba(200, 219, 255, 0.8);
  --entity-lab-muted: rgba(179, 196, 230, 0.65);
  --entity-lab-border: rgba(255, 255, 255, 0.15);
  --entity-lab-card: rgba(8, 18, 43, 0.9);
  --entity-lab-surface: radial-gradient(circle at 35% 15%, rgba(52, 96, 219, 0.65), rgba(10, 14, 32, 0.95));
  --entity-lab-surface-alt: linear-gradient(145deg, rgba(7, 19, 43, 0.9), rgba(2, 6, 18, 0.95));
  --entity-lab-glow: rgba(71, 206, 255, 0.25);
  --entity-lab-pink: #ff8fbd;
  --entity-lab-teal: #6bd8c7;
  --entity-lab-orange: #ffbe6a;
  --entity-lab-radius: 1.45rem;
}

.entity-panel {
  padding: clamp(0.85rem, 1vw, 1.25rem);
  overflow: hidden;
}

.entity-panel > .entity-lab {
  height: 100%;
}

.entity-lab {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: var(--entity-lab-radius);
  padding: clamp(1.2rem, 2vw, 2rem);
  background: var(--entity-lab-surface);
  color: var(--entity-lab-ink);
  border: 1px solid var(--entity-lab-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 25px 55px rgba(0, 0, 0, 0.65);
  font-family: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  overflow-y: auto;
  min-height: 0;
  isolation: isolate;
}

.entity-lab__halo {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 70% -10%, rgba(255, 143, 189, 0.3), transparent 60%),
    radial-gradient(circle at 15% 0%, rgba(107, 216, 199, 0.4), transparent 50%);
  opacity: 0.8;
  filter: blur(45px);
  pointer-events: none;
  z-index: 0;
}

.entity-lab__hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.75rem);
  border-radius: calc(var(--entity-lab-radius) - 0.2rem);
  background: var(--entity-lab-surface-alt);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 25px rgba(109, 214, 191, 0.15);
}

.entity-lab__utility-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.entity-lab__quick-links {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.entity-lab__controls {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-left: auto;
}

.entity-lab__control {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(8, 16, 38, 0.65);
  color: var(--entity-lab-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.entity-lab__control:focus-visible,
.entity-lab__control:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.entity-lab__control--expand {
  background: rgba(107, 216, 199, 0.2);
  color: var(--entity-lab-ink);
  border-color: rgba(107, 216, 199, 0.5);
}

.entity-lab__control--expand[aria-pressed='true'] {
  background: rgba(255, 143, 189, 0.25);
  border-color: rgba(255, 143, 189, 0.45);
}

.entity-lab__control-icon {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-block;
}

.entity-lab__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--entity-lab-muted);
}

.entity-lab__name {
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.entity-lab__status-pill {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: rgba(107, 216, 199, 0.15);
  border: 1px solid rgba(107, 216, 199, 0.4);
  color: var(--entity-lab-soft);
  font-family: 'IBM Plex Mono', monospace;
}

.entity-lab__status-pill[data-state='active'] {
  background: rgba(107, 216, 199, 0.25);
  border-color: rgba(107, 216, 199, 0.65);
  color: #e7fff5;
}

.entity-lab__status-pill[data-state='inactive'] {
  background: rgba(255, 143, 189, 0.15);
  border-color: rgba(255, 143, 189, 0.55);
  color: #ffe8f1;
}

.entity-lab__lede {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--entity-lab-soft);
}

.entity-lab__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  position: relative;
  z-index: 1;
}

.entity-lab__card {
  border-radius: 1rem;
  padding: 1.15rem;
  background: rgba(8, 16, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.entity-lab__card--primary {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(107, 216, 199, 0.2), rgba(8, 16, 38, 0.85));
}

.entity-lab__card--stretch {
  min-height: 100%;
}

.entity-lab__card-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.entity-lab__card-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--entity-lab-muted);
}

.entity-lab__card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.entity-lab__card-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--entity-lab-soft);
}

.entity-lab__list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--entity-lab-soft);
}

.entity-lab__list li {
  position: relative;
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.4;
}

.entity-lab__list li::before {
  content: '';
  position: absolute;
  left: -1.2rem;
  top: 0.4rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.entity-lab__link {
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: var(--entity-lab-ink);
  font-size: 0.72rem;
  padding: 0.35rem 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.entity-lab__link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.entity-lab__link:hover:not(:disabled),
.entity-lab__link:focus-visible:not(:disabled) {
  border-color: rgba(107, 216, 199, 0.7);
  background: rgba(107, 216, 199, 0.15);
  color: #e7fff5;
}

@media (max-width: 900px) {
  .entity-lab__card--primary {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .entity-panel {
    padding: 0.35rem;
  }

  .entity-lab__controls {
    width: 100%;
    justify-content: space-between;
  }

  .entity-lab__utility-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
