.lab-profiles-page .lab-profiles-header {
  margin-bottom: 1rem;
}

.lab-profiles-page .lab-profiles-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.lab-profiles-page.lab-sandbox-page .lab-profiles-header p {
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.lab-profiles-page.lab-sandbox-page .lab-profiles-header a {
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.lab-profiles-page.lab-sandbox-page .lab-profiles-header a:hover {
  color: #fde047;
}

.lab-profiles-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 992px) {
  .lab-profiles-layout {
    grid-template-columns: 1fr;
  }
}

.lab-profiles-list {
  max-height: calc(100vh - 12rem);
  overflow: auto;
}

.lab-profiles-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
}

.lab-profiles-list button:hover {
  background: rgba(3, 105, 161, 0.08);
}

.lab-profiles-list button.is-active {
  background: #e0f2fe;
  font-weight: 600;
}

html[data-theme="dark"] .lab-profiles-list button.is-active {
  background: rgba(3, 105, 161, 0.25);
}

.lab-profiles-list .profile-key {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
}

.lab-profiles-editor table {
  width: 100%;
  font-size: 0.8125rem;
}

.lab-profiles-editor th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.lab-profiles-editor td {
  vertical-align: middle;
}

.lab-profiles-editor input[type="number"] {
  min-width: 5.5rem;
  max-width: 7rem;
}

.lab-profiles-editor .norm-calc-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
}

.lab-profiles-editor .norm-source-badge {
  display: inline-block;
  font-size: 0.62rem;
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  margin-right: 0.2rem;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lab-profiles-editor .norm-source-badge--db {
  background: #f1f5f9;
  color: #475569;
}

.lab-profiles-editor .norm-source-badge--racion {
  background: #fef3c7;
  color: #b45309;
}

.lab-profiles-editor .norm-source-badge--derived {
  background: #ede9fe;
  color: #6d28d9;
}

.lab-profiles-editor .norm-source-badge--fallback,
.lab-profiles-editor .norm-source-badge--stored {
  background: #dcfce7;
  color: #15803d;
}

.lab-profiles-editor .norm-source-badge--gfe {
  background: #e0f2fe;
  color: #0369a1;
}

.lab-profiles-editor .norm-source-badge--empty {
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
}

.lab-profiles-source-cell {
  white-space: nowrap;
}

.lab-profiles-norms-summary strong {
  font-weight: 600;
}

html[data-theme="dark"] .lab-profiles-editor .norm-calc-badge {
  background: rgba(29, 78, 216, 0.25);
  color: #93c5fd;
}

.lab-profiles-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.lab-profiles-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.lab-profiles-table-wrap {
  max-height: calc(100vh - 18rem);
  overflow: auto;
}

.lab-profiles-gfe {
  font-size: 0.8125rem;
}

.lab-profiles-gfe strong {
  font-weight: 600;
}

.lab-profiles-seed {
  font-size: 0.8125rem;
}

.lab-profiles-seed select {
  max-width: 100%;
}

.lab-heisenberg-prime .lab-profiles-list button:hover {
  background: rgba(0, 200, 255, 0.1);
  color: #f8fafc;
}

.lab-heisenberg-prime .lab-profiles-list button.is-active {
  background: rgba(253, 224, 71, 0.15);
  color: var(--lab-prime-yellow, #fde047);
  box-shadow: inset 0 0 0 1px rgba(253, 224, 71, 0.3);
}

.lab-heisenberg-prime .lab-profiles-list .profile-key {
  color: #94a3b8;
}

.lab-heisenberg-prime .lab-profiles-editor th {
  color: var(--lab-prime-crystal, #00c8ff);
}

.lab-heisenberg-prime .lab-profiles-editor .norm-calc-badge {
  background: rgba(0, 200, 255, 0.15);
  color: var(--lab-prime-crystal, #00c8ff);
}

.lab-heisenberg-prime .lab-profiles-editor .norm-source-badge--racion {
  background: rgba(253, 224, 71, 0.2);
  color: var(--lab-prime-yellow, #fde047);
}

.lab-heisenberg-prime .lab-profiles-editor .norm-source-badge--derived {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.lab-heisenberg-prime .lab-profiles-editor .norm-source-badge--fallback,
.lab-heisenberg-prime .lab-profiles-editor .norm-source-badge--stored {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.lab-heisenberg-prime .lab-profiles-editor .norm-source-badge--db {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
