.block-list { display: grid; gap: 10px; margin: 10px 0; }

.block-card {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border-color, #d3dad9);
  border-radius: var(--radius-sm);
  background: #fff;

  &.block-card--hidden { opacity: 0.6; }
  &.cdk-drag-preview { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
  &.cdk-drag-placeholder { opacity: 0.3; }
}

.block-card__handle {
  cursor: grab;
  color: var(--text-secondary, #6b7280);
  padding-top: 4px;
}

.block-card__preview {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary, #f7f8f8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl, 1.25rem);
  color: var(--primary-color, #2f8f5b);
}

.block-card__title-row { display: flex; align-items: center; gap: 8px; }
.block-card__desc { margin: 2px 0 8px; color: var(--text-secondary, #6b7280); font-size: var(--font-size-sm, 0.8125rem); }

.block-card__hidden-badge {
  font-size: var(--font-size-xs, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary, #6b7280);
  border: 1px solid var(--border-color, #d3dad9);
  border-radius: var(--radius-full, 999px);
  padding: 1px 8px;
}

.block-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;

  button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary, #6b7280);

    &:hover:not(:disabled) { color: var(--text-primary, #1e3c38); }

    &:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
  }
}

.block-card__visible-toggle { display: flex; align-items: center; gap: 6px; font-size: var(--font-size-sm, 0.8125rem); }
.block-card__remove:hover { color: var(--error-color, #c0392b); }

.block-catalog { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color, #d3dad9); }

.block-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.block-catalog__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px dashed var(--border-color, #d3dad9);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary, #f7f8f8);
  cursor: pointer;
  font-size: var(--font-size-sm, 0.8125rem);
  color: var(--text-primary, #1e3c38);

  .pi { font-size: var(--font-size-2xl, 1.25rem); color: var(--primary-color, #2f8f5b); }

  &:hover { border-color: var(--primary-color, #2f8f5b); background: #fff; }
  &:focus-visible { outline: 2px solid var(--primary-color, #2f8f5b); outline-offset: 2px; }
}

@media (max-width: 640px) {
  .block-card { grid-template-columns: auto 1fr; }
  .block-card__actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}
