.portal-components {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 84rem;
  margin: 0 auto;
}

/* Header */
.portal-components__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-components__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  color: var(--color-text-1);
}

.portal-components__sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-3);
  max-width: 46rem;
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  Catalogue grid                                                           */
/* ──────────────────────────────────────────────────────────────────────── */

.portal-components__grid,
.portal-components__grid-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.portal-components__card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  height: 100%;
}

/* Locked cards read as available-but-gated: dimmed, never disabled. */
.portal-components__card.is-locked {
  opacity: 0.7;
}

.portal-components__card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-components__card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.portal-components__lock {
  margin-left: auto;
  font-size: 0.875rem;
  line-height: 1;
}

.portal-components__card-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-3);
  flex: 1;
}

.portal-components__card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.portal-components__price {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.portal-components__pkg {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-components__frameworks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  Detail modal                                                             */
/* ──────────────────────────────────────────────────────────────────────── */

.portal-components__modal-title {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.portal-components__modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

/* Live-preview sandbox placeholder */
.portal-components__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 9rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--color-border-strong, var(--color-border));
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(
    45deg,
    var(--color-bg-subtle),
    var(--color-bg-subtle) 10px,
    var(--color-surface) 10px,
    var(--color-surface) 20px
  );
}

.portal-components__preview-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-blue);
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-blue-light);
}

.portal-components__preview-note {
  font-size: 0.75rem;
  color: var(--color-text-4);
}

.portal-components__tabs {
  margin-bottom: 1rem;
}

.portal-components__tab-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 12rem;
}

.portal-components__overview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-components__overview-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-2);
}

.portal-components__code {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-components__stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
}

@media (max-width: 48rem) {
  .portal-components__stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portal-components__pricing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-components__pricing-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-3);
}

/* Props table cells */
.portal-components__prop-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.portal-components__prop-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-blue);
}

.portal-components__prop-desc {
  font-size: 0.8125rem;
  color: var(--color-text-3);
}

.portal-components__muted {
  font-size: 0.8125rem;
  color: var(--color-text-4);
}
