/* Enrichment Studio — recipe gallery + canvas polish (SCI tokens) */

.enr-studio {
  --enr-rail: color-mix(in srgb, var(--accent2, #4f8ef7) 55%, transparent);
  --enr-card-bg: color-mix(in srgb, var(--bg0, #0a132f) 88%, #1a2744);
  --enr-card-border: color-mix(in srgb, var(--border, #2a3a5c) 80%, var(--accent2, #4f8ef7));
}

.enr-studio-hero {
  padding: 16px 18px;
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--accent2, #4f8ef7) 22%, transparent), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--bg0, #0a132f) 92%, #152238), var(--bg0, #0a132f));
  border: 1px solid var(--border, #2a3a5c);
  margin-bottom: 14px;
  animation: enr-fade-up 0.45s ease-out both;
}

.enr-studio-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.enr-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.enr-recipe-card {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: var(--enr-card-bg);
  border: 1px solid var(--enr-card-border);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: enr-fade-up 0.5s ease-out both;
  overflow: hidden;
}

.enr-recipe-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent2, #4f8ef7);
  opacity: 0.85;
}

.enr-recipe-card:nth-child(1) { animation-delay: 0.04s; }
.enr-recipe-card:nth-child(2) { animation-delay: 0.08s; }
.enr-recipe-card:nth-child(3) { animation-delay: 0.12s; }
.enr-recipe-card:nth-child(4) { animation-delay: 0.16s; }
.enr-recipe-card:nth-child(5) { animation-delay: 0.2s; }
.enr-recipe-card:nth-child(6) { animation-delay: 0.24s; }

.enr-recipe-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent2, #4f8ef7) 55%, var(--border, #2a3a5c));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.enr-recipe-card:active {
  transform: translateY(-1px) scale(0.99);
}

.enr-recipe-card__title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 6px;
}

.enr-recipe-card__desc {
  font-size: 12px;
  opacity: 0.78;
  line-height: 1.4;
  margin: 0 0 10px;
  min-height: 2.8em;
}

.enr-recipe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.enr-recipe-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border, #2a3a5c);
  opacity: 0.9;
}

.enr-studio-shell .pipe-wb-flow-host {
  min-height: min(70vh, 620px) !important;
  height: min(70vh, 620px) !important;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--border, #2a3a5c);
  background:
    radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--accent2, #4f8ef7) 8%, transparent), transparent 50%),
    color-mix(in srgb, var(--bg0, #0a132f) 96%, #101a30);
  overflow: hidden;
}

.enr-studio-shell .pipe-wb-flow-host > div,
.enr-studio-shell .pipe-wb-flow-host .react-flow {
  min-height: 100% !important;
  height: 100% !important;
  width: 100% !important;
}

.enr-studio-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enr-studio-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.enr-studio-toolbar__row .sci-select,
.enr-studio-toolbar__row .mantine-Select-root {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 320px;
}

.enr-studio-toolbar__name {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 360px;
}

.enr-palette-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

.enr-palette-bar__label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.enr-palette-bar .mantine-Select-root,
.enr-palette-bar .Select,
.enr-palette-bar .sci-select {
  min-width: 180px;
  flex: 1 1 200px;
  max-width: 280px;
}

.enr-studio-shell .react-flow__node {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.enr-studio-shell .react-flow__node.selected {
  transform: scale(1.03);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent2, #4f8ef7) 55%, transparent);
}

.enr-run-rail {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, #2a3a5c);
  background: color-mix(in srgb, var(--bg0, #0a132f) 90%, #152238);
  animation: enr-fade-up 0.35s ease-out both;
}

.enr-run-rail--live {
  border-color: color-mix(in srgb, var(--accent2, #4f8ef7) 45%, var(--border, #2a3a5c));
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent2, #4f8ef7) 12%, transparent);
}

.enr-result-stage {
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
  font-size: 12px;
}

.enr-col-banner {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a3a5c);
  font-size: 12px;
}

.enr-col-banner__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.enr-col-banner__row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.enr-col-chip {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border, #2a3a5c);
}

.enr-col-chip--ok {
  border-color: #3dba7a;
  color: #3dba7a;
}

.enr-col-chip--missing {
  border-color: #d9785a;
  color: #d9785a;
}

.enr-col-chip--soft {
  opacity: 0.85;
}

.enr-tool-card {
  border: 1px solid var(--border, #2a3a5c);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: transparent;
}

.enr-tool-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.enr-tool-card__title {
  font-weight: 600;
  font-size: 13px;
}

.enr-tool-card__badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border, #2a3a5c);
  opacity: 0.9;
}

.enr-tool-card__io {
  margin-top: 8px;
}

.enr-tool-card__io-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.enr-tool-card__io-row label {
  min-width: 110px;
  font-weight: 500;
}

.enr-step-modal-body {
  max-height: min(65vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

@keyframes enr-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .enr-recipe-card,
  .enr-studio-hero,
  .enr-run-rail {
    animation: none;
  }
  .enr-recipe-card:hover {
    transform: none;
  }
}

.enr-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.enr-overview-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--enr-card-border, #2a3a5c);
  background: var(--enr-card-bg, transparent);
  min-height: 88px;
}

.enr-overview-card__title {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.enr-overview-card__status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.enr-overview-card--ok .enr-overview-card__status {
  color: #3dba7a;
}

.enr-overview-card--missing .enr-overview-card__status,
.enr-overview-card--error .enr-overview-card__status {
  color: #d9785a;
}

.enr-overview-card__value {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 6px;
  word-break: break-word;
}

.enr-overview-card__msg {
  font-size: 11px;
  margin-top: 4px;
}

.enr-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.enr-overview-table th,
.enr-overview-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border, #2a3a5c);
}

.enr-lib-tool-meta {
  line-height: 1.45;
}

.enr-lib-modal-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding-right: 4px;
}

.enr-lib-field {
  margin-bottom: 12px;
}

.enr-lib-field__label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.enr-lib-field-help {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
  line-height: 1.35;
}

.enr-lib-field-example {
  font-size: 11px;
  margin-bottom: 6px;
}

.enr-lib-advanced {
  margin-top: 8px;
  font-size: 12px;
}

.enr-lib-advanced summary {
  cursor: pointer;
  margin-bottom: 6px;
}

.enr-lib-list-panel {
  min-height: 220px;
}

.enr-lib-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}

.enr-lib-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border, #2a3a5c);
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.enr-lib-card:hover {
  border-color: var(--accent, #4c7fff);
  background: rgba(76, 127, 255, 0.06);
}

.enr-lib-card__title {
  font-weight: 600;
  font-size: 13px;
}

.enr-lib-card__sub {
  font-size: 11px;
  margin-top: 2px;
  word-break: break-all;
}

.enr-lib-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.enr-lib-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border, #2a3a5c);
  opacity: 0.9;
}
