:host {
  display: block;
}

.app-layout-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--space-sm, 0.5rem);
}

.app-layout-picker__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs, 0.25rem);
  padding: var(--space-sm, 0.5rem);
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e4e4e7);
  border-radius: var(--radius-lg, 10px);
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary, #1f322d);
  transition: border-color var(--transition-fast, 120ms ease),
    box-shadow var(--transition-fast, 120ms ease);

  &:hover:not(:disabled) {
    border-color: var(--primary-color, #2f6e5d);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
  }

  &:focus-visible {
    outline: 2px solid var(--primary-color, #2f6e5d);
    outline-offset: 2px;
  }

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

.app-layout-picker__card--selected {
  border-color: var(--primary-color, #2f6e5d);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #2f6e5d) 20%, transparent);
  background: color-mix(in srgb, var(--primary-color, #2f6e5d) 6%, var(--bg-primary, #fff));
}

.app-layout-picker__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md, 6px);
  background: var(--bg-secondary, #f4f4f5);
  color: var(--text-secondary, #6b7280);
}

.app-layout-picker__card--selected .app-layout-picker__preview {
  color: var(--primary-color, #2f6e5d);
}

.app-layout-picker__label {
  font-size: var(--font-size-xs, 0.75rem);
  text-align: center;
  line-height: var(--line-height-normal, 1.5);
}

.app-layout-picker__desc {
  margin: var(--space-xs, 0.25rem) 0 0;
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--text-secondary, #6b7280);
}

@media (prefers-reduced-motion: reduce) {
  .app-layout-picker__card {
    transition: none;
  }
}
